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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3752508cc7ff7e3cf5be0dfd95855dace55897c2
| 78
|
py
|
Python
|
capsule/parser/__init__.py
|
0xFable/capsule
|
f8e52fad006c172fbd873308a5b498d97acb9b76
|
[
"MIT"
] | 8
|
2021-09-09T02:23:28.000Z
|
2022-03-17T20:54:55.000Z
|
ftx_cli/parser/__init__.py
|
PAV-Laboratory/ftx-cli-1
|
4ef587d7b8aecd476d788377faf0834facb9a82f
|
[
"MIT"
] | 19
|
2021-09-05T11:57:02.000Z
|
2022-01-29T22:22:21.000Z
|
ftx_cli/parser/__init__.py
|
PAV-Laboratory/ftx-cli-1
|
4ef587d7b8aecd476d788377faf0834facb9a82f
|
[
"MIT"
] | 1
|
2021-08-01T18:50:24.000Z
|
2021-08-01T18:50:24.000Z
|
from .parser import get_main_parser
from .parser import get_subcommmand_parser
| 39
| 42
| 0.884615
| 12
| 78
| 5.416667
| 0.5
| 0.307692
| 0.492308
| 0.584615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089744
| 78
| 2
| 42
| 39
| 0.915493
| 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
| 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
| 8
|
3784270a0f5684bd87889c5d03e8c61fdefd346b
| 182
|
py
|
Python
|
nl_project/data_layer/__init__.py
|
softwareunderground/northern-lights
|
dbb478a4fcefb6c02678722b23984bb733bcc2b1
|
[
"Apache-2.0"
] | 1
|
2021-04-17T09:13:20.000Z
|
2021-04-17T09:13:20.000Z
|
nl_project/data_layer/__init__.py
|
softwareunderground/northern-lights
|
dbb478a4fcefb6c02678722b23984bb733bcc2b1
|
[
"Apache-2.0"
] | null | null | null |
nl_project/data_layer/__init__.py
|
softwareunderground/northern-lights
|
dbb478a4fcefb6c02678722b23984bb733bcc2b1
|
[
"Apache-2.0"
] | 2
|
2021-04-17T13:40:38.000Z
|
2022-03-16T09:55:37.000Z
|
from .biostrat_file_interface import *
from .core_photo_interface import *
from .siesmic_data_interface import *
from .well_log_interface import *
from .core_desc_interface import *
| 30.333333
| 38
| 0.835165
| 25
| 182
| 5.68
| 0.48
| 0.528169
| 0.535211
| 0.323944
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.10989
| 182
| 5
| 39
| 36.4
| 0.876543
| 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
| 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
| 8
|
379aa494f6e0a4f5b4e8fe26036bd3b79da8facc
| 4,021
|
py
|
Python
|
neural_networks/keras/mixture.py
|
hwangyale/AlphaGomoku
|
7c85a71c710fa8d114b3591e4fd27c8649caccbb
|
[
"MIT"
] | 3
|
2018-10-30T07:07:40.000Z
|
2019-11-22T12:32:32.000Z
|
neural_networks/keras/mixture.py
|
hwangyale/AlphaGomoku
|
7c85a71c710fa8d114b3591e4fd27c8649caccbb
|
[
"MIT"
] | null | null | null |
neural_networks/keras/mixture.py
|
hwangyale/AlphaGomoku
|
7c85a71c710fa8d114b3591e4fd27c8649caccbb
|
[
"MIT"
] | null | null | null |
__all__ = ['ResNetMixture', 'UnitizedResNetMixture']
import keras.backend as K
import keras.layers as KL
import keras.engine as KE
import keras.initializers as KI
from ...global_constants import *
from ...board import Board
from .base import MixtureBase
from .layers import Unitization
from .models import get_resnet, get_unitized_resnet
AXIS = 1 if K.image_data_format() == 'channels_first' else -1
class ResNetMixture(MixtureBase):
def initialize_network(self, stack_nb, board_cls=Board, weight_decay=0.0005):
if not isinstance(board_cls, type) or not issubclass(board_cls, Board):
raise Exception('`board_cls` must be a class/subclass of `Board`')
board = Board(toTensor=True)
resnet_inputs, resnet_outputs = get_resnet(board.tensor.shape,
stack_nb, weight_decay)
tensor = KL.Conv2D(
filters=2,
kernel_size=(1, 1),
strides=(1, 1),
padding='same',
kernel_initializer=KI.he_normal(),
name='last_policy_convolution')(resnet_outputs)
tensor = KL.BatchNormalization(axis=AXIS, name='last_policy_batch_norm')(tensor)
tensor = KL.Activation(activation='relu', name='last_policy_relu')(tensor)
tensor = KL.Flatten(name='policy_flatten')(tensor)
distributions = KL.Dense(BOARD_SIZE**2, activation='softmax', name='distribution')(tensor)
tensor = KL.Conv2D(
filters=1,
kernel_size=(1, 1),
strides=(1, 1),
padding='same',
kernel_initializer=KI.he_normal(),
name='last_value_convolution')(resnet_outputs)
tensor = KL.BatchNormalization(axis=AXIS, name='last_value_batch_norm')(tensor)
tensor = KL.Activation(activation='relu', name='last_value_relu')(tensor)
tensor = KL.Flatten(name='value_flatten')(tensor)
tensor = KL.Dense(256, activation='relu', name='full_connected_layer')(tensor)
values = KL.Dense(1, activation='tanh', name='value')(tensor)
return KE.Model(resnet_inputs, [distributions, values],
name='resnet_{}_mixture'.format(6*stack_nb+2))
class UnitizedResNetMixture(MixtureBase):
def initialize_network(self, stack_nb, board_cls=Board, weight_decay=0.0005):
if not isinstance(board_cls, type) or not issubclass(board_cls, Board):
raise Exception('`board_cls` must be a class/subclass of `Board`')
board = Board(toTensor=True)
resnet_inputs, resnet_outputs = get_unitized_resnet(board.tensor.shape,
stack_nb, weight_decay)
tensor = KL.Conv2D(
filters=2,
kernel_size=(1, 1),
strides=(1, 1),
padding='same',
kernel_initializer=KI.he_normal(),
name='last_policy_convolution')(resnet_outputs)
tensor = Unitization(axis=AXIS, name='last_policy_unitization')(tensor)
tensor = KL.Activation(activation='relu', name='last_policy_relu')(tensor)
tensor = KL.Flatten(name='policy_flatten')(tensor)
distributions = KL.Dense(BOARD_SIZE**2, activation='softmax', name='distribution')(tensor)
tensor = KL.Conv2D(
filters=1,
kernel_size=(1, 1),
strides=(1, 1),
padding='same',
kernel_initializer=KI.he_normal(),
name='last_value_convolution')(resnet_outputs)
tensor = Unitization(axis=AXIS, name='last_value_unitization')(tensor)
tensor = KL.Activation(activation='relu', name='last_value_relu')(tensor)
tensor = KL.Flatten(name='value_flatten')(tensor)
tensor = KL.Dense(256, activation='relu', name='full_connected_layer')(tensor)
values = KL.Dense(1, activation='tanh', name='value')(tensor)
return KE.Model(resnet_inputs, [distributions, values],
name='unitized_resnet_{}_mixture'.format(6*stack_nb+2))
| 49.036585
| 98
| 0.638647
| 472
| 4,021
| 5.235169
| 0.211864
| 0.051801
| 0.067989
| 0.033994
| 0.851477
| 0.842574
| 0.842574
| 0.819911
| 0.819911
| 0.789154
| 0
| 0.016372
| 0.240487
| 4,021
| 81
| 99
| 49.641975
| 0.792731
| 0
| 0
| 0.72
| 0
| 0
| 0.152947
| 0.055956
| 0
| 0
| 0
| 0
| 0
| 1
| 0.026667
| false
| 0
| 0.12
| 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
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
8090743887f743ec0f8600a6989931f356228ad5
| 4,265
|
py
|
Python
|
medium/63-unique-paths-ii.py
|
wanglongjiang/leetcode
|
c61d2e719e81575cfb5bde9d64e15cee7cf01ef3
|
[
"MIT"
] | 2
|
2021-03-14T11:38:26.000Z
|
2021-03-14T11:38:30.000Z
|
medium/63-unique-paths-ii.py
|
wanglongjiang/leetcode
|
c61d2e719e81575cfb5bde9d64e15cee7cf01ef3
|
[
"MIT"
] | null | null | null |
medium/63-unique-paths-ii.py
|
wanglongjiang/leetcode
|
c61d2e719e81575cfb5bde9d64e15cee7cf01ef3
|
[
"MIT"
] | 1
|
2022-01-17T19:33:23.000Z
|
2022-01-17T19:33:23.000Z
|
'''
不同路径 II
一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。
机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。
现在考虑网格中有障碍物。那么从左上角到右下角将会有多少条不同的路径?
'''
from typing import List
'''
解题思路:动态规划。
对于节点i,有动态规划转移方程
1、 f(i,j)=f(i-1,j)+f(i,j-1) ,i>0 j>0 且满足i,j上没有障碍。
2、 f(i,j)=f(i-1,j) , i>0
3、 f(i,j)=f(i,j-1), j>0
4、 f(i,j)=0 如果i,j上有障碍
需要遍历矩阵的每一单元格,对转移进行赋值
'''
class Solution:
def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
m = len(obstacleGrid)
n = len(obstacleGrid[0])
f = [[0] * n for _ in range(m)]
for i in range(m):
for j in range(n):
if not obstacleGrid[i][j]:
if i > 0 and j > 0:
f[i][j] += f[i - 1][j] + f[i][j - 1]
elif j > 0:
f[i][j] = f[i][j - 1]
elif i > 0:
f[i][j] = f[i - 1][j]
else:
f[i][j] = 1
else:
f[i][j] = 0
return f[m - 1][n - 1]
s = Solution()
print(s.uniquePathsWithObstacles([[1, 0]]))
print(s.uniquePathsWithObstacles([[0, 0, 0], [0, 1, 0], [0, 0, 0]]))
print(s.uniquePathsWithObstacles([[0, 1], [0, 0]]))
print(
s.uniquePathsWithObstacles([[0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0],
[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1], [0, 0, 0, 1, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 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], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0],
[0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0], [0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0],
[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0], [1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]]))
print(
s.uniquePathsWithObstacles([[0, 0], [0, 0], [0, 0], [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, 0],
[0, 0], [0, 1], [0, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 1], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1],
[0, 0], [0, 0], [0, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0]]))
print(
s.uniquePathsWithObstacles([[0], [1], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [1], [0], [0], [0], [0], [1], [0], [0], [0], [0], [0], [0], [0],
[0], [0], [0], [1], [1], [0], [1], [0], [0], [1], [0], [0], [0], [0], [1]]))
print(s.uniquePathsWithObstacles([[0, 0, 0, 0, 0], [0, 0, 0, 0, 1], [0, 0, 0, 1, 0], [0, 0, 1, 0, 0]]))
print(s.uniquePathsWithObstacles([[0, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 0]]))
| 59.236111
| 159
| 0.332005
| 887
| 4,265
| 1.595265
| 0.063134
| 0.638869
| 0.773852
| 0.822615
| 0.686219
| 0.686219
| 0.680565
| 0.660777
| 0.628975
| 0.622615
| 0
| 0.279985
| 0.392028
| 4,265
| 71
| 160
| 60.070423
| 0.265715
| 0.032591
| 0
| 0.102041
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.020408
| false
| 0
| 0.020408
| 0
| 0.081633
| 0.163265
| 0
| 0
| 1
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 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
| 7
|
03b27d18d2037dc95a593c4273635e8561a5dbb9
| 2,099
|
py
|
Python
|
tests/test_style.py
|
joowani/dtags
|
9e9d02267cc56bf406ee0bfe0af9c5e56db6a8e3
|
[
"MIT"
] | 405
|
2016-01-25T05:51:42.000Z
|
2022-01-07T06:53:43.000Z
|
tests/test_style.py
|
joowani/dtags
|
9e9d02267cc56bf406ee0bfe0af9c5e56db6a8e3
|
[
"MIT"
] | 21
|
2016-01-31T16:23:19.000Z
|
2019-08-24T15:14:03.000Z
|
tests/test_style.py
|
joowani/dtags
|
9e9d02267cc56bf406ee0bfe0af9c5e56db6a8e3
|
[
"MIT"
] | 16
|
2016-02-01T09:06:00.000Z
|
2020-09-23T13:19:31.000Z
|
from dtags import style as s
from .helpers import clean_str
def test_style_tag():
assert clean_str(s.tag("a", tty=False)) == "@a"
assert clean_str(s.tag("b", tty=False)) == "@b"
assert clean_str(s.tag("a", tty=True)) == "@a"
assert clean_str(s.tag("b", tty=True)) == "@b"
def test_style_path(dir1, dir2):
assert clean_str(s.path(dir1, tty=False)) == dir1.as_posix()
assert clean_str(s.path(dir2, tty=False)) == dir2.as_posix()
assert clean_str(s.path(dir1, tty=True)) == dir1.as_posix()
assert clean_str(s.path(dir2, tty=True)) == dir2.as_posix()
def test_style_command():
assert clean_str(s.command("ls -la", tty=False)) == "$ ls -la"
assert clean_str(s.command("ps aux", tty=False)) == "$ ps aux"
assert clean_str(s.command("ls -la", tty=True)) == "$ ls -la"
assert clean_str(s.command("ps aux", tty=True)) == "$ ps aux"
def test_style_dir_tags(dir1):
expected = f"{dir1.as_posix()} @a @b"
assert clean_str(s.mapping(dir1, {"a", "b"}, tty=False)) == expected
assert clean_str(s.mapping(dir1, {"a", "b"}, tty=True)) == expected
expected = f"{dir1.as_posix()}"
assert clean_str(s.mapping(dir1, set(), tty=False)) == expected
assert clean_str(s.mapping(dir1, set(), tty=True)) == expected
def test_style_dir_tags_diff(dir1):
expected = f"{dir1.as_posix()}"
assert clean_str(s.diff(dir1, set(), set(), tty=False)) == expected
assert clean_str(s.diff(dir1, set(), set(), tty=True)) == expected
expected = f"{dir1.as_posix()} +@a +@b"
assert clean_str(s.diff(dir1, {"a", "b"}, set(), tty=False)) == expected
assert clean_str(s.diff(dir1, {"a", "b"}, set(), tty=True)) == expected
expected = f"{dir1.as_posix()} -@c -@d"
assert clean_str(s.diff(dir1, set(), {"c", "d"}, tty=False)) == expected
assert clean_str(s.diff(dir1, set(), {"c", "d"}, tty=True)) == expected
expected = f"{dir1.as_posix()} +@a +@b -@c -@d"
assert clean_str(s.diff(dir1, {"a", "b"}, {"c", "d"}, tty=False)) == expected
assert clean_str(s.diff(dir1, {"a", "b"}, {"c", "d"}, tty=True)) == expected
| 39.603774
| 81
| 0.613626
| 340
| 2,099
| 3.647059
| 0.105882
| 0.16129
| 0.270968
| 0.290323
| 0.837097
| 0.795968
| 0.789516
| 0.706452
| 0.593548
| 0.417742
| 0
| 0.017114
| 0.16484
| 2,099
| 52
| 82
| 40.365385
| 0.690245
| 0
| 0
| 0.054054
| 0
| 0
| 0.108623
| 0
| 0
| 0
| 0
| 0
| 0.648649
| 1
| 0.135135
| false
| 0
| 0.054054
| 0
| 0.189189
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
03e00f994436b612a899fbb4a7f2f38994e07ce9
| 778
|
py
|
Python
|
puck/test_parser.py
|
NativeInstruments/puck
|
626419214b8895a787a979e672cd27744304bf76
|
[
"MIT"
] | 21
|
2017-07-10T08:55:05.000Z
|
2019-07-12T10:20:01.000Z
|
puck/test_parser.py
|
NativeInstruments/puck
|
626419214b8895a787a979e672cd27744304bf76
|
[
"MIT"
] | 3
|
2017-07-12T12:39:03.000Z
|
2017-09-01T10:07:05.000Z
|
puck/test_parser.py
|
NativeInstruments/puck
|
626419214b8895a787a979e672cd27744304bf76
|
[
"MIT"
] | null | null | null |
from puck.backend import echo_backend
from puck.parser import parse_requirement
def test_parse_req():
expected = {
'name': 'foo',
'pinned_version': '1.2.3',
'latest_version': 'foo',
'source': None
}
assert parse_requirement(
'foo==1.2.3',
None,
backend=echo_backend
) == expected
def test_parse_with_spaces():
expected = {
'name': 'foo',
'pinned_version': '1.2.3',
'latest_version': 'foo',
'source': None
}
assert parse_requirement(
'foo == 1.2.3',
None,
backend=echo_backend
) == expected
def test_parse_invalid_req():
assert parse_requirement(
'foo<1.2.3',
None,
backend=echo_backend
) is None
| 19.948718
| 41
| 0.556555
| 89
| 778
| 4.640449
| 0.303371
| 0.024213
| 0.03632
| 0.181598
| 0.736077
| 0.736077
| 0.736077
| 0.736077
| 0.736077
| 0.736077
| 0
| 0.028195
| 0.316195
| 778
| 38
| 42
| 20.473684
| 0.74812
| 0
| 0
| 0.71875
| 0
| 0
| 0.16581
| 0
| 0
| 0
| 0
| 0
| 0.09375
| 1
| 0.09375
| false
| 0
| 0.0625
| 0
| 0.15625
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 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
| 7
|
03fd03cbb88d915615e55597acebea3b6e3032a1
| 4,365
|
py
|
Python
|
rltoolkit/rltoolkit/acm/test/test_acm_off_policy.py
|
MIMUW-RL/spp-rl
|
86b96cdd220cc4eae86f7cfd26924c69b498dcc6
|
[
"MIT"
] | 7
|
2020-06-15T12:25:53.000Z
|
2021-11-03T01:08:47.000Z
|
rltoolkit/rltoolkit/acm/test/test_acm_off_policy.py
|
MIMUW-RL/spp-rl
|
86b96cdd220cc4eae86f7cfd26924c69b498dcc6
|
[
"MIT"
] | null | null | null |
rltoolkit/rltoolkit/acm/test/test_acm_off_policy.py
|
MIMUW-RL/spp-rl
|
86b96cdd220cc4eae86f7cfd26924c69b498dcc6
|
[
"MIT"
] | 1
|
2020-12-21T11:21:22.000Z
|
2020-12-21T11:21:22.000Z
|
from rltoolkit.acm.off_policy import DDPG_AcM, SAC_AcM
ENV_NAME = "Pendulum-v0"
ACM_PRE_TRAIN_SAMPLES = 100
ACM_PRE_TRAIN_EPOCHS = 1
ITERATIONS = 5
STEPS_PER_EPOCH = 100
STATS_FREQ = 5
ACM_UPDATE_FREQ = 100
ACM_EPOCHS = 1
def test_ddpg_acm():
model = DDPG_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
)
model.pre_train()
model.train()
def test_ddpg_acm_min_max():
model = DDPG_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
denormalize_actor_out=True,
min_max_denormalize=True,
)
model.pre_train()
model.train()
def test_sac_acm():
model = SAC_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
)
model.pre_train()
model.train()
def test_sac_acm_drop_pretrain():
acm_keep_pretrain = False
model = SAC_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
acm_keep_pretrain=acm_keep_pretrain,
)
model.pre_train()
model.train()
def test_ddpg_acm_batches():
acm_update_batches = 50
model = DDPG_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
acm_update_batches=acm_update_batches,
)
model.pre_train()
model.train()
def test_ddpg_custom_loss():
custom_loss = 0.1
model = DDPG_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
custom_loss=custom_loss,
)
model.pre_train()
model.train()
def test_ddpg_custom_loss_min_max():
custom_loss = 0.1
model = DDPG_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
custom_loss=custom_loss,
denormalize_actor_out=True,
min_max_denormalize=True,
)
model.pre_train()
model.train()
def test_ddpg_acm_critic():
acm_critic = True
model = DDPG_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
acm_critic=acm_critic,
)
model.pre_train()
model.train()
def test_sac_acm_critic():
acm_critic = True
model = SAC_AcM(
env_name=ENV_NAME,
acm_pre_train_samples=ACM_PRE_TRAIN_SAMPLES,
acm_pre_train_epochs=ACM_PRE_TRAIN_EPOCHS,
iterations=ITERATIONS,
steps_per_epoch=STEPS_PER_EPOCH,
stats_freq=STATS_FREQ,
acm_update_freq=ACM_UPDATE_FREQ,
acm_epochs=ACM_EPOCHS,
acm_critic=acm_critic,
)
model.pre_train()
model.train()
| 26.779141
| 54
| 0.693242
| 603
| 4,365
| 4.472637
| 0.074627
| 0.139414
| 0.154987
| 0.126808
| 0.888024
| 0.888024
| 0.873934
| 0.873934
| 0.873934
| 0.845755
| 0
| 0.006024
| 0.239404
| 4,365
| 162
| 55
| 26.944444
| 0.806325
| 0
| 0
| 0.78169
| 0
| 0
| 0.00252
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.06338
| false
| 0
| 0.007042
| 0
| 0.070423
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
ff1094072dd1d82b51dcc8b0b1971a6c82a7590c
| 7,659
|
py
|
Python
|
code/createFakeData.py
|
seansegal/parity-in-the-senate
|
bf48c1e6ba9c50cf83b0ef84e456ced7a791e3aa
|
[
"MIT"
] | 5
|
2017-05-18T14:02:18.000Z
|
2020-07-31T03:13:13.000Z
|
code/createFakeData.py
|
seansegal/parity-in-the-senate
|
bf48c1e6ba9c50cf83b0ef84e456ced7a791e3aa
|
[
"MIT"
] | 4
|
2017-05-09T23:11:22.000Z
|
2017-05-09T23:11:23.000Z
|
code/createFakeData.py
|
seansegal/parity-in-the-senate
|
bf48c1e6ba9c50cf83b0ef84e456ced7a791e3aa
|
[
"MIT"
] | null | null | null |
import json
import random
def main():
data = {}
allNodes = []
allLinks = []
importance = 12
names = ["senator1", "senator2", "senator3", "senator4", "senator5",
"senator6", "senator7", "senator8", "senator9", "senator10"]
terms = ["2012", "2013", "2014"]
demNames = []
repubNames = []
bothNames = []
for n in range(4):
thisNode = {}
nameChoice = random.choice(names)
names.remove(nameChoice)
demNames.append(nameChoice)
thisNode["name"] = nameChoice
thisNode["id"] = nameChoice
thisNode["info"] = "info on this person"
thisNode["importance"] = importance
randNum = random.uniform(0, 1)
thisTerms = list(terms)
if randNum < 0.33:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
thisNode["parities"] = {choice1: random.uniform(0.0, 0.2)}
elif randNum >= 0.33 and randNum < 0.66:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
choice2 = random.choice(thisTerms)
thisTerms.remove(choice2)
thisNode["parities"] = {choice1: random.uniform(
0.0, 0.2), choice2: random.uniform(0.0, 0.2)}
else:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
choice2 = random.choice(thisTerms)
thisTerms.remove(choice2)
choice3 = random.choice(thisTerms)
thisTerms.remove(choice3)
thisNode["parities"] = {choice1: random.uniform(
0.0, 0.2), choice2: random.uniform(0.0, 0.2), choice3: random.uniform(0.0, 0.2)}
allNodes.append(thisNode)
thisNode = {}
nameChoice = random.choice(names)
names.remove(nameChoice)
bothNames.append(nameChoice)
thisNode["name"] = nameChoice
thisNode["id"] = nameChoice
thisNode["info"] = "info on this person"
thisNode["importance"] = importance
randNum = random.uniform(0, 1)
thisTerms = list(terms)
if randNum < 0.33:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
thisNode["parities"] = {choice1: random.uniform(0.45, 0.55)}
elif randNum >= 0.33 and randNum < 0.66:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
choice2 = random.choice(thisTerms)
thisTerms.remove(choice2)
thisNode["parities"] = {choice1: random.uniform(
0.45, 0.55), choice2: random.uniform(0.45, 0.55)}
else:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
choice2 = random.choice(thisTerms)
thisTerms.remove(choice2)
choice3 = random.choice(thisTerms)
thisTerms.remove(choice3)
thisNode["parities"] = {choice1: random.uniform(0.45, 0.55), choice2: random.uniform(
0.45, 0.55), choice3: random.uniform(0.45, 0.55)}
allNodes.append(thisNode)
thisNode = {}
nameChoice = random.choice(names)
names.remove(nameChoice)
bothNames.append(nameChoice)
thisNode["name"] = nameChoice
thisNode["id"] = nameChoice
thisNode["info"] = "info on this person"
thisNode["importance"] = importance
randNum = random.uniform(0, 1)
thisTerms = list(terms)
if randNum < 0.33:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
thisNode["parities"] = {choice1: random.uniform(0.45, 0.55)}
elif randNum >= 0.33 and randNum < 0.66:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
choice2 = random.choice(thisTerms)
thisTerms.remove(choice2)
thisNode["parities"] = {choice1: random.uniform(
0.45, 0.55), choice2: random.uniform(0.45, 0.55)}
else:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
choice2 = random.choice(thisTerms)
thisTerms.remove(choice2)
choice3 = random.choice(thisTerms)
thisTerms.remove(choice3)
thisNode["parities"] = {choice1: random.uniform(0.45, 0.55), choice2: random.uniform(
0.45, 0.55), choice3: random.uniform(0.45, 0.55)}
allNodes.append(thisNode)
for n in range(4):
thisNode = {}
nameChoice = random.choice(names)
names.remove(nameChoice)
repubNames.append(nameChoice)
thisNode["name"] = nameChoice
thisNode["id"] = nameChoice
thisNode["info"] = "info on this person"
thisNode["importance"] = importance
randNum = random.uniform(0, 1)
thisTerms = list(terms)
if randNum < 0.33:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
thisNode["parities"] = {choice1: random.uniform(0.8, 0.1)}
elif randNum >= 0.33 and randNum < 0.66:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
choice2 = random.choice(thisTerms)
thisTerms.remove(choice2)
thisNode["parities"] = {choice1: random.uniform(
0.8, 0.1), choice2: random.uniform(0.8, 0.1)}
else:
choice1 = random.choice(thisTerms)
thisTerms.remove(choice1)
choice2 = random.choice(thisTerms)
thisTerms.remove(choice2)
choice3 = random.choice(thisTerms)
thisTerms.remove(choice3)
thisNode["parities"] = {choice1: random.uniform(
0.8, 0.1), choice2: random.uniform(0.8, 0.1), choice3: random.uniform(0.8, 0.1)}
allNodes.append(thisNode)
for name in demNames:
for otherName in demNames:
if not (name == otherName):
thisLink = {}
thisLink["source"] = name
thisLink["target"] = otherName
thisLink["weight"] = random.randint(50, 80)
thisLink["term"] = random.choice(terms)
allLinks.append(thisLink)
for otherName in repubNames:
thisLink = {}
thisLink["source"] = name
thisLink["target"] = otherName
thisLink["weight"] = random.randint(350, 380)
thisLink["term"] = random.choice(terms)
allLinks.append(thisLink)
for otherName in bothNames:
thisLink = {}
thisLink["source"] = name
thisLink["target"] = otherName
thisLink["weight"] = random.randint(200, 230)
thisLink["term"] = random.choice(terms)
allLinks.append(thisLink)
for name in repubNames:
for otherName in repubNames:
if not (name == otherName):
thisLink = {}
thisLink["source"] = name
thisLink["target"] = otherName
thisLink["weight"] = random.randint(50, 80)
thisLink["term"] = random.choice(terms)
allLinks.append(thisLink)
for otherName in bothNames:
thisLink = {}
thisLink["source"] = name
thisLink["target"] = otherName
thisLink["weight"] = random.randint(200, 230)
thisLink["term"] = random.choice(terms)
allLinks.append(thisLink)
thisLink = {}
thisLink["source"] = bothNames[0]
thisLink["target"] = bothNames[1]
thisLink["weight"] = random.randint(50, 80)
thisLink["term"] = random.choice(terms)
allLinks.append(thisLink)
data["nodes"] = allNodes
data["links"] = allLinks
with open("../docs/data/fakeData.json", "w+") as f:
f.write(json.dumps(data, indent=4))
main()
| 33.155844
| 96
| 0.577882
| 786
| 7,659
| 5.631043
| 0.114504
| 0.092183
| 0.088568
| 0.162675
| 0.888839
| 0.888839
| 0.881157
| 0.881157
| 0.881157
| 0.879123
| 0
| 0.054744
| 0.294033
| 7,659
| 230
| 97
| 33.3
| 0.763825
| 0
| 0
| 0.830688
| 0
| 0
| 0.067241
| 0.003395
| 0
| 0
| 0
| 0
| 0
| 1
| 0.005291
| false
| 0
| 0.037037
| 0
| 0.042328
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 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
| 8
|
208f0dd1bf0d7959a2b4ef96b5e792dbd74cb23a
| 319
|
py
|
Python
|
demo_project/api/swagger/schemas.py
|
sobolevn/django-swagger-tester
|
5f47ea8056c1a26a40c4c2f3b5b22dba84242f30
|
[
"BSD-3-Clause"
] | null | null | null |
demo_project/api/swagger/schemas.py
|
sobolevn/django-swagger-tester
|
5f47ea8056c1a26a40c4c2f3b5b22dba84242f30
|
[
"BSD-3-Clause"
] | null | null | null |
demo_project/api/swagger/schemas.py
|
sobolevn/django-swagger-tester
|
5f47ea8056c1a26a40c4c2f3b5b22dba84242f30
|
[
"BSD-3-Clause"
] | null | null | null |
from drf_yasg.openapi import Schema, TYPE_INTEGER, TYPE_STRING
def generic_string_schema(example, description):
return Schema(type=TYPE_STRING, example=example, description=description)
def generic_int_schema(example, description):
return Schema(type=TYPE_INTEGER, example=example, description=description)
| 31.9
| 78
| 0.821317
| 40
| 319
| 6.325
| 0.375
| 0.284585
| 0.189723
| 0.237154
| 0.347826
| 0.347826
| 0.347826
| 0
| 0
| 0
| 0
| 0
| 0.100313
| 319
| 9
| 79
| 35.444444
| 0.881533
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.2
| 0.4
| 1
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
209fffae76d1a9f9c7ec9acb8862febf3ef199bd
| 693
|
py
|
Python
|
test/test.py
|
panguangyu/TimerWood
|
fb45ba440bb26bceb0cc95b33215c67e34de1cf4
|
[
"Apache-2.0"
] | 1
|
2019-05-03T14:16:57.000Z
|
2019-05-03T14:16:57.000Z
|
test/test.py
|
panguangyu/timerWood
|
fb45ba440bb26bceb0cc95b33215c67e34de1cf4
|
[
"Apache-2.0"
] | null | null | null |
test/test.py
|
panguangyu/timerWood
|
fb45ba440bb26bceb0cc95b33215c67e34de1cf4
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
import time
time.sleep(2)
print("siafsjkkkkkkkkkkkkkkkkkkkkkkjkjkwrejkwrejlkjasdkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk8r92jfskallllllllllllllllllllllllllvnxcz,mnsfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnurweeeeeeeeeeeeeeeeeeeeeeeeee832944444444444444442iu34444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444442348jksfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafss")
| 99
| 646
| 0.97114
| 11
| 693
| 61.181818
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188047
| 0.010101
| 693
| 6
| 647
| 115.5
| 0.793003
| 0.023088
| 0
| 0
| 0
| 0
| 0.942308
| 0.942308
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 9
|
454aea3039b7f6f69d2b12dcdc9f01c3bd2b0629
| 92
|
py
|
Python
|
glue/external/echo/qt/connect.py
|
HPLegion/glue
|
1843787ccb4de852dfe103ff58473da13faccf5f
|
[
"BSD-3-Clause"
] | 550
|
2015-01-08T13:51:06.000Z
|
2022-03-31T11:54:47.000Z
|
glue/external/echo/qt/connect.py
|
HPLegion/glue
|
1843787ccb4de852dfe103ff58473da13faccf5f
|
[
"BSD-3-Clause"
] | 1,362
|
2015-01-03T19:15:52.000Z
|
2022-03-30T13:23:11.000Z
|
glue/external/echo/qt/connect.py
|
HPLegion/glue
|
1843787ccb4de852dfe103ff58473da13faccf5f
|
[
"BSD-3-Clause"
] | 142
|
2015-01-08T13:08:00.000Z
|
2022-03-18T13:25:57.000Z
|
from echo.qt.connect import *
from echo.qt.connect import _find_combo_data, UserDataWrapper
| 30.666667
| 61
| 0.836957
| 14
| 92
| 5.285714
| 0.642857
| 0.216216
| 0.27027
| 0.459459
| 0.621622
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097826
| 92
| 2
| 62
| 46
| 0.891566
| 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
| 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
| 8
|
45c0c0ef8c6d3a9ca0c77c67000347d35e3acdb5
| 3,062
|
py
|
Python
|
tests/quara/math/test_func_proj.py
|
tknrsgym/quara
|
8f3337af83cdd02bb85632bb1e297902b1fff8fb
|
[
"Apache-2.0"
] | 3
|
2021-05-19T11:44:30.000Z
|
2022-03-30T07:13:49.000Z
|
tests/quara/math/test_func_proj.py
|
tknrsgym/quara
|
8f3337af83cdd02bb85632bb1e297902b1fff8fb
|
[
"Apache-2.0"
] | 2
|
2021-06-02T01:24:59.000Z
|
2021-06-02T12:20:31.000Z
|
tests/quara/math/test_func_proj.py
|
tknrsgym/quara
|
8f3337af83cdd02bb85632bb1e297902b1fff8fb
|
[
"Apache-2.0"
] | 1
|
2021-10-14T13:21:27.000Z
|
2021-10-14T13:21:27.000Z
|
import numpy as np
import numpy.testing as npt
from quara.math import func_proj
def test_proj_to_self():
proj = func_proj.proj_to_self()
var = np.array([1.0, 2.0], dtype=np.float64)
actual = proj(var)
expected = np.array([1.0, 2.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
def test_proj_to_hyperplane():
### var_a = [2.0, 0.0]
var_a = np.array([2.0, 0.0], dtype=np.float64)
proj = func_proj.proj_to_hyperplane(var_a)
# case1
var = np.array([1.0, 1.0], dtype=np.float64)
actual = proj(var)
expected = np.array([2.0, 1.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case2
var = np.array([1.0, 0.0], dtype=np.float64)
actual = proj(var)
expected = np.array([2.0, 0.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case3
var = np.array([1.0, -1.0], dtype=np.float64)
actual = proj(var)
expected = np.array([2.0, -1.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case4
var = np.array([2.0, 1.0], dtype=np.float64)
actual = proj(var)
expected = np.array([2.0, 1.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
### var_a = [1.0, 1.0]
var_a = np.array([1.0, 1.0], dtype=np.float64)
proj = func_proj.proj_to_hyperplane(var_a)
# case5
var = np.array([-1.0, 1.0], dtype=np.float64)
actual = proj(var)
expected = np.array([0.0, 2.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case6
var = np.array([0.0, 0.0], dtype=np.float64)
actual = proj(var)
expected = np.array([1.0, 1.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case7
var = np.array([1.0, -1.0], dtype=np.float64)
actual = proj(var)
expected = np.array([2.0, 0.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case8
var = np.array([0.0, 2.0], dtype=np.float64)
actual = proj(var)
expected = np.array([0.0, 2.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
def test_proj_to_nonnegative():
proj = func_proj.proj_to_nonnegative()
# case1
var = np.array([1.0, 2.0], dtype=np.float64)
actual = proj(var)
expected = np.array([1.0, 2.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case2
var = np.array([-1.0, 2.0], dtype=np.float64)
actual = proj(var)
expected = np.array([0.0, 2.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case3
var = np.array([1.0, -2.0], dtype=np.float64)
actual = proj(var)
expected = np.array([1.0, 0.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
# case4
var = np.array([-1.0, -2.0], dtype=np.float64)
actual = proj(var)
expected = np.array([0.0, 0.0], dtype=np.float64)
npt.assert_almost_equal(actual, expected, decimal=15)
| 30.62
| 57
| 0.637818
| 507
| 3,062
| 3.745562
| 0.078895
| 0.103212
| 0.117957
| 0.221169
| 0.92733
| 0.892575
| 0.887309
| 0.887309
| 0.887309
| 0.867825
| 0
| 0.086605
| 0.193011
| 3,062
| 99
| 58
| 30.929293
| 0.68191
| 0.035598
| 0
| 0.640625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.203125
| 1
| 0.046875
| false
| 0
| 0.046875
| 0
| 0.09375
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 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
| 7
|
afdf375171e65ae5a17bc26a77f190a288a6ddf2
| 135
|
py
|
Python
|
jupyterlab_templates/tests/test_all.py
|
ElectroDevTeam/jupyterlab_templates
|
b09d8ac52b583bdc8fdcce11f6da14341d282b54
|
[
"Apache-2.0"
] | null | null | null |
jupyterlab_templates/tests/test_all.py
|
ElectroDevTeam/jupyterlab_templates
|
b09d8ac52b583bdc8fdcce11f6da14341d282b54
|
[
"Apache-2.0"
] | null | null | null |
jupyterlab_templates/tests/test_all.py
|
ElectroDevTeam/jupyterlab_templates
|
b09d8ac52b583bdc8fdcce11f6da14341d282b54
|
[
"Apache-2.0"
] | null | null | null |
# for Coverage
from jupyterlab_templates import * # noqa: F401, F403
from jupyterlab_templates.extension import * # noqa: F401, F403
| 33.75
| 64
| 0.77037
| 17
| 135
| 6
| 0.588235
| 0.27451
| 0.45098
| 0.352941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 0.155556
| 135
| 3
| 65
| 45
| 0.789474
| 0.340741
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
aff4196ed491781a5d9a72fe270eba11405ba315
| 39,489
|
py
|
Python
|
slp/trainer/trainer.py
|
manzar96/movie_corpus_chatbot
|
59de55de261330ed87b652dac6f8e045bf4fffcf
|
[
"MIT"
] | null | null | null |
slp/trainer/trainer.py
|
manzar96/movie_corpus_chatbot
|
59de55de261330ed87b652dac6f8e045bf4fffcf
|
[
"MIT"
] | 1
|
2020-12-05T22:57:13.000Z
|
2020-12-05T22:57:13.000Z
|
slp/trainer/trainer.py
|
manzar96/movie_corpus_chatbot
|
59de55de261330ed87b652dac6f8e045bf4fffcf
|
[
"MIT"
] | null | null | null |
import os
import time
from tqdm import tqdm
import math
from typing import Union
import torch
import torch.nn as nn
import random
from ignite.handlers import EarlyStopping
from ignite.contrib.handlers import ProgressBar
from ignite.engine import Engine, Events, State
from ignite.metrics import RunningAverage, Loss
from torch.optim.optimizer import Optimizer
from torch.nn.modules.loss import _Loss
from torch.utils.data import DataLoader
from typing import cast, List, Optional, Tuple, TypeVar
from slp.util import types
from slp.util.parallel import DataParallelModel, DataParallelCriterion
from slp.trainer.handlers import CheckpointHandler, EvaluationHandlerTxt
from slp.util import from_checkpoint, to_device
from slp.util import log
from slp.util import system
#from slp.util.plot_grads import plot_grad_flow
TrainerType = TypeVar('TrainerType', bound='Trainer')
class Trainer(object):
def __init__(self: TrainerType,
model: nn.Module,
optimizer: Optimizer,
checkpoint_dir: str = '../../checkpoints',
experiment_name: str = 'experiment',
model_checkpoint: Optional[str] = None,
optimizer_checkpoint: Optional[str] = None,
metrics: types.GenericDict = None,
patience: int = 10,
validate_every: int = 1,
accumulation_steps: int = 1,
loss_fn: Union[_Loss, DataParallelCriterion] = None,
non_blocking: bool = True,
retain_graph: bool = False,
dtype: torch.dtype = torch.float,
device: str = 'cpu',
parallel: bool = False) -> None:
self.dtype = dtype
self.retain_graph = retain_graph
self.non_blocking = non_blocking
self.device = device
self.loss_fn = loss_fn
self.validate_every = validate_every
self.patience = patience
self.accumulation_steps = accumulation_steps
self.checkpoint_dir = checkpoint_dir
model_checkpoint = self._check_checkpoint(model_checkpoint)
optimizer_checkpoint = self._check_checkpoint(optimizer_checkpoint)
self.model = cast(nn.Module, from_checkpoint(
model_checkpoint, model, map_location=torch.device('cpu')))
self.model = self.model.type(dtype).to(device)
self.optimizer = from_checkpoint(optimizer_checkpoint, optimizer)
self.parallel = parallel
if parallel:
if device == 'cpu':
raise ValueError("parallel can be used only with cuda device")
self.model = DataParallelModel(self.model).to(device)
self.loss_fn = DataParallelCriterion(self.loss_fn) # type: ignore
if metrics is None:
metrics = {}
if 'loss' not in metrics:
if self.parallel:
metrics['loss'] = Loss(
lambda x, y: self.loss_fn(x, y).mean()) # type: ignore
else:
metrics['loss'] = Loss(self.loss_fn)
self.trainer = Engine(self.train_step)
self.train_evaluator = Engine(self.eval_step)
self.valid_evaluator = Engine(self.eval_step)
for name, metric in metrics.items():
metric.attach(self.train_evaluator, name)
metric.attach(self.valid_evaluator, name)
self.pbar = ProgressBar()
self.val_pbar = ProgressBar(desc='Validation')
if checkpoint_dir is not None:
self.checkpoint = CheckpointHandler(
checkpoint_dir, experiment_name, score_name='validation_loss',
score_function=self._score_fn, n_saved=2,
require_empty=False, save_as_state_dict=True)
self.early_stop = EarlyStopping(
patience, self._score_fn, self.trainer)
self.val_handler = EvaluationHandlerTxt(pbar=self.pbar,
validate_every=1,
early_stopping=self.early_stop,
checkpointdir=self.checkpoint_dir)
self.attach()
log.info(
f'Trainer configured to run {experiment_name}\n'
f'\tpretrained model: {model_checkpoint} {optimizer_checkpoint}\n'
f'\tcheckpoint directory: {checkpoint_dir}\n'
f'\tpatience: {patience}\n'
f'\taccumulation steps: {accumulation_steps}\n'
f'\tnon blocking: {non_blocking}\n'
f'\tretain graph: {retain_graph}\n'
f'\tdevice: {device}\n'
f'\tmodel dtype: {dtype}\n'
f'\tparallel: {parallel}')
def _check_checkpoint(self: TrainerType,
ckpt: Optional[str]) -> Optional[str]:
if ckpt is None:
return ckpt
if system.is_url(ckpt):
ckpt = system.download_url(cast(str, ckpt), self.checkpoint_dir)
ckpt = os.path.join(self.checkpoint_dir, ckpt)
return ckpt
@staticmethod
def _score_fn(engine: Engine) -> float:
"""Returns the scoring metric for checkpointing and early stopping
Args:
engine (ignite.engine.Engine): The engine that calculates
the val loss
Returns:
(float): The validation loss
"""
negloss: float = -engine.state.metrics['loss']
return negloss
def parse_batch(
self: TrainerType,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs = to_device(batch[0],
device=self.device,
non_blocking=self.non_blocking)
targets = to_device(batch[1],
device=self.device,
non_blocking=self.non_blocking)
return inputs, targets
def get_predictions_and_targets(
self: TrainerType,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs, targets = self.parse_batch(batch)
y_pred = self.model(inputs)
return y_pred, targets
def train_step(self: TrainerType,
engine: Engine,
batch: List[torch.Tensor]) -> float:
self.model.train()
y_pred, targets = self.get_predictions_and_targets(batch)
loss = self.loss_fn(y_pred, targets) # type: ignore
if self.parallel:
loss = loss.mean()
loss = loss / self.accumulation_steps
loss.backward(retain_graph=self.retain_graph)
if (self.trainer.state.iteration + 1) % self.accumulation_steps == 0:
self.optimizer.step() # type: ignore
self.optimizer.zero_grad()
loss_value: float = loss.item()
return loss_value
def eval_step(
self: TrainerType,
engine: Engine,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
self.model.eval()
with torch.no_grad():
y_pred, targets = self.get_predictions_and_targets(batch)
return y_pred, targets
def predict(self: TrainerType, dataloader: DataLoader) -> State:
return self.valid_evaluator.run(dataloader)
def fit(self: TrainerType,
train_loader: DataLoader,
val_loader: DataLoader,
epochs: int = 50) -> State:
log.info(
'Trainer will run for\n'
f'model: {self.model}\n'
f'optimizer: {self.optimizer}\n'
f'loss: {self.loss_fn}')
self.val_handler.attach(self.trainer,
self.train_evaluator,
train_loader,
validation=False)
self.val_handler.attach(self.trainer,
self.valid_evaluator,
val_loader,
validation=True)
self.model.zero_grad()
self.trainer.run(train_loader, max_epochs=epochs)
def overfit_single_batch(self: TrainerType,
train_loader: DataLoader) -> State:
single_batch = [next(iter(train_loader))]
if self.trainer.has_event_handler(self.val_handler, Events.EPOCH_COMPLETED):
self.trainer.remove_event_handler(self.val_handler, Events.EPOCH_COMPLETED)
self.val_handler.attach(self.trainer,
self.train_evaluator,
single_batch, # type: ignore
validation=False)
out = self.trainer.run(single_batch, max_epochs=100)
return out
def fit_debug(self: TrainerType,
train_loader: DataLoader,
val_loader: DataLoader) -> State:
train_loader = iter(train_loader)
train_subset = [next(train_loader), next(train_loader)]
val_loader = iter(val_loader) # type: ignore
val_subset = [next(val_loader), next(val_loader)] # type ignore
out = self.fit(train_subset, val_subset, epochs=6) # type: ignore
return out
def _attach_checkpoint(self: TrainerType) -> TrainerType:
ckpt = {
'model': self.model,
'optimizer': self.optimizer
}
if self.checkpoint_dir is not None:
self.valid_evaluator.add_event_handler(
Events.COMPLETED, self.checkpoint, ckpt)
return self
def attach(self: TrainerType) -> TrainerType:
ra = RunningAverage(output_transform=lambda x: x)
ra.attach(self.trainer, "Train Loss")
self.pbar.attach(self.trainer, ['Train Loss'])
self.val_pbar.attach(self.train_evaluator)
self.val_pbar.attach(self.valid_evaluator)
self.valid_evaluator.add_event_handler(Events.COMPLETED,
self.early_stop)
self = self._attach_checkpoint()
def graceful_exit(engine, e):
if isinstance(e, KeyboardInterrupt):
engine.terminate()
log.warn("CTRL-C caught. Exiting gracefully...")
else:
raise(e)
self.trainer.add_event_handler(Events.EXCEPTION_RAISED, graceful_exit)
self.train_evaluator.add_event_handler(Events.EXCEPTION_RAISED,
graceful_exit)
self.valid_evaluator.add_event_handler(Events.EXCEPTION_RAISED,
graceful_exit)
return self
class AutoencoderTrainer(Trainer):
def parse_batch(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs = to_device(batch[0],
device=self.device,
non_blocking=self.non_blocking)
return inputs, inputs
class SequentialTrainer(Trainer):
def parse_batch(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs = to_device(batch[0],
device=self.device,
non_blocking=self.non_blocking)
targets = to_device(batch[1],
device=self.device,
non_blocking=self.non_blocking)
lengths = to_device(batch[2],
device=self.device,
non_blocking=self.non_blocking)
return inputs, targets, lengths
def get_predictions_and_targets(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs, targets, lengths = self.parse_batch(batch)
y_pred = self.model(inputs, lengths)
return y_pred, targets
class Seq2SeqTrainer(Trainer):
def __init__(self: TrainerType,
model: nn.Module,
optimizer: Optimizer,
checkpoint_dir: str = '../../checkpoints',
experiment_name: str = 'experiment',
model_checkpoint: Optional[str] = None,
optimizer_checkpoint: Optional[str] = None,
metrics: types.GenericDict = None,
patience: int = 10,
validate_every: int = 1,
accumulation_steps: int = 1,
loss_fn: Union[_Loss, DataParallelCriterion] = None,
clip: float = None,
non_blocking: bool = True,
retain_graph: bool = False,
dtype: torch.dtype = torch.float,
device: str = 'cpu',
parallel: bool = False) -> None:
self.dtype = dtype
self.retain_graph = retain_graph
self.non_blocking = non_blocking
self.device = device
self.loss_fn = loss_fn
self.clip=clip
self.validate_every = validate_every
self.patience = patience
self.accumulation_steps = accumulation_steps
self.checkpoint_dir = checkpoint_dir
model_checkpoint = self._check_checkpoint(model_checkpoint)
optimizer_checkpoint = self._check_checkpoint(optimizer_checkpoint)
self.model = cast(nn.Module, from_checkpoint(
model_checkpoint, model, map_location=torch.device('cpu')))
self.model = self.model.type(dtype).to(device)
self.optimizer = from_checkpoint(optimizer_checkpoint, optimizer)
self.parallel = parallel
if parallel:
if device == 'cpu':
raise ValueError("parallel can be used only with cuda device")
self.model = DataParallelModel(self.model).to(device)
self.loss_fn = DataParallelCriterion(self.loss_fn) # type: ignore
if metrics is None:
metrics = {}
if 'loss' not in metrics:
if self.parallel:
metrics['loss'] = Loss(
lambda x, y: self.loss_fn(x, y).mean()) # type: ignore
else:
metrics['loss'] = Loss(self.loss_fn)
self.trainer = Engine(self.train_step)
self.train_evaluator = Engine(self.eval_step)
self.valid_evaluator = Engine(self.eval_step)
for name, metric in metrics.items():
metric.attach(self.train_evaluator, name)
metric.attach(self.valid_evaluator, name)
self.pbar = ProgressBar()
self.val_pbar = ProgressBar(desc='Validation')
if checkpoint_dir is not None:
self.checkpoint = CheckpointHandler(
checkpoint_dir, experiment_name, score_name='validation_loss',
score_function=self._score_fn, n_saved=2,
require_empty=False, save_as_state_dict=True)
self.early_stop = EarlyStopping(
patience, self._score_fn, self.trainer)
self.val_handler = EvaluationHandler(pbar=self.pbar,
validate_every=1,
early_stopping=self.early_stop)
self.attach()
log.info(
f'Trainer configured to run {experiment_name}\n'
f'\tpretrained model: {model_checkpoint} {optimizer_checkpoint}\n'
f'\tcheckpoint directory: {checkpoint_dir}\n'
f'\tpatience: {patience}\n'
f'\taccumulation steps: {accumulation_steps}\n'
f'\tnon blocking: {non_blocking}\n'
f'\tretain graph: {retain_graph}\n'
f'\tdevice: {device}\n'
f'\tmodel dtype: {dtype}\n'
f'\tparallel: {parallel}')
def parse_batch(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs, input_lengths, targets, target_lengths = map(
lambda b: to_device(b, device=self.device,
non_blocking=self.non_blocking), batch)
return inputs, input_lengths, targets, target_lengths
def get_predictions_and_targets(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs, input_lengths, targets, target_lengths = self.parse_batch(
batch)
y_pred = self.model(inputs, input_lengths, targets)
return y_pred, targets
def train_step(self: TrainerType,
engine: Engine,
batch: List[torch.Tensor]) -> float:
self.model.train()
y_pred, targets = self.get_predictions_and_targets(batch)
loss = self.loss_fn(y_pred, targets) # type: ignore
if self.parallel:
loss = loss.mean()
loss = loss / self.accumulation_steps
loss.backward(retain_graph=self.retain_graph)
#plot_grad_flow(self.model.named_parameters())
# Clip the gradient if necessary.
if self.clip is not None:
torch.nn.utils.clip_grad_norm_(self.model.parameters(),self.clip)
if (self.trainer.state.iteration + 1) % self.accumulation_steps == 0:
self.optimizer.step() # type: ignore
self.optimizer.zero_grad()
loss_value: float = loss.item()
return loss_value
class TransformerTrainer(Trainer):
def parse_batch(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs = to_device(batch[0],
device=self.device,
non_blocking=self.non_blocking)
targets = to_device(batch[1],
device=self.device,
non_blocking=self.non_blocking)
mask_inputs = to_device(batch[2],
device=self.device,
non_blocking=self.non_blocking)
mask_targets = to_device(batch[3],
device=self.device,
non_blocking=self.non_blocking)
return inputs, targets, mask_inputs, mask_targets
def get_predictions_and_targets(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs, targets, mask_inputs, mask_targets = self.parse_batch(batch)
y_pred = self.model(inputs,
targets,
source_mask=mask_inputs,
target_mask=mask_targets)
targets = targets.view(-1)
y_pred = y_pred.view(targets.size(0), -1)
# TODO: BEAMSEARCH!!
return y_pred, targets
class HREDTrainer(Trainer):
def parse_batch(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs1 = to_device(batch[0],
device=self.device,
non_blocking=self.non_blocking)
lengths1 = to_device(batch[1],
device=self.device,
non_blocking=self.non_blocking)
inputs2 = to_device(batch[2],
device=self.device,
non_blocking=self.non_blocking)
lengths2 = to_device(batch[3],
device=self.device,
non_blocking=self.non_blocking)
inputs3 = to_device(batch[4],
device=self.device,
non_blocking=self.non_blocking)
lengths3 = to_device(batch[5],
device=self.device,
non_blocking=self.non_blocking)
return inputs1, lengths1, inputs2, lengths2, inputs3, lengths3
def get_predictions_and_targets(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs1, lengths1, inputs2, lengths2, inputs3, lengths3 = \
self.parse_batch(batch)
y_pred = self.model(inputs1, lengths1, inputs2, lengths2, inputs3,
lengths3)
# y_pred = self.model(batch)
# TODO: BEAMSEARCH!!
return y_pred, inputs3
def train_step(self: TrainerType,
engine: Engine,
batch: List[torch.Tensor]) -> float:
self.model.train()
y_pred, targets = self.get_predictions_and_targets(batch)
loss = self.loss_fn(y_pred, targets) # type: ignore
if self.parallel:
loss = loss.mean()
loss = loss / self.accumulation_steps
loss.backward(retain_graph=self.retain_graph)
if (self.trainer.state.iteration + 1) % self.accumulation_steps == 0:
self.optimizer.step() # type: ignore
self.optimizer.zero_grad()
loss_value: float = loss.item()
return loss_value
class HREDIterationsTrainer:
def __init__(self, model,
optimizer, criterion, metrics=None, scheduler=None,
checkpoint_dir=None, save_every=1000, validate_every=10,
print_every=200, clip=None, device='cpu'):
self.model = model.to(device)
self.optimizer = optimizer
self.criterion = criterion
self.metrics = metrics
self.scheduler = scheduler
self.checkpoint_dir = checkpoint_dir
self.save_every = save_every
self.validate_every = validate_every
self.print_every = print_every
self.clip = clip
self.device = device
def parse_batch(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs1 = to_device(batch[0], device=self.device)
lengths1 = to_device(batch[1], device=self.device)
inputs2 = to_device(batch[2], device=self.device)
lengths2 = to_device(batch[3], device=self.device)
inputs3 = to_device(batch[4], device=self.device)
lengths3 = to_device(batch[5], device=self.device)
return inputs1, lengths1, inputs2, lengths2, inputs3, lengths3
def get_predictions_and_targets(
self: TrainerType,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs1, lengths1, inputs2, lengths2, inputs3, lengths3 = \
self.parse_batch(batch)
y_pred = self.model(inputs1, lengths1, inputs2, lengths2, inputs3,
lengths3)
return y_pred, inputs3
def train_step(self, batch):
self.model.train()
self.optimizer.zero_grad()
outputs, targets = self.get_predictions_and_targets(batch)
loss = self.criterion(outputs, targets)
metrics_res = []
if self.metrics is not None:
for metric in self.metrics:
metrics_res.append(metric(outputs, targets).item())
# Perform backpropagation
loss.backward()
# Clip gradients: gradients are modified in place
if self.clip is not None:
_ = torch.nn.utils.clip_grad_norm_(self.model.parameters(),
self.clip)
# Adjust model weights
self.optimizer.step()
return loss.item(), metrics_res
def eval_step(self, batch):
self.model.eval()
with torch.no_grad():
outputs, targets = self.get_predictions_and_targets(batch)
loss = self.criterion(outputs, targets)
metrics_res = []
if self.metrics is not None:
for metric in self.metrics:
metrics_res.append(metric(outputs, targets).item())
return loss.item(), metrics_res
def print_iter(self, print_loss, print_ppl, iteration, n_iterations):
print_loss_avg = print_loss / self.print_every
print_ppl_avg = print_ppl / self.print_every
print("Training results")
print(
"Iteration: {}; Percent complete: {:.1f}%; Average train loss: {"
":.4f}".format(
iteration, iteration / n_iterations * 100, print_loss_avg))
print(
"Iteration: {}; Percent complete: {:.1f}%; Average PPL: {:.4f}".format(
iteration, iteration / n_iterations * 100, print_ppl_avg))
print("++++++++++++++++++")
def print_iter_val(self, print_loss, print_ppl, iteration, n_iterations):
print_loss_avg = print_loss / self.print_every
print_ppl_avg = print_ppl / self.print_every
print("Validation results")
print(
"Iteration: {}; Percent complete: {:.1f}%; Average loss: {"
":.4f}".format(
iteration, iteration / n_iterations * 100, print_loss_avg))
print(
"Iteration: {}; Percent complete: {:.1f}%; Average PPL: {:.4f}".format(
iteration, iteration / n_iterations * 100, print_ppl_avg))
print("==============================================================")
def save_iter(self, iteration, loss):
if not os.path.exists(self.checkpoint_dir):
os.makedirs(self.checkpoint_dir)
torch.save(self.model.state_dict(), os.path.join(
self.checkpoint_dir, '{}_{}.pth'.format(iteration, 'checkpoint')))
def train_Iterations(self, n_iterations, train_loader, val_loader):
all_mini_batches_train = [batch for _, batch in enumerate(train_loader)]
selected_batches_train = [random.choice(all_mini_batches_train) for _
in range(n_iterations)]
all_mini_batches_val = [batch for _, batch in enumerate(val_loader)]
selected_batches_val = [random.choice(all_mini_batches_val) for _ in
range(n_iterations)]
start_iter = 1
train_print_loss = 0
train_print_ppl = 0
val_print_loss = 0
val_print_ppl = 0
print("Training model....")
for iteration in range(start_iter, n_iterations + 1):
# train step
mini_batch = selected_batches_train[iteration - 1]
loss, metrics_res = self.train_step(mini_batch)
train_print_loss += loss
train_print_ppl += metrics_res[0]
# eval step
mini_batch = selected_batches_val[iteration-1]
loss_val, metrics_res = self.eval_step(mini_batch)
val_print_loss += loss_val
val_print_ppl += metrics_res[0]
# Print progress
if iteration % self.print_every == 0:
self.print_iter(train_print_loss, train_print_ppl, iteration,
n_iterations)
train_print_loss = 0
train_print_ppl = 0
self.print_iter_val(val_print_loss, val_print_ppl,
iteration, n_iterations)
val_print_loss = 0
val_print_ppl = 0
# Save checkpoint
if self.checkpoint_dir is not None:
if iteration % self.save_every == 0:
self.save_iter(iteration, loss)
def fit(self, train_loader, val_loader, n_iters):
self.train_Iterations(n_iters, train_loader, val_loader)
class HREDTrainerEpochs:
def __init__(self, model,
optimizer, criterion, patience, metrics=None, scheduler=None,
checkpoint_dir=None, clip=None, decreasing_tc=False,
device='cpu'):
self.model = model.to(device)
self.optimizer = optimizer
self.criterion = criterion
self.metrics = metrics
self.scheduler = scheduler
self.checkpoint_dir = checkpoint_dir
self.clip = clip
self.device = device
self.patience = patience
self.decreasing_tc = decreasing_tc
def parse_batch(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs1 = to_device(batch[0], device=self.device)
lengths1 = to_device(batch[1], device=self.device)
inputs2 = to_device(batch[2], device=self.device)
lengths2 = to_device(batch[3], device=self.device)
inputs3 = to_device(batch[4], device=self.device)
lengths3 = to_device(batch[5], device=self.device)
return inputs1, lengths1, inputs2, lengths2, inputs3, lengths3
def get_predictions_and_targets(
self: TrainerType,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs1, lengths1, inputs2, lengths2, inputs3, lengths3 = \
self.parse_batch(batch)
y_pred = self.model(inputs1, lengths1, inputs2, lengths2, inputs3,
lengths3)
return y_pred, inputs3
def calc_val_loss(self, val_loader):
curr_tc = self.model.dec.get_tc_ratio()
self.model.dec.set_tc_ratio(1.0)
self.model.eval()
with torch.no_grad():
# cur_tc = model.dec.get_teacher_forcing()
# model.dec.set_teacher_forcing(True)
val_loss, num_words = 0,0
for index, batch in enumerate(tqdm(val_loader)):
preds, targets = self.get_predictions_and_targets(batch)
preds = preds[:, :-1, :].contiguous().view(-1,preds.size(2))
targets = targets[:, 1:].contiguous().view(-1)
# do not include the lM loss, exp(loss) is perplexity
loss = self.criterion(preds, targets)
num_words += targets.ne(0).long().sum().item()
val_loss += loss.item()
self.model.dec.set_tc_ratio(curr_tc)
return val_loss / num_words
def print_epoch(self, epoch, avg_train_epoch_loss, avg_val_epoch_loss,
cur_patience, strt, tc_ratio):
print("Epoch {}:".format(epoch+1))
print("Training loss: {} ".format(avg_train_epoch_loss))
print("Training ppl: {} ".format(math.exp(avg_train_epoch_loss)))
print("Validation loss: {} ".format(avg_val_epoch_loss))
print("Validation ppl: {} ".format(math.exp(avg_val_epoch_loss)))
print("Patience left: {}".format(self.patience-cur_patience))
print("tc ratio", tc_ratio)
print("Time: {} mins".format((time.time() - strt) / 60.0))
print("++++++++++++++++++")
def save_epoch(self, epoch, loss=None):
if not os.path.exists(self.checkpoint_dir):
os.makedirs(self.checkpoint_dir)
torch.save(self.model.state_dict(), os.path.join(
self.checkpoint_dir, '{}_{}.pth'.format(epoch, 'model_checkpoint')))
torch.save(self.optimizer.state_dict(), os.path.join(
self.checkpoint_dir, '{}_{}.pth'.format(epoch,
'optimizer_checkpoint')))
def clip_gnorm(self):
for name, param in self.model.named_parameters():
if param.grad is not None:
param_norm = param.grad.data.norm()
if param_norm > 1:
param.grad.data.mul_(1 / param_norm)
def train_step(self, sample_batch):
self.model.train()
# new_tc_ratio = 2100.0 / (2100.0 + math.exp(batch_id / 2100.0))
# self.model.dec.set_tc_ratio(new_tc_ratio)
self.optimizer.zero_grad()
preds, u3 = self.get_predictions_and_targets(sample_batch)
# # neglect last timestep!
preds = preds[:, :-1, :].contiguous().view(-1, preds.size(2))
# # neglect first timestep!!
u3 = u3[:, 1:].contiguous().view(-1)
loss = self.criterion(preds, u3)
return loss, u3
def train_epochs(self, n_epochs, train_loader, val_loader):
best_val_loss, cur_patience, batch_id = 10000, 0, 0
print("Training model....")
self.model.train()
if self.decreasing_tc:
new_tc_ratio = 2100.0 / (2100.0 + math.exp(batch_id / 2100.0))
self.model.dec.set_tc_ratio(new_tc_ratio)
for epoch in range(n_epochs):
if cur_patience == self.patience:
break
train_epoch_loss, epoch_num_words = 0, 0
strt = time.time()
for index, sample_batch in enumerate(tqdm(train_loader)):
if self.decreasing_tc:
new_tc_ratio = 2100.0 / (2100.0 + math.exp(batch_id / 2100.0))
self.model.dec.set_tc_ratio(new_tc_ratio)
loss, targets = self.train_step(sample_batch)
# ne() because 0 is the pad idx
target_toks = targets.ne(0).long().sum().item()
epoch_num_words += target_toks
train_epoch_loss += loss.item()
loss = loss / target_toks
# if options.lm:
# lmpreds = lmpreds[:, :-1, :].contiguous().view(-1,
# lmpreds.size(
# 2))
loss.backward(retain_graph=False)
# if options.lm:
# lm_loss.backward()
self.clip_gnorm()
self.optimizer.step()
batch_id += 1
avg_val_loss = self.calc_val_loss(val_loader)
avg_train_loss = train_epoch_loss / epoch_num_words
if avg_val_loss < best_val_loss:
self.save_epoch(epoch)
best_val_loss = avg_val_loss
cur_patience = 0
else:
cur_patience += 1
self.print_epoch(epoch, avg_train_loss, avg_val_loss,
cur_patience, strt, self.model.dec.get_tc_ratio())
def fit(self, train_loader, val_loader, epochs):
self.train_epochs(epochs, train_loader, val_loader)
class HREDTrainerEpochsTest:
def __init__(self, model,
optimizer, criterion,patience, metrics=None, scheduler=None,
checkpoint_dir=None, clip=None, device='cpu'):
self.model = model.to(device)
self.optimizer = optimizer
self.criterion = criterion
self.metrics = metrics
self.scheduler = scheduler
self.checkpoint_dir = checkpoint_dir
self.clip = clip
self.device = device
self.patience = patience
def parse_batch(
self,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs1 = to_device(batch[0], device=self.device)
lengths1 = to_device(batch[1], device=self.device)
inputs2 = to_device(batch[2], device=self.device)
lengths2 = to_device(batch[3], device=self.device)
inputs3 = to_device(batch[4], device=self.device)
lengths3 = to_device(batch[5], device=self.device)
return inputs1, lengths1, inputs2, lengths2, inputs3, lengths3
def get_predictions_and_targets(
self: TrainerType,
batch: List[torch.Tensor]) -> Tuple[torch.Tensor, ...]:
inputs1, lengths1, inputs2, lengths2, inputs3, lengths3 = \
self.parse_batch(batch)
y_pred = self.model(batch)
return y_pred, inputs3
def calc_val_loss(self, val_loader):
self.model.eval()
with torch.no_grad():
# cur_tc = model.dec.get_teacher_forcing()
# model.dec.set_teacher_forcing(True)
val_loss, num_words = 0,0
for index, batch in enumerate(tqdm(val_loader)):
preds,targets = self.get_predictions_and_targets(batch)
# we want to find the perplexity or likelihood of the provided sequence
preds = preds[:, :-1, :].contiguous().view(-1,preds.size(2))
targets = targets[:, 1:].contiguous().view(-1)
# do not include the lM loss, exp(loss) is perplexity
loss = self.criterion(preds, targets)
num_words += targets.ne(0).long().sum().item()
val_loss += loss.item()
# model.dec.set_teacher_forcing(cur_tc)
return val_loss / num_words
def print_epoch(self, epoch, avg_train_epoch_loss, avg_val_epoch_loss,
cur_patience, strt):
print("Epoch {}:".format(epoch+1))
print("Training loss: {} ".format(avg_train_epoch_loss))
print("Training ppl: {} ".format(math.exp(avg_train_epoch_loss)))
print("Validation loss: {} ".format(avg_val_epoch_loss))
print("Validation ppl: {} ".format(math.exp(avg_val_epoch_loss)))
print("Patience left: {}".format(self.patience-cur_patience))
print("Time: {} mins".format((time.time() - strt) / 60.0))
print("++++++++++++++++++")
def save_epoch(self, epoch, loss=None):
if not os.path.exists(self.checkpoint_dir):
os.makedirs(self.checkpoint_dir)
torch.save(self.model.state_dict(), os.path.join(
self.checkpoint_dir, '{}_{}.pth'.format(epoch, 'checkpoint')))
torch.save(self.optimizer.state_dict(), os.path.join(
self.checkpoint_dir, '{}_{}.pth'.format(epoch, 'checkpoint')))
def clip_gnorm(self):
for name, param in self.model.named_parameters():
if param.grad is not None:
param_norm = param.grad.data.norm()
if param_norm > 1:
param.grad.data.mul_(1 / param_norm)
def train_step(self, sample_batch):
self.model.train()
# new_tc_ratio = 2100.0 / (2100.0 + math.exp(batch_id / 2100.0))
# self.model.dec.set_tc_ratio(new_tc_ratio)
self.optimizer.zero_grad()
preds, u3 = self.get_predictions_and_targets(sample_batch)
# # neglect last timestep!
preds = preds[:, :-1, :].contiguous().view(-1, preds.size(2))
# # neglect first timestep!!
u3 = u3[:, 1:].contiguous().view(-1)
loss = self.criterion(preds, u3)
return loss, u3
def train_epochs(self, n_epochs, train_loader, val_loader):
best_val_loss, cur_patience, batch_id = 10000, 0, 0
print("Training model....")
self.model.train()
for epoch in range(n_epochs):
if cur_patience == self.patience:
break
train_epoch_loss, epoch_num_words = 0, 0
strt = time.time()
for i_batch, sample_batch in enumerate(tqdm(train_loader)):
loss, targets = self.train_step(sample_batch)
# ne() because 0 is the pad idx
target_toks = targets.ne(0).long().sum().item()
epoch_num_words += target_toks
train_epoch_loss += loss.item()
loss = loss / target_toks
# if options.lm:
# lmpreds = lmpreds[:, :-1, :].contiguous().view(-1,
# lmpreds.size(
# 2))
loss.backward(retain_graph=False)
# if options.lm:
# lm_loss.backward()
self.clip_gnorm()
self.optimizer.step()
batch_id += 1
avg_val_loss = self.calc_val_loss(val_loader)
avg_train_loss = train_epoch_loss / epoch_num_words
if avg_val_loss < best_val_loss:
self.save_epoch(epoch)
best_val_loss = avg_val_loss
cur_patience = 0
else:
cur_patience += 1
self.print_epoch(epoch, avg_train_loss, avg_val_loss,
cur_patience, strt)
def fit(self, train_loader, val_loader, epochs):
self.train_epochs(epochs, train_loader, val_loader)
| 39.847629
| 87
| 0.57264
| 4,362
| 39,489
| 4.96928
| 0.080468
| 0.023252
| 0.025835
| 0.019376
| 0.827459
| 0.800655
| 0.78294
| 0.764209
| 0.745802
| 0.717476
| 0
| 0.012956
| 0.32566
| 39,489
| 991
| 88
| 39.847629
| 0.801044
| 0.048292
| 0
| 0.747759
| 0
| 0
| 0.05127
| 0.00411
| 0
| 0
| 0
| 0.001009
| 0
| 1
| 0.071703
| false
| 0
| 0.028169
| 0.00128
| 0.15621
| 0.075544
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
b30750b048adc0df76165961800c221c39f4c493
| 6,747
|
py
|
Python
|
loan_calculator/grossup/functions.py
|
yanomateus/loan-calculator
|
b6b8eb8102f40c4ec151ba2331e2122f6162f093
|
[
"MIT"
] | 17
|
2020-02-15T20:14:49.000Z
|
2022-03-16T01:00:00.000Z
|
loan_calculator/grossup/functions.py
|
yanomateus/loan-calculator
|
b6b8eb8102f40c4ec151ba2331e2122f6162f093
|
[
"MIT"
] | null | null | null |
loan_calculator/grossup/functions.py
|
yanomateus/loan-calculator
|
b6b8eb8102f40c4ec151ba2331e2122f6162f093
|
[
"MIT"
] | 2
|
2021-01-03T19:14:29.000Z
|
2021-06-01T06:24:25.000Z
|
"""Provide functions implementation of different grossup cases.
The grossup of a net principal is an augmented principal value whose net
value corresponds to the given net principal. The net value of a principal
is the one obtained after subtracting due taxes and service fees according
to very specific mathematical rule.
"""
def br_iof_regressive_price_grossup(
net_principal,
daily_interest_rate,
daily_iof_fee,
complementary_iof_fee,
return_days,
service_fee
):
"""Calculate the grossup of the given principal.
This function implements a grossup for which
- the principal is amortized according to a regressive Price schedule,
- the principal and the payments are taxed by IOF,
- a fee is calculated over the principal.
If :math:`s` is the principal, :math:`d` is the daily interest rate,
:math:`I^*` is the daily IOF fee, :math:`I^{**}` is the complementary IOF
fee, :math:`g` is the service fee and :math:`(n_1,n_2,\\ldots,n_k)` is the
vector with the return dates, then the grossup is given by
.. math::
\\mathrm{GROSSUP}\\ (s, d, I^*, I^{**}, (n_1,\\ldots,n_k), g)
=\\frac{s}{1 - \\alpha - I^{**} - g},
where
.. math::
\\alpha := \\frac{
\\displaystyle\\sum_{j=1}^k\\frac{\\min(n_{k-j+1}\\ I^*, 0.015)}
{(1+d)^{n_j}}} {\\displaystyle\\sum_{j=1}^k\\frac{1}{(1+d)^{n_j}}}.
Parameters
----------
net_principal : float, required
The principal to be "grossed up".
daily_interest_rate : float, required
The rate at which the principal grows over time.
daily_iof_fee : float, required
Daily tax due to brazilian tax IOF.
complementary_iof_fee : float, required
Complementary tax due to brazilian tax IOF.
return_days : list, required
List containing the number of days since the start reference date.
service_fee : float, optional
Eventual service fee. It is assumed to be an aliquot
applied on the principal
Returns
-------
The grossed up principal.
"""
# variables are renamed in order to make the math more explicit
p = net_principal
d = daily_interest_rate
d_iof = daily_iof_fee
c_iof = complementary_iof_fee
s_fee = service_fee
pmt_days = return_days
# TODO:think of a better name for this coefficient
# transport coefficient
transport_coef = sum(1.0 / (1 + d) ** n for n in pmt_days)
# iof coefficient
iof_coef = sum(
float(min(n * d_iof, 0.015)) / (1 + d) ** n
for n in pmt_days
)
return p / (1 - (iof_coef / transport_coef) - c_iof - s_fee)
def br_iof_progressive_price_grossup(
net_principal,
daily_interest_rate,
daily_iof_fee,
complementary_iof_fee,
return_days,
service_fee
):
"""Calculate the grossup of the principal for the given parameters.
This implements a grossup for which
- the principal is amortized according to a progressive Price schedule,
- the principal is taxed, as well as its payments, by IOF
- a fee is applied over the principal
If :math:`s` is the principal, :math:`d` is the daily interest rate,
:math:`I^*` is the daily IOF fee, :math:`I^{**}` is the complementary IOF
fee, :math:`g` is the service fee and :math:`(n_1,n_2,\\ldots,n_k)` is the
vector with the return dates, then the grossup is given by
.. math::
\\mathrm{GROSSUP}(s, d, I^*, I^{**}, (n_1,\\ldots,n_k), g) =
\\frac{s}{1 - \\alpha - I^{**} - g },
where
.. math::
\\alpha :=
\\frac
{
\\displaystyle
\\sum_{j=1}^k\\frac{\\min(n_j\\ I^*, 0.015)}{(1+d)^{n_j}}}
{
\\displaystyle\\sum_{j=1}^k\\frac{1}{(1+d)^{n_j}}}.
Parameters
----------
net_principal : float, required
The principal to be "grossed up".
daily_interest_rate : float, required
The rate at which the principal grows over time.
daily_iof_fee : float, required
Daily tax due to brazilian tax IOF.
complementary_iof_fee : float, required
Complementary tax due to brazilian tax IOF.
return_days : list, required
List containing the number of days since the start reference date.
service_fee : float, optional
Eventual service fee. It is assumed to be an aliquot
applied on the principal
Returns
-------
The grossed up principal.
"""
# variables are renamed in order to make the math more explicit
p = net_principal
d = daily_interest_rate
d_iof = daily_iof_fee
c_iof = complementary_iof_fee
s_fee = service_fee
pmt_days = return_days
# TODO:think of a better name for this coefficient
# transport coefficient
transport_coef = sum(1.0 / (1 + d) ** n for n in pmt_days)
# iof coefficient
iof_coef = sum(
float(min(n * d_iof, 0.015)) / (1 + d) ** n
for n in pmt_days[::-1]
)
return p / (1 - (iof_coef / transport_coef) - c_iof - s_fee)
def br_iof_constant_amortization_grossup(
net_principal,
daily_interest_rate,
daily_iof_fee,
complementary_iof_fee,
return_days,
service_fee
):
"""Calculate the grossup of the principal and given parameters.
This implements a grossup for which
- the principal is amortized according to a constant amortization
schedule
- the principal and the payments are taxed with IOF,
- a service fee is applied over the principal.
If :math:`s` is the principal, :math:`d` is the daily interest rate,
:math:`I^*` is the daily IOF fee, :math:`I^{**}` is the complementary IOF
fee, :math:`g` is the service fee and :math:`(n_1,n_2,\\ldots,n_k)` is the
vector with the return dates, then the grossup is given by
.. math::
\\mathrm{GROSSUP}(s, d, I^*, I^{**}, (n_1,\\ldots,n_k), g) =
\\frac{s} {1 - \\alpha - I^{**} - g},
where
.. math::
\\alpha :=
\\frac{1}{k}
\\frac{\\displaystyle\\sum_{j=1}^k \\min(n_j\\ I^*, 0.015)}
{\\displaystyle\\sum_{j=1}^k\\frac{1}{(1+d)^{n_j}}}.
"""
# variables are renamed to make the math more explicit
p = net_principal
d = daily_interest_rate
d_iof = daily_iof_fee
c_iof = complementary_iof_fee
s_fee = service_fee
pmt_days = return_days
# TODO:think of a better name for this coefficient
# transport coefficient
transport_coef = sum(1.0 / (1 + d) ** n for n in pmt_days)
# iof coefficient
iof_coef = sum(
float(min(n * d_iof, 0.015)) / len(pmt_days)
for n in pmt_days
)
return p / (1 - (iof_coef / transport_coef) - c_iof - s_fee)
| 30.529412
| 78
| 0.626649
| 1,000
| 6,747
| 4.075
| 0.134
| 0.032393
| 0.04589
| 0.014724
| 0.875337
| 0.871166
| 0.863067
| 0.863067
| 0.842454
| 0.842454
| 0
| 0.013462
| 0.262339
| 6,747
| 220
| 79
| 30.668182
| 0.805304
| 0.662517
| 0
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013636
| 0
| 1
| 0.05
| false
| 0
| 0
| 0
| 0.1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
b30e81f9b32b5d0423d224bf036ece64461e09f2
| 14,059
|
py
|
Python
|
src/rewrites/simple_negate.py
|
j6mes/fever-attacks-emlp-2019
|
20c8c39cd91b5e0ae945e101906a50d4bbaecd06
|
[
"Apache-2.0"
] | 3
|
2019-05-04T04:33:44.000Z
|
2020-06-22T10:30:16.000Z
|
src/rewrites/simple_negate.py
|
j6mes/fever-attacks-emlp-2019
|
20c8c39cd91b5e0ae945e101906a50d4bbaecd06
|
[
"Apache-2.0"
] | null | null | null |
src/rewrites/simple_negate.py
|
j6mes/fever-attacks-emlp-2019
|
20c8c39cd91b5e0ae945e101906a50d4bbaecd06
|
[
"Apache-2.0"
] | 1
|
2022-03-28T11:38:30.000Z
|
2022-03-28T11:38:30.000Z
|
import re
from rewrites.replacement_rule import ReplacementRule
class SimpleNegateIsAReplacementRuleMeaningAltering(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) is a (.+)", instance["claim"])
matches2 = re.match(r"(.+) is an (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None and matches2 is None:
return None
if matches1 is not None:
new_claim = "{0} is not a {1}.".format(matches1.group(1).replace(".",""),matches1.group(2).replace(".",""))
else:
new_claim = "{0} is not an {1}.".format(matches2.group(1).replace(".", ""), matches2.group(2).replace(".",""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "is.a.swap"
class SimpleNegateWasAReplacementRuleMeaningAltering(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) was a (.+)", instance["claim"])
matches2 = re.match(r"(.+) was an (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None and matches2 is None:
return None
if matches1 is not None:
new_claim = "{0} was not a {1}.".format(matches1.group(1).replace(".",""),matches1.group(2).replace(".",""))
else:
new_claim = "{0} was not an {1}.".format(matches2.group(1).replace(".", ""), matches2.group(2).replace(".",""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "was.a.swap"
class SimpleNegateIsAReplacementRuleMeaningAltering1(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) is a (.+)", instance["claim"])
matches2 = re.match(r"(.+) is an (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None and matches2 is None:
return None
if matches1 is not None:
new_claim = "{0} is not a {1}.".format(matches1.group(1).replace(".",""),matches1.group(2).replace(".",""))
else:
new_claim = "{0} is not an {1}.".format(matches2.group(1).replace(".", ""), matches2.group(2).replace(".",""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "is.a.swap.2"
class SimpleNegateWasAReplacementRuleMeaningAltering1(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) was a (.+)", instance["claim"])
matches2 = re.match(r"(.+) was an (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None and matches2 is None:
return None
if matches1 is not None:
new_claim = "{0} wasn't a {1}.".format(matches1.group(1).replace(".",""),matches1.group(2).replace(".",""))
else:
new_claim = "{0} wasn't an {1}.".format(matches2.group(1).replace(".", ""), matches2.group(2).replace(".",""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "was.a.swap.2"
class SimpleNegateIsAReplacementRuleMeaningAltering2(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) is a (.+)", instance["claim"])
matches2 = re.match(r"(.+) is an (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None and matches2 is None:
return None
if matches1 is not None:
new_claim = "{0} is definitely not a {1}.".format(matches1.group(1).replace(".",""),matches1.group(2).replace(".",""))
else:
new_claim = "{0} is definitely not an {1}.".format(matches2.group(1).replace(".", ""), matches2.group(2).replace(".",""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "is.intens1.a.swap.2"
class SimpleNegateWasAReplacementRuleMeaningAltering2(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) was a (.+)", instance["claim"])
matches2 = re.match(r"(.+) was an (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None and matches2 is None:
return None
if matches1 is not None:
new_claim = "{0} definitely was not a {1}.".format(matches1.group(1).replace(".",""),matches1.group(2).replace(".",""))
else:
new_claim = "{0} definitely was not an {1}.".format(matches2.group(1).replace(".", ""), matches2.group(2).replace(".",""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "was.intens1.a.swap.2"
class SimpleNegateIsAReplacementRuleMeaningAltering3(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) is a (.+)", instance["claim"])
matches2 = re.match(r"(.+) is an (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None and matches2 is None:
return None
if matches1 is not None:
new_claim = "{0} is certainly not a {1}.".format(matches1.group(1).replace(".",""),matches1.group(2).replace(".",""))
else:
new_claim = "{0} is certainly not an {1}.".format(matches2.group(1).replace(".", ""), matches2.group(2).replace(".",""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "is.intens2.a.swap.2"
class SimpleNegateWasAReplacementRuleMeaningAltering3(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) was a (.+)", instance["claim"])
matches2 = re.match(r"(.+) was an (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None and matches2 is None:
return None
if matches1 is not None:
new_claim = "{0} certainly was not a {1}.".format(matches1.group(1).replace(".",""),matches1.group(2).replace(".",""))
else:
new_claim = "{0} certainly was not an {1}.".format(matches2.group(1).replace(".", ""), matches2.group(2).replace(".",""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "was.intens2.a.swap.2"
class SimpleNegateDirectedByMeaningAltering(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) (?:was|is)? directed by (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None:
return None
new_claim = "{0} is not directed by {1}.".format(matches1.group(1).replace(".", ""), matches1.group(2).replace(".", ""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "directedby.swap.1"
class SimpleNegateDirectedByMeaningAltering1(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) (?:was|is)? directed by (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None:
return None
new_claim = "{0} isn't directed by {1}.".format(matches1.group(1).replace(".", ""), matches1.group(2).replace(".", ""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "directedby.swap.2"
class SimpleNegateDirectedByMeaningAltering2(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) (?:was|is)? directed by (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None:
return None
new_claim = "{0} is definitely not directed by {1}.".format(matches1.group(1).replace(".", ""), matches1.group(2).replace(".", ""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "directedby.intens1.swap.1"
class SimpleNegateDirectedByMeaningAltering3(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) (?:was|is)? directed by (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None:
return None
new_claim = "{0} is certainly not directed by {1}.".format(matches1.group(1).replace(".", ""),
matches1.group(2).replace(".", ""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "directedby.intens2.swap.1"
class SimpleNegateStarredIn1(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) (?:starred|stars) in (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None:
return None
new_claim = "{0} did not star in {1}.".format(matches1.group(1).replace(".", ""), matches1.group(2).replace(".", ""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "starredin1.swap"
class SimpleNegateStarredIn2(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) (?:starred|stars) in (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None:
return None
new_claim = "{0} didn't star in {1}.".format(matches1.group(1).replace(".", ""), matches1.group(2).replace(".", ""))
instance["claim"] = new_claim
instance["label"] = "REFUTES" if instance["label"] == "SUPPORTS" else "SUPPORTS"
return instance
def name(self):
return "starredin2.swap"
class SimpleNegateAmerican(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) American (.+)", instance["claim"])
if instance["label"] == "NOT ENOUGH INFO":
return None
if matches1 is None:
return None
if instance["label"] == "REFUTES":
return None
instance["claim"] = instance["claim"].replace("American","Canadian")
instance["label"] = "REFUTES"
return instance
def name(self):
return "american.canadian"
class SimpleNegateBirth1(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) (?:was|is) born (?:in|on)? (.+)", instance["claim"])
if matches1 is None:
return None
if instance["label"] == "NOT ENOUGH INFO":
return None
if instance["label"] == "REFUTES":
return None
instance["claim"] = instance["claim"].replace("born","not born")
instance["label"] = "REFUTES"
return instance
def name(self):
return "birth1.swap"
class SimpleNegateBirth2(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) (?:was|is) born (?:in|on)? (.+)", instance["claim"])
if matches1 is None:
return None
if instance["label"] == "NOT ENOUGH INFO":
return None
if instance["label"] == "REFUTES":
return None
instance["claim"] = "{0} was never born".format(matches1.group(1).replace(".", ""))
instance["label"] = "REFUTES"
return instance
def name(self):
return "birth2.swap"
class SimpleNegateDeath1(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) died (?:in|on) (.+)", instance["claim"])
if matches1 is None:
return None
if instance["label"] == "NOT ENOUGH INFO":
return None
if instance["label"] == "REFUTES":
return None
new_claim = "{0} is still alive".format(matches1.group(1).replace(".", ""))
instance["label"] = "REFUTES"
instance["claim"] = new_claim
return instance
def name(self):
return "death1.swap"
class SimpleNegateDeath2(ReplacementRule):
def _process(self, instance):
matches1 = re.match(r"(.+) died (?:in|on) (.+)", instance["claim"])
if matches1 is None:
return None
if instance["label"] == "NOT ENOUGH INFO":
return None
if instance["label"] == "REFUTES":
return None
new_claim = "{0} has not died".format(matches1.group(1).replace(".", ""))
instance["label"] = "REFUTES"
instance["claim"] = new_claim
return instance
def name(self):
return "death2.swap"
| 34.458333
| 139
| 0.576286
| 1,547
| 14,059
| 5.198449
| 0.058824
| 0.092141
| 0.070878
| 0.0572
| 0.877767
| 0.86757
| 0.860234
| 0.855509
| 0.852151
| 0.826536
| 0
| 0.022964
| 0.256633
| 14,059
| 407
| 140
| 34.542998
| 0.746531
| 0
| 0
| 0.775087
| 0
| 0
| 0.194905
| 0.003558
| 0
| 0
| 0
| 0
| 0
| 1
| 0.131488
| false
| 0
| 0.00692
| 0.065744
| 0.484429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
b33e0183977a9fd528fa9d1dd89e6b5c6dbda910
| 136
|
py
|
Python
|
python/axi_soc_ultra_plus_core/rfsoc_utility/__init__.py
|
slaclab/axi-soc-ultra-plus-core
|
e2b207bf88505724ad088c99756907beaab7db98
|
[
"BSD-3-Clause-LBNL"
] | 1
|
2021-09-07T03:12:22.000Z
|
2021-09-07T03:12:22.000Z
|
python/axi_soc_ultra_plus_core/rfsoc_utility/__init__.py
|
slaclab/axi-soc-ultra-plus-core
|
e2b207bf88505724ad088c99756907beaab7db98
|
[
"BSD-3-Clause-LBNL"
] | null | null | null |
python/axi_soc_ultra_plus_core/rfsoc_utility/__init__.py
|
slaclab/axi-soc-ultra-plus-core
|
e2b207bf88505724ad088c99756907beaab7db98
|
[
"BSD-3-Clause-LBNL"
] | null | null | null |
from axi_soc_ultra_plus_core.rfsoc_utility._AppRingBuffer import *
from axi_soc_ultra_plus_core.rfsoc_utility._DacSigGen import *
| 45.333333
| 67
| 0.852941
| 20
| 136
| 5.2
| 0.55
| 0.134615
| 0.192308
| 0.288462
| 0.673077
| 0.673077
| 0.673077
| 0.673077
| 0
| 0
| 0
| 0
| 0.102941
| 136
| 2
| 68
| 68
| 0.852459
| 0
| 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
| 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
| 7
|
b3431ea0ae569badf8667e2bd100cd744c5bd065
| 31,396
|
py
|
Python
|
GUI/PyQt/DLart/RigidPatching.py
|
thomaskuestner/CNNArt
|
c2fc639dd2ce035f6ca90113290682a0ccd26fb8
|
[
"Apache-2.0"
] | 22
|
2018-04-27T21:28:46.000Z
|
2021-12-24T06:44:55.000Z
|
GUI/PyQt/DLart/RigidPatching.py
|
thomaskuestner/CNNArt
|
c2fc639dd2ce035f6ca90113290682a0ccd26fb8
|
[
"Apache-2.0"
] | 81
|
2017-11-09T17:23:15.000Z
|
2020-01-28T22:54:13.000Z
|
GUI/PyQt/DLart/RigidPatching.py
|
thomaskuestner/CNNArt
|
c2fc639dd2ce035f6ca90113290682a0ccd26fb8
|
[
"Apache-2.0"
] | 18
|
2017-11-13T16:12:17.000Z
|
2020-08-27T10:17:34.000Z
|
import numpy as np
import math
from utils.Label import Label
#########################################################################################################################################
#Function: fRigidPatching #
#The function fRigidPatching is responsible for splitting the dicom numpy array in patches depending on the patchSize and the #
#patchOverlap. Besides the function creates an 1D array with the corresponding labels. #
# #
#Input: dicom_numpy_array ---> 3D dicom array (height, width, number of slices) #
# patchSize ---> size of patches, example: [40, 40], patchSize[0] = height, patchSize[1] = weight, height and weight can differ #
# patchOverlap ---> the ratio for overlapping, example: 0.25 #
# mask_numpy_array ---> 3D mask array contains information about the areas of artefacts. movement-artefact = 1, shim-artefact = 2 #
# noise-artefact = 3 #
# ratio_labeling ---> set the ratio of the number of 'Pixel-Artefacts' to the whole number of pixels of one patch #
#Output: dPatches ---> 3D-Numpy-Array, which contain all Patches. #
# dLabels ---> 1D-Numpy-Array with all corresponding labels #
#########################################################################################################################################
def fRigidPatching(dicom_numpy_array, patchSize, patchOverlap, mask_numpy_array, ratio_labeling):
move_artefact = False
shim_artefact = False
noise_artefact = False
#dLabels = []
dOverlap = np.multiply(patchSize, patchOverlap)
dNotOverlap = np.round(np.multiply(patchSize, (1 - patchOverlap)))
size_zero_pad = np.array(([math.ceil((dicom_numpy_array.shape[0] - dOverlap[0]) / (dNotOverlap[0])) * dNotOverlap[0] + dOverlap[
0], math.ceil((dicom_numpy_array.shape[1] - dOverlap[1]) / (dNotOverlap[1])) * dNotOverlap[1] + dOverlap[1]]))
zero_pad = np.array(([int(size_zero_pad[0]) - dicom_numpy_array.shape[0], int(size_zero_pad[1]) - dicom_numpy_array.shape[1]]))
zero_pad_part = np.array(([int(math.ceil(zero_pad[0] / 2)), int(math.ceil(zero_pad[1] / 2))]))
Img_zero_pad = np.lib.pad(dicom_numpy_array, (
(zero_pad_part[0], zero_pad[0] - zero_pad_part[0]), (zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (0, 0)),
mode='constant')
Mask_zero_pad = np.lib.pad(mask_numpy_array, (
(zero_pad_part[0], zero_pad[0] - zero_pad_part[0]), (zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (0, 0)),
mode='constant')
nbPatches = int(((size_zero_pad[0]-patchSize[0])/((1-patchOverlap)*patchSize[0])+1)*((size_zero_pad[1]-patchSize[1])/((1-patchOverlap)*patchSize[1])+1)*dicom_numpy_array.shape[2])
dPatches = np.zeros((patchSize[0], patchSize[1], nbPatches), dtype=float) #dtype=np.float32
dLabels = np.zeros((nbPatches), dtype = float) #dtype = float
idxPatch = 0
for iZ in range(0, dicom_numpy_array.shape[2], 1):
for iY in range(0, int(size_zero_pad[0] - dOverlap[0]), int(dNotOverlap[0])):
for iX in range(0, int(size_zero_pad[1] - dOverlap[1]), int(dNotOverlap[1])):
dPatch = Img_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ]
dPatches[:,:,idxPatch] = dPatch
dPatch_mask = Mask_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ]
patch_number_value = patchSize[0] * patchSize[1]
if np.count_nonzero((dPatch_mask==1).astype(np.int)) > int(ratio_labeling*patch_number_value):
move_artefact = True
if np.count_nonzero((dPatch_mask==2).astype(np.int)) > int(ratio_labeling*patch_number_value):
shim_artefact = True
if np.count_nonzero((dPatch_mask==3).astype(np.int)) > int(ratio_labeling*patch_number_value):
noise_artefact = True
label = 0
if move_artefact == True and shim_artefact != True and noise_artefact != True:
label = 1
elif move_artefact != True and shim_artefact == True and noise_artefact != True:
label = 2
elif move_artefact != True and shim_artefact != True and noise_artefact == True:
label = 3
elif move_artefact == True and shim_artefact == True and noise_artefact != True:
label = 4
elif move_artefact == True and shim_artefact != True and noise_artefact == True:
label = 5
elif move_artefact != True and shim_artefact == True and noise_artefact == True:
label = 6
elif move_artefact == True and shim_artefact == True and noise_artefact == True:
label = 7
print(label)
dLabels[idxPatch] = label
idxPatch += 1
move_artefact = False
shim_artefact = False
noise_artefact = False
print("Rigid done!")
print(dLabels)
return dPatches, dLabels, nbPatches
#########################################################################################################################################
#Function: fRigidPatching3D #
#The function fRigidPatching3D is responsible for splitting the dicom numpy array in patches depending on the patchSize and the #
#patchOverlap. Besides the function creates an 1D array with the corresponding labels. #
# #
#Input: dicom_numpy_array ---> 3D dicom array (height, width, number of slices) #
# patchSize ---> size of patches, example: [40, 40], patchSize[0] = height, patchSize[1] = weight, height and weight can differ #
# patchOverlap ---> the ratio for overlapping, example: 0.25 #
# mask_numpy_array ---> 3D mask array contains information about the areas of artefacts. movement-artefact = 1, shim-artefact = 2 #
# noise-artefact = 3 #
# ratio_labeling ---> set the ratio of the number of 'Pixel-Artefacts' to the whole number of pixels of one patch #
#Output: dPatches ---> 3D-Numpy-Array, which contain all Patches. #
# dLabels ---> 1D-Numpy-Array with all corresponding labels #
#########################################################################################################################################
def fRigidPatching3D(dicom_numpy_array, patchSize, patchOverlap, mask_numpy_array, ratio_labeling):
move_artefact = False
shim_artefact = False
noise_artefact = False
#dLabels = []
print(patchSize)
dOverlap = np.round(np.multiply(patchSize, patchOverlap))
dNotOverlap = np.round(np.multiply(patchSize, (1 - patchOverlap)))
print(dOverlap, dNotOverlap)
size_zero_pad = np.array(([math.ceil((dicom_numpy_array.shape[0] - dOverlap[0]) / (dNotOverlap[0])) * dNotOverlap[0] + dOverlap[
0], math.ceil((dicom_numpy_array.shape[1] - dOverlap[1]) / (dNotOverlap[1])) * dNotOverlap[1] + dOverlap[1], math.ceil((dicom_numpy_array.shape[2] - dOverlap[2]) / (dNotOverlap[2])) * dNotOverlap[2] + dOverlap[2]]))
print(size_zero_pad.shape)
zero_pad = np.array(([int(size_zero_pad[0]) - dicom_numpy_array.shape[0], int(size_zero_pad[1]) - dicom_numpy_array.shape[1], int(size_zero_pad[2]) - dicom_numpy_array.shape[2]]))
print(zero_pad.shape)
zero_pad_part = np.array(([int(math.ceil(zero_pad[0] / 2)), int(math.ceil(zero_pad[1] / 2)), int(math.ceil(zero_pad[2] / 2))]))
print(zero_pad_part.shape)
Img_zero_pad = np.lib.pad(dicom_numpy_array, (
(zero_pad_part[0], zero_pad[0] - zero_pad_part[0]), (zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (zero_pad_part[2], zero_pad[2] - zero_pad_part[2])),
mode='constant')
print(Img_zero_pad.shape)
Mask_zero_pad = np.lib.pad(mask_numpy_array, (
(zero_pad_part[0], zero_pad[0] - zero_pad_part[0]), (zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (zero_pad_part[2], zero_pad[2] - zero_pad_part[2])),
mode='constant')
print(Mask_zero_pad.shape)
print(size_zero_pad[2])
print(np.round((1-patchOverlap)*patchSize[2]))
print(((size_zero_pad[2]-patchSize[2])/(np.round((1-patchOverlap)*patchSize[2]))+1))
nbPatches = ((size_zero_pad[0]-patchSize[0])/((1-patchOverlap)*patchSize[0])+1)*((size_zero_pad[1]-patchSize[1])/((1-patchOverlap)*patchSize[1])+1)*((size_zero_pad[2]-patchSize[2])/(np.round((1-patchOverlap)*patchSize[2]))+1)
print(nbPatches)
dPatches = np.zeros((patchSize[0], patchSize[1], patchSize[2], int(nbPatches)), dtype=float)
dLabels = np.zeros((int(nbPatches)), dtype = int) #float
idxPatch = 0
for iZ in range(0, int(size_zero_pad[2] - dOverlap[2]), int(dNotOverlap[2])):
for iY in range(0, int(size_zero_pad[0] - dOverlap[0]), int(dNotOverlap[0])):
for iX in range(0, int(size_zero_pad[1] - dOverlap[1]), int(dNotOverlap[1])):
dPatch = Img_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ:iZ + patchSize[2]]
print(dPatch.shape)
print(dPatches[:,:,:,idxPatch].shape)
dPatches[:,:,:,idxPatch] = dPatch
dPatch_mask = Mask_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ:iZ + patchSize[2]]
patch_number_value = patchSize[0] * patchSize[1]*patchSize[2]
if np.count_nonzero((dPatch_mask==1).astype(np.int)) > int(ratio_labeling*patch_number_value):
move_artefact = True
if np.count_nonzero((dPatch_mask==2).astype(np.int)) > int(ratio_labeling*patch_number_value):
shim_artefact = True
if np.count_nonzero((dPatch_mask==3).astype(np.int)) > int(ratio_labeling*patch_number_value):
noise_artefact = True
label = 0
if move_artefact == True and shim_artefact != True and noise_artefact != True:
label = 1
elif move_artefact != True and shim_artefact == True and noise_artefact != True:
label = 2
elif move_artefact != True and shim_artefact != True and noise_artefact == True:
label = 3
elif move_artefact == True and shim_artefact == True and noise_artefact != True:
label = 4
elif move_artefact == True and shim_artefact != True and noise_artefact == True:
label = 5
elif move_artefact != True and shim_artefact == True and noise_artefact == True:
label = 6
elif move_artefact == True and shim_artefact == True and noise_artefact == True:
label = 7
print(label)
dLabels[idxPatch] = label
idxPatch += 1
move_artefact = False
shim_artefact = False
noise_artefact = False
print("Rigid done!")
print(dLabels.dtype)
return dPatches, dLabels, nbPatches
def fRigidPatching3DN(dicom_numpy_array, patchSize, patchOverlap, mask_numpy_array, ratio_labeling):
move_artefact = False
shim_artefact = False
noise_artefact = False
#dLabels = []
dOverlap = np.multiply(patchSize, patchOverlap)
dNotOverlap = np.round(np.multiply(patchSize, (1 - patchOverlap)))
print(dOverlap,dNotOverlap)
size_zero_pad = np.array(([math.ceil((dicom_numpy_array.shape[0] - dOverlap[0]) / (dNotOverlap[0])) * dNotOverlap[0] + dOverlap[
0], math.ceil((dicom_numpy_array.shape[1] - dOverlap[1]) / (dNotOverlap[1])) * dNotOverlap[1] + dOverlap[1], math.ceil((dicom_numpy_array.shape[2] - dOverlap[2]) / (dNotOverlap[2])) * dNotOverlap[2] + dOverlap[2]]))
zero_pad = np.array(([int(size_zero_pad[0]) - dicom_numpy_array.shape[0], int(size_zero_pad[1]) - dicom_numpy_array.shape[1], int(size_zero_pad[2]) - dicom_numpy_array.shape[2]]))
zero_pad_part = np.array(([int(math.ceil(zero_pad[0] / 2)), int(math.ceil(zero_pad[1] / 2)), int(math.ceil(zero_pad[2] / 2))]))
Img_zero_pad = np.lib.pad(dicom_numpy_array, (
(zero_pad_part[0], zero_pad[0] - zero_pad_part[0]), (zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (zero_pad_part[2], zero_pad[2] - zero_pad_part[2])),
mode='constant')
print(Img_zero_pad.shape)
Mask_zero_pad = np.lib.pad(mask_numpy_array, (
(zero_pad_part[0], zero_pad[0] - zero_pad_part[0]), (zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (zero_pad_part[2], zero_pad[2] - zero_pad_part[2])),
mode='constant')
nbPatches = ((size_zero_pad[0]-patchSize[0])/((1-patchOverlap)*patchSize[0])+1)*((size_zero_pad[1]-patchSize[1])/((1-patchOverlap)*patchSize[1])+1)*((size_zero_pad[2]-patchSize[2])/((1-patchOverlap)*patchSize[2])+1)
print(((size_zero_pad[0]-patchSize[0])/((1-patchOverlap)*patchSize[0])+1))
print(((size_zero_pad[1]-patchSize[1])/((1-patchOverlap)*patchSize[1])+1))
print(((size_zero_pad[2]-patchSize[2])/((1-patchOverlap)*patchSize[2])+1))
print(int(patchSize[0]), int(patchSize[1]), int(patchSize[2]), int(nbPatches))
dPatches = np.zeros((int(patchSize[0]), int(patchSize[1]), int(patchSize[2]), int(nbPatches)), dtype=float)
dLabels = np.zeros((int(nbPatches)), dtype = float)
idxPatch = 0
for iZ in range(0, dicom_numpy_array.shape[2], int(dNotOverlap[2])):
for iY in range(0, int(size_zero_pad[0] - dOverlap[0]), int(dNotOverlap[0])):
for iX in range(0, int(size_zero_pad[1] - dOverlap[1]), int(dNotOverlap[1])):
print(iX, iY, iZ)
dPatch = Img_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ:iZ + patchSize[2]]
print(idxPatch)
print(dPatch.shape)
dPatches[:,:,:,idxPatch] = dPatch
dPatch_mask = Mask_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ:iZ + patchSize[2]]
patch_number_value = patchSize[0] * patchSize[1]*patchSize[2]
if np.count_nonzero((dPatch_mask==1).astype(np.int)) > int(ratio_labeling*patch_number_value):
move_artefact = True
if np.count_nonzero((dPatch_mask==2).astype(np.int)) > int(ratio_labeling*patch_number_value):
shim_artefact = True
if np.count_nonzero((dPatch_mask==3).astype(np.int)) > int(ratio_labeling*patch_number_value):
noise_artefact = True
label = 0
if move_artefact == True and shim_artefact != True and noise_artefact != True:
label = 1
elif move_artefact != True and shim_artefact == True and noise_artefact != True:
label = 2
elif move_artefact != True and shim_artefact != True and noise_artefact == True:
label = 3
elif move_artefact == True and shim_artefact == True and noise_artefact != True:
label = 4
elif move_artefact == True and shim_artefact != True and noise_artefact == True:
label = 5
elif move_artefact != True and shim_artefact == True and noise_artefact == True:
label = 6
elif move_artefact == True and shim_artefact == True and noise_artefact == True:
label = 7
dLabels[idxPatch] = label
idxPatch += 1
move_artefact = False
shim_artefact = False
noise_artefact = False
print("Rigid done!")
print(dLabels)
return dPatches, dLabels, nbPatches
def fRigidPatching_maskLabeling(dicom_numpy_array, patchSize, patchOverlap, mask_numpy_array, ratio_labeling, dataset):
dPatches = None
move_artefact = False
shim_artefact = False
noise_artefact = False
#body region
bodyRegion, bodyRegionLabel = dataset.getBodyRegion()
# MRT weighting label (T1, T2)
weighting, weightingLabel = dataset.getMRTWeighting()
#dOverlap = np.multiply(patchSize, patchOverlap)
dOverlap = np.round(np.multiply(patchSize, patchOverlap))
#dNotOverlap = np.round(np.multiply(patchSize, (1 - patchOverlap)))
dNotOverlap = [patchSize[0]-dOverlap[0], patchSize[1]-dOverlap[1]]
size_zero_pad = np.array(
([math.ceil((dicom_numpy_array.shape[0] - dOverlap[0]) / (dNotOverlap[0])) * dNotOverlap[0] + dOverlap[0],
math.ceil((dicom_numpy_array.shape[1] - dOverlap[1]) / (dNotOverlap[1])) * dNotOverlap[1] + dOverlap[1]]))
zero_pad = np.array(
([int(size_zero_pad[0]) - dicom_numpy_array.shape[0], int(size_zero_pad[1]) - dicom_numpy_array.shape[1]]))
zero_pad_part = np.array(([int(math.ceil(zero_pad[0] / 2)), int(math.ceil(zero_pad[1] / 2))]))
Img_zero_pad = np.lib.pad(dicom_numpy_array, (
(zero_pad_part[0], zero_pad[0] - zero_pad_part[0]),
(zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (0, 0)), mode='constant')
Mask_zero_pad = np.lib.pad(mask_numpy_array,
((zero_pad_part[0], zero_pad[0] - zero_pad_part[0]),
(zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (0, 0)),
mode='constant')
nbPatches = int(((size_zero_pad[0]-patchSize[0])/((1-patchOverlap)*patchSize[0])+1)*((size_zero_pad[1]-patchSize[1])/((1-patchOverlap)*patchSize[1])+1)*dicom_numpy_array.shape[2])
nbPatches_in_Y = int((size_zero_pad[0]-dOverlap[0])/dNotOverlap[0])
nbPatches_in_X = int((size_zero_pad[1]-dOverlap[1])/dNotOverlap[1])
nbPatches_in_Z = dicom_numpy_array.shape[2]
nbPatches = nbPatches_in_X*nbPatches_in_Y*nbPatches_in_Z
dPatches = np.zeros((patchSize[0], patchSize[1], nbPatches), dtype=float) # dtype=np.float32
#dLabels = np.zeros((nbPatches), dtype=float) # dtype = float
dLabels = np.zeros((nbPatches), dtype=np.dtype('i4'))
idxPatch = 0
for iZ in range(0, dicom_numpy_array.shape[2], 1):
for iY in range(0, int(size_zero_pad[0] - dOverlap[0]), int(dNotOverlap[0])):
for iX in range(0, int(size_zero_pad[1] - dOverlap[1]), int(dNotOverlap[1])):
dPatch = Img_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ]
dPatches[:, :, idxPatch] = dPatch
#if idxPatch == 7678:
# print()
dPatch_mask = Mask_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ]
patch_number_value = patchSize[0] * patchSize[1]
if np.count_nonzero((dPatch_mask == 1).astype(np.int)) > int(ratio_labeling * patch_number_value):
move_artefact = True
if np.count_nonzero((dPatch_mask == 2).astype(np.int)) > int(ratio_labeling * patch_number_value):
shim_artefact = True
if np.count_nonzero((dPatch_mask == 3).astype(np.int)) > int(ratio_labeling * patch_number_value):
noise_artefact = True
label = Label.REFERENCE
if move_artefact == True and shim_artefact != True and noise_artefact != True:
label = Label.MOTION
elif move_artefact != True and shim_artefact == True and noise_artefact != True:
label = Label.SHIM
elif move_artefact != True and shim_artefact != True and noise_artefact == True:
label = Label.NOISE
elif move_artefact == True and shim_artefact == True and noise_artefact != True:
label = Label.MOTION_AND_SHIM
elif move_artefact == True and shim_artefact != True and noise_artefact == True:
label = Label.MOTION_AND_NOISE
elif move_artefact != True and shim_artefact == True and noise_artefact == True:
label = Label.SHIM_AND_NOISE
elif move_artefact == True and shim_artefact == True and noise_artefact == True:
label = Label.MOTION_AND_SHIM_AND_NOISE
# calculate final label
label = label + bodyRegionLabel + weightingLabel
#print(label)
dLabels[idxPatch] = label
idxPatch += 1
move_artefact = False
shim_artefact = False
noise_artefact = False
print("Rigid done!")
print(dLabels)
#return dPatches, dLabels, nbPatches
return dPatches, dLabels
def fRigidPatching_patchLabeling(dicom_numpy_array, patchSize, patchOverlap, ratio_labeling):
dPatches = None
move_artefact = False
shim_artefact = False
noise_artefact = False
dLabels = []
dOverlap = np.multiply(patchSize, patchOverlap)
dNotOverlap = np.round(np.multiply(patchSize, (1 - patchOverlap)))
size_zero_pad = np.array(
([math.ceil((dicom_numpy_array.shape[0] - dOverlap[0]) / (dNotOverlap[0])) * dNotOverlap[0] + dOverlap[
0],
math.ceil((dicom_numpy_array.shape[1] - dOverlap[1]) / (dNotOverlap[1])) * dNotOverlap[1] + dOverlap[1]]))
zero_pad = np.array(
([int(size_zero_pad[0]) - dicom_numpy_array.shape[0], int(size_zero_pad[1]) - dicom_numpy_array.shape[1]]))
zero_pad_part = np.array(([int(math.ceil(zero_pad[0] / 2)), int(math.ceil(zero_pad[1] / 2))]))
Img_zero_pad = np.lib.pad(dicom_numpy_array, (
(zero_pad_part[0], zero_pad[0] - zero_pad_part[0]), (zero_pad_part[1], zero_pad[1] - zero_pad_part[1]), (0, 0)),
mode='constant')
for iZ in range(0, dicom_numpy_array.shape[2], 1):
for iY in range(0, int(size_zero_pad[0] - dOverlap[0]), int(dNotOverlap[0])):
for iX in range(0, int(size_zero_pad[1] - dOverlap[1]), int(dNotOverlap[1])):
dPatch = Img_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ]
dPatch = dPatch[:, :, np.newaxis]
if dPatches is None:
dPatches = dPatch
else:
dPatches = np.concatenate((dPatches, dPatch), axis=2)
dLabels = np.ones((dPatches.shape[2]), dtype=np.dtype('i4'))
return dPatches, dLabels
#########################################################################################################################################
#Function: fRigidPatching3D #
#The function fRigidPatching3D is responsible for splitting the dicom numpy array in patches depending on the patchSize and the #
#patchOverlap. Besides the function creates an 1D array with the corresponding labels. #
# #
#Input: dicom_numpy_array ---> 3D dicom array (height, width, number of slices) #
# patchSize ---> size of patches, example: [40, 40], patchSize[0] = height, patchSize[1] = weight, height and weight can differ #
# patchOverlap ---> the ratio for overlapping, example: 0.25 #
# mask_numpy_array ---> 3D mask array contains information about the areas of artefacts. movement-artefact = 1, shim-artefact = 2 #
# noise-artefact = 3 #
# ratio_labeling ---> set the ratio of the number of 'Pixel-Artefacts' to the whole number of pixels of one patch #
#Output: dPatches ---> 3D-Numpy-Array, which contain all Patches. #
# dLabels ---> 1D-Numpy-Array with all corresponding labels #
#########################################################################################################################################
def fRigidPatching3D_maskLabeling(dicom_numpy_array, patchSize, patchOverlap, mask_numpy_array, ratio_labeling, dataset):
#ToDo error for patchSizeZ = 5. To different Array sizes (40,40,4) and (40,40,5). Padding problem with uneven z-patch sizes????
move_artefact = False
shim_artefact = False
noise_artefact = False
# body region
bodyRegion, bodyRegionLabel = dataset.getBodyRegion()
# MRT weighting label (T1, T2)
weighting, weightingLabel = dataset.getMRTWeighting()
dOverlap = np.round(np.multiply(patchSize, patchOverlap))
dNotOverlap = np.round(np.multiply(patchSize, (1 - patchOverlap)))
size_zero_pad = np.array(([math.ceil((dicom_numpy_array.shape[0] - dOverlap[0]) / (dNotOverlap[0])) * dNotOverlap[0] + dOverlap[0],
math.ceil((dicom_numpy_array.shape[1] - dOverlap[1]) / (dNotOverlap[1])) * dNotOverlap[1] + dOverlap[1],
math.ceil((dicom_numpy_array.shape[2] - dOverlap[2]) / (dNotOverlap[2])) * dNotOverlap[2] + dOverlap[2]]))
zero_pad = np.array(([int(size_zero_pad[0]) - dicom_numpy_array.shape[0],
int(size_zero_pad[1]) - dicom_numpy_array.shape[1],
int(size_zero_pad[2]) - dicom_numpy_array.shape[2]]))
zero_pad_part = np.array(([int(math.ceil(zero_pad[0] / 2)),
int(math.ceil(zero_pad[1] / 2)),
int(math.ceil(zero_pad[2] / 2))]))
Img_zero_pad = np.lib.pad(dicom_numpy_array,
((zero_pad_part[0], zero_pad[0] - zero_pad_part[0]),
(zero_pad_part[1], zero_pad[1] - zero_pad_part[1]),
(zero_pad_part[2], zero_pad[2] - zero_pad_part[2])),
mode='constant')
Mask_zero_pad = np.lib.pad(mask_numpy_array,
((zero_pad_part[0], zero_pad[0] - zero_pad_part[0]),
(zero_pad_part[1], zero_pad[1] - zero_pad_part[1]),
(zero_pad_part[2], zero_pad[2] - zero_pad_part[2])),
mode='constant')
nbPatches = ((size_zero_pad[0]-patchSize[0])/((1-patchOverlap)*patchSize[0])+1)*((size_zero_pad[1]-patchSize[1])/((1-patchOverlap)*patchSize[1])+1)*((size_zero_pad[2]-patchSize[2])/(np.round((1-patchOverlap)*patchSize[2]))+1)
nbPatches_in_Y = int((size_zero_pad[0] - dOverlap[0]) / dNotOverlap[0])
nbPatches_in_X = int((size_zero_pad[1] - dOverlap[1]) / dNotOverlap[1])
nbPatches_in_Z = int((size_zero_pad[2] - dOverlap[2]) / dNotOverlap[2])
nbPatches = nbPatches_in_X * nbPatches_in_Y * nbPatches_in_Z
dPatches = np.zeros((patchSize[0], patchSize[1], patchSize[2], int(nbPatches)), dtype=float)
dLabels = np.zeros((int(nbPatches)), dtype = int) #float
idxPatch = 0
for iZ in range(0, int(size_zero_pad[2] - dOverlap[2]), int(dNotOverlap[2])):
for iY in range(0, int(size_zero_pad[0] - dOverlap[0]), int(dNotOverlap[0])):
for iX in range(0, int(size_zero_pad[1] - dOverlap[1]), int(dNotOverlap[1])):
dPatch = Img_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ:iZ + patchSize[2]]
dPatches[:,:,:,idxPatch] = dPatch
dPatch_mask = Mask_zero_pad[iY:iY + patchSize[0], iX:iX + patchSize[1], iZ:iZ + patchSize[2]]
patch_number_value = patchSize[0] * patchSize[1]*patchSize[2]
if np.count_nonzero((dPatch_mask==1).astype(np.int)) > int(ratio_labeling*patch_number_value):
move_artefact = True
if np.count_nonzero((dPatch_mask==2).astype(np.int)) > int(ratio_labeling*patch_number_value):
shim_artefact = True
if np.count_nonzero((dPatch_mask==3).astype(np.int)) > int(ratio_labeling*patch_number_value):
noise_artefact = True
label = Label.REFERENCE
if move_artefact == True and shim_artefact != True and noise_artefact != True:
label = Label.MOTION
elif move_artefact != True and shim_artefact == True and noise_artefact != True:
label = Label.SHIM
elif move_artefact != True and shim_artefact != True and noise_artefact == True:
label = Label.NOISE
elif move_artefact == True and shim_artefact == True and noise_artefact != True:
label = Label.MOTION_AND_SHIM
elif move_artefact == True and shim_artefact != True and noise_artefact == True:
label = Label.MOTION_AND_NOISE
elif move_artefact != True and shim_artefact == True and noise_artefact == True:
label = Label.SHIM_AND_NOISE
elif move_artefact == True and shim_artefact == True and noise_artefact == True:
label = Label.MOTION_AND_SHIM_AND_NOISE
label = weightingLabel + bodyRegionLabel + label
dLabels[idxPatch] = label
idxPatch += 1
move_artefact = False
shim_artefact = False
noise_artefact = False
print("Rigid done!")
print(dLabels)
return dPatches, dLabels#, nbPatches
| 62.293651
| 230
| 0.550261
| 3,667
| 31,396
| 4.500409
| 0.042814
| 0.083561
| 0.063625
| 0.053324
| 0.952978
| 0.941162
| 0.937829
| 0.935769
| 0.935769
| 0.935769
| 0
| 0.027798
| 0.307937
| 31,396
| 504
| 231
| 62.293651
| 0.731729
| 0.173462
| 0
| 0.829201
| 0
| 0
| 0.005992
| 0
| 0
| 0
| 0
| 0.001984
| 0
| 1
| 0.016529
| false
| 0
| 0.008264
| 0
| 0.041322
| 0.093664
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
2fa9696096ea71792b3df678bb07655cdf1520ce
| 247
|
py
|
Python
|
GPy/inference/optimization/__init__.py
|
ekalosak/GPy
|
ff82f12c3d321bfc3ce6615447fad25aea9de6bd
|
[
"BSD-3-Clause"
] | 1,685
|
2015-01-03T14:46:25.000Z
|
2022-03-30T02:41:35.000Z
|
GPy/inference/optimization/__init__.py
|
ekalosak/GPy
|
ff82f12c3d321bfc3ce6615447fad25aea9de6bd
|
[
"BSD-3-Clause"
] | 778
|
2015-01-15T18:21:25.000Z
|
2022-03-30T14:52:32.000Z
|
GPy/inference/optimization/__init__.py
|
ekalosak/GPy
|
ff82f12c3d321bfc3ce6615447fad25aea9de6bd
|
[
"BSD-3-Clause"
] | 584
|
2015-01-06T06:30:43.000Z
|
2022-03-29T13:05:33.000Z
|
from paramz.optimization import Optimizer
from . import stochastics
from paramz.optimization import *
import sys
sys.modules['GPy.inference.optimization.stochastics'] = stochastics
sys.modules['GPy.inference.optimization.Optimizer'] = Optimizer
| 27.444444
| 67
| 0.821862
| 28
| 247
| 7.25
| 0.357143
| 0.098522
| 0.216749
| 0.275862
| 0.334975
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089069
| 247
| 8
| 68
| 30.875
| 0.902222
| 0
| 0
| 0
| 0
| 0
| 0.299595
| 0.299595
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 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
| 1
| 0
|
0
| 7
|
2fbc024577f6eaeb31b4c6fa083115cdad4b9124
| 101
|
py
|
Python
|
yomoPyCommon/db/__init__.py
|
luyomo/yomo-py-common
|
abca1c7a1f497e8ffb677ea0cb73697e71403bb7
|
[
"MIT"
] | null | null | null |
yomoPyCommon/db/__init__.py
|
luyomo/yomo-py-common
|
abca1c7a1f497e8ffb677ea0cb73697e71403bb7
|
[
"MIT"
] | null | null | null |
yomoPyCommon/db/__init__.py
|
luyomo/yomo-py-common
|
abca1c7a1f497e8ffb677ea0cb73697e71403bb7
|
[
"MIT"
] | null | null | null |
from yomoPyCommon.db import MongoData
from yomoPyCommon.db import PGBase
| 33.666667
| 51
| 0.623762
| 10
| 101
| 6.3
| 0.6
| 0.507937
| 0.571429
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.356436
| 101
| 2
| 52
| 50.5
| 0.969231
| 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
| 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
| 8
|
2fd1c5f3ac013e7c40e57b9bf0fa9521b57090fc
| 1,165
|
py
|
Python
|
tests/test_build_compounds.py
|
fkbyf14/vcf_adjunct_parser
|
9c0f4dd9a7e3b18c92c1a0dd70b8be4991aefdec
|
[
"MIT"
] | 42
|
2015-03-19T09:04:39.000Z
|
2022-02-02T10:38:25.000Z
|
tests/test_build_compounds.py
|
fkbyf14/vcf_adjunct_parser
|
9c0f4dd9a7e3b18c92c1a0dd70b8be4991aefdec
|
[
"MIT"
] | 14
|
2015-02-06T08:35:05.000Z
|
2017-08-17T08:27:19.000Z
|
tests/test_build_compounds.py
|
fkbyf14/vcf_adjunct_parser
|
9c0f4dd9a7e3b18c92c1a0dd70b8be4991aefdec
|
[
"MIT"
] | 12
|
2015-02-12T13:41:13.000Z
|
2021-11-09T17:23:46.000Z
|
from vcf_parser.utils import build_compounds_dict
def test_build_compounds():
"""
Test how build_compounds_dict behaves
"""
compound_info = ['2:1_24_T_A']
assert build_compounds_dict(compound_info) == {
'2':[
{
'variant_id': '1_24_T_A',
'compound_score': None
}
]
}
def test_build_multiple_compounds():
"""
Test how build_compounds_dict behaves
"""
compound_info = ['2:1_24_T_A|1_25_A_C']
assert build_compounds_dict(compound_info) == {
'2':[
{
'variant_id': '1_24_T_A',
'compound_score': None
},
{
'variant_id': '1_25_A_C',
'compound_score': None
}
]
}
def test_build_compounds_with_score():
"""
Test how build_compounds_dict behaves
"""
compound_info = ['2:1_24_T_A>17']
assert build_compounds_dict(compound_info) == {
'2':[
{
'variant_id': '1_24_T_A',
'compound_score': '17'
}
]
}
| 21.574074
| 51
| 0.492704
| 124
| 1,165
| 4.129032
| 0.233871
| 0.246094
| 0.246094
| 0.058594
| 0.798828
| 0.798828
| 0.71875
| 0.71875
| 0.71875
| 0.71875
| 0
| 0.048433
| 0.397425
| 1,165
| 54
| 52
| 21.574074
| 0.680912
| 0.096996
| 0
| 0.342857
| 0
| 0
| 0.173784
| 0
| 0
| 0
| 0
| 0
| 0.085714
| 1
| 0.085714
| false
| 0
| 0.028571
| 0
| 0.114286
| 0
| 0
| 0
| 0
| null | 1
| 1
| 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
| 0
|
0
| 7
|
6437ae0ffa8639892404dea71d93d41d4d3ae0e5
| 27,404
|
py
|
Python
|
src/genie/libs/parser/iosxe/tests/test_show_mcast.py
|
Drey/genieparser
|
f16649efabf1f3c892bcaad340ae24ce5403ba6b
|
[
"Apache-2.0"
] | null | null | null |
src/genie/libs/parser/iosxe/tests/test_show_mcast.py
|
Drey/genieparser
|
f16649efabf1f3c892bcaad340ae24ce5403ba6b
|
[
"Apache-2.0"
] | null | null | null |
src/genie/libs/parser/iosxe/tests/test_show_mcast.py
|
Drey/genieparser
|
f16649efabf1f3c892bcaad340ae24ce5403ba6b
|
[
"Apache-2.0"
] | null | null | null |
# Python
import unittest
from unittest.mock import Mock
# ATS
from ats.topology import Device
# Metaparset
from genie.metaparser.util.exceptions import SchemaEmptyParserError, \
SchemaMissingKeyError
# Parser
from genie.libs.parser.iosxe.show_mcast import ShowIpMroute,\
ShowIpv6Mroute, \
ShowIpMrouteStatic, \
ShowIpMulticast
# =======================================
# Unit test for 'show ip mroute'
# Unit test for 'show ip mroute vrf xxx'
# =======================================
class test_show_ip_mroute(unittest.TestCase):
device = Device(name='aDevice')
empty_output = {'execute.return_value': ''}
golden_parsed_output = {
"vrf": {
"default": {
"address_family": {
"ipv4": {
"multicast_group": {
"239.1.1.1": {
"source_address": {
"*": {
"expire": "stopped",
"rp": "1.1.1.1",
"flags": "SPF",
'msdp_learned': False,
'rp_bit': False,
"uptime": "00:00:03",
"rpf_nbr": "0.0.0.0",
},
"1.1.1.1": {
"expire": "00:02:57",
"flags": "PFT",
'msdp_learned': False,
'rp_bit': False,
"uptime": "00:00:03",
"rpf_info": "registering",
"rpf_nbr": "0.0.0.0",
"incoming_interface_list": {
"Loopback0": {
"rpf_info": "registering",
"rpf_nbr": "0.0.0.0"
}
}
},
"10.1.3.1": {
"expire": "00:02:57",
"flags": "PFT",
'msdp_learned': False,
'rp_bit': False,
"uptime": "00:00:03",
"rpf_info": "registering",
"rpf_nbr": "0.0.0.0",
"incoming_interface_list": {
"GigabitEthernet2": {
"rpf_info": "registering",
"rpf_nbr": "0.0.0.0"
}
}
}
}
},
"224.0.1.40": {
"source_address": {
"*": {
"expire": "00:02:56",
"outgoing_interface_list": {
"Loopback0": {
"expire": "00:02:56",
"uptime": "2d09h",
"state_mode": "forward/sparse"
}
},
"flags": "SCL",
'msdp_learned': False,
'rp_bit': False,
"rp": "2.2.2.2",
"uptime": "2d09h",
"rpf_nbr": "0.0.0.0",
}
}
},
"224.1.1.1": {
"source_address": {
"*": {
"expire": "00:02:54",
"outgoing_interface_list": {
"ATM0/0": {
"expire": "00:02:53",
"uptime": "00:03:57",
"vcd": "14",
"state_mode": "forward/sparse"
}
},
"flags": "SJ",
'msdp_learned': False,
'rp_bit': False,
"rp": "172.16.0.0",
"uptime": "00:03:57",
"rpf_nbr": "224.0.0.0224.0.0.0"}}}}}}}}}
golden_output = {'execute.return_value': '''\
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry, E - Extranet,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report,
Z - Multicast Tunnel, z - MDT-data group sender,
Y - Joined MDT-data group, y - Sending to MDT-data group,
G - Received BGP C-Mroute, g - Sent BGP C-Mroute,
N - Received BGP Shared-Tree Prune, n - BGP C-Mroute suppressed,
Q - Received BGP S-A Route, q - Sent BGP S-A Route,
V - RD & Vector, v - Vector, p - PIM Joins on route,
x - VxLAN group
Outgoing interface flags: H - Hardware switched, A - Assert winner, p - PIM Join
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
(*, 239.1.1.1), 00:00:03/stopped, RP 1.1.1.1, flags: SPF
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
(1.1.1.1, 239.1.1.1), 00:00:03/00:02:57, flags: PFT
Incoming interface: Loopback0, RPF nbr 0.0.0.0, Registering
Outgoing interface list: Null
(10.1.3.1, 239.1.1.1), 00:00:03/00:02:57, flags: PFT
Incoming interface: GigabitEthernet2, RPF nbr 0.0.0.0, Registering
Outgoing interface list: Null
(*, 224.0.1.40), 2d09h/00:02:56, RP 2.2.2.2, flags: SCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
Loopback0, Forward/Sparse, 2d09h/00:02:56
(*, 224.1.1.1), 00:03:57/00:02:54, RP 172.16.0.0, flags: SJ
Incoming interface: Null, RPF nbr 224.0.0.0224.0.0.0
Outgoing interface list:
ATM0/0, VCD 14, Forward/Sparse, 00:03:57/00:02:53
'''}
golden_parsed_output2 = {
"vrf": {
"VRF1": {
"address_family": {
"ipv4": {
"multicast_group": {
"239.1.1.1": {
"source_address": {
"11.11.11.11": {
"expire": "00:02:55",
"uptime": "00:00:04",
"flags": "PFT",
'msdp_learned': False,
'rp_bit': False,
"rpf_info": "registering",
"rpf_nbr": "0.0.0.0",
"incoming_interface_list": {
"Loopback1": {
"rpf_info": "registering",
"rpf_nbr": "0.0.0.0"
}
}
},
"*": {
"expire": "stopped",
"uptime": "00:00:04",
"flags": "SPF",
'msdp_learned': False,
'rp_bit': False,
"rp": "11.11.11.11",
"rpf_nbr": "0.0.0.0",
}
}
},
"224.0.1.40": {
"source_address": {
"*": {
"expire": "00:02:52",
"uptime": "00:08:58",
"rpf_nbr": "0.0.0.0",
"outgoing_interface_list": {
"Loopback1": {
"state_mode": "forward/sparse",
"uptime": "00:08:58",
"expire": "00:02:52"
}
},
"flags": "SJCL",
'msdp_learned': False,
'rp_bit': False,
"rp": "11.11.11.11"}}}}}}}}}
golden_output2 = {'execute.return_value': '''\
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry, E - Extranet,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report,
Z - Multicast Tunnel, z - MDT-data group sender,
Y - Joined MDT-data group, y - Sending to MDT-data group,
G - Received BGP C-Mroute, g - Sent BGP C-Mroute,
N - Received BGP Shared-Tree Prune, n - BGP C-Mroute suppressed,
Q - Received BGP S-A Route, q - Sent BGP S-A Route,
V - RD & Vector, v - Vector, p - PIM Joins on route,
x - VxLAN group
Outgoing interface flags: H - Hardware switched, A - Assert winner, p - PIM Join
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
(*, 239.1.1.1), 00:00:04/stopped, RP 11.11.11.11, flags: SPF
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
(11.11.11.11, 239.1.1.1), 00:00:04/00:02:55, flags: PFT
Incoming interface: Loopback1, RPF nbr 0.0.0.0, Registering
Outgoing interface list: Null
(*, 224.0.1.40), 00:08:58/00:02:52, RP 11.11.11.11, flags: SJCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
Loopback1, Forward/Sparse, 00:08:58/00:02:52
'''}
def test_empty(self):
self.device1 = Mock(**self.empty_output)
obj = ShowIpMroute(device=self.device1)
with self.assertRaises(SchemaEmptyParserError):
parsed_output = obj.parse()
def test_golden_vrf_default(self):
self.device = Mock(**self.golden_output)
obj = ShowIpMroute(device=self.device)
parsed_output = obj.parse()
self.maxDiff = None
self.assertEqual(parsed_output,self.golden_parsed_output)
def test_golden_vrf_non_default(self):
self.device = Mock(**self.golden_output2)
obj = ShowIpMroute(device=self.device)
parsed_output = obj.parse(vrf='VRF1')
self.maxDiff = None
self.assertEqual(parsed_output,self.golden_parsed_output2)
# =======================================
# Unit test for 'show ipv6 mroute'
# Unit test for 'show ipv6 mroute vrf xxx'
# =======================================
class test_show_ipv6_mroute(unittest.TestCase):
device = Device(name='aDevice')
empty_output = {'execute.return_value': ''}
golden_parsed_output = {
"vrf": {
"default": {
"address_family": {
"ipv6": {
"multicast_group": {
"FF07::1": {
"source_address": {
"2001:DB8:999::99": {
"outgoing_interface_list": {
"POS4/0": {
"state_mode": "forward",
"uptime": "00:02:06",
"expire": "00:03:27"
}
},
"incoming_interface_list": {
"POS1/0": {
"rpf_nbr": "2001:DB8:999::99"
}
},
"uptime": "00:02:06",
"flags": "SFT",
'rp_bit': False,
'msdp_learned': False,
"rpf_nbr": "2001:DB8:999::99",
"expire": "00:01:23"
},
"*": {
"outgoing_interface_list": {
"POS4/0": {
"state_mode": "forward",
"uptime": "00:04:45",
"expire": "00:02:47"
}
},
"incoming_interface_list": {
"Tunnel5": {
"rpf_nbr": "6:6:6::6"
}
},
"uptime": "00:04:45",
"rp": "2001:DB8:6::6",
"flags": "S",
'msdp_learned': False,
'rp_bit': False,
"rpf_nbr": "6:6:6::6",
"expire": "00:02:47"
}}}}}}}}}
golden_output = {'execute.return_value': '''\
Multicast Routing Table
Flags:D - Dense, S - Sparse, B - Bidir Group, s - SSM Group,
C - Connected, L - Local, I - Received Source Specific Host Report,
P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set,
J - Join SPT
Timers:Uptime/Expires
Interface state:Interface, State
(*, FF07::1), 00:04:45/00:02:47, RP 2001:DB8:6::6, flags:S
Incoming interface:Tunnel5
RPF nbr:6:6:6::6
Outgoing interface list:
POS4/0, Forward, 00:04:45/00:02:47
(2001:DB8:999::99, FF07::1), 00:02:06/00:01:23, flags:SFT
Incoming interface:POS1/0
RPF nbr:2001:DB8:999::99
Outgoing interface list:
POS4/0, Forward, 00:02:06/00:03:27
'''}
golden_parsed_output2 = {
"vrf": {
"VRF1": {
"address_family": {
"ipv6": {
"multicast_group": {
"FF07::1": {
"source_address": {
"2001:DB8:999::99": {
"outgoing_interface_list": {
"POS4/0": {
"state_mode": "forward",
"uptime": "00:02:06",
"expire": "00:03:27"
}
},
"incoming_interface_list": {
"POS1/0": {
"rpf_nbr": "2001:DB8:999::99"
}
},
"uptime": "00:02:06",
"flags": "SFT",
'msdp_learned': False,
'rp_bit': False,
"rpf_nbr": "2001:DB8:999::99",
"expire": "00:01:23"
},
"*": {
"outgoing_interface_list": {
"POS4/0": {
"state_mode": "forward",
"uptime": "00:04:45",
"expire": "00:02:47"
}
},
"incoming_interface_list": {
"Tunnel5": {
"rpf_nbr": "6:6:6::6"
}
},
"uptime": "00:04:45",
"rp": "2001:DB8:6::6",
"flags": "S",
'msdp_learned': False,
'rp_bit': False,
"rpf_nbr": "6:6:6::6",
"expire": "00:02:47"
}}}}}}}}}
golden_output2 = {'execute.return_value': '''\
Multicast Routing Table
Flags:D - Dense, S - Sparse, B - Bidir Group, s - SSM Group,
C - Connected, L - Local, I - Received Source Specific Host Report,
P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set,
J - Join SPT
Timers:Uptime/Expires
Interface state:Interface, State
(*, FF07::1), 00:04:45/00:02:47, RP 2001:DB8:6::6, flags:S
Incoming interface:Tunnel5
RPF nbr:6:6:6::6
Outgoing interface list:
POS4/0, Forward, 00:04:45/00:02:47
(2001:DB8:999::99, FF07::1), 00:02:06/00:01:23, flags:SFT
Incoming interface:POS1/0
RPF nbr:2001:DB8:999::99
Outgoing interface list:
POS4/0, Forward, 00:02:06/00:03:27
'''}
def test_empty(self):
self.device1 = Mock(**self.empty_output)
obj = ShowIpv6Mroute(device=self.device1)
with self.assertRaises(SchemaEmptyParserError):
parsed_output = obj.parse()
def test_golden_vrf_default(self):
self.device = Mock(**self.golden_output)
obj = ShowIpv6Mroute(device=self.device)
parsed_output = obj.parse()
self.assertEqual(parsed_output,self.golden_parsed_output)
def test_golden_vrf_non_default(self):
self.device = Mock(**self.golden_output2)
obj = ShowIpv6Mroute(device=self.device)
parsed_output = obj.parse(vrf='VRF1')
self.assertEqual(parsed_output,self.golden_parsed_output2)
# =============================================
# Unit test for 'show ip mroute static'
# Unit test for 'show ip mroute vrf xxx static'
# =============================================
class test_show_ip_mroute_static(unittest.TestCase):
device = Device(name='aDevice')
empty_output = {'execute.return_value': ''}
golden_parsed_output = {
"vrf": {
"default": {
"mroute": {
"172.16.0.0/16": {
"path": {
"172.30.10.13 1": {
"neighbor_address": "172.30.10.13",
"admin_distance": "1"
}
}
},
"172.16.1.0/24": {
"path": {
"172.30.10.13 1": {
"neighbor_address": "172.30.10.13",
"admin_distance": "1"
}}}}}}}
golden_output = {'execute.return_value': '''\
Mroute: 172.16.0.0/16, RPF neighbor: 172.30.10.13, distance: 1
Mroute: 172.16.1.0/24, RPF neighbor: 172.30.10.13, distance: 1
'''}
golden_parsed_output2 = {
"vrf": {
"VRF1": {
"mroute": {
"77.77.77.77/32": {
"path": {
"10.12.12.13 1": {
"neighbor_address": "10.12.12.13",
"admin_distance": "1"
}}}}}}}
golden_output2 = {'execute.return_value': '''\
Mroute: 77.77.77.77/32, RPF neighbor: 10.12.12.13, distance: 1
'''}
def test_empty(self):
self.device1 = Mock(**self.empty_output)
obj = ShowIpMrouteStatic(device=self.device1)
with self.assertRaises(SchemaEmptyParserError):
parsed_output = obj.parse()
def test_golden_vrf_default(self):
self.device = Mock(**self.golden_output)
obj = ShowIpMrouteStatic(device=self.device)
parsed_output = obj.parse()
self.assertEqual(parsed_output,self.golden_parsed_output)
def test_golden_vrf_non_default(self):
self.device = Mock(**self.golden_output2)
obj = ShowIpMrouteStatic(device=self.device)
parsed_output = obj.parse(vrf='VRF1')
self.assertEqual(parsed_output,self.golden_parsed_output2)
# =============================================
# Unit test for 'show ip multicast'
# Unit test for 'show ip multicast vrf xxx'
# =============================================
class test_show_ip_multicast(unittest.TestCase):
device = Device(name='aDevice')
empty_output = {'execute.return_value': ''}
golden_parsed_output = {
"vrf": {
"default": {
"enable": True,
"route_limit": "no limit",
"multipath": True,
"mo_frr": False,
"fallback_group_mode": "sparse",
"multicast_bound_with_filter_autorp": 0
}}}
golden_output = {'execute.return_value': '''\
Multicast Routing: enabled
Multicast Multipath: enabled
Multicast Route limit: No limit
Multicast Fallback group mode: Sparse
Number of multicast boundaries configured with filter-autorp option: 0
MoFRR: Disabled
'''}
golden_parsed_output2 = {
"vrf": {
"VRF1": {
"enable": True,
"route_limit": "no limit",
"multipath": False,
"mo_frr": False,
"fallback_group_mode": "sparse",
"multicast_bound_with_filter_autorp": 0
}}}
golden_output2 = {'execute.return_value': '''\
Multicast Routing: enabled
Multicast Multipath: disabled
Multicast Route limit: No limit
Multicast Fallback group mode: Sparse
Number of multicast boundaries configured with filter-autorp option: 0
MoFRR: Disabled
'''}
def test_empty(self):
self.device1 = Mock(**self.empty_output)
obj = ShowIpMulticast(device=self.device1)
with self.assertRaises(SchemaEmptyParserError):
parsed_output = obj.parse()
def test_golden_vrf_default(self):
self.device = Mock(**self.golden_output)
obj = ShowIpMulticast(device=self.device)
parsed_output = obj.parse()
self.assertEqual(parsed_output,self.golden_parsed_output)
def test_golden_vrf_non_default(self):
self.device = Mock(**self.golden_output2)
obj = ShowIpMulticast(device=self.device)
parsed_output = obj.parse(vrf='VRF1')
self.assertEqual(parsed_output,self.golden_parsed_output2)
if __name__ == '__main__':
unittest.main()
| 48.246479
| 88
| 0.345278
| 2,161
| 27,404
| 4.256826
| 0.114299
| 0.013262
| 0.01174
| 0.014784
| 0.903685
| 0.858028
| 0.821828
| 0.796282
| 0.7603
| 0.731601
| 0
| 0.088124
| 0.546161
| 27,404
| 568
| 89
| 48.246479
| 0.651524
| 0.024668
| 0
| 0.770791
| 0
| 0.044625
| 0.340385
| 0.016175
| 0
| 0
| 0
| 0
| 0.028398
| 1
| 0.024341
| false
| 0
| 0.010142
| 0
| 0.091278
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 1
| 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
| 8
|
4437f65b07d17ceb80835e32d9218b5961a7ec0a
| 4,382
|
py
|
Python
|
modules/select_threshold_op.py
|
shahrukhqasim/HGCalML
|
2808564b31c89d9b7eb882734f6aebc6f35e94f3
|
[
"BSD-3-Clause"
] | null | null | null |
modules/select_threshold_op.py
|
shahrukhqasim/HGCalML
|
2808564b31c89d9b7eb882734f6aebc6f35e94f3
|
[
"BSD-3-Clause"
] | null | null | null |
modules/select_threshold_op.py
|
shahrukhqasim/HGCalML
|
2808564b31c89d9b7eb882734f6aebc6f35e94f3
|
[
"BSD-3-Clause"
] | null | null | null |
import tensorflow as tf
from tensorflow.python.framework import ops
'''
Description
'''
#_selthresh_op = tf.load_op_library('select_threshold.so')
#@tf.function
def SelectThreshold(x, pl, rowsplits, hardness = 20., threshold=0.5):
'''
x >= 0
'''
if x.shape[0] is None: #keras pre-compile
return pl, rowsplits, tf.zeros_like(rowsplits), x
all_idxs = tf.expand_dims(tf.range(x.shape[0]),axis=1)
#make sure at least two survive so that the gradient is not cut off and there is a gradient w.r.t. selection!
#do this per RS
tf.print(x.shape, rowsplits.shape)
xragged = tf.RaggedTensor.from_row_splits(values=x,
row_splits=rowsplits)
#make sure at least one vertex per RS remains
max_per_rs = tf.reduce_max(xragged, axis=1)
global_max = tf.expand_dims(tf.reduce_min(max_per_rs),axis=0)-1e-6
threshold = tf.reduce_min(tf.concat([global_max, tf.zeros_like(global_max)+threshold],axis=0))
tf.print('threshold',threshold)
offset = -4.6/hardness # approx = - tf.math.log(1/0.01 - 1.)/hardness
weight = tf.nn.sigmoid( hardness*(x + offset - threshold) )
weighted_pl = weight * pl
tf.print('xmean, xmin',tf.reduce_mean(x), tf.reduce_min(x))
scatter_idxs = tf.expand_dims(all_idxs[x>=threshold],axis=1)
#print('scatter_idxs',scatter_idxs.shape)
new_rs = [tf.zeros((1,), dtype='int32') for i in tf.range(tf.shape(rowsplits)[0])]
ntot = tf.zeros((1,), dtype='int32')
for i in tf.range(tf.shape(rowsplits)[0]-1):
x_s = x[rowsplits[i]:rowsplits[i+1]][:,0]
n = tf.shape(x_s[x_s>=threshold])[0]
ntot += n
new_rs[i+1] = ntot
rs = tf.concat(new_rs, axis=0)
gathered = tf.gather_nd(weighted_pl, scatter_idxs)
gathered_threshvals = tf.gather_nd(x, scatter_idxs)
plout, rsnew, scat_idx, thout = tf.reshape(gathered, [-1, pl.shape[1]]), rs, scatter_idxs, gathered_threshvals
return plout, rsnew, scat_idx, thout
def SelectThresholdRagged(x, pl, rowsplits, hardness = 20., threshold=0.5):
'''
x >= 0
'''
if x.shape[0] is None: #keras pre-compile
return pl, rowsplits, tf.zeros_like(rowsplits), x
all_idxs = tf.expand_dims(tf.range(x.shape[0]),axis=1)
#make sure at least two survive so that the gradient is not cut off and there is a gradient w.r.t. selection!
#do this per RS
tf.print("HERE A")
tf.print(x.shape, rowsplits.shape)
xragged = tf.RaggedTensor.from_row_splits(values=x,
row_splits=rowsplits)
tf.print("HERE B")
#make sure at least one vertex per RS remains
max_per_rs = tf.reduce_max(xragged, axis=1)
threshold = tf.reduce_min(tf.concat([max_per_rs, tf.zeros_like(max_per_rs)+threshold],axis=1),axis=1,keepdims=True)
threshold +=xragged*0.#broadcast to right dimensions (hopefully already implemented in TF
tf.print(threshold,summarize=300)
tf.print('xragged',xragged.shape)
sel = xragged[xragged>threshold]
tf.print('sel',sel.shape)
global_max = tf.expand_dims(tf.reduce_min(max_per_rs),axis=0)-1e-2
threshold = tf.reduce_min(tf.concat([global_max, tf.zeros_like(global_max)+threshold],axis=0))
tf.print('threshold',threshold)
offset = -4.6/hardness # approx = - tf.math.log(1/0.01 - 1.)/hardness
weight = tf.nn.sigmoid( hardness*(x + offset - threshold) )
weighted_pl = weight * pl
tf.print('xmean',tf.reduce_mean(x))
scatter_idxs = tf.expand_dims(all_idxs[x>=threshold],axis=1)
#print('scatter_idxs',scatter_idxs.shape)
new_rs = [tf.zeros((1,), dtype='int32') for i in tf.range(tf.shape(rowsplits)[0])]
ntot = tf.zeros((1,), dtype='int32')
for i in tf.range(tf.shape(rowsplits)[0]-1):
x_s = x[rowsplits[i]:rowsplits[i+1]][:,0]
n = tf.shape(x_s[x_s>threshold])[0]
ntot += n
new_rs[i+1] = ntot
rs = tf.concat(new_rs, axis=0)
gathered = tf.gather_nd(weighted_pl, scatter_idxs)
gathered_threshvals = tf.gather_nd(x, scatter_idxs)
plout, rsnew, scat_idx, thout = tf.reshape(gathered, [-1, pl.shape[1]]), rs, scatter_idxs, gathered_threshvals
return plout, rsnew, scat_idx, thout
#SelectThreshold = SelectThresholdRagged
| 32.459259
| 119
| 0.643085
| 670
| 4,382
| 4.065672
| 0.195522
| 0.048458
| 0.026432
| 0.023495
| 0.820485
| 0.820485
| 0.810206
| 0.810206
| 0.810206
| 0.810206
| 0
| 0.02331
| 0.216796
| 4,382
| 135
| 120
| 32.459259
| 0.770396
| 0.165678
| 0
| 0.727273
| 0
| 0
| 0.021283
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.030303
| false
| 0
| 0.030303
| 0
| 0.121212
| 0.166667
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
44774d2593fa72d7f2069d6a42063f45184783df
| 4,774
|
py
|
Python
|
teraserver/python/tests/modules/FlaskModule/API/user/test_UserQueryStats.py
|
introlab/opentera
|
bfc4de672c9de40b7c9a659be2138731e7ee4e94
|
[
"Apache-2.0"
] | 10
|
2020-03-16T14:46:06.000Z
|
2022-02-11T16:07:38.000Z
|
teraserver/python/tests/modules/FlaskModule/API/user/test_UserQueryStats.py
|
introlab/opentera
|
bfc4de672c9de40b7c9a659be2138731e7ee4e94
|
[
"Apache-2.0"
] | 114
|
2019-09-16T13:02:50.000Z
|
2022-03-22T19:17:36.000Z
|
teraserver/python/tests/modules/FlaskModule/API/user/test_UserQueryStats.py
|
introlab/opentera
|
bfc4de672c9de40b7c9a659be2138731e7ee4e94
|
[
"Apache-2.0"
] | null | null | null |
from tests.modules.FlaskModule.API.BaseAPITest import BaseAPITest
import datetime
class UserQueryStatsTest(BaseAPITest):
login_endpoint = '/api/user/login'
test_endpoint = '/api/user/stats'
def setUp(self):
pass
def tearDown(self):
pass
def test_no_auth(self):
response = self._request_with_no_auth()
self.assertEqual(response.status_code, 401)
def test_query_no_params_as_admin(self):
response = self._request_with_http_auth(username='admin', password='admin')
self.assertEqual(response.status_code, 400)
def test_query_user_group_stats(self):
response = self._request_with_http_auth(username='admin', password='admin', payload='id_user_group=1')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/json')
json_data = response.json()
self.assertGreater(len(json_data), 0)
response = self._request_with_http_auth(username='user4', password='user4', payload='id_user_group=1')
self.assertEqual(response.status_code, 403)
def test_query_user_stats(self):
response = self._request_with_http_auth(username='admin', password='admin', payload='id_user=1')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/json')
json_data = response.json()
self.assertGreater(len(json_data), 0)
response = self._request_with_http_auth(username='user4', password='user4', payload='id_user=1')
self.assertEqual(response.status_code, 403)
def test_query_site_stats(self):
response = self._request_with_http_auth(username='admin', password='admin', payload='id_site=1')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/json')
json_data = response.json()
self.assertGreater(len(json_data), 0)
response = self._request_with_http_auth(username='user4', password='user4', payload='id_site=1')
self.assertEqual(response.status_code, 403)
def test_query_project_stats(self):
response = self._request_with_http_auth(username='admin', password='admin', payload='id_project=1')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/json')
json_data = response.json()
self.assertGreater(len(json_data), 0)
response = self._request_with_http_auth(username='user4', password='user4', payload='id_project=1')
self.assertEqual(response.status_code, 403)
def test_query_participant_group_stats(self):
response = self._request_with_http_auth(username='admin', password='admin', payload='id_group=1')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/json')
json_data = response.json()
self.assertGreater(len(json_data), 0)
response = self._request_with_http_auth(username='user4', password='user4', payload='id_group=1')
self.assertEqual(response.status_code, 403)
def test_query_session_stats(self):
response = self._request_with_http_auth(username='admin', password='admin', payload='id_session=1')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/json')
json_data = response.json()
self.assertGreater(len(json_data), 0)
response = self._request_with_http_auth(username='user4', password='user4', payload='id_session=1')
self.assertEqual(response.status_code, 403)
def test_query_participant_stats(self):
response = self._request_with_http_auth(username='admin', password='admin', payload='id_participant=1')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/json')
json_data = response.json()
self.assertGreater(len(json_data), 0)
response = self._request_with_http_auth(username='user4', password='user4', payload='id_participant=1')
self.assertEqual(response.status_code, 403)
def test_query_device_stats(self):
response = self._request_with_http_auth(username='admin', password='admin', payload='id_device=1')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Content-Type'], 'application/json')
json_data = response.json()
self.assertGreater(len(json_data), 0)
response = self._request_with_http_auth(username='user4', password='user4', payload='id_device=1')
self.assertEqual(response.status_code, 403)
| 46.803922
| 111
| 0.708211
| 588
| 4,774
| 5.479592
| 0.098639
| 0.121043
| 0.185599
| 0.128492
| 0.911235
| 0.882371
| 0.882371
| 0.88144
| 0.88144
| 0.849162
| 0
| 0.023612
| 0.166108
| 4,774
| 102
| 112
| 46.803922
| 0.785732
| 0
| 0
| 0.531646
| 0
| 0
| 0.128168
| 0
| 0
| 0
| 0
| 0
| 0.43038
| 1
| 0.151899
| false
| 0.240506
| 0.025316
| 0
| 0.21519
| 0
| 0
| 0
| 0
| null | 0
| 1
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 9
|
4487953d03119bc4003fd7518498bf178a8c1d5c
| 8,071
|
py
|
Python
|
games/test_save.py
|
wnormandin/resources
|
43be223b0c66e944985357a6d23891b551ac2937
|
[
"MIT"
] | null | null | null |
games/test_save.py
|
wnormandin/resources
|
43be223b0c66e944985357a6d23891b551ac2937
|
[
"MIT"
] | null | null | null |
games/test_save.py
|
wnormandin/resources
|
43be223b0c66e944985357a6d23891b551ac2937
|
[
"MIT"
] | null | null | null |
map_template = (
(
(0,0,0,0,0,3,3,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,3,3,3,0,1,1,1,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,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,3,3,3,0,1,0,0,3,3,3,1,1,1,1,1,1,1,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,1,0,0,0,0,0,3,3,3,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,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,1,0,0,0,0,0,0,1,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,0,1,0,0,0,0,3,3,3,0,0,0,0,0,3,3,3,0,0),
(0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,3,3,3,1,1,1,0,0,3,3,3,0,0),
(0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,0,1,0,0,0,0,3,3,3,1,1,1,0,0,3,3,3,0,0),
(0,0,0,3,3,3,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,0,0,0,0),
(0,0,0,3,D,3,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,1,0,1,1,0,0,0,0),
(0,0,0,3,3,3,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,1,0,1,0,0,0,0,0),
(0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,3,3,3,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,1,1,0,1,0,0,0,0,0),
(0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,3,3,3,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,0,1,0,1,0,0,0,0,0),
(0,0,0,0,0,0,0,0,1,0,1,3,3,3,3,3,3,3,3,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,0,0,0,0),
(0,0,0,0,0,0,0,0,1,1,1,3,3,3,3,3,1,1,0,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,0,0,1,1,1,0,0,1,0,1,0,0,0,0,0),
(0,0,0,0,0,0,0,1,1,0,0,3,3,3,3,3,1,1,1,0,1,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,0,0,0,0),
(0,0,0,0,0,0,0,1,1,0,0,3,3,3,3,3,1,1,1,0,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,3,3,3,0,0,0),
(0,0,0,0,0,0,0,1,1,0,0,3,3,3,3,3,1,0,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,3,3,3,0,0,0),
(0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,3,3,3,0,0,0),
(0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,1,0,3,3,3,3,3,1,0,1,0,0,0,0,0,0,0,0,0,0,1,1,3,3,3,1,0,1,0,0,0,0),
(0,0,0,0,0,0,0,0,1,3,3,3,0,0,0,0,1,1,1,1,3,3,3,3,3,1,1,1,1,1,0,0,0,0,0,0,0,3,3,3,3,3,3,0,0,1,0,0,0,0),
(0,0,0,0,0,0,0,0,1,3,3,3,1,1,1,1,1,1,1,1,3,3,3,3,3,0,0,3,3,3,0,0,0,0,0,0,0,3,3,3,3,3,3,0,0,1,0,0,0,0),
(0,0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0,0,0,1,3,3,3,3,3,0,0,3,3,3,0,0,0,0,0,0,0,3,3,3,1,0,1,0,0,1,0,0,0,0),
(0,0,0,0,0,0,0,3,3,3,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,0,3,3,3,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,1,0,0,0,0),
(0,0,0,0,0,0,0,3,3,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,3,3,3,3,3,3,3,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,3,3,3,3,3,S,3,3,0,0,0,0,0),
),
(
(0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,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,3,3,3,3,3,1,1,1,1,1,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,3,3,3,3,3,0,0,0,0,1,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,3,3,3,3,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,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,3,3,3,0,0,0,0,0,0,0,1,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,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,3,3,3,3,3,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,3,3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0),
(0,0,3,3,3,3,3,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,3,3,3,0,1,1,1,1,1,1,3,3,3,0,1,0,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,3,3,U,3,3,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,3,3,3,3,3,1,1,0,0,0,3,3,3,0,1,0,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,3,3,3,3,3,0,0,0,0,0,0,0,1,1,1,3,3,3,1,1,3,3,3,3,3,3,3,3,1,1,1,1,1,1,1,1,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,3,3,3,3,3,0,0,0,0,0,0,0,0,1,0,3,3,3,1,1,1,1,3,3,3,3,3,3,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,1,1,1,1,0),
(0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,3,3,3,0,0,1,1,1,3,3,3,3,3,0,1,0,0,0,1,3,3,3,3,3,3,3,3,3,1,1,1,1,1),
(0,0,0,1,1,0,0,0,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,1,1,3,3,3,3,3,0,1,0,0,0,0,3,3,3,3,3,3,3,3,3,1,0,0,0,1),
(0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,3,3,3,3,3,0,1,0,0,0,0,3,3,3,3,3,3,3,3,3,1,0,0,0,1),
(0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,3,3,3,3,3,3,3,3,3,0,0,0,1,1),
(0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,3,3,3,3,3,3,3,3,3,1),
(0,0,0,1,0,0,0,0,1,1,0,0,1,0,0,1,0,0,1,0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,3,3,3,3,3,0),
(0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,3,3,3,3,3,0),
(0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,3,3,3,3,3,0,0,0,0,1,0,0,0,0,3,3,3,0,0,0,1,0,3,3,3,3,3,0),
(0,0,0,3,3,3,3,3,0,1,0,0,0,0,0,0,1,0,1,0,0,0,3,3,3,3,3,0,0,0,0,1,0,0,0,0,3,3,3,1,1,1,1,0,3,3,3,3,3,0),
(0,0,0,3,3,3,3,3,1,1,1,1,1,0,0,0,1,0,1,0,0,0,3,3,3,3,3,0,0,0,0,1,0,0,0,0,3,3,3,0,0,1,1,0,0,0,0,0,0,0),
(0,0,0,3,3,3,3,3,1,1,0,0,0,0,0,0,1,1,1,1,1,1,3,3,3,3,3,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0),
(0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,1,0,1,0,0,0,3,3,3,3,3,0,0,0,3,3,3,3,3,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,1,0,1,0,0,0,0,0,1,1,0,0,0,0,3,3,3,3,3,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,D,3,3,0,0,0,0,0,3,3,3,3,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,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,3,3,3,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,1,0,1,1,0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,0,0,0,0,0,0,0,0,0,3,3,3,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,3,3,3,3,3,0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,1,1,1,0,3,3,3,3,3,3,3,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,1,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0),
(0,0,3,3,3,3,3,3,D,3,3,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0),
(0,0,3,3,3,3,3,3,3,3,3,0,1,0,0,3,3,3,3,3,0,3,3,3,3,3,0,3,3,3,0,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0),
(0,0,3,3,3,3,3,3,3,3,3,0,1,1,1,3,3,3,3,3,1,3,3,3,3,3,1,3,3,3,1,1,0,1,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0),
(0,0,3,3,3,3,3,3,3,3,1,1,1,1,1,3,3,3,3,3,1,3,3,3,3,3,1,3,3,3,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0),
(0,0,3,3,3,3,3,3,3,3,0,1,0,0,0,3,3,3,3,3,0,3,3,3,3,3,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1),
(0,0,0,0,0,0,0,3,3,3,0,0,0,0,0,3,3,3,3,3,0,3,3,3,3,3,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1),
(0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1),
(0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,1),
(0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,3,3,3,0,0,0,1,0,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,1),
(0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,3,3,3,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1),
(0,0,0,0,0,0,1,0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0,1,0,0,3,3,3,0,0,1,3,3,3,3,3,1,1,1,1,1,1,1,0,0,0,0,0,1),
(0,0,0,0,0,1,1,0,0,0,0,0,0,3,3,3,3,3,0,0,1,0,0,1,0,0,3,3,3,1,1,1,3,3,3,3,3,0,3,3,3,3,3,1,1,0,0,0,0,1),
(0,0,0,0,0,1,1,0,0,0,0,0,0,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,0,3,3,3,3,3,0,1,0,0,0,0,1),
(0,0,0,0,0,1,1,0,0,0,0,0,0,3,3,3,3,3,0,0,0,1,0,0,0,1,0,1,1,1,1,1,3,3,3,3,3,1,3,3,3,3,3,0,1,1,1,1,1,1),
(0,0,0,0,0,0,1,0,0,0,0,0,0,3,3,3,3,3,0,0,0,1,0,0,0,0,0,1,0,0,0,0,3,3,3,3,3,1,3,3,3,3,3,0,3,3,3,3,3,0),
(0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,3,3,3,3,3,0,3,3,3,3,3,0),
(0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,3,3,3,3,3,0,0,0,0,1,0,1,0,3,3,3,3,3,3,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,3,3,3,0,0,3,3,3,3,3,1,1,1,1,1,1,1,1,3,3,3,3,3,3,0),
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,3,3,3,0,0,3,3,U,3,3,0,0,0,0,0,0,0,0,3,3,3,3,3,3,0),
),
)
| 96.083333
| 106
| 0.466113
| 3,752
| 8,071
| 1.002399
| 0.002132
| 0.979527
| 1.210051
| 1.323052
| 0.996543
| 0.996543
| 0.995746
| 0.995746
| 0.994682
| 0.993087
| 0
| 0.487881
| 0.049188
| 8,071
| 83
| 107
| 97.240964
| 0.002215
| 0
| 0
| 0.036145
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 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
| 12
|
924c24cf1136275f13acf61eb5792207973ff9a3
| 89
|
py
|
Python
|
tools/showRGB/test.py
|
hebingyedu/Hyperspetral-Image-segmentation
|
f5c89358cb57227eb88ed9e49597a548c083e0dc
|
[
"MIT"
] | 1
|
2021-07-17T00:30:00.000Z
|
2021-07-17T00:30:00.000Z
|
tools/showRGB/test.py
|
hebingyedu/Hyperspetral-Image-segmentation
|
f5c89358cb57227eb88ed9e49597a548c083e0dc
|
[
"MIT"
] | null | null | null |
tools/showRGB/test.py
|
hebingyedu/Hyperspetral-Image-segmentation
|
f5c89358cb57227eb88ed9e49597a548c083e0dc
|
[
"MIT"
] | null | null | null |
# coding=utf-8
import sys
def fun(file,filedir,str1,a):
print(file,filedir,str1,a)
| 12.714286
| 30
| 0.696629
| 16
| 89
| 3.875
| 0.75
| 0.354839
| 0.483871
| 0.516129
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.039474
| 0.146067
| 89
| 6
| 31
| 14.833333
| 0.776316
| 0.134831
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0.333333
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
92699a34571c33e20ce68dc0f23fe874ea31f2a2
| 136
|
py
|
Python
|
app/data_sources/__init__.py
|
theposter/food-server
|
d6a1a9e1300d35ff4642463f0a73074b1440c648
|
[
"MIT"
] | null | null | null |
app/data_sources/__init__.py
|
theposter/food-server
|
d6a1a9e1300d35ff4642463f0a73074b1440c648
|
[
"MIT"
] | null | null | null |
app/data_sources/__init__.py
|
theposter/food-server
|
d6a1a9e1300d35ff4642463f0a73074b1440c648
|
[
"MIT"
] | null | null | null |
from flask import Blueprint
data_sources_blueprint = Blueprint("data_sources_blueprint", __name__)
from app.data_sources import routes
| 27.2
| 70
| 0.852941
| 18
| 136
| 5.944444
| 0.5
| 0.308411
| 0.373832
| 0.542056
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095588
| 136
| 5
| 71
| 27.2
| 0.869919
| 0
| 0
| 0
| 0
| 0
| 0.160584
| 0.160584
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 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
| 1
| 1
|
0
| 8
|
929e7a3e54eeadb796e60618fd4242c7b1dec728
| 49,187
|
py
|
Python
|
com/vmware/nsx/serviceinsertion/services/service_instances_client.py
|
adammillerio/vsphere-automation-sdk-python
|
c07e1be98615201139b26c28db3aa584c4254b66
|
[
"MIT"
] | null | null | null |
com/vmware/nsx/serviceinsertion/services/service_instances_client.py
|
adammillerio/vsphere-automation-sdk-python
|
c07e1be98615201139b26c28db3aa584c4254b66
|
[
"MIT"
] | null | null | null |
com/vmware/nsx/serviceinsertion/services/service_instances_client.py
|
adammillerio/vsphere-automation-sdk-python
|
c07e1be98615201139b26c28db3aa584c4254b66
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2020 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.nsx.serviceinsertion.services.service_instances.
#---------------------------------------------------------------------------
"""
"""
__author__ = 'VMware, Inc.'
__docformat__ = 'restructuredtext en'
import sys
from vmware.vapi.bindings import type
from vmware.vapi.bindings.converter import TypeConverter
from vmware.vapi.bindings.enum import Enum
from vmware.vapi.bindings.error import VapiError
from vmware.vapi.bindings.struct import VapiStruct
from vmware.vapi.bindings.stub import (
ApiInterfaceStub, StubFactoryBase, VapiInterface)
from vmware.vapi.bindings.common import raise_core_exception
from vmware.vapi.data.validator import (UnionValidator, HasFieldsOfValidator)
from vmware.vapi.exception import CoreException
from vmware.vapi.lib.constants import TaskType
from vmware.vapi.lib.rest import OperationRestMetadata
class GroupAssociations(VapiInterface):
"""
"""
_VAPI_SERVICE_ID = 'com.vmware.nsx.serviceinsertion.services.service_instances.group_associations'
"""
Identifier of the service in canonical form.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _GroupAssociationsStub)
self._VAPI_OPERATION_IDS = {}
def get(self,
service_id,
service_instance_id,
):
"""
Returns list of NSGroups used in Service Insertion North-South rules
for a given Service Instance.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:rtype: :class:`com.vmware.nsx.model_client.ServiceInstanceNSGroups`
:return: com.vmware.nsx.model.ServiceInstanceNSGroups
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('get',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
})
class InstanceEndpoints(VapiInterface):
"""
"""
_VAPI_SERVICE_ID = 'com.vmware.nsx.serviceinsertion.services.service_instances.instance_endpoints'
"""
Identifier of the service in canonical form.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _InstanceEndpointsStub)
self._VAPI_OPERATION_IDS = {}
def create(self,
service_id,
service_instance_id,
instance_endpoint,
):
"""
Adds a new instance endpoint. It belongs to one service instance and is
attached to one service attachment. It represents a redirection target
for a Rule.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:type instance_endpoint: :class:`com.vmware.nsx.model_client.InstanceEndpoint`
:param instance_endpoint: (required)
:rtype: :class:`com.vmware.nsx.model_client.InstanceEndpoint`
:return: com.vmware.nsx.model.InstanceEndpoint
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('create',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
'instance_endpoint': instance_endpoint,
})
def delete(self,
service_id,
service_instance_id,
instance_endpoint_id,
):
"""
Delete instance endpoint information for a given instace endpoint.
Please make sure to delete all the Service Insertion Rules, which refer
to this Endpoint as 'redirect_tos' target.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:type instance_endpoint_id: :class:`str`
:param instance_endpoint_id: (required)
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('delete',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
'instance_endpoint_id': instance_endpoint_id,
})
def get(self,
service_id,
service_instance_id,
instance_endpoint_id,
):
"""
Returns detailed Endpoint information for a given InstanceEndpoint.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:type instance_endpoint_id: :class:`str`
:param instance_endpoint_id: (required)
:rtype: :class:`com.vmware.nsx.model_client.InstanceEndpoint`
:return: com.vmware.nsx.model.InstanceEndpoint
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('get',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
'instance_endpoint_id': instance_endpoint_id,
})
def list(self,
service_id,
service_instance_id,
):
"""
List all InstanceEndpoints of a service instance.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:rtype: :class:`com.vmware.nsx.model_client.InstanceEndpointListResult`
:return: com.vmware.nsx.model.InstanceEndpointListResult
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('list',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
})
class InstanceRuntimes(VapiInterface):
"""
"""
CREATE_ACTION_ENABLE_MAINTENANCE_MODE = "enable_maintenance_mode"
"""
Possible value for ``action`` of method :func:`InstanceRuntimes.create`.
"""
CREATE_ACTION_DISABLE_MAINTENANCE_MODE = "disable_maintenance_mode"
"""
Possible value for ``action`` of method :func:`InstanceRuntimes.create`.
"""
CREATE_ACTION_IS_HEALTHY = "is_healthy"
"""
Possible value for ``action`` of method :func:`InstanceRuntimes.create`.
"""
CREATE_ACTION_IS_STOPPED = "is_stopped"
"""
Possible value for ``action`` of method :func:`InstanceRuntimes.create`.
"""
CREATE_ACTION_IS_NOT_RESPONDING = "is_not_responding"
"""
Possible value for ``action`` of method :func:`InstanceRuntimes.create`.
"""
_VAPI_SERVICE_ID = 'com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes'
"""
Identifier of the service in canonical form.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _InstanceRuntimesStub)
self._VAPI_OPERATION_IDS = {}
def create(self,
service_id,
service_instance_id,
instance_runtime_id,
action=None,
unhealthy_reason=None,
):
"""
Set service VM either in or out of maintenance mode for maintenance
mode, or in service or out of service for runtime state. Only one value
can be set at one time.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:type instance_runtime_id: :class:`str`
:param instance_runtime_id: (required)
:type action: :class:`str` or ``None``
:param action: (optional)
:type unhealthy_reason: :class:`str` or ``None``
:param unhealthy_reason: Reason for the unhealthy state (optional)
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('create',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
'instance_runtime_id': instance_runtime_id,
'action': action,
'unhealthy_reason': unhealthy_reason,
})
def delete(self,
service_id,
service_instance_id,
):
"""
Undeploy one service VM as standalone or two service VMs as HA.
Associated deployment information and instance runtime will also be
deleted once service VMs have been un-deployed successfully.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('delete',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
})
def deploy(self,
service_id,
service_instance_id,
):
"""
Deploys one service VM as standalone, or two service VMs as HA where
one VM is active and another one is standby. During the deployment of
service VMs, service will be set up based on deployment events using
callbacks.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('deploy',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
})
def list(self,
service_id,
service_instance_id,
):
"""
Returns list of instance runtimes of service VMs being deployed for a
given service instance id
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:rtype: :class:`com.vmware.nsx.model_client.InstanceRuntimeListResult`
:return: com.vmware.nsx.model.InstanceRuntimeListResult
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('list',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
})
def upgrade(self,
service_id,
service_instance_id,
):
"""
Upgrade service VMs using newer version of OVF. In case of HA, the
stand-by service VM will be upgrade first. Once it has been upgraded,
it switches to be the Active one and then the other VM will be upgrade.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('upgrade',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
})
class State(VapiInterface):
"""
"""
_VAPI_SERVICE_ID = 'com.vmware.nsx.serviceinsertion.services.service_instances.state'
"""
Identifier of the service in canonical form.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _StateStub)
self._VAPI_OPERATION_IDS = {}
def get(self,
service_id,
service_instance_id,
):
"""
Returns configuration state of one instance of a deployed partner
service using service insertion framework.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:rtype: :class:`com.vmware.nsx.model_client.ConfigurationState`
:return: com.vmware.nsx.model.ConfigurationState
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('get',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
})
class Status(VapiInterface):
"""
"""
GET_SOURCE_REALTIME = "realtime"
"""
Possible value for ``source`` of method :func:`Status.get`.
"""
GET_SOURCE_CACHED = "cached"
"""
Possible value for ``source`` of method :func:`Status.get`.
"""
_VAPI_SERVICE_ID = 'com.vmware.nsx.serviceinsertion.services.service_instances.status'
"""
Identifier of the service in canonical form.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _StatusStub)
self._VAPI_OPERATION_IDS = {}
def get(self,
service_id,
service_instance_id,
source=None,
):
"""
Returns status of one instance of a deployed partner service using
service insertion framework. By default this API would return cached
status. Caching happens every 3 minutes. For realtime status, query
parameter \"source=realtime\" needs to be passed.
:type service_id: :class:`str`
:param service_id: (required)
:type service_instance_id: :class:`str`
:param service_instance_id: (required)
:type source: :class:`str` or ``None``
:param source: Data source type. (optional)
:rtype: :class:`com.vmware.nsx.model_client.ServiceInstanceStatus`
:return: com.vmware.nsx.model.ServiceInstanceStatus
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest`
Bad Request, Precondition Failed
:raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError`
Internal Server Error
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
Forbidden
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
Not Found
"""
return self._invoke('get',
{
'service_id': service_id,
'service_instance_id': service_instance_id,
'source': source,
})
class _GroupAssociationsStub(ApiInterfaceStub):
def __init__(self, config):
# properties for get operation
get_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
})
get_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
get_input_value_validator_list = [
]
get_output_validator_list = [
]
get_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/group-associations',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
},
content_type='application/json'
)
operations = {
'get': {
'input_type': get_input_type,
'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ServiceInstanceNSGroups'),
'errors': get_error_dict,
'input_value_validator_list': get_input_value_validator_list,
'output_validator_list': get_output_validator_list,
'task_type': TaskType.NONE,
},
}
rest_metadata = {
'get': get_rest_metadata,
}
ApiInterfaceStub.__init__(
self, iface_name='com.vmware.nsx.serviceinsertion.services.service_instances.group_associations',
config=config, operations=operations, rest_metadata=rest_metadata,
is_vapi_rest=False)
class _InstanceEndpointsStub(ApiInterfaceStub):
def __init__(self, config):
# properties for create operation
create_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
'instance_endpoint': type.ReferenceType('com.vmware.nsx.model_client', 'InstanceEndpoint'),
})
create_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
create_input_value_validator_list = [
]
create_output_validator_list = [
]
create_rest_metadata = OperationRestMetadata(
http_method='POST',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-endpoints',
request_body_parameter='instance_endpoint',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
},
content_type='application/json'
)
# properties for delete operation
delete_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
'instance_endpoint_id': type.StringType(),
})
delete_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
delete_input_value_validator_list = [
]
delete_output_validator_list = [
]
delete_rest_metadata = OperationRestMetadata(
http_method='DELETE',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-endpoints/{instance-endpoint-id}',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
'instance_endpoint_id': 'instance-endpoint-id',
},
query_parameters={
},
content_type='application/json'
)
# properties for get operation
get_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
'instance_endpoint_id': type.StringType(),
})
get_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
get_input_value_validator_list = [
]
get_output_validator_list = [
]
get_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-endpoints/{instance-endpoint-id}',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
'instance_endpoint_id': 'instance-endpoint-id',
},
query_parameters={
},
content_type='application/json'
)
# properties for list operation
list_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
})
list_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
list_input_value_validator_list = [
]
list_output_validator_list = [
]
list_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-endpoints',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
},
content_type='application/json'
)
operations = {
'create': {
'input_type': create_input_type,
'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'InstanceEndpoint'),
'errors': create_error_dict,
'input_value_validator_list': create_input_value_validator_list,
'output_validator_list': create_output_validator_list,
'task_type': TaskType.NONE,
},
'delete': {
'input_type': delete_input_type,
'output_type': type.VoidType(),
'errors': delete_error_dict,
'input_value_validator_list': delete_input_value_validator_list,
'output_validator_list': delete_output_validator_list,
'task_type': TaskType.NONE,
},
'get': {
'input_type': get_input_type,
'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'InstanceEndpoint'),
'errors': get_error_dict,
'input_value_validator_list': get_input_value_validator_list,
'output_validator_list': get_output_validator_list,
'task_type': TaskType.NONE,
},
'list': {
'input_type': list_input_type,
'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'InstanceEndpointListResult'),
'errors': list_error_dict,
'input_value_validator_list': list_input_value_validator_list,
'output_validator_list': list_output_validator_list,
'task_type': TaskType.NONE,
},
}
rest_metadata = {
'create': create_rest_metadata,
'delete': delete_rest_metadata,
'get': get_rest_metadata,
'list': list_rest_metadata,
}
ApiInterfaceStub.__init__(
self, iface_name='com.vmware.nsx.serviceinsertion.services.service_instances.instance_endpoints',
config=config, operations=operations, rest_metadata=rest_metadata,
is_vapi_rest=False)
class _InstanceRuntimesStub(ApiInterfaceStub):
def __init__(self, config):
# properties for create operation
create_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
'instance_runtime_id': type.StringType(),
'action': type.OptionalType(type.StringType()),
'unhealthy_reason': type.OptionalType(type.StringType()),
})
create_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
create_input_value_validator_list = [
]
create_output_validator_list = [
]
create_rest_metadata = OperationRestMetadata(
http_method='POST',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes/{instance-runtime-id}',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
'instance_runtime_id': 'instance-runtime-id',
},
query_parameters={
'action': 'action',
'unhealthy_reason': 'unhealthy_reason',
},
content_type='application/json'
)
# properties for delete operation
delete_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
})
delete_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
delete_input_value_validator_list = [
]
delete_output_validator_list = [
]
delete_rest_metadata = OperationRestMetadata(
http_method='POST',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=delete',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
},
content_type='application/json'
)
# properties for deploy operation
deploy_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
})
deploy_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
deploy_input_value_validator_list = [
]
deploy_output_validator_list = [
]
deploy_rest_metadata = OperationRestMetadata(
http_method='POST',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=deploy',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
},
content_type='application/json'
)
# properties for list operation
list_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
})
list_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
list_input_value_validator_list = [
]
list_output_validator_list = [
]
list_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
},
content_type='application/json'
)
# properties for upgrade operation
upgrade_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
})
upgrade_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
upgrade_input_value_validator_list = [
]
upgrade_output_validator_list = [
]
upgrade_rest_metadata = OperationRestMetadata(
http_method='POST',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=upgrade',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
},
content_type='application/json'
)
operations = {
'create': {
'input_type': create_input_type,
'output_type': type.VoidType(),
'errors': create_error_dict,
'input_value_validator_list': create_input_value_validator_list,
'output_validator_list': create_output_validator_list,
'task_type': TaskType.NONE,
},
'delete': {
'input_type': delete_input_type,
'output_type': type.VoidType(),
'errors': delete_error_dict,
'input_value_validator_list': delete_input_value_validator_list,
'output_validator_list': delete_output_validator_list,
'task_type': TaskType.NONE,
},
'deploy': {
'input_type': deploy_input_type,
'output_type': type.VoidType(),
'errors': deploy_error_dict,
'input_value_validator_list': deploy_input_value_validator_list,
'output_validator_list': deploy_output_validator_list,
'task_type': TaskType.NONE,
},
'list': {
'input_type': list_input_type,
'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'InstanceRuntimeListResult'),
'errors': list_error_dict,
'input_value_validator_list': list_input_value_validator_list,
'output_validator_list': list_output_validator_list,
'task_type': TaskType.NONE,
},
'upgrade': {
'input_type': upgrade_input_type,
'output_type': type.VoidType(),
'errors': upgrade_error_dict,
'input_value_validator_list': upgrade_input_value_validator_list,
'output_validator_list': upgrade_output_validator_list,
'task_type': TaskType.NONE,
},
}
rest_metadata = {
'create': create_rest_metadata,
'delete': delete_rest_metadata,
'deploy': deploy_rest_metadata,
'list': list_rest_metadata,
'upgrade': upgrade_rest_metadata,
}
ApiInterfaceStub.__init__(
self, iface_name='com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes',
config=config, operations=operations, rest_metadata=rest_metadata,
is_vapi_rest=False)
class _StateStub(ApiInterfaceStub):
def __init__(self, config):
# properties for get operation
get_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
})
get_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
get_input_value_validator_list = [
]
get_output_validator_list = [
]
get_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/state',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
},
content_type='application/json'
)
operations = {
'get': {
'input_type': get_input_type,
'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ConfigurationState'),
'errors': get_error_dict,
'input_value_validator_list': get_input_value_validator_list,
'output_validator_list': get_output_validator_list,
'task_type': TaskType.NONE,
},
}
rest_metadata = {
'get': get_rest_metadata,
}
ApiInterfaceStub.__init__(
self, iface_name='com.vmware.nsx.serviceinsertion.services.service_instances.state',
config=config, operations=operations, rest_metadata=rest_metadata,
is_vapi_rest=False)
class _StatusStub(ApiInterfaceStub):
def __init__(self, config):
# properties for get operation
get_input_type = type.StructType('operation-input', {
'service_id': type.StringType(),
'service_instance_id': type.StringType(),
'source': type.OptionalType(type.StringType()),
})
get_error_dict = {
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.invalid_request':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
'com.vmware.vapi.std.errors.internal_server_error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
}
get_input_value_validator_list = [
]
get_output_validator_list = [
]
get_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/status',
path_variables={
'service_id': 'service-id',
'service_instance_id': 'service-instance-id',
},
query_parameters={
'source': 'source',
},
content_type='application/json'
)
operations = {
'get': {
'input_type': get_input_type,
'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ServiceInstanceStatus'),
'errors': get_error_dict,
'input_value_validator_list': get_input_value_validator_list,
'output_validator_list': get_output_validator_list,
'task_type': TaskType.NONE,
},
}
rest_metadata = {
'get': get_rest_metadata,
}
ApiInterfaceStub.__init__(
self, iface_name='com.vmware.nsx.serviceinsertion.services.service_instances.status',
config=config, operations=operations, rest_metadata=rest_metadata,
is_vapi_rest=False)
class StubFactory(StubFactoryBase):
_attrs = {
'GroupAssociations': GroupAssociations,
'InstanceEndpoints': InstanceEndpoints,
'InstanceRuntimes': InstanceRuntimes,
'State': State,
'Status': Status,
}
| 42.920593
| 156
| 0.600525
| 4,799
| 49,187
| 5.905814
| 0.057929
| 0.067956
| 0.082563
| 0.101616
| 0.889669
| 0.87739
| 0.856856
| 0.846129
| 0.841296
| 0.827429
| 0
| 0.000516
| 0.290951
| 49,187
| 1,145
| 157
| 42.958079
| 0.812134
| 0.240145
| 0
| 0.693481
| 1
| 0.016644
| 0.332125
| 0.218991
| 0
| 0
| 0
| 0
| 0
| 1
| 0.030513
| false
| 0.005548
| 0.016644
| 0
| 0.097087
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
2bc0ad49b420d24603e00ae1363b8d740cf99717
| 2,635
|
py
|
Python
|
src/old/test-eval.py
|
willbr/ie
|
484fc5288f720cb15efb84b4a9ecfcfe34c9099b
|
[
"MIT"
] | null | null | null |
src/old/test-eval.py
|
willbr/ie
|
484fc5288f720cb15efb84b4a9ecfcfe34c9099b
|
[
"MIT"
] | null | null | null |
src/old/test-eval.py
|
willbr/ie
|
484fc5288f720cb15efb84b4a9ecfcfe34c9099b
|
[
"MIT"
] | null | null | null |
import unittest
import src.eval
def setup_stack(s):
rs = reversed(s.split())
src.eval.input_stack = list(rs)
class Prefix_Tests(unittest.TestCase):
def setUp(self):
src.eval.input_stack = []
def test_simple(self):
setup_stack("+ 1 2 ]")
r = src.eval.parse_prefix()
er = "1 2 +".split()
self.assertEqual(r,er)
def test_child_prefix(self):
setup_stack("+ 1 [ + 2 3 ] ]")
r = src.eval.parse_prefix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def test_child_infix(self):
setup_stack("+ 1 ( 2 + 3 ) ]")
r = src.eval.parse_prefix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def test_child_postfix(self):
setup_stack("+ 1 { 2 3 + } ]")
r = src.eval.parse_prefix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def on_cleanup(self):
print("clean")
class Infix_Tests(unittest.TestCase):
def setUp(self):
src.eval.input_stack = []
def test_simple(self):
setup_stack("1 + 2 )")
r = src.eval.parse_infix()
er = "1 2 +".split()
self.assertEqual(r,er)
def test_child_prefix(self):
setup_stack("1 + [ + 2 3 ] )")
r = src.eval.parse_infix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def test_child_infix(self):
setup_stack("1 + ( 2 + 3 ) )")
r = src.eval.parse_infix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def test_child_postfix(self):
setup_stack("1 + { 2 3 + } )")
r = src.eval.parse_infix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def on_cleanup(self):
print("clean")
class Postfix_Tests(unittest.TestCase):
def setUp(self):
src.eval.input_stack = []
def test_simple(self):
setup_stack("1 2 + }")
r = src.eval.parse_postfix()
er = "1 2 +".split()
self.assertEqual(r,er)
def test_child_prefix(self):
setup_stack("1 [ + 2 3 ] + }")
r = src.eval.parse_postfix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def test_child_infix(self):
setup_stack("1 ( 2 + 3 ) + }")
r = src.eval.parse_postfix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def test_child_postfix(self):
setup_stack("1 { 2 3 + } + }")
r = src.eval.parse_postfix()
er = "1 2 3 + +".split()
self.assertEqual(r,er)
def on_cleanup(self):
print("clean")
if __name__ == '__main__':
unittest.main()
| 24.626168
| 39
| 0.527514
| 357
| 2,635
| 3.714286
| 0.103641
| 0.036199
| 0.040724
| 0.135747
| 0.905732
| 0.905732
| 0.905732
| 0.905732
| 0.892157
| 0.892157
| 0
| 0.036545
| 0.314611
| 2,635
| 106
| 40
| 24.858491
| 0.697674
| 0
| 0
| 0.731707
| 0
| 0
| 0.104404
| 0
| 0
| 0
| 0
| 0
| 0.146341
| 1
| 0.231707
| false
| 0
| 0.02439
| 0
| 0.292683
| 0.036585
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
920e481c47e3ad293459fa71aae4cfcc19357f10
| 288,119
|
py
|
Python
|
Cgasn.py
|
fireballpoint1/fortranTOpy
|
55843a62c6f0a2f8e2a777ef70193940d3d2d141
|
[
"Apache-2.0"
] | 1
|
2018-08-26T05:10:56.000Z
|
2018-08-26T05:10:56.000Z
|
Cgasn.py
|
fireballpoint1/fortranTOpy
|
55843a62c6f0a2f8e2a777ef70193940d3d2d141
|
[
"Apache-2.0"
] | null | null | null |
Cgasn.py
|
fireballpoint1/fortranTOpy
|
55843a62c6f0a2f8e2a777ef70193940d3d2d141
|
[
"Apache-2.0"
] | 1
|
2018-06-26T18:06:44.000Z
|
2018-06-26T18:06:44.000Z
|
import math
import numpy
def CGAS1(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
#DIMENSION
PRSH=[[[0 for x in range(3+1)]for y in range(17+1)] for z in range(17+1)]
PRSHBT=[[0 for x in range(3+1)] for y in range(17+1)]
ESH=[[0 for x in range(3+1)] for y in range(17+1)]
AUG=[[[[0 for x in range(3+1)] for y in range(17+1)] for z in range(17+1)] for a in range(17+1)]
RAD=[[[0 for x in range(3+1)]for y in range(17+1)] for z in range(17+1)]
XPE=[[[0 for x in range(3+1)]for y in range(17+1)] for z in range(60+1)]
YPE=[[[0 for x in range(3+1)]for y in range(17+1)] for z in range(60+1)]
XCP=[[0 for x in range(3+1)] for y in range(54+1)]
YRY=[[0 for x in range(3+1)] for y in range(54+1)]
YCP=[[0 for x in range(3+1)] for y in range(54+1)]
YPP=[[0 for x in range(3+1)] for y in range(54+1)]
FFAR=[[0 for x in range(3+1)] for y in range(45+1)]
FFAC=[[0 for x in range(3+1)] for y in range(45+1)]
IZ=[0 for x in range(3+1)]
AMZ=[0 for x in range(3+1)]
INIOCC=[[0 for x in range(3+1)] for y in range(17+1)]
#DIMENSION
INIOC=numpy.zeros((17+1))
PRBSH=numpy.zeros((17+1,17+1))
ES=numpy.zeros((17+1))
R=numpy.zeros((17+1,17+1))
A=[numpy.zeros((17+1,17+1)) for z in range(17+1)]
PRBSHBT=numpy.zeros((17+1))
#DIMENSION
INIOCF=numpy.zeros((17+1))
PRBSHF=numpy.zeros((17+1,17+1))
ESF=numpy.zeros((17+1))
RF=numpy.zeros((17+1,17+1))
AF=[numpy.zeros((17+1,17+1)) for z in range(17+1)]
PRBSHBTF=numpy.zeros((17+1))
#DIMENSION
XPEK=[0 for x in range(49+1)]
YPEK=[0 for x in range(49+1)]
XPEL1=[0 for x in range(54+1)]
YPEL1=[0 for x in range(54+1)]
XPEL2=[0 for x in range(54+1)]
YPEL2=[0 for x in range(54+1)]
XCOMC=[0 for x in range(54+1)]
YRAYC=[0 for x in range(54+1)]
YCOMC=[0 for x in range(54+1)]
YPAPC=[0 for x in range(54+1)]
FFRC=[0 for x in range(45+1)]
FFCC=[0 for x in range(45+1)]
#DIMENSION
XPEKF=[0 for x in range(45+1)]
YPEKF=[0 for x in range(45+1)]
XPEL1F=[0 for x in range(53+1)]
YPEL1F=[0 for x in range(53+1)]
XPEL2F=[0 for x in range(55+1)]
YPEL2F=[0 for x in range(55+1)]
XPEL3F=[0 for x in range(55+1)]
YPEL3F=[0 for x in range(55+1)]
XCOMF=[0 for x in range(54+1)]
YRAYF=[0 for x in range(54+1)]
YCOMF=[0 for x in range(54+1)]
YPAPF=[0 for x in range(54+1)]
FFRF=[0 for x in range(45+1)]
FFCF=[0 for x in range(45+1)]
#
# CF4 FOR CASCADE CALCULATIONS
#
# CARBON DATA
# LEVEL OCCUPANCY FOR GROUND STATE
INIOC=[2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
# AVERAGE SHAKE OFF ELECTRON ENERGY
ES=[10.00,2.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]
# SHAKE OFF : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
PRBSH=[0.20,3.00,9.00,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.80,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,238*0.0]
# SHAKE OFF : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
PRBSHBT=[2.74,12.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
A[1][2][2]=[0.858]
A[1][2][3]=[0.824]
A[1][3][3]=[0.378]
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
R[1][2]=[1.50E-14]
R[1][3]=[3.45E-5]
R[1][4]=[6.88E-5]
# L1 SHELL
R[2][3]=[1.20E-7]
R[2][4]=[2.41E-7]
# L2 SHELL
R[3][4]=[1.55E-21]
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC 5(1973)50
# K SHELL 1S 1/2
YPEK=[9.26E5,7.98E5,4.81E5,2.35E5,1.21E5,8.42E4,6.57E4,5.09E4,4.20E4,1.33E4,5.73E3,1.70E3,707.,354.,200.,80.4,39.3,10.6,4.12,1.08,.415,.197,.107,.0411,.0195,.00512,.00201,5.64E-4,2.41E-4,1.29E-4,8.05E-5,4.06E-5,2.52E-5,1.19E-5,7.51E-6,4.21E-6,2.90E-6,2.20E-6,1.77E-6,1.27E-6,9.93E-7,6.39E-7,4.71E-7,3.08E-7,2.29E-7,1.82E-7,1.51E-7,1.13E-7,9.01E-8]
XPEK=[285.0,300.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L1 SHELL 2S 1/2
YPEL1=[1.35E7,1.50E6,4.00E5,2.21E5,1.70E5,1.14E5,4.58E4,2.07E4,1.02E4,5.34E3,3.76E3,2.97E3,2.32E3,1.93E3,635.,280.,85.1,35.7,18.0,10.3,4.16,2.05,.554,.217,.0571,.0220,.0105,.00570,.00218,.00104, 2.72E-4,1.07E-4,3.00E-5,1.28E-5,6.88E-6,4.28E-6,2.16E-6,1.34E-6,6.37E-7,4.02E-7,2.26E-7,1.55E-7,1.18E-7,9.49E-8,6.82E-8,5.32E-8,3.42E-8,2.52E-8,1.65E-8,1.23E-8,9.75E-9,8.10E-9,6.05E-9,4.82E-9]
XPEL1=[18.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L2 SHELL 2P 1/2
YPEL2=[1.35E7,9.0E5,1.50E5,7.81E4,5.15E4,2.79E4,7.59E3,2.49E3,924.,383.,239.,173.,124.,94.6,20.7,6.75,1.36,.432,.176,.0841, .0259,.0103,.00189,5.64E-4,1.02E-4,3.06E-5,1.20E-5,5.63E-6,1.72E-6,6.96E-7,1.40E-7,4.69E-8,1.10E-8,4.26E-9,2.16E-9,1.29E-9,6.20E-10,3.76E-10,1.82E-10,1.15E-10,6.45E-11,4.44E-11,3.37E-11,2.71E-11,1.95E-11,1.52E-11,9.77E-12,7.20E-12,4.71E-12,3.50E-12,2.79E-12,2.31E-12,1.73E-12,1.38E-12]
XPEL2=[6.40,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.TABLES A7(1970)565
XCOMC=[100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.022E6,1.25E6,1.5E6,2.0E6,2.044E6,3.0E6,4.0E6,5.0E6,6.0E6,7.0E6,8.0E6,9.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
YRAYC=[23.94,23.90,24.85,23.72,23.53,23.31,23.03,22.37,21.52,19.12,16.59,12.22,9.179,7.170,5.819,4.181,3.232,1.952,1.292,.6711,.4079,.2734,.1956,.1139,.07418,.03360,.01903,8.504E-3,4.792E-3,3.070E-3,2.133E-3,1.200E-3,7.682E-4,7.355E-4,4.917E-4,3.415E-4,1.921E-4,1.839E-4,8.539E-5,4.803E-5,3.074E-5,2.135E-5,1.568E-5,1.201E-5,9.488E-6,7.685E-6,3.415E-6,1.921E-6,8.537E-7,4.802E-7,3.073E-7,2.134E-7,1.200E-7,7.682E-8]
YCOMC=[3.044E-3,6.469E-3,.01140,.02518,.04448,.06870,.09764, .1680,.2519,.5001,.7702,1.278,1.685,1.984,2.202,2.497,2.697,3.012,3.182,3.300,3.296,3.250,3.188,3.054,2.924,2.647,2.431,2.118,1.899,1.735,1.605,1.410,1.268,1.255,1.134,1.031,.8795,.8687,.6920,.5772,.4985,.4406,.3960,.3604,.3313,.3069,.2272,.1823,.1327,.1055,.08805,.07586,.05983,.04966]
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
YPAPC=[34*1E-20,2.870E-4,1.594E-3,6.356E-3,6.852E-3,.01844, .03054, .04163,.05178,.06095,.06928,.07690,.08388,.1108,.1310,.1597,.1802,.1958,.2080,.2263,.2401]
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
FFRC=[1.0,.99957,.99830,.9962,.9932,.9895,.9848,.9735,.9590,.9228,.8783,.8538,.7902,.7218,.6562,.5962,.4935,.4170,.3252,.2810,.2558,.2375,.2202,.2027,.1853,.1441,.1094,.0620,.03577,.02147,.01341,.008705,.004055,.002108,.001191,7.198E-4,3.06E-4,6.295E-5, 2.027E-5,5.398E-7,8.455E-8,3.52E-8,5.993E-12,2.767E-21,2.80E-30]
# NORMALISED COMPTON FORM FACTOR Hubbel
FFCC=[1.7E-21,6.317E-4,.002165,.004922,.008607,.01341,.01928,.03358,.05143,.0948,.1459,.1732,.2413,.3110,.3755,.4340,.5330,.6072,.6973,.7463,.7817,.8130,.8418,.8680,.8913,.9358,.9635,.9883,.9962,.9987,.99947,.99977,.99995,.99998,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]
# CARBON ATOMIC NUMBER
IZ[1]=6
AMZ[1]=12.0107
#
# ATOMIC FLOURINE FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
INIOCF=[2,2,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0]
# AVERAGE SHAKE OFF ELECTRON ENERGY
ESF=[14.0,2.5,2.5,2.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
# SHAKE OFF : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
PRBSHF=[0.08,2.00,6.00,8.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.20,1.20,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.40,1.00,2.50,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.40,1.20,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,221*0.0]
# SHAKE OFF : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
PRBSHBTF=[1.29,5.5,7.0,11.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
AF[1][2][2]=[0.838]
AF[1][2][3]=[0.816]
AF[1][3][3]=[0.377]
AF[1][2][4]=[0.216]
AF[1][3][4]=[0.104]
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
RF[1][2]=[1.17E-12]
RF[1][3]=[5.88E-4]
RF[1][4]=[1.17E-3]
# L1 SHELL
RF[2][3]=[1.27E-6]
RF[2][4]=[2.57E-6]
# L2 SHELL
RF[3][4]=[1.69E-18]
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC 5(1973)50
# K SHELL 1S 1/2
YPEKF=[4.3E5,3.20E5,2.53E5,2.02E5,1.68E5,5.89E4,2.70E4,8.58E3,3.72E3,1.92E3,1.11E3,462.,232.,65.2,26.1,7.07,2.77,1.34,.734,.285,.137,.0364,.0144,.00409,.00176,9.47E-4,5.90E-4,2.98E-4,1.85E-4,8.73E-5,5.48E-5,3.06E-5,2.09E-5,1.59E-5,1.28E-5,9.13E-6,7.11E-6,5.99E-6,3.36E-6,2.19E-6,1.63E-6,1.30E-6,1.08E-6,8.03E-7,6.41E-7]
XPEKF=[685.4,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L1 SHELL 2S 1/2
YPEL1F=[3.70E6,6.60E5,4.17E5,3.46E5,2.56E5,1.26E5,6.41E4,3.46E4,1.97E4,1.44E4,1.16E4,9.24E3,7.76E3,2.80E3,1.32E3,438.,194.,102.,59.7,25.2,12.8,3.64,1.47,.402,.158,.0765,.0421,.0164,.00789,.00210,8.35E-4,2.37E-4,1.02E-4,5.48E-5,3.41E-5,1.72E-5,1.07E-5,5.06E-6,3.18E-6,1.77E-6,1.21E-6,9.20E-7,7.39E-7,5.29E-7,4.12E-7,2.64E-7,1.95E-7,1.27E-7,9.45E-8,7.51E-8,6.24E-8,4.66E-8,3.71E-8]
XPEL1F=[34.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L2 SHELL 2P 1/2
YPEL2F=[1.0E7,1.00E7,3.2E6,6.93E5,3.73E5,2.65E5,1.59E5,4.99E4,1.78E4,7.22E3,3.19E3,2.03E3,1.50E3,1.09E3,860.,212.,75.7,17.0,5.71,2.40,1.17,.375,.154,.0300,.00931,.00177,5.46E-4,2.19E-4,1.05E-4,3.29E-5,1.36E-5,2.82E-6,9.63E-7,2.29E-7,8.82E-8,4.40E-8,2.58E-8,1.18E-8,6.74E-9,2.75E-9,1.73E-9,9.63E-10,6.60E-10,5.00E-10,4.02E-10,2.88E-10,2.24E-10,1.44E-10,1.06E-10,6.91E-11,5.14E-11,4.08E-11,3.39E-11,2.53E-11,2.02E-11]
XPEL2F=[16.0,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L3 SHELL 2P 3/2
YPEL3F=[2.00E7,2.0E7,6.4E6,1.39E6,7.43E5,5.30E5,3.18E5,9.98E4,3.57E4,1.43E4,6.32E3,4.03E3,2.97E3,2.16E3,1.70E3,419.,149.,33.5,11.2,4.71,2.30,.731,.298,.0578,.0178,.00335,.00102,4.07E-4,1.92E-4,5.95E-5,2.42E-5,4.90E-6,1.65E-6,3.91E-7,1.53E-7,7.86E-8,4.75E-8,2.33E-8,1.43E-8,6.69E-9,4.20E-9,2.34E-9,1.60E-9,1.22E-9,9.77E-10,7.00E-10,5.44E-10,3.50E-10,2.57E-10,1.68E-10,1.25E-10,9.93E-11,8.25E-11,6.16E-11,4.91E-11]
XPEL3F=[16.0,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
XCOMF=[100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.022E6,1.25E6,1.5E6,2.0E6,2.044E6,3.0E6,4.0E6,5.0E6,6.0E6,7.0E6,8.0E6,9.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
YRAYF=[53.87,53.82,53.77,53.62,53.42,53.16,52.85,52.07,51.11,48.01,44.27,36.25,29.02,23.25,18.86,13.07,9.647,5.470,3.611,1.921, 1.181,.7966,.5731,.3370,.2212,.1013,.05764,.02585,.01459,.009349, 6.498E-3,3.658E-3,2.342E-3,2.242E-3,1.499E-3,1.041E-3,5.858E-4,5.609E-4,2.604E-4,1.465E-4,9.374E-5,6.510E-5,4.783E-5,3.662E-5,2.893E-5,2.344E-5,1.046E-5,5.883E-6,2.614E-6,1.471E-6,9.412E-7,6.535E-7,3.677E-7,2.353E-7]
YCOMF=[1.935E-3,4.736E-3,8.533E-3,.01925,.03410,.05298,.07579,.1325,.2029,.4270, .6987,1.293,1.861,2.354,2.762,3.353,3.735,4.257,4.524,4.760,4.808,4.775,4.706,4.533,4.354,3.955,3.637,3.172,2.846,2.600,2.406,2.115,1.902,1.882,1.701,1.546,1.319,1.303,1.038,.8658,.7477,.6609,.5940,.5406,.4969,.4604,.3408,.2735,.1991,.1582, .1321,.1138,.08974,.07449]
# TOTAL PAIR PROEUCTION NUCLEAR + ELECTRON
YPAPF=[34*1E-20,6.506E-4,3.60E-3,.01434,.01546,.04137,.06799,.09219,.1141,.1339,.1518,.1680,.1829,.2403,.2830,.3451,.3893, .4199,.4463,.4852,.5119]
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
FFRF=[1.0,.99973,.99910,.9981,.9967,.9948,.9926,.9868,.9794,.9604,.9362,.9223,.8833,.8398,.7931,.7451,.6497,.5611,.4172,.3189,.2562,.2172,.1926,.1762,.1646,.1430,.1243,.08978,.06246,.04616,.02986,.02354,.01091,.006078,.003611,.002744,.001011,2.268E-4,7.432E-5,2.042E-6, 3.244E-7,1.362E-7,2.758E-11,1.59E-20,1.63E-29]
# NORMALISED COMPTON FORM FACTOR Hubbel
FFCF=[1.1E-21,2.22E-4,.00111,.002489,.004411,.006878,.009867,.01739,.02689,.05122,.08166,.09867,.1453,.1957,.2474,.2990,.3966,.4830,.6169,.7043,.7591,.7946,.8196,.8391,.8559,.8916,.9209,.9609,.9816,.9914,.99590,.99800,.99946,.99983,.99994,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]
# FLOURINE ATOMIC NUMBER
IZ[2]=9
AMZ[2]=75.9936
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
for I in range(1,17+1):
PRSHBT[1][I]=PRBSHBT[I]/100.0
PRSHBT[2][I]=PRBSHBTF[I]/100.0
for J in range(1,17+1):
PRBSH[I][J]=PRBSH[I][J]/100.0
PRBSHF[I][J]=PRBSHF[I][J]/100.0
# SWAP INDICES AND DO CHECK SUM
for I in range(1,17+1):
PRSUM=0.0
PRSUMF=0.0
for J in range(1,17+1):
PRSH[1][I][J]=PRBSH[J][I]
PRSH[2][I][J]=PRBSHF[J][I]
# PRSUMF=PRSUMF+PRSH[2][I][J]
# PRSUM=PRSUM+PRSH[1][I][J]
# WRITE(6,888) I,PRSUM,PRSUMF
# 888 print(' I=',I3,' PRSUM=','%.3f' %,' PRSUM=','%.3f' %)
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
for I in range(1,17+1):
ESH[1][I]=ES[I]
ESH[2][I]=ESF[I]
INIOCC[1][I]=INIOC[I]
INIOCC[2][I]=INIOCF[I]
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
for I in range(1,4+1):
for J in range(1,17+1):
for K in range(1,17 +1):
AUG[1][I][J][K]=A[I][J][K]*0.0272105
AUG[2][I][J][K]=AF[I][J][K]*0.0272105
for I in range(5,17+1):
for J in range(1,17+1):
for K in range(1,17+1):
AUG[1][I][J][K]=A[I][J][K]*0.00272105
AUG[2][I][J][K]=AF[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
for I in range(5,17+1):
for J in range(6,17+1):
R[I][J]=R[I][J]*6.582119E-16
RF[I][J]=RF[I][J]*6.582119E-16
# LOAD OUTPUT ARRAY
# LOAD OUTPUT ARRAY
for I in range(1,17+1):
for J in range(1,17+1):
RAD[1][I][J]=R[I][J]
RAD[2][I][J]=RF[I][J]
#
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD CARBON PHOTOELECTRIC DATA
for J in range(1,49+1):
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1E-24)
for J in range(1,54+1):
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*1E-24)
for J in range(1,54 +1):
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*1E-24)
# LOAD FLUORINE PHOTOELECTRIC DATA
# SCALE BY 4 SINCE 4 ATOMS PER CARBON
for J in range(1,45+1):
XPE[2][1][J]=math.log(XPEKF[J])
YPE[2][1][J]=math.log(YPEKF[J]*4.0*1E-24)
for J in range(1,53+1):
XPE[2][2][J]=math.log(XPEL1F[J])
YPE[2][2][J]=math.log(YPEL1F[J]*4.0*1E-24)
for J in range(1,55 +1):
XPE[2][3][J]=math.log(XPEL2F[J])
YPE[2][3][J]=math.log(YPEL2F[J]*4.0*1E-24)
for J in range(1,55 +1):
XPE[2][4][J]=math.log(XPEL3F[J])
YPE[2][4][J]=math.log(YPEL3F[J]*4.0*1E-24)
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
for J in range(1,54+1):
XCP[1][J]=math.log(XCOMC[J])
XCP[2][J]=math.log(XCOMF[J])
YRY[1][J]=math.log(YRAYC[J]*1E-24)
YRY[2][J]=math.log(YRAYF[J]*4.0*1E-24)
YCP[1][J]=math.log(YCOMC[J]*1E-24)
YCP[2][J]=math.log(YCOMF[J]*4.0*1E-24)
YPP[1][J]=math.log(YPAPC[J]*1E-24)
YPP[2][J]=math.log(YPAPF[J]*4.0*1E-24)
# LOAD RAYLEIGH AND COMPTON FORM FACTOR
for J in range(1,45+1):
FFAR[1][J]=FFRC[J]
FFAR[2][J]=FFRF[J]
FFAC[1][J]=FFCC[J]
FFAC[2][J]=FFCF[J]
return
# end
def CGAS2(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
#DIMENSION
PRSH=numpy.zeros((3+1,17+1,17+1))
PRSHBT=numpy.zeros((3+1,17+1))#[[0 for x in range(3+1)]for y in range(17+1)]
ESH=numpy.zeros((3+1,17+1))
AUG=numpy.zeros((3+1,17+1,17+1,17+1))
RAD=numpy.zeros((3+1,17+1,17+1))
XPE=numpy.zeros((3+1,17+1,60+1))
YPE=numpy.zeros((3+1,17+1,60+1))
XCP=numpy.zeros((3+1,54+1))
YRY=numpy.zeros((3+1,54+1))
YCP=numpy.zeros((3+1,54+1))
YPP=numpy.zeros((3+1,54+1))
FFAR=numpy.zeros((3+1,45+1))
FFAC=numpy.zeros((3+1,45+1))
IZ=numpy.zeros((3+1))
AMZ=numpy.zeros((3+1))
INIOCC=numpy.zeros((3+1,17+1))
#DIMENSION
INIOC=numpy.zeros((17+1))
PRBSH=numpy.zeros((17+1,17+1))
ES=numpy.zeros((17+1))
R=numpy.zeros((17+1,17+1))
A=numpy.zeros((17+1,17+1,17+1))
PRBSHBT=numpy.zeros((17+1))
#DIMENSION
XPEK=numpy.zeros((38+1))
YPEK=numpy.zeros((38+1))
XPEL1=numpy.zeros((54+1))
YPEL1=numpy.zeros((54+1))
XPEL2=numpy.zeros((56+1))
YPEL2=numpy.zeros((56+1))
XPEL3=numpy.zeros((56+1))
YPEL3=numpy.zeros((56+1))
XPEM1=numpy.zeros((59+1))
YPEM1=numpy.zeros((59+1))
XPEM2=numpy.zeros((60+1))
YPEM2=numpy.zeros((60+1))
XPEM3=numpy.zeros((60+1))
YPEM3=numpy.zeros((60+1))
XENE=numpy.zeros((54+1))
YRAY=numpy.zeros((54+1))
YCOM=numpy.zeros((54+1))
YPAP=numpy.zeros((54+1))
FFR=numpy.zeros((45+1))
FFC=numpy.zeros((45+1))
#
# ARGON FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
INIOC=[0]+[2,2,2,4,2,2,4,0,0,0,0,0,0,0,0,0,0]
# AVERAGE SHAKE OFF ELECTRON ENERGY
ES=[0]+[22.5,9.10,9.90,9.90,2.20,1.60,1.60,0.00,0.00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
# SHAKE OFF : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
PRBSH=[.001,0.30,0.54,1.07,2.47,5.86,11.45,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.017,.056,0.11,1.66,4.18,8.33,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.049,.043,0.17,1.73,4.41,8.71,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.050,.080,0.13,1.73,4.37,8.72,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.16,1.37,2.82,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.25,0.57,2.33,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.25,1.12,1.74,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,*170*[0.0]]
PRBSH=numpy.reshape(PRBSH,(17,17))
PRBSH=numpy.r_[[numpy.zeros(PRBSH.shape[1])],PRBSH]
PRBSH=numpy.c_[numpy.zeros(PRBSH.shape[0]),PRBSH]
# SHAKE OFF : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
PRBSHBT=[0]+[.264,.914,.703,1.41,4.24,5.92,11.84,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00]
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K L M AND N SHELLS
# CHEN+CRASEMANN,ANDT 24(1979)13, FOR K AND L SHELLS
# MCGUIRE,SANDIA REPORTS, FOR M AND N SHELLS
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
A[1][2][2]=1.456
A[1][2][3]=1.604
A[1][2][4]=3.072
A[1][2][5]=0.324
A[1][2][6]=0.151
A[1][2][7]=0.288
A[1][3][3]=0.294
A[1][3][4]=7.277
A[1][3][5]=0.156
A[1][3][6]=0.053
A[1][3][7]=0.607
A[1][4][4]=4.132
A[1][4][5]=0.299
A[1][4][6]=0.607
A[1][4][7]=0.697
A[1][5][5]=0.018
A[1][5][6]=0.015
A[1][5][7]=0.028
A[1][6][7]=0.202
A[1][7][7]=0.030
# L1 SHELL RATE (MILLIATOMIC UNITS)
A[2][3][5]=17.780
A[2][3][6]=7.404
A[2][3][7]=7.482
A[2][4][5]=34.607
A[2][4][6]=7.308
A[2][4][7]=20.792
A[2][5][5]=0.767
A[2][5][6]=1.203
A[2][5][7]=2.380
A[2][6][7]=0.007
A[2][7][7]=0.068
# L2 AUGER SHELL RATE (MILLIATOMIC UNITS)
# L3 AUGER SHELL RATE (MILLIATOMIC UNITS)
A[4][5][5]=0.062
A[4][5][6]=0.041
A[4][5][7]=1.293
A[4][6][7]=1.719
A[4][7][7]=2.548
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
R[1][2]=2.34E-9
R[1][3]=.02226
R[1][4]=.044
R[1][5]=3.36E-10
R[1][6]=1.822E-3
R[1][7]=3.60E-3
# L1 SHELL
R[2][3]=8.75E-6
R[2][4]=1.97E-5
R[2][5]=7.22E-14
R[2][6]=7.18E-5
R[2][7]=1.378E-4
# L2 SHELL
R[3][4]=7.88E-14
R[3][5]=2.43E-5
R[3][6]=1.21E-14
R[3][7]=1.05E-8
# L3 SHELL
R[4][5]=2.48E-5
R[4][6]=5.29E-9
R[4][7]=5.19E-9
# RADIATIVE TRANSITIONS MANSON AND KENNEDY ANDT 14(1974)111
# DIPOLE ONLY NON-RELATIVISTIC CALC. UNITS 1/SEC
# M1 SHELL
R[5][6]=2.0708E9
R[5][7]=4.1416E9
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : KENNEDY AND MANSON PHYS REV A5(1972)227
# : SCOFIELD UCRL-51326
# : SAMSON AND STOLTE J.ELEC.SPEC. 123(2002)265
# : CHAN ET AL PHYS REV A46(1992)149
# : MARR AND WEST ANDT 18(1976)497
# : VIEGELE ATOMIC 5(1973)50
# KSHELL 1S 1/2
YPEK=[0]+[7.53E4,4.51E4,2.53E4,1.55E4,7.06E3,3.77E3,1.17E3,498.,146.,60.2,30.0,17.0,6.85,3.38,.938,.382,.111,.0485,.0264,.0165,.00839,.00522,.00244,.00152,8.31E-4,5.64E-4,4.24E-4,3.39E-4,2.41E-4,1.87E-4,1.19E-4,8.75E-5,5.70E-5,4.23E-5,3.36E-5,2.79E-5,2.08E-5,1.66E-5]
XPEK=[0]+[3205.9,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L1 SHELL 2S 1/2
YPEL1=[0]+[3.20E5,3.38E5,3.35E5,3.26E5,3.15E5,2.92E5,2.72E5,2.62E5,1.77E5,1.19E5,9.46E4,8.06E4,6.79E4,5.89E4,2.64E4,1.43E4,5.71E3,2.86E3,1.64E3,1.03E3,483.,264.,84.9,37.0,11.1,4.66,2.35,1.34,.544,.270,.0755,.0308,.00903,.00394,.00215,.00135,6.83E-4,4.25E-4,1.99E-4,1.24E-4,6.78E-5,4.60E-5,3.46E-5,2.77E-5,1.97E-5,1.52E-5,9.73E-6,7.14E-6,4.65E-6,3.45E-6,2.74E-6,2.27E-6,1.69E-6,1.35E-6]
XPEL1=[0]+[326.3,333.1,339.9,346.7,353.5,367.1,380.7,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L2 SHELL 2P 1/2
YPEL2=[0]+[1.80E6,1.31E6,9.57E5,8.67E5,8.37E5,8.17E5,7.80E5,6.87E5,6.10E5,5.40E5,2.65E5,1.36E5,9.40E4,7.28E4,5.60E4,4.56E4,1.37E4,5.61E3,1.51E3,577.,268.,142.,50.7,22.5,5.00,1.68,.354,.116,.0488,.0241,.00793,.00338,7.46E-4,2.63E-4,6.51E-5,2.57E-5,1.31E-5,7.72E-6,3.59E-6,2.08E-6,8.63E-7,5.36E-7,2.94E-7,2.00E-7,1.50E-7,1.20E-7,8.54E-8,6.61E-8,4.22E-8,3.09E-8,2.02E-8,1.50E-8,1.19E-8,9.86E-9,7.35E-9,5.86E-9]
XPEL2=[0]+[250.6,257.4,264.2,271.0,277.8,291.4,305.0,332.2,359.4,386.6,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L3 SHELL 2P 3/2
YPEL3=[0]+[3.60E6,2.63E6,1.91E6,1.73E6,1.67E6,1.63E6,1.56E6,1.37E6,1.22E6,1.08E6,5.21E5,2.67E5,1.84E5,1.43E5,1.09E5,8.93E4,2.67E4,1.09E4,2.93E3,1.11E3,514.,271.,96.4,42.6,9.36,3.12,.647,.209,.0869,.0424,.0137,.00575,.00122,4.23E-4,1.03E-4,4.07E-5,2.10E-5,1.27E-5,6.22E-6,3.79E-6,1.72E-6,1.07E-6,5.86E-7,3.98E-7,2.99E-7,2.39E-7,1.70E-7,1.32E-7,8.41E-8,6.17E-8,4.02E-8,2.98E-8,2.37E-8,1.96E-8,1.46E-8,1.17E-8]
XPEL3=[0]+[248.4,255.2,262.0,268.8,275.6,289.2,302.8,330.0,357.2,384.4,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# M1 SHELL 3S 1/2
YPEM1=[0]+[5.6E4,1.87E5,2.62E5,3.07E5,3.27E5,3.27E5,3.07E5,2.54E5,2.08E5,1.79E5,1.36E5,7.16E4,4.04E4,2.39E4,1.49E4,1.15E4,9.67E3,8.05E3,7.00E3,3.04E3,1.62E3,639.,320.,183.,115.,54.1,29.6,9.53,4.17,1.26,.527,.266,.151,.0616,.0306,.00856,.00350,.00102,4.47E-4,2.44E-4,1.53E-4,7.75E-5,4.82E-5,2.26E-5,1.40E-5,7.70E-6,5.23E-6,3.93E-6,3.14E-6,2.24E-6,1.73E-6,1.10E-6,8.10E-7,5.28E-7,3.92E-7,3.11E-7,2.58E-7,1.92E-7,1.53E-8]
XPEM1=[0]+[29.239,36.0,42.8,49.6,56.4,70.0,83.6,110.8,138.0,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# M2 SHELL 3P 1/2
YPEM2=[0]+[10.3E6,11.9E6,11.3E6,7.23E6,3.33E6,8.83E5,2.43E5,1.67E5,2.25E5,2.81E5,3.24E5,3.58E5,3.77E5,3.80E5,3.79E5,3.69E5,3.45E5,3.25E5,2.97E5,2.80E5,2.38E5,2.00E5,1.67E5,1.40E5,1.09E5,7.40E4,3.58E4,1.81E4,9.65E3,6.82E3,5.37E3,4.19E3,3.44E3,1.09E3,458.,127.,49.4,23.3,12.4,4.49,2.01,.450,.152,.0322,.0106,.00446,.00221,7.29E-4,3.11E-4,6.85E-5,2.42E-5,5.98E-6,2.36E-6,1.20E-6,7.07E-7,3.27E-7,1.89E-7,7.82E-8,4.86E-8,5.31E-10]
XPEM2=[0]+[15.937,20.0,25.0,30.0,35.0,40.0,45.0,50.0,55.0,60.0,65.0,70.0,75.0,80.0,85.0,90.0,100.,110.,120.,130.,150.,170.,190.,210.,245.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,1.0E8]
# M3 SHELL 3P 3/2
YPEM3=[0]+[20.5E6,23.8E6,22.5E6,14.5E6,6.67E6,1.77E6,4.87E5,3.33E5,4.50E5,5.62E5,6.49E5,7.15E5,7.53E5,7.60E5,7.57E5,7.37E5,6.89E5,6.51E5,5.95E5,5.60E5,4.76E5,4.00E5,3.33E5,2.80E5,2.17E5,1.47E5,7.06E4,3.55E4,1.89E4,1.34E4,1.05E4,8.19E3,6.73E3,2.12E3,889.,246.,95.1,44.6,23.7,8.50,3.78,.839,.281,.0587,.0190,.00792,.00387,.00125,5.26E-4,1.12E-4,3.88E-5,9.43E-6,3.75E-6,1.94E-6,1.17E-6,5.75E-7,3.51E-7,1.62E-7,1.01E-7,1.10E-9]
XPEM3=[0]+[15.760,20.0,25.0,30.0,35.0,40.0,45.0,50.0,55.0,60.0,65.0,70.0,75.0,80.0,85.0,90.0,100.,110.,120.,130.,150.,170.,190.,210.,245.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,1.0E8]
# RAYLEIGH, COMPTON AND PAIR PR0DUCTION
# HUBBEL J.PHYS.CHEM.REF.4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.TABLES A7(1970)565
XENE=[0]+[100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.022E6,1.25E6,1.5E6,2.0E6,2.044E6,3.0E6,4.0E6,5.0E6,6.0E6,7.0E6,8.0E6,9.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
YRAY=[0]+[215.5,215.2,215.0,214.2,213.2,211.9,210.3,206.5,201.7,187.2,170.5,138.2,112.4,93.45,79.70,61.33,49.16,30.22,20.01,10.72, 6.776,4.690,3.435,2.061,1.369,.6390,.3681,.1671,.09475,.06089, .04238,.02389,.01531,.01466,9.804E-3,6.811E-3,3.833E-3,3.669E-3,1.704E-3,9.585E-4, 6.135E-4,4.260E-4,3.130E-4,2.397E-4,1.894E-4,1.534E-4,6.788E-5,3.818E-5,1.697E-5,9.545E-6,6.109E-6,4.242E-6,2.386E-6,1.527E-6]
YCOM=[0]+[5.185E-3,.01168,.02080,.04655,.08210,.1270,.1806,.3117,.4696,.9421, 1.462,2.466,3.332,4.046,4.624,5.501,6.161,7.330,8.048,8.727,8.961,9.013,8.975,8.767,8.493,7.800,7.209,6.314,5.674,5.189,4.805,4.225,3.801,3.761,3.400,3.090,2.638,2.605,2.076,1.731,1.495,1.322,1.188,1.081,.9938,.9208,.6815,.5470,.3982,.3164, .2641,.2276,.1795,.1490]
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
YPAP=[0]+34*[1.E-20]+[2.826E-3,.01507,.05880,.06336,.1665,.2700, .3627,.4462,.5208,.5882,.6493,.7049,.9170,1.072,1.296,1.446, 1.563,1.650,1.779,1.876]
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
FFR=[0]+[1.0,.99967,.99889,.99761,.99578,.99339,.99056,.98333,.9744,.9506, .9217,.9050,.8606,.8078,.7656,.7189,.6350,.5667,.4746,.4202,.3814,.3465,.3122,.2787,.2468,.1796,.1343,.08906,.07183,.06278,.05371,.04672,.03272,.02292,.01596,.0126,.005872,.001555,5.553E-4,1.744E-5,2.907E-6,1.250E-6,3.693E-10,2.99E-19,3.37E-28]
FFC=[0]+[5.6E-22,3.33E-4,.00133,.003011,.005328,.008283,.01185,.02073,.03172,.05906, .09133,.1087,.1533,.1977,.2400,.2796,.3502,.4098,.4999,.5617,.6094,.6517,.6900,.7256,.7572,.8189,.8606,.9067,.9328,.9517,.9661,.9761,.9889,.9950,.99756,.99878,.99967,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]
# ARGON ATOMIC NUMBER
IZ[1]=18
AMZ[1]=39.948
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
for I in range(1,17+1):
PRSHBT[1][I]=PRBSHBT[I]/100.0
for J in range(1,17+1):
PRBSH[I][J]=PRBSH[I][J]/100.0
# SWAP INDICES AND DO CHECK SUM
for I in range(1,17+1):
PRSUM=0
for J in range(1,17+1):
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
for I in range(1,17+1):
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
for I in range(1,4+1):
for J in range(1,17+1):
for K in range(1,17 +1):
AUG[1][I][J][K]=A[I][J][K]*0.0272105
for I in range(5,17+1):
for J in range(1,17+1):
for K in range(1,17+1):
AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# for I in range(1,17+1):
# ASUM=0.0
# for J in range(1,17+1):
# for K in range(1,17+1):
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
for I in range(5,17+1):
for J in range(6,17+1):
R[I][J]=R[I][J]*6.582119E-16
# LOAD OUTPUT ARRAY
for I in range(1,17+1):
for J in range(1,17+1):
RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# for5 in range(=1,17+1):
# RSUM=0.0
# for4 in range(=1,17+1):
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC DATA
for J in range(1,38+1):
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1.E-24)
for J in range(1,54+1):
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*1.E-24)
for J in range(1,55+1):
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*1.E-24)
for J in range(1,55+1):
XPE[1][4][J]=math.log(XPEL3[J])
YPE[1][4][J]=math.log(YPEL3[J]*1.E-24)
for J in range(1,59+1):
XPE[1][5][J]=math.log(XPEM1[J])
YPE[1][5][J]=math.log(YPEM1[J]*1.E-24)
for J in range(1,60+1):
XPE[1][6][J]=math.log(XPEM2[J])
YPE[1][6][J]=math.log(YPEM2[J]*1.E-24)
for J in range(1,60+1):
XPE[1][7][J]=math.log(XPEM3[J])
YPE[1][7][J]=math.log(YPEM3[J]*1.E-24)
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
for J in range(1,54+1):
XCP[1][J]=math.log(XENE[J])
YRY[1][J]=math.log(YRAY[J]*1.E-24)
YCP[1][J]=math.log(YCOM[J]*1.E-24)
YPP[1][J]=math.log(YPAP[J]*1.E-24)
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
for J in range(1,45+1):
FFAR[1][J]=FFR[J]
FFAC[1][J]=FFC[J]
return
# end
'''
def CGAS3(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION XPEK(60),YPEK(60),XENE(54),YRAY(54),YCOM(54),YPAP(54),FFR(45),FFC(45)
#
# HELIUM DATA FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/26.9,0.0,0.0,0.0,0.0,0.0,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00/
# AUGER RATES
DATA A/4913*0.0/
# RADIATIVE RATES
DATA R/289*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : SAMSON AND STOLTE J.ELEC.SPEC. 123(2002)265
# KSHELL 1S 1/2
DATA YPEK/7.40E6,6.40E6,5.38E6,4.57E6,3.88E6,3.16E6,2.48E6,2.02E6,1.67E6,1.56E6,1.15E6,9.75E5,8.13E5,6.93E5,5.95E5,5.16E5,4.50E5,3.93E5,3.06E5,2.46E5,1.73E5,1.21E5,7.15E4,2.23E4,7.98E3,3.23E3,1.44E3,926.,688.,507.,402.,109.,43.2,11.2,4.23,2.03,1.10,.411,.194,.0487,.0183,.00457,.00171,7.95E-4,4.26E-4,1.60E-4,7.48E-5,1.92E-5,7.43E-6,2.05E-6,8.66E-7,4.64E-7,2.88E-7,1.45E-7,9.03E-8,4.14E-8,2.63E-8,1.49E-8,1.03E-8,3.28E-10/
DATA XPEK/24.587,27.0,30.0,33.0,36.0,40.0,45.0,50.0,55.0,59.0,66.0,70.0,75.0,80.0,85.0,90.0,95.0,100.,110.,120.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
# HUBBEL J.PHYS CHEM REF DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL DATA TABLES A7(1970)565
DATA XENE/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAY/2.660,2.658,2.655,2.648,2.637,2.624,2.608,2.567,2.517,2.356,2.162,1.743,1.369,1.072,.8492,.5592,.3921,.1962,.1166,.05432, .03113,.02010,.01403,7.933D-3,5.089D-3,2.267D-3,1.276D-3,5.676D-4,3.194D-4,2.044D-4, 1.420D-4,7.986D-5,5.111D-5,4.894D-5,3.272D-5,2.272D-5,1.278D-5,1.224D-5,5.680D-6,3.195D-6,2.045D-6,1.420D-6,1.043D-6,7.988D-7,6.312D-7,5.112D-7,2.272D-7,1.278D-7,5.679D-8,3.194D-8,2.044D-8,1.420D-8,7.984D-9,5.109D-9/
DATA YCOM/1.524D-3,2.559D-3,3.793D-3,7.081D-3,1.183D-2,1.796D-2,2.543D-2,4.426D-2,6.759D-2,0.1419,.2317,.4230,.5948,.7328,.8385,.9785,1.059,1.145,1.168,1.163,1.139,1.111,1.083,1.030,.9825,.8860,.8124,.7068,.6334,.5785,.5352,.4702,.4228,.4183,.3780,.3436,.2932,.2896,.2307,.1924,.1662,.1469,.1320,.1201,.1104,.1023,.07573,.06078,.04425,.03516,.02935,.02529,.01994,.01655/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAP/34*1.E-20,3.127D-5,1.755D-4,7.034D-4,7.584D-4,2.101D-3,3.611D-3,5.061D-3,6.427D-3,7.681D-3,8.838D-3,9.906D-3,1.089D-2,1.473D-2,1.792D-2,.0222,.0253, .0277,.0296,.0326,.0351/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFR/1.0,.99975,.99910,.9980,.9965,.9945,.9920,.9860,.9785,.9585,.9330,.9180,.8775,.8305,.7800,.7290,.6260,.5295,.3690,.2547,.1771,.1247,.8930,.06495,.04806,.02420,.01326,4.82D-3,2.098D-3,1.046D-3,5.770D-4,3.428D-4,1.427D-4,6.945D-5,3.770D-5,2.218D-5,9.130D-6,1.813D-6,5.755D-7,1.487D-8,2.289D-9,9.425D-10,1.173D-13,2.56D-23,2.56D-32/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFC/5.E-21,.00105,.00250,.00440,.00705,.01029,.01495,.02595,.04027,.07675,.1225,.1478,.2161,.2917,.3680,.4403,.5730,.6810,.8285,.9090,.9510,.9735,.9850,.9915,.99495,.99855,.99950,.99995,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/
# HELIUM ATOMIC NUMBER
IZ[1]=2
AMZ[1]=4.002602
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
4 AUG[1][I][J][K]=A[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
5 AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
12 R[I][J]=R[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
13 RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC DATA
DO 21 J=1,60
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1.E-24)
21 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 22 J=1,54
XCP[1][J]=math.log(XENE[J])
YRY[1][J]=math.log(YRAY[J]*1.E-24)
YCP[1][J]=math.log(YCOM[J]*1.E-24)
YPP[1][J]=math.log(YPAP[J]*1.E-24)
22 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 23 J=1,45
FFAR[1][J]=FFR[J]
FFAC[1][J]=FFC[J]
23 CONTINUE
return
# end
def CGAS4(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION XPEK(60),YPEK(60),XENE(54),YRAY(54),YCOM(54),YPAP(54),FFR(45),FFC(45)
#
# HELIUM DATA FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/26.9,0.0,0.0,0.0,0.0,0.0,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00/
# AUGER RATES
DATA A/4913*0.0/
# RADIATIVE RATES
DATA R/289*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : SAMSON AND STOLTE J.ELEC.SPEC. 123(2002)265
# KSHELL 1S 1/2
DATA YPEK/7.40E6,6.40E6,5.38E6,4.57E6,3.88E6,3.16E6,2.48E6,2.02E6,1.67E6,1.56E6,1.15E6,9.75E5,8.13E5,6.93E5,5.95E5,5.16E5,4.50E5,3.93E5,3.06E5,2.46E5,1.73E5,1.21E5,7.15E4,2.23E4,7.98E3,3.23E3,1.44E3,926.,688.,507.,402.,109.,43.2,11.2,4.23,2.03,1.10,.411,.194,.0487,.0183,.00457,.00171,7.95E-4,4.26E-4,1.60E-4,7.48E-5,1.92E-5,7.43E-6,2.05E-6,8.66E-7,4.64E-7,2.88E-7,1.45E-7,9.03E-8,4.14E-8,2.63E-8,1.49E-8,1.03E-8,3.28E-10/
DATA XPEK/24.587,27.0,30.0,33.0,36.0,40.0,45.0,50.0,55.0,59.0,66.0,70.0,75.0,80.0,85.0,90.0,95.0,100.,110.,120.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL DATA TABLES A7(1970)565
DATA XENE/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAY/2.660,2.658,2.655,2.648,2.637,2.624,2.608,2.567,2.517,2.356,2.162,1.743,1.369,1.072,.8492,.5592,.3921,.1962,.1166,.05432, .03113,.02010,.01403,7.933D-3,5.089D-3,2.267D-3,1.276D-3,5.676D-4,3.194D-4,2.044D-4, 1.420D-4,7.986D-5,5.111D-5,4.894D-5,3.272D-5,2.272D-5,1.278D-5,1.224D-5,5.680D-6,3.195D-6,2.045D-6,1.420D-6,1.043D-6,7.988D-7,6.312D-7,5.112D-7,2.272D-7,1.278D-7,5.679D-8,3.194D-8,2.044D-8,1.420D-8,7.984D-9,5.109D-9/
DATA YCOM/1.524D-3,2.559D-3,3.793D-3,7.081D-3,1.183D-2,1.796D-2,2.543D-2,4.426D-2,6.759D-2,0.1419,.2317,.4230,.5948,.7328,.8385,.9785,1.059,1.145,1.168,1.163,1.139,1.111,1.083,1.030,.9825,.8860,.8124,.7068,.6334,.5785,.5352,.4702,.4228,.4183,.3780,.3436,.2932,.2896,.2307,.1924,.1662,.1469,.1320,.1201,.1104,.1023,.07573,.06078,.04425,.03516,.02935,.02529,.01994,.01655/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAP/34*1.E-20,3.127D-5,1.755D-4,7.034D-4,7.584D-4,2.101D-3,3.611D-3,5.061D-3,6.427D-3,7.681D-3,8.838D-3,9.906D-3,1.089D-2,1.473D-2,1.792D-2,.0222,.0253, .0277,.0296,.0326,.0351/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFR/1.0,.99975,.99910,.9980,.9965,.9945,.9920,.9860,.9785,.9585,.9330,.9180,.8775,.8305,.7800,.7290,.6260,.5295,.3690,.2547,.1771,.1247,.8930,.06495,.04806,.02420,.01326,4.82D-3,2.098D-3,1.046D-3,5.770D-4,3.428D-4,1.427D-4,6.945D-5,3.770D-5,2.218D-5,9.130D-6,1.813D-6,5.755D-7,1.487D-8,2.289D-9,9.425D-10,1.173D-13,2.56D-23,2.56D-32/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFC/5.E-21,.00105,.00250,.00440,.00705,.01029,.01495,.02595,.04027,.07675,.1225,.1478,.2161,.2917,.3680,.4403,.5730,.6810,.8285,.9090,.9510,.9735,.9850,.9915,.99495,.99855,.99950,.99995,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/
# HELIUM ATOMIC NUMBER
IZ[1]=2
AMZ[1]=3.01600
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
4 AUG[1][I][J][K]=A[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
5 AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
12 R[I][J]=R[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
13 RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC DATA
DO 21 J=1,60
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1.E-24)
21 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 22 J=1,54
XCP[1][J]=math.log(XENE[J])
YRY[1][J]=math.log(YRAY[J]*1.E-24)
YCP[1][J]=math.log(YCOM[J]*1.E-24)
YPP[1][J]=math.log(YPAP[J]*1.E-24)
22 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 23 J=1,45
FFAR[1][J]=FFR[J]
FFAC[1][J]=FFC[J]
23 CONTINUE
return
# end
def CGAS5(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION XPEK(42),YPEK(42),XPEL1(58),YPEL1(58),XPEL2(60),YPEL2(60),XPEL3(60),YPEL3(60),XENE(54),YRAY(54),YCOM(54),YPAP(54),FFR(45),FFC(45)
#
# NEON DATA FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/15.9,3.40,3.20,3.20,0.00,0.00,0.00,0.00,0.00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/.030,1.71,5.44,10.63,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.16,1.48,2.98,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.34,0.78,3.14,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.34,1.55,2.35,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,221*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/1.03,4.77,5.55,11.10,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/0.820/,A[1][2][3]/0.8315/,A[1][2][4]/1.5925/
DATA A[1][3][3]/0.140/,A[1][3][4]/3.47/
DATA A[1][4][4]/1.97/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/3.55E-12/,R(1,3)/.001128/,R(1,4)/.002242/
# L1 SHELL
DATA R(2,3)/2.23E-6/,R(2,4)/4.54E-6/
# L2 SHELL
DATA R(3,4)/8.70E-18/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : KENNEDY AND MANSON PHYS REV A5(1972)227
# : SCOFIELD UCRL-51326
# : SAMSON AND STOLTE J.ELEC.SPEC. 123(2002)265
# : CHAN ET AL PHYS REV A45(1992)1420
# : VIEGELE ATOMIC DATA 5(1973)50
# : BIZAU ET AL J.ELEC.SPEC. 71(1995)205
# K SHELL 1S 1/2
DATA YPEK/3.60E5,2.32E5,8.40E4,3.92E4,1.28E4,5.61E3,2.92E3,1.70E3,717.,363.,103.,41.6,11.4,4.49,2.17,1.20,.468,.225,.0602,.0240,.00680,.00293,.00158,9.86E-4,4.98E-4,3.10E-4,1.46E-4,9.16E-5,5.09E-5,3.49E-5,2.64E-5,2.12E-5,1.52E-5,1.18E-5,7.57E-6,5.57E-6,3.64E-6,2.70E-6,2.15E-6,1.78E-6,1.33E-6,1.06E-6/
DATA XPEK/870.2,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1/2.69E5,4.04E5,5.03E5,5.48E5,6.21E5,5.60E5,5.24E5,4.38E5,3.76E5,2.90E5,1.51E5,8.05E4,4.47E4,2.61E4,1.93E4,1.57E4,1.26E4,1.06E4,3.95E3,
1.90E3,643.,290.,154.,91.2,39.1,20.0,5.78,2.35,.651,.258,.125,.0693,.0271,.0131,.00351,.00140,3.98E-4,1.71E-4,9.24E-5,5.76E-5,2.91E-5,1.81E-5,8.52E-6,5.34E-6,2.97E-6,2.03E-6,1.54E-6,1.24E-6,8.85E-7,6.88E-7,4.42E-7,3.25E-7,2.12E-7,1.58E-7,1.25E-7,1.04E-7,7.77E-8,6.19E-8/
DATA XPEL1/48.475,55.3,62.1,68.3,75.7,89.3,102.9,132.3,151.3,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2/2.13E6,2.57E6,2.87E6,2.98E6,2.98E6,2.87E6,2.50E6,2.14E6,1.82E6,1.57E6,1.35E6,1.14E6,9.49E5,7.91E5,6.35E5,4.43E5,2.86E5,9.54E4,3.52E4,1.46E4,6.60E3,4.25E3,3.15E3,2.32E3,1.82E3,459.,167.,38.5,13.2,5.64,2.78,.901,.372,.0734,.0230,.00444,.00138,5.57E-4,2.67E-4,8.43E-5,3.49E-5,7.30E-6,2.50E-6,5.98E-7,2.31E-7,1.16E-7,6.78E-8,3.10E-8,1.78E-8,7.27E-9,4.56E-9,2.54E-9,1.74E-9,1.31E-9,1.06E-9,7.55E-10,5.87E-10,3.77E-10,2.77E-10,5.28E-11/
DATA XPEL2/21.661,24.0,27.0,30.0,35.0,40.0,50.0,60.0,70.0,80.0,90.0,100.,110.,120.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,1.0E8/
# L3 SHELL 2P 3/2
DATA YPEL3/4.25E6,5.14E6,5.73E6,5.97E6,2.98E6,2.87E6,5.00E6,4.29E6,3.64E6,3.13E6,2.69E6,2.28E6,1.90E6,1.58E6,1.26E6,9.20E5,5.68E5,1.89E5,6.98E4,2.89E4,1.30E4,8.41E3,6.23E3,4.57E3,3.60E3,903.,328.,75.6,25.8,11.0,5.43,1.75,.720,.141,.0439,.00837,.00257,.00103,4.88E-4,1.52E-4,6.19E-5,1.26E-5,4.26E-6,1.01E-6,3.96E-7,2.04E-7,1.23E-7,6.04E-8,3.70E-8,1.72E-8,1.08E-8,6.00E-9,4.11E-9,3.11E-9,2.50E-9,1.79E-9,1.39E-9,8.91E-10,6.56E-10,1.25E-10/
DATA XPEL3/21.565,24.0,27.0,30.0,35.0,40.0,50.0,60.0,70.0,80.0,90.0,100.,110.,120.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XENE/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAY/66.51,66.46,66.41,66.26,66.05,65.79,65.47,64.67,63.67,60.42,56.40,47.42,38.86,31.65,25.94,18.11,13.35,7.460,4.877,2.590, 1.596,1.078,.7754,.4563,.2998,.1376,.07840,.03519,.01987,.01274, 8.853D-3,4.985D-3,3.191D-3,3.056D-3,2.043D-3,1.419D-3,7.983D-4,7.643D-4,3.549D-4,1.996D-4,1.278D-4,8.872D-5,6.518D-5,4.991D-5,3.943D-5,3.194D-5,1.425D-5,8.017D-6,3.563D-6,2.004D-6,1.283D-6,8.905D-7,5.011D-7,3.206D-7/
DATA YCOM/1.835D-3,4.309D-3,7.696D-3,.01731,.03067,.04770,.06825,.1196,.1836,.3902, .6452,1.221,1.796,2.320,2.774,3.473,3.949,4.603,4.926,5.214,5.287,5.264,5.198,5.017,4.823,4.388,4.038,3.523,3.161,2.889,2.673,2.350,2.113,2.091,1.889,1.718,1.466,1.448,1.153,.9620,.8308,.7343,.6600,.6006,.5521,.5116,.3786,.3039,.2212,.1758, .1467,.1264,.09972,.08276/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAP/34*1.E-20,8.090D-4,4.464D-3,.01775,.01913,.05108,.08379,.1135,.1403,.1644,.1863,.2062,.2244,.2942,.3473,.4212,.4730, .5120,.5417,.5872,.6210/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFR/1.,.99978,.99926,.9984,.9972,.9957,.9938,.9891,.9830,.9672,.9468,.9352,.9019,.8643,.8233,.7803,.6925,.6076,.4614,.3531,.2786,.2293,.1969,.1754,.1607,.1379,.1217,.09266,.06781,.05136, .03491,.02782,.01363,.007790,.004690,.003580,.001360,.0003075,.0001015,2.822D-6,4.507D-7,1.897D-7,4.044D-11,2.45D-20,2.54D-29/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFC/1.E-21,.000200,.00090,.00201,.00357,.00556,.00799,.01410,.02180,.04177, .06694,.08120,.1205,.1637,.2088,.2547,.3442,.4269,.5644,.6640,.7320,.7774,.8085,.8312,.8490,.8836,.9113,.9517,.9752,.9875,.99368,.99670,.99906,.99969,.99989,1.,1.,1.,1.,1.,1.,1.,1.,1.,1./
# NEON ATOMIC NUMBER
IZ[1]=10
AMZ[1]=20.1797
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
4 AUG[1][I][J][K]=A[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
5 AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
12 R[I][J]=R[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
13 RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC DATA
DO 21 J=1,42
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1.E-24)
21 CONTINUE
DO 22 J=1,58
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*1.E-24)
22 CONTINUE
DO 23 J=1,60
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*1.E-24)
23 CONTINUE
DO 24 J=1,60
XPE[1][4][J]=math.log(XPEL3[J])
YPE[1][4][J]=math.log(YPEL3[J]*1.E-24)
24 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 25 J=1,54
XCP[1][J]=math.log(XENE[J])
YRY[1][J]=math.log(YRAY[J]*1.E-24)
YCP[1][J]=math.log(YCOM[J]*1.E-24)
YPP[1][J]=math.log(YPAP[J]*1.E-24)
25 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 26 J=1,45
FFAR[1][J]=FFR[J]
FFAC[1][J]=FFC[J]
26 CONTINUE
return
# end
def CGAS6(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION XPEK(33),YPEK(33),XPEL1(40),YPEL1(40),XPEL2(40),YPEL2(40),XPEL3(40),YPEL3(40),XPEM1(48),YPEM1(48),XPEM2(49),YPEM2(49),XPEM3(49),YPEM3(49),XPEM4(59),YPEM4(59),XPEM5(59),YPEM5(59),XPEN1(59),YPEN1(59),XPEN2(60),YPEN2(60),XPEN3(60),YPEN3(60),XENE(54),YRAY(54),YCOM(54),YPAP(54),FFR(45),FFC(45)
#
# KRYPTON DATA FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,4,2,2,4,4,6,2,2,4,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/33.4,17.7,19.2,19.3,7.80,7.80,7.70,7.80,7.70,2.0,1.4,1.3,0.0,0.0,0.0,0.0,0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/.002,.060,.089,.180,.220,0.38,0.75,1.43,2.13,1.80,4.39,9.06,0.00,0.00,0.00,0.00,0.00,0.00,.002,.007,.014,.089,.150,.310,1.36,2.04,1.50,3.78,7.97,0.00,0.00,0.00,0.00,0.00,0.00,.008,.006,.026,.099,.180,.360,1.42,2.14,1.53,3.86,8.13,0.00,0.00,0.00,0.00,0.00,0.00,.008,.011,.018,.097,.170,.360,1.41,2.12,1.52,3.84,8.10,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.006,.020,.045,0.32,0.50,1.22,3.26,6.97,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.012,.010,.048,0.33,0.51,1.21,3.26,6.96,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.011,.020,.034,0.31,0.48,1.20,3.24,6.95,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.012,.023,.050,0.27,0.55,1.19,3.22,6.88,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.012,.022,.049,0.35,0.45,1.18,3.21,6.87,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.003,.004,0.14,1.33,3.02,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.001,.002,0.20,0.50,2.31,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.001,.001,0.18,0.96,1.66,0.00,0.00,0.00,0.00,0.00,85*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/.0723,.185,.124,.230,.438,.446,.852,1.32,1.96,2.39,4.53,9.23,0.00,0.00,0.00,0.00,0.00/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K L M AND N SHELLS
# CHEN+CRASEMANN,ANDT 24(1979)13, FOR K AND L SHELLS
# MCGUIRE,SANDIA REPORTS, FOR M AND N SHELLS
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/2.402/,A[1][2][3]/2.697/,A[1][2][4]/4.434/,A[1][2][5]/0.713/,A[1][2][6]/0.406/,A[1][2][7]/0.663/,A[1][2][8]/0.031/,A[1][2][9]/0.039/,A[1,2,10]/0.092/,A[1,2,11]/0.040/,A[1,2,12]/0.065/
DATA A[1][3][3]/0.455/,A[1][3][4]/10.384/,A[1][3][5]/0.338/,A[1][3][6]/0.126/,A[1][3][7]/1.318/,A[1][3][8]/0.041/,A[1][3][9]/0.147/,A[1,3,10]/0.043/,A[1,3,11]/0.013/,A[1,3,12]/0.128/
DATA A[1][4][4]/5.730/,A[1][4][5]/0.611/,A[1][4][6]/1.457/,A[1][4][7]/1.597/,A[1][4][8]/0.214/,A[1][4][9]/0.217/,A[1,4,10]/0.098/,A[1,4,11]/0.202/,A[1,4,12]/0.222/
DATA A[1][5][5]/0.064/,A[1][5][6]/0.064/,A[1][5][7]/0.099/,A[1,5,10]/0.021/,A[1,5,11]/0.009/,A[1,5,12]/0.014/,A[1][6][7]/0.202/,A[1,6,10]/0.010/,A[1,6,12]/0.028/,A[1][7][7]/0.113/,A[1][7][8]/0.024/,A[1][7][9]/0.024/,A[1,7,10]/0.016/,A[1,7,11]/0.028/,A[1,7,12]/0.031/
# L1 SHELL RATE (MILLIATOMIC UNITS)
DATA A[2][3][8]/19.581/,A[2][3][9]/31.107/,A[2,3,10]/3.203/,A[2,3,11]/1.665/,A[2,3,12]/2.200/
DATA A[2][4][7]/54.196/,A[2][4][8]/57.773/,A[2][4][9]/82.495/,A[2,4,10]/5.370/,A[2,4,11]/1.833/,A[2,4,12]/3.926/
DATA A[2][5][5]/1.173/,A[2][5][6]/2.236/,A[2][5][7]/4.300/,A[2][5][8]/3.017/,A[2][5][9]/4.422/,A[2,5,10]/0.266/,A[2,5,11]/0.218/,A[2,5,12]/0.415/
DATA A[2][6][7]/0.092/,A[2][6][8]/0.054/,A[2][6][9]/0.974/,A[2,6,10]/0.216/
DATA A[2][7][7]/0.103/,A[2][7][8]/0.916/,A[2][7][9]/0.652/,A[2,7,10]/0.415/,A[2,7,12]/0.017/
DATA A[2][8][8]/0.125/,A[2][8][9]/5.685/,A[2,8,10]/0.282/,A[2,8,11]/0.007/,A[2,8,12]/0.085/
DATA A[2][9][9]/1.580/,A[2,9,10]/0.411/,A[2,9,11]/0.088/,A[2,9,12]/0.062/
DATA A[2,10,10]/0.015/,A[2,10,11]/0.021/,A[2,10,12]/0.041/
# L2 AUGER SHELL RATE (MILLIATOMIC UNITS)
DATA A[3,4,10]/0.874/,A[3,4,11]/2.468/,A[3,4,12]/0.978/
DATA A[3][5][5]/0.093/,A[3][5][6]/1.876/,A[3][5][7]/0.160/,A[3][5][8]/0.111/,A[3][5][9]/0.252/,A[3,5,11]/0.141/,A[3,5,12]/0.014/
DATA A[3][6][6]/1.724/,A[3][6][7]/5.804/,A[3][6][8]/2.741/,A[3][6][9]/5.061/,A[3,6,10]/0.245/,A[3,6,11]/0.301/,A[3,6,12]/0.551/
DATA A[3][7][7]/0.160/,A[3][7][8]/3.285/,A[3][7][9]/0.460/,A[3,7,10]/0.019/,A[3,7,11]/0.449/,A[3,7,12]/0.027/
DATA A[3][8][8]/2.818/,A[3][8][9]/12.528/,A[3,8,10]/0.014/
DATA A[3][9][9]/0.592/,A[3,9,11]/0.362/,A[3,9,12]/0.040/
DATA A[3,10,11]/0.019/,A[3,11,11]/0.019/,A[3,11,12]/0.043/
# L3 AUGER SHELL RATE (MILLIATOMIC UNITS)
DATA A[4][5][5]/0.099/,A[4][5][6]/0.071/,A[4][5][7]/1.974/,A[4][5][8]/0.176/,A[4][5][9]/0.206/,A[4,5,12]/0.148/
DATA A[4][6][7]/3.189/,A[4][6][8]/0.190/,A[4][6][9]/1.737/,A[4,6,12]/0.244/
DATA A[4][7][7]/4.617/,A[4][7][8]/4.052/,A[4][7][9]/6.153/,A[4,7,10]/0.256/,A[4,7,11]/0.300/,A[4,7,12]/0.793/
DATA A[4][8][8]/0.512/,A[4][8][9]/10.126/,A[4,8,10]/0.021/,A[4,8,11]/0.018/,A[4,8,12]/0.297/
DATA A[4][9][9]/6.885/,A[4,9,10]/0.025/,A[4,9,11]/0.159/,A[4,9,12]/0.485/
DATA A[4,10,12]/0.019/,A[4,11,12]/0.023/,A[4,12,12]/0.034/
# M SHELL AUGER RATE (10**-4 ATOMIC UNITS)
DATA A[5,6,10]/127.3/,A[5,6,11]/145.0/,A[5,6,12]/336.5/
DATA A[5,7,10]/254.6/,A[5,7,11]/336.5/,A[5,7,12]/626.1/
DATA A[5,8,10]/104.4/,A[5,8,11]/15.3/,A[5,8,12]/5.30/
DATA A[5,9,10]/156.6/,A[5,9,11]/1.95/,A[5,9,12]/29.1/
DATA A[5,10,10]/5.00/A[5,10,11]/9.22/,A[5,10,12]/18.4/
DATA A[5,11,11]/0.346/,A[5,11,12]/0.656/,A[5,12,12]/1.02/
DATA A[6,10,10]/1.04/,A[6,10,11]/5.01/,A[6,10,12]/1.38/
DATA A[6,11,11]/3.41/,A[6,11,12]/12.3/,A[6,12,12]/0.32/
DATA A[7][8][8]/29.2/,A[7][8][9]/364.0/,A[7,8,10]/23.9/,A[7,8,11]/23.6/,A[7,8,12]/143.2/
DATA A[7][9][9]/294.0/,A[7,9,10]/105.7/,A[7,9,11]/164.4/,A[7,9,12]/361.8/
DATA A[7,10,10]/1.04/,A[7,10,11]/0.69/,A[7,10,12]/5.69/
DATA A[7,11,11]/0.06/,A[7,11,12]/6.37/,A[7,12,12]/9.62/
DATA A[8,10,10]/2.22/,A[8,10,11]/8.35/,A[8,10,12]/10.83/
DATA A[8,11,11]/2.65/,A[8,11,12]/6.62/,A[8,12,12]/2.34/
DATA A[9,10,10]/2.22/,A[9,10,11]/5.09/,A[9,10,12]/14.09/
DATA A[9,11,11]/0.50/,A[9,11,12]/3.96/,A[9,12,12]/7.15/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/3.88E-6/,R(1,3)/0.499/,R(1,4)/0.962/,R(1,5)/8.60E-7/,R(1,6)/0.0702/,R(1,7)/0.1369/,R(1,8)/2.046E-4/,R(1,9)/2.931E-4/,R(1,10)/1.11E-7/,R(1,11)/6.17E-3/,R(1,12)/.01187/
# L1 SHELL
DATA R(2,3)/3.24E-5/,R(2,4)/1.536E-4/,R(2,5)/4.85E-10/,R(2,6)/5.43E-3/,R(2,7)/9.66E-3/,R(2,8)/3.19E-5/,R(2,9)/4.75E-5/,R(2,10)/8.62E-11/,R(2,11)/5.09E-4/R(2,12)/9.00E-4/
# L2 SHELL
DATA R(3,4)/1.02E-9/,R(3,5)/8.69E-4/,R(3,6)/1.26E-10/,R(3,7)/4.40E-6/,R(3,8)/.02374/,R(3,9)/2.80E-8/,R(3,10)/1.082E-4/,R(3,11)/1.47E-11/,R(3,12)/4.11E-7/
# L3 SHELL
DATA R(4,5)/9.62E-4/,R(4,6)/2.22E-6/,R(4,7)/2.12E-6/,R(4,8)/2.326E-3/,R(4,9)/.02067/,R(4,10)/1.192E-4/,R(4,11)/2.07E-7/,R(4,12)/1.97E-7/
# RADIATIVE TRANSITIONS MANSON AND KENNEDY ANDT 14(1974)111
# DIPOLE ONLY NON-RELATIVISTIC CALC. UNITS 1/SEC
# M1 SHELL
DATA R(5,6)/2.2759E10/,R(5,7)/4.5517E10/,R(5,11)/4.5243E10/,R(5,12)/9.0487E10/
DATA R(6,8)/3.43988E10/,R(6,9)/5.15982E10/,R(6,10)/1.5818E10/,R(6,11)/1.4049E9/,R(6,12)/2.8099E9/
DATA R(7,8)/6.8797E10/,R(7,9)/1.03196E11/,R(7,10)/3.1636E10/,R(7,11)/2.1074E9/,R(7,12)/4.2148E9/
DATA R(10,11)/2.3294E9/,R(10,12)/4.6589E9/
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SHANTHI ET AL. PHYS REV A37(1988)4720
# : KENNEDY AND MANSON PHYS REV A5(1972)227
# : SCOFIELD UCRL-51326
# : SAMSON AND STOLTE J.ELEC.SPEC. 123(2002)265
# : CHAN ET AL PHYS REV A46(1992)149
# : VIEGELE ATOMIC DATA 5(1973)50
# KSHELL
DATA YPEK/1.54E4,1.38E4,6.61E3,2.2E3,979.,517.,304.,131.,67.3,20.,8.50,2.61,1.17,.650,.412,.211,.131,.0611,.0374,.0201,.0135,.0100,.00795,.00559,.00430,.00272,.00198,.00129,9.50E-4,7.54E-4,6.24E-4,4.65E-4,3.70E-4/
DATA XPEK/14326.,1.5E4,2.0E4,3.0E4,4.E4,5.E4,6.E4,8.E4,1.E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL
DATA YPEL1/6.48E4,6.43E4,3.31E4,1.95E4,1.26E4,8.66E3,4.66E3,2.82E3,1.08E3,527.,184.,84.7,45.7,27.4,12.0,6.31,1.92,.828,.258,.117,.0649,.0412,.0211,.0132,.00611,.00374,.00201,.00135,.00100,7.95E-4,5.59E-4,4.30E-4,2.72E-4,1.98E-4,1.29E-4,9.50E-5,7.54E-5,6.24E-5,4.65E-5,3.70E-5/
DATA XPEL1/1921.,2000.,3000.,4000.,5000.,6000.,8000.,1.E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL
DATA YPEL2/1.89E5,1.24E5,4.22E4,1.88E4,9.77E3,5.65E3,2.32E3,1.14E3,303.,115.,28.6,10.4,4.74,2.48,.892,.404,.0978,.0366,.00970,.00399,.00207,.00125,5.96E-4,3.51E-4,1.48E-4,9.07E-5,4.87E-5,3.26E-5,2.43E-5,1.93E-5,1.36E-5,1.04E-5,6.59E-6,4.80E-6,3.11E-6,2.30E-6,1.83E-6,1.51E-6,1.13E-6,8.97E-7/
DATA XPEL2/1730.9,2000.,3000.,4000.,5000.,6000.,8000.,1.E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L3 SHELL
DATA YPEL3/3.96E5,2.37E5,7.91E4,3.47E4,1.79E4,1.03E4,4.17E3,2.03E3,528.,197.,47.6,17.0,7.57,3.90,1.36,.602,.139,.0504,.0129,.00525,.00274,.00167,8.18E-4,4.95E-4,2.23E-4,1.37E-4,7.34E-5,4.91E-5,3.66E-5,2.90E-5,2.04E-5,1.57E-5,9.92E-6,7.24E-6,4.69E-6,3.47E-6,2.75E-6,2.28E-6,1.70E-6,1.35E-6/
DATA XPEL3/1678.4,2000.,3000.,4000.,5000.,6000.,8000.,1.E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# M1 SHELL
DATA YPEM1/2.05E5,1.53E5,1.11E5,7.89E4,6.48E4,5.65E4,4.89E4,4.34E4,2.20E4,1.31E4,6.07E3,3.40E3,2.14E3,1.45E3,764.,459.,174.,85.1,29.7,13.7,7.42,4.45,1.96,1.03,.315,.136,.0423,.0192,.0107,.00677,.00347,.00216,.00100,6.13E-4,3.29E-4,2.20E-4,1.64E-4,1.30E-4,9.16E-5,7.04E-5,4.45E-5,3.25E-5,2.10E-5,1.56E-5,1.23E-5,1.02E-5,7.61E-6,6.06E-6/
DATA XPEM1/292.8,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# M2 SHELL
DATA YPEM2/2.00E5,1.96E5,1.92E5,1.49E5,1.07E5,8.72E4,7.52E4,6.41E4,5.62E4,2.53E4,1.34E4,4.99E3,2.35E3,1.27E3,760.,326.,165.,45.8,17.8,4.53,1.68,.769,.405,.147,.0668,.0163,.00613,.00163,6.72E-4,3.51E-4,2.11E-4,1.01E-4,5.91E-5,2.50E-5,1.53E-5,8.23E-6,5.51E-6,4.10E-6,3.25E-6,2.29E-6,1.76E-6,1.11E-6,8.11E-7,5.26E-7,3.89E-7,3.08E-7,2.56E-7,1.90E-7,1.52E-7/
DATA XPEM2/222.2,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# M3 SHELL
DATA YPEM3/4.90E5,4.54E5,4.11E5,3.07E5,2.16E5,1.74E5,1.49E5,1.27E5,1.11E5,4.88E4,2.55E4,9.36E3,4.36E3,2.34E3,1.38E3,586.,294.,79.8,30.5,7.55,2.73,1.23,.636,.224,.0995,.0231,.00842,.00216,8.81E-4,4.61E-4,2.81E-4,1.38E-4,8.36E-5,3.76E-5,2.30E-5,1.24E-5,8.28E-6,6.17E-6,4.89E-6,3.44E-6,2.65E-6,1.67E-6,1.22E-6,7.91E-7,5.85E-7,4.64E-7,3.84E-7,2.86E-7,2.28E-7/
DATA XPEM3/214.4,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# M4 SHELL
DATA YPEM4/2.17E5,2.89E5,3.62E5,5.68E5,8.00E5,1.17E6,1.44E6,1.71E6,1.74E6,1.68E6,1.37E6,1.06E6,8.07E5,4.04E5,2.08E5,1.42E5,1.09E5,8.31E4,6.73E4,1.88E4,7.16E3,1.71E3,588.,251.,123.,38.9,15.6,2.82,.819,.140,.0394,.0147,.00659,.00187,.000710,.000127,3.91E-5,8.04E-6,2.82E-6,1.30E-6,7.15E-7,2.99E-7,1.62E-7,6.33E-8,3.88E-8,2.08E-8,1.39E-8,1.04E-8,8.24E-9,5.80E-9,4.46E-9,2.82E-9,2.05E-9,1.33E-9,9.84E-10,7.81E-10,6.47E-10,4.82E-10,3.84E-10/
DATA XPEM4/95.0,101.8,108.6,115.4,122.2,135.8,149.,176.,203.,230.,298.,366.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# M5 SHELL
DATA YPEM5/3.25E5,4.34E5,5.43E5,8.52E5,1.20E6,1.76E6,2.16E6,2.56E6,2.61E6,2.53E6,2.06E6,1.58E6,1.19E6,5.96E5,3.05E5,2.08E5,1.60E5,1.22E5,9.83E4,2.73E4,1.04E4,2.46E3,843.,358.,175.,55.0,21.9,3.92,1.12,.189,.0525,.0193,.00853,.00237,.000889,.000156,4.78E-5,9.95E-6,3.57E-6,1.73E-6,1.01E-6,4.51E-7,2.63E-7,1.09E-7,6.68E-8,3.59E-8,2.40E-8,1.79E-8,1.42E-8,1.04E-8,7.68E-9,4.85E-9,3.54E-9,2.29E-9,1.69E-9,1.35E-9,1.11E-9,8.29E-10,6.61E-10/
DATA XPEM5/93.8,100.6,107.4,114.2,121.0,134.6,149.,176.,203.,230.,298.,366.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# N1 SHELL
DATA YPEN1/3.4E3,2.75E4,8.9E4,1.29E5,1.53E5,1.72E5,1.62E5,1.42E5,1.19E5,1.02E5,8.0E4,4.52E4,2.70E4,1.71E4,1.13E4,9.07E3,7.78E3,6.64E3,5.88E3,2.86E3,1.67E3,760.,423.,265.,179.,94.3,56.5,21.5,10.5,3.66,1.69,.915,.549,.242,.127,.0389,.0168,.00523,.00237,.00132,8.36E-4,4.29E-4,2.67E-4,1.24E-4,7.60E-5,4.08E-5,2.73E-5,2.03E-5,1.61E-5,1.14E-5,8.73E-6,5.52E-6,4.03E-6,2.61E-6,1.93E-6,1.53E-6,1.27E-6,9.44E-7,7.52E-7/
DATA XPEN1/27.5,34.3,41.1,47.9,54.7,68.3,81.7,109.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# N2 SHELL
DATA YPEN2/1.47E7,1.51E7,1.48E7,1.37E7,1.07E7,8.87E6,5.80E6,3.17E6,1.56E6,8.33E5,4.93E5,3.30E5,2.49E5,2.08E5,1.75E5,1.42E5,9.00E4,5.2E4,4.80E4,4.16E4,3.33E4,2.28E4,1.50E4,1.01E4,8.01E3,6.81E3,5.74E3,5.00E3,2.19E3,1.15E3,431.,204.,111.,66.2,28.7,14.6,4.06,1.58,.404,.150,.0688,.0363,.0132,.00600,.00146,5.51E-4,1.46E-4,6.03E-5,3.14E-5,1.90E-5,9.01E-6,5.30E-6,2.24E-6,1.37E-6,7.38E-7,4.93E-7,3.67E-7,2.91E-7,2.05E-7,1.36E-8/
DATA XPEN2/14.666,16.0,18.0,20.0,24.0,26.0,30.0,35.0,40.0,45.0,50.0,55.0,60.0,65.0,70.0,80.0,96.0,132.,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E8/
# N3 SHELL
DATA YPEN3/29.5E7,3.02E7,2.95E7,2.73E7,2.15E7,1.77E7,1.16E7,6.33E6,3.11E6,1.67E6,9.87E5,6.59E5,4.99E5,4.15E5,3.50E5,2.84E5,1.8E5,1.04E5,9.6E4,8.32E4,6.67E4,4.60E4,2.99E4,1.98E4,1.56E4,1.32E4,1.11E4,9.67E3,4.18E3,2.17E3,801.,374.,202.,119.,50.7,25.5,6.95,2.67,.662,.240,.108,.0560,.0198,.00879,.00205,7.45E-4,1.91E-4,7.81E-5,4.09E-5,2.49E-5,1.22E-5,7.44E-6,3.37E-6,2.07E-6,1.11E-6,7.42E-7,5.53E-7,4.38E-7,3.09E-7,2.04E-8/
DATA XPEN3/13.9996,16.0,18.0,20.0,24.0,26.0,30.0,35.0,40.0,45.0,50.0,55.0,60.0,65.0,70.0,80.0,96.0,132.,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XENE/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAY/861.9,861.2,860.4,858.1,855.0,851.0,846.3,834.6,820.7,776.6,726.0,625.3,539.9,471.2,415.0,327.3,261.5,159.7,108.7,61.54, 39.47,27.32,20.06,12.24,8.281,3.975,2.319,1.068,.6111,.3949, .2758,.1561,.1002,.09596,.06426,.04467,.02516,.02409,.01119, 6.296D-3, 4.030D-3,2.799D-3,2.056D-3,1.574D-3,1.244D-3,1.008D-3,4.366D-4,2.456D-4,1.092D-4,6.141D-5,3.930D-5,2.729D-5,1.535D-5,9.825D-6/
DATA YCOM/7.696D-3,.01705,.03005,.06694,.1178,.1818,.2579,.4424, .6620,1.304, 1.995,3.334,4.548,5.610,6.532,8.078,9.364,11.81,13.46,15.33,16.23,16.64,16.77,16.63,16.27,15.17,14.14,12.49,11.26,10.32,9.572,8.429,7.588,7.508,6.790,6.175,5.272,5.207,4.149,3.462,2.990,2.643,2.375,2.162,1.987,1.841,1.363,1.094,.7964,.6329, .5283,.4552,.3590,.2979/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAP/34*1.E-20,1.437D-2,.07008,.2552,.2737,.6887,1.089, 1.443,1.753,2.031,2.281,2.510,2.718,3.486,4.074,4.911,5.470,5.863,6.215,6.672,7.015/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFR/1.0,.99972,.99914,.99819,.99678,.99497,.9928,.9872,.9806,.9628, .9411,.9289,.8961,.8614,.8264,.7925,.7306,.6775,.5925,.5228,.4594,.4008,.3489,.3044,.2682,.2076,.1751,.1385,.1086,.0860,.06344,.05469,.03719,.03106,.02684,.02350,.01682,.007156,.003261,1.552D-4,2.919D-5,1.323D-5,6.572D-9,8.97D-18,1.46D-16/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFC/2.8D-22,2.5D-4,9.7D-4,.002164,.003825,.005942,.008489,.01480,.02256,.04151, .0635,.07508,.1046,.1335,.1613,.1878,.2374,.2822,.3564,.4158,.4681,.5156,.5589,.5983,.6333,.7056,.7586,.8297,.8758,.9072,.9281,.9422,.9600,.9717,.9800,.9861,.9936,.99903,.99983,1.0,1.0,1.0,1.0,1.0,1.0/
# KRYPTON ATOMIC NUMBER
IZ[1]=36
AMZ[1]=83.798
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
4 AUG[1][I][J][K]=A[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
5 AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
12 R[I][J]=R[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
13 RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC DATA
DO 21 J=1,33
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1.E-24)
21 CONTINUE
DO 22 J=1,40
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*1.E-24)
22 CONTINUE
DO 23 J=1,40
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*1.E-24)
23 CONTINUE
DO 24 J=1,40
XPE[1][4][J]=math.log(XPEL3[J])
YPE[1][4][J]=math.log(YPEL3[J]*1.E-24)
24 CONTINUE
DO 25 J=1,48
XPE[1][5][J]=math.log(XPEM1[J])
YPE[1][5][J]=math.log(YPEM1[J]*1.E-24)
25 CONTINUE
DO 26 J=1,49
XPE[1][6][J]=math.log(XPEM2[J])
YPE[1][6][J]=math.log(YPEM2[J]*1.E-24)
26 CONTINUE
DO 27 J=1,49
XPE[1][7][J]=math.log(XPEM3[J])
YPE[1][7][J]=math.log(YPEM3[J]*1.E-24)
27 CONTINUE
DO 28 J=1,59
XPE[1][8][J]=math.log(XPEM4[J])
YPE[1][8][J]=math.log(YPEM4[J]*1.E-24)
28 CONTINUE
DO 29 J=1,59
XPE[1][9][J]=math.log(XPEM5[J])
YPE[1][9][J]=math.log(YPEM5[J]*1.E-24)
29 CONTINUE
DO 30 J=1,59
XPE(1,10,J)=math.log(XPEN1[J])
YPE(1,10,J)=math.log(YPEN1[J]*1.E-24)
30 CONTINUE
DO 31 J=1,60
XPE(1,11,J)=math.log(XPEN2[J])
YPE(1,11,J)=math.log(YPEN2[J]*1.E-24)
31 CONTINUE
DO 32 J=1,60
XPE(1,12,J)=math.log(XPEN3[J])
YPE(1,12,J)=math.log(YPEN3[J]*1.E-24)
32 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 33 J=1,54
XCP[1][J]=math.log(XENE[J])
YRY[1][J]=math.log(YRAY[J]*1.E-24)
YCP[1][J]=math.log(YCOM[J]*1.E-24)
YPP[1][J]=math.log(YPAP[J]*1.E-24)
33 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 34 J=1,45
FFAR[1][J]=FFR[J]
FFAC[1][J]=FFC[J]
34 CONTINUE
return
# end
def CGAS7(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION XPEK(30),YPEK(30),XPEL1(36),YPEL1(36),XPEL2(37),YPEL2(37),XPEL3(37),YPEL3(37),XPEM1(41),YPEM1(41),XPEM2(41),YPEM2(41),XPEM3(42),YPEM3(42),XPEM4(45),YPEM4(45),XPEM5(45),YPEM5(45),XPEN1(49),YPEN1(49),XPEN2(50),YPEN2(50),XPEN3(51),YPEN3(51),XPEN4(59),YPEN4(59),XPEN5(59),YPEN5(59),XPEO1(59),YPEO1(59),XPEO2(60),YPEO2(60),XPEO3(60),YPEO3(60),XENE(54),YRAY(54),YCOM(54),YPAP(54),FFR(45),FFC(45)
#
# XENON DATA FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,4,2,2,4,4,6,2,2,4,4,6,2,2,4/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/43.6,23.7,26.2,25.4,11.7,12.1,11.7,12.8,12.6,6.0,5.8,5.6,5.0,4.9,1.7,1.2,1.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/.001,.023,.032,.061,.073,0.11,0.22,0.22,0.32,0.23,0.37,0.73,1.65,2.46,1.67,3.73,8.39,0.00,.001,.002,.005,.028,.038,.082,0.16,0.24,0.14,0.22,0.36,1.63,2.46,1.48,3.36,7.76,0.00,.003,.002,.009,.032,.052,0.10,0.18,0.27,0.15,0.24,0.50,1.67,2.51,1.50,3.41,7.86,0.00,.003,.003,.006,.030,.045,.099,0.17,0.26,0.15,0.23,0.48,1.66,2.50,1.49,3.39,7.83,0.00,0.00,0.00,0.00,.001,.004,.009,.017,.027,.075,0.11,0.25,1.05,1.62,1.36,3.12,7.31,0.00,0.00,0.00,0.00,.003,.002,.011,.020,.032,.075,0.12,0.26,1.08,1.66,1.36,3.14,7.33,0.00,0.00,0.00,0.00,.003,.004,.007,.017,.028,.072,0.11,0.25,1.05,1.61,1.36,3.12,7.31,0.00,0.00,0.00,0.00,.004,.005,.014,.023,.047,.079,0.12,0.27,1.15,1.75,1.37,3.15,7.35,0.00,0.00,0.00,0.00,.004,.006,.013,.028,.037,.078,0.12,0.27,1.13,1.75,1.37,3.14,7.35,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.005,.017,.043,0.33,0.53,1.09,2.70,6.45,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.008,.008,.039,0.31,0.49,1.06,2.57,6.39,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.007,.014,.025,0.28,0.45,1.04,2.63,6.34,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.005,.010,.025,0.17,0.36,0.96,2.51,6.09,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.004,.009,.024,0.21,0.29,0.95,2.50,6.06,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.006,.010,0.14,1.13,3.05,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.002,.004,0.19,0.43,2.35,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.002,.003,0.17,0.76,1.60/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/.0348,.0791,.0494,.0819,.160,.144,.258,.205,.300,.376,.417,.784,1.56,2.32,2.09,3.88,8.51/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K L M AND N SHELLS
# CHEN+CRASEMANN,ANDT 24(1979)13, FOR K AND L SHELLS
# MCGUIRE,SANDIA REPORTS, FOR M AND N SHELLS
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/3.740/,A[1][2][3]/4.524/,A[1][2][4]/5.393/,A[1][2][5]/1.340/,A[1][2][6]/0.867/,A[1][2][7]/1.046/,A[1][2][8]/0.074/,A[1][2][9]/0.078/,A[1,2,10]/0.293/,A[1,2,11]/0.179/,A[1,2,12]/0.215/,A[1,2,15]/0.045/,A[1,2,16]/0.022/,A[1,2,17]/0.025/
DATA A[1][3][3]/0.558/,A[1][3][4]/11.635/,A[1][3][5]/0.673/,A[1][3][6]/0.191/,A[1][3][7]/1.874/,A[1][3][8]/0.088/,A[1][3][9]/0.287/,A[1,3,10]/0.142/,A[1,3,11]/0.039/,A[1,3,12]/0.372/,A[1,3,14]/0.053/,A[1,3,15]/0.021/,A[1,3,17]/0.043/
DATA A[1][4][4]/5.864/,A[1][4][5]/0.797/,A[1][4][6]/1.842/,A[1][4][7]/1.943/,A[1][4][8]/0.311/,A[1][4][9]/0.318/,A[1,4,10]/0.167/,A[1,4,11]/0.367/,A[1,4,12]/0.388/,A[1,4,13]/0.058/,A[1,4,14]/0.059/,A[1,4,15]/0.026/,A[1,4,16]/0.044/,A[1,4,17]/0.045/
DATA A[1][5][5]/0.119/,A[1][5][6]/0.131/,A[1][5][7]/0.154/,A[1,5,10]/0.052/,A[1,5,11]/0.027/,A[1,5,12]/0.032/,A[1][6][7]/0.301/,A[1,6,10]/0.028/,A[1,6,12]/0.060/,A[1][7][7]/0.163/,A[1][7][8]/0.041/,A[1][7][9]/0.041/,A[1,7,10]/0.033/,A[1,7,11]/0.061/,A[1,7,12]/0.065/
# L1 SHELL RATE (MILLIATOMIC UNITS)
DATA A[2,3,10]/7.052/,A[2,3,11]/5.055/,A[2,3,12]/6.396/,A[2,3,13]/1.751/,A[2,3,14]/2.869/,A[2,3,15]/1.038/,A[2,3,16]/0.556/,A[2,3,17]/0.686/
DATA A[2,4,10]/9.422/,A[2,4,11]/4.167/,A[2,4,12]/7.694/,A[2,4,13]/8.024/,A[2,4,14]/10.40/,A[2,4,15]/1.385/,A[2,4,16]/0.473/,A[2,4,17]/0.880/
DATA A[2][5][5]/1.715/,A[2][5][6]/3.423/,A[2][5][7]/6.315/,A[2][5][8]/4.969/,A[2][5][9]/7.119/,A[2,5,10]/0.636/,A[2,5,11]/0.688/,A[2,5,12]/1.261/,A[2,5,13]/0.793/,A[2,5,14]/1.132/,A[2,5,15]/0.097/,A[2,5,16]/0.084/,A[2,5,17]/0.149/
DATA A[2][6][7]/0.136/,A[2][6][8]/0.147/,A[2][6][9]/1.890/,A[2,6,10]/0.508/,A[2,6,13]/0.024/,A[2,6,14]/0.197/,A[2,6,15]/0.073/
DATA A[2][7][7]/0.143/,A[2][7][8]/1.290/,A[2][7][9]/0.891/,A[2,7,10]/0.937/,A[2,7,12]/0.044/,A[2,7,13]/0.116/,A[2,7,15]/0.135/
DATA A[2][8][8]/0.285/,A[2][8][9]/10.175/,A[2,8,10]/0.712/,A[2,8,11]/0.038/,A[2,8,12]/0.255/,A[2,8,13]/0.090/,A[2,8,14]/1.191/,A[2,8,15]/0.102/
DATA A[2][9][9]/2.873/,A[2,9,10]/1.011/,A[2,9,11]/0.342/,A[2,9,12]/0.185/,A[2,9,13]/1.138/,A[2,9,14]/0.703/,A[2,9,15]/0.146/,A[2,9,16]/0.041/
DATA A[2,10,10]/0.056/,A[2,10,11]/0.103/,A[2,10,12]/0.189/,A[2,10,13]/0.112/,A[2,10,14]/0.160/,A[2,10,17]/0.022/
DATA A[2,11,14]/0.038/,A[2,11,17]/0.027/,A[2,13,14]/0.147/,A[2,14,14]/0.046/
# L2 AUGER SHELL RATE (MILLIATOMIC UNITS)
DATA A[3,4,10]/1.260/,A[3,4,11]/5.499/,A[3,4,12]/1.934/,A[3,4,13]/7.131/,A[3,4,14]/2.659/,A[3,4,15]/0.176/,A[3,4,16]/0.645/,A[3,4,17]/0.228/
DATA A[3][5][5]/0.113/,A[3][5][6]/2.762/,A[3][5][7]/0.258/,A[3][5][8]/0.228/,A[3][5][9]/0.388/,A[3,5,11]/0.382/,A[3,5,12]/0.046/,A[3,5,13]/0.025/,A[3,5,16]/0.044/
DATA A[3][6][6]/2.718/,A[3][6][7]/8.442/,A[3][6][8]/4.636/,A[3][6][9]/7.878/,A[3,6,10]/0.612/,A[3,6,11]/0.939/,A[3,6,12]/1.656/,A[3,6,13]/0.738/,A[3,6,14]/1.253/,A[3,6,15]/0.095/,A[3,6,16]/0.112/,A[3,6,17]/0.195/
DATA A[3][7][7]/0.223/,A[3][7][8]/5.422/,A[3][7][9]/0.727/,A[3,7,10]/0.050/,A[3,7,11]/1.221/,A[3,7,12]/0.074/,A[3,7,13]/0.746/,A[3,7,14]/0.094/,A[3,7,16]/0.141/
DATA A[3][8][8]/5.092/,A[3][8][9]/21.648/,A[3,8,10]/0.050/,A[3,8,11]/0.664/,A[3,8,12]/1.008/,A[3,8,13]/1.384/,A[3,8,14]/3.146/,A[3,8,16]/0.077/,A[3,8,17]/0.118/
DATA A[3][9][9]/1.031/,A[3,9,11]/1.005/,A[3,9,12]/0.125/,A[3,9,13]/2.513/,A[3,9,14]/0.274/,A[3,9,16]/0.114/
DATA A[3,10,11]/0.086/,A[3,11,11]/0.078/,A[3,11,12]/0.239/,A[3,11,13]/0.105/,A[3,11,14]/0.162/,A[3,12,13]/0.140/,A[3,13,13]/0.379/
# L3 AUGER SHELL RATE (MILLIATOMIC UNITS)
DATA A[4][5][5]/0.135/,A[4][5][6]/0.092/,A[4][5][7]/2.942/,A[4][5][8]/0.300/,A[4][5][9]/0.343/,A[4,5,12]/0.407/
DATA A[4][6][7]/4.935/,A[4][6][8]/0.327/,A[4][6][9]/2.893/,A[4,6,12]/0.705/,A[4,6,14]/0.376/
DATA A[4][7][7]/6.897/,A[4][7][8]/7.051/,A[4][7][9]/10.607/,A[4,7,10]/0.645/,A[4,7,11]/0.943/,A[4,7,12]/2.335/,A[4,7,13]/1.084/,A[4,7,14]/1.611/,A[4,7,15]/0.101/,A[4,7,16]/0.114/,A[4,7,17]/0.270/
DATA A[4][8][8]/1.037/,A[4][8][9]/19.841/,A[4,8,10]/0.060/,A[4,8,11]/0.064/,A[4,8,12]/0.944/,A[4,8,13]/0.282/,A[4,8,14]/2.322/,A[4,8,17]/0.105/
DATA A[4][9][9]/13.486/,A[4,9,10]/0.072/,A[4,9,11]/0.523/,A[4,9,12]/1.592/,A[4,9,13]/2.728/,A[4,9,14]/3.516/,A[4,9,16]/0.063/,A[4,9,17]/0.181/
DATA A[4,10,12]/0.090/,A[4,11,12]/0.137/,A[4,11,14]/0.070/,A[4,12,12]/0.193/,A[4,12,13]/0.146/,A[4,12,14]/0.240/,A[4,12,17]/0.044/,A[4,13,14]/0.333/,A[4,14,14]/0.233/
# M SHELL AUGER RATE (10**-4 ATOMIC UNITS)
DATA A[5,6,13]/300.0/,A[5,6,14]/453.0/,A[5,6,15]/38.0/,A[5,6,16]/33.6/,A[5,6,17]/68.7/
DATA A[5,7,11]/396.0/,A[5,7,12]/732.0/,A[5,7,13]/213.0/,A[5,7,14]/337.0/,A[5,7,15]/59.1/,A[5,7,16]/55.3/,A[5,7,17]/108.0/
DATA A[5,8,10]/155.0/,A[5,8,11]/23.4/,A[5,8,12]/13.0/,A[5,8,13]/39.3/,A[5,8,14]/55.9/,A[5,8,15]/15.5/,A[5,8,16]/2.67/,A[5,8,17]/1.60/
DATA A[5,9,10]/233.0/,A[5,9,11]/6.96/,A[5,9,12]/47.6/,A[5,9,13]/55.9/,A[5,9,14]/86.9/,A[5,9,15]/23.3/,A[5,9,16]/0.88/,A[5,9,17]/5.52/
DATA A[5,10,10]/20.7/A[5,10,11]/18.2/,A[5,10,12]/36.4/,A[5,10,13]/30.8/,A[5,10,14]/46.1/,A[5,10,15]/3.06/,A[5,10,16]/2.39/,A[5,10,17]/4.78/
DATA A[5,11,11]/0.92/,A[5,11,12]/2.22/,A[5,11,13]/1.34/,A[5,11,14]/0.84/,A[5,11,15]/1.92/,A[5,11,16]/0.20/,A[5,11,17]/0.24/
DATA A[5,12,12]/2.95/,A[5,12,13]/1.28/,A[5,12,14]/3.09/,A[5,12,15]/3.84/,A[5,12,16]/0.24/,A[5,12,17]/0.65/
DATA A[5,13,13]/0.34/,A[5,13,14]/2.36/,A[5,13,15]/3.43/,A[5,13,16]/0.13/,A[5,13,17]/0.13/
DATA A[5,14,14]/1.10/,A[5,14,15]/5.14/,A[5,14,16]/0.091/,A[5,14,17]/0.30/
DATA A[5,15,15]/0.43/,A[5,15,16]/0.26/,A[5,15,17]/0.53/,A[5,16,16]/0.011/,A[5,16,17]/0.024/,A[5,17,17]/0.035/
DATA A[6,7,15]/16.8/,A[6,7,16]/16.4/,A[6,7,17]/21.0/
DATA A[6,8,10]/188.0/,A[6,8,11]/224.0/,A[6,8,12]/407.0/,A[6,8,13]/77.4/,A[6,8,14]/81.7/,A[6,8,15]/31.5/,A[6,8,16]/25.8/,A[6,8,17]/49.5/
DATA A[6,9,10]/45.1/,A[6,9,11]/277.0/,A[6,9,12]/34.8/,A[6,9,13]/5.43/,A[6,9,14]/14.0/,A[6,9,15]/5.05/,A[6,9,16]/27.7/,A[6,9,17]/4.08/
DATA A[6,10,10]/1.59/,A[6,10,11]/18.2/,A[6,10,12]/3.51/,A[6,10,13]/0.77/,A[6,10,14]/2.36/,A[6,10,15]/0.38/,A[6,10,16]/1.37/,A[6,10,17]/0.38/
DATA A[6,11,11]/13.5/,A[6,11,12]/45.7/,A[6,11,13]/31.6/,A[6,11,14]/54.4/,A[6,11,15]/3.08/,A[6,11,16]/2.80/,A[6,11,17]/5.51/
DATA A[6,12,12]/1.07/,A[6,12,13]/4.10/,A[6,12,14]/2.76/,A[6,12,15]/0.35/,A[6,12,16]/3.91/,A[6,12,17]/0.21/
DATA A[6,13,13]/1.13/,A[6,13,14]/3.67/,A[6,13,15]/0.097/,A[6,13,16]/2.94/,A[6,13,17]/0.39/
DATA A[6,14,14]/0.82/,A[6,14,15]/0.279/,A[6,14,16]/5.17/,A[6,14,17]/0.26/
DATA A[6,15,15]/0.026/,A[6,15,16]/0.301/,A[6,15,17]/0.046/,A[6,16,16]/0.15/,A[6,16,17]/0.53/,A[6,17,17]/0.023/
DATA A[7,8,10]/57.2/,A[7,8,11]/36.6/,A[7,8,12]/236.0/,A[7,8,13]/29.4/,A[7,8,14]/17.7/,A[7,8,15]/7.45/,A[7,8,16]/4.82/,A[7,8,17]/27.0/
DATA A[7,9,10]/222.0/,A[7,9,11]/223.0/,A[7,9,12]/555.0/,A[7,9,13]/81.9/,A[7,9,14]/162.0/,A[7,9,15]/37.4/,A[7,9,16]/30.4/,A[7,9,17]/77.5/
DATA A[7,10,10]/1.59/,A[7,10,11]/1.76/,A[7,10,12]/19.9/,A[7,10,13]/1.49/,A[7,10,14]/1.63/,A[7,10,15]/0.38/,A[7,10,16]/0.19/,A[7,10,17]/1.56/
DATA A[7,11,11]/0.38/,A[7,11,12]/23.1/,A[7,11,13]/0.61/,A[7,11,14]/2.82/,A[7,11,15]/0.17/,A[7,11,16]/0.075/,A[7,11,17]/1.99/
DATA A[7,12,12]/36.7/,A[7,12,13]/37.2/,A[7,12,14]/52.2/,A[7,12,15]/3.25/,A[7,12,16]/2.78/,A[7,12,17]/7.59/
DATA A[7,13,13]/0.33/,A[7,13,14]/3.11/,A[7,13,15]/0.177/,A[7,13,16]/0.057/,A[7,13,17]/3.53/
DATA A[7,14,14]/2.17/,A[7,14,15]/0.198/,A[7,14,16]/0.26/,A[7,14,17]/4.90/
DATA A[7,15,15]/0.026/,A[7,15,16]/0.023/,A[7,15,17]/0.324/,A[7,16,16]/0.004/,A[7,16,17]/0.266/,A[7,17,17]/0.421/
DATA A[8,10,10]/0.012/,A[8,10,11]/1.25/,A[8,10,12]/0.88/,A[8,10,13]/20.5/,A[8,10,14]/2.96/,A[8,10,15]/0.009/,A[8,10,16]/0.123/,A[8,10,17]/0.065/
DATA A[8,11,11]/0.56/,A[8,11,12]/4.25/,A[8,11,13]/17.8/,A[8,11,14]/2.16/,A[8,11,15]/0.133/,A[8,11,16]/0.079/,A[8,11,17]/0.297/
DATA A[8,12,12]/1.55/,A[8,12,13]/43.0/,A[8,12,14]/2.02/,A[8,12,15]/0.090/,A[8,12,16]/0.398/,A[8,12,17]/0.284/
DATA A[8,13,13]/36.8/,A[8,13,14]/86.3/,A[8,13,15]/4.70/,A[8,13,16]/3.10/,A[8,13,17]/7.24/
DATA A[8,14,14]/13.5/,A[8,14,15]/0.35/,A[8,14,16]/0.24/,A[8,14,17]/0.25/
DATA A[8,15,15]/0.0008/,A[8,15,16]/0.015/,A[8,15,17]/0.008/,A[8,16,16]/0.0072/,A[8,16,17]/0.0479/,A[8,17,17]/0.0169/
DATA A[9,10,10]/0.012/,A[9,10,11]/0.35/,A[9,10,12]/1.78/,A[9,10,13]/1.97/,A[9,10,14]/21.5/,A[9,10,15]/0.009/,A[9,10,16]/0.022/,A[9,10,17]/0.166/
DATA A[9,11,11]/0.025/,A[9,11,12]/3.46/,A[9,11,13]/0.36/,A[9,11,14]/22.4/,A[9,11,15]/0.035/,A[9,11,16]/0.003/,A[9,11,17]/0.334/
DATA A[9,12,12]/2.88/,A[9,12,13]/2.42/,A[9,12,14]/3.98/,A[9,12,15]/0.188/,A[9,12,16]/0.266/,A[9,12,17]/0.455/
DATA A[9,13,13]/5.90/,A[9,13,14]/63.7/,A[9,13,15]/0.23/,A[9,13,16]/0.051/,A[9,13,17]/0.274/
DATA A[9,14,14]/66.9/,A[9,14,15]/4.82/,A[9,14,16]/3.74/,A[9,14,17]/6.76/
DATA A[9,15,15]/0.0008/,A[9,15,16]/0.003/,A[9,15,17]/0.021/,A[9,16,16]/0.0003/,A[9,16,17]/0.0380/,A[9,17,17]/0.0388/
# N SHELL AUGER RATES (10**-4 ATOMIC UNITS)
DATA A[10,11,15]/98.5/,A[10,11,16]/80.3/,A[10,11,17]/229.0/
DATA A[10,12,15]/197.0/,A[10,12,16]/229.0/,A[10,12,17]/389.0/
DATA A[10,13,13]/11.6/,A[10,13,14]/295.0/,A[10,13,15]/74.7/,A[10,13,16]/12.4/,A[10,13,17]/64.2/
DATA A[10,14,14]/91.4/,A[10,14,15]/112.0/,A[10,14,16]/51.4/,A[10,14,17]/63.5/
DATA A[10,15,15]/5.72/,A[10,15,16]/5.83/,A[10,15,17]/11.7/
DATA A[10,16,16]/0.53/,A[10,16,17]/1.95/,A[10,17,17]/2.04/
DATA A[11,13,15]/171.0/,A[11,13,16]/152.0/,A[11,13,17]/394.0/
DATA A[11,14,15]/25.2/,A[11,14,16]/139.0/,A[11,14,17]/35.9/
DATA A[11,15,15]/0.390/,A[11,15,16]/8.04/,A[11,15,17]/1.05/
DATA A[11,16,16]/4.14/,A[11,16,17]/13.7/,A[11,17,17]/0.42/
DATA A[12,13,15]/32.2/,A[12,13,16]/26.9/,A[12,13,17]/133.0/
DATA A[12,14,15]/164.0/,A[12,14,16]/188.0/,A[12,14,17]/374.0/
DATA A[12,15,15]/0.390/,A[12,15,16]/0.53/,A[12,15,17]/8.56/
DATA A[12,16,16]/0.15/,A[12,16,17]/6.98/,A[12,17,17]/11.1/
DATA A[13,15,15]/6.00/,A[13,15,16]/2.69/,A[13,15,17]/3.41/
DATA A[13,16,16]/3.13/,A[13,16,17]/10.7/,A[13,17,17]/4.21/
DATA A[14,15,15]/6.00/,A[14,15,16]/1.60/,A[14,15,17]/4.50/
DATA A[14,16,16]/0.59/,A[14,16,17]/7.55/,A[14,17,17]/9.90/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/2.88E-4/,R(1,3)/2.842/,R(1,4)/5.26/,R(1,5)/7.93E-5/,R(1,6)/0.494/,R(1,7)/0.958/,R(1,8)/4.87E-3/,R(1,9)/6.66E-3/,R(1,10)/1.86E-5/,R(1,11)/.0986/,R(1,12)/.1916/,R(1,13)/8.588E-4/,R(1,14)/1.2882E-3/,R(1,16)/.01057/,R(1,17)/.02113/
# L1 SHELL
DATA R(2,3)/7.12E-5/,R(2,4)/1.341E-3/,R(2,5)/6.67E-8/,R(2,6)/.0498/,R(2,7)/.0785/,R(2,8)/7.42E-4/,R(2,9)/1.109E-3/,R(2,10)/2.37E-8/,R(2,11)/.01074/R(2,12)/.01737/,R(2,13)/9.03E-5/,R(2,14)/1.372E-4/,R(2,15)/3.87E-9/,R(2,16)/1.221E-3/,R(2,17)/1.897E-3/
# L2 SHELL
DATA R(3,4)/2.17E-7/,R(3,5)/6.49E-3/,R(3,6)/1.84E-8/,R(3,7)/1.001E-4/,R(3,8)/.2312/,R(3,9)/1.92E-6/,R(3,10)/1.431E-3/,R(3,11)/5.58E-9/,R(3,12)/2.22E-5/,R(3,13)/.0345/,R(3,14)/3.13E-7/,R(3,15)/2.146E-4/,R(3,16)/6.70E-10/,R(3,17)/2.43E-6/
# L3 SHELL
DATA R(4,5)/8.22E-3/,R(4,6)/4.98E-5/,R(4,7)/4.63E-5/,R(4,8)/.02188/,R(4,9)/.1939/,R(4,10)/1.789E-3/,R(4,11)/1.04E-5/,R(4,12)/9.99E-6/,R(4,13)/3.18E-3/,R(4,14)/.02838/,R(4,15)/2.677E-4/,R(4,16)/1.18E-6/,R(4,17)/1.09E-6/
# RADIATIVE TRANSITIONS MANSON AND KENNEDY ANDT 14(1974)111
# DIPOLE ONLY NON-RELATIVISTIC CALC. UNITS 1/SEC
# M1 SHELL
DATA R(5,6)/6.3377E10/,R(5,7)/1.26753E11/,R(5,11)/1.8393E12/,R(5,12)/3.6785E12/,R(5,16)/2.2512E11/,R(5,17)/4.5023E11/
DATA R(6,8)/8.8395E10/,R(6,9)/1.3259E11/,R(6,10)/2.8247E11/,R(6,13)/5.7349E11/,R(6,14)/8.6023E11/,R(6,15)/4.2237E10/
DATA R(7,8)/1.7679E11/,R(7,9)/2.6518E11/,R(7,10)/5.6494E11/,R(7,13)/1.1470E12/,R(7,14)/1.7205E12/,R(7,15)/8.4473E10/
DATA R(8,11)/4.6363E10/,R(8,12)/9.2725E10/,R(8,16)/4.9477E9/,R(8,17)/9.8955E9/
DATA R(9,11)/6.9544E10/,R(9,12)/1.3909E11/,R(9,16)/7.4216E9/,R(9,17)/1.4843E10/
DATA R(10,11)/1.7296E10/,R(10,12)/3.4593E10/,R(10,16)/1.8626E10/,R(10,17)/3.7251E10/
DATA R(11,13)/2.6747E10/,R(11,14)/4.012E10/,R(11,15)/1.2116E10/
DATA R(12,13)/5.3493E10/,R(12,14)/8.024E10/,R(12,15)/2.4233E10/
DATA R(13,16)/1.5247E9/,R(13,17)/3.0493E9/,R(14,16)/2.287E9/,R(14,17)/4.574E9/,R(15,16)/1.5316E9/,R(15,17)/3.0633E9/
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : KUTZNER ET AL PHYS REV A40(1989)5052
# : KENNEDY AND MANSON PHYS REV A5(1972)227
# : SCOFIELD UCRL-51326
# : WEST AND MORTON ANDT 22(1978)103
# : SAMSON AND STOLTE J.ELEC.SPEC. 123(2002)265
# : CHAN ET AL PHYS REV A46(1992)149
# KSHELL
DATA YPEK/5920.,4040.,2262.,1381.,626.,335.,106.,46.7,15.1,6.95,3.93,2.52,1.31,.817,.378,.231,.123,.0816,.0607,.0479,.0335,.0259,.0160,.0117,.00749,.00553,.00438,.00363,.00271,.00215/
DATA XPEK/34561.,4.0E4,5.0E4,6.0E4,8.E4,1.E5,1.5E5,2.E5,3.E5,4.E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEL1/2.34E4,1.97E4,1.19E4,7.80E3,3.42E3,1.82E3,712.,353.,202.,126.,59.1,32.4,10.7,4.82,1.59,.746,.424,.273,.142,.0887,.0409,.0250,.0133,.00883,.00657,.00518,.00362,.00280,.00174,.00126,.000810,.000598,.000474,.000393,.000293,.000232/
DATA XPEL1/5453.,6.0E3,8.0E3,1.E4,1.5E4,2.E4,3.E4,4.E4,5.E4,6.E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEL2/4.62E4,4.10E4,3.25E4,1.49E4,7.91E3,2.40E3,999.,279.,111.,53.4,29.3,11.3,5.42,1.43,.567,.160,.0686,.0367,.0225,.0109,.00653,.00282,.00172,.000916,.000609,.000453,.000357,.000250,.000193,.000120,8.70E-5,5.59E-5,4.12E-5,3.27E-5,2.71E-5,2.02E-5,1.60E-5/
DATA XPEL2/5107.,5455.,6000.,8000.,1.E4,1.5E4,2.E4,3.E4,4.E4,5.E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEL3/9.85E4,9.25E4,5.74E4,2.53E4,1.32E4,3.86E3,1.56E3,417.,160.,75.0,40.2,14.9,6.89,1.71,.645,.173,.072,.0381,.0233,.0114,.0069,.00306,.00187,.000994,.000660,.000491,.000388,.000271,.000209,.000130,9.44E-5,6.06E-5,4.47E-5,3.55E-5,2.94E-5,2.19E-5,1.74E-5/
DATA XPEL3/4786.,5000.,6000.,8000.,1.E4,1.5E4,2.E4,3.E4,4.E4,5.E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5, 1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEM1/6.72E4,4.87E4,3.22E4,1.65E4,9.91E3,6.55E3,4.62E3,2.61E3,1.65E3,692.,363.,140.,69.3,39.5,24.7,11.6,6.38,2.11,.956,.317,.148,.0844,.0543,.0283,.0177,.00814,.00497,.00264,.00176,.00131,.00103,7.21E-4,5.57E-4,3.46E-4,2.51E-4,1.61E-4,1.19E-4,9.44E-5,7.82E-5,5.84E-5,4.63E-5/
DATA XPEM1/1148.7,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEM2/1.20E5,6.99E4,4.49E4,2.12E4,1.16E4,7.05E3,4.58E3,2.24E3,1.25E3,411.,179.,52.7,21.5,10.6,5.89,2.32,1.12,.301,.120,.0343,.0147,.0079,.00486,.00237,.00141,6.11E-4,3.73E-4,1.98E-4,1.32E-4,9.81E-5,7.74E-5,5.42E-5,4.18E-5,2.59E-5,1.89E-5,1.21E-5,8.93E-6,7.09E-6,5.87E-6,4.38E-6,3.47E-6/
DATA XPEM2/1002.1,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEM3/2.85E5,2.58E5,1.48E5,9.05E4,4.06E4,2.16E4,1.28E4,8.17E3,3.89E3,2.13E3,672.,284.,80.0,31.5,15.1,8.19,3.09,1.44,.364,.139,.0375,.0157,.00830,.00509,.00249,.00151,6.67E-4,4.07E-4,2.17E-4,1.44E-4,1.07E-4,8.45E-5,5.91E-5,4.57E-5,2.83E-5,2.06E-5,1.32E-5,9.75E-6,7.74E-6,6.41E-6,4.78E-6,3.79E-6/
DATA XPEM3/940.6,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEM4/1.37E6,1.02E6,8.11E5,6.60E5,5.58E5,2.01E5,8.88E4,2.59E4,1.02E4,4.81E3,2.56E3,915.,402.,85.5,27.5,5.35,1.64,.649,.305,.0924,.0368,.00713,.00230,.000501,.000181,8.53E-5,4.78E-5,2.04E-5,1.10E-5,4.20E-6,2.56E-6,1.36E-6,9.06E-7,6.75E-7,5.32E-7,3.72E-7,2.87E-7,1.78E-7,1.30E-7,8.32E-8,6.14E-8,4.87E-8,4.06E-8,3.01E-8,2.39E-8/
DATA XPEM4/689.,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEM5/2.20E6,1.48E6,1.19E6,9.68E5,8.15E5,2.90E5,1.27E5,3.66E4,1.43E4,6.70E3,3.54E3,1.25E3,547.,114.,36.3,6.88,2.07,.806,.373,.110,.0433,.00815,.00259,.000561,.000208,.000102,5.86E-5,2.66E-5,1.57E-5,6.43E-6,3.92E-6,2.09E-6,1.39E-6,1.03E-6,8.15E-7,5.70E-7,4.40E-7,2.73E-7,1.98E-7,1.27E-7,9.40E-8,7.46E-8,6.18E-8,4.61E-8,3.66E-8/
DATA XPEM5/676.4,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEN1/1.65E5,1.33E5,9.75E4,6.86E4,4.85E4,3.97E4,3.46E4,2.99E4,2.67E4,1.37E4,8.27E3,3.97E3,2.31E3,1.50E3,1.05E3,585.,367.,153.,79.7,30.7,15.2,8.66,5.42,2.55,1.40,.463,.210,.0696,.0326,.0186,.0119,.00622,.00388,.00179,.00109,5.81E-4,3.86E-4,2.87E-4,2.27E-4,1.59E-4,1.23E-4,7.60E-5,5.52E-5,3.55E-5,2.62E-5,2.08E-5,1.72E-5,1.28E-5,1.02E-5/
DATA XPEN1/213.2,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEN2/1.29E5,1.23E5,1.06E5,8.97E4,6.97E4,5.24E4,4.41E4,3.89E4,3.41E4,3.08E4,1.60E4,9.50E3,4.27E3,2.31E3,1.39E3,905.,443.,248.,82.2,36.0,10.7,4.38,2.16,1.21,.477,.231,.0623,.0249,.00713,.00306,.00164,.00101,4.93E-4,2.94E-4,1.27E-4,7.75E-5,4.12E-5,2.74E-5,2.04E-5,1.61E-5,1.13E-5,8.69E-6,5.39E-6,3.92E-6,2.52E-6,1.86E-6,1.47E-6,1.22E-6,9.10E-7,7.22E-7/
DATA XPEN2/146.7,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEN3/3.85E5,3.75E5,3.37E5,2.86E5,2.21E5,1.61E5,1.16E5,9.58E4,8.36E4,7.23E4,6.46E4,3.21E4,1.85E4,8.03E3,4.23E3,2.50E3,1.60E3,766.,421.,134.,56.9,16.2,6.41,3.08,1.67,.633,.296,.0748,.0286,.00774,.00324,.00172,.00105,5.17E-4,3.12E-4,1.38E-4,8.42E-5,4.48E-5,2.98E-5,2.22E-5,1.75E-5,1.22E-5,9.45E-6,5.86E-6,4.26E-6,2.73E-6,2.02E-6,1.60E-6,1.33E-6,9.89E-7,7.84E-7/
DATA XPEN3/145.5,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEN4/5.08E5,4.60E5,5.00E6,8.00E6,9.60E6,8.60E6,4.60E6,9.20E5,2.94E5,1.02E5,2.48E5,3.12E5,3.00E5,2.14E5,1.43E5,1.12E5,9.32E4,7.69E4,6.60E4,2.56E4,1.21E4,3.81E3,1.58E3,769.,418.,154.,69.1,15.2,4.96,.981,.303,.121,.0570,.0174,.00696,.00135,4.38E-4,9.55E-5,3.45E-5,1.63E-5,9.14E-6,3.88E-6,2.11E-6,7.87E-7,4.80E-7,2.56E-7,1.70E-7,1.26E-7,9.97E-8,6.98E-8,5.39E-8,3.34E-8,2.43E-8,1.56E-8,1.15E-8,9.13E-9,7.56E-9,5.64E-9,4.47E-9/
DATA XPEN4/69.5,76.3,83.1,89.9,96.7,110.3,123.9,151.1,178.3,205.5,273.5,341.5,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEN5/7.62E5,6.90E5,7.50E6,1.20E7,1.44E7,1.29E7,6.90E7,1.38E6,4.40E5,1.53E5,3.72E5,4.67E5,4.54E5,3.19E5,2.11E5,1.64E5,1.36E5,1.12E5,9.63E4,3.68E4,1.72E4,5.38E3,2.21E3,1.07E3,577.,211.,93.6,20.2,6.51,1.26,.380,.149,.0692,.0206,.00810,.00153,4.90E-4,1.07E-4,3.94E-5,1.93E-5,1.12E-5,5.12E-6,2.94E-6,1.24E-6,7.57E-7,4.03E-7,2.68E-7,1.99E-7,1.57E-7,1.10E-7,8.49E-8,5.35E-8,3.83E-8,2.46E-8,1.81E-8,1.44E-8,1.19E-8,8.89E-9,7.05E-9/
DATA XPEN5/67.5,74.3,81.1,87.9,94.7,108.3,121.9,149.1,176.3,203.5,271.5,339.5,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E8,1.0E8/
DATA YPEO1/5.00E5,1.80E5,6.00E4,2.00E5,5.00E5,7.50E5,8.50E5,6.00E5,4.00E4,7.00E3,2.00E4,2.50E4,1.88E4,1.22E4,8.20E3,6.58E3,5.67E3,4.85E3,4.33E3,2.14E3,1.28E3,604.,349.,226.,157.,87.5,54.8,22.9,12.0,4.61,2.28,1.30,.813,.382,.210,.0695,.0315,.0105,.00490,.00279,.00179,9.33E-4,5.84E-4,2.69E-4,1.64E-4,8.74E-5,5.81E-5,4.32E-5,3.41E-5,2.38E-5,1.84E-5,1.14E-5,8.30E-6,5.33E-6,3.93E-6,3.12E-6,2.58E-6,1.93E-6,1.53E-6/
DATA XPEO1/23.3,30.0,40.0,50.0,70.0,80.0,90.0,100.0,130.0,160.0,190.,250.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEO2/2.20E7,1.20E7,2.5E6,6.5E5,4.0E5,2.2E5,3.3E5,6.0E5,5.5E5,6.0E4,2.5E4,2.71E4,1.87E4,1.30E4,9.15E3,6.54E3,5.37E3,4.69E3,4.07E3,3.63E3,1.82E3,1.07E3,475.,255.,154.,102.,49.8,28.0,9.26,4.06,1.21,.495,.245,.137,.054,.0262,.00704,.00282,8.06E-4,3.47E-4,1.86E-4,1.14E-4,5.57E-5,3.33E-5,1.44E-5,8.79E-6,4.68E-6,3.11E-6,2.31E-6,1.82E-6,1.28E-6,9.86E-7,6.11E-7,4.44E-7,2.85E-7,2.11E-7,1.67E-7,1.38E-7,1.03E-7,8.18E-8/
DATA XPEO2/13.43,20.0,30.0,40.0,50.0,60.0,80.0,90.0,100.,130.,150.,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
DATA YPEO3/4.40E7,2.40E7,5.0E6,1.3E6,8.0E5,4.4E5,6.6E5,1.2E6,1.1E6,1.2E5,5.0E4,5.42E4,3.74E4,2.60E4,1.83E4,1.33E4,1.07E4,9.38E3,8.14E3,7.26E3,3.64E3,2.14E3,950.,510.,308.,204.,99.6,56.0,18.5,8.12,2.42,.990,.490,.274,.108,.0524,.01408,.00564,1.62E-3,6.94E-4,3.72E-4,2.28E-4,1.12E-4,6.66E-5,2.88E-5,1.76E-5,9.35E-6,6.22E-6,4.63E-6,3.65E-6,2.55E-6,1.97E-6,1.22E-6,8.89E-7,5.71E-7,4.21E-7,3.34E-7,2.77E-7,2.06E-7,1.64E-7/
DATA XPEO3/12.129843,20.0,30.0,40.0,50.0,60.0,80.0,90.0,100.,130.,150.,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL DATA TABLES A7(1970)565
DATA XENE/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAY/1939.,1938.,1936.,1930.,1923.,1914.,1902.,1877.,1844.,1744.,1631.,1413.,1229.,1078.,952.3,755.3,613.6,403.8,288.3,164.5, 107.1,76.13,56.90,35.05,23.74,11.55,6.836,3.192,1.839,1.193, .8365,.4755,.3061,.2932,.1967,.1369,.07712,.07390,.03436,.01934,.01238,8.599D-3,6.318D-3,4.838D-3,3.823D-3,3.096D-3,1.292D-3, 7.268D-4,3.229D-4,1.817D-4,1.163D-4,8.073D-5,4.542D-5,2.906D-5/
DATA YCOM/.01126,.02527,.04472,.09970,.1751,.2695,.3812,.6491, .9629,1.858, 2.801,4.628,6.265,7.664,8.876,10.96,12.75,16.22,18.50,21.21,22.64,23.40,23.78,23.90,23.57,22.22,20.83,18.52,16.76,15.40,14.30,12.61,11.36,11.24,10.17,9.252,7.902,7.805,6.222,5.191,4.484,3.964,3.563,3.243,2.981,2.762,2.044,1.641,1.195,.9493, .7924,.6828,.5385,.4469/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAP/34*1.E-20,4.173D-2,.19300,.6478,.6918,1.628,2.496, 3.247,3.895,4.472,4.993,5.465,5.899,7.429,8.685,10.46,11.59,12.51,13.23,14.25,14.97/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFR/1.0,.99978,.99913,.99809,.99661,.99470,.9924,.9867,.9794,.9613, .9391,.9267,.8941,.8604,.8270,.7950,.7372,.6872,.6026,.5298,.4676,.4169,.3772,.3463,.3215,.2715,.2265,.1533,.1126,.09657,.08052,.07033,.04998,.03619,.02807,.02498,.01881,.01213,.006993,5.581D-4, 1.226D-4,5.913D-5,4.711D-8,1.29D-16,3.96D-25/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFC/1.9D-22,2.41D-4,9.63D-4,.002152,.003802,.005894,.008406,.01458,.02211,.04015,.06054,.07113,.09769,.1236,.1487,.1730,.2180,.2572,.3206,.3735,.4228,.4689,.5115,.5496,.5831,.6485,.6969,.7681,.8189,.8565,.8856,.9080,.9383,.9559,.9667,.9739,.9837,.9954,.9987,.99998,1.0,1.0,1.0,1.0,1.0/
# XENON ATOMIC NUMBER
IZ[1]=54
AMZ[1]=131.293
# CONVERT SHAKE OFF FROM % TO PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
4 AUG[1][I][J][K]=A[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
5 AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
12 R[I][J]=R[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
13 RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC DATA
DO 21 J=1,30
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1.E-24)
21 CONTINUE
DO 22 J=1,36
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*1.E-24)
22 CONTINUE
DO 23 J=1,37
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*1.E-24)
23 CONTINUE
DO 24 J=1,37
XPE[1][4][J]=math.log(XPEL3[J])
YPE[1][4][J]=math.log(YPEL3[J]*1.E-24)
24 CONTINUE
DO 25 J=1,41
XPE[1][5][J]=math.log(XPEM1[J])
YPE[1][5][J]=math.log(YPEM1[J]*1.E-24)
25 CONTINUE
DO 26 J=1,41
XPE[1][6][J]=math.log(XPEM2[J])
YPE[1][6][J]=math.log(YPEM2[J]*1.E-24)
26 CONTINUE
DO 27 J=1,42
XPE[1][7][J]=math.log(XPEM3[J])
YPE[1][7][J]=math.log(YPEM3[J]*1.E-24)
27 CONTINUE
DO 28 J=1,45
XPE[1][8][J]=math.log(XPEM4[J])
YPE[1][8][J]=math.log(YPEM4[J]*1.E-24)
28 CONTINUE
DO 29 J=1,45
XPE[1][9][J]=math.log(XPEM5[J])
YPE[1][9][J]=math.log(YPEM5[J]*1.E-24)
29 CONTINUE
DO 30 J=1,49
XPE(1,10,J)=math.log(XPEN1[J])
YPE(1,10,J)=math.log(YPEN1[J]*1.E-24)
30 CONTINUE
DO 31 J=1,50
XPE(1,11,J)=math.log(XPEN2[J])
YPE(1,11,J)=math.log(YPEN2[J]*1.E-24)
31 CONTINUE
DO 32 J=1,51
XPE(1,12,J)=math.log(XPEN3[J])
YPE(1,12,J)=math.log(YPEN3[J]*1.E-24)
32 CONTINUE
DO 33 J=1,59
XPE(1,13,J)=math.log(XPEN4[J])
YPE(1,13,J)=math.log(YPEN4[J]*1.E-24)
33 CONTINUE
DO 34 J=1,59
XPE(1,14,J)=math.log(XPEN5[J])
YPE(1,14,J)=math.log(YPEN5[J]*1.E-24)
34 CONTINUE
DO 35 J=1,59
XPE(1,15,J)=math.log(XPEO1[J])
YPE(1,15,J)=math.log(YPEO1[J]*1.E-24)
35 CONTINUE
DO 36 J=1,60
XPE(1,16,J)=math.log(XPEO2[J])
YPE(1,16,J)=math.log(YPEO2[J]*1.E-24)
36 CONTINUE
DO 37 J=1,60
XPE(1,17,J)=math.log(XPEO3[J])
YPE(1,17,J)=math.log(YPEO3[J]*1.E-24)
37 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 38 J=1,54
XCP[1][J]=math.log(XENE[J])
YRY[1][J]=math.log(YRAY[J]*1.E-24)
YCP[1][J]=math.log(YCOM[J]*1.E-24)
YPP[1][J]=math.log(YPAP[J]*1.E-24)
38 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 39 J=1,45
FFAR[1][J]=FFR[J]
FFAC[1][J]=FFC[J]
39 CONTINUE
# end
def CGAS8(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION INIOCH(17),PRBSHH(17,17),ESHH(17),RH(17,17),AH(17,17,17),PRBSHBTH(17)
DIMENSION XPEK(49),YPEK(49),XPEL1(54),YPEL1(54),XPEL2(54),YPEL2(54),XCOMC(54),YRAYC(54),YCOMC(54),YPAPC(54),FFRC(45),FFCC(45)
DIMENSION XPEKH(54),YPEKH(54),XCOMH(54),YRAYH(54),YCOMH(54),YPAPH(54),FFRH(45),FFCH(45)
#
#
# CH4 DATA FOR CASCADE CALCULATIONS
#
# CARBON DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/10.00,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/0.20,3.00,9.00,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.80,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,238*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/2.74,12.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/0.858/,A[1][2][3]/0.824/,A[1][3][3]/0.378/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/1.50E-14/,R(1,3)/3.45E-5/,R(1,4)/6.88E-5/
# L1 SHELL
DATA R(2,3)/1.20E-7/,R(2,4)/2.41E-7/
# L2 SHELL
DATA R(3,4)/1.55E-21/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEK/9.26E5,7.98E5,4.81E5,2.35E5,1.21E5,8.42E4,6.57E4,5.09E4,4.20E4,1.33E4,5.73E3,1.70E3,707.,354.,200.,80.4,39.3,10.6,4.12,1.08,.415,.197,.107,.0411,.0195,.00512,.00201,5.64E-4,2.41E-4,1.29E-4,8.05E-5,4.06E-5,2.52E-5,1.19E-5,7.51E-6,4.21E-6,2.90E-6,2.20E-6,1.77E-6,1.27E-6,9.93E-7,6.39E-7,4.71E-7,3.08E-7,2.29E-7,1.82E-7,1.51E-7,1.13E-7,9.01E-8/
DATA XPEK/285.0,300.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1/1.35E7,1.50E6,4.00E5,2.21E5,1.70E5,1.14E5,4.58E4,2.07E4,1.02E4,5.34E3,3.76E3,2.97E3,2.32E3,1.93E3,635.,280.,85.1,35.7,18.0,10.3,4.16,2.05,.554,.217,.0571,.0220,.0105,.00570,.00218,.00104, 2.72E-4,1.07E-4,3.00E-5,1.28E-5,6.88E-6,4.28E-6,2.16E-6,1.34E-6,6.37E-7,4.02E-7,2.26E-7,1.55E-7,1.18E-7,9.49E-8,6.82E-8,5.32E-8,3.42E-8,2.52E-8,1.65E-8,1.23E-8,9.75E-9,8.10E-9,6.05E-9,4.82E-9/
DATA XPEL1/18.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2/1.35E7,9.0E5,1.50E5,7.81E4,5.15E4,2.79E4,7.59E3,2.49E3,924.,383.,239.,173.,124.,94.6,20.7,6.75,1.36,.432,.176,.0841, .0259,.0103,.00189,5.64E-4,1.02E-4,3.06E-5,1.20E-5,5.63E-6,1.72E-6,6.96E-7,1.40E-7,4.69E-8,1.10E-8,4.26E-9,2.16E-9,1.29E-9,6.20E-10,3.76E-10,1.82E-10,1.15E-10,6.45E-11,4.44E-11,3.37E-11,2.71E-11,1.95E-11,1.52E-11,9.77E-12,7.20E-12,4.71E-12,3.50E-12,2.79E-12,2.31E-12,1.73E-12,1.38E-12/
DATA XPEL2/6.40,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
DATA XCOMC/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYC/23.94,23.90,24.85,23.72,23.53,23.31,23.03,22.37,21.52,19.12,16.59,12.22,9.179,7.170,5.819,4.181,3.232,1.952,1.292,.6711, .4079,.2734,.1956,.1139,.07418,.03360,.01903,8.504D-3,4.792D-3, 3.070D-3, 2.133D-3,1.200D-3,7.682D-4,7.355D-4,4.917D-4,3.415D-4,1.921D-4,1.839D-4,8.539D-5,4.803D-5,3.074D-5,2.135D-5,1.568D-5,1.201D-5,9.488D-6,7.685D-6,3.415D-6,1.921D-6,8.537D-7,4.802D-7,3.073D-7,2.134D-7,1.200D-7,7.682D-8/
DATA YCOMC/3.044D-3,6.469D-3,.01140,.02518,.04448,.06870,.09764, .1680,.2519,.5001, .7702,1.278,1.685,1.984,2.202,2.497,2.697,3.012,3.182,3.300,3.296,3.250,3.188,3.054,2.924,2.647,2.431,2.118,1.899,1.735,1.605,1.410,1.268,1.255,1.134,1.031,.8795,.8687,.6920,.5772,.4985,.4406,.3960,.3604,.3313,.3069,.2272,.1823,.1327,.1055, .08805,.07586,.05983,.04966/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPC/34*1.E-20,2.870D-4,1.594D-3,6.356D-3,6.852D-3,.01844, .03054, .04163,.05178,.06095,.06928,.07690,.08388,.1108,.1310,.1597,.1802,.1958,.2080,.2263,.2401/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRC/1.0,.99957,.99830,.9962,.9932,.9895,.9848,.9735,.9590,.9228,.8783,.8538,.7902,.7218,.6562,.5962,.4935,.4170,.3252,.2810,.2558,.2375,.2202,.2027,.1853,.1441,.1094,.0620,.03577,.02147,.01341,.008705,.004055,.002108,.001191,7.198D-4,3.06D-4,6.295D-5, 2.027D-5,5.398D-7,8.455D-8,3.52D-8,5.993D-12,2.767D-21,2.80D-30/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCC/1.7D-21,6.317D-4,.002165,.004922,.008607,.01341,.01928,.03358,.05143,.0948,.1459,.1732,.2413,.3110,.3755,.4340,.5330,.6072,.6973,.7463,.7817,.8130,.8418,.8680,.8913,.9358,.9635,.9883,.9962,.9987,.99947,.99977,.99995,.99998,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# CARBON ATOMIC NUMBER
IZ[1]=6
AMZ[1]=12.0107
#
# ATOMIC HYDROGEN DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCH/1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESHH/17*0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTH/17*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKH/6.41E6,2.18E6,1.93E4,8.10E3,5.31E3,2.86E3,765.,251.,96.6,41.9,26.7,19.7,14.4,11.4,2.93,1.11,.281,.105,.0491,.0263,.00982,.00456,.00113,4.18E-4,1.03E-4,3.82E-5,1.77E-5,9.46E-6,3.52E-6,1.64E-6,4.18E-7,1.61E-7,4.41E-8,1.86E-8,9.93E-9,6.16E-9,3.12E-9,1.96E-9,9.73E-10,6.20E-10,3.52E-10,2.44E-10,1.87E-10,1.51E-10,1.09E-10,8.50E-11,5.49E-11,4.06E-11,2.66E-11,1.98E-11,1.58E-11,1.31E-11,9.79E-12,7.81E-12/
DATA XPEKH/13.598,20.,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XCOMH/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YCOMH/9.552D-4,2.144D-3,3.802D-3,8.494D-3,1.496D-2,2.310D-2,3.279D-2,5.629D-2,8.424D-2,0.1650,.2478,.3822,.4675,.5187,.5503,.5840,.5993,.6095,.6068,.5924,.5759,.5597,.5444,.5166,.4923,.4435,.4064,.3535,.3168,.2893,.2676,.2351,.2114,.2092,.1890,.1718,.1466,.1448,.1153,.0962,.08308,.07343,.0660,.06007,.05522,.05116,.03786,.03039,.02212,.01758,.01467,.01264,.009972,.008276/
DATA YRAYH/.6650,.6635,.6617,.6569,.6503,.6421,.6323,.6087,.5806,.4984,.4142,.2764,.1881,.1341,.09987,.06126,.04121,.01943,.01119,.005062,.002866,.001840,.001280,7.211D-4,4.619D-4,2.054D-4,1.156D-4,5.138D-5,2.890D-5,1.850D-5,1.285D-5,7.226D-6,4.625D-6,4.428D-6,2.960D-6,2.056D-6,1.156D-6,1.107D-6,5.139D-7,2.891D-7,1.850D-7,1.285D-7,9.439D-8,7.227D-8,5.710D-8,4.625D-8,2.056D-8,1.156D-8,5.139D-9,2.890D-9,1.850D-9,1.284D-9,7.222D-10,4.620D-10/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPH/34*1.E-20,7.805D-6,4.385D-5,1.758D-4,1.895D-4,5.451D-4,9.849D-4,1.430D-3,1.859D-3,2.260D-3,2.634D-3,2.984D-3,3.308D-3,4.61D-3,5.61D-3,7.08D-3,8.13D-3,8.98D-3,9.65D-3,1.074D-2,1.161D-2/
# RAYLEIGH FORM FACTOR Hubbel
DATA FFRH/1.0,.9994,.9978,.9950,.9912,.9863,.9804,.9655,.9469,.8999,.8424,.8108,.7271,.6413,.5581,.4808,.3497,.2513,.1304,.07059,.04032,.02429,.01533,.01009,.006881,.002995,.001494,4.890D-4,2.035D-4,9.902D-5,5.373D-5,3.160D-5,1.300D-5,6.282D-6,3.395D-6,1.992D-6,8.168D-7,1.615D-7,5.112D-8,1.309D-9,1.998D-10,8.182D-11,8.182D-15,8.182D-27,8.182D-39/
# COMPTON FORM FACTOR Hubbel
DATA FFCH/1.E-20,.001105,.004410,.009888,.01749,.02717,.03883,.06773,.1033,.1902,.2904,.3426,.4713,.5887,.6885,.7689,.8777,.9369,.9830,.9950,.9984,.9994,.9998,.9999,.99995,.99999,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/
# HYDROGEN ATOMIC NUMBER
IZ[2]=1
AMZ[2]=4.03176
#
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
PRSHBT[2][I]=PRBSHBTH[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
PRBSHH[I][J]=PRBSHH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0.0
PRSUMH=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
PRSH[2][I][J]=PRBSHH[J][I]
# PRSUMH=PRSUMH+PRSH[2][I][J]
# PRSUM=PRSUM+PRSH[1][I][J]
# WRITE(6,888) I,PRSUM,PRSUMH
# 888 print(' I=',I3,' PRSUM=','%.3f' %,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
ESH[2][I]=ESHH[I]
INIOCC[1][I]=INIOC[I]
INIOCC[2][I]=INIOCH[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.0272105
4 AUG[2][I][J][K]=AH[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.00272105
5 AUG[2][I][J][K]=AH[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
R[I][J]=R[I][J]*6.582119D-16
12 RH[I][J]=RH[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
RAD[1][I][J]=R[I][J]
13 RAD[2][I][J]=RH[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD CARBON PHOTOELECTRIC AND COMPTON DATA
DO 21 J=1,49
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1.E-24)
21 CONTINUE
DO 22 J=1,54
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*1.E-24)
22 CONTINUE
DO 23 J=1,54
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*1.E-24)
23 CONTINUE
# LOAD HYDROGEN PHOTOELECTRIC AND COMPTON DATA
DO 24 J=1,54
XPE[2][1][J]=math.log(XPEKH[J])
# ALLOW FOR 4 HYDROGEN ATOMS
YPE[2][1][J]=math.log(YPEKH[J]*4.0*1.E-24)
24 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 25 J=1,54
XCP[1][J]=math.log(XCOMC[J])
XCP[2][J]=math.log(XCOMH[J])
YRY[1][J]=math.log(YRAYC[J]*1.E-24)
YRY[2][J]=math.log(YRAYH[J]*4.0*1.E-24)
YCP[1][J]=math.log(YCOMC[J]*1.E-24)
YCP[2][J]=math.log(YCOMH[J]*4.0*1.E-24)
YPP[1][J]=math.log(YPAPC[J]*1.E-24)
YPP[2][J]=math.log(YPAPH[J]*4.0*1.E-24)
25 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 29 J=1,45
FFAR[1][J]=FFRC[J]
FFAR[2][J]=FFRH[J]
FFAC[1][J]=FFCC[J]
FFAC[2][J]=FFCH[J]
29 CONTINUE
return
# end
def CGAS9(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION INIOCH(17),PRBSHH(17,17),ESHH(17),RH(17,17),AH(17,17,17),PRBSHBTH(17)
DIMENSION XPEK(49),YPEK(49),XPEL1(54),YPEL1(54),XPEL2(54),YPEL2(54),XCOMC(54),YRAYC(54),YCOMC(54),YPAPC(54),FFRC(45),FFCC(45)
DIMENSION XPEKH(54),YPEKH(54),XCOMH(54),YRAYH(54),YCOMH(54),YPAPH(54),FFRH(45),FFCH(45)
#
#
# C2H6 DATA FOR CASCADE CALCULATION
#
# CARBON DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/10.00,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/0.20,3.00,9.00,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.80,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,238*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/2.74,12.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/0.858/,A[1][2][3]/0.824/,A[1][3][3]/0.378/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/1.50E-14/,R(1,3)/3.45E-5/,R(1,4)/6.88E-5/
# L1 SHELL
DATA R(2,3)/1.20E-7/,R(2,4)/2.41E-7/
# L2 SHELL
DATA R(3,4)/1.55E-21/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEK/9.26E5,7.98E5,4.81E5,2.35E5,1.21E5,8.42E4,6.57E4,5.09E4,4.20E4,1.33E4,5.73E3,1.70E3,707.,354.,200.,80.4,39.3,10.6,4.12,1.08,.415,.197,.107,.0411,.0195,.00512,.00201,5.64E-4,2.41E-4,1.29E-4,8.05E-5,4.06E-5,2.52E-5,1.19E-5,7.51E-6,4.21E-6,2.90E-6,2.20E-6,1.77E-6,1.27E-6,9.93E-7,6.39E-7,4.71E-7,3.08E-7,2.29E-7,1.82E-7,1.51E-7,1.13E-7,9.01E-8/
DATA XPEK/285.0,300.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1/1.35E7,1.50E6,4.00E5,2.21E5,1.70E5,1.14E5,4.58E4,2.07E4,1.02E4,5.34E3,3.76E3,2.97E3,2.32E3,1.93E3,635.,280.,85.1,35.7,18.0,10.3,4.16,2.05,.554,.217,.0571,.0220,.0105,.00570,.00218,.00104, 2.72E-4,1.07E-4,3.00E-5,1.28E-5,6.88E-6,4.28E-6,2.16E-6,1.34E-6,6.37E-7,4.02E-7,2.26E-7,1.55E-7,1.18E-7,9.49E-8,6.82E-8,5.32E-8,3.42E-8,2.52E-8,1.65E-8,1.23E-8,9.75E-9,8.10E-9,6.05E-9,4.82E-9/
DATA XPEL1/18.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2/1.35E7,9.0E5,1.50E5,7.81E4,5.15E4,2.79E4,7.59E3,2.49E3,924.,383.,239.,173.,124.,94.6,20.7,6.75,1.36,.432,.176,.0841, .0259,.0103,.00189,5.64E-4,1.02E-4,3.06E-5,1.20E-5,5.63E-6,1.72E-6,6.96E-7,1.40E-7,4.69E-8,1.10E-8,4.26E-9,2.16E-9,1.29E-9,6.20E-10,3.76E-10,1.82E-10,1.15E-10,6.45E-11,4.44E-11,3.37E-11,2.71E-11,1.95E-11,1.52E-11,9.77E-12,7.20E-12,4.71E-12,3.50E-12,2.79E-12,2.31E-12,1.73E-12,1.38E-12/
DATA XPEL2/6.40,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
DATA XCOMC/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYC/23.94,23.90,24.85,23.72,23.53,23.31,23.03,22.37,21.52,19.12,16.59,12.22,9.179,7.170,5.819,4.181,3.232,1.952,1.292,.6711, .4079,.2734,.1956,.1139,.07418,.03360,.01903,8.504D-3,4.792D-3, 3.070D-3, 2.133D-3,1.200D-3,7.682D-4,7.355D-4,4.917D-4,3.415D-4,1.921D-4,1.839D-4,8.539D-5,4.803D-5,3.074D-5,2.135D-5,1.568D-5,1.201D-5,9.488D-6,7.685D-6,3.415D-6,1.921D-6,8.537D-7,4.802D-7,3.073D-7,2.134D-7,1.200D-7,7.682D-8/
DATA YCOMC/3.044D-3,6.469D-3,.01140,.02518,.04448,.06870,.09764, .1680,.2519,.5001, .7702,1.278,1.685,1.984,2.202,2.497,2.697,3.012,3.182,3.300,3.296,3.250,3.188,3.054,2.924,2.647,2.431,2.118,1.899,1.735,1.605,1.410,1.268,1.255,1.134,1.031,.8795,.8687,.6920,.5772,.4985,.4406,.3960,.3604,.3313,.3069,.2272,.1823,.1327,.1055, .08805,.07586,.05983,.04966/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPC/34*1.E-20,2.870D-4,1.594D-3,6.356D-3,6.852D-3,.01844, .03054, .04163,.05178,.06095,.06928,.07690,.08388,.1108,.1310,.1597,.1802,.1958,.2080,.2263,.2401/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRC/1.0,.99957,.99830,.9962,.9932,.9895,.9848,.9735,.9590,.9228,.8783,.8538,.7902,.7218,.6562,.5962,.4935,.4170,.3252,.2810,.2558,.2375,.2202,.2027,.1853,.1441,.1094,.0620,.03577,.02147,.01341,.008705,.004055,.002108,.001191,7.198D-4,3.06D-4,6.295D-5, 2.027D-5,5.398D-7,8.455D-8,3.52D-8,5.993D-12,2.767D-21,2.80D-30/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCC/1.7D-21,6.317D-4,.002165,.004922,.008607,.01341,.01928,.03358,.05143,.0948,.1459,.1732,.2413,.3110,.3755,.4340,.5330,.6072,.6973,.7463,.7817,.8130,.8418,.8680,.8913,.9358,.9635,.9883,.9962,.9987,.99947,.99977,.99995,.99998,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# CARBON ATOMIC NUMBER
IZ[1]=6
AMZ[1]=24.0214
#
# ATOMIC HYDROGEN DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCH/1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESHH/17*0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTH/17*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKH/6.41E6,2.18E6,1.93E4,8.10E3,5.31E3,2.86E3,765.,251.,96.6,41.9,26.7,19.7,14.4,11.4,2.93,1.11,.281,.105,.0491,.0263,.00982,.00456,.00113,4.18E-4,1.03E-4,3.82E-5,1.77E-5,9.46E-6,3.52E-6,1.64E-6,4.18E-7,1.61E-7,4.41E-8,1.86E-8,9.93E-9,6.16E-9,3.12E-9,1.96E-9,9.73E-10,6.20E-10,3.52E-10,2.44E-10,1.87E-10,1.51E-10,1.09E-10,8.50E-11,5.49E-11,4.06E-11,2.66E-11,1.98E-11,1.58E-11,1.31E-11,9.79E-12,7.81E-12/
DATA XPEKH/13.598,20.,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XCOMH/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YCOMH/9.552D-4,2.144D-3,3.802D-3,8.494D-3,1.496D-2,2.310D-2,3.279D-2,5.629D-2,8.424D-2,0.1650,.2478,.3822,.4675,.5187,.5503,.5840,.5993,.6095,.6068,.5924,.5759,.5597,.5444,.5166,.4923,.4435,.4064,.3535,.3168,.2893,.2676,.2351,.2114,.2092,.1890,.1718,.1466,.1448,.1153,.0962,.08308,.07343,.0660,.06007,.05522,.05116,.03786,.03039,.02212,.01758,.01467,.01264,.009972,.008276/
DATA YRAYH/.6650,.6635,.6617,.6569,.6503,.6421,.6323,.6087,.5806,.4984,.4142,.2764,.1881,.1341,.09987,.06126,.04121,.01943,.01119,.005062,.002866,.001840,.001280,7.211D-4,4.619D-4,2.054D-4,1.156D-4,5.138D-5,2.890D-5,1.850D-5,1.285D-5,7.226D-6,4.625D-6,4.428D-6,2.960D-6,2.056D-6,1.156D-6,1.107D-6,5.139D-7,2.891D-7,1.850D-7,1.285D-7,9.439D-8,7.227D-8,5.710D-8,4.625D-8,2.056D-8,1.156D-8,5.139D-9,2.890D-9,1.850D-9,1.284D-9,7.222D-10,4.620D-10/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPH/34*1.E-20,7.805D-6,4.385D-5,1.758D-4,1.895D-4,5.451D-4,9.849D-4,1.430D-3,1.859D-3,2.260D-3,2.634D-3,2.984D-3,3.308D-3,4.61D-3,5.61D-3,7.08D-3,8.13D-3,8.98D-3,9.65D-3,1.074D-2,1.161D-2/
# RAYLEIGH FORM FACTOR Hubbel
DATA FFRH/1.0,.9994,.9978,.9950,.9912,.9863,.9804,.9655,.9469,.8999,.8424,.8108,.7271,.6413,.5581,.4808,.3497,.2513,.1304,.07059,.04032,.02429,.01533,.01009,.006881,.002995,.001494,4.890D-4,2.035D-4,9.902D-5,5.373D-5,3.160D-5,1.300D-5,6.282D-6,3.395D-6,1.992D-6,8.168D-7,1.615D-7,5.112D-8,1.309D-9,1.998D-10,8.182D-11,8.182D-15,8.182D-27,8.182D-39/
# COMPTON FORM FACTOR Hubbel
DATA FFCH/1.E-20,.001105,.004410,.009888,.01749,.02717,.03883,.06773,.1033,.1902,.2904,.3426,.4713,.5887,.6885,.7689,.8777,.9369,.9830,.9950,.9984,.9994,.9998,.9999,.99995,.99999,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/
# HYDROGEN ATOMIC NUMBER
IZ[2]=1
AMZ[2]=6.04764
#
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
PRSHBT[2][I]=PRBSHBTH[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
PRBSHH[I][J]=PRBSHH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0.0
PRSUMH=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
PRSH[2][I][J]=PRBSHH[J][I]
# PRSUMH=PRSUMH+PRSH[2][I][J]
# PRSUM=PRSUM+PRSH[1][I][J]
# WRITE(6,888) I,PRSUM,PRSUMH
# 888 print(' I=',I3,' PRSUM=','%.3f' %,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
ESH[2][I]=ESHH[I]
INIOCC[1][I]=INIOC[I]
INIOCC[2][I]=INIOCH[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.0272105
4 AUG[2][I][J][K]=AH[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.00272105
5 AUG[2][I][J][K]=AH[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
R[I][J]=R[I][J]*6.582119D-16
12 RH[I][J]=RH[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
RAD[1][I][J]=R[I][J]
13 RAD[2][I][J]=RH[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD CARBON PHOTOELECTRIC AND COMPTON DATA
# ALLOW FOR 2 CARBON ATOMS
DO 21 J=1,49
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*2.0*1.E-24)
21 CONTINUE
DO 22 J=1,54
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*2.0*1.E-24)
22 CONTINUE
DO 23 J=1,54
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*2.0*1.E-24)
23 CONTINUE
# LOAD HYDROGEN PHOTOELECTRIC AND COMPTON DATA
DO 24 J=1,54
XPE[2][1][J]=math.log(XPEKH[J])
# ALLOW FOR 6 HYDROGEN ATOMS
YPE[2][1][J]=math.log(YPEKH[J]*6.0*1.E-24)
24 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 25 J=1,54
XCP[1][J]=math.log(XCOMC[J])
XCP[2][J]=math.log(XCOMH[J])
YRY[1][J]=math.log(YRAYC[J]*2.0*1.E-24)
YRY[2][J]=math.log(YRAYH[J]*6.0*1.E-24)
YCP[1][J]=math.log(YCOMC[J]*2.0*1.E-24)
YCP[2][J]=math.log(YCOMH[J]*6.0*1.E-24)
YPP[1][J]=math.log(YPAPC[J]*2.0*1.E-24)
YPP[2][J]=math.log(YPAPH[J]*6.0*1.E-24)
25 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 29 J=1,45
FFAR[1][J]=FFRC[J]
FFAR[2][J]=FFRH[J]
FFAC[1][J]=FFCC[J]
FFAC[2][J]=FFCH[J]
29 CONTINUE
return
# end
def CGAS10(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION INIOCH(17),PRBSHH(17,17),ESHH(17),RH(17,17),AH(17,17,17),PRBSHBTH(17)
DIMENSION XPEK(49),YPEK(49),XPEL1(54),YPEL1(54),XPEL2(54),YPEL2(54),XCOMC(54),YRAYC(54),YCOMC(54),YPAPC(54),FFRC(45),FFCC(45)
DIMENSION XPEKH(54),YPEKH(54),XCOMH(54),YRAYH(54),YCOMH(54),YPAPH(54),FFRH(45),FFCH(45)
#
#
# C3H8 DATA FOR CASCADE CALCULATIONS
#
# CARBON DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/10.00,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/0.20,3.00,9.00,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.80,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,238*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/2.74,12.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/0.858/,A[1][2][3]/0.824/,A[1][3][3]/0.378/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/1.50E-14/,R(1,3)/3.45E-5/,R(1,4)/6.88E-5/
# L1 SHELL
DATA R(2,3)/1.20E-7/,R(2,4)/2.41E-7/
# L2 SHELL
DATA R(3,4)/1.55E-21/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEK/9.26E5,7.98E5,4.81E5,2.35E5,1.21E5,8.42E4,6.57E4,5.09E4,4.20E4,1.33E4,5.73E3,1.70E3,707.,354.,200.,80.4,39.3,10.6,4.12,1.08,.415,.197,.107,.0411,.0195,.00512,.00201,5.64E-4,2.41E-4,1.29E-4,8.05E-5,4.06E-5,2.52E-5,1.19E-5,7.51E-6,4.21E-6,2.90E-6,2.20E-6,1.77E-6,1.27E-6,9.93E-7,6.39E-7,4.71E-7,3.08E-7,2.29E-7,1.82E-7,1.51E-7,1.13E-7,9.01E-8/
DATA XPEK/285.0,300.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1/1.35E7,1.50E6,4.00E5,2.21E5,1.70E5,1.14E5,4.58E4,2.07E4,1.02E4,5.34E3,3.76E3,2.97E3,2.32E3,1.93E3,635.,280.,85.1,35.7,18.0,10.3,4.16,2.05,.554,.217,.0571,.0220,.0105,.00570,.00218,.00104, 2.72E-4,1.07E-4,3.00E-5,1.28E-5,6.88E-6,4.28E-6,2.16E-6,1.34E-6,6.37E-7,4.02E-7,2.26E-7,1.55E-7,1.18E-7,9.49E-8,6.82E-8,5.32E-8,3.42E-8,2.52E-8,1.65E-8,1.23E-8,9.75E-9,8.10E-9,6.05E-9,4.82E-9/
DATA XPEL1/18.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2/1.35E7,9.0E5,1.50E5,7.81E4,5.15E4,2.79E4,7.59E3,2.49E3,924.,383.,239.,173.,124.,94.6,20.7,6.75,1.36,.432,.176,.0841, .0259,.0103,.00189,5.64E-4,1.02E-4,3.06E-5,1.20E-5,5.63E-6,1.72E-6,6.96E-7,1.40E-7,4.69E-8,1.10E-8,4.26E-9,2.16E-9,1.29E-9,6.20E-10,3.76E-10,1.82E-10,1.15E-10,6.45E-11,4.44E-11,3.37E-11,2.71E-11,1.95E-11,1.52E-11,9.77E-12,7.20E-12,4.71E-12,3.50E-12,2.79E-12,2.31E-12,1.73E-12,1.38E-12/
DATA XPEL2/6.40,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
DATA XCOMC/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYC/23.94,23.90,24.85,23.72,23.53,23.31,23.03,22.37,21.52,19.12,16.59,12.22,9.179,7.170,5.819,4.181,3.232,1.952,1.292,.6711, .4079,.2734,.1956,.1139,.07418,.03360,.01903,8.504D-3,4.792D-3, 3.070D-3, 2.133D-3,1.200D-3,7.682D-4,7.355D-4,4.917D-4,3.415D-4,1.921D-4,1.839D-4,8.539D-5,4.803D-5,3.074D-5,2.135D-5,1.568D-5,1.201D-5,9.488D-6,7.685D-6,3.415D-6,1.921D-6,8.537D-7,4.802D-7,3.073D-7,2.134D-7,1.200D-7,7.682D-8/
DATA YCOMC/3.044D-3,6.469D-3,.01140,.02518,.04448,.06870,.09764, .1680,.2519,.5001, .7702,1.278,1.685,1.984,2.202,2.497,2.697,3.012,3.182,3.300,3.296,3.250,3.188,3.054,2.924,2.647,2.431,2.118,1.899,1.735,1.605,1.410,1.268,1.255,1.134,1.031,.8795,.8687,.6920,.5772,.4985,.4406,.3960,.3604,.3313,.3069,.2272,.1823,.1327,.1055, .08805,.07586,.05983,.04966/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPC/34*1.E-20,2.870D-4,1.594D-3,6.356D-3,6.852D-3,.01844, .03054, .04163,.05178,.06095,.06928,.07690,.08388,.1108,.1310,.1597,.1802,.1958,.2080,.2263,.2401/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRC/1.0,.99957,.99830,.9962,.9932,.9895,.9848,.9735,.9590,.9228,.8783,.8538,.7902,.7218,.6562,.5962,.4935,.4170,.3252,.2810,.2558,.2375,.2202,.2027,.1853,.1441,.1094,.0620,.03577,.02147,.01341,.008705,.004055,.002108,.001191,7.198D-4,3.06D-4,6.295D-5, 2.027D-5,5.398D-7,8.455D-8,3.52D-8,5.993D-12,2.767D-21,2.80D-30/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCC/1.7D-21,6.317D-4,.002165,.004922,.008607,.01341,.01928,.03358,.05143,.0948,.1459,.1732,.2413,.3110,.3755,.4340,.5330,.6072,.6973,.7463,.7817,.8130,.8418,.8680,.8913,.9358,.9635,.9883,.9962,.9987,.99947,.99977,.99995,.99998,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# CARBON ATOMIC NUMBER
IZ[1]=6
AMZ[1]=36.0321
#
# ATOMIC HYDROGEN DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCH/1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESHH/17*0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTH/17*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKH/6.41E6,2.18E6,1.93E4,8.10E3,5.31E3,2.86E3,765.,251.,96.6,41.9,26.7,19.7,14.4,11.4,2.93,1.11,.281,.105,.0491,.0263,.00982,.00456,.00113,4.18E-4,1.03E-4,3.82E-5,1.77E-5,9.46E-6,3.52E-6,1.64E-6,4.18E-7,1.61E-7,4.41E-8,1.86E-8,9.93E-9,6.16E-9,3.12E-9,1.96E-9,9.73E-10,6.20E-10,3.52E-10,2.44E-10,1.87E-10,1.51E-10,1.09E-10,8.50E-11,5.49E-11,4.06E-11,2.66E-11,1.98E-11,1.58E-11,1.31E-11,9.79E-12,7.81E-12/
DATA XPEKH/13.598,20.,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XCOMH/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YCOMH/9.552D-4,2.144D-3,3.802D-3,8.494D-3,1.496D-2,2.310D-2,3.279D-2,5.629D-2,8.424D-2,0.1650,.2478,.3822,.4675,.5187,.5503,.5840,.5993,.6095,.6068,.5924,.5759,.5597,.5444,.5166,.4923,.4435,.4064,.3535,.3168,.2893,.2676,.2351,.2114,.2092,.1890,.1718,.1466,.1448,.1153,.0962,.08308,.07343,.0660,.06007,.05522,.05116,.03786,.03039,.02212,.01758,.01467,.01264,.009972,.008276/
DATA YRAYH/.6650,.6635,.6617,.6569,.6503,.6421,.6323,.6087,.5806,.4984,.4142,.2764,.1881,.1341,.09987,.06126,.04121,.01943,.01119,.005062,.002866,.001840,.001280,7.211D-4,4.619D-4,2.054D-4,1.156D-4,5.138D-5,2.890D-5,1.850D-5,1.285D-5,7.226D-6,4.625D-6,4.428D-6,2.960D-6,2.056D-6,1.156D-6,1.107D-6,5.139D-7,2.891D-7,1.850D-7,1.285D-7,9.439D-8,7.227D-8,5.710D-8,4.625D-8,2.056D-8,1.156D-8,5.139D-9,2.890D-9,1.850D-9,1.284D-9,7.222D-10,4.620D-10/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPH/34*1.E-20,7.805D-6,4.385D-5,1.758D-4,1.895D-4,5.451D-4,9.849D-4,1.430D-3,1.859D-3,2.260D-3,2.634D-3,2.984D-3,3.308D-3,4.61D-3,5.61D-3,7.08D-3,8.13D-3,8.98D-3,9.65D-3,1.074D-2,1.161D-2/
# RAYLEIGH FORM FACTOR Hubbel
DATA FFRH/1.0,.9994,.9978,.9950,.9912,.9863,.9804,.9655,.9469,.8999,.8424,.8108,.7271,.6413,.5581,.4808,.3497,.2513,.1304,.07059,.04032,.02429,.01533,.01009,.006881,.002995,.001494,4.890D-4,2.035D-4,9.902D-5,5.373D-5,3.160D-5,1.300D-5,6.282D-6,3.395D-6,1.992D-6,8.168D-7,1.615D-7,5.112D-8,1.309D-9,1.998D-10,8.182D-11,8.182D-15,8.182D-27,8.182D-39/
# COMPTON FORM FACTOR Hubbel
DATA FFCH/1.E-20,.001105,.004410,.009888,.01749,.02717,.03883,.06773,.1033,.1902,.2904,.3426,.4713,.5887,.6885,.7689,.8777,.9369,.9830,.9950,.9984,.9994,.9998,.9999,.99995,.99999,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/
# HYDROGEN ATOMIC NUMBER
IZ[2]=1
AMZ[2]=8.06352
#
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
PRSHBT[2][I]=PRBSHBTH[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
PRBSHH[I][J]=PRBSHH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0.0
PRSUMH=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
PRSH[2][I][J]=PRBSHH[J][I]
# PRSUMH=PRSUMH+PRSH[2][I][J]
# PRSUM=PRSUM+PRSH[1][I][J]
# WRITE(6,888) I,PRSUM,PRSUMH
# 888 print(' I=',I3,' PRSUM=','%.3f' %,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
ESH[2][I]=ESHH[I]
INIOCC[1][I]=INIOC[I]
INIOCC[2][I]=INIOCH[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.0272105
4 AUG[2][I][J][K]=AH[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.00272105
5 AUG[2][I][J][K]=AH[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
R[I][J]=R[I][J]*6.582119D-16
12 RH[I][J]=RH[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
RAD[1][I][J]=R[I][J]
13 RAD[2][I][J]=RH[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD CARBON PHOTOELECTRIC AND COMPTON DATA
DO 21 J=1,49
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*3.0*1.E-24)
21 CONTINUE
DO 22 J=1,54
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*3.0*1.E-24)
22 CONTINUE
DO 23 J=1,54
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*3.0*1.E-24)
23 CONTINUE
# LOAD HYDROGEN PHOTOELECTRIC AND COMPTON DATA
DO 24 J=1,54
XPE[2][1][J]=math.log(XPEKH[J])
# ALLOW FOR 4 HYDROGEN ATOMS
YPE[2][1][J]=math.log(YPEKH[J]*8.0*1.E-24)
24 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 25 J=1,54
XCP[1][J]=math.log(XCOMC[J])
XCP[2][J]=math.log(XCOMH[J])
YRY[1][J]=math.log(YRAYC[J]*3.0*1.E-24)
YRY[2][J]=math.log(YRAYH[J]*8.0*1.E-24)
YCP[1][J]=math.log(YCOMC[J]*3.0*1.E-24)
YCP[2][J]=math.log(YCOMH[J]*8.0*1.E-24)
YPP[1][J]=math.log(YPAPC[J]*3.0*1.E-24)
YPP[2][J]=math.log(YPAPH[J]*8.0*1.E-24)
25 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 29 J=1,45
FFAR[1][J]=FFRC[J]
FFAR[2][J]=FFRH[J]
FFAC[1][J]=FFCC[J]
FFAC[2][J]=FFCH[J]
29 CONTINUE
return
# end
def CGAS11(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION INIOCH(17),PRBSHH(17,17),ESHH(17),RH(17,17),AH(17,17,17),PRBSHBTH(17)
DIMENSION XPEK(49),YPEK(49),XPEL1(54),YPEL1(54),XPEL2(54),YPEL2(54),XCOMC(54),YRAYC(54),YCOMC(54),YPAPC(54),FFRC(45),FFCC(45)
DIMENSION XPEKH(54),YPEKH(54),XCOMH(54),YRAYH(54),YCOMH(54),YPAPH(54),FFRH(45),FFCH(45)
#
#
# C4H10 DATA FOR CASCADE CALCULATIONS
#
# CARBON DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/10.00,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/0.20,3.00,9.00,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.80,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,238*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/2.74,12.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/0.858/,A[1][2][3]/0.824/,A[1][3][3]/0.378/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/1.50E-14/,R(1,3)/3.45E-5/,R(1,4)/6.88E-5/
# L1 SHELL
DATA R(2,3)/1.20E-7/,R(2,4)/2.41E-7/
# L2 SHELL
DATA R(3,4)/1.55E-21/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEK/9.26E5,7.98E5,4.81E5,2.35E5,1.21E5,8.42E4,6.57E4,5.09E4,4.20E4,1.33E4,5.73E3,1.70E3,707.,354.,200.,80.4,39.3,10.6,4.12,1.08,.415,.197,.107,.0411,.0195,.00512,.00201,5.64E-4,2.41E-4,1.29E-4,8.05E-5,4.06E-5,2.52E-5,1.19E-5,7.51E-6,4.21E-6,2.90E-6,2.20E-6,1.77E-6,1.27E-6,9.93E-7,6.39E-7,4.71E-7,3.08E-7,2.29E-7,1.82E-7,1.51E-7,1.13E-7,9.01E-8/
DATA XPEK/285.0,300.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1/1.35E7,1.50E6,4.00E5,2.21E5,1.70E5,1.14E5,4.58E4,2.07E4,1.02E4,5.34E3,3.76E3,2.97E3,2.32E3,1.93E3,635.,280.,85.1,35.7,18.0,10.3,4.16,2.05,.554,.217,.0571,.0220,.0105,.00570,.00218,.00104, 2.72E-4,1.07E-4,3.00E-5,1.28E-5,6.88E-6,4.28E-6,2.16E-6,1.34E-6,6.37E-7,4.02E-7,2.26E-7,1.55E-7,1.18E-7,9.49E-8,6.82E-8,5.32E-8,3.42E-8,2.52E-8,1.65E-8,1.23E-8,9.75E-9,8.10E-9,6.05E-9,4.82E-9/
DATA XPEL1/18.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2/1.35E7,9.0E5,1.50E5,7.81E4,5.15E4,2.79E4,7.59E3,2.49E3,924.,383.,239.,173.,124.,94.6,20.7,6.75,1.36,.432,.176,.0841, .0259,.0103,.00189,5.64E-4,1.02E-4,3.06E-5,1.20E-5,5.63E-6,1.72E-6,6.96E-7,1.40E-7,4.69E-8,1.10E-8,4.26E-9,2.16E-9,1.29E-9,6.20E-10,3.76E-10,1.82E-10,1.15E-10,6.45E-11,4.44E-11,3.37E-11,2.71E-11,1.95E-11,1.52E-11,9.77E-12,7.20E-12,4.71E-12,3.50E-12,2.79E-12,2.31E-12,1.73E-12,1.38E-12/
DATA XPEL2/6.40,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL DATA TABLES A7(1970)565
DATA XCOMC/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYC/23.94,23.90,24.85,23.72,23.53,23.31,23.03,22.37,21.52,19.12,16.59,12.22,9.179,7.170,5.819,4.181,3.232,1.952,1.292,.6711, .4079,.2734,.1956,.1139,.07418,.03360,.01903,8.504D-3,4.792D-3, 3.070D-3, 2.133D-3,1.200D-3,7.682D-4,7.355D-4,4.917D-4,3.415D-4,1.921D-4,1.839D-4,8.539D-5,4.803D-5,3.074D-5,2.135D-5,1.568D-5,1.201D-5,9.488D-6,7.685D-6,3.415D-6,1.921D-6,8.537D-7,4.802D-7,3.073D-7,2.134D-7,1.200D-7,7.682D-8/
DATA YCOMC/3.044D-3,6.469D-3,.01140,.02518,.04448,.06870,.09764, .1680,.2519,.5001, .7702,1.278,1.685,1.984,2.202,2.497,2.697,3.012,3.182,3.300,3.296,3.250,3.188,3.054,2.924,2.647,2.431,2.118,1.899,1.735,1.605,1.410,1.268,1.255,1.134,1.031,.8795,.8687,.6920,.5772,.4985,.4406,.3960,.3604,.3313,.3069,.2272,.1823,.1327,.1055, .08805,.07586,.05983,.04966/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPC/34*1.E-20,2.870D-4,1.594D-3,6.356D-3,6.852D-3,.01844, .03054, .04163,.05178,.06095,.06928,.07690,.08388,.1108,.1310,.1597,.1802,.1958,.2080,.2263,.2401/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRC/1.0,.99957,.99830,.9962,.9932,.9895,.9848,.9735,.9590,.9228,.8783,.8538,.7902,.7218,.6562,.5962,.4935,.4170,.3252,.2810,.2558,.2375,.2202,.2027,.1853,.1441,.1094,.0620,.03577,.02147,.01341,.008705,.004055,.002108,.001191,7.198D-4,3.06D-4,6.295D-5, 2.027D-5,5.398D-7,8.455D-8,3.52D-8,5.993D-12,2.767D-21,2.80D-30/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCC/1.7D-21,6.317D-4,.002165,.004922,.008607,.01341,.01928,.03358,.05143,.0948,.1459,.1732,.2413,.3110,.3755,.4340,.5330,.6072,.6973,.7463,.7817,.8130,.8418,.8680,.8913,.9358,.9635,.9883,.9962,.9987,.99947,.99977,.99995,.99998,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# CARBON ATOMIC NUMBER
IZ[1]=6
AMZ[1]=48.0428
#
# ATOMIC HYDROGEN DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCH/1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESHH/17*0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTH/17*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKH/6.41E6,2.18E6,1.93E4,8.10E3,5.31E3,2.86E3,765.,251.,96.6,41.9,26.7,19.7,14.4,11.4,2.93,1.11,.281,.105,.0491,.0263,.00982,.00456,.00113,4.18E-4,1.03E-4,3.82E-5,1.77E-5,9.46E-6,3.52E-6,1.64E-6,4.18E-7,1.61E-7,4.41E-8,1.86E-8,9.93E-9,6.16E-9,3.12E-9,1.96E-9,9.73E-10,6.20E-10,3.52E-10,2.44E-10,1.87E-10,1.51E-10,1.09E-10,8.50E-11,5.49E-11,4.06E-11,2.66E-11,1.98E-11,1.58E-11,1.31E-11,9.79E-12,7.81E-12/
DATA XPEKH/13.598,20.,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
DATA XCOMH/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YCOMH/9.552D-4,2.144D-3,3.802D-3,8.494D-3,1.496D-2,2.310D-2,3.279D-2,5.629D-2,8.424D-2,0.1650,.2478,.3822,.4675,.5187,.5503,.5840,.5993,.6095,.6068,.5924,.5759,.5597,.5444,.5166,.4923,.4435,.4064,.3535,.3168,.2893,.2676,.2351,.2114,.2092,.1890,.1718,.1466,.1448,.1153,.0962,.08308,.07343,.0660,.06007,.05522,.05116,.03786,.03039,.02212,.01758,.01467,.01264,.009972,.008276/
DATA YRAYH/.6650,.6635,.6617,.6569,.6503,.6421,.6323,.6087,.5806,.4984,.4142,.2764,.1881,.1341,.09987,.06126,.04121,.01943,.01119,.005062,.002866,.001840,.001280,7.211D-4,4.619D-4,2.054D-4,1.156D-4,5.138D-5,2.890D-5,1.850D-5,1.285D-5,7.226D-6,4.625D-6,4.428D-6,2.960D-6,2.056D-6,1.156D-6,1.107D-6,5.139D-7,2.891D-7,1.850D-7,1.285D-7,9.439D-8,7.227D-8,5.710D-8,4.625D-8,2.056D-8,1.156D-8,5.139D-9,2.890D-9,1.850D-9,1.284D-9,7.222D-10,4.620D-10/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPH/34*1.E-20,7.805D-6,4.385D-5,1.758D-4,1.895D-4,5.451D-4,9.849D-4,1.430D-3,1.859D-3,2.260D-3,2.634D-3,2.984D-3,3.308D-3,4.61D-3,5.61D-3,7.08D-3,8.13D-3,8.98D-3,9.65D-3,1.074D-2,1.161D-2/
# RAYLEIGH FORM FACTOR Hubbel
DATA FFRH/1.0,.9994,.9978,.9950,.9912,.9863,.9804,.9655,.9469,.8999,.8424,.8108,.7271,.6413,.5581,.4808,.3497,.2513,.1304,.07059,.04032,.02429,.01533,.01009,.006881,.002995,.001494,4.890D-4,2.035D-4,9.902D-5,5.373D-5,3.160D-5,1.300D-5,6.282D-6,3.395D-6,1.992D-6,8.168D-7,1.615D-7,5.112D-8,1.309D-9,1.998D-10,8.182D-11,8.182D-15,8.182D-27,8.182D-39/
# COMPTON FORM FACTOR Hubbel
DATA FFCH/1.E-20,.001105,.004410,.009888,.01749,.02717,.03883,.06773,.1033,.1902,.2904,.3426,.4713,.5887,.6885,.7689,.8777,.9369,.9830,.9950,.9984,.9994,.9998,.9999,.99995,.99999,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/
# HYDROGEN ATOMIC NUMBER
IZ[2]=1
AMZ[2]=10.0794
#
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
PRSHBT[2][I]=PRBSHBTH[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
PRBSHH[I][J]=PRBSHH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0.0
PRSUMH=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
PRSH[2][I][J]=PRBSHH[J][I]
# PRSUMH=PRSUMH+PRSH[2][I][J]
# PRSUM=PRSUM+PRSH[1][I][J]
# WRITE(6,888) I,PRSUM,PRSUMH
# 888 print(' I=',I3,' PRSUM=','%.3f' %,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
ESH[2][I]=ESHH[I]
INIOCC[1][I]=INIOC[I]
INIOCC[2][I]=INIOCH[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.0272105
4 AUG[2][I][J][K]=AH[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.00272105
5 AUG[2][I][J][K]=AH[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
R[I][J]=R[I][J]*6.582119D-16
12 RH[I][J]=RH[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
RAD[1][I][J]=R[I][J]
13 RAD[2][I][J]=RH[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD CARBON PHOTOELECTRIC AND COMPTON DATA
# SCALE TO 4 ATOMS PER MOLECULE
DO 21 J=1,49
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*4.0*1.E-24)
21 CONTINUE
DO 22 J=1,54
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*4.0*1.E-24)
22 CONTINUE
DO 23 J=1,54
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*4.0*1.E-24)
23 CONTINUE
# LOAD HYDROGEN PHOTOELECTRIC AND COMPTON DATA
DO 24 J=1,54
XPE[2][1][J]=math.log(XPEKH[J])
# SCALE TO 10 HYDROGEN ATOMS PER MOLECULE
YPE[2][1][J]=math.log(YPEKH[J]*10.0*1.E-24)
24 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 25 J=1,54
XCP[1][J]=math.log(XCOMC[J])
XCP[2][J]=math.log(XCOMH[J])
YRY[1][J]=math.log(YRAYC[J]*4.0*1.E-24)
YRY[2][J]=math.log(YRAYH[J]*10.0*1.E-24)
YCP[1][J]=math.log(YCOMC[J]*4.0*1.E-24)
YCP[2][J]=math.log(YCOMH[J]*10.0*1.E-24)
YPP[1][J]=math.log(YPAPC[J]*4.0*1.E-24)
YPP[2][J]=math.log(YPAPH[J]*10.0*1.E-24)
25 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 26 J=1,45
FFAR[1][J]=FFRC[J]
FFAR[2][J]=FFRH[J]
FFAC[1][J]=FFCC[J]
FFAC[2][J]=FFCH[J]
26 CONTINUE
return
# end
'''
def CGAS12(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
# DIMENSION
PRSH=numpy.zeros((3+1,17+1,17+1))
PRSHBT=numpy.zeros((3+1,17+1))
ESH=numpy.zeros((3+1,17+1))
AUG=numpy.zeros((3+1,17+1,17+1,17+1))
RAD=numpy.zeros((3+1,17+1,17+1))
XPE=numpy.zeros((3+1,17+1,60+1))
YPE=numpy.zeros((3+1,17+1,60+1))
XCP=numpy.zeros((3+1,54+1))
YRY=numpy.zeros((3+1,54+1))
YCP=numpy.zeros((3+1,54+1))
YPP=numpy.zeros((3+1,54+1))
FFAR=numpy.zeros((3+1,45+1))
FFAC=numpy.zeros((3+1,45+1))
IZ=numpy.zeros((3+1))
AMZ=numpy.zeros((3+1))
INIOCC=numpy.zeros((3+1,17+1))
# DIMENSION
INIOC=numpy.zeros((17+1))
PRBSH=numpy.zeros((17+1,17+1))
ES=numpy.zeros((17+1))
R=numpy.zeros((17+1,17+1))
A=numpy.zeros((17+1,17+1,17+1))
PRBSHBT=numpy.zeros((17+1))
# DIMENSION
INIOCO=numpy.zeros((17+1))
PRBSHO=numpy.zeros((17+1,17+1))
ESO=numpy.zeros((17+1))
RO=numpy.zeros((17+1,17+1))
AO=numpy.zeros((17+1,17+1,17+1))
PRBSHBTO=numpy.zeros((17+1))
# DIMENSION
XPEK=numpy.zeros((49+1))
YPEK=numpy.zeros((49+1))
XPEL1=numpy.zeros((54+1))
YPEL1=numpy.zeros((54+1))
XPEL2=numpy.zeros((54+1))
YPEL2=numpy.zeros((54+1))
XCOMC=numpy.zeros((54+1))
YRAYC=numpy.zeros((54+1))
YCOMC=numpy.zeros((54+1))
YPAPC=numpy.zeros((54+1))
FFRC=numpy.zeros((45+1))
FFCC=numpy.zeros((45+1))
# DIMENSION
XPEKO=numpy.zeros((46+1))
YPEKO=numpy.zeros((46+1))
XPEL1O=numpy.zeros((53+1))
YPEL1O=numpy.zeros((53+1))
XPEL2O=numpy.zeros((55+1))
YPEL2O=numpy.zeros((55+1))
XPEL3O=numpy.zeros((55+1))
YPEL3O=numpy.zeros((55+1))
XCOMO=numpy.zeros((54+1))
YRAYO=numpy.zeros((54+1))
YCOMO=numpy.zeros((54+1))
YPAPO=numpy.zeros((54+1))
FFRO=numpy.zeros((45+1))
FFCO=numpy.zeros((45+1))
#
# CO2 DATA
#
# CARBON DATA FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
INIOC=[0]+[2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
# AVERAGE SHAKE OFF ELECTRON ENERGY
ES=[0]+[10.00,2.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]
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
PRBSH=[0.20,3.00,9.00,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.80,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00]+238*[0.0]
PRBSH=numpy.reshape(PRBSH,(17,17))
PRBSH=numpy.r_[[numpy.zeros(PRBSH.shape[1])],PRBSH]
PRBSH=numpy.c_[numpy.zeros(PRBSH.shape[0]),PRBSH]
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
PRBSHBT=[0]+[2.74,12.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
A[1][2][2]=0.858
A[1][2][3]=0.824
A[1][3][3]=0.378
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
R[1][2]=1.50E-14
R[1][3]=3.45E-5
R[1][4]=6.88E-5
# L1 SHELL
R[2][3]=1.20E-7
R[2][4]=2.41E-7
# L2 SHELL
R[3][4]=1.55E-21
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
YPEK=[0]+[9.26E5,7.98E5,4.81E5,2.35E5,1.21E5,8.42E4,6.57E4,5.09E4,4.20E4,1.33E4,5.73E3,1.70E3,707.,354.,200.,80.4,39.3,10.6,4.12,1.08,.415,.197,.107,.0411,.0195,.00512,.00201,5.64E-4,2.41E-4,1.29E-4,8.05E-5,4.06E-5,2.52E-5,1.19E-5,7.51E-6,4.21E-6,2.90E-6,2.20E-6,1.77E-6,1.27E-6,9.93E-7,6.39E-7,4.71E-7,3.08E-7,2.29E-7,1.82E-7,1.51E-7,1.13E-7,9.01E-8]
XPEK=[0]+[285.0,300.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L1 SHELL 2S 1/2
YPEL1=[0]+[1.35E7,1.50E6,4.00E5,2.21E5,1.70E5,1.14E5,4.58E4,2.07E4,1.02E4,5.34E3,3.76E3,2.97E3,2.32E3,1.93E3,635.,280.,85.1,35.7,18.0,10.3,4.16,2.05,.554,.217,.0571,.0220,.0105,.00570,.00218,.00104, 2.72E-4,1.07E-4,3.00E-5,1.28E-5,6.88E-6,4.28E-6,2.16E-6,1.34E-6,6.37E-7,4.02E-7,2.26E-7,1.55E-7,1.18E-7,9.49E-8,6.82E-8,5.32E-8,3.42E-8,2.52E-8,1.65E-8,1.23E-8,9.75E-9,8.10E-9,6.05E-9,4.82E-9]
XPEL1=[0]+[18.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L2 SHELL 2P 1/2
YPEL2=[0]+[1.35E7,9.0E5,1.50E5,7.81E4,5.15E4,2.79E4,7.59E3,2.49E3,924.,383.,239.,173.,124.,94.6,20.7,6.75,1.36,.432,.176,.0841, .0259,.0103,.00189,5.64E-4,1.02E-4,3.06E-5,1.20E-5,5.63E-6,1.72E-6,6.96E-7,1.40E-7,4.69E-8,1.10E-8,4.26E-9,2.16E-9,1.29E-9,6.20E-10,3.76E-10,1.82E-10,1.15E-10,6.45E-11,4.44E-11,3.37E-11,2.71E-11,1.95E-11,1.52E-11,9.77E-12,7.20E-12,4.71E-12,3.50E-12,2.79E-12,2.31E-12,1.75E-12,1.38E-12]
XPEL2=[0]+[6.40,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
XCOMC=[0]+[100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.022E6,1.25E6,1.5E6,2.0E6,2.044E6,3.0E6,4.0E6,5.0E6,6.0E6,7.0E6,8.0E6,9.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
YRAYC=[0]+[23.94,23.90,24.85,23.72,23.53,23.31,23.03,22.37,21.52,19.12,16.59,12.22,9.179,7.170,5.819,4.181,3.232,1.952,1.292,.6711, .4079,.2734,.1956,.1139,.07418,.03360,.01903,8.504E-3,4.792E-3, 3.070E-3, 2.133E-3,1.200E-3,7.682E-4,7.355E-4,4.917E-4,3.415E-4,1.921E-4,1.839E-4,8.539E-5,4.803E-5,3.074E-5,2.135E-5,1.568E-5,1.201E-5,9.488E-6,7.685E-6,3.415E-6,1.921E-6,8.537E-7,4.802E-7,3.073E-7,2.134E-7,1.200E-7,7.682E-8]
YCOMC=[0]+[3.044E-3,6.469E-3,.01140,.02518,.04448,.06870,.09764, .1680,.2519,.5001,.7702,1.278,1.685,1.984,2.202,2.497,2.697,3.012,3.182,3.300,3.296,3.250,3.188,3.054,2.924,2.647,2.431,2.118,1.899,1.735,1.605,1.410,1.268,1.255,1.134,1.031,.8795,.8687,.6920,.5772,.4985,.4406,.3960,.3604,.3313,.3069,.2272,.1823,.1327,.1055,.08805,.07586,.05983,.04966]
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
YPAPC=[0]+34*[1.E-20]+[2.870E-4,1.594E-3,6.356E-3,6.852E-3,.01844,.03054, .04163,.05178,.06095,.06928,.07690,.08388,.1108,.1310,.1597,.1802,.1958,.2080,.2263,.2401]
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
FFRC=[0]+[1.0,.99957,.99830,.9962,.9932,.9895,.9848,.9735,.9590,.9228,.8783,.8538,.7902,.7218,.6562,.5962,.4935,.4170,.3252,.2810,.2558,.2375,.2202,.2027,.1853,.1441,.1094,.0620,.03577,.02147,.01341,.008705,.004055,.002108,.001191,7.198E-4,3.06E-4,6.295E-5, 2.027E-5,5.398E-7,8.455E-8,3.52E-8,5.993E-12,2.767E-21,2.80E-30]
# NORMALISED COMPTON FORM FACTOR Hubbel
FFCC=[0]+[1.7E-21,6.317E-4,.002165,.004922,.008607,.01341,.01928,.03358,.05143,.0948,.1459,.1732,.2413,.3110,.3755,.4340,.5330,.6072,.6973,.7463,.7817,.8130,.8418,.8680,.8913,.9358,.9635,.9883,.9962,.9987,.99947,.99977,.99995,.99998,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]
# CARBON ATOMIC NUMBER
IZ[1]=6
AMZ[1]=12.0107
#
# ATOMIC OXYGEN DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
INIOCO=[0]+[2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0]
# AVERAGE SHAKE OFF ELECTRON ENERGY
ESO=[0]+[12.0,2.0,2.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]
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
PRBSHO=[0.10,2.50,6.00,6.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.30,2.00,1.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,1.00,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,1.00,1.20,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00]+221*[0.0]
PRBSHO=numpy.reshape(PRBSHO,(17,17))
PRBSHO=numpy.r_[[numpy.zeros(PRBSHO.shape[1])],PRBSHO]
PRBSHO=numpy.c_[numpy.zeros(PRBSHO.shape[0]),PRBSHO]
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
PRBSHBTO=[0]+[1.56,6.0,8.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
AO[1][2][2]=0.856
AO[1][2][3]=0.824
AO[1][3][3]=0.382
AO[1][2][4]=0.140
AO[1][3][4]=0.068
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
RO[1][2]=3.36E-13
RO[1][3]=2.752E-4
RO[1][4]=5.48E-4
# L1 SHELL
RO[2][3]=6.62E-7
RO[2][4]=1.34E-6
# L2 SHELL
RO[3][4]=2.55E-19
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
YPEKO=[0]+[5.75E5,3.06E5,2.21E5,1.76E5,1.39E5,1.16E5,3.9E4,1.75E4,5.44E3,2.32E3,1.19E3,682.,281.,140.,38.8,15.4,4.13,1.61,.771,.423,.163,.0782,.0207,.00817,.00231,9.89E-4,5.33E-4,3.32E-4,1.68E-4,1.04E-4,4.91E-5,3.09E-5,1.73E-5,1.18E-5,8.98E-6,7.22E-6,5.18E-6,4.03E-6,2.59E-6,1.91E-6,1.25E-6,9.26E-7,7.36E-7,6.11E-7,4.56E-7,3.64E-7]
XPEKO=[0]+[532.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L1 SHELL 2S 1/2
YPEL1O=[0]+[5.60E6,6.00E5,3.67E5,2.96E5,2.12E5,9.79E4,4.78E4,2.51E4,1.39E4,1.00E4,8.00E3,6.36E3,5.32E3,1.87E3,863.,279.,122.,63.1,36.6,15.3,7.67,2.15,.859,.232,.0906,.0436,.0239,.00926,.00444,.00118,4.66E-4,1.31E-4,5.63E-5,3.03E-5,1.89E-5,9.54E-6,5.93E-6,2.80E-6,1.76E-6,9.84E-7,6.75E-7,5.12E-7,4.12E-7,2.95E-7,2.30E-7,1.48E-7,1.09E-7,7.11E-8,5.28E-8,4.20E-8,3.49E-8,2.60E-8,2.08E-8]
XPEL1O=[0]+[28.5,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L2 SHELL 2P 1/2
YPEL2O=[0]+[2.0E7,2.00E7,2.4E6,3.25E5,1.93E5,1.34E5,7.80E4,2.29E4,7.93E3,3.13E3,1.35E3,853.,626.,455.,357.,85.7,30.0,6.51,2.13,.884,.428,.136,.0552,.0106,.00325,6.11E-4,1.87E-4,7.46E-5,3.55E-5,1.11E-5,4.55E-6,9.39E-7,3.20E-7,7.55E-8,2.91E-8,1.45E-8,8.47E-9,3.86E-9,2.21E-9,9.07E-10,5.71E-10,3.19E-10,2.19E-10,1.66E-10,1.33E-10,9.56E-11,7.44E-11,4.78E-11,3.52E-11,2.30E-11,1.71E-11,1.36E-11,1.13E-11,8.43E-12,6.72E-12]
XPEL2O=[0]+[13.8,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# L3 SHELL 2P 3/2
YPEL3O=[0]+[4.0E7,4.00E7,4.8E6,6.50E5,3.84E5,2.67E5,1.55E5,4.55E4,1.58E4,6.23E3,2.69E3,1.69E3,1.24E3,900.,708.,170.,59.3,12.8,4.20,1.74,.841,.265,.107,.0205,.00625,.00116,3.51E-4,1.39E-4,6.55E-5,2.01E-5,8.16E-6,1.65E-6,5.52E-7,1.30E-7,5.10E-8,2.62E-8,1.58E-8,7.76E-9,4.77E-9,2.25E-9,1.42E-9,7.91E-10,5.42E-10,4.12E-10,3.31E-10,2.37E-10,1.85E-10,1.19E-10,8.73E-11,5.71E-11,4.24E-11,3.37E-11,2.80E-11,2.09E-11,1.67E-11]
XPEL3O=[0]+[13.8,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
XCOMO=[0]+[100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.022E6,1.25E6,1.5E6,2.0E6,2.044E6,3.0E6,4.0E6,5.0E6,6.0E6,7.0E6,8.0E6,9.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8]
YRAYO=[0]+[42.56,42.52,42.46,42.32,42.12,41.87,41.57,40.82,39.89,36.98,33.56,26.63,20.81,16.42,13.23,9.157,6.814,3.948,2.627,1.394, .8541,.5755,.4138,.2428,.1591,.07264,.04128,.01849,.01043, .006684, 4.645E-3,2.615E-3,1.674E-3,1.603E-3,1.072E-3,7.442E-4,4.187E-4,4.008E-4,1.861E-4,1.047E-4,6.699E-5,4.652E-5,3.418E-5,2.617E-5,2.068E-5,1.675E-5,7.474E-6,4.204E-6,1.868E-6,1.051E-6,6.726E-7,4.670E-7,2.628E-7,1.681E-7]
YCOMO=[0]+[2.479E-3,5.433E-3,9.695E-3,.02175,.03847,.05970,.08522,.1484,.2262,.4697, .7560,1.352,1.886,2.323,2.665,3.139,3.439,3.864,4.092,4.286,4.315,4.275,4.207,4.044,3.880,3.521,3.236,2.821,2.530,2.312,2.139,1.880,1.691,1.673,1.512,1.374,1.173,1.158,.9226,.7696,.6646,.5874,.5280,.4805,.4417,.4093,.3029,.2431,.1770,.1406, .1174,.1012,.07977,.06621]
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
YPAPO=[0]+34*[1.E-20]+[5.159E-4,2.85E-3,.01134,.01222,.03273,.05388,.07314,.09067,.1064,.1207,.1338,.1457,.1915,.2267,.2749,.3085, .3339,.3549,.3862,.4086]
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
FFRO=[0]+[1.0,.99967,.99890,.9976,.9959,.9935,.9907,.9836,.9746,.9515,.9221,.9055,.8594,.8087,.7559,.7025,.6006,.5107,.3754,.2919,.2430,.2141,.1959,.1827,.1720,.1477,.1245,.0840,.05521,.0398,.02439,.01905,.008362,.004562,.002637,.001975,6.5E-4,1.609E-4,5.239E-5,1.424E-6, 2.251E-7,9.421E-8,1.809E-11,9.77E-21,1.0E-29]
# NORMALISED COMPTON FORM FACTOR Hubbel
FFCO=[0]+[1.2E-21,3.7E-4,.00137,.00316,.00560,.00872,.0125,.02201,.03387,.06421,.1015,.1221,.1775,.2356,.2937,.3499,.4516,.5366,.6571,.7285,.7719,.8014,.8245,.8444,.8626,.9020,.9327,.9705,.9875,.9946,.99759,.99887,.99971,.99991,.99997,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]
# OXYGEN ATOMIC NUMBER
IZ[2]=8
AMZ[2]=31.9988
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
for I in range(1,17+1):
PRSHBT[1][I]=PRBSHBT[I]/100.0
PRSHBT[2][I]=PRBSHBTO[I]/100.0
for J in range(1,17+1):
PRBSH[I][J]=PRBSH[I][J]/100.0
PRBSHO[I][J]=PRBSHO[I][J]/100.0
# SWAP INDICES AND DO CHECK SUM
for I in range(1,17+1):
PRSUM=0.0
PRSUMO=0.0
for J in range(1,17+1):
PRSH[1][I][J]=PRBSH[J][I]
PRSH[2][I][J]=PRBSHO[J][I]
# PRSUM=PRSUM+PRSH[1][I][J]
# PRSUMO=PRSUMO+PRSH[2][I][J]
# WRITE(6,888) I,PRSUM,PRSUMO
# 888 print(' I=',I3,' PRSUM=','%.3f' %,' PRSUMO=','%.3f' %)
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
for I in range(1,17+1):
ESH[1][I]=ES[I]
ESH[2][I]=ESO[I]
INIOCC[1][I]=INIOC[I]
INIOCC[2][I]=INIOCO[I]
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
for I in range(1,4+1):
for J in range(1,17+1):
for K in range(1,17 +1):
AUG[1][I][J][K]=A[I][J][K]*0.0272105
AUG[2][I][J][K]=AO[I][J][K]*0.0272105
for I in range(5,17+1):
for J in range(1,17+1):
for K in range(1,17+1):
AUG[1][I][J][K]=A[I][J][K]*0.00272105
AUG[2][I][J][K]=AO[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
for I in range(5,17+1):
for J in range(6,17+1):
R[I][J]=R[I][J]*6.582119E-16
RO[I][J]=RO[I][J]*6.582119E-16
# LOAD OUTPUT ARRAY
for I in range(1,17+1):
for J in range(1,17+1):
RAD[1][I][J]=R[I][J]
RAD[2][I][J]=RO[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD CARBON PHOTOELECTRIC AND COMPTON DATA
for J in range(1,49+1):
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*1.E-24)
for J in range(1,54+1):
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*1.E-24)
for J in range(1,54 +1):
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*1.E-24)
# LOAD OXYGEN PHOTOELECTRIC AND COMPTON DATA DATA
# SCALE BY TWO FOR OXYGEN ATOMS
for J in range(1,46+1):
XPE[2][1][J]=math.log(XPEKO[J])
YPE[2][1][J]=math.log(YPEKO[J]*2.0*1.E-24)
for J in range(1,53+1):
XPE[2][2][J]=math.log(XPEL1O[J])
YPE[2][2][J]=math.log(YPEL1O[J]*2.0*1.E-24)
for J in range(1,55 +1):
XPE[2][3][J]=math.log(XPEL2O[J])
YPE[2][3][J]=math.log(YPEL2O[J]*2.0*1.E-24)
for J in range(1,55 +1):
XPE[2][4][J]=math.log(XPEL3O[J])
YPE[2][4][J]=math.log(YPEL3O[J]*2.0*1.E-24)
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
for J in range(1,54+1):
XCP[1][J]=math.log(XCOMC[J])
XCP[2][J]=math.log(XCOMO[J])
YRY[1][J]=math.log(YRAYC[J]*1.E-24)
YRY[2][J]=math.log(YRAYO[J]*2.0*1.E-24)
YCP[1][J]=math.log(YCOMC[J]*1.E-24)
YCP[2][J]=math.log(YCOMO[J]*2.0*1.E-24)
YPP[1][J]=math.log(YPAPC[J]*1.E-24)
YPP[2][J]=math.log(YPAPO[J]*2.0*1.E-24)
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
for J in range(1,45+1):
FFAR[1][J]=FFRC[J]
FFAR[2][J]=FFRO[J]
FFAC[1][J]=FFCC[J]
FFAC[2][J]=FFCO[J]
return
# end
'''
def CGAS13(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS14(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOCO(17),PRBSHO(17,17),ESO(17),RO(17,17),AO(17,17,17),PRBSHBTO(17)
DIMENSION XPEKO(46),YPEKO(46),XPEL1O(53),YPEL1O(53),XPEL2O(55),YPEL2O(55),XPEL3O(55),YPEL3O(55),XCOMO(54),YRAYO(54),YCOMO(54),YPAPO(54),FFRO(45),FFCO(45)
DIMENSION INIOCH(17),PRBSHH(17,17),ESHH(17),RH(17,17),AH(17,17,17),PRBSHBTH(17)
DIMENSION XPEKH(54),YPEKH(54),XCOMH(54),YRAYH(54),YCOMH(54),YPAPH(54),FFRH(45),FFCH(45)
#
# ATOMIC OXYGEN DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCO/2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESO/12.0,2.0,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHO/0.10,2.50,6.00,6.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.30,2.00,1.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,1.00,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,1.00,1.20,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,221*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTO/1.56,6.0,8.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA AO[1][2][2]/0.856/,AO[1][2][3]/0.824/,AO[1][3][3]/0.382/
DATA AO[1][2][4]/0.140/,AO[1][3][4]/0.068/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA
RO[1][2]=3.36E-13/
RO[1][3]=2.752E-4/
RO[1][4]=5.48E-4
# L1 SHELL
DATA
RO[2][3]=6.62E-7/
RO[2][4]=1.34E-6
# L2 SHELL
DATA
RO[3][4]=2.55E-19
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKO/5.75E5,3.06E5,2.21E5,1.76E5,1.39E5,1.16E5,3.9E4,1.75E4,5.44E3,2.32E3,1.19E3,682.,281.,140.,38.8,15.4,4.13,1.61,.771,.423,.163,.0782,.0207,.00817,.00231,9.89E-4,5.33E-4,3.32E-4,1.68E-4,1.04E-4,4.91E-5,3.09E-5,1.73E-5,1.18E-5,8.98E-6,7.22E-6,5.18E-6,4.03E-6,2.59E-6,1.91E-6,1.25E-6,9.26E-7,7.36E-7,6.11E-7,4.56E-7,3.64E-7/
DATA XPEKO/532.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1O/5.60E6,6.00E5,3.67E5,2.96E5,2.12E5,9.79E4,4.78E4,2.51E4,1.39E4,1.00E4,8.00E3,6.36E3,5.32E3,1.87E3,863.,279.,122.,63.1,36.6,15.3,7.67,2.15,.859,.232,.0906,.0436,.0239,.00926,.00444,.00118,4.66E-4,1.31E-4,5.63E-5,3.03E-5,1.89E-5,9.54E-6,5.93E-6,2.80E-6,1.76E-6,9.84E-7,6.75E-7,5.12E-7,4.12E-7,2.95E-7,2.30E-7,1.48E-7,1.09E-7,7.11E-8,5.28E-8,4.20E-8,3.49E-8,2.60E-8,2.08E-8/
DATA XPEL1O/28.5,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2O/2.0E7,2.00E7,2.4E6,3.25E5,1.93E5,1.34E5,7.80E4,2.29E4,7.93E3,3.13E3,1.35E3,853.,626.,455.,357.,85.7,30.0,6.51,2.13,.884,.428,.136,.0552,.0106,.00325,6.11E-4,1.87E-4,7.46E-5,3.55E-5,1.11E-5,4.55E-6,9.39E-7,3.20E-7,7.55E-8,2.91E-8,1.45E-8,8.47E-9,3.86E-9,2.21E-9,9.07E-10,5.71E-10,3.19E-10,2.19E-10,1.66E-10,1.33E-10,9.56E-11,7.44E-11,4.78E-11,3.52E-11,2.30E-11,1.71E-11,1.36E-11,1.13E-11,8.43E-12,6.72E-12/
DATA XPEL2O/13.8,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L3 SHELL 2P 3/2
DATA YPEL3O/4.0E7,4.00E7,4.8E6,6.50E5,3.84E5,2.67E5,1.55E5,4.55E4,1.58E4,6.23E3,2.69E3,1.69E3,1.24E3,900.,708.,170.,59.3,12.8,4.20,1.74,.841,.265,.107,.0205,.00625,.00116,3.51E-4,1.39E-4,6.55E-5,2.01E-5,8.16E-6,1.65E-6,5.52E-7,1.30E-7,5.10E-8,2.62E-8,1.58E-8,7.76E-9,4.77E-9,2.25E-9,1.42E-9,7.91E-10,5.42E-10,4.12E-10,3.31E-10,2.37E-10,1.85E-10,1.19E-10,8.73E-11,5.71E-11,4.24E-11,3.37E-11,2.80E-11,2.09E-11,1.67E-11/
DATA XPEL3O/13.8,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
DATA XCOMO/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYO/42.56,42.52,42.46,42.32,42.12,41.87,41.57,40.82,39.89,36.98,33.56,26.63,20.81,16.42,13.23,9.157,6.814,3.948,2.627,1.394, .8541,.5755,.4138,.2428,.1591,.07264,.04128,.01849,.01043, .006684, 4.645D-3,2.615D-3,1.674D-3,1.603D-3,1.072D-3,7.442D-4,4.187D-4,4.008D-4,1.861D-4,1.047D-4,6.699D-5,4.652D-5,3.418D-5,2.617D-5,2.068D-5,1.675D-5,7.474D-6,4.204D-6,1.868D-6,1.051D-6,6.726D-7,4.670D-7,2.628D-7,1.681D-7/
DATA YCOMO/2.479D-3,5.433D-3,9.695D-3,.02175,.03847,.05970,.08522,.1484,.2262,.4697, .7560,1.352,1.886,2.323,2.665,3.139,3.439,3.864,4.092,4.286,4.315,4.275,4.207,4.044,3.880,3.521,3.236,2.821,2.530,2.312,2.139,1.880,1.691,1.673,1.512,1.374,1.173,1.158,.9226,.7696,.6646,.5874,.5280,.4805,.4417,.4093,.3029,.2431,.1770,.1406, .1174,.1012,.07977,.06621/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPO/34*1.E-20,5.159D-4,2.85D-3,.01134,.01222,.03273,.05388,.07314,.09067,.1064,.1207,.1338,.1457,.1915,.2267,.2749,.3085, .3339,.3549,.3862,.4086/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRO/1.0,.99967,.99890,.9976,.9959,.9935,.9907,.9836,.9746,.9515,.9221,.9055,.8594,.8087,.7559,.7025,.6006,.5107,.3754,.2919,.2430,.2141,.1959,.1827,.1720,.1477,.1245,.0840,.05521,.0398,.02439,.01905,.008362,.004562,.002637,.001975,6.5D-4,1.609D-4,5.239D-5,1.424D-6, 2.251D-7,9.421D-8,1.809D-11,9.77D-21,1.0D-29/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCO/1.2D-21,3.7D-4,.00137,.00316,.00560,.00872,.0125,.02201,.03387,.06421,.1015,.1221,.1775,.2356,.2937,.3499,.4516,.5366,.6571,.7285,.7719,.8014,.8245,.8444,.8626,.9020,.9327,.9705,.9875,.9946,.99759,.99887,.99971,.99991,.99997,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# OXYGEN ATOMIC NUMBER
IZ[1]=8
AMZ[1]=15.9994
#
# ATOMIC HYDROGEN DATA FOR CASCADE CALCULATIONS SCALED TO
# MOLECULAR HYDROGEN
#
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCH/1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESHH/17*0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTH/17*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKH/6.41E6,2.18E6,1.93E4,8.10E3,5.31E3,2.86E3,765.,251.,96.6,41.9,26.7,19.7,14.4,11.4,2.93,1.11,.281,.105,.0491,.0263,.00982,.00456,.00113,4.18E-4,1.03E-4,3.82E-5,1.77E-5,9.46E-6,3.52E-6,1.64E-6,4.18E-7,1.61E-7,4.41E-8,1.86E-8,9.93E-9,6.16E-9,3.12E-9,1.96E-9,9.73E-10,6.20E-10,3.52E-10,2.44E-10,1.87E-10,1.51E-10,1.09E-10,8.50E-11,5.49E-11,4.06E-11,2.66E-11,1.98E-11,1.58E-11,1.31E-11,9.79E-12,7.81E-12/
DATA XPEKH/13.598,20.,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL DATA TABLES A7(1970)565
DATA XCOMH/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YCOMH/9.552D-4,2.144D-3,3.802D-3,8.494D-3,1.496D-2,2.310D-2,3.279D-2,5.629D-2,8.424D-2,0.1650,.2478,.3822,.4675,.5187,.5503,.5840,.5993,.6095,.6068,.5924,.5759,.5597,.5444,.5166,.4923,.4435,.4064,.3535,.3168,.2893,.2676,.2351,.2114,.2092,.1890,.1718,.1466,.1448,.1153,.0962,.08308,.07343,.0660,.06007,.05522,.05116,.03786,.03039,.02212,.01758,.01467,.01264,.009972,.008276/
DATA YRAYH/.6650,.6635,.6617,.6569,.6503,.6421,.6323,.6087,.5806,.4984,.4142,.2764,.1881,.1341,.09987,.06126,.04121,.01943,.01119,.005062,.002866,.001840,.001280,7.211D-4,4.619D-4,2.054D-4,1.156D-4,5.138D-5,2.890D-5,1.850D-5,1.285D-5,7.226D-6,4.625D-6,4.428D-6,2.960D-6,2.056D-6,1.156D-6,1.107D-6,5.139D-7,2.891D-7,1.850D-7,1.285D-7,9.439D-8,7.227D-8,5.710D-8,4.625D-8,2.056D-8,1.156D-8,5.139D-9,2.890D-9,1.850D-9,1.284D-9,7.222D-10,4.620D-10/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPH/34*1.E-20,7.805D-6,4.385D-5,1.758D-4,1.895D-4,5.451D-4,9.849D-4,1.430D-3,1.859D-3,2.260D-3,2.634D-3,2.984D-3,3.308D-3,4.61D-3,5.61D-3,7.08D-3,8.13D-3,8.98D-3,9.65D-3,1.074D-2,1.161D-2/
# RAYLEIGH FORM FACTOR Hubbel
DATA FFRH/1.0,.9994,.9978,.9950,.9912,.9863,.9804,.9655,.9469,.8999,.8424,.8108,.7271,.6413,.5581,.4808,.3497,.2513,.1304,.07059,.04032,.02429,.01533,.01009,.006881,.002995,.001494,4.890D-4,2.035D-4,9.902D-5,5.373D-5,3.160D-5,1.300D-5,6.282D-6,3.395D-6,1.992D-6,8.168D-7,1.615D-7,5.112D-8,1.309D-9,1.998D-10,8.182D-11,8.182D-15,8.182D-27,8.182D-39/
# COMPTON FORM FACTOR Hubbel
DATA FFCH/1.E-20,.001105,.004410,.009888,.01749,.02717,.03883,.06773,.1033,.1902,.2904,.3426,.4713,.5887,.6885,.7689,.8777,.9369,.9830,.9950,.9984,.9994,.9998,.9999,.99995,.99999,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/
# HYDROGEN ATOMIC NUMBER
IZ[2]=1
AMZ[2]=2.015808
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBTO[I]/100.0
PRSHBT[2][I]=PRBSHBTH[I]/100.0
DO 1 J=1,17
PRBSHO[I][J]=PRBSHO[I][J]/100.0
PRBSHH[I][J]=PRBSHH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUMO=0.0
PRSUMH=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSHO[J][I]
PRSH[2][I][J]=PRBSHH[J][I]
# PRSUMO=PRSUMO+PRSH[1][I][J]
# PRSUMH=PRSUMH+PRSH[2][I][J]
# WRITE(6,888) I,PRSUMO,PRSUMH
# 888 print(' I=',I3,' PRSUMO=','%.3f' %,' PRSUMH=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ESO[I]
ESH[2][I]=ESHH[I]
INIOCC[1][I]=INIOCO[I]
INIOCC[2][I]=INIOCH[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
AUG[1][I][J][K]=AO[I][J][K]*0.0272105
4 AUG[2][I][J][K]=AH[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
AUG[1][I][J][K]=AO[I][J][K]*0.00272105
5 AUG[2][I][J][K]=AH[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
RO[I][J]=RO[I][J]*6.582119D-16
12 RH[I][J]=RH[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
RAD[1][I][J]=RO[I][J]
13 RAD[2][I][J]=RH[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD HYDROGEN PHOTOELECTRIC AND COMPTON DATA\
# SCALE BY 2 HYDROGEN ATOMS
DO 21 J=1,54
XPE[2][1][J]=math.log(XPEKH[J])
YPE[2][1][J]=math.log(YPEKH[J]*2.E-24)
21 CONTINUE
# LOAD OXYGEN PHOTOELECTRIC AND COMPTON DATA DATA
DO 24 J=1,46
XPE[1][1][J]=math.log(XPEKO[J])
YPE[1][1][J]=math.log(YPEKO[J]*1.E-24)
24 CONTINUE
DO 25 J=1,53
XPE[1][2][J]=math.log(XPEL1O[J])
YPE[1][2][J]=math.log(YPEL1O[J]*1.E-24)
25 CONTINUE
DO 26 J=1,55
XPE[1][3][J]=math.log(XPEL2O[J])
YPE[1][3][J]=math.log(YPEL2O[J]*1.E-24)
26 CONTINUE
DO 27 J=1,55
XPE[1][4][J]=math.log(XPEL3O[J])
YPE[1][4][J]=math.log(YPEL3O[J]*1.E-24)
27 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 28 J=1,54
XCP[1][J]=math.log(XCOMO[J])
XCP[2][J]=math.log(XCOMH[J])
YRY[1][J]=math.log(YRAYO[J]*1.E-24)
YRY[2][J]=math.log(YRAYH[J]*2.0*1.E-24)
YCP[1][J]=math.log(YCOMO[J]*1.E-24)
YCP[2][J]=math.log(YCOMH[J]*2.0*1.E-24)
YPP[1][J]=math.log(YPAPO[J]*1.E-24)
YPP[2][J]=math.log(YPAPH[J]*2.0*1.E-24)
28 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 29 J=1,45
FFAR[1][J]=FFRO[J]
FFAR[2][J]=FFRH[J]
FFAC[1][J]=FFCO[J]
FFAC[2][J]=FFCH[J]
29 CONTINUE
return
# end
def CGAS15(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION XPEK(46),YPEK(46),XPEL1(53),YPEL1(53),XPEL2(55),YPEL2(55),XPEL3(55),YPEL3(55),XCOMO(54),YRAYO(54),YCOMO(54),YPAPO(54),FFRO(45),FFCO(45)
#
# ATOMIC OXYGEN DATA FOR CASCADE CALCULATIONS SCALED LATER TO
# MOLECULAR OXYGEN
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/12.0,2.0,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/0.10,2.50,6.00,6.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.30,2.00,1.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,1.00,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,1.00,1.20,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,221*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/1.56,6.0,8.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/0.856/,A[1][2][3]/0.824/,A[1][3][3]/0.382/
DATA A[1][2][4]/0.140/,A[1][3][4]/0.068/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/3.36E-13/,R(1,3)/2.752E-4/,R(1,4)/5.48E-4/
# L1 SHELL
DATA R(2,3)/6.62E-7/,R(2,4)/1.34E-6/
# L2 SHELL
DATA R(3,4)/2.55E-19/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEK/5.75E5,3.06E5,2.21E5,1.76E5,1.39E5,1.16E5,3.9E4,1.75E4,5.44E3,2.32E3,1.19E3,682.,281.,140.,38.8,15.4,4.13,1.61,.771,.423,.163,.0782,.0207,.00817,.00231,9.89E-4,5.33E-4,3.32E-4,1.68E-4,1.04E-4,4.91E-5,3.09E-5,1.73E-5,1.18E-5,8.98E-6,7.22E-6,5.18E-6,4.03E-6,2.59E-6,1.91E-6,1.25E-6,9.26E-7,7.36E-7,6.11E-7,4.56E-7,3.64E-7/
DATA XPEK/532.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1/5.60E6,6.00E5,3.67E5,2.96E5,2.12E5,9.79E4,4.78E4,2.51E4,1.39E4,1.00E4,8.00E3,6.36E3,5.32E3,1.87E3,863.,279.,122.,63.1,36.6,15.3,7.67,2.15,.859,.232,.0906,.0436,.0239,.00926,.00444,.00118,4.66E-4,1.31E-4,5.63E-5,3.03E-5,1.89E-5,9.54E-6,5.93E-6,2.80E-6,1.76E-6,9.84E-7,6.75E-7,5.12E-7,4.12E-7,2.95E-7,2.30E-7,1.48E-7,1.09E-7,7.11E-8,5.28E-8,4.20E-8,3.49E-8,2.60E-8,2.08E-8/
DATA XPEL1/28.5,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2/2.0E7,2.00E7,2.4E6,3.25E5,1.93E5,1.34E5,7.80E4,2.29E4,7.93E3,3.13E3,1.35E3,853.,626.,455.,357.,85.7,30.0,6.51,2.13,.884,.428,.136,.0552,.0106,.00325,6.11E-4,1.87E-4,7.46E-5,3.55E-5,1.11E-5,4.55E-6,9.39E-7,3.20E-7,7.55E-8,2.91E-8,1.45E-8,8.47E-9,3.86E-9,2.21E-9,9.07E-10,5.71E-10,3.19E-10,2.19E-10,1.66E-10,1.33E-10,9.56E-11,7.44E-11,4.78E-11,3.52E-11,2.30E-11,1.71E-11,1.36E-11,1.13E-11,8.43E-12,6.72E-12/
DATA XPEL2/13.8,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L3 SHELL 2P 3/2
DATA YPEL3/4.0E7,4.00E7,4.8E6,6.50E5,3.84E5,2.67E5,1.55E5,4.55E4,1.58E4,6.23E3,2.69E3,1.69E3,1.24E3,900.,708.,170.,59.3,12.8,4.20,1.74,.841,.265,.107,.0205,.00625,.00116,3.51E-4,1.39E-4,6.55E-5,2.01E-5,8.16E-6,1.65E-6,5.52E-7,1.30E-7,5.10E-8,2.62E-8,1.58E-8,7.76E-9,4.77E-9,2.25E-9,1.42E-9,7.91E-10,5.42E-10,4.12E-10,3.31E-10,2.37E-10,1.85E-10,1.19E-10,8.73E-11,5.71E-11,4.24E-11,3.37E-11,2.80E-11,2.09E-11,1.67E-11/
DATA XPEL3/13.8,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XCOMO/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYO/42.56,42.52,42.46,42.32,42.12,41.87,41.57,40.82,39.89,36.98,33.56,26.63,20.81,16.42,13.23,9.157,6.814,3.948,2.627,1.394, .8541,.5755,.4138,.2428,.1591,.07264,.04128,.01849,.01043, .006684, 4.645D-3,2.615D-3,1.674D-3,1.603D-3,1.072D-3,7.442D-4,4.187D-4,4.008D-4,1.861D-4,1.047D-4,6.699D-5,4.652D-5,3.418D-5,2.617D-5,2.068D-5,1.675D-5,7.474D-6,4.204D-6,1.868D-6,1.051D-6,6.726D-7,4.670D-7,2.628D-7,1.681D-7/
DATA YCOMO/2.479D-3,5.433D-3,9.695D-3,.02175,.03847,.05970,.08522,.1484,.2262,.4697, .7560,1.352,1.886,2.323,2.665,3.139,3.439,3.864,4.092,4.286,4.315,4.275,4.207,4.044,3.880,3.521,3.236,2.821,2.530,2.312,2.139,1.880,1.691,1.673,1.512,1.374,1.173,1.158,.9226,.7696,.6646,.5874,.5280,.4805,.4417,.4093,.3029,.2431,.1770,.1406, .1174,.1012,.07977,.06621/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPO/34*1.E-20,5.159D-4,2.85D-3,.01134,.01222,.03273,.05388,.07314,.09067,.1064,.1207,.1338,.1457,.1915,.2267,.2749,.3085, .3339,.3549,.3862,.4086/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRO/1.0,.99967,.99890,.9976,.9959,.9935,.9907,.9836,.9746,.9515,.9221,.9055,.8594,.8087,.7559,.7025,.6006,.5107,.3754,.2919,.2430,.2141,.1959,.1827,.1720,.1477,.1245,.0840,.05521,.0398,.02439,.01905,.008362,.004562,.002637,.001975,6.5D-4,1.609D-4,5.239D-5,1.424D-6, 2.251D-7,9.421D-8,1.809D-11,9.77D-21,1.0D-29/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCO/1.2D-21,3.7D-4,.00137,.00316,.00560,.00872,.0125,.02201,.03387,.06421,.1015,.1221,.1775,.2356,.2937,.3499,.4516,.5366,.6571,.7285,.7719,.8014,.8245,.8444,.8626,.9020,.9327,.9705,.9875,.9946,.99759,.99887,.99971,.99991,.99997,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# OXYGEN ATOMIC NUMBER
IZ[1]=8
AMZ[1]=31.9988
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
4 AUG[1][I][J][K]=A[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
5 AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
12 R[I][J]=R[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
13 RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC AND COMPTON DATA
# SCALE BY TWO FOR MOLECULE
DO 21 J=1,46
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*2.0*1.E-24)
21 CONTINUE
DO 22 J=1,53
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*2.0*1.E-24)
22 CONTINUE
DO 23 J=1,55
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*2.0*1.E-24)
23 CONTINUE
DO 24 J=1,55
XPE[1][4][J]=math.log(XPEL3[J])
YPE[1][4][J]=math.log(YPEL3[J]*2.0*1.E-24)
24 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 25 J=1,54
XCP[1][J]=math.log(XCOMO[J])
YRY[1][J]=math.log(YRAYO[J]*2.0*1.E-24)
YCP[1][J]=math.log(YCOMO[J]*2.0*1.E-24)
YPP[1][J]=math.log(YPAPO[J]*2.0*1.E-24)
25 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 26 J=1,45
FFAR[1][J]=FFRO[J]
FFAC[1][J]=FFCO[J]
26 CONTINUE
return
# end
def CGAS16(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION XPEK(47),YPEK(47),XPEL1(53),YPEL1(53),XPEL2(55),YPEL2(55),XPEL3(55),YPEL3(55),XCOMN(54),YRAYN(54),YCOMN(54),YPAPN(54),FFRN(45),FFCN(45)
#
# ATOMIC NITROGEN DATA FOR CASCADE CALCULATIONS SCALED LATER TO
# MOLECULAR NITROGEN
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/11.00,2.0,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/0.12,2.50,8.00,4.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.30,2.00,1.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,1.00,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.50,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,221*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/2.2,6.0,8.0,10.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/0.842/,A[1][2][3]/0.828/,A[1][3][3]/0.380/
DATA A[1][2][4]/0.072/,A[1][3][4]/0.035/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/8.04E-14/,R(1,3)/1.104E-4/,R(1,4)/2.201E-4/
# L1 SHELL
DATA R(2,3)/3.09E-7/,R(2,4)/6.23E-7/
# L2 SHELL
DATA R(3,4)/2.65E-20/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEK/7.0E5,3.78E5,2.03E5,1.43E5,1.13E5,8.83E5,7.32E4,2.39E4,1.05E4,3.20E3,1.35E3,681.,388.,158.,78.2,21.3,8.39,2.22,.861,.411,.225,.0863,.0412,.0108,.00428,.00120,5.14E-4,2.77E-4,1.72E-4,8.69E-5,5.40E-5,2.55E-5,1.61E-5,8.99E-6,6.18E-6,4.69E-6,3.77E-6,2.71E-6,2.11E-6,1.36E-6,9.99E-7,6.54E-7,4.86E-7,3.86E-7,3.21E-7,2.39E-7,1.91E-7/
DATA XPEK/401.6,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1/4.50E6,4.80E5,2.98E5,2.35E5,1.63E5,7.04E4,3.31E4,1.68E4,9.06E3,6.45E3,5.12E3,4.03E3,3.38E3,1.15E3,522.,164.,70.0,35.8,20.6,8.46,
.4.21,1.16,.459,.122,.0475,.0227,.0124,.00478,.00229,6.02E-4,2.37E-4,6.68E-5,2.86E-5,1.54E-5,9.57E-6,4.83E-6,3.00E-6,1.42E-6,8.94E-7,5.01E-7,3.44E-7,2.61E-7,2.10E-7,1.51E-7,1.17E-7,7.55E-8,5.56E-8,3.64E-8,2.70E-8,2.15E-8,1.79E-8,1.33E-8,1.06E-8/
DATA XPEL1/24.4,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2/3.20E6,4.00E6,4.00E6,1.8E5,8.45E4,5.70E4,3.19E4,8.90E3,2.95E3,1.14E3,482.,301.,220.,160.,124.,28.4,9.73,2.02,.647,.266,.128,.0402,.0162,.00306,9.27E-4,1.72E-4,5.20E-5,2.07E-5,9.78E-6,3.03E-6,1.24E-6,2.55E-7,8.63E-8,2.03E-8,7.78E-9,3.88E-9,2.25E-9,1.02E-9,5.85E-10,2.44E-10,1.54E-10,8.60E-11,5.91E-11,4.49E-11,3.61E-11,2.59E-11,2.02E-11,1.30E-11,9.56E-12,6.25E-12,4.65E-12,3.70E-12,3.07E-12,2.29E-12,1.83E-12/
DATA XPEL2/14.534,20.0,25.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L3 SHELL 2P 3/2
DATA YPEL3/6.40E6,8.00E6,8.00E6,3.6E5,1.68E5,1.14E5,6.38E4,1.78E4,5.90E3,2.29E3,964.,603.,440.,319.,246.,56.4,19.3,4.00,1.28,.524,.252,.0787,.0317,.00593,.00179,3.27E-4,9.82E-5,3.87E-5,1.82E-5,5.55E-6,2.25E-6,4.50E-7,1.51E-7,3.54E-8,1.39E-8,7.10E-9,4.32E-9,2.12E-9,1.31E-9,6.29E-10,3.96E-10,2.22E-10,1.52E-10,1.16E-10,9.31E-11,6.68E-11,5.20E-11,3.34E-11,2.46E-11,1.61E-11,1.20E-11,9.53E-12,7.91E-12,5.91E-12,4.71E-12/
DATA XPEL3/14.524,20.0,25.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XCOMN/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYN/32.55,32.51,32.47,32.34,32.15,31.91,31.62,30.90,30.03,27.34,24.32,18.61,14.21,11.10,8.927,6.246,4.722,2.805,1.870,.9839, .6009,.4042,.2901,.1697,.1109,.05046,.02863,.01281,.007221, .004626, 3.215D-3,1.809D-3,1.158D-3,1.109D-3,7.414D-4,5.149D-4,2.897D-4,2.773D-4,1.287D-4,7.243D-5,4.635D-5,3.219D-5,2.365D-5,1.811D-5,1.431D-5,1.159D-5,5.164D-6,2.905D-6,1.291D-6,7.263D-7,4.648D-7,3.227D-7,1.816D-7,1.162D-7/
DATA YCOMN/2.698D-3,6.260D-3,.01180,.02508,.04428,.06856,.09770, .1692,.2560,.5198, .8165,1.392,1.866,2.225,2.494,2.858,3.093,3.449,3.645,3.800,3.811,3.766,3.700,3.551,3.403,3.085,2.834,2.470,2.215,2.023,1.872,1.645,1.479,1.464,1.323,1.202,1.026,1.013,.8073,.6734,.5815,.5140,.4620,.4205,.3865,.3581,.2650,.2127,.1549,.1231, .1027,.08851,.06980,.05793/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPN/34*1.E-20,3.931D-4,2.177D-3,8.667D-3,9.343D-3,.02507,.04138, .05628,.06989,.08213,.09326,.1034,.1127,.1487,.1753,.2138,.2397, .2609,.2763,.3012,.3193/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRN/1.0,.99911,.99814,.9970,.9947,.9919,.9897,.9793,.9680,.9391,.9031,.8834,.8280,.7696,.7099,.6514,.5464,.4597,.3420,.2769,.2421,.2217,.2066,.1931,.1803,.1307,.1197,.07481,.0462,.0325,.01881,.01457,.006071,.003214,.001871,.001443,5.857D-4,1.087D-4,3.519D-5,9.463D-7,1.490D-7,6.217D-8,1.127D-11,5.67D-21,5.77D-30/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCN/1.4D-21,4.3D-4,.00186,.00417,.00739,.01149,.01644,.02881,.04429,.08257,.1292,.1543,.2200,.2861,.3496,.4083,.5084,.5853,.6846,.7403,.7767,.8050,.8299,.8526,.8733,.9166,.9471,.9800,.9924,.9970,.99876,.99943,.99987,.99997,.99999,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# NITROGEN ATOMIC NUMBER
IZ[1]=7
AMZ[1]=28.0134
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
4 AUG[1][I][J][K]=A[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
5 AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
12 R[I][J]=R[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
13 RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC AND COMPTON DATA
# SCALE BY TWO FOR MOLECULE
DO 21 J=1,47
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*2.0*1.E-24)
21 CONTINUE
DO 22 J=1,53
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*2.0*1.E-24)
22 CONTINUE
DO 23 J=1,55
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*2.0*1.E-24)
23 CONTINUE
DO 24 J=1,55
XPE[1][4][J]=math.log(XPEL3[J])
YPE[1][4][J]=math.log(YPEL3[J]*2.0*1.E-24)
24 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 25 J=1,54
XCP[1][J]=math.log(XCOMN[J])
YRY[1][J]=math.log(YRAYN[J]*2.0*1.E-24)
YCP[1][J]=math.log(YCOMN[J]*2.0*1.E-24)
YPP[1][J]=math.log(YPAPN[J]*2.0*1.E-24)
25 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 26 J=1,45
FFAR[1][J]=FFRN[J]
FFAC[1][J]=FFCN[J]
26 CONTINUE
return
# end
def CGAS17(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS18(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS19(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS20(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS21(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION XPEK(54),YPEK(54),XCOMH(54),YRAYH(54),YCOMH(54),YPAPH(54),FFRH(45),FFCH(45)
#
# ATOMIC HYDROGEN DATA FOR CASCADE CALCULATIONS SCALED TO
# MOLECULAR HYDROGEN
#
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/17*0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/17*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEK/6.41E6,2.18E6,1.93E4,8.10E3,5.31E3,2.86E3,765.,251.,96.6,41.9,26.7,19.7,14.4,11.4,2.93,1.11,.281,.105,.0491,.0263,.00982,.00456,.00113,4.18E-4,1.03E-4,3.82E-5,1.77E-5,9.46E-6,3.52E-6,1.64E-6,4.18E-7,1.61E-7,4.41E-8,1.86E-8,9.93E-9,6.16E-9,3.12E-9,1.96E-9,9.73E-10,6.20E-10,3.52E-10,2.44E-10,1.87E-10,1.51E-10,1.09E-10,8.50E-11,5.49E-11,4.06E-11,2.66E-11,1.98E-11,1.58E-11,1.31E-11,9.79E-12,7.81E-12/
DATA XPEK/13.598,20.,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL DATA TABLES A7(1970)565
DATA XCOMH/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YCOMH/9.552D-4,2.144D-3,3.802D-3,8.494D-3,1.496D-2,2.310D-2,3.279D-2,5.629D-2,8.424D-2,0.1650,.2478,.3822,.4675,.5187,.5503,.5840,.5993,.6095,.6068,.5924,.5759,.5597,.5444,.5166,.4923,.4435,.4064,.3535,.3168,.2893,.2676,.2351,.2114,.2092,.1890,.1718,.1466,.1448,.1153,.0962,.08308,.07343,.0660,.06007,.05522,.05116,.03786,.03039,.02212,.01758,.01467,.01264,.009972,.008276/
DATA YRAYH/.6650,.6635,.6617,.6569,.6503,.6421,.6323,.6087,.5806,.4984,.4142,.2764,.1881,.1341,.09987,.06126,.04121,.01943,.01119,.005062,.002866,.001840,.001280,7.211D-4,4.619D-4,2.054D-4,1.156D-4,5.138D-5,2.890D-5,1.850D-5,1.285D-5,7.226D-6,4.625D-6,4.428D-6,2.960D-6,2.056D-6,1.156D-6,1.107D-6,5.139D-7,2.891D-7,1.850D-7,1.285D-7,9.439D-8,7.227D-8,5.710D-8,4.625D-8,2.056D-8,1.156D-8,5.139D-9,2.890D-9,1.850D-9,1.284D-9,7.222D-10,4.620D-10/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPH/34*1.E-20,7.805D-6,4.385D-5,1.758D-4,1.895D-4,5.451D-4,9.849D-4,1.430D-3,1.859D-3,2.260D-3,2.634D-3,2.984D-3,3.308D-3,4.61D-3,5.61D-3,7.08D-3,8.13D-3,8.98D-3,9.65D-3,1.074D-2,1.161D-2/
# RAYLEIGH FORM FACTOR Hubbel
DATA FFRH/1.0,.9994,.9978,.9950,.9912,.9863,.9804,.9655,.9469,.8999,.8424,.8108,.7271,.6413,.5581,.4808,.3497,.2513,.1304,.07059,.04032,.02429,.01533,.01009,.006881,.002995,.001494,4.890D-4,2.035D-4,9.902D-5,5.373D-5,3.160D-5,1.300D-5,6.282D-6,3.395D-6,1.992D-6,8.168D-7,1.615D-7,5.112D-8,1.309D-9,1.998D-10,8.182D-11,8.182D-15,8.182D-27,8.182D-39/
# COMPTON FORM FACTOR Hubbel
DATA FFCH/1.E-20,.001105,.004410,.009888,.01749,.02717,.03883,.06773,.1033,.1902,.2904,.3426,.4713,.5887,.6885,.7689,.8777,.9369,.9830,.9950,.9984,.9994,.9998,.9999,.99995,.99999,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/
# HYDROGEN ATOMIC NUMBER
IZ[1]=1
AMZ[1]=2.015808
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
# PRSUM=PRSUM+PRSH[1][I][J]
# WRITE(6,888) I,PRSUM
# 888 print(' I=',I3,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
INIOCC[1][I]=INIOC[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
4 AUG[1][I][J][K]=A[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
5 AUG[1][I][J][K]=A[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
12 R[I][J]=R[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
13 RAD[1][I][J]=R[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
# LOAD PHOTOELECTRIC AND COMPTON DATA
DO 21 J=1,54
XPE[1][1][J]=math.log(XPEK[J])
# SCALED TO MOLECULAR HYDROGEN
YPE[1][1][J]=math.log(YPEK[J]*2.0*1.E-24)
21 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 22 J=1,54
XCP[1][J]=math.log(XCOMH[J])
YRY[1][J]=math.log(YRAYH[J]*2.0*1.E-24)
YCP[1][J]=math.log(YCOMH[J]*2.0*1.E-24)
YPP[1][J]=math.log(YPAPH[J]*2.0*1.E-24)
22 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 23 J=1,45
FFAR[1][J]=FFRH[J]
FFAC[1][J]=FFCH[J]
23 CONTINUE
return
# end
def CGAS22(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS23(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS24(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS25(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS26(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS27(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS28(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS29(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS30(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOCS(17),PRBSHS(17,17),ESS(17),RS(17,17),AS(17,17,17),PRBSHBTS(17)
DIMENSION INIOCF(17),PRBSHF(17,17),ESF(17),RF(17,17),AF(17,17,17),PRBSHBTF(17)
DIMENSION XPEKS(42),YPEKS(42),XPEL1S(53),YPEL1S(53),XPEL2S(54),YPEL2S(54),XPEL3S(54),YPEL3S(54),XPEM1S(60),YPEM1S(60),XPEM2S(60),YPEM2S(60),XPEM3S(60),YPEM3S(60),XCOMS(54),YRAYS(54),YCOMS(54),YPAPS(54),FFRS(45),FFCS(45)
DIMENSION XPEKF(45),YPEKF(45),XPEL1F(53),YPEL1F(53),XPEL2F(55),YPEL2F(55),XPEL3F(55),YPEL3F(55),XCOMF(54),YRAYF(54),YCOMF(54),YPAPF(54),FFRF(45),FFCF(45)
#
# SF6 DATA FOR CASCADE CALCULATIONS
#
# SULFUR DATA
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCS/2,2,2,4,2,2,2,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESS/19.0,7.5,7.5,7.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHS/0.001,0.38,0.69,1.37,3.16,7.50,7.33,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.022,.072,0.14,2.12,5.35,5.33,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.063,.055,0.22,2.21,5.64,5.57,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,.064,0.10,0.17,2.21,5.59,5.58,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,221*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTS/0.337,1.25,1.01,2.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/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA AS(1,2,2)/1.250/,AS(1,2,3)/1.384/,AS(1,2,4)/2.768/,AS(1,2,5)/0.252/,AS(1,3,3)/0.26/,AS(1,3,4)/6.55/,AS(1,3,5)/0.118/,AS(1,4,4)/3.72/,AS(1,4,5)/0.237/
# L1 SHELL RATE
DATA AS(2,3,5)/10.56/,AS(2,4,5)/21.1/,AS(2,5,5)/0.210/
# L3 SHELL RATE
DATA AS(4,5,5)/0.017/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA RS(1,2)/6.51D-10/,RS(1,3)/0.01276/,RS(1,4)/0.02527/,RS(1,5)/8.30D-11/,RS(1,6)/5.95D-4/,RS(1,7)/1.179D-3/
# L1 SHELL
DATA RS(2,3)/6.84D-6/,RS(2,4)/1.48D-5/,RS(2,5)/1.37D-14/,RS(2,6)/1.91D-5/,RS(2,7)/3.69D-5/
# L2 SHELL
DATA RS(3,4)/1.45D-14/,RS(3,5)/1.21D-5/,RS(3,6)/1.31D-15/,RS(3,7)/2.02D-9/
# L3 SHELL
DATA RS(4,5)/1.23D-5/,RS(4,6)/1.02D-9/,RS(4,7)/1.00D-9/
# M1 SHELL
DATA RS(5,6)/1.235D9/,RS(5,7)/1.2351D9/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKS/9.86D4,6.45'%.3f' %.07D4,1.69D4,1.03D4,4.58D3,2.41D3,7.32'%.3f' %.08D2,8.89'%.3f' %6.3,18.0,10.1,4.05,1.99,.546,.221,6.40D-2,2.78D-2,1.51D-2,9.45D-3,4.79D-3,2.98D-3,1.39D-3,8.59D-4,4.73D-4,3.21D-4,2.42D-4,1.94D-4,1.61D-4,1.38D-4,1.21D-4,1.07D-4,8.73D-5,6.84D-5,5.02D-5,3.27D-5,2.43D-5,1.93D-5,1.60D-5,1.19D-5,9.52D-6/
DATA XPEKS/2472.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.2D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# L1 SHELL 2S 1/2
DATA YPEL1S/4.06'%.3f' %.42D5,2.24D5,1.44D5,9.30D4,7.25D4,6.11D4,5.11D4,4.42D4,1.91D4,1.01D4,6.16'%.3f' %.88D3,1.90D3,1.07D3,6.63'%.3f' %.05D2,1.64D2,51.6,22.1,6.53,2.70,1.35,.761,.307,.151,.0419,.0170,4.94D-3,2.15D-3,1.17D-3,7.32D-4,3.71D-4,2.31D-4,1.07D-4,6.65D-5,3.66D-5,2.49D-5,1.87D-5,1.50D-5,1.25D-5,1.07D-5,9.34D-6,8.28D-6,6.76D-6,5.29D-6,3.88D-6,2.53D-6,1.88D-6,1.49D-6,1.24D-6,9.24D-7,7.37D-7/
DATA XPEL1S/230.9,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,2472.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.2D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# L2 SHELL 2P 1/2
DATA YPEL2S/1.70D6,1.48D6,7.45'%.3f' %.37D5,1.59D5,7.96D4,5.43D4,4.18'%.3f' %.18D4,2.60D4,7.52'%.3f' %.01D3,1.50D3,784.,292.,133.,69.3,24.3,10.6,2.30,.760,.156,5.05D-2,2.11D-2,1.03D-2,3.37D-3,1.43D-3,3.11D-4,1.09D-4,2.67D-5,1.05D-5,5.33D-6,3.14D-6,1.46D-6,8.41D-7,3.89D-7,2.42D-7,1.33D-7,9.07D-8,6.83D-8,5.47D-8,4.55D-8,3.89D-8,3.40D-8,3.02D-8,2.46D-8,1.93D-8,1.42D-8,9.24D-9,6.85D-9,5.44D-9,4.52D-9,3.37D-9,2.69D-9/
DATA XPEL2S/163.6,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,2472.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.2D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# L3 SHELL 2P 3/2
DATA YPEL3S/3.20D6,2.89D6,1.48D6,6.65'%.3f' %.13D5,1.56D5,1.07D5,8.19D4,6.23D4,5.10D4,1.47D4,5.86D3,2.91D3,1.52D3,564.,257.,133.,46.6,20.3,4.34,1.42,.288,9.20D-2,3.79D-2,1.84D-2,5.89D-3,2.45D-3,5.16D-4,1.78D-4,4.29D-5,1.70D-5,8.72D-6,5.29D-6,2.58D-6,1.58D-6,7.30D-7,4.54D-7,2.50D-7,1.70D-7,1.28D-7,1.03D-7,8.54D-8,7.30D-8,6.38D-8,5.66D-8,4.62D-8,3.62D-8,2.66D-8,1.73D-8,1.29D-8,1.02D-8,8.47D-9,6.32D-9,5.04D-9/
DATA XPEL3S/162.5,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,2472.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.2D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# M1 SHELL 3S 1/2
DATA YPEM1S/1.60D6,1.59D6,1.21D6,9.98D5,5.23D5,2.82D5,1.62D5,1.33D5,9.84D4,5.03D4,2.77D4,1.62D4,1.01D4,7.75D3,6.47D3,5.36D3,4.65D3,1.96D3,1024.,624.,392.,192.,108.,67.1,30.9,16.7,5.24,2.26,.666,.276,.138,.0778,.0314,.0155,4.29D-3,1.74D-3,5.06D-4,2.20D-4,1.20D-4,7.50D-5,3.80D-5,2.36D-5,1.10D-5,6.82D-6,3.75D-6,2.55D-6,1.92D-6,1.54D-6,1.28D-6,1.10D-6,8.50D-7,6.93D-7,5.43D-7,3.98D-7,2.60D-7,1.93D-7,1.53D-7,1.27D-7,9.48D-8,7.56D-8/
DATA XPEM1S/22.0,25.0,30.0,40.0,70.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,2472.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,1.0D7,1.2D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# M2 SHELL 3P 1/2
DATA YPEM2S/1.30D6,1.27D6,1.76D6,1.34D6,1.11D6,5.81'%.3f' %.13D5,1.80D5,1.44D5,1.01D5,4.39D4,2.01D4,9.84D3,5.13'%.3f' %.55D3,2.76D3,2.13D3,1.16'%.3f' %48.,142.,71.8,38.0,14.4,6.60,3.46,1.22,5.39,.117,.0389,8.03D-3,2.60D-3,1.09D-3,5.33D-4,1.74D-4,7.39D-5,1.60D-5,5.63D-6,1.48D-6,5.40D-7,2.73D-7,1.61D-7,7.43D-8,4.29D-8,1.99D-8,1.24D-8,6.80D-9,4.62D-9,3.48D-9,2.79D-9,2.32D-9,1.99D-9,1.54D-9,1.26D-9,9.84D-10,7.22D-10,4.71D-10,3.49D-10,2.30D-10,1.72D-10,1.37D-10/
DATA XPEM2S/16.0,20.0,25.0,30.0,40.0,70.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,2472.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,1.0D7,1.2D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,6.0D7,8.0D7,1.0D8/
# M3 SHELL 3P 3/2
DATA YPEM3S/2.60D6,2.54'%.3f' %.52D6,2.68D6,2.21D6,1.16D6,6.25'%.3f' %.59D5,2.87D5,2.01D5,8.70'%.3f' %.97D4,1.94D4,1.01D4,6.98D3,5.15'%.3f' %.750D3,2.28D3,680.,277.,140.,73.7,27.7,12.7,6.64,2.34,1.02,.220,.0725,.0148,4.72D-3,1.95D-3,9.45D-4,3.03D-4,1.27D-4,2.67D-5,9.18D-6,2.22D-6,8.78D-7,4.54D-7,2.75D-7,1.35D-7,8.26D-8,3.83D-8,2.38D-8,1.31D-8,8.91D-9,6.71D-9,5.37D-9,4.47D-9,3.83D-9,2.97D-9,2.42D-9,1.90D-9,1.39D-9,9.07D-10,6.73D-10,4.44D-10,3.31D-10,2.64D-10/
DATA XPEM3S/15.67,20.0,25.0,30.0,40.0,70.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,2472.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,1.0D7,1.2D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,6.0D7,8.0D7,1.0D8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XCOMS/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYS/170.2,170.0,169.7,169.0,168.0,166.7,165.1,161.4,156.9,143.5,129.2,103.8,85.21,72.06,62.38,48.50,38.49,22.90,15.02,8.049,5.082,3.503,2.554,1.523,1.009,.4698,.2700,.1222,.06924,.04447,.03094,.01744,.01117,.01070,7.153D-3,4.969D-3,2.796D-3,2.677D-3,1.243D-3,6.992D-4,4.475D-4,3.108D-4,2.283D-4,1.748D-4,1.381D-4,1.119D-4,4.972D-5,2.797D-5,1.243D-5,6.992D-6,4.475D-6,3.108D-6,1.748D-6,1.119D-6/
DATA YCOMS/6.17D-3,1.402D-2,2.485D-2,5.543D-2,9.741D-2,.150,.2124,.3623,.5383,1.039,1.553,2.469,3.196,3.766,4.231,4.983,5.592,6.677,7.306,7.874,8.065,8.099,8.053,7.848,7.590,6.956,6.421,5.618,5.047,4.615,4.273,3.757,3.379,3.343,3.022,2.747,2.345,2.316,1.845,1.539,1.329,1.175,1.056,.9610,.8834,.8185,.6058,.4862,.3540,.2813,.2348,.2023,.1595,.1324/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPS/34*1.E-20,2.188D-3,1.177D-2,4.614D-2,4.973D-2,.1313,.2134,.2871,.3537,.4132,.4669,.5157,.5601,.7341,.8602,1.037,1.161,1.252,1.325,1.432,1.509/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRS/1.0,.99962,.99862,.99700,.99463,.99162,.98800,.97900,.96769,.93919,.90462,.88575,.83612,.78588,.73781,.69369,.61976,.56428,.49048,.43821,.39011,.34307,.29846,.25789,.22239,.15750,.12050,.087775,.073556,.063131,.052706,.044881,.029237,.019362,.013112,.010256,4.537D-3,1.141D-3,3.982D-4,1.208D-5,1.991D-6,8.514D-7,2.342D-10,1.78D-19,1.96D-28/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCS/1.7D-21,4.37D-4,1.812D-3,4.04D-3,7.1375D-3,.011062,.015787,.027425,.041625,.075794,.11446,.13444,.18373,.23000,.27216,.31000,.37400,.42469,.50012,.56000,.61431,.66412,.70850,.74700,.77950,.83837,.87438,.91506,.94069,.95944,.97294,.98225,.99250,.99675,.99856,.99931,.99981,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# SULFUR ATOMIC NUMBER
IZ[1]=16
AMZ[1]=32.065
#
# ATOMIC FLOURINE DATA FOR CASCADE CALCULATIONS
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCF/2,2,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESF/14.0,2.5,2.5,2.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHF/0.08,2.00,6.00,8.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.20,1.20,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.40,1.00,2.50,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.40,1.20,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,221*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTF/1.29,5.5,7.0,11.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
# DATA AF(1,2,2)/0.838/,AF(1,2,3)/0.816/,AF(1,3,3)/0.377/
# DATA AF(1,2,4)/0.216/,AF(1,3,4)/0.104/
DATA AF(1,2,2)/0.838/,AF(1,2,3)/0.816/,AF(1,3,3)/0.754/
DATA AF(1,2,4)/1.224/,AF(1,3,4)/2.262/,AF(1,4,4)/2.262/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA RF(1,2)/1.17D-12/,RF(1,3)/5.88D-4/,RF(1,4)/1.17D-3/
# L1 SHELL
DATA RF(2,3)/1.27D-6/,RF(2,4)/2.57D-6/
# L2 SHELL
DATA RF(3,4)/1.69D-18/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKF/4.3'%.3f' %.20D5,2.53D5,2.02D5,1.68D5,5.89D4,2.70D4,8.58'%.3f' %.72D3,1.92D3,1.11D3,462.,232.,65.2,26.1,7.07,2.77,1.34,.734,.285,.137,.0364,.0144,.00409,.00176,9.47D-4,5.90D-4,2.98D-4,1.85D-4,8.73D-5,5.48D-5,3.06D-5,2.09D-5,1.59D-5,1.28D-5,9.13D-6,7.11D-6,5.99D-6,3.36D-6,2.19D-6,1.63D-6,1.30D-6,1.08D-6,8.03D-7,6.41D-7/
DATA XPEKF/685.4,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,8.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# L1 SHELL 2S 1/2
DATA YPEL1F/3.70D6,6.60D5,4.17'%.3f' %.46D5,2.56D5,1.26D5,6.41'%.3f' %.46D4,1.97D4,1.44D4,1.16D4,9.24D3,7.76D3,2.80D3,1.32D3,438.,194.,102.,59.7,25.2,12.8,3.64,1.47,.402,.158,.0765,.0421,.0164,.00789,.00210,8.35D-4,2.37D-4,1.02D-4,5.48D-5,3.41D-5,1.72D-5,1.07D-5,5.06D-6,3.18D-6,1.77D-6,1.21D-6,9.20D-7,7.39D-7,5.29D-7,4.12D-7,2.64D-7,1.95D-7,1.27D-7,9.45D-8,7.51D-8,6.24D-8,4.66D-8,3.71D-8/
DATA XPEL1F/34.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,8.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# L2 SHELL 2P 1/2
DATA YPEL2F/1.0D7,1.00'%.3f' %.2D6,6.93'%.3f' %.73D5,2.65D5,1.59D5,4.99D4,1.78D4,7.22'%.3f' %.19D3,2.03D3,1.50D3,1.09D3,860.,212.,75.7,17.0,5.71,2.40,1.17,.375,.154,.0300,.00931,.00177,5.46D-4,2.19D-4,1.05D-4,3.29D-5,1.36D-5,2.82D-6,9.63D-7,2.29D-7,8.82D-8,4.40D-8,2.58D-8,1.18D-8,6.74D-9,2.75D-9,1.73D-9,9.63D-10,6.60D-10,5.00D-10,4.02D-10,2.88D-10,2.24D-10,1.44D-10,1.06D-10,6.91D-11,5.14D-11,4.08D-11,3.39D-11,2.53D-11,2.02D-11/
DATA XPEL2F/16.0,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,8.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# L3 SHELL 2P 3/2
DATA YPEL3F/2.0D7,2.0D7,6.4D6,1.39D6,7.43D5,5.30'%.3f' %.18D5,9.98'%.3f' %.57D4,1.43D4,6.32D3,4.03D3,2.97D3,2.16D3,1.70D3,419.,149.,33.5,11.2,4.71,2.30,.731,.298,.0578,.0178,.00335,.00102,4.07D-4,1.92D-4,5.95D-5,2.42D-5,4.90D-6,1.65D-6,3.91D-7,1.53D-7,7.86D-8,4.75D-8,2.33D-8,1.43D-8,6.69D-9,4.20D-9,2.34D-9,1.60D-9,1.22D-9,9.77D-10,7.00D-10,5.44D-10,3.50D-10,2.57D-10,1.68D-10,1.25D-10,9.93D-11,8.25D-11,6.16D-11,4.91D-11/
DATA XPEL3F/16.0,25.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.5D6,2.0'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,8.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
DATA XCOMF/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYF/53.87,53.82,53.77,53.62,53.42,53.16,52.85,52.07,51.11,48.01,44.27,36.25,29.02,23.25,18.86,13.07,9.647,5.470,3.611,1.921, 1.181,.7966,.5731,.3370,.2212,.1013,.05764,.02585,.01459,.009349, 6.498D-3,3.658D-3,2.342D-3,2.242D-3,1.499D-3,1.041D-3,5.858D-4,5.609D-4,2.604D-4,1.465D-4,9.374D-5,6.510D-5,4.783D-5,3.662D-5,2.893D-5,2.344D-5,1.046D-5,5.883D-6,2.614D-6,1.471D-6,9.412D-7,6.535D-7,3.677D-7,2.353D-7/
DATA YCOMF/1.935D-3,4.736D-3,8.533D-3,.01925,.03410,.05298,.07579,.1325,.2029,.4270, .6987,1.293,1.861,2.354,2.762,3.353,3.735,4.257,4.524,4.760,4.808,4.775,4.706,4.533,4.354,3.955,3.637,3.172,2.846,2.600,2.406,2.115,1.902,1.882,1.701,1.546,1.319,1.303,1.038,.8658,.7477,.6609,.5940,.5406,.4969,.4604,.3408,.2735,.1991,.1582, .1321,.1138,.08974,.07449/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPF/34*1.E-20,6.506D-4,3.60D-3,.01434,.01546,.04137,.06799,.09219,.1141,.1339,.1518,.1680,.1829,.2403,.2830,.3451,.3893, .4199,.4463,.4852,.5119/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRF/1.0,.99973,.99910,.9981,.9967,.9948,.9926,.9868,.9794,.9604,.9362,.9223,.8833,.8398,.7931,.7451,.6497,.5611,.4172,.3189,.2562,.2172,.1926,.1762,.1646,.1430,.1243,.08978,.06246,.04616,.02986,.02354,.01091,.006078,.003611,.002744,.001011,2.268D-4,7.432D-5,2.042D-6, 3.244D-7,1.362D-7,2.758D-11,1.59D-20,1.63D-29/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCF/1.1D-21,2.22D-4,.00111,.002489,.004411,.006878,.009867,.01739,.02689,.05122,.08166,.09867,.1453,.1957,.2474,.2990,.3966,.4830,.6169,.7043,.7591,.7946,.8196,.8391,.8559,.8916,.9209,.9609,.9816,.9914,.99590,.99800,.99946,.99983,.99994,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# FLOURINE ATOMIC NUMBER
IZ[2]=9
AMZ[2]=113.9904
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBTS[I]/100.0
PRSHBT[2][I]=PRBSHBTF[I]/100.0
DO 1 J=1,17
PRBSHS[I][J]=PRBSHS[I][J]/100.0
PRBSHF[I][J]=PRBSHF[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUMS=0.0
PRSUMF=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSHS[J][I]
PRSH[2][I][J]=PRBSHF[J][I]
# PRSUMF=PRSUMF+PRSH[2][I][J]
# PRSUMS=PRSUMS+PRSH[1][I][J]
# WRITE(6,888) I,PRSUMS,PRSUMF
# 888 print(' I=',I3,' PRSUMS=','%.3f' %,' PRSUMF=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ESS[I]
ESH[2][I]=ESF[I]
INIOCC[1][I]=INIOCS[I]
INIOCC[2][I]=INIOCF[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
AUG[1][I][J][K]=AS[I][J][K]*0.0272105
4 AUG[2][I][J][K]=AF[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
AUG[1][I][J][K]=AS[I][J][K]*0.00272105
5 AUG[2][I][J][K]=AF[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
RS[I][J]=RS[I][J]*6.582119D-16
12 RF[I][J]=RF[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
RAD[1][I][J]=RS[I][J]
13 RAD[2][I][J]=RF[I][J]
#
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD SULFUR PHOTOELECTRIC DATA
DO 21 J=1,42
XPE[1][1][J]=math.log(XPEKS[J])
YPE[1][1][J]=math.log(YPEKS[J]*1.E-24)
21 CONTINUE
DO 22 J=1,53
XPE[1][2][J]=math.log(XPEL1S[J])
YPE[1][2][J]=math.log(YPEL1S[J]*1.E-24)
22 CONTINUE
DO 23 J=1,54
XPE[1][3][J]=math.log(XPEL2S[J])
YPE[1][3][J]=math.log(YPEL2S[J]*1.E-24)
XPE[1][4][J]=math.log(XPEL3S[J])
YPE[1][4][J]=math.log(YPEL3S[J]*1.E-24)
23 CONTINUE
DO 231 J=1,60
XPE[1][5][J]=math.log(XPEM1S[J])
YPE[1][5][J]=math.log(YPEM1S[J]*1.E-24)
XPE[1][6][J]=math.log(XPEM2S[J])
YPE[1][6][J]=math.log(YPEM2S[J]*1.E-24)
XPE[1][7][J]=math.log(XPEM3S[J])
YPE[1][7][J]=math.log(YPEM3S[J]*1.E-24)
231 CONTINUE
# LOAD FLUORINE PHOTOELECTRIC DATA
# SCALE BY 6 SINCE 6 ATOMS PER SULFUR
DO 24 J=1,45
XPE[2][1][J]=math.log(XPEKF[J])
YPE[2][1][J]=math.log(YPEKF[J]*6.0*1.E-24)
24 CONTINUE
DO 25 J=1,53
XPE[2][2][J]=math.log(XPEL1F[J])
YPE[2][2][J]=math.log(YPEL1F[J]*6.0*1.E-24)
25 CONTINUE
DO 26 J=1,55
XPE[2][3][J]=math.log(XPEL2F[J])
YPE[2][3][J]=math.log(YPEL2F[J]*6.0*1.E-24)
26 CONTINUE
DO 27 J=1,55
XPE[2][4][J]=math.log(XPEL3F[J])
YPE[2][4][J]=math.log(YPEL3F[J]*6.0*1.E-24)
27 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 28 J=1,54
XCP[1][J]=math.log(XCOMS[J])
XCP[2][J]=math.log(XCOMF[J])
YRY[1][J]=math.log(YRAYS[J]*1.E-24)
YRY[2][J]=math.log(YRAYF[J]*6.0*1.E-24)
YCP[1][J]=math.log(YCOMS[J]*1.E-24)
YCP[2][J]=math.log(YCOMF[J]*6.0*1.E-24)
YPP[1][J]=math.log(YPAPS[J]*1.E-24)
YPP[2][J]=math.log(YPAPF[J]*6.0*1.E-24)
28 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTOR
DO 29 J=1,45
FFAR[1][J]=FFRS[J]
FFAR[2][J]=FFRF[J]
FFAC[1][J]=FFCS[J]
FFAC[2][J]=FFCF[J]
29 CONTINUE
return
# end
def CGAS31(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS32(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS33(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS34(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS35(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS36(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS37(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS38(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS39(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS40(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS41(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS42(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS43(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS44(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
DIMENSION INIOC(17),PRBSH(17,17),ES(17),R(17,17),A[17,17,17],PRBSHBT(17)
DIMENSION INIOCN(17),PRBSHN(17,17),ESN(17),RN(17,17),AN(17,17,17),PRBSHBTN(17)
DIMENSION INIOCH(17),PRBSHH(17,17),ESHH(17),RH(17,17),AH(17,17,17),PRBSHBTH(17)
DIMENSION XPEK(49),YPEK(49),XPEL1(54),YPEL1(54),XPEL2(54),YPEL2(54),XCOMC(54),YRAYC(54),YCOMC(54),YPAPC(54),FFRC(45),FFCC(45)
DIMENSION XPEKN(47),YPEKN(47),XPEL1N(53),YPEL1N(53),XPEL2N(55),YPEL2N(55),XPEL3N(55),YPEL3N(55),XCOMN(54),YRAYN(54),YCOMN(54),YPAPN(54),FFRN(45),FFCN(45)
DIMENSION XPEKH(54),YPEKH(54),XCOMH(54),YRAYH(54),YCOMH(54),YPAPH(54),FFRH(45),FFCH(45)
#
# TRIMETHYL AMINE TMA
# C3NH9 DATA FOR CASCADE CALCULATIONS
#
# CARBON DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOC/2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ES/10.00,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSH/0.20,3.00,9.00,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.80,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,238*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBT/2.74,12.0,12.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA A[1][2][2]/0.858/,A[1][2][3]/0.824/,A[1][3][3]/0.378/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA R(1,2)/1.50E-14/,R(1,3)/3.45E-5/,R(1,4)/6.88E-5/
# L1 SHELL
DATA R(2,3)/1.20E-7/,R(2,4)/2.41E-7/
# L2 SHELL
DATA R(3,4)/1.55E-21/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEK/9.26E5,7.98E5,4.81E5,2.35E5,1.21E5,8.42E4,6.57E4,5.09E4,4.20E4,1.33E4,5.73E3,1.70E3,707.,354.,200.,80.4,39.3,10.6,4.12,1.08,.415,.197,.107,.0411,.0195,.00512,.00201,5.64E-4,2.41E-4,1.29E-4,8.05E-5,4.06E-5,2.52E-5,1.19E-5,7.51E-6,4.21E-6,2.90E-6,2.20E-6,1.77E-6,1.27E-6,9.93E-7,6.39E-7,4.71E-7,3.08E-7,2.29E-7,1.82E-7,1.51E-7,1.13E-7,9.01E-8/
DATA XPEK/285.0,300.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1/1.35E7,1.50E6,4.00E5,2.21E5,1.70E5,1.14E5,4.58E4,2.07E4,1.02E4,5.34E3,3.76E3,2.97E3,2.32E3,1.93E3,635.,280.,85.1,35.7,18.0,10.3,4.16,2.05,.554,.217,.0571,.0220,.0105,.00570,.00218,.00104, 2.72E-4,1.07E-4,3.00E-5,1.28E-5,6.88E-6,4.28E-6,2.16E-6,1.34E-6,6.37E-7,4.02E-7,2.26E-7,1.55E-7,1.18E-7,9.49E-8,6.82E-8,5.32E-8,3.42E-8,2.52E-8,1.65E-8,1.23E-8,9.75E-9,8.10E-9,6.05E-9,4.82E-9/
DATA XPEL1/18.0,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2/1.35E7,9.0E5,1.50E5,7.81E4,5.15E4,2.79E4,7.59E3,2.49E3,924.,383.,239.,173.,124.,94.6,20.7,6.75,1.36,.432,.176,.0841, .0259,.0103,.00189,5.64E-4,1.02E-4,3.06E-5,1.20E-5,5.63E-6,1.72E-6,6.96E-7,1.40E-7,4.69E-8,1.10E-8,4.26E-9,2.16E-9,1.29E-9,6.20E-10,3.76E-10,1.82E-10,1.15E-10,6.45E-11,4.44E-11,3.37E-11,2.71E-11,1.95E-11,1.52E-11,9.77E-12,7.20E-12,4.71E-12,3.50E-12,2.79E-12,2.31E-12,1.73E-12,1.38E-12/
DATA XPEL2/6.40,50.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
DATA XCOMC/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYC/23.94,23.90,24.85,23.72,23.53,23.31,23.03,22.37,21.52,19.12,16.59,12.22,9.179,7.170,5.819,4.181,3.232,1.952,1.292,.6711, .4079,.2734,.1956,.1139,.07418,.03360,.01903,8.504D-3,4.792D-3, 3.070D-3, 2.133D-3,1.200D-3,7.682D-4,7.355D-4,4.917D-4,3.415D-4,1.921D-4,1.839D-4,8.539D-5,4.803D-5,3.074D-5,2.135D-5,1.568D-5,1.201D-5,9.488D-6,7.685D-6,3.415D-6,1.921D-6,8.537D-7,4.802D-7,3.073D-7,2.134D-7,1.200D-7,7.682D-8/
DATA YCOMC/3.044D-3,6.469D-3,.01140,.02518,.04448,.06870,.09764, .1680,.2519,.5001, .7702,1.278,1.685,1.984,2.202,2.497,2.697,3.012,3.182,3.300,3.296,3.250,3.188,3.054,2.924,2.647,2.431,2.118,1.899,1.735,1.605,1.410,1.268,1.255,1.134,1.031,.8795,.8687,.6920,.5772,.4985,.4406,.3960,.3604,.3313,.3069,.2272,.1823,.1327,.1055, .08805,.07586,.05983,.04966/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPC/34*1.E-20,2.870D-4,1.594D-3,6.356D-3,6.852D-3,.01844, .03054, .04163,.05178,.06095,.06928,.07690,.08388,.1108,.1310,.1597,.1802,.1958,.2080,.2263,.2401/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRC/1.0,.99957,.99830,.9962,.9932,.9895,.9848,.9735,.9590,.9228,.8783,.8538,.7902,.7218,.6562,.5962,.4935,.4170,.3252,.2810,.2558,.2375,.2202,.2027,.1853,.1441,.1094,.0620,.03577,.02147,.01341,.008705,.004055,.002108,.001191,7.198D-4,3.06D-4,6.295D-5, 2.027D-5,5.398D-7,8.455D-8,3.52D-8,5.993D-12,2.767D-21,2.80D-30/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCC/1.7D-21,6.317D-4,.002165,.004922,.008607,.01341,.01928,.03358,.05143,.0948,.1459,.1732,.2413,.3110,.3755,.4340,.5330,.6072,.6973,.7463,.7817,.8130,.8418,.8680,.8913,.9358,.9635,.9883,.9962,.9987,.99947,.99977,.99995,.99998,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# CARBON ATOMIC NUMBER
IZ[1]=6
AMZ[1]=36.0321
#
# ATOMIC NITROGEN DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCN/2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESN/11.00,2.0,2.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/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHN/0.12,2.50,8.00,4.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.30,2.00,1.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,1.00,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.50,2.00,0.50,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,221*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTN/2.2,6.0,8.0,10.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0/
#
# AUGER AND COSTER-KRONIG TRANSITION RATES FOR K AND L SHELLS
# WALTERS AND BHALLA (1971)
# K SHELL RATE (MILLIATOMIC UNITS) TO GET TO EV *0.0272105
DATA AN(1,2,2)/0.842/,AN(1,2,3)/0.828/,AN(1,3,3)/0.380/
DATA AN(1,2,4)/0.072/,AN(1,3,4)/0.035/
# RADIATIVE TRANSITIONS SCOFIELD ANDT 14(1974)121
# DIPOLE AND HIGHER MULTIPOLES , RELATIVISTIC CALC. UNITS 1.519E15/SEC
# K-SHELL
DATA RN(1,2)/8.04E-14/,RN(1,3)/1.104E-4/,RN(1,4)/2.201E-4/
# L1 SHELL
DATA RN(2,3)/3.09E-7/,RN(2,4)/6.23E-7/
# L2 SHELL
DATA RN(3,4)/2.65E-20/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKN/7.0E5,3.78E5,2.03E5,1.43E5,1.13E5,8.83E5,7.32E4,2.39E4,1.05E4,3.20E3,1.35E3,681.,388.,158.,78.2,21.3,8.39,2.22,.861,.411,.225,.0863,.0412,.0108,.00428,.00120,5.14E-4,2.77E-4,1.72E-4,8.69E-5,5.40E-5,2.55E-5,1.61E-5,8.99E-6,6.18E-6,4.69E-6,3.77E-6,2.71E-6,2.11E-6,1.36E-6,9.99E-7,6.54E-7,4.86E-7,3.86E-7,3.21E-7,2.39E-7,1.91E-7/
DATA XPEKN/401.6,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L1 SHELL 2S 1/2
DATA YPEL1N/4.50E6,4.80E5,2.98E5,2.35E5,1.63E5,7.04E4,3.31E4,1.68E4,9.06E3,6.45E3,5.12E3,4.03E3,3.38E3,1.15E3,522.,164.,70.0,35.8,20.6,8.46,
.4.21,1.16,.459,.122,.0475,.0227,.0124,.00478,.00229,6.02E-4,2.37E-4,6.68E-5,2.86E-5,1.54E-5,9.57E-6,4.83E-6,3.00E-6,1.42E-6,8.94E-7,5.01E-7,3.44E-7,2.61E-7,2.10E-7,1.51E-7,1.17E-7,7.55E-8,5.56E-8,3.64E-8,2.70E-8,2.15E-8,1.79E-8,1.33E-8,1.06E-8/
DATA XPEL1N/24.4,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L2 SHELL 2P 1/2
DATA YPEL2N/3.20E6,4.00E6,4.00E6,1.8E5,8.45E4,5.70E4,3.19E4,8.90E3,2.95E3,1.14E3,482.,301.,220.,160.,124.,28.4,9.73,2.02,.647,.266,.128,.0402,.0162,.00306,9.27E-4,1.72E-4,5.20E-5,2.07E-5,9.78E-6,3.03E-6,1.24E-6,2.55E-7,8.63E-8,2.03E-8,7.78E-9,3.88E-9,2.25E-9,1.02E-9,5.85E-10,2.44E-10,1.54E-10,8.60E-11,5.91E-11,4.49E-11,3.61E-11,2.59E-11,2.02E-11,1.30E-11,9.56E-12,6.25E-12,4.65E-12,3.70E-12,3.07E-12,2.29E-12,1.83E-12/
DATA XPEL2N/14.534,20.0,25.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# L3 SHELL 2P 3/2
DATA YPEL3N/6.40E6,8.00E6,8.00E6,3.6E5,1.68E5,1.14E5,6.38E4,1.78E4,5.90E3,2.29E3,964.,603.,440.,319.,246.,56.4,19.3,4.00,1.28,.524,.252,.0787,.0317,.00593,.00179,3.27E-4,9.82E-5,3.87E-5,1.82E-5,5.55E-6,2.25E-6,4.50E-7,1.51E-7,3.54E-8,1.39E-8,7.10E-9,4.32E-9,2.12E-9,1.31E-9,6.29E-10,3.96E-10,2.22E-10,1.52E-10,1.16E-10,9.31E-11,6.68E-11,5.20E-11,3.34E-11,2.46E-11,1.61E-11,1.20E-11,9.53E-12,7.91E-12,5.91E-12,4.71E-12/
DATA XPEL3N/14.524,20.0,25.0,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XCOMN/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YRAYN/32.55,32.51,32.47,32.34,32.15,31.91,31.62,30.90,30.03,27.34,24.32,18.61,14.21,11.10,8.927,6.246,4.722,2.805,1.870,.9839, .6009,.4042,.2901,.1697,.1109,.05046,.02863,.01281,.007221, .004626, 3.215D-3,1.809D-3,1.158D-3,1.109D-3,7.414D-4,5.149D-4,2.897D-4,2.773D-4,1.287D-4,7.243D-5,4.635D-5,3.219D-5,2.365D-5,1.811D-5,1.431D-5,1.159D-5,5.164D-6,2.905D-6,1.291D-6,7.263D-7,4.648D-7,3.227D-7,1.816D-7,1.162D-7/
DATA YCOMN/2.698D-3,6.260D-3,.01180,.02508,.04428,.06856,.09770, .1692,.2560,.5198, .8165,1.392,1.866,2.225,2.494,2.858,3.093,3.449,3.645,3.800,3.811,3.766,3.700,3.551,3.403,3.085,2.834,2.470,2.215,2.023,1.872,1.645,1.479,1.464,1.323,1.202,1.026,1.013,.8073,.6734,.5815,.5140,.4620,.4205,.3865,.3581,.2650,.2127,.1549,.1231, .1027,.08851,.06980,.05793/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPN/34*1.E-20,3.931D-4,2.177D-3,8.667D-3,9.343D-3,.02507,.04138, .05628,.06989,.08213,.09326,.1034,.1127,.1487,.1753,.2138,.2397, .2609,.2763,.3012,.3193/
# NORMALISED RAYLEIGH FORM FACTOR Hubbel
DATA FFRN/1.0,.99911,.99814,.9970,.9947,.9919,.9897,.9793,.9680,.9391,.9031,.8834,.8280,.7696,.7099,.6514,.5464,.4597,.3420,.2769,.2421,.2217,.2066,.1931,.1803,.1307,.1197,.07481,.0462,.0325,.01881,.01457,.006071,.003214,.001871,.001443,5.857D-4,1.087D-4,3.519D-5,9.463D-7,1.490D-7,6.217D-8,1.127D-11,5.67D-21,5.77D-30/
# NORMALISED COMPTON FORM FACTOR Hubbel
DATA FFCN/1.4D-21,4.3D-4,.00186,.00417,.00739,.01149,.01644,.02881,.04429,.08257,.1292,.1543,.2200,.2861,.3496,.4083,.5084,.5853,.6846,.7403,.7767,.8050,.8299,.8526,.8733,.9166,.9471,.9800,.9924,.9970,.99876,.99943,.99987,.99997,.99999,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0/
# NITROGEN ATOMIC NUMBER
IZ[2]=7
AMZ[2]=14.0067
#
# ATOMIC HYDROGEN DATA
#
# LEVEL OCCUPANCY FOR GROUND STATE
DATA INIOCH/1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/
# AVERAGE SHAKE OFF ELECTRON ENERGY
DATA ESHH/17*0.0/
# SHAKE OFF DATA : CARLSON AND NESTOR PHYS REV A8(1973)2887
# % PROBABILITY OF J SHELL SHAKE OFF FROM VACANCY IN SHELL I PROBSH[I][J]
DATA PRBSHH/289*0.0/
# SHAKE OFF DATA : CARLSON,NESTOR ET AL PHYS REV 169(1968)27
# % PROBABILITY OF J SHELL SHAKE OFF FROM BETA DECAY PRSHBT[J]
DATA PRBSHBTH/17*0.0/
#
# PHOTOELECTRIC ABSORPTION X-SECTIONS FOR EACH SHELL:
# UNITS BARNS/ATOM AND ENERGIES IN EV
# ASSEMBLED FROM: BAND ET AL. ANDT 23(1979)443
# : SCOFIELD UCRL-51326
# : VIEGELE ATOMIC DATA 5(1973)50
# K SHELL 1S 1/2
DATA YPEKH/6.41E6,2.18E6,1.93E4,8.10E3,5.31E3,2.86E3,765.,251.,96.6,41.9,26.7,19.7,14.4,11.4,2.93,1.11,.281,.105,.0491,.0263,.00982,.00456,.00113,4.18E-4,1.03E-4,3.82E-5,1.77E-5,9.46E-6,3.52E-6,1.64E-6,4.18E-7,1.61E-7,4.41E-8,1.86E-8,9.93E-9,6.16E-9,3.12E-9,1.96E-9,9.73E-10,6.20E-10,3.52E-10,2.44E-10,1.87E-10,1.51E-10,1.09E-10,8.50E-11,5.49E-11,4.06E-11,2.66E-11,1.98E-11,1.58E-11,1.31E-11,9.79E-12,7.81E-12/
DATA XPEKH/13.598,20.,100.,132.3,151.4,184.,278.,392.,525.,676.5,775.,849.,932.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0E4,1.5E4,2.0E4,3.0E4,4.0E4,5.0E4,6.0E4,8.0E4,1.0E5,1.5E5,2.0E5,3.0E5,4.0E5,5.0E5,6.0E5,8.0E5,1.0E6,1.5E6,2.0E6,3.0E6,4.0E6,5.0E6,6.0E6,8.0E6,1.0E7,1.5E7,2.0E7,3.0E7,4.0E7,5.0E7,6.0E7,8.0E7,1.0E8/
# RAYLEIGH COMPTON AND PAIR PRODUCTION DATA
# HUBBEL J.PHYS.CHEM.REF.DATA 4(1975)471
# HUBBEL NIST XCOM WEB SITE
# STORM AND ISRAEL NUCL.DATA TABLES A7(1970)565
DATA XCOMH/100.,150.,200.,300.,400.,500.,600.,800.,1000.,1500.,2000.,3000.,4000.,5000.,6000.,8000.,1.0D4,1.5D4,2.0'%.3f' %.0D4,4.0D4,5.0D4,6.0D4,8.0D4,1.0D5,1.5D5,2.0'%.3f' %.0D5,4.0D5,5.0D5,6.0D5,8.0D5,1.0D6,1.022D6,1.25D6,1.5D6,2.0D6,2.044'%.3f' %.0D6,4.0D6,5.0D6,6.0D6,7.0D6,8.0D6,9.0D6,1.0D7,1.5D7,2.0'%.3f' %.0D7,4.0D7,5.0D7,6.0D7,8.0D7,1.0D8/
DATA YCOMH/9.552D-4,2.144D-3,3.802D-3,8.494D-3,1.496D-2,2.310D-2,3.279D-2,5.629D-2,8.424D-2,0.1650,.2478,.3822,.4675,.5187,.5503,.5840,.5993,.6095,.6068,.5924,.5759,.5597,.5444,.5166,.4923,.4435,.4064,.3535,.3168,.2893,.2676,.2351,.2114,.2092,.1890,.1718,.1466,.1448,.1153,.0962,.08308,.07343,.0660,.06007,.05522,.05116,.03786,.03039,.02212,.01758,.01467,.01264,.009972,.008276/
DATA YRAYH/.6650,.6635,.6617,.6569,.6503,.6421,.6323,.6087,.5806,.4984,.4142,.2764,.1881,.1341,.09987,.06126,.04121,.01943,.01119,.005062,.002866,.001840,.001280,7.211D-4,4.619D-4,2.054D-4,1.156D-4,5.138D-5,2.890D-5,1.850D-5,1.285D-5,7.226D-6,4.625D-6,4.428D-6,2.960D-6,2.056D-6,1.156D-6,1.107D-6,5.139D-7,2.891D-7,1.850D-7,1.285D-7,9.439D-8,7.227D-8,5.710D-8,4.625D-8,2.056D-8,1.156D-8,5.139D-9,2.890D-9,1.850D-9,1.284D-9,7.222D-10,4.620D-10/
# TOTAL PAIR PRODUCTION NUCLEAR + ELECTRON
DATA YPAPH/34*1.E-20,7.805D-6,4.385D-5,1.758D-4,1.895D-4,5.451D-4,9.849D-4,1.430D-3,1.859D-3,2.260D-3,2.634D-3,2.984D-3,3.308D-3,4.61D-3,5.61D-3,7.08D-3,8.13D-3,8.98D-3,9.65D-3,1.074D-2,1.161D-2/
# RAYLEIGH FORM FACTOR Hubbel
DATA FFRH/1.0,.9994,.9978,.9950,.9912,.9863,.9804,.9655,.9469,.8999,.8424,.8108,.7271,.6413,.5581,.4808,.3497,.2513,.1304,.07059,.04032,.02429,.01533,.01009,.006881,.002995,.001494,4.890D-4,2.035D-4,9.902D-5,5.373D-5,3.160D-5,1.300D-5,6.282D-6,3.395D-6,1.992D-6,8.168D-7,1.615D-7,5.112D-8,1.309D-9,1.998D-10,8.182D-11,8.182D-15,8.182D-27,8.182D-39/
# COMPTON FORM FACTOR Hubbel
DATA FFCH/1.E-20,.001105,.004410,.009888,.01749,.02717,.03883,.06773,.1033,.1902,.2904,.3426,.4713,.5887,.6885,.7689,.8777,.9369,.9830,.9950,.9984,.9994,.9998,.9999,.99995,.99999,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/
# HYDROGEN ATOMIC NUMBER
IZ[3]=1
AMZ[3]=9.07146
#
# CONVERT SHAKE OFF FROM A % TO A PROBABILITY
DO 1 I=1,17
PRSHBT[1][I]=PRBSHBT[I]/100.0
PRSHBT[2][I]=PRBSHBTN[I]/100.0
PRSHBT(3,I)=PRBSHBTH[I]/100.0
DO 1 J=1,17
PRBSH[I][J]=PRBSH[I][J]/100.0
PRBSHN[I][J]=PRBSHN[I][J]/100.0
PRBSHH[I][J]=PRBSHH[I][J]/100.0
1 CONTINUE
# SWAP INDICES AND DO CHECK SUM
DO 2 I=1,17
PRSUM=0.0
PRSUMN=0.0
PRSUMH=0.0
DO 2 J=1,17
PRSH[1][I][J]=PRBSH[J][I]
PRSH[2][I][J]=PRBSHN[J][I]
PRSH[3][I][J]=PRBSHH[J][I]
# PRSUMH=PRSUMH+PRSH[2][I][J]
# PRSUM=PRSUM+PRSH[1][I][J]
# WRITE(6,888) I,PRSUM,PRSUMH
# 888 print(' I=',I3,' PRSUM=','%.3f' %,' PRSUM=','%.3f' %)
2 CONTINUE
# LOAD SKAKE OFF ENERGIES AND LEVEL OCCUPATIONS
DO 3 I=1,17
ESH[1][I]=ES[I]
ESH[2][I]=ESN[I]
ESH(3,I)=ESHH[I]
INIOCC[1][I]=INIOC[I]
INIOCC[2][I]=INIOCN[I]
INIOCC(3,I)=INIOCH[I]
3 CONTINUE
#
# AUGER PROBABILITIES IN ARRAY AUG[I][J][K] INITIAL VACANCY IN SHELL I,
# WITH TRANSITION TO SHELLS J,K
# LOAD OUTPUT ARRAYS AND CONVERT TO EV
DO 4 I=1,4
DO 4 J=1,17
DO 4 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.0272105
AUG[2][I][J][K]=AN[I][J][K]*0.0272105
4 AUG[3][I][J][K]=AH[I][J][K]*0.0272105
DO 5 I=5,17
DO 5 J=1,17
DO 5 K=1,17
AUG[1][I][J][K]=A[I][J][K]*0.00272105
AUG[2][I][J][K]=AN[I][J][K]*0.00272105
5 AUG[3][I][J][K]=AH[I][J][K]*0.00272105
# CHECK AUGER LEVEL SUMS
# DO 7 I=1,17
# ASUM=0.0
# DO 6 J=1,17
# DO 6 K=1,17
# 6 ASUM=ASUM+AUG[I][J][K]
# WRITE(6,887) I,ASUM
# 887 print(' I=',I3,' ASUM=','%.3f' %)
# 7 CONTINUE
#
# CONVERT RADIATIVE RATES IN M AND N SHELL TO EV
DO 12 I=5,17
DO 12 J=6,17
R[I][J]=R[I][J]*6.582119D-16
RN[I][J]=RN[I][J]*6.582119D-16
12 RH[I][J]=RH[I][J]*6.582119D-16
# LOAD OUTPUT ARRAY
DO 13 I=1,17
DO 13 J=1,17
RAD[1][I][J]=R[I][J]
RAD[2][I][J]=RN[I][J]
13 RAD[3][I][J]=RH[I][J]
# PRINTOUT CHECK SUM
# DO 15 I=1,17
# RSUM=0.0
# DO 14 J=1,17
# 14 RSUM=RSUM+R[I][J]
# WRITE(6,100) I,RSUM
# 100 print(' SHELL =',I3,' RAD RATE EV=','%.3f' %)
# 15 CONTINUE
#
# LOAD CARBON PHOTOELECTRIC AND COMPTON DATA
# ALLOW FOR 3 CARBON ATOMS
DO 21 J=1,49
XPE[1][1][J]=math.log(XPEK[J])
YPE[1][1][J]=math.log(YPEK[J]*3.E-24)
21 CONTINUE
DO 22 J=1,54
XPE[1][2][J]=math.log(XPEL1[J])
YPE[1][2][J]=math.log(YPEL1[J]*3.E-24)
22 CONTINUE
DO 23 J=1,54
XPE[1][3][J]=math.log(XPEL2[J])
YPE[1][3][J]=math.log(YPEL2[J]*3.E-24)
23 CONTINUE
# LOAD NITROGEN PHOTOELECTRIC AND COMPTON DATA
DO 24 J=1,47
XPE[2][1][J]=math.log(XPEKN[J])
YPE[2][1][J]=math.log(YPEKN[J]*1.E-24)
24 CONTINUE
DO 25 J=1,53
XPE[2][2][J]=math.log(XPEL1N[J])
YPE[2][2][J]=math.log(YPEL1N[J]*1.E-24)
25 CONTINUE
DO 26 J=1,55
XPE[2][3][J]=math.log(XPEL2N[J])
YPE[2][3][J]=math.log(YPEL2N[J]*1.E-24)
26 CONTINUE
DO 27 J=1,55
XPE[2][4][J]=math.log(XPEL3N[J])
YPE[2][4][J]=math.log(YPEL3N[J]*1.E-24)
27 CONTINUE
# LOAD HYDROGEN PHOTOELECTRIC AND COMPTON DATA
DO 28 J=1,54
XPE[3][1][J]=math.log(XPEKH[J])
# ALLOW FOR 9 HYDROGEN ATOMS
YPE[3][1][J]=math.log(YPEKH[J]*9.0*1.E-24)
28 CONTINUE
# LOAD RAYLEIGH COMPTON AND PAIR PRODUCTION X-SEC
DO 29 J=1,54
XCP[1][J]=math.log(XCOMC[J])
XCP[2][J]=math.log(XCOMN[J])
XCP[3][J]=math.log(XCOMH[J])
YRY[1][J]=math.log(YRAYC[J]*3.0D-24)
YRY[2][J]=math.log(YRAYN[J]*1.0D-24)
YRY[3][J]=math.log(YRAYH[J]*9.0D-24)
YCP[1][J]=math.log(YCOMC[J]*3.0D-24)
YCP[2][J]=math.log(YCOMN[J]*1.0D-24)
YCP[3][J]=math.log(YCOMH[J]*9.0D-24)
YPP[1][J]=math.log(YPAPC[J]*3.0D-24)
YPP[2][J]=math.log(YPAPN[J]*1.0D-24)
YPP[3][J]=math.log(YPAPH[J]*9.0D-24)
29 CONTINUE
# LOAD RAYLEIGH AND COMPTON FORM FACTORS
DO 39 J=1,45
FFAR[1][J]=FFRC[J]
FFAR[2][J]=FFRN[J]
FFAR[3][J]=FFRH[J]
FFAC[1][J]=FFCC[J]
FFAC[2][J]=FFCN[J]
FFAC[3][J]=FFCH[J]
39 CONTINUE
return
# end
def CGAS45(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS46(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS47(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS48(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS49(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS50(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS51(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS52(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS53(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS54(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS55(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS56(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS57(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS58(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS59(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS60(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS61(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS62(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS63(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS64(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS65(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS66(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS67(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS68(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS69(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS70(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS71(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS72(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS73(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS74(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS75(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS76(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS77(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS78(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS79(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
def CGAS80(PRSH,PRSHBT,ESH,AUG,RAD,XPE,YPE,XCP,YRY,YCP,YPP,FFAR,FFAC,IZ,AMZ,INIOCC):
# IMPLICIT #real*8 (A-H,O-Z)
# IMPLICIT #integer*8 (I-N)
DIMENSION PRSH(3,17,17),PRSHBT(3,17),ESH(3,17),AUG(3,17,17,17),RAD[3,17,17],XPE(3,17,60),YPE(3,17,60),XCP(3,54),YRY(3,54),YCP(3,54),YPP(3,54),FFAR(3,45),FFAC(3,45),IZ[3],AMZ[3],INIOCC(3,17)
#
return
# end
'''
| 64.687696
| 1,457
| 0.629455
| 73,555
| 288,119
| 2.465529
| 0.056271
| 0.015373
| 0.020182
| 0.025343
| 0.821827
| 0.806294
| 0.797725
| 0.789944
| 0.783565
| 0.780366
| 0
| 0.385782
| 0.088665
| 288,119
| 4,454
| 1,458
| 64.687696
| 0.30489
| 0.034753
| 0
| 0.330948
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.005367
| false
| 0
| 0.003578
| 0
| 0.014311
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
a633269c6453e6113d264d19770f4bf32ed92c9a
| 9,802
|
py
|
Python
|
python/cucim/src/cucim/skimage/morphology/tests/test_misc.py
|
chrisroat/cucim
|
8b909e374b9a77bb1c8ad747c793c30a3d86d4b4
|
[
"Apache-2.0"
] | null | null | null |
python/cucim/src/cucim/skimage/morphology/tests/test_misc.py
|
chrisroat/cucim
|
8b909e374b9a77bb1c8ad747c793c30a3d86d4b4
|
[
"Apache-2.0"
] | null | null | null |
python/cucim/src/cucim/skimage/morphology/tests/test_misc.py
|
chrisroat/cucim
|
8b909e374b9a77bb1c8ad747c793c30a3d86d4b4
|
[
"Apache-2.0"
] | null | null | null |
import cupy as cp
import pytest
from cupy.testing import assert_array_equal
from numpy.testing import assert_equal
from cucim.skimage._shared._warnings import expected_warnings
from cucim.skimage.morphology import remove_small_holes, remove_small_objects
# fmt: off
test_image = cp.array([[0, 0, 0, 1, 0],
[1, 1, 1, 0, 0],
[1, 1, 1, 0, 1]], bool)
# fmt: on
def test_one_connectivity():
# fmt: off
expected = cp.array([[0, 0, 0, 0, 0],
[1, 1, 1, 0, 0],
[1, 1, 1, 0, 0]], bool)
# fmt: on
observed = remove_small_objects(test_image, min_size=6)
assert_array_equal(observed, expected)
def test_two_connectivity():
# fmt: off
expected = cp.array([[0, 0, 0, 1, 0],
[1, 1, 1, 0, 0],
[1, 1, 1, 0, 0]], bool)
# fmt: on
observed = remove_small_objects(test_image, min_size=7, connectivity=2)
assert_array_equal(observed, expected)
def test_in_place():
image = test_image.copy()
with expected_warnings(["in_place argument is deprecated"]):
observed = remove_small_objects(image, min_size=6, in_place=True)
assert_equal(observed is image, True,
"remove_small_objects in_place argument failed.")
@pytest.mark.parametrize("in_dtype", [bool, int, cp.int32])
@pytest.mark.parametrize("out_dtype", [bool, int, cp.int32])
def test_out(in_dtype, out_dtype):
image = test_image.astype(in_dtype, copy=True)
expected_out = cp.empty_like(test_image, dtype=out_dtype)
if out_dtype != bool:
# object with only 1 label will warn on non-bool output dtype
exp_warn = ["Only one label was provided"]
else:
exp_warn = []
with expected_warnings(exp_warn):
out = remove_small_objects(image, min_size=6, out=expected_out)
assert out is expected_out
def test_labeled_image():
# fmt: off
labeled_image = cp.array([[2, 2, 2, 0, 1],
[2, 2, 2, 0, 1],
[2, 0, 0, 0, 0],
[0, 0, 3, 3, 3]], dtype=int)
expected = cp.array([[2, 2, 2, 0, 0],
[2, 2, 2, 0, 0],
[2, 0, 0, 0, 0],
[0, 0, 3, 3, 3]], dtype=int)
# fmt: on
observed = remove_small_objects(labeled_image, min_size=3)
assert_array_equal(observed, expected)
def test_uint_image():
# fmt: off
labeled_image = cp.array([[2, 2, 2, 0, 1],
[2, 2, 2, 0, 1],
[2, 0, 0, 0, 0],
[0, 0, 3, 3, 3]], dtype=cp.uint8)
expected = cp.array([[2, 2, 2, 0, 0],
[2, 2, 2, 0, 0],
[2, 0, 0, 0, 0],
[0, 0, 3, 3, 3]], dtype=cp.uint8)
# fmt: on
observed = remove_small_objects(labeled_image, min_size=3)
assert_array_equal(observed, expected)
def test_single_label_warning():
# fmt: off
image = cp.array([[0, 0, 0, 1, 0],
[1, 1, 1, 0, 0],
[1, 1, 1, 0, 0]], int)
# fmt: on
with expected_warnings(['use a boolean array?']):
remove_small_objects(image, min_size=6)
def test_float_input():
float_test = cp.random.rand(5, 5)
with pytest.raises(TypeError):
remove_small_objects(float_test)
def test_negative_input():
negative_int = cp.random.randint(-4, -1, size=(5, 5))
with pytest.raises(ValueError):
remove_small_objects(negative_int)
# fmt: off
test_holes_image = cp.array([[0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 0, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 0, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1]], bool)
# fmt: on
def test_one_connectivity_holes():
# fmt: off
expected = cp.array([[0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1]], bool)
# fmt: on
observed = remove_small_holes(test_holes_image, area_threshold=3)
assert_array_equal(observed, expected)
def test_two_connectivity_holes():
# fmt: off
expected = cp.array([[0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 0, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1]], bool)
# fmt: on
observed = remove_small_holes(test_holes_image, area_threshold=3,
connectivity=2)
assert_array_equal(observed, expected)
def test_in_place_holes():
image = test_holes_image.copy()
with expected_warnings(["in_place argument is deprecated"]):
observed = remove_small_holes(image, area_threshold=3, in_place=True)
assert_equal(observed is image, True,
"remove_small_holes in_place argument failed.")
def test_out_remove_small_holes():
image = test_holes_image.copy()
expected_out = cp.empty_like(image)
out = remove_small_holes(image, area_threshold=3, out=expected_out)
assert out is expected_out
def test_non_bool_out():
image = test_holes_image.copy()
expected_out = cp.empty_like(image, dtype=int)
with pytest.raises(TypeError):
remove_small_holes(image, area_threshold=3, out=expected_out)
def test_labeled_image_holes():
# fmt: off
labeled_holes_image = cp.array([[0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 0, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 2, 2, 2],
[0, 0, 0, 0, 0, 0, 0, 2, 0, 2],
[0, 0, 0, 0, 0, 0, 0, 2, 2, 2]],
dtype=int)
expected = cp.array([[0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1]], dtype=bool)
# fmt: on
with expected_warnings(['returned as a boolean array']):
observed = remove_small_holes(labeled_holes_image, area_threshold=3)
assert_array_equal(observed, expected)
def test_uint_image_holes():
# fmt: off
labeled_holes_image = cp.array([[0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 0, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 2, 2, 2],
[0, 0, 0, 0, 0, 0, 0, 2, 0, 2],
[0, 0, 0, 0, 0, 0, 0, 2, 2, 2]],
dtype=cp.uint8)
expected = cp.array([[0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1]], dtype=bool)
# fmt: on
with expected_warnings(['returned as a boolean array']):
observed = remove_small_holes(labeled_holes_image, area_threshold=3)
assert_array_equal(observed, expected)
def test_label_warning_holes():
# fmt: off
labeled_holes_image = cp.array([[0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 1, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 0, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 2, 2, 2],
[0, 0, 0, 0, 0, 0, 0, 2, 0, 2],
[0, 0, 0, 0, 0, 0, 0, 2, 2, 2]],
dtype=int)
# fmt: on
with expected_warnings(['use a boolean array?']):
remove_small_holes(labeled_holes_image, area_threshold=3)
remove_small_holes(labeled_holes_image.astype(bool), area_threshold=3)
def test_float_input_holes():
float_test = cp.random.rand(5, 5)
with pytest.raises(TypeError):
remove_small_holes(float_test)
| 39.051793
| 77
| 0.43991
| 1,477
| 9,802
| 2.778605
| 0.062288
| 0.18616
| 0.214912
| 0.216374
| 0.804825
| 0.781676
| 0.760965
| 0.730507
| 0.722953
| 0.693957
| 0
| 0.140393
| 0.408488
| 9,802
| 250
| 78
| 39.208
| 0.567437
| 0.026831
| 0
| 0.640884
| 0
| 0
| 0.030485
| 0
| 0
| 0
| 0
| 0
| 0.077348
| 1
| 0.099448
| false
| 0
| 0.033149
| 0
| 0.132597
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 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
| 8
|
a63fda08f000bf70a33fd2c144286a600767dca9
| 15,546
|
py
|
Python
|
n3jet/utils/fks_utils.py
|
JosephPB/n3jet
|
f097c5e829b5f86fc0ce9007c5fa76ea229dfc56
|
[
"MIT"
] | 3
|
2020-06-03T13:50:59.000Z
|
2021-12-01T08:21:34.000Z
|
n3jet/utils/fks_utils.py
|
JosephPB/n3jet
|
f097c5e829b5f86fc0ce9007c5fa76ea229dfc56
|
[
"MIT"
] | 2
|
2021-08-25T16:15:38.000Z
|
2022-02-10T03:36:12.000Z
|
n3jet/utils/fks_utils.py
|
JosephPB/n3jet
|
f097c5e829b5f86fc0ce9007c5fa76ea229dfc56
|
[
"MIT"
] | 1
|
2020-06-12T15:00:56.000Z
|
2020-06-12T15:00:56.000Z
|
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import random
from matplotlib import rc
import time
from keras.models import load_model
from tqdm import tqdm
# python 2/3 compatibility
try:
import cPickle as pickle
except:
import pickle
from n3jet.models import Model
###############################################################################################
############################### TRAINING ON NEAR NETWORKS ###############################
###############################################################################################
def train_near_networks(
pairs,
near_momenta,
NJ_split,
order,
n_gluon,
delta_near,
points,
model_dir = '',
**kwargs
):
'''
Train 'near' networks on pairs of jets
:param pairs: array of pairs of jet positions
:param near_momenta: list of PS points between delta_near and delta_cut
:param NJ_split: array of NJet results weighted by different partition functions
:param model_dir: the directory in which to create sub-directories to save the networks
'''
lr = kwargs.get('lr', 0.001)
layers = kwargs.get('layers', [20,40,20])
print ('Using learning rate {}'.format(lr))
epochs = kwargs.get('epochs', 1000000)
if type(near_momenta) != list:
raise AssertionError('Momentum must be in the form of a list')
NN_near = []
model_near = []
x_mean_near = []
x_std_near = []
y_mean_near = []
y_std_near = []
for idx,i in enumerate(pairs):
NN = Model((n_gluon+2-1)*4,near_momenta, NJ_split[idx])
model, x_mean, x_std, y_mean, y_std = NN.fit(layers=layers, lr=lr, epochs=epochs)
NN_near.append(NN)
model_near.append(model)
x_mean_near.append(x_mean)
x_std_near.append(x_std)
y_mean_near.append(y_mean)
y_std_near.append(y_std)
if model_dir != '':
pair_dir = model_dir + '/{}_near_{}_{}_{}_{}_{}/'.format(
order,i[0],i[1],n_gluon+2,delta_near,points
)
if os.path.exists(pair_dir) == False:
os.mkdir(pair_dir)
model.save(pair_dir + '/model')
metadata = {'x_mean': x_mean, 'x_std': x_std, 'y_mean': y_mean, 'y_std': y_std}
pickle_out = open(pair_dir + "/dataset_metadata.pickle","wb")
pickle.dump(metadata, pickle_out)
pickle_out.close()
return model_near, x_mean_near, x_std_near, y_mean_near, y_std_near
def train_near_networks_general(
input_size,
pairs,
near_momenta,
NJ_split,
delta_near,
model_dir = '',
all_jets=False,
all_legs=False,
model_dataset=False,
**kwargs
):
'''
Train 'near' networks on pairs of jets
'''
scaling = kwargs.get('scaling', 'standardise')
lr = kwargs.get('lr', 0.001)
layers = kwargs.get('layers', [20,40,20])
print ('Using learning rate {}'.format(lr))
activation = kwargs.get('activation', 'tanh')
loss = kwargs.get('loss', 'mean_squared_error')
epochs = kwargs.get('epochs', 1000000)
high_precision = kwargs.get('high_precision', False)
if type(near_momenta) != list:
raise AssertionError('Momentum must be in the form of a list')
NN_near = []
model_near = []
x_mean_near = []
x_std_near = []
y_mean_near = []
y_std_near = []
for idx,i in enumerate(pairs):
NN = Model(
input_size = input_size,
momenta = near_momenta,
labels = NJ_split[idx],
all_jets = all_jets,
all_legs = all_legs,
model_dataset = model_dataset,
high_precision = high_precision
)
model, x_mean, x_std, y_mean, y_std = NN.fit(
scaling = scaling,
layers = layers,
lr = lr,
activation = activation,
loss = loss,
epochs = epochs,
)
NN_near.append(NN)
model_near.append(model)
x_mean_near.append(x_mean)
x_std_near.append(x_std)
y_mean_near.append(y_mean)
y_std_near.append(y_std)
if model_dir != '':
pair_dir = model_dir + 'pair_{}_{}'.format(delta_near,idx)
if os.path.exists(pair_dir) == False:
os.mkdir(pair_dir)
model.save(pair_dir + '/model')
with open (pair_dir + '/model_arch.json', 'w') as fout:
fout.write(model.to_json())
model.save_weights(pair_dir + '/model_weights.h5')
metadata = {'x_mean': x_mean, 'x_std': x_std, 'y_mean': y_mean, 'y_std': y_std}
pickle_out = open(pair_dir + "/dataset_metadata.pickle","wb")
pickle.dump(metadata, pickle_out)
pickle_out.close()
return model_near, x_mean_near, x_std_near, y_mean_near, y_std_near
def get_near_networks(NN, pairs, order, n_gluon, delta_near, points, model_dir):
'''
Retrieve the near networks given the assigned file structure
:param NN: NN object from the Model class
:param pairs: array of numbers defining jet positions
:param order: LO or NLO
:param n_gluon: the number of gluon jets
:param delta_near: the secondary 'cut' defining the region 'close to' the cut boundary
:param points: the number of training points
:param model_dir: the directory in which to create sub-directories to save the networks
'''
model_near = []
x_mean_near = []
x_std_near = []
y_mean_near = []
y_std_near = []
for idx,i in enumerate(pairs):
pair_dir = model_dir + '{}_near_{}_{}_{}_{}_{}'.format(order, i[0],i[1],n_gluon+2,delta_near,points)
model = load_model(
pair_dir + '/model',
custom_objects={'root_mean_squared_error':NN.root_mean_squared_error}
)
model_near.append(model)
pickle_out = open(pair_dir + "/dataset_metadata.pickle","rb")
metadata = pickle.load(pickle_out)
pickle_out.close()
x_mean_near.append(metadata['x_mean'])
y_mean_near.append(metadata['y_mean'])
x_std_near.append(metadata['x_std'])
y_std_near.append(metadata['y_std'])
return model_near, x_mean_near, x_std_near, y_mean_near, y_std_near
def get_near_networks_general(NN, pairs, delta_near, model_dir):
'''
Retrieve the near networks given the assigned file structure
'''
model_near = []
x_mean_near = []
x_std_near = []
y_mean_near = []
y_std_near = []
for idx,i in enumerate(pairs):
pair_dir = model_dir + 'pair_{}_{}'.format(delta_near,idx)
model = load_model(
pair_dir + '/model',
custom_objects={'root_mean_squared_error':NN.root_mean_squared_error}
)
model_near.append(model)
pickle_out = open(pair_dir + "/dataset_metadata.pickle","rb")
metadata = pickle.load(pickle_out)
pickle_out.close()
x_mean_near.append(metadata['x_mean'])
y_mean_near.append(metadata['y_mean'])
x_std_near.append(metadata['x_std'])
y_std_near.append(metadata['y_std'])
return model_near, x_mean_near, x_std_near, y_mean_near, y_std_near
###############################################################################################
############################### TRAINING ON CUT NETWORKS ###############################
###############################################################################################
def train_cut_network(
cut_momenta,
NJ_cut,
order,
n_gluon,
delta_cut,
points,
model_dir = '',
**kwargs
):
lr = kwargs.get('lr', 0.001)
layers = kwargs.get('layers', [20,40,20])
print ('Using learning rate {}'.format(lr))
epochs = kwargs.get('epochs', 1000000)
NN_cut = Model((n_gluon+2-1)*4,cut_momenta,NJ_cut)
model_cut, x_mean_cut, x_std_cut, y_mean_cut, y_std_cut = NN_cut.fit(layers=layers, lr=lr, epochs=epochs)
if model_dir != '':
if not os.path.exists(
model_dir + '{}_cut_{}_{}_{}'.format(order,n_gluon+2,delta_cut,points)
):
os.mkdir(model_dir + '{}_cut_{}_{}_{}'.format(order,n_gluon+2,delta_cut,points))
model_cut.save(model_dir + '{}_cut_{}_{}_{}/model'.format(order,n_gluon+2,delta_cut,points))
metadata = {
'x_mean': x_mean_cut,
'x_std': x_std_cut,
'y_mean': y_mean_cut,
'y_std': y_std_cut
}
pickle_out = open(model_dir + "{}_cut_{}_{}_{}/dataset_metadata.pickle".format(order,n_gluon+2,delta_cut,points),"wb")
pickle.dump(metadata, pickle_out)
pickle_out.close()
return model_cut, x_mean_cut, x_std_cut, y_mean_cut, y_std_cut
def train_cut_network_general(
input_size,
cut_momenta,
NJ_cut,
delta_cut,
model_dir = '',
all_jets = False,
all_legs = False,
model_dataset=False,
**kwargs
):
scaling = kwargs.get('scaling', 'standardise')
lr = kwargs.get('lr', 0.001)
layers = kwargs.get('layers', [20,40,20])
print ('Using learning rate {}'.format(lr))
activation = kwargs.get('activation', 'tanh')
loss = kwargs.get('loss', 'mean_squared_error')
epochs = kwargs.get('epochs', 1000000)
high_precision = kwargs.get('high_precision', False)
NN_cut = Model(
input_size = input_size,
momenta = cut_momenta,
labels = NJ_cut,
all_jets = all_jets,
all_legs = all_legs,
model_dataset = model_dataset,
high_precision = high_precision
)
model_cut, x_mean_cut, x_std_cut, y_mean_cut, y_std_cut = NN_cut.fit(
scaling = scaling,
layers = layers,
lr = lr,
activation = activation,
loss = loss,
epochs = epochs
)
if model_dir != '':
cut_dir = model_dir + 'cut_{}'.format(delta_cut)
if not os.path.exists(cut_dir):
os.mkdir(cut_dir)
model_cut.save(cut_dir + '/model')
with open (cut_dir + '/model_arch.json', 'w') as fout:
fout.write(model_cut.to_json())
model_cut.save_weights(cut_dir + '/model_weights.h5')
metadata = {
'x_mean': x_mean_cut,
'x_std': x_std_cut,
'y_mean': y_mean_cut,
'y_std': y_std_cut
}
pickle_out = open(cut_dir + '/dataset_metadata.pickle',"wb")
pickle.dump(metadata, pickle_out)
pickle_out.close()
return model_cut, x_mean_cut, x_std_cut, y_mean_cut, y_std_cut
def get_cut_network(NN, order, n_gluon, delta_cut, points, model_dir):
model_cut = load_model(
model_dir + '{}_cut_{}_{}_{}/model'.format(
order,n_gluon+2,delta_cut,points
),
custom_objects={'root_mean_squared_error':NN.root_mean_squared_error}
)
pickle_out = open(model_dir + "{}_cut_{}_{}_{}/dataset_metadata.pickle".format(order,n_gluon+2,delta_cut,points),"rb")
metadata = pickle.load(pickle_out)
pickle_out.close()
x_mean_cut = (metadata['x_mean'])
y_mean_cut = (metadata['y_mean'])
x_std_cut = (metadata['x_std'])
y_std_cut = (metadata['y_std'])
return model_cut, x_mean_cut, x_std_cut, y_mean_cut, y_std_cut
def get_cut_network_general(NN, delta_cut, model_dir):
cut_dir = model_dir + 'cut_{}'.format(delta_cut)
model_cut = load_model(
cut_dir + '/model',
custom_objects={'root_mean_squared_error':NN.root_mean_squared_error}
)
pickle_out = open(cut_dir + '/dataset_metadata.pickle',"rb")
metadata = pickle.load(pickle_out)
pickle_out.close()
x_mean_cut = (metadata['x_mean'])
y_mean_cut = (metadata['y_mean'])
x_std_cut = (metadata['x_std'])
y_std_cut = (metadata['y_std'])
return model_cut, x_mean_cut, x_std_cut, y_mean_cut, y_std_cut
###############################################################################################
############################### INFERRING ON NEAR NETWORKS ###############################
###############################################################################################
def infer_on_near_splits(
NN,
moms,
models,
x_mean_near,
x_std_near,
y_mean_near,
y_std_near,
scaling = "standardise"
):
'''
Infer on near networks
:param moms: list of testing momenta
:param models: array of near network models
'''
y_pred_nears = np.zeros(len(moms))
for i in range(len(models)):
test = i
x_standard_near = NN.process_testing_data(
moms=moms,
scaling=scaling,
x_mean=x_mean_near[test],
x_std=x_std_near[test],
y_mean=y_mean_near[test],
y_std=y_std_near[test]
)
pred_near = models[test].predict(x_standard_near)
y_pred_near = NN.destandardise_data(
y_pred=pred_near.reshape(-1),
scaling=scaling,
x_mean=x_mean_near[test],
x_std=x_std_near[test],
y_mean=y_mean_near[test],
y_std=y_std_near[test]
)
y_pred_nears += np.array(y_pred_near)
return y_pred_nears
def infer_on_near_splits_separate(
NN,
moms,
models,
x_mean_near,
x_std_near,
y_mean_near,
y_std_near,
scaling="standardise"
):
'''
Infer on near networks
:param moms: list of testing momenta
:param models: array of near network models
'''
y_preds_nears = []
y_pred_nears = np.zeros(len(moms))
for i in range(len(models)):
test = i
x_standard_near = NN.process_testing_data(
moms=moms,
scaling=scaling,
x_mean=x_mean_near[test],
x_std=x_std_near[test],
y_mean=y_mean_near[test],
y_std=y_std_near[test]
)
pred_near = models[test].predict(x_standard_near)
y_pred_near = NN.destandardise_data(
y_pred=pred_near.reshape(-1),
scaling=scaling,
x_mean=x_mean_near[test],
x_std=x_std_near[test],
y_mean=y_mean_near[test],
y_std=y_std_near[test]
)
y_pred_nears += np.array(y_pred_near)
y_preds_nears.append(y_pred_near)
return y_preds_nears, y_pred_nears
def infer_on_cut(
NN,
moms,
model,
x_mean_cut,
x_std_cut,
y_mean_cut,
y_std_cut,
scaling="standardise"
):
x_standard_cut = NN.process_testing_data(
moms=moms,
scaling=scaling,
x_mean=x_mean_cut,
x_std=x_std_cut,
y_mean=y_mean_cut,
y_std=y_std_cut
)
pred_cut = model.predict(x_standard_cut)
y_pred_cuts = NN.destandardise_data(
y_pred=pred_cut.reshape(-1),
scaling=scaling,
x_mean=x_mean_cut,
x_std=x_std_cut,
y_mean=y_mean_cut,
y_std=y_std_cut
)
return y_pred_cuts
| 30.304094
| 126
| 0.561817
| 2,006
| 15,546
| 3.998006
| 0.092223
| 0.031796
| 0.0202
| 0.012344
| 0.836783
| 0.818953
| 0.79813
| 0.792643
| 0.766958
| 0.757232
| 0
| 0.00845
| 0.284446
| 15,546
| 512
| 127
| 30.363281
| 0.712513
| 0.077255
| 0
| 0.748663
| 0
| 0
| 0.085638
| 0.029962
| 0
| 0
| 0
| 0
| 0.005348
| 1
| 0.029412
| false
| 0
| 0.032086
| 0
| 0.090909
| 0.010695
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
a64c0bf2b3055a8b0cec28c6d8e2e23963775072
| 336
|
py
|
Python
|
post-release-data.py
|
romaninsh/botostubs
|
efe3a6cff2f73842878f983a9797a29c77d93cb0
|
[
"BSD-2-Clause"
] | 104
|
2018-11-27T17:21:24.000Z
|
2022-03-05T12:52:09.000Z
|
post-release-data.py
|
romaninsh/botostubs
|
efe3a6cff2f73842878f983a9797a29c77d93cb0
|
[
"BSD-2-Clause"
] | 18
|
2019-01-02T20:21:35.000Z
|
2022-02-28T06:18:47.000Z
|
post-release-data.py
|
romaninsh/botostubs
|
efe3a6cff2f73842878f983a9797a29c77d93cb0
|
[
"BSD-2-Clause"
] | 4
|
2019-04-29T22:45:19.000Z
|
2020-12-20T05:02:37.000Z
|
#!/usr/bin/env python
import boto3
import os
print(f'{{"tag_name": "v{os.environ["CODE_VERSION"]}.{boto3.__version__}", "name": "{os.environ["CODE_VERSION"]}.{boto3.__version__}", "body": "Compatibility with boto3 version {boto3.__version__}. See boto3 release here: https://github.com/boto/boto3/releases/tag/{boto3.__version__}"}}')
| 56
| 289
| 0.729167
| 46
| 336
| 4.913043
| 0.565217
| 0.265487
| 0.252212
| 0.176991
| 0.283186
| 0.283186
| 0
| 0
| 0
| 0
| 0
| 0.025478
| 0.065476
| 336
| 5
| 290
| 67.2
| 0.694268
| 0.059524
| 0
| 0
| 0
| 0.333333
| 0.888535
| 0.328025
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0.333333
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 9
|
a65061b8bb24d763163ae10c42a135b472a36fc8
| 3,230
|
py
|
Python
|
Script/Commands/Messages/Moderation/delete_messages.py
|
AIDRI/Clash-Of-Clans-Discord-Bot
|
2a9f0495e30ae22ca487886fa48f9d206a545b99
|
[
"BSD-3-Clause"
] | null | null | null |
Script/Commands/Messages/Moderation/delete_messages.py
|
AIDRI/Clash-Of-Clans-Discord-Bot
|
2a9f0495e30ae22ca487886fa48f9d206a545b99
|
[
"BSD-3-Clause"
] | null | null | null |
Script/Commands/Messages/Moderation/delete_messages.py
|
AIDRI/Clash-Of-Clans-Discord-Bot
|
2a9f0495e30ae22ca487886fa48f9d206a545b99
|
[
"BSD-3-Clause"
] | null | null | null |
import discord
import datetime
from Script.import_functions import create_embed, int_to_str
async def delete_messages_number(ctx, number):
if ctx.author.guild_permissions.manage_messages:
await ctx.defer()
if number <= 0:
await ctx.send("Error\nYou cannot delete a negative number of messages", hidden=True)
return
nb_msg = 0
async for msg in ctx.channel.history(limit=number+1):
if not msg.pinned:
nb_msg += 1
await msg.delete()
nb_msg -= 1
if nb_msg == 1:
embed = create_embed("Messages deleted", f"{int_to_str(nb_msg)} message deleted", ctx.guild.me.color, "", ctx.guild.me.avatar_url)
else:
embed = create_embed("Messages deleted", f"{int_to_str(nb_msg)} messages deleted", ctx.guild.me.color, "", ctx.guild.me.avatar_url)
try:
await ctx.send(embed=embed)
except discord.errors.NotFound:
await ctx.channel.send(embed=embed)
else:
await ctx.send("You cannot do this action\nYou are not allowed to delete messages.", hidden=True)
return
async def delete_messages_time(ctx, minutes):
if ctx.author.guild_permissions.manage_messages:
await ctx.defer()
if minutes <= 0:
await ctx.send("Error\nYou must choose a number of minutes strictly positive", hidden=True)
return
nb_msg = 0
async for msg in ctx.channel.history(after=(datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(minutes=minutes)).replace(tzinfo=None), oldest_first=False):
if not msg.pinned:
nb_msg += 1
await msg.delete()
nb_msg -= 1
if nb_msg == 1:
embed = create_embed("Messages deleted", f"{int_to_str(nb_msg)} message deleted", ctx.guild.me.color, "", ctx.guild.me.avatar_url)
else:
embed = create_embed("Messages deleted", f"{int_to_str(nb_msg)} messages deleted", ctx.guild.me.color, "", ctx.guild.me.avatar_url)
try:
await ctx.send(embed=embed)
except discord.errors.NotFound:
await ctx.channel.send(embed=embed)
else:
await ctx.send("You cannot do this action\nYou are not allowed to delete messages.", hidden=True)
return
async def delete_messages_all(ctx):
if ctx.author.guild_permissions.manage_messages:
await ctx.defer()
nb_msg = 0
async for msg in ctx.channel.history(limit=None):
if not msg.pinned:
nb_msg += 1
await msg.delete()
nb_msg -= 1
if nb_msg == 1:
embed = create_embed("Messages deleted", f"{int_to_str(nb_msg)} message deleted", ctx.guild.me.color, "", ctx.guild.me.avatar_url)
else:
embed = create_embed("Messages deleted", f"{int_to_str(nb_msg)} messages deleted", ctx.guild.me.color, "", ctx.guild.me.avatar_url)
try:
await ctx.send(embed=embed)
except discord.errors.NotFound:
await ctx.channel.send(embed=embed)
else:
await ctx.send("You cannot do this action\nYou are not allowed to delete messages.", hidden=True)
return
| 42.5
| 178
| 0.626935
| 444
| 3,230
| 4.427928
| 0.182432
| 0.045778
| 0.061038
| 0.073245
| 0.825025
| 0.825025
| 0.802645
| 0.802645
| 0.802645
| 0.802645
| 0
| 0.006334
| 0.266873
| 3,230
| 75
| 179
| 43.066667
| 0.823902
| 0
| 0
| 0.811594
| 0
| 0
| 0.194118
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.043478
| 0
| 0.115942
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
a672ec72275a2690e67d7ef207830dd0f3449b9c
| 16,596
|
py
|
Python
|
tests/integration/test_materialized_mysql_database/test.py
|
chalice19/ClickHouse
|
2f38e7bc5c2113935ab86260439bb543a1737291
|
[
"Apache-2.0"
] | 8,629
|
2016-06-14T21:03:01.000Z
|
2019-09-23T07:46:38.000Z
|
tests/integration/test_materialized_mysql_database/test.py
|
chalice19/ClickHouse
|
2f38e7bc5c2113935ab86260439bb543a1737291
|
[
"Apache-2.0"
] | 4,335
|
2016-06-15T12:58:31.000Z
|
2019-09-23T11:18:43.000Z
|
tests/integration/test_materialized_mysql_database/test.py
|
chalice19/ClickHouse
|
2f38e7bc5c2113935ab86260439bb543a1737291
|
[
"Apache-2.0"
] | 1,700
|
2016-06-15T09:25:11.000Z
|
2019-09-23T11:16:38.000Z
|
import os
import os.path as p
import time
import pwd
import re
import pymysql.cursors
import pytest
from helpers.cluster import (
ClickHouseCluster,
ClickHouseInstance,
get_docker_compose_path,
run_and_check,
)
import docker
import logging
from . import materialize_with_ddl
DOCKER_COMPOSE_PATH = get_docker_compose_path()
cluster = ClickHouseCluster(__file__)
mysql_node = None
mysql8_node = None
node_db = cluster.add_instance(
"node1",
main_configs=["configs/timezone_config.xml"],
user_configs=["configs/users.xml"],
with_mysql=True,
with_mysql8=True,
stay_alive=True,
)
node_disable_bytes_settings = cluster.add_instance(
"node2",
main_configs=["configs/timezone_config.xml"],
user_configs=["configs/users_disable_bytes_settings.xml"],
with_mysql=False,
stay_alive=True,
)
node_disable_rows_settings = cluster.add_instance(
"node3",
main_configs=["configs/timezone_config.xml"],
user_configs=["configs/users_disable_rows_settings.xml"],
with_mysql=False,
stay_alive=True,
)
@pytest.fixture(scope="module")
def started_cluster():
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
class MySQLConnection:
def __init__(
self,
port,
user="root",
password="clickhouse",
ip_address=None,
docker_compose=None,
project_name=cluster.project_name,
):
self.user = user
self.port = port
self.ip_address = ip_address
self.password = password
self.mysql_connection = None # lazy init
def alloc_connection(self):
errors = []
for _ in range(5):
try:
if self.mysql_connection is None:
self.mysql_connection = pymysql.connect(
user=self.user,
password=self.password,
host=self.ip_address,
port=self.port,
autocommit=True,
)
else:
self.mysql_connection.ping(reconnect=True)
logging.debug(
"MySQL Connection establised: {}:{}".format(
self.ip_address, self.port
)
)
return self.mysql_connection
except Exception as e:
errors += [str(e)]
time.sleep(1)
raise Exception("Connection not establised, {}".format(errors))
def query(self, execution_query):
with self.alloc_connection().cursor() as cursor:
cursor.execute(execution_query)
def create_min_priv_user(self, user, password):
self.query("CREATE USER '" + user + "'@'%' IDENTIFIED BY '" + password + "'")
self.grant_min_priv_for_user(user)
def grant_min_priv_for_user(self, user, db="priv_err_db"):
self.query(
"GRANT REPLICATION SLAVE, REPLICATION CLIENT, RELOAD ON *.* TO '"
+ user
+ "'@'%'"
)
self.query("GRANT SELECT ON " + db + ".* TO '" + user + "'@'%'")
def result(self, execution_query):
with self.alloc_connection().cursor() as cursor:
result = cursor.execute(execution_query)
if result is not None:
print(cursor.fetchall())
def query_and_get_data(self, executio_query):
with self.alloc_connection().cursor() as cursor:
cursor.execute(executio_query)
return cursor.fetchall()
def close(self):
if self.mysql_connection is not None:
self.mysql_connection.close()
@pytest.fixture(scope="module")
def started_mysql_5_7():
mysql_node = MySQLConnection(
cluster.mysql_port, "root", "clickhouse", cluster.mysql_ip
)
yield mysql_node
@pytest.fixture(scope="module")
def started_mysql_8_0():
mysql8_node = MySQLConnection(
cluster.mysql8_port, "root", "clickhouse", cluster.mysql8_ip
)
yield mysql8_node
@pytest.fixture(scope="module")
def clickhouse_node():
yield node_db
def test_materialized_database_dml_with_mysql_5_7(
started_cluster, started_mysql_5_7, clickhouse_node: ClickHouseInstance
):
materialize_with_ddl.dml_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.materialized_mysql_database_with_views(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.materialized_mysql_database_with_datetime_and_decimal(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.move_to_prewhere_and_column_filtering(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_materialized_database_dml_with_mysql_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.dml_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.materialized_mysql_database_with_views(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.materialized_mysql_database_with_datetime_and_decimal(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.move_to_prewhere_and_column_filtering(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_materialized_database_ddl_with_mysql_5_7(
started_cluster, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.drop_table_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.create_table_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.rename_table_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.alter_add_column_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.alter_drop_column_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
# mysql 5.7 cannot support alter rename column
# materialize_with_ddl.alter_rename_column_with_materialized_mysql_database(clickhouse_node, started_mysql_5_7, "mysql57")
materialize_with_ddl.alter_rename_table_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.alter_modify_column_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.create_table_like_with_materialize_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_materialized_database_ddl_with_mysql_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.drop_table_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.create_table_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.rename_table_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.alter_add_column_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.alter_drop_column_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.alter_rename_table_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.alter_rename_column_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.alter_modify_column_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.create_table_like_with_materialize_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_materialized_database_ddl_with_empty_transaction_5_7(
started_cluster, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.query_event_with_empty_transaction(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_materialized_database_ddl_with_empty_transaction_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.query_event_with_empty_transaction(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_select_without_columns_5_7(
started_cluster, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.select_without_columns(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_select_without_columns_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.select_without_columns(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_insert_with_modify_binlog_checksum_5_7(
started_cluster, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.insert_with_modify_binlog_checksum(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_insert_with_modify_binlog_checksum_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.insert_with_modify_binlog_checksum(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_materialized_database_err_sync_user_privs_5_7(
started_cluster, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.err_sync_user_privs_with_materialized_mysql_database(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_materialized_database_err_sync_user_privs_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.err_sync_user_privs_with_materialized_mysql_database(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_network_partition_5_7(started_cluster, started_mysql_5_7, clickhouse_node):
materialize_with_ddl.network_partition_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_network_partition_8_0(started_cluster, started_mysql_8_0, clickhouse_node):
materialize_with_ddl.network_partition_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_mysql_kill_sync_thread_restore_5_7(
started_cluster, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.mysql_kill_sync_thread_restore_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_mysql_kill_sync_thread_restore_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.mysql_kill_sync_thread_restore_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_mysql_killed_while_insert_5_7(
started_cluster, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.mysql_killed_while_insert(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_mysql_killed_while_insert_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.mysql_killed_while_insert(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_clickhouse_killed_while_insert_5_7(
started_cluster, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.clickhouse_killed_while_insert(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_clickhouse_killed_while_insert_8_0(
started_cluster, started_mysql_8_0, clickhouse_node
):
materialize_with_ddl.clickhouse_killed_while_insert(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_utf8mb4(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.utf8mb4_test(clickhouse_node, started_mysql_5_7, "mysql57")
materialize_with_ddl.utf8mb4_test(clickhouse_node, started_mysql_8_0, "mysql80")
def test_system_parts_table(started_cluster, started_mysql_8_0, clickhouse_node):
materialize_with_ddl.system_parts_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_multi_table_update(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.multi_table_update_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.multi_table_update_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_system_tables_table(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.system_tables_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.system_tables_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_materialized_with_column_comments(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.materialize_with_column_comments_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.materialize_with_column_comments_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_materialized_with_enum(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.materialize_with_enum8_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.materialize_with_enum16_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.alter_enum8_to_enum16_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.materialize_with_enum8_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.materialize_with_enum16_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.alter_enum8_to_enum16_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
@pytest.mark.parametrize(
("clickhouse_node"), [node_disable_bytes_settings, node_disable_rows_settings]
)
def test_mysql_settings(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.mysql_settings_test(
clickhouse_node, started_mysql_5_7, "mysql57"
)
materialize_with_ddl.mysql_settings_test(
clickhouse_node, started_mysql_8_0, "mysql80"
)
def test_large_transaction(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.materialized_mysql_large_transaction(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.materialized_mysql_large_transaction(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_table_table(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.table_table(clickhouse_node, started_mysql_8_0, "mysql80")
materialize_with_ddl.table_table(clickhouse_node, started_mysql_5_7, "mysql57")
def test_table_overrides(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.table_overrides(clickhouse_node, started_mysql_5_7, "mysql57")
materialize_with_ddl.table_overrides(clickhouse_node, started_mysql_8_0, "mysql80")
def test_materialized_database_support_all_kinds_of_mysql_datatype(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.materialized_database_support_all_kinds_of_mysql_datatype(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.materialized_database_support_all_kinds_of_mysql_datatype(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_materialized_database_settings_materialized_mysql_tables_list(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.materialized_database_settings_materialized_mysql_tables_list(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.materialized_database_settings_materialized_mysql_tables_list(
clickhouse_node, started_mysql_5_7, "mysql57"
)
def test_materialized_database_mysql_date_type_to_date32(
started_cluster, started_mysql_8_0, started_mysql_5_7, clickhouse_node
):
materialize_with_ddl.materialized_database_mysql_date_type_to_date32(
clickhouse_node, started_mysql_8_0, "mysql80"
)
materialize_with_ddl.materialized_database_mysql_date_type_to_date32(
clickhouse_node, started_mysql_5_7, "mysql57"
)
| 32.414063
| 126
| 0.752169
| 2,108
| 16,596
| 5.343928
| 0.089658
| 0.125699
| 0.115047
| 0.16387
| 0.829827
| 0.811451
| 0.803018
| 0.777896
| 0.762805
| 0.751709
| 0
| 0.033473
| 0.180947
| 16,596
| 511
| 127
| 32.477495
| 0.795262
| 0.010545
| 0
| 0.481043
| 0
| 0
| 0.058963
| 0.009746
| 0
| 0
| 0
| 0
| 0
| 1
| 0.106635
| false
| 0.011848
| 0.026066
| 0
| 0.13981
| 0.00237
| 0
| 0
| 0
| null | 0
| 0
| 1
| 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
| 7
|
a6856bd85b7077bc655bb34cf5b00cc0271ac231
| 5,889
|
py
|
Python
|
example5.py
|
burgeaer/python
|
0cd0c1ea1a5849b8bc32ace9b2e3b67392ff6b79
|
[
"bzip2-1.0.6"
] | null | null | null |
example5.py
|
burgeaer/python
|
0cd0c1ea1a5849b8bc32ace9b2e3b67392ff6b79
|
[
"bzip2-1.0.6"
] | null | null | null |
example5.py
|
burgeaer/python
|
0cd0c1ea1a5849b8bc32ace9b2e3b67392ff6b79
|
[
"bzip2-1.0.6"
] | null | null | null |
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> archimedes
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
archimedes
NameError: name 'archimedes' is not defined
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
>>> archimedes
<function archimedes at 0x00000142D3C0FDC0>
>>> archimedes(8)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
archimedes(8)
File "C:/Program Files/Python38/archimedes.py", line 7, in archimedes
oneHalfSideS = math.sin(math.radian(halfAngleA))
AttributeError: module 'math' has no attribute 'radian'
>>> archimedes(8)
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
archimedes(8)
File "C:/Program Files/Python38/archimedes.py", line 7, in archimedes
oneHalfSideS = math.sin(math.radian(halfAngleA))
AttributeError: module 'math' has no attribute 'radian'
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
>>> archimedes
<function archimedes at 0x0000027C2267FDC0>
>>> archimedes(8)
3.0614674589207183
>>> archimedes(16)
3.121445152258052
>>> archimedes(100)
3.141075907812829
>>>
>>> for sides in range(8, 100, 8):
print(sides, archimedes(sides))
8 3.0614674589207183
16 3.121445152258052
24 3.1326286132812378
32 3.1365484905459393
40 3.1383638291137976
48 3.1393502030468667
56 3.13994504528274
64 3.140331156954753
72 3.140595890304192
80 3.140785260725489
88 3.14092537783028
96 3.1410319508905093
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
>>> archimedes
<function archimedes at 0x0000020BCD31FDC0>
>>> archimedes(8)
3.0614674589207183
>>> archimedes(16)
3.121445152258052
>>> archimedes(100)
3.141075907812829
>>>
>>> for sides in range(8,100,8):
print(sides, archimedes(sides))
8 3.0614674589207183
16 3.121445152258052
24 3.1326286132812378
32 3.1365484905459393
40 3.1383638291137976
48 3.1393502030468667
56 3.13994504528274
64 3.140331156954753
72 3.140595890304192
80 3.140785260725489
88 3.14092537783028
96 3.1410319508905093
>>> archimedes - pi
Traceback (most recent call last):
File "<pyshell#20>", line 1, in <module>
archimedes - pi
NameError: name 'pi' is not defined
>>> archimedes(pi)
Traceback (most recent call last):
File "<pyshell#21>", line 1, in <module>
archimedes(pi)
NameError: name 'pi' is not defined
>>> print(archimedes - 3.14)
Traceback (most recent call last):
File "<pyshell#22>", line 1, in <module>
print(archimedes - 3.14)
TypeError: unsupported operand type(s) for -: 'function' and 'float'
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
Traceback (most recent call last):
File "C:/Program Files/Python38/archimedes.py", line 11, in <module>
print(archimedes - pi)
NameError: name 'pi' is not defined
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
Traceback (most recent call last):
File "C:/Program Files/Python38/archimedes.py", line 11, in <module>
print(archimedes - 3.14)
TypeError: unsupported operand type(s) for -: 'function' and 'float'
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
Traceback (most recent call last):
File "C:/Program Files/Python38/archimedes.py", line 11, in <module>
print(archimedes - math.pi)
TypeError: unsupported operand type(s) for -: 'function' and 'float'
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
Traceback (most recent call last):
File "C:/Program Files/Python38/archimedes.py", line 11, in <module>
print(numSides - math.pi)
NameError: name 'numSides' is not defined
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
>>> archimedes
<function archimedes at 0x0000023AA059FDC0>
>>> archimedes - math.pi
Traceback (most recent call last):
File "<pyshell#24>", line 1, in <module>
archimedes - math.pi
TypeError: unsupported operand type(s) for -: 'function' and 'float'
>>>
=============== RESTART: C:/Program Files/Python38/archimedes.py ===============
>>> archimedes
<function archimedes at 0x000002AE9869FDC0>
>>> archimedes
<function archimedes at 0x000002AE9869FDC0>
>>> archimedes(8)
3.0614674589207183
>>> archimedes(16)
3.121445152258052
>>> archimedes(100)
3.141075907812829
>>>
>>> for sides in range(8, 100, 8):
print(sides, archimedes(sides))
8 3.0614674589207183
16 3.121445152258052
24 3.1326286132812378
32 3.1365484905459393
40 3.1383638291137976
48 3.1393502030468667
56 3.13994504528274
64 3.140331156954753
72 3.140595890304192
80 3.140785260725489
88 3.14092537783028
96 3.1410319508905093
>>> print(sides, archimedes(sides), math.pi))
SyntaxError: unmatched ')'
>>> print(sides, archimedes(sides), math.pi)
96 3.1410319508905093 3.141592653589793
>>> print(sides, archimedes(sides)) - math.pi
96 3.1410319508905093
Traceback (most recent call last):
File "<pyshell#36>", line 1, in <module>
print(sides, archimedes(sides)) - math.pi
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
>>> print
<built-in function print>
>>> print(sides, archimedes(sides)) - (math.pi)
96 3.1410319508905093
Traceback (most recent call last):
File "<pyshell#38>", line 1, in <module>
print(sides, archimedes(sides)) - (math.pi)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
>>> print(sides, archimedes(sides), math.pi)
96 3.1410319508905093 3.141592653589793
>>> print(sides, (math.pi - archimedes(sides)))
96 0.000560702699283766
>>>
| 32.716667
| 95
| 0.679572
| 727
| 5,889
| 5.504814
| 0.162311
| 0.029985
| 0.048726
| 0.078711
| 0.904048
| 0.893803
| 0.869565
| 0.850575
| 0.836332
| 0.786857
| 0
| 0.229705
| 0.152827
| 5,889
| 179
| 96
| 32.899441
| 0.572459
| 0
| 0
| 0.780347
| 0
| 0
| 0.085989
| 0.029422
| 0
| 0
| 0.018914
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.109827
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
47004b09a1a2bcb088f197da95ca93bfde42de54
| 6,833
|
py
|
Python
|
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/SUN/vertex.py
|
JE-Chen/je_old_repo
|
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
|
[
"MIT"
] | null | null | null |
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/SUN/vertex.py
|
JE-Chen/je_old_repo
|
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
|
[
"MIT"
] | null | null | null |
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/SUN/vertex.py
|
JE-Chen/je_old_repo
|
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
|
[
"MIT"
] | null | null | null |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GL_SUN_vertex'
def _f( function ):
return _p.createFunction( function,_p.PLATFORM.GL,'GL_SUN_vertex',error_checker=_errors._error_checker)
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glColor3fVertex3fSUN(r,g,b,x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray)
def glColor3fVertex3fvSUN(c,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glColor4fNormal3fVertex3fSUN(r,g,b,a,nx,ny,nz,x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glColor4fNormal3fVertex3fvSUN(c,n,v):pass
@_f
@_p.types(None,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLfloat,_cs.GLfloat)
def glColor4ubVertex2fSUN(r,g,b,a,x,y):pass
@_f
@_p.types(None,arrays.GLubyteArray,arrays.GLfloatArray)
def glColor4ubVertex2fvSUN(c,v):pass
@_f
@_p.types(None,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glColor4ubVertex3fSUN(r,g,b,a,x,y,z):pass
@_f
@_p.types(None,arrays.GLubyteArray,arrays.GLfloatArray)
def glColor4ubVertex3fvSUN(c,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glNormal3fVertex3fSUN(nx,ny,nz,x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray)
def glNormal3fVertex3fvSUN(n,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glReplacementCodeuiColor3fVertex3fSUN(rc,r,g,b,x,y,z):pass
@_f
@_p.types(None,arrays.GLuintArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glReplacementCodeuiColor3fVertex3fvSUN(rc,c,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glReplacementCodeuiColor4fNormal3fVertex3fSUN(rc,r,g,b,a,nx,ny,nz,x,y,z):pass
@_f
@_p.types(None,arrays.GLuintArray,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glReplacementCodeuiColor4fNormal3fVertex3fvSUN(rc,c,n,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glReplacementCodeuiColor4ubVertex3fSUN(rc,r,g,b,a,x,y,z):pass
@_f
@_p.types(None,arrays.GLuintArray,arrays.GLubyteArray,arrays.GLfloatArray)
def glReplacementCodeuiColor4ubVertex3fvSUN(rc,c,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glReplacementCodeuiNormal3fVertex3fSUN(rc,nx,ny,nz,x,y,z):pass
@_f
@_p.types(None,arrays.GLuintArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glReplacementCodeuiNormal3fVertex3fvSUN(rc,n,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(rc,s,t,r,g,b,a,nx,ny,nz,x,y,z):pass
@_f
@_p.types(None,arrays.GLuintArray,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(rc,tc,c,n,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(rc,s,t,nx,ny,nz,x,y,z):pass
@_f
@_p.types(None,arrays.GLuintArray,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(rc,tc,n,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glReplacementCodeuiTexCoord2fVertex3fSUN(rc,s,t,x,y,z):pass
@_f
@_p.types(None,arrays.GLuintArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glReplacementCodeuiTexCoord2fVertex3fvSUN(rc,tc,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glReplacementCodeuiVertex3fSUN(rc,x,y,z):pass
@_f
@_p.types(None,arrays.GLuintArray,arrays.GLfloatArray)
def glReplacementCodeuiVertex3fvSUN(rc,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glTexCoord2fColor3fVertex3fSUN(s,t,r,g,b,x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glTexCoord2fColor3fVertex3fvSUN(tc,c,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glTexCoord2fColor4fNormal3fVertex3fSUN(s,t,r,g,b,a,nx,ny,nz,x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glTexCoord2fColor4fNormal3fVertex3fvSUN(tc,c,n,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glTexCoord2fColor4ubVertex3fSUN(s,t,r,g,b,a,x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLubyteArray,arrays.GLfloatArray)
def glTexCoord2fColor4ubVertex3fvSUN(tc,c,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glTexCoord2fNormal3fVertex3fSUN(s,t,nx,ny,nz,x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glTexCoord2fNormal3fVertex3fvSUN(tc,n,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glTexCoord2fVertex3fSUN(s,t,x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray)
def glTexCoord2fVertex3fvSUN(tc,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glTexCoord4fColor4fNormal3fVertex4fSUN(s,t,p,q,r,g,b,a,nx,ny,nz,x,y,z,w):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray,arrays.GLfloatArray)
def glTexCoord4fColor4fNormal3fVertex4fvSUN(tc,c,n,v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glTexCoord4fVertex4fSUN(s,t,p,q,x,y,z,w):pass
@_f
@_p.types(None,arrays.GLfloatArray,arrays.GLfloatArray)
def glTexCoord4fVertex4fvSUN(tc,v):pass
| 50.614815
| 196
| 0.802576
| 1,027
| 6,833
| 5.081792
| 0.104187
| 0.24315
| 0.25503
| 0.413872
| 0.680399
| 0.653573
| 0.652041
| 0.651466
| 0.650508
| 0.645334
| 0
| 0.015748
| 0.0521
| 6,833
| 134
| 197
| 50.992537
| 0.790026
| 0.014635
| 0
| 0.488372
| 1
| 0
| 0.003944
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.317829
| false
| 0.310078
| 0.046512
| 0.007752
| 0.372093
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 7
|
4728e20798c5d4fc292dd5528514916d3945e609
| 2,235
|
py
|
Python
|
mainsite/migrations/0011_auto_20171110_1057.py
|
sighill/orchid
|
e91e51b408f89b96c38da3c97e8ba8c04d0148aa
|
[
"MIT"
] | null | null | null |
mainsite/migrations/0011_auto_20171110_1057.py
|
sighill/orchid
|
e91e51b408f89b96c38da3c97e8ba8c04d0148aa
|
[
"MIT"
] | null | null | null |
mainsite/migrations/0011_auto_20171110_1057.py
|
sighill/orchid
|
e91e51b408f89b96c38da3c97e8ba8c04d0148aa
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-10 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0010_auto_20171110_0956'),
]
operations = [
migrations.AddField(
model_name='orchidee',
name='arrosage',
field=models.CharField(choices=[('Modéré', 'Modéré'), ('Maintenir humide', 'Maintenir humide'), ('Arrosage copieux', 'Arrosage copieux')], default='Chaud', max_length=50),
preserve_default=False,
),
migrations.AddField(
model_name='orchidee',
name='lumiere',
field=models.CharField(choices=[('Ombre', 'Ombre'), ('Mi-ombre', 'Mi-ombre'), ('Lumière modérée', 'Lumière modérée'), ('Forte lumière', 'Forte lumière'), ('Soleil', 'Soleil')], default='Ombre', max_length=50),
preserve_default=False,
),
migrations.AddField(
model_name='orchidee',
name='temperature',
field=models.CharField(choices=[('Chaud', 'Chaud'), ('Tempéré', 'Tempéré'), ('Froid', 'Froid')], default='Modéré', max_length=50),
preserve_default=False,
),
migrations.AddField(
model_name='plante',
name='arrosage',
field=models.CharField(choices=[('Modéré', 'Modéré'), ('Maintenir humide', 'Maintenir humide'), ('Arrosage copieux', 'Arrosage copieux')], default='Modéré', max_length=50),
preserve_default=False,
),
migrations.AddField(
model_name='plante',
name='lumiere',
field=models.CharField(choices=[('Ombre', 'Ombre'), ('Mi-ombre', 'Mi-ombre'), ('Lumière modérée', 'Lumière modérée'), ('Forte lumière', 'Forte lumière'), ('Soleil', 'Soleil')], default='Ombre', max_length=50),
preserve_default=False,
),
migrations.AddField(
model_name='plante',
name='temperature',
field=models.CharField(choices=[('Chaud', 'Chaud'), ('Tempéré', 'Tempéré'), ('Froid', 'Froid')], default='Froid', max_length=50),
preserve_default=False,
),
]
| 42.980769
| 221
| 0.585682
| 215
| 2,235
| 5.967442
| 0.283721
| 0.084178
| 0.10756
| 0.126267
| 0.841777
| 0.841777
| 0.790335
| 0.790335
| 0.790335
| 0.790335
| 0
| 0.02669
| 0.245638
| 2,235
| 51
| 222
| 43.823529
| 0.734282
| 0.030425
| 0
| 0.727273
| 1
| 0
| 0.261091
| 0.010628
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.045455
| 0
| 0.113636
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
5b2603d7bab2ccd075232985f6add478cc8dc4c6
| 1,786
|
py
|
Python
|
test/translator/timestamp_translator_test.py
|
RayzeEU/willhaben-scrapper
|
d350f8d905f38e1e453bc4014b2a944613ae5594
|
[
"MIT"
] | 4
|
2021-09-17T18:52:48.000Z
|
2022-01-17T08:23:23.000Z
|
test/translator/timestamp_translator_test.py
|
RayzeEU/willhaben-scrapper
|
d350f8d905f38e1e453bc4014b2a944613ae5594
|
[
"MIT"
] | 22
|
2021-09-20T14:23:33.000Z
|
2022-01-21T17:16:33.000Z
|
test/translator/timestamp_translator_test.py
|
RayzeEU/willhaben-scrapper
|
d350f8d905f38e1e453bc4014b2a944613ae5594
|
[
"MIT"
] | 1
|
2021-09-17T18:57:04.000Z
|
2021-09-17T18:57:04.000Z
|
from src.translator.timestamp_translator import TimestampTranslator
def test__given_date_string_for_today__when_text_to_timestamp_or_max_if_not_today__then_right_date():
datetime = TimestampTranslator.text_to_timestamp_or_max_if_not_today("Heute, 21:18 Uhr")
assert datetime == datetime.today().replace(hour=21, minute=18, second=0, microsecond=0)
def test__given_date_string_for_today_without_text_uhr__when_text_to_timestamp_or_max_if_not_today__then_right_date():
datetime = TimestampTranslator.text_to_timestamp_or_max_if_not_today("Heute, 21:18")
assert datetime == datetime.today().replace(hour=21, minute=18, second=0, microsecond=0)
def test__given_invalid_date_string_for_today__when_text_to_timestamp_or_max_if_not_today__then_exception():
datetime = TimestampTranslator.text_to_timestamp_or_max_if_not_today("Heute, 121:18")
assert datetime == datetime.max
def test__given_date_string_not_for_today__when_text_to_timestamp_or_max_if_not_today__then_right_date():
datetime = TimestampTranslator.text_to_timestamp_or_max_if_not_today("16.12. - 20:37 Uhr")
assert datetime == datetime.today().replace(month=12, day=16, hour=20, minute=37, second=0, microsecond=0)
def test__given_date_string_not_for_today_without_text_uhr__when_text_to_timestamp_or_max_if_not_today__then_right_date():
datetime = TimestampTranslator.text_to_timestamp_or_max_if_not_today("16.12. - 20:37")
assert datetime == datetime.today().replace(month=12, day=16, hour=20, minute=37, second=0, microsecond=0)
def test__given_invalid_date_string_not_for_today__when_text_to_timestamp_or_max_if_not_today__then_exception():
datetime = TimestampTranslator.text_to_timestamp_or_max_if_not_today("16.12. - 200:37 Uhr")
assert datetime == datetime.max
| 55.8125
| 122
| 0.835386
| 282
| 1,786
| 4.680851
| 0.159574
| 0.054545
| 0.136364
| 0.154545
| 0.926515
| 0.906061
| 0.901515
| 0.892424
| 0.881061
| 0.865909
| 0
| 0.042683
| 0.081747
| 1,786
| 31
| 123
| 57.612903
| 0.762195
| 0
| 0
| 0.315789
| 0
| 0
| 0.051512
| 0
| 0
| 0
| 0
| 0
| 0.315789
| 1
| 0.315789
| false
| 0
| 0.052632
| 0
| 0.368421
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
5b508ef4ccc537193269019eeb0ca97bd0dcb942
| 41,196
|
py
|
Python
|
ParlAI/parlai/mturk/tasks/context_evaluator/worlds_onboard.py
|
solomon-han/convince
|
8d32118b3339fc9820aa59af4815f87eaca95f24
|
[
"Apache-2.0"
] | 24
|
2019-09-16T00:10:54.000Z
|
2021-09-08T19:31:51.000Z
|
ParlAI/parlai/mturk/tasks/context_evaluator/worlds_onboard.py
|
solomon-han/convince
|
8d32118b3339fc9820aa59af4815f87eaca95f24
|
[
"Apache-2.0"
] | null | null | null |
ParlAI/parlai/mturk/tasks/context_evaluator/worlds_onboard.py
|
solomon-han/convince
|
8d32118b3339fc9820aa59af4815f87eaca95f24
|
[
"Apache-2.0"
] | 7
|
2019-09-16T02:37:31.000Z
|
2021-09-01T06:06:17.000Z
|
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.mturk.core.worlds import MTurkOnboardWorld
import math
import time
class ContextEvaluationOnboardWorld(MTurkOnboardWorld):
"""Example onboarding world. Sends a message from the world to the
worker and then exits as complete
"""
def __init__(self, opt, mturk_agent):
# MTurkOnboardWorld init
self.mturk_agent = mturk_agent
print(self.mturk_agent.worker_id, '| INIT ONBOARD WORLD')
self.episodeDone = False
self.passed_test = None
self.cur_example_no = 1
self.num_incorrect = 0
self.options = ['A', 'B', 'C', 'D'] # Always use all 4 answer-options for practice questions.
self.prompt_types = [opt['prompt_type']]
assert len(self.prompt_types) == 1, 'Using multiple prompt_types not yet supported.'
self.wrong_threshold = {
'question': .25,
'quote and question': .25,
'question and quotes': .25,
'quotes and question': 0.,
'passage and question': 0.,
}[self.prompt_types[0]]
self.test_questions = {
'question': [
{
'text': 'When Fred opens his pantry, he is surprised the banana is not colored _.\n\n' +
'A. Gray-ish blue\n' +
'B. Purple and pink\n' +
'C. Green or yellow\n' +
'D. Plain white',
'answer': 'C',
},
{
'text': 'He who considers himself to be better and more important than others is likely to _.\n\n' +
'A. have his head in the clouds\n' +
'B. be easy to deal with\n' +
'C. have "common sense"\n' +
'D. have a "big head"',
'answer': 'D',
},
{
'text': 'What does Alan\'s grandfather do every Sunday?\n\n' +
'A. He hosts crazy parties.\n' +
'B. He studies for the medical school entrance exam.\n' +
'C. He flies to Hawaii and back.\n' +
'D. He goes to church with his wife.',
'answer': 'D',
},
],
'quote and question': [
{
'text': '"Wow, I never knew a banana could be that color."\n\n' +
'When Fred opens his pantry, he is surprised the banana is not colored _.\n\n' +
'A. Gray-ish blue\n' +
'B. Purple and pink\n' +
'C. Green or yellow\n' +
'D. Plain white',
'answer': 'C',
},
{
'text': 'The film Schindler\'s List also takes place during World War Two.\n\n' +
'What\'s the similarity between Saving Private Ryan and Schindler\'s List?\n\n' +
'A. They are both humorous.\n' +
'B. They were released at the same time.\n' +
'C. They are both American movies.\n' +
'D. They both happen during World War Two.',
'answer': 'D',
},
{
'text': 'They are like sheep being led to the slaughterhouse.\n\n'
'The main idea of this passage is that _ .\n\n' +
'A. Farm animals suffer gruesome deaths.\n' +
'B. In every school there is a "top" crowd that sets the pace.\n' +
'C. At one time or another you probably did something you knew to be wrong.\n'
'D. It is a mistake to follow the "top" crowd blindly.',
'answer': 'D',
},
],
'question and quotes': [
{
'text': """
Which is TRUE about LIFE WATERR?
Quote: “* If you are taking any special medication or have stomach problems, please check with the doctor before buying LIFE WATERR.”
A: It can't be sold without a doctor.
Quote: “You need LIFE WATERR when you feel thirsty after working in the office a long time.”
B: It's also good for stomach problems.
Quote: “For only a little money, you will feel great!”
C: It's not expensive.
Quote: “It\'s purified H2O straight from the Pacific Ocean.”
D: It's made from spring water in the mountains.""",
'answer': 'C',
'explanation': """
The quote for C provides direct evidence supporting it\'s answer option. Other quotes either only provide indirect support or contradict their associated answer.
Just to give you an idea, the quotes were from this passage:
You need LIFE WATERR when you feel thirsty after working in the office a long time.\nIt\'s purified H2O straight from the Pacific Ocean.\nFor only a little money, you will feel great again!\nGet LIFE WATERR at the stores near your house NOW!\n* If you are taking any special medication or have stomach problems, please check with the doctor before buying LIFE WATERR.
""",
},
{
'text': """
What does the man prefer to work for?
Quote: “Woman: How do you like your new job?”
A: A company of his own.
Quote: “Woman: You see, small businesses have a common problem: only the two or three people who run it can make decisions, and the employees may not be very happy because they can't make decisions.”
B: A small company.
Quote: “Man: But large companies also have a common problem, so many people are making decisions that sometimes it is a waste of time and money.”
C: A large company.
Quote: “Man: I like a small company because it's more exciting.”
D: He prefers not to work.""",
'answer': 'B',
'explanation': """
Here, no quotes support their associated answer. However, answer B's quote supports that the man doesn't like large companies, and answer D's quote supports that the man does like small companies. From this, we can infer that B is correct.
Just to give you an idea, the quotes were from this passage:
"Woman: How do you like your new job?",
"Man: I like it very much. This is a nice company to work for.",
"Woman: You worked for a large company before, didn't you?",
"Man: Yes, I did. But I prefer a small company.",
"Woman: Is it really different?",
"Man: Oh, yes. It's much different. I like a small company because it's more exciting.",
"Woman: You mean a large company is boring to work for?",
"Man: No, it's not boring. But a large company has too many people and because it is so big that two or three people couldn't possibly make all the important decisions.",
"Woman: You see, small businesses have a common problem: only the two or three people who run it can make decisions, and the employees may not be very happy because they can't make decisions.",
"Man: But large companies also have a common problem, so many people are making decisions that sometimes it is a waste of time and money.",
"Woman: Well, I guess there are problems everywhere.",
"Man: Yeah, but I still prefer working for a small company. It's more interesting and I'll keep more opportunities.\"""",
},
{
'text': """
Amy Smith is an _ dancer.
Quote: “Nothing is impossible in this world.”
A: Asian
Quote: “Nothing is impossible in this world.”
B: American
Quote: “.”
C: Argentinian
Quote: “Nothing is impossible in this world.”
D: Nigerian
""",
'answer': 'B',
'explanation': """
Since the quotes weren't very helpful, you'd have to guess based on her name only.
Just to give you an idea, the quotes were from this passage:
Amy Smith, a famous dancer from the U.S., had to have her right leg cut after a car accident. She was also cut off on her career road.\nThough the accident brought her bright career to a stop, she didn't give up. In the painful months that followed, Amy met a doctor who developed a man-made leg for her. So strongly, she wanted to go back to dancing. Amy believed in herself and she thought she could realize her dream.\n\nAfter every public recital, she would ask her dad about her performance. \"You still have a long way to go\" was the answer she used to get in return. In January 1984, Amy made a historic comeback by giving a public recital in Los Angeles. She performed in such a great manner that it moved everyone to tears. That evening when she asked her dad the usual question, he didn't say anything. He just touched her feet as a praise. Amy's comeback was so moving that a film producer decided to make the story into a hit film.\n\nWhen someone asked Amy how she had managed to dance again, she said quite simply, \"You don't need feet to dance!\" Nothing is impossible in this world. If you have the will to win, you can achieve anything.""",
},
{
'text': """
According to the passage, the key responsibilities include _.
Quote: “* Participate in and contribute to the budget and business planning cycle.”
A: taking charge of production work
Quote: “* Good at day to day leading and coaching.”
B: working on training programs
Quote: “* Conduct market and product research; maintain data base by identifying and gathering marketing information.”
C: maintaining data base of marketing information.
Quote: “* Good at day to day leading and coaching.”
D: serving as a network technician""",
'answer': 'C',
'explanation': """
Answer C's quote provides direct evidence supporting C. Other quotes only indirectly support their associated answer.
Just to give you an idea, the quotes were from this passage:
Key responsibilities:\n* Manage the whole marketing activities, i.e. brand building, market research and integrated-marketing functions.\n* Develop and evaluate brand activities including the development of promotional activities, advertising and merchandising.\n* Obtain market share by developing marketing plans and programs for key brands.\n* Conduct market and product research; maintain data base by identifying and gathering marketing information.\n* Understand market/competitor intelligence and cooperate with the sales teams in developing the appropriate marketing strategies.\n* Keep contacts and exchange of information with regional operations on marketing issues.\n* Participate in and contribute to the budget and business planning cycle.\n* Supervise the project to establish company websites.\n* Complete marketing department operational requirements by scheduling and assigning employees; develop, maintain, evaluate and lead the marketing team of pan-China.\n* Serve as a member of the senior management team providing input and direction on the company's strategic and operational goals and objects.\nRequirements:\n* University degree or above, MBA is a plus.\n* At least Bi-lingual: Chinese and English, any other language is a plus.\n* Strong wits and oral communication skills; analytic skill; active listening.\n* Good at day to day leading and coaching.\n* More than 10 years working experience in sales and marketing of _ industry, including at least 5 years management experience; professional in marketing function.\nEmployer introduction:\nSummergate was established in 1999 to import, distribute and market some of the world's best wines to the Chinese market. Today Summergate represents more than 60 wineries from 12 countries around the world.\nWith offices in Beijing, Shanghai; Shenzhen, Guangzhou, Macau and now Hong Kong, Summergate services the entire China market. We distribute and market our brands to all the major food and beverage operators in China, establishing solid business partnerships with national hotel groups as well as all China retail chains and fine dining western and Chinese restaurants.""",
},
{
'text': """
Why did the Prior complain about the delay?
Quote: “The creative artist needs time for contemplation; he may be busiest when his hands are idlest.”
A: Because he knew that genius might be busiest when seemingly idlest.
Quote: “Leonardo was slightly unhappy and explained to somebody else that there is a great difference between the work of the creative artist and the stonemason.”
B: Because he liked the work of a stonemason.
Quote: “But he would look no further; if none came his way, he would be satisfied to take Prior as a model for Judas.”
C: Because he was eager to be taken as a model for Judas.
Quote: “This inactivity aroused the anger of the fussy Prior, the head of the church, who belonged to the large group of those who believed that the busier a man seems, the more he accomplishes; and so he tried to find fault with the idle painter.”
D: Because he thought that the painter idled most of the hours.""",
'answer': 'D',
'explanation': """
Here, all quotes are related to their respective answers. However, answer D and its quote respond to the question in the most plausible manner.
Just to give you an idea, the quotes were from this passage:
The Last Supper is regarded as one of the supreme masterpieces in the whole field of pictorial art. Tradition has it that Leonardo Da Vinci worked for ten years upon the painting, the monks in the church annoyed at the delay. It was said that Leonardo often painted continuously from dawn to night without eating his meals. But at other times he spent hours before the picture, lost in contemplation, examining, comparing, and measuring his figures.\n\nThis inactivity aroused the anger of the fussy Prior, the head of the church, who belonged to the large group of those who believed that the busier a man seems, the more he accomplishes; and so he tried to find fault with the idle painter. Leonardo was slightly unhappy and explained to somebody else that there is a great difference between the work of the creative artist and the stonemason . The creative artist needs time for contemplation; he may be busiest when his hands are idlest. Just now he needed two heads to complete the picture: that of Christ, for which no model on earth could be found, for where was the man to be found whose face would express the strength, and beauty, and tenderness, and deep sorrow of the Christ; then he also needed a head of Judas, and that was hard to find as well, for where was the man whose face could express the meanness of that base traitor . But he would look no further; if none came his way, he would be satisfied to take Prior as a model for Judas. This threat silenced the angry Prior, who quite naturally had no desire to pass to descendants in such a fashion.""",
},
],
'quotes and question': [
{
'text': """
“You need LIFE WATERR when you feel thirsty after working in the office a long time. ... It\'s purified H2O straight from the Pacific Ocean. ... For only a little money, you will feel great! ... * If you are taking any special medication or have stomach problems, please check with the doctor before buying LIFE WATERR.”
Which is TRUE about LIFE WATERR?
A: It can't be sold without a doctor.
B: It's also good for stomach problems.
C: It's not expensive.
D: It's made from spring water in the mountains.""",
'answer': 'C',
'explanation': """
The quoted passage states that "For only a little money, you will feel great again!", which directly supports C. The quotes only indirectly support other answers.
Just to give you an idea, the quotes were from this passage:
You need LIFE WATERR when you feel thirsty after working in the office a long time.\nIt\'s purified H2O straight from the Pacific Ocean.\nFor only a little money, you will feel great again!\nGet LIFE WATERR at the stores near your house NOW!\n* If you are taking any special medication or have stomach problems, please check with the doctor before buying LIFE WATERR.""",
},
{
'text': """
“Woman: How do you like your new job? ... Man: I like a small company because it's more exciting. ... Woman: You see, small businesses have a common problem: only the two or three people who run it can make decisions, and the employees may not be very happy because they can't make decisions. ... Man: But large companies also have a common problem, so many people are making decisions that sometimes it is a waste of time and money.”
What does the man prefer to work for?
A: A company of his own.
B: A small company.
C: A large company.
D: He prefers not to work.""",
'answer': 'B',
'explanation': """
B is correct, as the quoted sentences support that the man likes working at a small company and not at a large company.
Just to give you an idea, the quotes were from this passage:
"Woman: How do you like your new job?",
"Man: I like it very much. This is a nice company to work for.",
"Woman: You worked for a large company before, didn't you?",
"Man: Yes, I did. But I prefer a small company.",
"Woman: Is it really different?",
"Man: Oh, yes. It's much different. I like a small company because it's more exciting.",
"Woman: You mean a large company is boring to work for?",
"Man: No, it's not boring. But a large company has too many people and because it is so big that two or three people couldn't possibly make all the important decisions.",
"Woman: You see, small businesses have a common problem: only the two or three people who run it can make decisions, and the employees may not be very happy because they can't make decisions.",
"Man: But large companies also have a common problem, so many people are making decisions that sometimes it is a waste of time and money.",
"Woman: Well, I guess there are problems everywhere.",
"Man: Yeah, but I still prefer working for a small company. It's more interesting and I'll keep more opportunities.\"""",
},
{
'text': """
“. ... Nothing is impossible in this world. ... ? ... .”
Amy Smith is an _ dancer.
A: Asian
B: American
C: Argentinian
D: Nigerian
""",
'answer': 'B',
'explanation': """
Since the quotes weren't very helpful, you'd have to guess based on her name only.
Just to give you an idea, the quotes were from this passage:
Amy Smith, a famous dancer from the U.S., had to have her right leg cut after a car accident. She was also cut off on her career road.\nThough the accident brought her bright career to a stop, she didn't give up. In the painful months that followed, Amy met a doctor who developed a man-made leg for her. So strongly, she wanted to go back to dancing. Amy believed in herself and she thought she could realize her dream.\n\nAfter every public recital, she would ask her dad about her performance. \"You still have a long way to go\" was the answer she used to get in return. In January 1984, Amy made a historic comeback by giving a public recital in Los Angeles. She performed in such a great manner that it moved everyone to tears. That evening when she asked her dad the usual question, he didn't say anything. He just touched her feet as a praise. Amy's comeback was so moving that a film producer decided to make the story into a hit film.\n\nWhen someone asked Amy how she had managed to dance again, she said quite simply, \"You don't need feet to dance!\" Nothing is impossible in this world. If you have the will to win, you can achieve anything.""",
},
{
'text': """
“* Conduct market and product research; maintain data base by identifying and gathering marketing information. ... * Participate in and contribute to the budget and business planning cycle. ... * Good at day to day leading and coaching.”
According to the passage, the key responsibilities include _.
A: taking charge of production work
B: working on training programs
C: maintaining data base of marketing information.
D: serving as a network technician""",
'answer': 'C',
'explanation': """
The role lists a responsibility to "maintain data base by identifying and gathering marketing information," which directly supports answer C. The quotes only support other answers indirectly.
Just to give you an idea, the quotes were from this passage:
Key responsibilities:\n* Manage the whole marketing activities, i.e. brand building, market research and integrated-marketing functions.\n* Develop and evaluate brand activities including the development of promotional activities, advertising and merchandising.\n* Obtain market share by developing marketing plans and programs for key brands.\n* Conduct market and product research; maintain data base by identifying and gathering marketing information.\n* Understand market/competitor intelligence and cooperate with the sales teams in developing the appropriate marketing strategies.\n* Keep contacts and exchange of information with regional operations on marketing issues.\n* Participate in and contribute to the budget and business planning cycle.\n* Supervise the project to establish company websites.\n* Complete marketing department operational requirements by scheduling and assigning employees; develop, maintain, evaluate and lead the marketing team of pan-China.\n* Serve as a member of the senior management team providing input and direction on the company's strategic and operational goals and objects.\nRequirements:\n* University degree or above, MBA is a plus.\n* At least Bi-lingual: Chinese and English, any other language is a plus.\n* Strong wits and oral communication skills; analytic skill; active listening.\n* Good at day to day leading and coaching.\n* More than 10 years working experience in sales and marketing of _ industry, including at least 5 years management experience; professional in marketing function.\nEmployer introduction:\nSummergate was established in 1999 to import, distribute and market some of the world's best wines to the Chinese market. Today Summergate represents more than 60 wineries from 12 countries around the world.\nWith offices in Beijing, Shanghai; Shenzhen, Guangzhou, Macau and now Hong Kong, Summergate services the entire China market. We distribute and market our brands to all the major food and beverage operators in China, establishing solid business partnerships with national hotel groups as well as all China retail chains and fine dining western and Chinese restaurants.""",
},
{
'text': """
“This inactivity aroused the anger of the fussy Prior, the head of the church, who belonged to the large group of those who believed that the busier a man seems, the more he accomplishes; and so he tried to find fault with the idle painter. ... Leonardo was slightly unhappy and explained to somebody else that there is a great difference between the work of the creative artist and the stonemason. ... The creative artist needs time for contemplation; he may be busiest when his hands are idlest. ... But he would look no further; if none came his way, he would be satisfied to take Prior as a model for Judas.”
Why did the Prior complain about the delay?
A: Because he knew that genius might be busiest when seemingly idlest.
B: Because he liked the work of a stonemason.
C: Because he was eager to be taken as a model for Judas.
D: Because he thought that the painter idled most of the hours.""",
'answer': 'D',
'explanation': """
The first quoted sentence most directly answers the question, and it supports answer D.
Just to give you an idea, the quotes were from this passage:
The Last Supper is regarded as one of the supreme masterpieces in the whole field of pictorial art. Tradition has it that Leonardo Da Vinci worked for ten years upon the painting, the monks in the church annoyed at the delay. It was said that Leonardo often painted continuously from dawn to night without eating his meals. But at other times he spent hours before the picture, lost in contemplation, examining, comparing, and measuring his figures.\n\nThis inactivity aroused the anger of the fussy Prior, the head of the church, who belonged to the large group of those who believed that the busier a man seems, the more he accomplishes; and so he tried to find fault with the idle painter. Leonardo was slightly unhappy and explained to somebody else that there is a great difference between the work of the creative artist and the stonemason . The creative artist needs time for contemplation; he may be busiest when his hands are idlest. Just now he needed two heads to complete the picture: that of Christ, for which no model on earth could be found, for where was the man to be found whose face would express the strength, and beauty, and tenderness, and deep sorrow of the Christ; then he also needed a head of Judas, and that was hard to find as well, for where was the man whose face could express the meanness of that base traitor . But he would look no further; if none came his way, he would be satisfied to take Prior as a model for Judas. This threat silenced the angry Prior, who quite naturally had no desire to pass to descendants in such a fashion.""",
},
],
'passage and question': [
{
'text': """
You need LIFE WATERR when you feel thirsty after working in the office a long time.\nIt\'s purified H2O straight from the Pacific Ocean.\nFor only a little money, you will feel great again!\nGet LIFE WATERR at the stores near your house NOW!\n* If you are taking any special medication or have stomach problems, please check with the doctor before buying LIFE WATERR.
Which is TRUE about LIFE WATERR?
A: It can't be sold without a doctor.
B: It's also good for stomach problems.
C: It's not expensive.
D: It's made from spring water in the mountains.""",
'answer': 'C',
'explanation': """The passage states that "For only a little money, you will feel great again!", which directly supports C. The passage only indirectly supports other answers.""",
},
{
'text': """
"Woman: How do you like your new job?",
"Man: I like it very much. This is a nice company to work for.",
"Woman: You worked for a large company before, didn't you?",
"Man: Yes, I did. But I prefer a small company.",
"Woman: Is it really different?",
"Man: Oh, yes. It's much different. I like a small company because it's more exciting.",
"Woman: You mean a large company is boring to work for?",
"Man: No, it's not boring. But a large company has too many people and because it is so big that two or three people couldn't possibly make all the important decisions.",
"Woman: You see, small businesses have a common problem: only the two or three people who run it can make decisions, and the employees may not be very happy because they can't make decisions.",
"Man: But large companies also have a common problem, so many people are making decisions that sometimes it is a waste of time and money.",
"Woman: Well, I guess there are problems everywhere.",
"Man: Yeah, but I still prefer working for a small company. It's more interesting and I'll keep more opportunities."
What does the man prefer to work for?
A: A company of his own.
B: A small company.
C: A large company.
D: He prefers not to work.""",
'answer': 'B',
'explanation': """The man states he finds a small company more exciting and that he is frustrated that large companies have too many people.""",
},
{
'text': """
Key responsibilities:\n* Manage the whole marketing activities, i.e. brand building, market research and integrated-marketing functions.\n* Develop and evaluate brand activities including the development of promotional activities, advertising and merchandising.\n* Obtain market share by developing marketing plans and programs for key brands.\n* Conduct market and product research; maintain data base by identifying and gathering marketing information.\n* Understand market/competitor intelligence and cooperate with the sales teams in developing the appropriate marketing strategies.\n* Keep contacts and exchange of information with regional operations on marketing issues.\n* Participate in and contribute to the budget and business planning cycle.\n* Supervise the project to establish company websites.\n* Complete marketing department operational requirements by scheduling and assigning employees; develop, maintain, evaluate and lead the marketing team of pan-China.\n* Serve as a member of the senior management team providing input and direction on the company's strategic and operational goals and objects.\nRequirements:\n* University degree or above, MBA is a plus.\n* At least Bi-lingual: Chinese and English, any other language is a plus.\n* Strong wits and oral communication skills; analytic skill; active listening.\n* Good at day to day leading and coaching.\n* More than 10 years working experience in sales and marketing of _ industry, including at least 5 years management experience; professional in marketing function.\nEmployer introduction:\nSummergate was established in 1999 to import, distribute and market some of the world's best wines to the Chinese market. Today Summergate represents more than 60 wineries from 12 countries around the world.\nWith offices in Beijing, Shanghai; Shenzhen, Guangzhou, Macau and now Hong Kong, Summergate services the entire China market. We distribute and market our brands to all the major food and beverage operators in China, establishing solid business partnerships with national hotel groups as well as all China retail chains and fine dining western and Chinese restaurants.
According to the passage, the key responsibilities include _.
A: taking charge of production work
B: working on training programs
C: maintaining data base of marketing information.
D: serving as a network technician""",
'answer': 'C',
'explanation': """The role lists a responsibility to "maintain data base by identifying and gathering marketing information," which directly supports answer C. Other answers only have indirect support.""",
},
{
'text': """
The Last Supper is regarded as one of the supreme masterpieces in the whole field of pictorial art. Tradition has it that Leonardo Da Vinci worked for ten years upon the painting, the monks in the church annoyed at the delay. It was said that Leonardo often painted continuously from dawn to night without eating his meals. But at other times he spent hours before the picture, lost in contemplation, examining, comparing, and measuring his figures.\n\nThis inactivity aroused the anger of the fussy Prior, the head of the church, who belonged to the large group of those who believed that the busier a man seems, the more he accomplishes; and so he tried to find fault with the idle painter. Leonardo was slightly unhappy and explained to somebody else that there is a great difference between the work of the creative artist and the stonemason . The creative artist needs time for contemplation; he may be busiest when his hands are idlest. Just now he needed two heads to complete the picture: that of Christ, for which no model on earth could be found, for where was the man to be found whose face would express the strength, and beauty, and tenderness, and deep sorrow of the Christ; then he also needed a head of Judas, and that was hard to find as well, for where was the man whose face could express the meanness of that base traitor . But he would look no further; if none came his way, he would be satisfied to take Prior as a model for Judas. This threat silenced the angry Prior, who quite naturally had no desire to pass to descendants in such a fashion.
Why did the Prior complain about the delay?
A: Because he knew that genius might be busiest when seemingly idlest.
B: Because he liked the work of a stonemason.
C: Because he was eager to be taken as a model for Judas.
D: Because he thought that the painter idled most of the hours.""",
'answer': 'D',
'explanation': """The answer is contained in the sentence \"This inactivity aroused the anger of the fussy Prior... who believed that the busier a man seems, the more he accomplishes.\"""",
},
],
}
for prompt_type in self.test_questions.keys():
for i in range(len(self.test_questions[prompt_type])):
self.test_questions[prompt_type][i]['qid'] = prompt_type + '/' + str(i)
# random.shuffle(self.test_questions[prompt_type])
def parley(self):
prompt_type = self.prompt_types[0]
num_test = len(self.test_questions[prompt_type])
max_incorrect = int(math.floor(num_test * self.wrong_threshold))
self.mturk_agent.observe({
'episode_done': False,
'id': 'System',
'text': 'Welcome onboard! We\'ll first give you ' + str(num_test) +
' practice examples to help you understand the task. ' +
'To qualify for the HIT, you\'ll have to answer ' + str(num_test - max_incorrect) + ' correct.',
})
if prompt_type in {'question and quotes'}:
initial_understand_response, initial_understand_duration = self.get_response_and_duration({
'episode_done': False,
'id': 'System',
'text': 'Note: Answer-supporting quotes won\'t always be helpful; sometimes, you\'ll have to guess from the question and answers only. ' +
'Other times, the quote may contradict its answer or support a different answer.',
'task_data': {"respond_with_form": [{
"type": "choices",
"question": "Does this make sense?",
"choices": ['Yes, let\'s see a few examples.', 'Not really, but let\'s see a few examples.']
}]}
})
if initial_understand_response is None:
return
print(self.mturk_agent.worker_id, '| Makes sense?', initial_understand_response)
for test_question in self.test_questions[prompt_type]:
response = self.prompt_and_receive_response(test_question, prompt_type)
if response is None:
return
elif response != test_question['answer']:
print(self.mturk_agent.worker_id,
'| WRONG', test_question['qid'],
'| Answered', response, 'not', test_question['answer'])
self.num_incorrect += 1
# Soft block
if self.num_incorrect > max_incorrect:
print(self.mturk_agent.worker_id, '| SOFT BLOCK')
self.mturk_agent.mturk_manager.soft_block_worker(self.mturk_agent.worker_id)
self.passed_test = False
# Give feedback
self.mturk_agent.observe({
'episode_done': False,
'id': 'System',
'text': 'The correct answer was ' + test_question['answer'] + '.',
})
# Terminate qualifier if necessary
if self.num_incorrect > max_incorrect:
self.episodeDone = True
self.mturk_agent.observe({
'episode_done': True,
'id': 'System',
'text': 'Unfortunately, you did not qualify for our task at this time, but we hope to see you again soon!',
})
self.mturk_agent.set_hit_is_abandoned() # NB: May not be the right thing to do
return
else:
self.mturk_agent.observe({
'episode_done': False,
'id': 'System',
'text': 'Correct!',
})
if 'explanation' in test_question:
explanation_response, explanation_duration = self.get_response_and_duration({
'episode_done': False,
'id': 'System',
'text': test_question['explanation'],
'task_data': {"respond_with_form": [{
"type": "choices",
"question": "Ready to continue?",
"choices": ['Yes']
}]}
})
if explanation_response is None:
return
self.cur_example_no += 1
continue_choices = ['No, so I\'d rather not do the task.',
'Yes, but I\'d rather not do the task.',
'Yes, let\'s do the real task!']
continue_response, continue_duration = self.get_response_and_duration({
'episode_done': False,
'id': 'System',
'text': 'Does the task make sense?',
'task_data': {"respond_with_form": [{
"type": "choices",
"question": "Does the task make sense?",
"choices": continue_choices
}]}
})
if continue_response is None:
return
print(self.mturk_agent.worker_id, '| Continue?', continue_response)
if continue_response != continue_choices[-1]:
self.episodeDone = True
self.mturk_agent.observe({
'episode_done': True,
'id': 'System',
'text': 'No problem. Thanks for considering our HIT, and we hope to see you again soon!',
})
self.mturk_agent.set_hit_is_abandoned() # NB: May not be the right thing to do
return
self.passed_test = True
self.episodeDone = True
self.mturk_agent.observe({
'episode_done': True,
'id': 'System',
'text': 'Great! Advancing to the real task...',
})
time.sleep(3)
def prompt_and_receive_response(self, test_question, prompt_type):
prompt_text = test_question['text']
# Clear previous answer from form. Emphasize questions are unrelated.
self.mturk_agent.observe({
'episode_done': False,
'id': 'New ' + prompt_type,
'text': None,
'task_data': {"respond_with_form": None},
})
# Data collection prompt
response, duration = self.get_response_and_duration({
'episode_done': False,
'id': '(#' + str(self.cur_example_no) + ')',
'text': prompt_text,
'task_data': {"respond_with_form": [{
"type": "choices",
"question": "Which option is most likely correct?",
"choices": self.options
}]}
})
if response is None:
return
print(self.mturk_agent.worker_id,
'| prompt_type:', prompt_type,
'| response:', response,
'| answer:', test_question['answer'],
'| duration:', round(duration / 1000., 1),
'| qid:', test_question['qid'])
return response
def get_response_and_duration(self, ad):
# Check for required ad data
assert 'task_data' in ad, "Ill-formed ad: 'task_data' not in ad"
assert 'respond_with_form' in ad['task_data'], "Ill-formed ad: 'respond_with_form' not in ad['task_data']"
# Serve ad and receive response
self.mturk_agent.observe(ad)
response_message = self.mturk_agent.act()
# Check for disconnect, return, etc.
if 'task_data' not in response_message:
print(self.mturk_agent.worker_id, '| DISCONNECT:', response_message)
self.episodeDone = True
return None, None
# Return string response
if ad['task_data']['respond_with_form'] is None: # Text field response
return response_message['text'], response_message['duration']
else: # Form response
return response_message['task_data']['form_responses'][0]['response'], response_message['duration']
| 73.042553
| 2,164
| 0.666472
| 5,941
| 41,196
| 4.586602
| 0.135331
| 0.005688
| 0.010789
| 0.004771
| 0.81192
| 0.800139
| 0.784873
| 0.779478
| 0.765826
| 0.748211
| 0
| 0.002344
| 0.26488
| 41,196
| 563
| 2,165
| 73.172291
| 0.897438
| 0.019128
| 0
| 0.557692
| 0
| 0.115385
| 0.750607
| 0.00379
| 0
| 0
| 0
| 0
| 0.00641
| 1
| 0.008547
| false
| 0.051282
| 0.021368
| 0
| 0.055556
| 0.014957
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 9
|
5b853f6ed2646d3f37ae04539e9f8fd71c815fd6
| 144,443
|
py
|
Python
|
EBC/python/antchain_sdk_ebc/models.py
|
alipay/antchain-openapi-prod-sdk
|
f78549e5135d91756093bd88d191ca260b28e083
|
[
"MIT"
] | 6
|
2020-06-28T06:40:50.000Z
|
2022-02-25T11:02:18.000Z
|
EBC/python/antchain_sdk_ebc/models.py
|
alipay/antchain-openapi-prod-sdk
|
f78549e5135d91756093bd88d191ca260b28e083
|
[
"MIT"
] | null | null | null |
EBC/python/antchain_sdk_ebc/models.py
|
alipay/antchain-openapi-prod-sdk
|
f78549e5135d91756093bd88d191ca260b28e083
|
[
"MIT"
] | 6
|
2020-06-30T09:29:03.000Z
|
2022-01-07T10:42:22.000Z
|
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from Tea.model import TeaModel
class Config(TeaModel):
"""
Model for initing client
"""
def __init__(self, access_key_id=None, access_key_secret=None, security_token=None, protocol=None,
read_timeout=None, connect_timeout=None, http_proxy=None, https_proxy=None, endpoint=None, no_proxy=None,
max_idle_conns=None, user_agent=None, socks_5proxy=None, socks_5net_work=None):
# accesskey id
self.access_key_id = access_key_id
# accesskey secret
self.access_key_secret = access_key_secret
# security token
self.security_token = security_token
# http protocol
self.protocol = protocol
# read timeout
self.read_timeout = read_timeout
# connect timeout
self.connect_timeout = connect_timeout
# http proxy
self.http_proxy = http_proxy
# https proxy
self.https_proxy = https_proxy
# endpoint
self.endpoint = endpoint
# proxy white list
self.no_proxy = no_proxy
# max idle conns
self.max_idle_conns = max_idle_conns
# user agent
self.user_agent = user_agent
# socks5 proxy
self.socks_5proxy = socks_5proxy
# socks5 network
self.socks_5net_work = socks_5net_work
def validate(self):
pass
def to_map(self):
result = {}
result['accessKeyId'] = self.access_key_id
result['accessKeySecret'] = self.access_key_secret
result['securityToken'] = self.security_token
result['protocol'] = self.protocol
result['readTimeout'] = self.read_timeout
result['connectTimeout'] = self.connect_timeout
result['httpProxy'] = self.http_proxy
result['httpsProxy'] = self.https_proxy
result['endpoint'] = self.endpoint
result['noProxy'] = self.no_proxy
result['maxIdleConns'] = self.max_idle_conns
result['userAgent'] = self.user_agent
result['socks5Proxy'] = self.socks_5proxy
result['socks5NetWork'] = self.socks_5net_work
return result
def from_map(self, map={}):
self.access_key_id = map.get('accessKeyId')
self.access_key_secret = map.get('accessKeySecret')
self.security_token = map.get('securityToken')
self.protocol = map.get('protocol')
self.read_timeout = map.get('readTimeout')
self.connect_timeout = map.get('connectTimeout')
self.http_proxy = map.get('httpProxy')
self.https_proxy = map.get('httpsProxy')
self.endpoint = map.get('endpoint')
self.no_proxy = map.get('noProxy')
self.max_idle_conns = map.get('maxIdleConns')
self.user_agent = map.get('userAgent')
self.socks_5proxy = map.get('socks5Proxy')
self.socks_5net_work = map.get('socks5NetWork')
return self
class Cert(TeaModel):
def __init__(self, cert_code=None, cert_description=None, cert_end_time=None, cert_id=None, cert_name_cn=None,
cert_name_en=None, cert_publish_time=None, cert_publish_time_zone=None, cert_start_time=None, cert_status=None,
cert_summary=None, cert_url=None, country=None, expire_type=None, feature_url=None, holder_avatar=None,
holder_name=None, level=None, org_did=None, org_name=None, org_user_id=None, primary_id_no=None,
second_id_no_1=None, second_id_no_2=None, second_id_no_3=None, type=None):
# 证书编号
self.cert_code = cert_code
# 证书描述
self.cert_description = cert_description
# 时间周期结束时间
self.cert_end_time = cert_end_time
# 证书id
self.cert_id = cert_id
# 证书名称-中文
self.cert_name_cn = cert_name_cn
# 证书名称-英文(拼音)
self.cert_name_en = cert_name_en
# 首次发布时间
self.cert_publish_time = cert_publish_time
# 发布时间时区,默认UTC+8
#
self.cert_publish_time_zone = cert_publish_time_zone
# 时间周期开始时间
self.cert_start_time = cert_start_time
# 1-有效
# 2-冻结
# 3-失效
# 4-作废
# 5-其他
self.cert_status = cert_status
# 证书概述
self.cert_summary = cert_summary
# 实体证书图片url
self.cert_url = cert_url
# 证书归属国家
# 使用“ISO 3166-1”代码表-数字码
# https://zh.wikipedia.org/wiki/ISO_3166-1
self.country = country
# 1.长期有效
# 2.时间周期
self.expire_type = expire_type
# 其他信息文件url
self.feature_url = feature_url
# 持有人的人脸图像url
self.holder_avatar = holder_avatar
# 证书持有人姓名
self.holder_name = holder_name
# 证书等级类型:
# 初级(五级)、中级(四级)、高级(三级)、技师(二级)和高级技师(一级)、其他
self.level = level
# 企业did
self.org_did = org_did
# 企业名称
self.org_name = org_name
# 证书持有人id
self.org_user_id = org_user_id
# 持有人主证件编号,无身份证的个人使用0000000000000000
self.primary_id_no = primary_id_no
# 持有人辅助证件编号-1
self.second_id_no_1 = second_id_no_1
# 持有人辅助证件编号-2
self.second_id_no_2 = second_id_no_2
# 持有人辅助证件编号-3
self.second_id_no_3 = second_id_no_3
# -数字码类型为156时可使用如下类目:
# --学历证书-XLZ
# --职业证书--ZYZ
# -其他国家传入--QT
self.type = type
def validate(self):
if self.cert_code:
self.validate_max_length(self.cert_code, 'cert_code', 64)
if self.cert_end_time:
self.validate_pattern(self.cert_end_time, 'cert_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.cert_id:
self.validate_max_length(self.cert_id, 'cert_id', 128)
if self.cert_name_cn:
self.validate_max_length(self.cert_name_cn, 'cert_name_cn', 64)
if self.cert_publish_time:
self.validate_pattern(self.cert_publish_time, 'cert_publish_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.cert_start_time:
self.validate_pattern(self.cert_start_time, 'cert_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.cert_url:
self.validate_max_length(self.cert_url, 'cert_url', 256)
if self.country:
self.validate_max_length(self.country, 'country', 32)
if self.feature_url:
self.validate_max_length(self.feature_url, 'feature_url', 512)
if self.holder_avatar:
self.validate_max_length(self.holder_avatar, 'holder_avatar', 256)
if self.holder_name:
self.validate_max_length(self.holder_name, 'holder_name', 64)
if self.level:
self.validate_max_length(self.level, 'level', 32)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_name:
self.validate_max_length(self.org_name, 'org_name', 128)
if self.org_user_id:
self.validate_max_length(self.org_user_id, 'org_user_id', 128)
if self.primary_id_no:
self.validate_max_length(self.primary_id_no, 'primary_id_no', 64)
if self.second_id_no_1:
self.validate_max_length(self.second_id_no_1, 'second_id_no_1', 64)
if self.second_id_no_2:
self.validate_max_length(self.second_id_no_2, 'second_id_no_2', 64)
if self.second_id_no_3:
self.validate_max_length(self.second_id_no_3, 'second_id_no_3', 64)
def to_map(self):
result = {}
result['cert_code'] = self.cert_code
result['cert_description'] = self.cert_description
result['cert_end_time'] = self.cert_end_time
result['cert_id'] = self.cert_id
result['cert_name_cn'] = self.cert_name_cn
result['cert_name_en'] = self.cert_name_en
result['cert_publish_time'] = self.cert_publish_time
result['cert_publish_time_zone'] = self.cert_publish_time_zone
result['cert_start_time'] = self.cert_start_time
result['cert_status'] = self.cert_status
result['cert_summary'] = self.cert_summary
result['cert_url'] = self.cert_url
result['country'] = self.country
result['expire_type'] = self.expire_type
result['feature_url'] = self.feature_url
result['holder_avatar'] = self.holder_avatar
result['holder_name'] = self.holder_name
result['level'] = self.level
result['org_did'] = self.org_did
result['org_name'] = self.org_name
result['org_user_id'] = self.org_user_id
result['primary_id_no'] = self.primary_id_no
result['second_id_no_1'] = self.second_id_no_1
result['second_id_no_2'] = self.second_id_no_2
result['second_id_no_3'] = self.second_id_no_3
result['type'] = self.type
return result
def from_map(self, map={}):
self.cert_code = map.get('cert_code')
self.cert_description = map.get('cert_description')
self.cert_end_time = map.get('cert_end_time')
self.cert_id = map.get('cert_id')
self.cert_name_cn = map.get('cert_name_cn')
self.cert_name_en = map.get('cert_name_en')
self.cert_publish_time = map.get('cert_publish_time')
self.cert_publish_time_zone = map.get('cert_publish_time_zone')
self.cert_start_time = map.get('cert_start_time')
self.cert_status = map.get('cert_status')
self.cert_summary = map.get('cert_summary')
self.cert_url = map.get('cert_url')
self.country = map.get('country')
self.expire_type = map.get('expire_type')
self.feature_url = map.get('feature_url')
self.holder_avatar = map.get('holder_avatar')
self.holder_name = map.get('holder_name')
self.level = map.get('level')
self.org_did = map.get('org_did')
self.org_name = map.get('org_name')
self.org_user_id = map.get('org_user_id')
self.primary_id_no = map.get('primary_id_no')
self.second_id_no_1 = map.get('second_id_no_1')
self.second_id_no_2 = map.get('second_id_no_2')
self.second_id_no_3 = map.get('second_id_no_3')
self.type = map.get('type')
return self
class OrgUser(TeaModel):
def __init__(self, org_did=None, org_user_id=None, person_did=None, uid=None):
# 企业did
self.org_did = org_did
# 企业用户id
self.org_user_id = org_user_id
# 个人id
self.person_did = person_did
# 机构内部用户工号
self.uid = uid
def validate(self):
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_id:
self.validate_max_length(self.org_user_id, 'org_user_id', 128)
if self.person_did:
self.validate_max_length(self.person_did, 'person_did', 128)
if self.uid:
self.validate_max_length(self.uid, 'uid', 64)
def to_map(self):
result = {}
result['org_did'] = self.org_did
result['org_user_id'] = self.org_user_id
result['person_did'] = self.person_did
result['uid'] = self.uid
return result
def from_map(self, map={}):
self.org_did = map.get('org_did')
self.org_user_id = map.get('org_user_id')
self.person_did = map.get('person_did')
self.uid = map.get('uid')
return self
class CourseRecord(TeaModel):
def __init__(self, chapter_id=None, class_id=None, course_id=None, course_name=None, org_did=None,
org_user_id=None, record_ext=None, record_id=None, record_open_time=None, record_period=None,
record_source=None, record_start_time=None):
# 链上章节id
#
self.chapter_id = chapter_id
# 班级id
self.class_id = class_id
# 课程id
self.course_id = course_id
# 课程名称
self.course_name = course_name
# 企业did
self.org_did = org_did
# 企业用户id
#
self.org_user_id = org_user_id
# 课程扩展信息,格式为json。比如钉钉用户id。
self.record_ext = record_ext
# 记录id
self.record_id = record_id
# 本次开启时间
#
self.record_open_time = record_open_time
# 本次观看时长,单位秒
self.record_period = record_period
# 行为来源
self.record_source = record_source
# 本次点击观看时间
self.record_start_time = record_start_time
def validate(self):
if self.chapter_id:
self.validate_max_length(self.chapter_id, 'chapter_id', 128)
if self.class_id:
self.validate_max_length(self.class_id, 'class_id', 128)
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.course_name:
self.validate_max_length(self.course_name, 'course_name', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_id:
self.validate_max_length(self.org_user_id, 'org_user_id', 128)
if self.record_ext:
self.validate_max_length(self.record_ext, 'record_ext', 2000)
if self.record_id:
self.validate_max_length(self.record_id, 'record_id', 128)
if self.record_open_time:
self.validate_pattern(self.record_open_time, 'record_open_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.record_source:
self.validate_max_length(self.record_source, 'record_source', 128)
if self.record_start_time:
self.validate_pattern(self.record_start_time, 'record_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
def to_map(self):
result = {}
result['chapter_id'] = self.chapter_id
result['class_id'] = self.class_id
result['course_id'] = self.course_id
result['course_name'] = self.course_name
result['org_did'] = self.org_did
result['org_user_id'] = self.org_user_id
result['record_ext'] = self.record_ext
result['record_id'] = self.record_id
result['record_open_time'] = self.record_open_time
result['record_period'] = self.record_period
result['record_source'] = self.record_source
result['record_start_time'] = self.record_start_time
return result
def from_map(self, map={}):
self.chapter_id = map.get('chapter_id')
self.class_id = map.get('class_id')
self.course_id = map.get('course_id')
self.course_name = map.get('course_name')
self.org_did = map.get('org_did')
self.org_user_id = map.get('org_user_id')
self.record_ext = map.get('record_ext')
self.record_id = map.get('record_id')
self.record_open_time = map.get('record_open_time')
self.record_period = map.get('record_period')
self.record_source = map.get('record_source')
self.record_start_time = map.get('record_start_time')
return self
class PrivacyDesc(TeaModel):
def __init__(self, attribute_name=None, privacy_level=None):
# 属性名称
#
self.attribute_name = attribute_name
# 隐私等级:
# 1:数据可以全量明文查询
# 2:数据仅可以通过数据比较查询
self.privacy_level = privacy_level
def validate(self):
if self.attribute_name:
self.validate_max_length(self.attribute_name, 'attribute_name', 64)
def to_map(self):
result = {}
result['attribute_name'] = self.attribute_name
result['privacy_level'] = self.privacy_level
return result
def from_map(self, map={}):
self.attribute_name = map.get('attribute_name')
self.privacy_level = map.get('privacy_level')
return self
class Class(TeaModel):
def __init__(self, class_id=None, org_did=None):
# 班级id
self.class_id = class_id
# 企业did
self.org_did = org_did
def validate(self):
if self.class_id:
self.validate_max_length(self.class_id, 'class_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['class_id'] = self.class_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.class_id = map.get('class_id')
self.org_did = map.get('org_did')
return self
class ProxyDesc(TeaModel):
def __init__(self, attribute_name=None, is_proxy=None):
# 属性名称
self.attribute_name = attribute_name
# 是否托管
self.is_proxy = is_proxy
def validate(self):
if self.attribute_name:
self.validate_max_length(self.attribute_name, 'attribute_name', 64)
def to_map(self):
result = {}
result['attribute_name'] = self.attribute_name
result['is_proxy'] = self.is_proxy
return result
def from_map(self, map={}):
self.attribute_name = map.get('attribute_name')
self.is_proxy = map.get('is_proxy')
return self
class PublicDesc(TeaModel):
def __init__(self, attribute_name=None, is_public=None):
# 属性名称
self.attribute_name = attribute_name
# 数据是否所有消费方可查询
self.is_public = is_public
def validate(self):
if self.attribute_name:
self.validate_max_length(self.attribute_name, 'attribute_name', 64)
def to_map(self):
result = {}
result['attribute_name'] = self.attribute_name
result['is_public'] = self.is_public
return result
def from_map(self, map={}):
self.attribute_name = map.get('attribute_name')
self.is_public = map.get('is_public')
return self
class CourseChapter(TeaModel):
def __init__(self, chapter_biz_id=None, chapter_description=None, chapter_id=None, chapter_name=None,
chapter_period=None):
# 业务系统章节ID
#
self.chapter_biz_id = chapter_biz_id
# 章节描述
#
self.chapter_description = chapter_description
# 链上章节id
self.chapter_id = chapter_id
# 章节名称
self.chapter_name = chapter_name
# 章节时长,单位秒
self.chapter_period = chapter_period
def validate(self):
if self.chapter_biz_id:
self.validate_max_length(self.chapter_biz_id, 'chapter_biz_id', 128)
if self.chapter_description:
self.validate_max_length(self.chapter_description, 'chapter_description', 1000)
if self.chapter_id:
self.validate_max_length(self.chapter_id, 'chapter_id', 128)
if self.chapter_name:
self.validate_max_length(self.chapter_name, 'chapter_name', 128)
def to_map(self):
result = {}
result['chapter_biz_id'] = self.chapter_biz_id
result['chapter_description'] = self.chapter_description
result['chapter_id'] = self.chapter_id
result['chapter_name'] = self.chapter_name
result['chapter_period'] = self.chapter_period
return result
def from_map(self, map={}):
self.chapter_biz_id = map.get('chapter_biz_id')
self.chapter_description = map.get('chapter_description')
self.chapter_id = map.get('chapter_id')
self.chapter_name = map.get('chapter_name')
self.chapter_period = map.get('chapter_period')
return self
class CreateBaasEbcOrganizationRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, org_code=None, org_name=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 企业码
self.org_code = org_code
# 企业名称
self.org_name = org_name
def validate(self):
if self.org_code:
self.validate_max_length(self.org_code, 'org_code', 64)
if self.org_name:
self.validate_max_length(self.org_name, 'org_name', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['org_code'] = self.org_code
result['org_name'] = self.org_name
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.org_code = map.get('org_code')
self.org_name = map.get('org_name')
return self
class CreateBaasEbcOrganizationResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, org_did=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 企业did
self.org_did = org_did
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.org_did = map.get('org_did')
return self
class CreateBaasEbcPersonRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, person_name=None,
primary_id_no=None, privacy_desc_list=None, proxy_desc_list=None, public_desc_list=None, second_id_no_1=None,
second_id_no_2=None, second_id_no_3=None, secret_key=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 姓名
self.person_name = person_name
# 持有人主证件编号,无身份证的个人使用0000000000000000
# 请使用我们提供的公钥对数据进行加密
self.primary_id_no = primary_id_no
# 隐私属性描述列表
#
self.privacy_desc_list = privacy_desc_list
# 托管属性描述列表
#
self.proxy_desc_list = proxy_desc_list
# 公开属性描述列表
#
self.public_desc_list = public_desc_list
# 持有人辅助证件编号-1
# 请使用我们提供的公钥对数据进行加密
self.second_id_no_1 = second_id_no_1
# 持有人辅助证件编号-1
# 请使用我们提供的公钥对数据进行加密
self.second_id_no_2 = second_id_no_2
# 持有人辅助证件编号-3
# 请使用我们提供的公钥对数据进行加密
self.second_id_no_3 = second_id_no_3
# 非对称加密后的对称秘钥,对应执行java SDK中的EnvelopeClient#envelopeSeal方法的返回值
self.secret_key = secret_key
def validate(self):
if self.person_name:
self.validate_max_length(self.person_name, 'person_name', 32)
if self.primary_id_no:
self.validate_max_length(self.primary_id_no, 'primary_id_no', 64)
if self.privacy_desc_list:
for k in self.privacy_desc_list:
if k:
k.validate()
if self.proxy_desc_list:
for k in self.proxy_desc_list:
if k:
k.validate()
if self.public_desc_list:
for k in self.public_desc_list:
if k:
k.validate()
if self.second_id_no_1:
self.validate_max_length(self.second_id_no_1, 'second_id_no_1', 64)
if self.second_id_no_2:
self.validate_max_length(self.second_id_no_2, 'second_id_no_2', 64)
if self.second_id_no_3:
self.validate_max_length(self.second_id_no_3, 'second_id_no_3', 64)
if self.secret_key:
self.validate_max_length(self.secret_key, 'secret_key', 512)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['person_name'] = self.person_name
result['primary_id_no'] = self.primary_id_no
result['privacy_desc_list'] = []
if self.privacy_desc_list is not None:
for k in self.privacy_desc_list:
result['privacy_desc_list'].append(k.to_map() if k else None)
else:
result['privacy_desc_list'] = None
result['proxy_desc_list'] = []
if self.proxy_desc_list is not None:
for k in self.proxy_desc_list:
result['proxy_desc_list'].append(k.to_map() if k else None)
else:
result['proxy_desc_list'] = None
result['public_desc_list'] = []
if self.public_desc_list is not None:
for k in self.public_desc_list:
result['public_desc_list'].append(k.to_map() if k else None)
else:
result['public_desc_list'] = None
result['second_id_no_1'] = self.second_id_no_1
result['second_id_no_2'] = self.second_id_no_2
result['second_id_no_3'] = self.second_id_no_3
result['secret_key'] = self.secret_key
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.person_name = map.get('person_name')
self.primary_id_no = map.get('primary_id_no')
self.privacy_desc_list = []
if map.get('privacy_desc_list') is not None:
for k in map.get('privacy_desc_list'):
temp_model = PrivacyDesc()
self.privacy_desc_list.append(temp_model.from_map(k))
else:
self.privacy_desc_list = None
self.proxy_desc_list = []
if map.get('proxy_desc_list') is not None:
for k in map.get('proxy_desc_list'):
temp_model = ProxyDesc()
self.proxy_desc_list.append(temp_model.from_map(k))
else:
self.proxy_desc_list = None
self.public_desc_list = []
if map.get('public_desc_list') is not None:
for k in map.get('public_desc_list'):
temp_model = PublicDesc()
self.public_desc_list.append(temp_model.from_map(k))
else:
self.public_desc_list = None
self.second_id_no_1 = map.get('second_id_no_1')
self.second_id_no_2 = map.get('second_id_no_2')
self.second_id_no_3 = map.get('second_id_no_3')
self.secret_key = map.get('secret_key')
return self
class CreateBaasEbcPersonResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, person_did=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 个人id
self.person_did = person_did
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['person_did'] = self.person_did
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.person_did = map.get('person_did')
return self
class CreateBaasEbcOrganizationUserRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, org_did=None, person_did=None,
uid=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 企业id
self.org_did = org_did
# 个人id
self.person_did = person_did
# 机构内部用户工号
self.uid = uid
def validate(self):
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.person_did:
self.validate_max_length(self.person_did, 'person_did', 128)
if self.uid:
self.validate_max_length(self.uid, 'uid', 64)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['org_did'] = self.org_did
result['person_did'] = self.person_did
result['uid'] = self.uid
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.org_did = map.get('org_did')
self.person_did = map.get('person_did')
self.uid = map.get('uid')
return self
class CreateBaasEbcOrganizationUserResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, org_user_id=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 机构内用户id
self.org_user_id = org_user_id
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['org_user_id'] = self.org_user_id
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.org_user_id = map.get('org_user_id')
return self
class CancelBaasEbcPersonRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, person_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 个人id
self.person_did = person_did
def validate(self):
if self.person_did:
self.validate_max_length(self.person_did, 'person_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['person_did'] = self.person_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.person_did = map.get('person_did')
return self
class CancelBaasEbcPersonResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
return self
class ResumeBaasEbcPersonRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, person_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 个人did
self.person_did = person_did
def validate(self):
if self.person_did:
self.validate_max_length(self.person_did, 'person_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['person_did'] = self.person_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.person_did = map.get('person_did')
return self
class ResumeBaasEbcPersonResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
return self
class CreateBaasEbcOrganizationClassRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, capacity=None,
class_end_time=None, class_name=None, class_start_time=None, class_status=None, org_did=None,
privacy_desc_list=None, proxy_desc_list=None, public_desc_list=None, secret_key=None, type=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 班级容量
self.capacity = capacity
# 结束时间
self.class_end_time = class_end_time
# 班级名称
self.class_name = class_name
# 开始时间
self.class_start_time = class_start_time
# 1:有效、2:暂停、3:失效
self.class_status = class_status
# 企业id
self.org_did = org_did
# 隐私属性描述列表
#
self.privacy_desc_list = privacy_desc_list
# 托管属性描述列表
#
self.proxy_desc_list = proxy_desc_list
# 公开属性描述列表
#
self.public_desc_list = public_desc_list
# 非对称加密后的对称秘钥,对应执行java SDK中的EnvelopeClient#envelopeSeal方法的返回值
self.secret_key = secret_key
# 1线上、2线下、3混合
self.type = type
def validate(self):
if self.class_end_time:
self.validate_pattern(self.class_end_time, 'class_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.class_name:
self.validate_max_length(self.class_name, 'class_name', 128)
if self.class_start_time:
self.validate_pattern(self.class_start_time, 'class_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.privacy_desc_list:
for k in self.privacy_desc_list:
if k:
k.validate()
if self.proxy_desc_list:
for k in self.proxy_desc_list:
if k:
k.validate()
if self.public_desc_list:
for k in self.public_desc_list:
if k:
k.validate()
if self.secret_key:
self.validate_max_length(self.secret_key, 'secret_key', 512)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['capacity'] = self.capacity
result['class_end_time'] = self.class_end_time
result['class_name'] = self.class_name
result['class_start_time'] = self.class_start_time
result['class_status'] = self.class_status
result['org_did'] = self.org_did
result['privacy_desc_list'] = []
if self.privacy_desc_list is not None:
for k in self.privacy_desc_list:
result['privacy_desc_list'].append(k.to_map() if k else None)
else:
result['privacy_desc_list'] = None
result['proxy_desc_list'] = []
if self.proxy_desc_list is not None:
for k in self.proxy_desc_list:
result['proxy_desc_list'].append(k.to_map() if k else None)
else:
result['proxy_desc_list'] = None
result['public_desc_list'] = []
if self.public_desc_list is not None:
for k in self.public_desc_list:
result['public_desc_list'].append(k.to_map() if k else None)
else:
result['public_desc_list'] = None
result['secret_key'] = self.secret_key
result['type'] = self.type
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.capacity = map.get('capacity')
self.class_end_time = map.get('class_end_time')
self.class_name = map.get('class_name')
self.class_start_time = map.get('class_start_time')
self.class_status = map.get('class_status')
self.org_did = map.get('org_did')
self.privacy_desc_list = []
if map.get('privacy_desc_list') is not None:
for k in map.get('privacy_desc_list'):
temp_model = PrivacyDesc()
self.privacy_desc_list.append(temp_model.from_map(k))
else:
self.privacy_desc_list = None
self.proxy_desc_list = []
if map.get('proxy_desc_list') is not None:
for k in map.get('proxy_desc_list'):
temp_model = ProxyDesc()
self.proxy_desc_list.append(temp_model.from_map(k))
else:
self.proxy_desc_list = None
self.public_desc_list = []
if map.get('public_desc_list') is not None:
for k in map.get('public_desc_list'):
temp_model = PublicDesc()
self.public_desc_list.append(temp_model.from_map(k))
else:
self.public_desc_list = None
self.secret_key = map.get('secret_key')
self.type = map.get('type')
return self
class CreateBaasEbcOrganizationClassResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, class_id=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 班级id
self.class_id = class_id
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['class_id'] = self.class_id
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.class_id = map.get('class_id')
return self
class UpdateBaasEbcOrganizationClassRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, capacity=None,
class_end_time=None, class_id=None, class_name=None, class_start_time=None, class_status=None, org_did=None,
privacy_desc_list=None, proxy_desc_list=None, public_desc_list=None, secret_key=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 容量
self.capacity = capacity
# 结束时间
self.class_end_time = class_end_time
# 班级id
self.class_id = class_id
# 班级名称
self.class_name = class_name
# 开始时间
self.class_start_time = class_start_time
# 1:有效、2:暂停、3:失效
self.class_status = class_status
# 企业did
self.org_did = org_did
# 隐私属性描述列表
#
self.privacy_desc_list = privacy_desc_list
# 托管属性描述列表
#
self.proxy_desc_list = proxy_desc_list
# 公开属性描述列表
#
self.public_desc_list = public_desc_list
# 非对称加密后的对称秘钥,对应执行java SDK中的EnvelopeClient#envelopeSeal方法的返回值
self.secret_key = secret_key
def validate(self):
if self.class_end_time:
self.validate_pattern(self.class_end_time, 'class_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.class_id:
self.validate_max_length(self.class_id, 'class_id', 128)
if self.class_name:
self.validate_max_length(self.class_name, 'class_name', 128)
if self.class_start_time:
self.validate_pattern(self.class_start_time, 'class_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.privacy_desc_list:
for k in self.privacy_desc_list:
if k:
k.validate()
if self.proxy_desc_list:
for k in self.proxy_desc_list:
if k:
k.validate()
if self.public_desc_list:
for k in self.public_desc_list:
if k:
k.validate()
if self.secret_key:
self.validate_max_length(self.secret_key, 'secret_key', 512)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['capacity'] = self.capacity
result['class_end_time'] = self.class_end_time
result['class_id'] = self.class_id
result['class_name'] = self.class_name
result['class_start_time'] = self.class_start_time
result['class_status'] = self.class_status
result['org_did'] = self.org_did
result['privacy_desc_list'] = []
if self.privacy_desc_list is not None:
for k in self.privacy_desc_list:
result['privacy_desc_list'].append(k.to_map() if k else None)
else:
result['privacy_desc_list'] = None
result['proxy_desc_list'] = []
if self.proxy_desc_list is not None:
for k in self.proxy_desc_list:
result['proxy_desc_list'].append(k.to_map() if k else None)
else:
result['proxy_desc_list'] = None
result['public_desc_list'] = []
if self.public_desc_list is not None:
for k in self.public_desc_list:
result['public_desc_list'].append(k.to_map() if k else None)
else:
result['public_desc_list'] = None
result['secret_key'] = self.secret_key
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.capacity = map.get('capacity')
self.class_end_time = map.get('class_end_time')
self.class_id = map.get('class_id')
self.class_name = map.get('class_name')
self.class_start_time = map.get('class_start_time')
self.class_status = map.get('class_status')
self.org_did = map.get('org_did')
self.privacy_desc_list = []
if map.get('privacy_desc_list') is not None:
for k in map.get('privacy_desc_list'):
temp_model = PrivacyDesc()
self.privacy_desc_list.append(temp_model.from_map(k))
else:
self.privacy_desc_list = None
self.proxy_desc_list = []
if map.get('proxy_desc_list') is not None:
for k in map.get('proxy_desc_list'):
temp_model = ProxyDesc()
self.proxy_desc_list.append(temp_model.from_map(k))
else:
self.proxy_desc_list = None
self.public_desc_list = []
if map.get('public_desc_list') is not None:
for k in map.get('public_desc_list'):
temp_model = PublicDesc()
self.public_desc_list.append(temp_model.from_map(k))
else:
self.public_desc_list = None
self.secret_key = map.get('secret_key')
return self
class UpdateBaasEbcOrganizationClassResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
return self
class AddBaasEbcClassUserRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, class_id=None, org_did=None,
org_user_list=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 班级id
self.class_id = class_id
# 企业id
self.org_did = org_did
# 企业用户列表,最多一次传入50个
self.org_user_list = org_user_list
def validate(self):
if self.class_id:
self.validate_max_length(self.class_id, 'class_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_list:
for k in self.org_user_list:
if k:
k.validate()
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['class_id'] = self.class_id
result['org_did'] = self.org_did
result['org_user_list'] = []
if self.org_user_list is not None:
for k in self.org_user_list:
result['org_user_list'].append(k.to_map() if k else None)
else:
result['org_user_list'] = None
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.class_id = map.get('class_id')
self.org_did = map.get('org_did')
self.org_user_list = []
if map.get('org_user_list') is not None:
for k in map.get('org_user_list'):
temp_model = OrgUser()
self.org_user_list.append(temp_model.from_map(k))
else:
self.org_user_list = None
return self
class AddBaasEbcClassUserResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, fail_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 加入失败的用户列表
self.fail_list = fail_list
def validate(self):
if self.fail_list:
for k in self.fail_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['fail_list'] = []
if self.fail_list is not None:
for k in self.fail_list:
result['fail_list'].append(k.to_map() if k else None)
else:
result['fail_list'] = None
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.fail_list = []
if map.get('fail_list') is not None:
for k in map.get('fail_list'):
temp_model = OrgUser()
self.fail_list.append(temp_model.from_map(k))
else:
self.fail_list = None
return self
class DeleteBaasEbcClassUserRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, class_id=None, org_did=None,
org_user_list=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 班级id
self.class_id = class_id
# 企业id
self.org_did = org_did
# 企业用户列表,最多一次传入50个
self.org_user_list = org_user_list
def validate(self):
if self.class_id:
self.validate_max_length(self.class_id, 'class_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_list:
for k in self.org_user_list:
if k:
k.validate()
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['class_id'] = self.class_id
result['org_did'] = self.org_did
result['org_user_list'] = []
if self.org_user_list is not None:
for k in self.org_user_list:
result['org_user_list'].append(k.to_map() if k else None)
else:
result['org_user_list'] = None
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.class_id = map.get('class_id')
self.org_did = map.get('org_did')
self.org_user_list = []
if map.get('org_user_list') is not None:
for k in map.get('org_user_list'):
temp_model = OrgUser()
self.org_user_list.append(temp_model.from_map(k))
else:
self.org_user_list = None
return self
class DeleteBaasEbcClassUserResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, fail_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 删除失败的用户列表
self.fail_list = fail_list
def validate(self):
if self.fail_list:
for k in self.fail_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['fail_list'] = []
if self.fail_list is not None:
for k in self.fail_list:
result['fail_list'].append(k.to_map() if k else None)
else:
result['fail_list'] = None
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.fail_list = []
if map.get('fail_list') is not None:
for k in map.get('fail_list'):
temp_model = OrgUser()
self.fail_list.append(temp_model.from_map(k))
else:
self.fail_list = None
return self
class QueryBaasEbcOrganizationClassRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, class_id=None, org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 班级id
self.class_id = class_id
# 企业did
self.org_did = org_did
def validate(self):
if self.class_id:
self.validate_max_length(self.class_id, 'class_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['class_id'] = self.class_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.class_id = map.get('class_id')
self.org_did = map.get('org_did')
return self
class QueryBaasEbcOrganizationClassResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, class_name=None, class_status=None,
create_time=None, modify_time=None, period=None, type=None, user_num=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 班级名称
self.class_name = class_name
# 1:有效、2:暂停、3:失效
self.class_status = class_status
# 创建时间
self.create_time = create_time
# 修改时间
self.modify_time = modify_time
# 累计时长
self.period = period
# 班级类型:线上、线下、混合
self.type = type
# 学员数量
self.user_num = user_num
def validate(self):
if self.create_time:
self.validate_pattern(self.create_time, 'create_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.modify_time:
self.validate_pattern(self.modify_time, 'modify_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['class_name'] = self.class_name
result['class_status'] = self.class_status
result['create_time'] = self.create_time
result['modify_time'] = self.modify_time
result['period'] = self.period
result['type'] = self.type
result['user_num'] = self.user_num
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.class_name = map.get('class_name')
self.class_status = map.get('class_status')
self.create_time = map.get('create_time')
self.modify_time = map.get('modify_time')
self.period = map.get('period')
self.type = map.get('type')
self.user_num = map.get('user_num')
return self
class QueryBaasEbcClassUserRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, class_id=None, org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 班级id
self.class_id = class_id
# 企业did
self.org_did = org_did
def validate(self):
if self.class_id:
self.validate_max_length(self.class_id, 'class_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['class_id'] = self.class_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.class_id = map.get('class_id')
self.org_did = map.get('org_did')
return self
class QueryBaasEbcClassUserResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, class_name=None, org_user_id_list=None,
user_num=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 班级名称
self.class_name = class_name
# 企业用户id列表
self.org_user_id_list = org_user_id_list
# 学员数量
self.user_num = user_num
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['class_name'] = self.class_name
result['org_user_id_list'] = self.org_user_id_list
result['user_num'] = self.user_num
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.class_name = map.get('class_name')
self.org_user_id_list = map.get('org_user_id_list')
self.user_num = map.get('user_num')
return self
class CreateBaasEbcOrganizationCourseRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, course_description=None,
course_end_time=None, course_name=None, course_start_time=None, course_summary=None, course_type=None,
org_did=None, period=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 课程描述
#
self.course_description = course_description
# 课程结束时间
self.course_end_time = course_end_time
# 课程名称
self.course_name = course_name
# 课程开始时间
self.course_start_time = course_start_time
# 课程简介
#
self.course_summary = course_summary
# 课程类型
# 1直播课程,2录播课程,3线下课程,4其他类型
self.course_type = course_type
# 企业did
self.org_did = org_did
# 课程时长
self.period = period
def validate(self):
if self.course_description:
self.validate_max_length(self.course_description, 'course_description', 1000)
if self.course_end_time:
self.validate_pattern(self.course_end_time, 'course_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.course_name:
self.validate_max_length(self.course_name, 'course_name', 64)
if self.course_start_time:
self.validate_pattern(self.course_start_time, 'course_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.course_summary:
self.validate_max_length(self.course_summary, 'course_summary', 120)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['course_description'] = self.course_description
result['course_end_time'] = self.course_end_time
result['course_name'] = self.course_name
result['course_start_time'] = self.course_start_time
result['course_summary'] = self.course_summary
result['course_type'] = self.course_type
result['org_did'] = self.org_did
result['period'] = self.period
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.course_description = map.get('course_description')
self.course_end_time = map.get('course_end_time')
self.course_name = map.get('course_name')
self.course_start_time = map.get('course_start_time')
self.course_summary = map.get('course_summary')
self.course_type = map.get('course_type')
self.org_did = map.get('org_did')
self.period = map.get('period')
return self
class CreateBaasEbcOrganizationCourseResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, course_id=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 课程did
self.course_id = course_id
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['course_id'] = self.course_id
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.course_id = map.get('course_id')
return self
class UpdateBaasEbcOrganizationCourseRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, course_description=None,
course_end_time=None, course_id=None, course_name=None, course_start_time=None, course_summary=None,
course_type=None, org_did=None, period=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 课程描述
#
self.course_description = course_description
# 课程结束时间
self.course_end_time = course_end_time
# 课程id
self.course_id = course_id
# 课程名称
self.course_name = course_name
# 课程开始时间
self.course_start_time = course_start_time
# 课程简介
#
self.course_summary = course_summary
# 课程类型
# 1直播课程,2录播课程,3线下课程,4其他类型
self.course_type = course_type
# 企业id
self.org_did = org_did
# 课程时长
self.period = period
def validate(self):
if self.course_description:
self.validate_max_length(self.course_description, 'course_description', 1000)
if self.course_end_time:
self.validate_pattern(self.course_end_time, 'course_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.course_name:
self.validate_max_length(self.course_name, 'course_name', 64)
if self.course_start_time:
self.validate_pattern(self.course_start_time, 'course_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.course_summary:
self.validate_max_length(self.course_summary, 'course_summary', 120)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['course_description'] = self.course_description
result['course_end_time'] = self.course_end_time
result['course_id'] = self.course_id
result['course_name'] = self.course_name
result['course_start_time'] = self.course_start_time
result['course_summary'] = self.course_summary
result['course_type'] = self.course_type
result['org_did'] = self.org_did
result['period'] = self.period
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.course_description = map.get('course_description')
self.course_end_time = map.get('course_end_time')
self.course_id = map.get('course_id')
self.course_name = map.get('course_name')
self.course_start_time = map.get('course_start_time')
self.course_summary = map.get('course_summary')
self.course_type = map.get('course_type')
self.org_did = map.get('org_did')
self.period = map.get('period')
return self
class UpdateBaasEbcOrganizationCourseResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
return self
class AddBaasEbcCourseClassRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, class_list=None, course_id=None,
org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 班级列表,最多一次传入50个
self.class_list = class_list
# 班级id
self.course_id = course_id
# 企业id
self.org_did = org_did
def validate(self):
if self.class_list:
for k in self.class_list:
if k:
k.validate()
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['class_list'] = []
if self.class_list is not None:
for k in self.class_list:
result['class_list'].append(k.to_map() if k else None)
else:
result['class_list'] = None
result['course_id'] = self.course_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.class_list = []
if map.get('class_list') is not None:
for k in map.get('class_list'):
temp_model = Class()
self.class_list.append(temp_model.from_map(k))
else:
self.class_list = None
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
return self
class AddBaasEbcCourseClassResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, fail_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 添加失败的班级列表
self.fail_list = fail_list
def validate(self):
if self.fail_list:
for k in self.fail_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['fail_list'] = []
if self.fail_list is not None:
for k in self.fail_list:
result['fail_list'].append(k.to_map() if k else None)
else:
result['fail_list'] = None
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.fail_list = []
if map.get('fail_list') is not None:
for k in map.get('fail_list'):
temp_model = Class()
self.fail_list.append(temp_model.from_map(k))
else:
self.fail_list = None
return self
class AddBaasEbcCourseUserRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, course_id=None, org_did=None,
org_user_list=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 课程id
self.course_id = course_id
# 企业id
self.org_did = org_did
# 企业用户列表,最多一次传入50个
self.org_user_list = org_user_list
def validate(self):
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_list:
for k in self.org_user_list:
if k:
k.validate()
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['course_id'] = self.course_id
result['org_did'] = self.org_did
result['org_user_list'] = []
if self.org_user_list is not None:
for k in self.org_user_list:
result['org_user_list'].append(k.to_map() if k else None)
else:
result['org_user_list'] = None
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
self.org_user_list = []
if map.get('org_user_list') is not None:
for k in map.get('org_user_list'):
temp_model = OrgUser()
self.org_user_list.append(temp_model.from_map(k))
else:
self.org_user_list = None
return self
class AddBaasEbcCourseUserResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, fail_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 添加失败的用户列表
self.fail_list = fail_list
def validate(self):
if self.fail_list:
for k in self.fail_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['fail_list'] = []
if self.fail_list is not None:
for k in self.fail_list:
result['fail_list'].append(k.to_map() if k else None)
else:
result['fail_list'] = None
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.fail_list = []
if map.get('fail_list') is not None:
for k in map.get('fail_list'):
temp_model = OrgUser()
self.fail_list.append(temp_model.from_map(k))
else:
self.fail_list = None
return self
class DeleteBaasEbcCourseClassRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, class_list=None, course_id=None,
org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 班级列表,最多一次传入50个
self.class_list = class_list
# 课程id
self.course_id = course_id
# 企业id
self.org_did = org_did
def validate(self):
if self.class_list:
for k in self.class_list:
if k:
k.validate()
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['class_list'] = []
if self.class_list is not None:
for k in self.class_list:
result['class_list'].append(k.to_map() if k else None)
else:
result['class_list'] = None
result['course_id'] = self.course_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.class_list = []
if map.get('class_list') is not None:
for k in map.get('class_list'):
temp_model = Class()
self.class_list.append(temp_model.from_map(k))
else:
self.class_list = None
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
return self
class DeleteBaasEbcCourseClassResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, fail_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 删除失败的班级列表
self.fail_list = fail_list
def validate(self):
if self.fail_list:
for k in self.fail_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['fail_list'] = []
if self.fail_list is not None:
for k in self.fail_list:
result['fail_list'].append(k.to_map() if k else None)
else:
result['fail_list'] = None
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.fail_list = []
if map.get('fail_list') is not None:
for k in map.get('fail_list'):
temp_model = Class()
self.fail_list.append(temp_model.from_map(k))
else:
self.fail_list = None
return self
class DeleteBaasEbcCourseUserRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, course_id=None, org_did=None,
org_user_list=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 课程id
self.course_id = course_id
# 企业id
self.org_did = org_did
# 企业用户列表,最多一次传入50个
self.org_user_list = org_user_list
def validate(self):
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_list:
for k in self.org_user_list:
if k:
k.validate()
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['course_id'] = self.course_id
result['org_did'] = self.org_did
result['org_user_list'] = []
if self.org_user_list is not None:
for k in self.org_user_list:
result['org_user_list'].append(k.to_map() if k else None)
else:
result['org_user_list'] = None
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
self.org_user_list = []
if map.get('org_user_list') is not None:
for k in map.get('org_user_list'):
temp_model = OrgUser()
self.org_user_list.append(temp_model.from_map(k))
else:
self.org_user_list = None
return self
class DeleteBaasEbcCourseUserResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, fail_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 删除失败的用户列表
self.fail_list = fail_list
def validate(self):
if self.fail_list:
for k in self.fail_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['fail_list'] = []
if self.fail_list is not None:
for k in self.fail_list:
result['fail_list'].append(k.to_map() if k else None)
else:
result['fail_list'] = None
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.fail_list = []
if map.get('fail_list') is not None:
for k in map.get('fail_list'):
temp_model = OrgUser()
self.fail_list.append(temp_model.from_map(k))
else:
self.fail_list = None
return self
class CreateBaasEbcUserCertRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, cert_code=None,
cert_description=None, cert_end_time=None, cert_name_cn=None, cert_name_en=None, cert_publish_time=None,
cert_publish_time_zone=None, cert_start_time=None, cert_status=None, cert_summary=None, country=None, expire_type=None,
holder_name=None, level=None, org_did=None, org_name=None, org_user_id=None, primary_id_no=None,
privacy_desc_list=None, proxy_desc_list=None, public_desc_list=None, second_id_no_1=None, second_id_no_2=None,
second_id_no_3=None, secret_key=None, type=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 证书编号
self.cert_code = cert_code
# 证书描述
self.cert_description = cert_description
# 时间周期结束时间
self.cert_end_time = cert_end_time
# 证书名称-中文
self.cert_name_cn = cert_name_cn
# 证书名称-英文(拼音)
self.cert_name_en = cert_name_en
# 首次发布时间
self.cert_publish_time = cert_publish_time
# 发布时间时区,默认UTC+8
self.cert_publish_time_zone = cert_publish_time_zone
# 时间周期开始时间
self.cert_start_time = cert_start_time
# 1-有效 2-冻结 3-失效 4-作废 5-其他
self.cert_status = cert_status
# 证书概述
self.cert_summary = cert_summary
# 证书归属国家 使用“ISO 3166-1”代码表-数字码 https://zh.wikipedia.org/wiki/ISO_3166-1
self.country = country
# 有效期类型1.长期有效 2.时间周期
self.expire_type = expire_type
# 证书持有人姓名
#
self.holder_name = holder_name
# 证书等级类型: 初级(五级)、中级(四级)、高级(三级)、技师(二级)和高级技师(一级)、其他
self.level = level
# 企业id
self.org_did = org_did
# 企业名称
self.org_name = org_name
# 企业用户id
self.org_user_id = org_user_id
# 持有人主证件编号,无身份证的个人使用0000000000000000
# 请使用我们提供的公钥对数据进行加密
#
self.primary_id_no = primary_id_no
# 隐私属性描述列表
self.privacy_desc_list = privacy_desc_list
# 托管属性描述列表
self.proxy_desc_list = proxy_desc_list
# 公开属性描述列表
self.public_desc_list = public_desc_list
# 持有人辅助证件编号-1
# 请使用我们提供的公钥对数据进行加密
self.second_id_no_1 = second_id_no_1
# 持有人辅助证件编号-2
# 请使用我们提供的公钥对数据进行加密
self.second_id_no_2 = second_id_no_2
# 持有人辅助证件编号-3
# 请使用我们提供的公钥对数据进行加密
self.second_id_no_3 = second_id_no_3
# 非对称加密后的对称秘钥,对应执行java SDK中的EnvelopeClient#envelopeSeal方法的返回值
self.secret_key = secret_key
# -数字码类型为156时可使用如下类目: --学历证书-XLZ --职业证书--ZYZ -其他国家传入--QT
self.type = type
def validate(self):
if self.cert_code:
self.validate_max_length(self.cert_code, 'cert_code', 64)
if self.cert_description:
self.validate_max_length(self.cert_description, 'cert_description', 1000)
if self.cert_end_time:
self.validate_pattern(self.cert_end_time, 'cert_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.cert_name_cn:
self.validate_max_length(self.cert_name_cn, 'cert_name_cn', 64)
if self.cert_name_en:
self.validate_max_length(self.cert_name_en, 'cert_name_en', 64)
if self.cert_publish_time:
self.validate_pattern(self.cert_publish_time, 'cert_publish_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.cert_publish_time_zone:
self.validate_max_length(self.cert_publish_time_zone, 'cert_publish_time_zone', 64)
if self.cert_start_time:
self.validate_pattern(self.cert_start_time, 'cert_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.cert_summary:
self.validate_max_length(self.cert_summary, 'cert_summary', 250)
if self.country:
self.validate_max_length(self.country, 'country', 32)
if self.holder_name:
self.validate_max_length(self.holder_name, 'holder_name', 64)
if self.level:
self.validate_max_length(self.level, 'level', 256)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_name:
self.validate_max_length(self.org_name, 'org_name', 128)
if self.org_user_id:
self.validate_max_length(self.org_user_id, 'org_user_id', 128)
if self.primary_id_no:
self.validate_max_length(self.primary_id_no, 'primary_id_no', 1024)
if self.privacy_desc_list:
for k in self.privacy_desc_list:
if k:
k.validate()
if self.proxy_desc_list:
for k in self.proxy_desc_list:
if k:
k.validate()
if self.public_desc_list:
for k in self.public_desc_list:
if k:
k.validate()
if self.second_id_no_1:
self.validate_max_length(self.second_id_no_1, 'second_id_no_1', 1024)
if self.second_id_no_2:
self.validate_max_length(self.second_id_no_2, 'second_id_no_2', 1024)
if self.second_id_no_3:
self.validate_max_length(self.second_id_no_3, 'second_id_no_3', 1024)
if self.secret_key:
self.validate_max_length(self.secret_key, 'secret_key', 512)
if self.type:
self.validate_max_length(self.type, 'type', 64)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['cert_code'] = self.cert_code
result['cert_description'] = self.cert_description
result['cert_end_time'] = self.cert_end_time
result['cert_name_cn'] = self.cert_name_cn
result['cert_name_en'] = self.cert_name_en
result['cert_publish_time'] = self.cert_publish_time
result['cert_publish_time_zone'] = self.cert_publish_time_zone
result['cert_start_time'] = self.cert_start_time
result['cert_status'] = self.cert_status
result['cert_summary'] = self.cert_summary
result['country'] = self.country
result['expire_type'] = self.expire_type
result['holder_name'] = self.holder_name
result['level'] = self.level
result['org_did'] = self.org_did
result['org_name'] = self.org_name
result['org_user_id'] = self.org_user_id
result['primary_id_no'] = self.primary_id_no
result['privacy_desc_list'] = []
if self.privacy_desc_list is not None:
for k in self.privacy_desc_list:
result['privacy_desc_list'].append(k.to_map() if k else None)
else:
result['privacy_desc_list'] = None
result['proxy_desc_list'] = []
if self.proxy_desc_list is not None:
for k in self.proxy_desc_list:
result['proxy_desc_list'].append(k.to_map() if k else None)
else:
result['proxy_desc_list'] = None
result['public_desc_list'] = []
if self.public_desc_list is not None:
for k in self.public_desc_list:
result['public_desc_list'].append(k.to_map() if k else None)
else:
result['public_desc_list'] = None
result['second_id_no_1'] = self.second_id_no_1
result['second_id_no_2'] = self.second_id_no_2
result['second_id_no_3'] = self.second_id_no_3
result['secret_key'] = self.secret_key
result['type'] = self.type
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.cert_code = map.get('cert_code')
self.cert_description = map.get('cert_description')
self.cert_end_time = map.get('cert_end_time')
self.cert_name_cn = map.get('cert_name_cn')
self.cert_name_en = map.get('cert_name_en')
self.cert_publish_time = map.get('cert_publish_time')
self.cert_publish_time_zone = map.get('cert_publish_time_zone')
self.cert_start_time = map.get('cert_start_time')
self.cert_status = map.get('cert_status')
self.cert_summary = map.get('cert_summary')
self.country = map.get('country')
self.expire_type = map.get('expire_type')
self.holder_name = map.get('holder_name')
self.level = map.get('level')
self.org_did = map.get('org_did')
self.org_name = map.get('org_name')
self.org_user_id = map.get('org_user_id')
self.primary_id_no = map.get('primary_id_no')
self.privacy_desc_list = []
if map.get('privacy_desc_list') is not None:
for k in map.get('privacy_desc_list'):
temp_model = PrivacyDesc()
self.privacy_desc_list.append(temp_model.from_map(k))
else:
self.privacy_desc_list = None
self.proxy_desc_list = []
if map.get('proxy_desc_list') is not None:
for k in map.get('proxy_desc_list'):
temp_model = ProxyDesc()
self.proxy_desc_list.append(temp_model.from_map(k))
else:
self.proxy_desc_list = None
self.public_desc_list = []
if map.get('public_desc_list') is not None:
for k in map.get('public_desc_list'):
temp_model = PublicDesc()
self.public_desc_list.append(temp_model.from_map(k))
else:
self.public_desc_list = None
self.second_id_no_1 = map.get('second_id_no_1')
self.second_id_no_2 = map.get('second_id_no_2')
self.second_id_no_3 = map.get('second_id_no_3')
self.secret_key = map.get('secret_key')
self.type = map.get('type')
return self
class CreateBaasEbcUserCertResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, cert_id=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 证书id
self.cert_id = cert_id
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['cert_id'] = self.cert_id
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.cert_id = map.get('cert_id')
return self
class UpdateBaasEbcUserCertRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, cert_id=None,
cert_publish_time=None, cert_status=None, org_did=None, org_user_id=None, privacy_desc_list=None,
proxy_desc_list=None, public_desc_list=None, secret_key=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 证书id
self.cert_id = cert_id
# 首次发布时间
self.cert_publish_time = cert_publish_time
# 1-有效 2-冻结 3-失效 4-作废 5-其他
self.cert_status = cert_status
# 企业did
self.org_did = org_did
# 企业用户id
self.org_user_id = org_user_id
# 隐私属性描述列表
#
self.privacy_desc_list = privacy_desc_list
# 托管属性描述列表
#
self.proxy_desc_list = proxy_desc_list
# 公开属性描述列表
#
self.public_desc_list = public_desc_list
# 非对称加密后的对称秘钥,对应执行java SDK中的EnvelopeClient#envelopeSeal方法的返回值
self.secret_key = secret_key
def validate(self):
if self.cert_id:
self.validate_max_length(self.cert_id, 'cert_id', 128)
if self.cert_publish_time:
self.validate_pattern(self.cert_publish_time, 'cert_publish_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_id:
self.validate_max_length(self.org_user_id, 'org_user_id', 128)
if self.privacy_desc_list:
for k in self.privacy_desc_list:
if k:
k.validate()
if self.proxy_desc_list:
for k in self.proxy_desc_list:
if k:
k.validate()
if self.public_desc_list:
for k in self.public_desc_list:
if k:
k.validate()
if self.secret_key:
self.validate_max_length(self.secret_key, 'secret_key', 512)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['cert_id'] = self.cert_id
result['cert_publish_time'] = self.cert_publish_time
result['cert_status'] = self.cert_status
result['org_did'] = self.org_did
result['org_user_id'] = self.org_user_id
result['privacy_desc_list'] = []
if self.privacy_desc_list is not None:
for k in self.privacy_desc_list:
result['privacy_desc_list'].append(k.to_map() if k else None)
else:
result['privacy_desc_list'] = None
result['proxy_desc_list'] = []
if self.proxy_desc_list is not None:
for k in self.proxy_desc_list:
result['proxy_desc_list'].append(k.to_map() if k else None)
else:
result['proxy_desc_list'] = None
result['public_desc_list'] = []
if self.public_desc_list is not None:
for k in self.public_desc_list:
result['public_desc_list'].append(k.to_map() if k else None)
else:
result['public_desc_list'] = None
result['secret_key'] = self.secret_key
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.cert_id = map.get('cert_id')
self.cert_publish_time = map.get('cert_publish_time')
self.cert_status = map.get('cert_status')
self.org_did = map.get('org_did')
self.org_user_id = map.get('org_user_id')
self.privacy_desc_list = []
if map.get('privacy_desc_list') is not None:
for k in map.get('privacy_desc_list'):
temp_model = PrivacyDesc()
self.privacy_desc_list.append(temp_model.from_map(k))
else:
self.privacy_desc_list = None
self.proxy_desc_list = []
if map.get('proxy_desc_list') is not None:
for k in map.get('proxy_desc_list'):
temp_model = ProxyDesc()
self.proxy_desc_list.append(temp_model.from_map(k))
else:
self.proxy_desc_list = None
self.public_desc_list = []
if map.get('public_desc_list') is not None:
for k in map.get('public_desc_list'):
temp_model = PublicDesc()
self.public_desc_list.append(temp_model.from_map(k))
else:
self.public_desc_list = None
self.secret_key = map.get('secret_key')
return self
class UpdateBaasEbcUserCertResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
return self
class QueryBaasEbcOrganizationCertRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, end=None, org_did=None,
start=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 查询结束时间
self.end = end
# 企业id
self.org_did = org_did
# 开始时间
self.start = start
def validate(self):
if self.end:
self.validate_pattern(self.end, 'end', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.start:
self.validate_pattern(self.start, 'start', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['end'] = self.end
result['org_did'] = self.org_did
result['start'] = self.start
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.end = map.get('end')
self.org_did = map.get('org_did')
self.start = map.get('start')
return self
class QueryBaasEbcOrganizationCertResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, cert_id_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 证书id
self.cert_id_list = cert_id_list
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['cert_id_list'] = self.cert_id_list
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.cert_id_list = map.get('cert_id_list')
return self
class QueryBaasEbcUserCertRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, org_did=None, org_user_id=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 企业did
self.org_did = org_did
# 企业用户id
self.org_user_id = org_user_id
def validate(self):
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_id:
self.validate_max_length(self.org_user_id, 'org_user_id', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['org_did'] = self.org_did
result['org_user_id'] = self.org_user_id
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.org_did = map.get('org_did')
self.org_user_id = map.get('org_user_id')
return self
class QueryBaasEbcUserCertResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, cert_id_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 证书id列表
self.cert_id_list = cert_id_list
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['cert_id_list'] = self.cert_id_list
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.cert_id_list = map.get('cert_id_list')
return self
class QueryBaasEbcCertRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, cert_id=None, org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 证书id
self.cert_id = cert_id
# 企业did
self.org_did = org_did
def validate(self):
if self.cert_id:
self.validate_max_length(self.cert_id, 'cert_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['cert_id'] = self.cert_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.cert_id = map.get('cert_id')
self.org_did = map.get('org_did')
return self
class QueryBaasEbcCertResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, cert=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 证书明细
self.cert = cert # type: Cert
def validate(self):
if self.cert:
self.cert.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
if self.cert is not None:
result['cert'] = self.cert.to_map()
else:
result['cert'] = None
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
if map.get('cert') is not None:
temp_model = Cert()
self.cert = temp_model.from_map(map['cert'])
else:
self.cert = None
return self
class ApplyBaasEbcCertUrlRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, cert_code=None, org_did=None,
org_user_id=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 证书code
self.cert_code = cert_code
# 机构did
self.org_did = org_did
# 证书持有人id
self.org_user_id = org_user_id
def validate(self):
if self.cert_code:
self.validate_max_length(self.cert_code, 'cert_code', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['cert_code'] = self.cert_code
result['org_did'] = self.org_did
result['org_user_id'] = self.org_user_id
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.cert_code = map.get('cert_code')
self.org_did = map.get('org_did')
self.org_user_id = map.get('org_user_id')
return self
class ApplyBaasEbcCertUrlResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, cert_upload_url=None,
feature_upload_url=None, holder_avatar_upload_url=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 实体证书图片上传url,文件最大5M
self.cert_upload_url = cert_upload_url
# 其他信息文件上传url,文件最大5M
#
self.feature_upload_url = feature_upload_url
# 持有人的人脸图像上传url,文件最大5M
self.holder_avatar_upload_url = holder_avatar_upload_url
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['cert_upload_url'] = self.cert_upload_url
result['feature_upload_url'] = self.feature_upload_url
result['holder_avatar_upload_url'] = self.holder_avatar_upload_url
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.cert_upload_url = map.get('cert_upload_url')
self.feature_upload_url = map.get('feature_upload_url')
self.holder_avatar_upload_url = map.get('holder_avatar_upload_url')
return self
class CreateBaasEbcAuthRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, auth_end_time=None,
auth_start_time=None, data_type=None, target_id_list=None, target_type=None, tenant_name=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 授权关系结束时间
self.auth_end_time = auth_end_time
# 授权关系开始时间
self.auth_start_time = auth_start_time
# 1:身份数据,2:机构数据,3:课程数据,4:班级数据,5:证书数据
self.data_type = data_type
# 授权目标数据id列表,最多20个
self.target_id_list = target_id_list
# 1.数据,2.机构,3.认证方,4.ALL
self.target_type = target_type
# 消费方租户id
self.tenant_name = tenant_name
def validate(self):
if self.auth_end_time:
self.validate_pattern(self.auth_end_time, 'auth_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.auth_start_time:
self.validate_pattern(self.auth_start_time, 'auth_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.tenant_name:
self.validate_max_length(self.tenant_name, 'tenant_name', 64)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['auth_end_time'] = self.auth_end_time
result['auth_start_time'] = self.auth_start_time
result['data_type'] = self.data_type
result['target_id_list'] = self.target_id_list
result['target_type'] = self.target_type
result['tenant_name'] = self.tenant_name
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.auth_end_time = map.get('auth_end_time')
self.auth_start_time = map.get('auth_start_time')
self.data_type = map.get('data_type')
self.target_id_list = map.get('target_id_list')
self.target_type = map.get('target_type')
self.tenant_name = map.get('tenant_name')
return self
class CreateBaasEbcAuthResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, auth_id=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 授权关系id
self.auth_id = auth_id
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['auth_id'] = self.auth_id
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.auth_id = map.get('auth_id')
return self
class UpdateBaasEbcAuthRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, auth_end_time=None,
auth_id=None, auth_start_time=None, data_type=None, target_id_list=None, target_type=None,
tenant_name=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 授权关系结束时间
#
self.auth_end_time = auth_end_time
# 授权关系id
self.auth_id = auth_id
# 授权关系开始时间
#
self.auth_start_time = auth_start_time
# 1:身份数据,2:机构数据,3:课程数据,4:班级数据,5:证书数据
self.data_type = data_type
# 授权目标数据id列表,最多20个
self.target_id_list = target_id_list
# 1.数据,2.机构,3.认证方,4.ALL
#
self.target_type = target_type
# 消费方租户id
#
self.tenant_name = tenant_name
def validate(self):
if self.auth_end_time:
self.validate_pattern(self.auth_end_time, 'auth_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.auth_id:
self.validate_max_length(self.auth_id, 'auth_id', 256)
if self.auth_start_time:
self.validate_pattern(self.auth_start_time, 'auth_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.tenant_name:
self.validate_max_length(self.tenant_name, 'tenant_name', 64)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['auth_end_time'] = self.auth_end_time
result['auth_id'] = self.auth_id
result['auth_start_time'] = self.auth_start_time
result['data_type'] = self.data_type
result['target_id_list'] = self.target_id_list
result['target_type'] = self.target_type
result['tenant_name'] = self.tenant_name
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.auth_end_time = map.get('auth_end_time')
self.auth_id = map.get('auth_id')
self.auth_start_time = map.get('auth_start_time')
self.data_type = map.get('data_type')
self.target_id_list = map.get('target_id_list')
self.target_type = map.get('target_type')
self.tenant_name = map.get('tenant_name')
return self
class UpdateBaasEbcAuthResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
return self
class UpdateBaasEbcAuthStatusRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, auth_id=None, status=None,
tenant_name=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 授权关系id
#
self.auth_id = auth_id
# 1:启用,2:禁用,3:停用
self.status = status
# 消费方租户id
#
self.tenant_name = tenant_name
def validate(self):
if self.auth_id:
self.validate_max_length(self.auth_id, 'auth_id', 256)
if self.tenant_name:
self.validate_max_length(self.tenant_name, 'tenant_name', 64)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['auth_id'] = self.auth_id
result['status'] = self.status
result['tenant_name'] = self.tenant_name
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.auth_id = map.get('auth_id')
self.status = map.get('status')
self.tenant_name = map.get('tenant_name')
return self
class UpdateBaasEbcAuthStatusResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
return self
class UpdateBaasEbcDataPriceRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, data_id_list=None,
data_type=None, price=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 目标数据id列表,最多20个
self.data_id_list = data_id_list
# 1:身份数据,2:机构数据,3:课程数据,4:班级数据,5:证书数据
self.data_type = data_type
# 数据价值
self.price = price
def validate(self):
pass
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['data_id_list'] = self.data_id_list
result['data_type'] = self.data_type
result['price'] = self.price
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.data_id_list = map.get('data_id_list')
self.data_type = map.get('data_type')
self.price = map.get('price')
return self
class UpdateBaasEbcDataPriceResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, fail_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 更新失败的id列表
self.fail_list = fail_list
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['fail_list'] = self.fail_list
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.fail_list = map.get('fail_list')
return self
class QueryBaasEbcConsumptionAmountRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, end_time=None, start_time=None,
tenant_name=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 结束时间
self.end_time = end_time
# 开始时间
self.start_time = start_time
# 消费方租户id
self.tenant_name = tenant_name
def validate(self):
if self.end_time:
self.validate_pattern(self.end_time, 'end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.start_time:
self.validate_pattern(self.start_time, 'start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.tenant_name:
self.validate_max_length(self.tenant_name, 'tenant_name', 64)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['end_time'] = self.end_time
result['start_time'] = self.start_time
result['tenant_name'] = self.tenant_name
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.end_time = map.get('end_time')
self.start_time = map.get('start_time')
self.tenant_name = map.get('tenant_name')
return self
class QueryBaasEbcConsumptionAmountResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, amount=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 区间内的累计消费金额
self.amount = amount
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['amount'] = self.amount
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.amount = map.get('amount')
return self
class QueryBaasEbcOrganizationCourseRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, course_id=None, org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 班级id
self.course_id = course_id
# 企业did
self.org_did = org_did
def validate(self):
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 256)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['course_id'] = self.course_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
return self
class QueryBaasEbcOrganizationCourseResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, course_class_list=None,
course_description=None, course_end_time=None, course_modify_time=None, course_name=None, course_org_user_list=None,
course_start_time=None, course_status=None, course_summary=None, course_type=None, period=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 课程班级列表
self.course_class_list = course_class_list
# 课程描述
self.course_description = course_description
# 课程结束时间
#
self.course_end_time = course_end_time
# 课程最近一次修改时间
self.course_modify_time = course_modify_time
# 课程名称
self.course_name = course_name
# 课程学员列表
self.course_org_user_list = course_org_user_list
# 课程开始时间
#
self.course_start_time = course_start_time
# 1:已发布,2:进行中,3:已结束
self.course_status = course_status
# 课程简介
self.course_summary = course_summary
# 课程类型: 1直播课程,2录播课程,3线下课程,4其他类型
self.course_type = course_type
# 课程时长
#
self.period = period
def validate(self):
if self.course_class_list:
for k in self.course_class_list:
if k:
k.validate()
if self.course_end_time:
self.validate_pattern(self.course_end_time, 'course_end_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.course_modify_time:
self.validate_pattern(self.course_modify_time, 'course_modify_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.course_org_user_list:
for k in self.course_org_user_list:
if k:
k.validate()
if self.course_start_time:
self.validate_pattern(self.course_start_time, 'course_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['course_class_list'] = []
if self.course_class_list is not None:
for k in self.course_class_list:
result['course_class_list'].append(k.to_map() if k else None)
else:
result['course_class_list'] = None
result['course_description'] = self.course_description
result['course_end_time'] = self.course_end_time
result['course_modify_time'] = self.course_modify_time
result['course_name'] = self.course_name
result['course_org_user_list'] = []
if self.course_org_user_list is not None:
for k in self.course_org_user_list:
result['course_org_user_list'].append(k.to_map() if k else None)
else:
result['course_org_user_list'] = None
result['course_start_time'] = self.course_start_time
result['course_status'] = self.course_status
result['course_summary'] = self.course_summary
result['course_type'] = self.course_type
result['period'] = self.period
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.course_class_list = []
if map.get('course_class_list') is not None:
for k in map.get('course_class_list'):
temp_model = Class()
self.course_class_list.append(temp_model.from_map(k))
else:
self.course_class_list = None
self.course_description = map.get('course_description')
self.course_end_time = map.get('course_end_time')
self.course_modify_time = map.get('course_modify_time')
self.course_name = map.get('course_name')
self.course_org_user_list = []
if map.get('course_org_user_list') is not None:
for k in map.get('course_org_user_list'):
temp_model = OrgUser()
self.course_org_user_list.append(temp_model.from_map(k))
else:
self.course_org_user_list = None
self.course_start_time = map.get('course_start_time')
self.course_status = map.get('course_status')
self.course_summary = map.get('course_summary')
self.course_type = map.get('course_type')
self.period = map.get('period')
return self
class CreateBaasEbcCourseChapterRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, chapter_biz_id=None,
chapter_description=None, chapter_name=None, chapter_period=None, course_id=None, org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 业务系统章节ID
self.chapter_biz_id = chapter_biz_id
# 章节描述
self.chapter_description = chapter_description
# 章节名称
self.chapter_name = chapter_name
# 章节时长,单位秒
self.chapter_period = chapter_period
# 课程id
self.course_id = course_id
# 企业链上did
self.org_did = org_did
def validate(self):
if self.chapter_biz_id:
self.validate_max_length(self.chapter_biz_id, 'chapter_biz_id', 128)
if self.chapter_description:
self.validate_max_length(self.chapter_description, 'chapter_description', 2000)
if self.chapter_name:
self.validate_max_length(self.chapter_name, 'chapter_name', 128)
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['chapter_biz_id'] = self.chapter_biz_id
result['chapter_description'] = self.chapter_description
result['chapter_name'] = self.chapter_name
result['chapter_period'] = self.chapter_period
result['course_id'] = self.course_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.chapter_biz_id = map.get('chapter_biz_id')
self.chapter_description = map.get('chapter_description')
self.chapter_name = map.get('chapter_name')
self.chapter_period = map.get('chapter_period')
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
return self
class CreateBaasEbcCourseChapterResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, chapter_id=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 链上章节id
self.chapter_id = chapter_id
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['chapter_id'] = self.chapter_id
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.chapter_id = map.get('chapter_id')
return self
class UpdateBaasEbcCourseChapterRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, chapter_description=None,
chapter_id=None, chapter_name=None, chapter_period=None, course_id=None, org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 章节描述
self.chapter_description = chapter_description
# 链上章节id
self.chapter_id = chapter_id
# 章节名称
self.chapter_name = chapter_name
# 章节时长,单位秒
self.chapter_period = chapter_period
# 链上课程id
self.course_id = course_id
# 企业链上did
self.org_did = org_did
def validate(self):
if self.chapter_description:
self.validate_max_length(self.chapter_description, 'chapter_description', 2000)
if self.chapter_id:
self.validate_max_length(self.chapter_id, 'chapter_id', 128)
if self.chapter_name:
self.validate_max_length(self.chapter_name, 'chapter_name', 128)
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['chapter_description'] = self.chapter_description
result['chapter_id'] = self.chapter_id
result['chapter_name'] = self.chapter_name
result['chapter_period'] = self.chapter_period
result['course_id'] = self.course_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.chapter_description = map.get('chapter_description')
self.chapter_id = map.get('chapter_id')
self.chapter_name = map.get('chapter_name')
self.chapter_period = map.get('chapter_period')
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
return self
class UpdateBaasEbcCourseChapterResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
return self
class CreateBaasEbcCourseRecordRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, chapter_id=None, class_id=None,
course_id=None, course_name=None, org_did=None, org_user_id=None, record_ext=None, record_open_time=None,
record_period=None, record_source=None, record_start_time=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 链上章节id
self.chapter_id = chapter_id
# 链上班级id
self.class_id = class_id
# 链上课程id
self.course_id = course_id
# 课程名称
self.course_name = course_name
# 企业did
#
self.org_did = org_did
# 企业用户id
self.org_user_id = org_user_id
# 课程扩展信息,格式为json。比如钉钉用户id。
self.record_ext = record_ext
# 本次开启时间
self.record_open_time = record_open_time
# 本次观看时长,单位秒
self.record_period = record_period
# 行为来源
self.record_source = record_source
# 本次点击观看时间
self.record_start_time = record_start_time
def validate(self):
if self.chapter_id:
self.validate_max_length(self.chapter_id, 'chapter_id', 128)
if self.class_id:
self.validate_max_length(self.class_id, 'class_id', 128)
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.course_name:
self.validate_max_length(self.course_name, 'course_name', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_id:
self.validate_max_length(self.org_user_id, 'org_user_id', 128)
if self.record_ext:
self.validate_max_length(self.record_ext, 'record_ext', 2000)
if self.record_open_time:
self.validate_pattern(self.record_open_time, 'record_open_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
if self.record_source:
self.validate_max_length(self.record_source, 'record_source', 128)
if self.record_start_time:
self.validate_pattern(self.record_start_time, 'record_start_time', '\\d{4}[-]\\d{1,2}[-]\\d{1,2}[T]\\d{2}:\\d{2}:\\d{2}[Z]')
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['chapter_id'] = self.chapter_id
result['class_id'] = self.class_id
result['course_id'] = self.course_id
result['course_name'] = self.course_name
result['org_did'] = self.org_did
result['org_user_id'] = self.org_user_id
result['record_ext'] = self.record_ext
result['record_open_time'] = self.record_open_time
result['record_period'] = self.record_period
result['record_source'] = self.record_source
result['record_start_time'] = self.record_start_time
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.chapter_id = map.get('chapter_id')
self.class_id = map.get('class_id')
self.course_id = map.get('course_id')
self.course_name = map.get('course_name')
self.org_did = map.get('org_did')
self.org_user_id = map.get('org_user_id')
self.record_ext = map.get('record_ext')
self.record_open_time = map.get('record_open_time')
self.record_period = map.get('record_period')
self.record_source = map.get('record_source')
self.record_start_time = map.get('record_start_time')
return self
class CreateBaasEbcCourseRecordResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, record_id=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 链上学习记录id
self.record_id = record_id
def validate(self):
pass
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['record_id'] = self.record_id
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.record_id = map.get('record_id')
return self
class QueryBaasEbcCourseChapterRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, course_id=None, org_did=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 课程id
self.course_id = course_id
# 企业链上did
self.org_did = org_did
def validate(self):
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['course_id'] = self.course_id
result['org_did'] = self.org_did
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
return self
class QueryBaasEbcCourseChapterResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, chapter_list=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 课程章节列表
self.chapter_list = chapter_list
def validate(self):
if self.chapter_list:
for k in self.chapter_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['chapter_list'] = []
if self.chapter_list is not None:
for k in self.chapter_list:
result['chapter_list'].append(k.to_map() if k else None)
else:
result['chapter_list'] = None
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.chapter_list = []
if map.get('chapter_list') is not None:
for k in map.get('chapter_list'):
temp_model = CourseChapter()
self.chapter_list.append(temp_model.from_map(k))
else:
self.chapter_list = None
return self
class QueryBaasEbcCourseRecordRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, course_id=None, org_did=None,
org_user_id=None, page_num=None, page_size=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 课程id
self.course_id = course_id
# 企业链上did
#
self.org_did = org_did
# 企业用户id
#
self.org_user_id = org_user_id
# 页码,从1开始
self.page_num = page_num
# 页面大小,最大10
self.page_size = page_size
def validate(self):
if self.course_id:
self.validate_max_length(self.course_id, 'course_id', 128)
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
if self.org_user_id:
self.validate_max_length(self.org_user_id, 'org_user_id', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['course_id'] = self.course_id
result['org_did'] = self.org_did
result['org_user_id'] = self.org_user_id
result['page_num'] = self.page_num
result['page_size'] = self.page_size
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.course_id = map.get('course_id')
self.org_did = map.get('org_did')
self.org_user_id = map.get('org_user_id')
self.page_num = map.get('page_num')
self.page_size = map.get('page_size')
return self
class QueryBaasEbcCourseRecordResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, pages=None, page_num=None,
record_list=None, total=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 总页数
self.pages = pages
# 当前页码
self.page_num = page_num
# 学习记录列表
self.record_list = record_list
# 数据总量
self.total = total
def validate(self):
if self.record_list:
for k in self.record_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['pages'] = self.pages
result['page_num'] = self.page_num
result['record_list'] = []
if self.record_list is not None:
for k in self.record_list:
result['record_list'].append(k.to_map() if k else None)
else:
result['record_list'] = None
result['total'] = self.total
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.pages = map.get('pages')
self.page_num = map.get('page_num')
self.record_list = []
if map.get('record_list') is not None:
for k in map.get('record_list'):
temp_model = CourseRecord()
self.record_list.append(temp_model.from_map(k))
else:
self.record_list = None
self.total = map.get('total')
return self
class QueryBaasEbcOrganizationUserRequest(TeaModel):
def __init__(self, auth_token=None, product_instance_id=None, region_name=None, org_did=None, page_num=None,
page_size=None):
self.auth_token = auth_token
self.product_instance_id = product_instance_id
self.region_name = region_name
# 企业链上did
self.org_did = org_did
# 页码,从1开始
self.page_num = page_num
# 页面大小,最大10
self.page_size = page_size
def validate(self):
if self.org_did:
self.validate_max_length(self.org_did, 'org_did', 128)
def to_map(self):
result = {}
result['auth_token'] = self.auth_token
result['product_instance_id'] = self.product_instance_id
result['region_name'] = self.region_name
result['org_did'] = self.org_did
result['page_num'] = self.page_num
result['page_size'] = self.page_size
return result
def from_map(self, map={}):
self.auth_token = map.get('auth_token')
self.product_instance_id = map.get('product_instance_id')
self.region_name = map.get('region_name')
self.org_did = map.get('org_did')
self.page_num = map.get('page_num')
self.page_size = map.get('page_size')
return self
class QueryBaasEbcOrganizationUserResponse(TeaModel):
def __init__(self, req_msg_id=None, result_code=None, result_msg=None, org_user_list=None, pages=None,
page_num=None, total=None):
self.req_msg_id = req_msg_id
self.result_code = result_code
self.result_msg = result_msg
# 企业用户列表
self.org_user_list = org_user_list
# 总页数
self.pages = pages
# 当前页码
self.page_num = page_num
# 数据总量
self.total = total
def validate(self):
if self.org_user_list:
for k in self.org_user_list:
if k:
k.validate()
def to_map(self):
result = {}
result['req_msg_id'] = self.req_msg_id
result['result_code'] = self.result_code
result['result_msg'] = self.result_msg
result['org_user_list'] = []
if self.org_user_list is not None:
for k in self.org_user_list:
result['org_user_list'].append(k.to_map() if k else None)
else:
result['org_user_list'] = None
result['pages'] = self.pages
result['page_num'] = self.page_num
result['total'] = self.total
return result
def from_map(self, map={}):
self.req_msg_id = map.get('req_msg_id')
self.result_code = map.get('result_code')
self.result_msg = map.get('result_msg')
self.org_user_list = []
if map.get('org_user_list') is not None:
for k in map.get('org_user_list'):
temp_model = OrgUser()
self.org_user_list.append(temp_model.from_map(k))
else:
self.org_user_list = None
self.pages = map.get('pages')
self.page_num = map.get('page_num')
self.total = map.get('total')
return self
| 37.52741
| 138
| 0.620861
| 19,628
| 144,443
| 4.2312
| 0.021449
| 0.039229
| 0.050151
| 0.036412
| 0.917014
| 0.903805
| 0.886791
| 0.876171
| 0.867357
| 0.859193
| 0
| 0.009105
| 0.270058
| 144,443
| 3,848
| 139
| 37.537162
| 0.778584
| 0.025089
| 0
| 0.875891
| 1
| 0.010369
| 0.117237
| 0.01343
| 0
| 0
| 0
| 0
| 0
| 1
| 0.102398
| false
| 0.008101
| 0.000324
| 0
| 0.17952
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
7504f330889ffcd681a04699689a82a8639a8d8d
| 35,681
|
py
|
Python
|
tests/unit/test_hub.py
|
klmitch/heyu
|
9bdc552115bb22d1d01910b0b851eb3cbc3b08d1
|
[
"Apache-2.0"
] | null | null | null |
tests/unit/test_hub.py
|
klmitch/heyu
|
9bdc552115bb22d1d01910b0b851eb3cbc3b08d1
|
[
"Apache-2.0"
] | null | null | null |
tests/unit/test_hub.py
|
klmitch/heyu
|
9bdc552115bb22d1d01910b0b851eb3cbc3b08d1
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2014 Rackspace
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import signal
import unittest
import mock
from heyu import hub
from heyu import util
class TestException(Exception):
pass
class HubServerTest(unittest.TestCase):
def _signal_test(self, hub_server, mock_signal):
signals = [
mock.call(signal.SIGINT, hub_server.stop),
mock.call(signal.SIGTERM, hub_server.stop),
]
if hasattr(signal, 'SIGUSR1'):
signals.append(mock.call(signal.SIGUSR1, hub_server.shutdown))
mock_signal.assert_has_calls(signals)
self.assertEqual(len(signals), mock_signal.call_count)
@mock.patch('tendril.get_manager', side_effect=lambda a, b: b)
@mock.patch('gevent.signal')
def test_init_basic(self, mock_signal, mock_get_manager):
result = hub.HubServer([])
self.assertEqual({}, result._subscribers)
self.assertEqual({}, result._listeners)
self.assertEqual(False, result._running)
self.assertFalse(mock_get_manager.called)
self._signal_test(result, mock_signal)
@mock.patch('tendril.get_manager', side_effect=lambda a, b: b)
@mock.patch('gevent.signal')
def test_init_endpoints(self, mock_signal, mock_get_manager):
result = hub.HubServer(['ep1', 'ep2', 'ep3'])
self.assertEqual({}, result._subscribers)
self.assertEqual({
'ep1': 'ep1',
'ep2': 'ep2',
'ep3': 'ep3',
}, result._listeners)
self.assertEqual(False, result._running)
mock_get_manager.assert_has_calls([
mock.call('tcp', 'ep1'),
mock.call('tcp', 'ep2'),
mock.call('tcp', 'ep3'),
], any_order=True)
self._signal_test(result, mock_signal)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
@mock.patch.object(hub, 'HubApplication', return_value='app')
def test_acceptor(self, mock_HubApplication, mock_init):
server = hub.HubServer()
result = server._acceptor('tendril')
self.assertEqual(result, 'app')
mock_HubApplication.assert_called_once_with('tendril', server)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
@mock.patch.object(util, 'cert_wrapper', return_value='wrapper')
def test_start_running(self, mock_cert_wrapper, mock_init):
server = hub.HubServer()
server._listeners = {
'a': mock.Mock(),
'b': mock.Mock(),
'c': mock.Mock(),
}
server._running = True
self.assertRaises(ValueError, server.start)
self.assertFalse(mock_cert_wrapper.called)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
@mock.patch.object(util, 'cert_wrapper', return_value='wrapper')
def test_start_basic(self, mock_cert_wrapper, mock_init):
server = hub.HubServer()
server._listeners = {
'a': mock.Mock(),
'b': mock.Mock(),
'c': mock.Mock(),
}
server._running = False
server.start()
self.assertEqual(True, server._running)
mock_cert_wrapper.assert_called_once_with(
None, 'hub', server_side=True, secure=True)
for manager in server._listeners.values():
manager.start.assert_called_once_with(server._acceptor, 'wrapper')
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
@mock.patch.object(util, 'cert_wrapper', return_value='wrapper')
def test_start_nolisteners(self, mock_cert_wrapper, mock_init):
server = hub.HubServer()
server._listeners = {}
server._running = False
server.start()
self.assertEqual(True, server._running)
mock_cert_wrapper.assert_called_once_with(
None, 'hub', server_side=True, secure=True)
for manager in server._listeners.values():
manager.start.assert_called_once_with(server._acceptor, 'wrapper')
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_stop_notrunning(self, mock_init):
server = hub.HubServer()
server._listeners = {
'a': mock.Mock(),
'b': mock.Mock(),
'c': mock.Mock(),
}
server._subscribers = {
'a': (mock.Mock(), 0),
'b': (mock.Mock(), 1),
'c': (mock.Mock(), 2),
}
server._running = False
server.stop()
for manager in server._listeners.values():
self.assertFalse(manager.stop.called)
for client, _version in server._subscribers.values():
self.assertFalse(client.disconnect.called)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_stop_basic(self, mock_init):
server = hub.HubServer()
server._listeners = {
'a': mock.Mock(),
'b': mock.Mock(),
'c': mock.Mock(),
}
server._subscribers = {
'a': (mock.Mock(), 0),
'b': (mock.Mock(), 1),
'c': (mock.Mock(), 2),
}
server._running = True
server.stop()
self.assertEqual(False, server._running)
for manager in server._listeners.values():
manager.stop.assert_called_once_with()
for client, _version in server._subscribers.values():
client.disconnect.assert_called_once_with()
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_stop_empty(self, mock_init):
server = hub.HubServer()
server._listeners = {}
server._subscribers = {}
server._running = True
server.stop()
self.assertEqual(False, server._running)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_shutdown_notrunning(self, mock_init):
subscribers = {
'a': (mock.Mock(), 0),
'b': (mock.Mock(), 1),
'c': (mock.Mock(), 2),
}
server = hub.HubServer()
server._listeners = {
'a': mock.Mock(),
'b': mock.Mock(),
'c': mock.Mock(),
}
server._subscribers = subscribers
server._running = False
server.shutdown()
for manager in server._listeners.values():
self.assertFalse(manager.shutdown.called)
self.assertEqual(subscribers, server._subscribers)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_shutdown_basic(self, mock_init):
subscribers = {
'a': (mock.Mock(), 0),
'b': (mock.Mock(), 1),
'c': (mock.Mock(), 2),
}
server = hub.HubServer()
server._listeners = {
'a': mock.Mock(),
'b': mock.Mock(),
'c': mock.Mock(),
}
server._subscribers = subscribers
server._running = True
server.shutdown()
self.assertEqual(False, server._running)
for manager in server._listeners.values():
manager.shutdown.assert_called_once_with()
self.assertEqual({}, server._subscribers)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_shutdown_empty(self, mock_init):
server = hub.HubServer()
server._listeners = {}
server._subscribers = {
'a': (mock.Mock(), 0),
'b': (mock.Mock(), 1),
'c': (mock.Mock(), 2),
}
server._running = True
server.shutdown()
self.assertEqual(False, server._running)
self.assertEqual({}, server._subscribers)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_subscribe(self, mock_init):
client = mock.Mock()
server = hub.HubServer()
server._subscribers = {}
server.subscribe(client, 1)
self.assertEqual({
id(client): (client, 1),
}, server._subscribers)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_unsubscribe_unsubscribed(self, mock_init):
client1 = mock.Mock()
client2 = mock.Mock()
server = hub.HubServer()
server._subscribers = {
id(client1): (client1, 0),
}
server.unsubscribe(client2)
self.assertEqual({
id(client1): (client1, 0),
}, server._subscribers)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_unsubscribe_subscribed(self, mock_init):
client1 = mock.Mock()
client2 = mock.Mock()
server = hub.HubServer()
server._subscribers = {
id(client1): (client1, 0),
id(client2): (client2, 0),
}
server.unsubscribe(client2)
self.assertEqual({
id(client1): (client1, 0),
}, server._subscribers)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_submit_empty(self, mock_init):
msg = mock.Mock(**{'to_frame.side_effect': lambda x: 'version %d' % x})
server = hub.HubServer()
server._subscribers = {}
server.submit(msg)
self.assertFalse(msg.to_frame.called)
@mock.patch.object(hub.HubServer, '__init__', return_value=None)
def test_submit(self, mock_init):
def fake_to_frame(version):
if version > 2:
raise TestException('version too high')
return 'version %d' % version
msg = mock.Mock(**{'to_frame.side_effect': fake_to_frame})
server = hub.HubServer()
server._subscribers = {
'a': (mock.Mock(), 0),
'b': (mock.Mock(), 1),
'c': (mock.Mock(), 2),
'd': (mock.Mock(), 3),
'e': (mock.Mock(), 4),
}
server.submit(msg)
msg.to_frame.assert_has_calls([
mock.call(0),
mock.call(1),
mock.call(2),
mock.call(3),
mock.call(4),
], any_order=True)
for client, version in server._subscribers.values():
if version > 2:
self.assertFalse(client.send_frame.called)
else:
client.send_frame.assert_called_once_with(
'version %d' % version)
class HubApplicationTest(unittest.TestCase):
@mock.patch('tendril.Application.__init__', return_value=None)
@mock.patch('tendril.COBSFramer', return_value='framer')
@mock.patch('socket.getfqdn', return_value='fqdn')
@mock.patch('socket.getnameinfo', return_value=('host', 1234))
def test_init_localipv4(self, mock_getnameinfo, mock_getfqdn,
mock_COBSFramer, mock_init):
parent = mock.Mock(remote_addr=('127.0.0.1', 4321))
app = hub.HubApplication(parent, 'server')
self.assertEqual('server', app.server)
self.assertEqual(False, app.persist)
self.assertEqual('fqdn', app.hostname)
mock_init.assert_called_once_with(parent)
mock_COBSFramer.assert_called_once_with(True)
self.assertEqual('framer', parent.framers)
mock_getfqdn.assert_called_once_with()
self.assertFalse(mock_getnameinfo.called)
@mock.patch('tendril.Application.__init__', return_value=None)
@mock.patch('tendril.COBSFramer', return_value='framer')
@mock.patch('socket.getfqdn', return_value='fqdn')
@mock.patch('socket.getnameinfo', return_value=('host', 1234))
def test_init_localipv6(self, mock_getnameinfo, mock_getfqdn,
mock_COBSFramer, mock_init):
parent = mock.Mock(remote_addr=('::1', 4321))
app = hub.HubApplication(parent, 'server')
self.assertEqual('server', app.server)
self.assertEqual(False, app.persist)
self.assertEqual('fqdn', app.hostname)
mock_init.assert_called_once_with(parent)
mock_COBSFramer.assert_called_once_with(True)
self.assertEqual('framer', parent.framers)
mock_getfqdn.assert_called_once_with()
self.assertFalse(mock_getnameinfo.called)
@mock.patch('tendril.Application.__init__', return_value=None)
@mock.patch('tendril.COBSFramer', return_value='framer')
@mock.patch('socket.getfqdn', return_value='fqdn')
@mock.patch('socket.getnameinfo', return_value=('host', 1234))
def test_init_remote(self, mock_getnameinfo, mock_getfqdn,
mock_COBSFramer, mock_init):
parent = mock.Mock(remote_addr=('10.0.0.1', 4321))
app = hub.HubApplication(parent, 'server')
self.assertEqual('server', app.server)
self.assertEqual(False, app.persist)
self.assertEqual('host', app.hostname)
mock_init.assert_called_once_with(parent)
mock_COBSFramer.assert_called_once_with(True)
self.assertEqual('framer', parent.framers)
self.assertFalse(mock_getfqdn.called)
mock_getnameinfo.assert_called_once_with(('10.0.0.1', 4321), 0)
@mock.patch('tendril.Application.__init__', return_value=None)
@mock.patch('tendril.COBSFramer', return_value='framer')
@mock.patch('socket.getfqdn', return_value='fqdn')
@mock.patch('socket.getnameinfo', side_effect=TestException('error'))
def test_init_bad_resolve(self, mock_getnameinfo, mock_getfqdn,
mock_COBSFramer, mock_init):
parent = mock.Mock(remote_addr=('10.0.0.1', 4321))
app = hub.HubApplication(parent, 'server')
self.assertEqual('server', app.server)
self.assertEqual(False, app.persist)
self.assertEqual('10.0.0.1', app.hostname)
mock_init.assert_called_once_with(parent)
mock_COBSFramer.assert_called_once_with(True)
self.assertEqual('framer', parent.framers)
self.assertFalse(mock_getfqdn.called)
mock_getnameinfo.assert_called_once_with(('10.0.0.1', 4321), 0)
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'some frame',
}), **{'from_frame.side_effect': ValueError('failed to decode')})
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
@mock.patch.object(hub.HubApplication, 'notify')
@mock.patch.object(hub.HubApplication, 'subscribe')
@mock.patch.object(hub.HubApplication, 'disconnect')
def test_recv_frame_decodeerror(self, mock_disconnect, mock_subscribe,
mock_notify, mock_close, mock_send_frame,
mock_init, mock_Message):
app = hub.HubApplication()
app.recv_frame('test')
mock_Message.from_frame.assert_called_once_with('test')
mock_Message.assert_called_once_with(
'error', reason='Failed to decode message: failed to decode')
mock_Message.return_value.to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('some frame')
mock_close.assert_called_once_with()
self.assertFalse(mock_notify.called)
self.assertFalse(mock_subscribe.called)
self.assertFalse(mock_disconnect.called)
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'some frame',
}), **{'from_frame.return_value': mock.Mock(msg_type='unknown')})
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
@mock.patch.object(hub.HubApplication, 'notify')
@mock.patch.object(hub.HubApplication, 'subscribe')
@mock.patch.object(hub.HubApplication, 'disconnect')
def test_recv_frame_unknownmsg(self, mock_disconnect, mock_subscribe,
mock_notify, mock_close, mock_send_frame,
mock_init, mock_Message):
app = hub.HubApplication()
app.recv_frame('test')
mock_Message.from_frame.assert_called_once_with('test')
mock_Message.assert_called_once_with(
'error', reason='Unknown message type "unknown"')
mock_Message.return_value.to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('some frame')
mock_close.assert_called_once_with()
self.assertFalse(mock_notify.called)
self.assertFalse(mock_subscribe.called)
self.assertFalse(mock_disconnect.called)
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'some frame',
}), **{'from_frame.return_value': mock.Mock(msg_type='notify')})
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
@mock.patch.object(hub.HubApplication, 'notify')
@mock.patch.object(hub.HubApplication, 'subscribe')
@mock.patch.object(hub.HubApplication, 'disconnect')
def test_recv_frame_notify(self, mock_disconnect, mock_subscribe,
mock_notify, mock_close, mock_send_frame,
mock_init, mock_Message):
app = hub.HubApplication()
app.recv_frame('test')
mock_Message.from_frame.assert_called_once_with('test')
self.assertFalse(mock_Message.called)
self.assertFalse(mock_send_frame.called)
self.assertFalse(mock_close.called)
mock_notify.assert_called_once_with(
mock_Message.from_frame.return_value)
self.assertFalse(mock_subscribe.called)
self.assertFalse(mock_disconnect.called)
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'some frame',
}), **{'from_frame.return_value': mock.Mock(msg_type='subscribe')})
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
@mock.patch.object(hub.HubApplication, 'notify')
@mock.patch.object(hub.HubApplication, 'subscribe')
@mock.patch.object(hub.HubApplication, 'disconnect')
def test_recv_frame_subscribe(self, mock_disconnect, mock_subscribe,
mock_notify, mock_close, mock_send_frame,
mock_init, mock_Message):
app = hub.HubApplication()
app.recv_frame('test')
mock_Message.from_frame.assert_called_once_with('test')
self.assertFalse(mock_Message.called)
self.assertFalse(mock_send_frame.called)
self.assertFalse(mock_close.called)
self.assertFalse(mock_notify.called)
mock_subscribe.assert_called_once_with(
mock_Message.from_frame.return_value)
self.assertFalse(mock_disconnect.called)
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'some frame',
}), **{'from_frame.return_value': mock.Mock(msg_type='goodbye')})
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
@mock.patch.object(hub.HubApplication, 'notify')
@mock.patch.object(hub.HubApplication, 'subscribe')
@mock.patch.object(hub.HubApplication, 'disconnect')
def test_recv_frame_goodbye(self, mock_disconnect, mock_subscribe,
mock_notify, mock_close, mock_send_frame,
mock_init, mock_Message):
app = hub.HubApplication()
app.recv_frame('test')
mock_Message.from_frame.assert_called_once_with('test')
self.assertFalse(mock_Message.called)
self.assertFalse(mock_send_frame.called)
self.assertFalse(mock_close.called)
self.assertFalse(mock_notify.called)
self.assertFalse(mock_subscribe.called)
mock_disconnect.assert_called_once_with()
@mock.patch('uuid.uuid4', return_value='some-uuid')
@mock.patch('heyu.protocol.Message')
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
def test_notify_success(self, mock_close, mock_send_frame, mock_init,
mock_Message, mock_uuid4):
msgs = {
'notify': 'notification',
'error': mock.Mock(**{'to_frame.return_value': 'error'}),
'accepted': mock.Mock(**{'to_frame.return_value': 'accepted'}),
}
mock_Message.side_effect = lambda x, **kw: msgs[x]
msg = mock.Mock(id=None, app_name='app', summary='summary',
body='body', urgency='urgency', category='category')
app = hub.HubApplication()
app.hostname = 'host'
app.server = mock.Mock()
app.persist = True
app.notify(msg)
mock_uuid4.assert_called_once_with()
mock_Message.assert_has_calls([
mock.call('notify', id='some-uuid', app_name='[host]app',
summary='summary', body='body', urgency='urgency',
category='category'),
mock.call('accepted', id='some-uuid'),
])
app.server.submit.assert_called_once_with('notification')
self.assertFalse(msgs['error'].to_frame.called)
msgs['accepted'].to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('accepted')
self.assertFalse(mock_close.called)
@mock.patch('uuid.uuid4', return_value='some-uuid')
@mock.patch('heyu.protocol.Message')
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
def test_notify_provided_id(self, mock_close, mock_send_frame, mock_init,
mock_Message, mock_uuid4):
msgs = {
'notify': 'notification',
'error': mock.Mock(**{'to_frame.return_value': 'error'}),
'accepted': mock.Mock(**{'to_frame.return_value': 'accepted'}),
}
mock_Message.side_effect = lambda x, **kw: msgs[x]
msg = mock.Mock(id='my-id', app_name='app', summary='summary',
body='body', urgency='urgency', category='category')
app = hub.HubApplication()
app.hostname = 'host'
app.server = mock.Mock()
app.persist = True
app.notify(msg)
self.assertFalse(mock_uuid4.called)
mock_Message.assert_has_calls([
mock.call('notify', id='my-id', app_name='[host]app',
summary='summary', body='body', urgency='urgency',
category='category'),
mock.call('accepted', id='my-id'),
])
app.server.submit.assert_called_once_with('notification')
self.assertFalse(msgs['error'].to_frame.called)
msgs['accepted'].to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('accepted')
self.assertFalse(mock_close.called)
@mock.patch('uuid.uuid4', return_value='some-uuid')
@mock.patch('heyu.protocol.Message')
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
def test_notify_no_persist(self, mock_close, mock_send_frame, mock_init,
mock_Message, mock_uuid4):
msgs = {
'notify': 'notification',
'error': mock.Mock(**{'to_frame.return_value': 'error'}),
'accepted': mock.Mock(**{'to_frame.return_value': 'accepted'}),
}
mock_Message.side_effect = lambda x, **kw: msgs[x]
msg = mock.Mock(id=None, app_name='app', summary='summary',
body='body', urgency='urgency', category='category')
app = hub.HubApplication()
app.hostname = 'host'
app.server = mock.Mock()
app.persist = False
app.notify(msg)
mock_uuid4.assert_called_once_with()
mock_Message.assert_has_calls([
mock.call('notify', id='some-uuid', app_name='[host]app',
summary='summary', body='body', urgency='urgency',
category='category'),
mock.call('accepted', id='some-uuid'),
])
app.server.submit.assert_called_once_with('notification')
self.assertFalse(msgs['error'].to_frame.called)
msgs['accepted'].to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('accepted')
mock_close.assert_called_once_with()
@mock.patch('uuid.uuid4', return_value='some-uuid')
@mock.patch('heyu.protocol.Message')
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
def test_notify_failure(self, mock_close, mock_send_frame, mock_init,
mock_Message, mock_uuid4):
msgs = {
'notify': 'notification',
'error': mock.Mock(**{'to_frame.return_value': 'error'}),
'accepted': mock.Mock(**{'to_frame.return_value': 'accepted'}),
}
mock_Message.side_effect = lambda x, **kw: msgs[x]
msg = mock.Mock(id=None, app_name='app', summary='summary',
body='body', urgency='urgency', category='category')
app = hub.HubApplication()
app.hostname = 'host'
app.server = mock.Mock(**{
'submit.side_effect': TestException('failed'),
})
app.persist = True
app.notify(msg)
mock_uuid4.assert_called_once_with()
mock_Message.assert_has_calls([
mock.call('notify', id='some-uuid', app_name='[host]app',
summary='summary', body='body', urgency='urgency',
category='category'),
mock.call('error', reason='Failed to submit notification: failed'),
])
app.server.submit.assert_called_once_with('notification')
msgs['error'].to_frame.assert_called_once_with()
self.assertFalse(msgs['accepted'].to_frame.called)
mock_send_frame.assert_called_once_with('error')
self.assertFalse(mock_close.called)
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'frame',
}))
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
def test_subscribe_success(self, mock_close, mock_send_frame, mock_init,
mock_Message):
msg = mock.Mock(version=1)
app = hub.HubApplication()
app.persist = False
app.server = mock.Mock()
app.subscribe(msg)
app.server.subscribe.assert_called_once_with(app, 1)
mock_Message.assert_called_once_with('subscribed')
mock_Message.return_value.to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('frame')
self.assertFalse(mock_close.called)
self.assertEqual(True, app.persist)
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'frame',
}))
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
def test_subscribe_failure(self, mock_close, mock_send_frame, mock_init,
mock_Message):
msg = mock.Mock(version=1)
app = hub.HubApplication()
app.persist = False
app.server = mock.Mock(**{
'subscribe.side_effect': TestException('failed'),
})
app.subscribe(msg)
app.server.subscribe.assert_called_once_with(app, 1)
mock_Message.assert_called_once_with(
'error', reason='Failed to subscribe: failed')
mock_Message.return_value.to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('frame')
mock_close.assert_called_once_with()
self.assertEqual(False, app.persist)
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'frame',
}))
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame')
@mock.patch.object(hub.HubApplication, 'close')
def test_disconnect_success(self, mock_close, mock_send_frame, mock_init,
mock_Message):
app = hub.HubApplication()
app.server = mock.Mock()
app.disconnect()
app.server.unsubscribe.assert_called_once_with(app)
mock_Message.assert_called_once_with('goodbye')
mock_Message.return_value.to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('frame')
mock_close.assert_called_once_with()
@mock.patch('heyu.protocol.Message', return_value=mock.Mock(**{
'to_frame.return_value': 'frame',
}))
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
@mock.patch.object(hub.HubApplication, 'send_frame',
side_effect=TestException('test'))
@mock.patch.object(hub.HubApplication, 'close')
def test_disconnect_failure(self, mock_close, mock_send_frame, mock_init,
mock_Message):
app = hub.HubApplication()
app.server = mock.Mock()
app.disconnect()
app.server.unsubscribe.assert_called_once_with(app)
mock_Message.assert_called_once_with('goodbye')
mock_Message.return_value.to_frame.assert_called_once_with()
mock_send_frame.assert_called_once_with('frame')
mock_close.assert_called_once_with()
@mock.patch.object(hub.HubApplication, '__init__', return_value=None)
def test_closed(self, mock_init):
app = hub.HubApplication()
app.server = mock.Mock()
app.closed(None)
app.server.unsubscribe.assert_called_once_with(app)
class StartHubTest(unittest.TestCase):
@mock.patch('gevent.wait')
@mock.patch.object(hub, 'HubServer')
def test_basic(self, mock_HubServer, mock_wait):
hub.start_hub(['ep1', 'ep2', 'ep3'])
mock_HubServer.assert_called_once_with(['ep1', 'ep2', 'ep3'])
mock_HubServer.return_value.start.assert_called_once_with(None, True)
mock_wait.assert_called_once_with()
@mock.patch('gevent.wait')
@mock.patch.object(hub, 'HubServer')
def test_alts(self, mock_HubServer, mock_wait):
hub.start_hub(['ep1', 'ep2', 'ep3'], 'cert_conf', False)
mock_HubServer.assert_called_once_with(['ep1', 'ep2', 'ep3'])
mock_HubServer.return_value.start.assert_called_once_with(
'cert_conf', False)
mock_wait.assert_called_once_with()
class NormalizeArgsTest(unittest.TestCase):
@mock.patch('socket.has_ipv6', False)
@mock.patch.object(util, 'parse_hub', side_effect=lambda x: x)
@mock.patch.object(util, 'daemonize')
def test_no_endpoints_v4(self, mock_daemonize, mock_parse_hub):
args = mock.Mock(
endpoints=[],
daemon=True,
debug=False,
pid_file=None,
)
hub._normalize_args(args)
self.assertEqual([('', util.HEYU_PORT)], args.endpoints)
self.assertFalse(mock_parse_hub.called)
mock_daemonize.assert_called_once_with(pidfile=None)
@mock.patch('socket.has_ipv6', True)
@mock.patch.object(util, 'parse_hub', side_effect=lambda x: x)
@mock.patch.object(util, 'daemonize')
def test_no_endpoints_v6(self, mock_daemonize, mock_parse_hub):
args = mock.Mock(
endpoints=[],
daemon=True,
debug=False,
pid_file=None,
)
hub._normalize_args(args)
self.assertEqual([('', util.HEYU_PORT), ('::', util.HEYU_PORT)],
args.endpoints)
self.assertFalse(mock_parse_hub.called)
mock_daemonize.assert_called_once_with(pidfile=None)
@mock.patch('socket.has_ipv6', True)
@mock.patch.object(util, 'parse_hub', side_effect=lambda x: (x, 1234))
@mock.patch.object(util, 'daemonize')
def test_with_endpoints(self, mock_daemonize, mock_parse_hub):
args = mock.Mock(
endpoints=['ep1', 'ep2', 'ep3'],
daemon=True,
debug=False,
pid_file=None,
)
hub._normalize_args(args)
self.assertEqual([('ep1', 1234), ('ep2', 1234), ('ep3', 1234)],
args.endpoints)
mock_parse_hub.assert_has_calls([
mock.call('ep1'),
mock.call('ep2'),
mock.call('ep3'),
])
mock_daemonize.assert_called_once_with(pidfile=None)
@mock.patch('socket.has_ipv6', True)
@mock.patch.object(util, 'parse_hub', side_effect=lambda x: x)
@mock.patch.object(util, 'daemonize')
def test_daemonize_debug(self, mock_daemonize, mock_parse_hub):
args = mock.Mock(
endpoints=[],
daemon=True,
debug=True,
pid_file=None,
)
hub._normalize_args(args)
self.assertEqual([('', util.HEYU_PORT), ('::', util.HEYU_PORT)],
args.endpoints)
self.assertFalse(mock_parse_hub.called)
self.assertFalse(mock_daemonize.called)
@mock.patch('socket.has_ipv6', True)
@mock.patch.object(util, 'parse_hub', side_effect=lambda x: x)
@mock.patch.object(util, 'daemonize')
def test_daemonize_nodaemon(self, mock_daemonize, mock_parse_hub):
args = mock.Mock(
endpoints=[],
daemon=False,
debug=False,
pid_file=None,
)
hub._normalize_args(args)
self.assertEqual([('', util.HEYU_PORT), ('::', util.HEYU_PORT)],
args.endpoints)
self.assertFalse(mock_parse_hub.called)
self.assertFalse(mock_daemonize.called)
@mock.patch('socket.has_ipv6', True)
@mock.patch.object(util, 'parse_hub', side_effect=lambda x: x)
@mock.patch.object(util, 'daemonize')
def test_daemonize_pidfile(self, mock_daemonize, mock_parse_hub):
args = mock.Mock(
endpoints=[],
daemon=True,
debug=False,
pid_file='/path/to/pid',
)
hub._normalize_args(args)
self.assertEqual([('', util.HEYU_PORT), ('::', util.HEYU_PORT)],
args.endpoints)
self.assertFalse(mock_parse_hub.called)
mock_daemonize.assert_called_once_with(pidfile='/path/to/pid')
| 39.470133
| 79
| 0.630055
| 4,106
| 35,681
| 5.206283
| 0.058938
| 0.055995
| 0.061749
| 0.077654
| 0.875848
| 0.86551
| 0.848716
| 0.828601
| 0.818169
| 0.801048
| 0
| 0.007544
| 0.238446
| 35,681
| 903
| 80
| 39.513843
| 0.779156
| 0.016676
| 0
| 0.756291
| 0
| 0
| 0.105329
| 0.025006
| 0
| 0
| 0
| 0
| 0.243709
| 1
| 0.059603
| false
| 0.001325
| 0.006623
| 0
| 0.074172
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
f3686dc51f85d188d91ffe389c807eb16215fdaf
| 474
|
py
|
Python
|
2019-10-23-ex-03.py
|
mpassosbr/python3
|
ff83f1f6f787206e49696134a99d68190606ed4f
|
[
"MIT"
] | null | null | null |
2019-10-23-ex-03.py
|
mpassosbr/python3
|
ff83f1f6f787206e49696134a99d68190606ed4f
|
[
"MIT"
] | null | null | null |
2019-10-23-ex-03.py
|
mpassosbr/python3
|
ff83f1f6f787206e49696134a99d68190606ed4f
|
[
"MIT"
] | null | null | null |
print("Números positivos:")
print("range(5)")
for n in range(5):
print(n)
print("\n")
print("range(2, 6)")
for x in range(2, 6):
print(x)
print("\n")
print("range(1, 10, 2)")
for y in range(1, 10, 2):
print(y)
print("\n")
print("Números negativos:")
print("range(-5)")
for n in range(-5):
print(n)
print("\n")
print("range(-2, 6)")
for x in range(-2, 6):
print(x)
print("\n")
print("range(-1, 10, 2)")
for y in range(-1, 10, 2):
print(y)
print("\n")
| 17.555556
| 27
| 0.565401
| 90
| 474
| 2.977778
| 0.166667
| 0.179104
| 0.287313
| 0.238806
| 0.843284
| 0.843284
| 0.843284
| 0.843284
| 0.843284
| 0.843284
| 0
| 0.071429
| 0.172996
| 474
| 26
| 28
| 18.230769
| 0.612245
| 0
| 0
| 0.461538
| 0
| 0
| 0.251055
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.769231
| 0
| 0
| 0
| null | 0
| 1
| 1
| 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
| 1
|
0
| 9
|
f36c45ffdf76849a0bb39d9d93bc4411e47e3237
| 102
|
py
|
Python
|
python/pycppad/__init__.py
|
proyan/pycppad
|
db5e00be62788a0c8f8395464c4693cd5d6c6716
|
[
"BSD-3-Clause"
] | null | null | null |
python/pycppad/__init__.py
|
proyan/pycppad
|
db5e00be62788a0c8f8395464c4693cd5d6c6716
|
[
"BSD-3-Clause"
] | null | null | null |
python/pycppad/__init__.py
|
proyan/pycppad
|
db5e00be62788a0c8f8395464c4693cd5d6c6716
|
[
"BSD-3-Clause"
] | null | null | null |
#
# Copyright 2021 INRIA
#
from .pycppad import *
#from .pycppad import __version__, __raw_version__
| 14.571429
| 50
| 0.764706
| 12
| 102
| 5.75
| 0.666667
| 0.318841
| 0.492754
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.046512
| 0.156863
| 102
| 6
| 51
| 17
| 0.755814
| 0.676471
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
| 1
| 0
|
0
| 7
|
f3a0dc6e5b2619f4d32be46e589a416f8ae89a4c
| 214
|
py
|
Python
|
2016/05/test_hashing_passwords.py
|
GeoffRiley/AdventOfCode
|
27fe8670a1923cb3b0675784f5e855ad18c29c93
|
[
"Unlicense"
] | 2
|
2020-12-12T03:18:45.000Z
|
2021-12-17T00:35:33.000Z
|
2016/05/test_hashing_passwords.py
|
GeoffRiley/AdventOfCode
|
27fe8670a1923cb3b0675784f5e855ad18c29c93
|
[
"Unlicense"
] | null | null | null |
2016/05/test_hashing_passwords.py
|
GeoffRiley/AdventOfCode
|
27fe8670a1923cb3b0675784f5e855ad18c29c93
|
[
"Unlicense"
] | null | null | null |
from hashing_passwords import find_password, find_password2
def test_hashing_passwords():
assert find_password('abc') == '18f47a30'
def test_find_password2():
assert find_password2('abc') == '05ace8e3'
| 21.4
| 59
| 0.757009
| 26
| 214
| 5.884615
| 0.5
| 0.254902
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07027
| 0.135514
| 214
| 9
| 60
| 23.777778
| 0.756757
| 0
| 0
| 0
| 0
| 0
| 0.102804
| 0
| 0
| 0
| 0
| 0
| 0.4
| 1
| 0.4
| true
| 1
| 0.2
| 0
| 0.6
| 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
| 1
| 1
| 1
| 0
| 0
| 1
| 0
|
0
| 7
|
cad121b6ab043d613c9d6e6b2bc9f9a07ec62bb8
| 449
|
py
|
Python
|
set5/challenge36const.py
|
sparkhom/crypto
|
32180394e977b3bbd316ed33a461c1dccb44a741
|
[
"0BSD"
] | null | null | null |
set5/challenge36const.py
|
sparkhom/crypto
|
32180394e977b3bbd316ed33a461c1dccb44a741
|
[
"0BSD"
] | null | null | null |
set5/challenge36const.py
|
sparkhom/crypto
|
32180394e977b3bbd316ed33a461c1dccb44a741
|
[
"0BSD"
] | null | null | null |
N = 0xffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff
g = 2
k = 3
I = b'test@gmail.com'
P = b'YELLOW SUBMARINE'
| 74.833333
| 390
| 0.939866
| 15
| 449
| 28.133333
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.531178
| 0.035635
| 449
| 5
| 391
| 89.8
| 0.443418
| 0
| 0
| 0
| 0
| 0
| 0.066815
| 0
| 0
| 1
| 0.859688
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
1b0920fa780b1a8ad43a45e5779a99de22a586f8
| 21,695
|
py
|
Python
|
python/models.py
|
jcatw/dcnn
|
5d60c4fed570ed68c4ff7a5b681a9810fe9268c1
|
[
"MIT"
] | 26
|
2017-07-06T00:55:18.000Z
|
2022-01-30T11:48:32.000Z
|
python/models.py
|
jcatw/dcnn
|
5d60c4fed570ed68c4ff7a5b681a9810fe9268c1
|
[
"MIT"
] | 1
|
2019-01-26T17:06:12.000Z
|
2019-01-26T17:06:12.000Z
|
python/models.py
|
jcatw/dcnn
|
5d60c4fed570ed68c4ff7a5b681a9810fe9268c1
|
[
"MIT"
] | 11
|
2017-11-28T16:59:35.000Z
|
2021-08-13T01:33:25.000Z
|
import lasagne
import numpy as np
import theano
import theano.tensor as T
from sklearn import metrics
import layers
import params
import util
class NodeClassificationDCNN(object):
"""A DCNN model for node classification.
This is a shallow model.
(K, X) -> DCNN -> Dense -> Out
"""
def __init__(self, parameters, A):
self.params = parameters
self.var_K = T.tensor3('Apow')
self.var_X = T.matrix('X')
self.var_Y = T.imatrix('Y')
self.l_in_k = lasagne.layers.InputLayer((None, self.params.num_hops + 1, self.params.num_nodes), input_var=self.var_K)
self.l_in_x = lasagne.layers.InputLayer((self.params.num_nodes, self.params.num_features), input_var=self.var_X)
self._compute_diffusion_kernel(A)
# Overridable to customize init behavior.
self._register_model_layers()
loss_fn = params.loss_map[self.params.loss_fn]
update_fn = params.update_map[self.params.update_fn]
prediction = lasagne.layers.get_output(self.l_out)
self._loss = lasagne.objectives.aggregate(loss_fn(prediction, self.var_Y), mode='mean')
model_parameters = lasagne.layers.get_all_params(self.l_out)
self._updates = update_fn(self._loss, model_parameters, learning_rate=self.params.learning_rate)
if self.params.momentum:
self._updates = lasagne.updates.apply_momentum(self._updates, model_parameters)
self.apply_loss_and_update = theano.function([self.var_K, self.var_X, self.var_Y], self._loss, updates=self._updates)
self.apply_loss = theano.function([self.var_K, self.var_X, self.var_Y], self._loss)
def _compute_diffusion_kernel(self, A):
self.K = util.A_to_diffusion_kernel(A, self.params.num_hops)
def _register_model_layers(self):
self.l_dcnn = layers.DCNNLayer(
[self.l_in_k, self.l_in_x],
self.params,
1,
)
self.l_out = lasagne.layers.DenseLayer(
self.l_dcnn,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity],
)
def train_step(self, X, Y, batch_indices):
return self.apply_loss_and_update(
self.K[batch_indices, :, :], X, Y[batch_indices, :]
)
def validation_step(self, X, Y, valid_indices):
return self.apply_loss(
self.K[valid_indices, :, :], X, Y[valid_indices, :]
)
def fit(self, X, Y, train_indices, valid_indices):
num_nodes = X.shape[0]
print 'Training model...'
validation_losses = []
validation_loss_window = np.zeros(self.params.stop_window_size)
validation_loss_window[:] = float('+inf')
for epoch in range(self.params.num_epochs):
train_loss = 0.0
np.random.shuffle(train_indices)
num_batch = num_nodes // self.params.batch_size
for batch in range(num_batch):
start = batch * self.params.batch_size
end = min((batch + 1) * self.params.batch_size, train_indices.shape[0])
if start < end:
train_loss += self.train_step(X, Y, train_indices[start:end])
train_loss /= num_batch
valid_loss = self.validation_step(X, Y, valid_indices)
print "Epoch %d mean training error: %.6f" % (epoch, train_loss)
print "Epoch %d validation error: %.6f" % (epoch, valid_loss)
if self.params.print_train_accuracy:
predictions = self.predict(X, train_indices)
actuals = Y[train_indices, :].argmax(1)
print "Epoch %d training accuracy: %.4f" % (epoch, metrics.accuracy_score(predictions, actuals))
if self.params.print_valid_accuracy:
predictions = self.predict(X, valid_indices)
actuals = Y[valid_indices, :].argmax(1)
print "Epoch %d validation accuracy: %.4f" % (epoch, metrics.accuracy_score(predictions, actuals), )
validation_losses.append(valid_loss)
if self.params.stop_early:
if valid_loss >= validation_loss_window.mean():
print 'Validation loss did not decrease. Stopping early.'
break
validation_loss_window[epoch % self.params.stop_window_size] = valid_loss
def predict(self, X, prediction_indices):
pred = lasagne.layers.get_output(self.l_out)
# Create a function that applies the model to data to predict a class
pred_fn = theano.function([self.var_K, self.var_X], T.argmax(pred, axis=1))
# Return the predictions
predictions = pred_fn(self.K[prediction_indices, :, :], X)
return predictions
class TrueSparseNodeClassificationDCNN(NodeClassificationDCNN):
"""A DCNN model for node classification with truly sparse pre-thresholding.
This is a shallow model.
(K, X) -> DCNN -> Dense -> Out
"""
def _compute_diffusion_kernel(self, A):
self.K = util.sparse_A_to_diffusion_kernel(
A,
self.params.num_hops
)
def _register_model_layers(self):
input = self.l_in_k + [self.l_in_x]
self.l_dcnn = layers.SparseDCNNLayer(
input,
self.params,
1,
)
self.l_out = lasagne.layers.DenseLayer(
self.l_dcnn,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity],
)
def __init__(self, parameters, A):
self.params = parameters
self.var_K = []
for i in range(self.params.num_hops + 1):
self.var_K.append(T.matrix('K_%d' % i))
self.var_X = T.matrix('X')
self.var_Y = T.imatrix('Y')
self.l_in_k = [lasagne.layers.InputLayer((None, self.params.num_nodes), input_var=vK) for vK in self.var_K]
self.l_in_x = lasagne.layers.InputLayer((self.params.num_nodes, self.params.num_features), input_var=self.var_X)
self._compute_diffusion_kernel(A)
# Overridable to customize init behavior.
self._register_model_layers()
loss_fn = params.loss_map[self.params.loss_fn]
update_fn = params.update_map[self.params.update_fn]
prediction = lasagne.layers.get_output(self.l_out)
self._loss = lasagne.objectives.aggregate(loss_fn(prediction, self.var_Y), mode='mean')
model_parameters = lasagne.layers.get_all_params(self.l_out)
self._updates = update_fn(self._loss, model_parameters, learning_rate=self.params.learning_rate)
if self.params.momentum:
self._updates = lasagne.updates.apply_momentum(self._updates, model_parameters)
self.apply_loss_and_update = theano.function(self.var_K + [self.var_X, self.var_Y], self._loss, updates=self._updates)
self.apply_loss = theano.function(self.var_K + [self.var_X, self.var_Y], self._loss)
def train_step(self, X, Y, batch_indices):
#inputs = [k[batch_indices, :] for k in self.K] + [X, Y[batch_indices, :]]
inputs = self.K + [X, Y[batch_indices, :]]
return self.apply_loss_and_update(
*inputs
)
def validation_step(self, X, Y, valid_indices):
return self.apply_loss(
self.K[valid_indices, :, :], X, Y[valid_indices, :]
)
class PostSparseNodeClassificationDCNN(NodeClassificationDCNN):
def _compute_diffusion_kernel(self, A):
self.K = util.A_to_post_sparse_diffusion_kernel(
A,
self.params.num_hops,
self.params.diffusion_threshold
)
class PreSparseNodeClassificationDCNN(NodeClassificationDCNN):
def _compute_diffusion_kernel(self, A):
self.K = util.A_to_pre_sparse_diffusion_kernel(
A,
self.params.num_hops,
self.params.diffusion_threshold
)
class DeepNodeClassificationDCNN(NodeClassificationDCNN):
"""A Deep DCNN model for node classification.
This model allows for several DCNN layers.
(K, X) -> DCNN -> DCNN -> ... -> DCNN -> Dense -> Out
"""
def __init__(self, parameters, A):
self.params = parameters
# Prepare indices input.
self.var_K = T.tensor3('Apow')
self.var_X = T.matrix('X')
self.var_I = T.ivector('I')
self.var_Y = T.imatrix('Y')
self.l_in_k = lasagne.layers.InputLayer((None, self.params.num_hops + 1, self.params.num_nodes),
input_var=self.var_K)
self.l_in_x = lasagne.layers.InputLayer((self.params.num_nodes, self.params.num_features), input_var=self.var_X)
self.l_indices = lasagne.layers.InputLayer(
(None,),
input_var=self.var_I
)
self.K = util.A_to_diffusion_kernel(A, self.params.num_hops)
# Overridable to customize init behavior.
self._register_model_layers()
loss_fn = params.loss_map[self.params.loss_fn]
update_fn = params.update_map[self.params.update_fn]
prediction = lasagne.layers.get_output(self.l_out)
self._loss = lasagne.objectives.aggregate(loss_fn(prediction, self.var_Y), mode='mean')
model_parameters = lasagne.layers.get_all_params(self.l_out)
self._updates = update_fn(self._loss, model_parameters, learning_rate=self.params.learning_rate)
if self.params.momentum:
self._updates = lasagne.updates.apply_momentum(self._updates, model_parameters)
self.apply_loss_and_update = theano.function([self.var_K, self.var_X, self.var_I, self.var_Y], self._loss,
updates=self._updates)
self.apply_loss = theano.function([self.var_K, self.var_X, self.var_I, self.var_Y], self._loss)
def _register_model_layers(self):
features_layer = self.l_in_x
num_features = self.params.num_features
for i in range(self.params.num_dcnn_layers):
l_dcnn = layers.DCNNLayer(
[self.l_in_k, features_layer],
self.params,
i + 1,
num_features=num_features,
)
num_features *= (self.params.num_hops + 1)
features_layer = lasagne.layers.ReshapeLayer(
l_dcnn,
(-1, num_features)
)
self.l_slice = layers.ArrayIndexLayer(
[features_layer, self.l_indices]
)
self.l_out = lasagne.layers.DenseLayer(
self.l_slice,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity],
)
def train_step(self, X, Y, batch_indices):
return self.apply_loss_and_update(
self.K, X, batch_indices, Y[batch_indices, :]
)
def validation_step(self, X, Y, valid_indices):
return self.apply_loss(
self.K, X, valid_indices, Y[valid_indices, :]
)
def predict(self, X, prediction_indices):
pred = lasagne.layers.get_output(self.l_out)
# Create a function that applies the model to data to predict a class
pred_fn = theano.function([self.var_K, self.var_X, self.var_I], T.argmax(pred, axis=1))
# Return the predictions
predictions = pred_fn(self.K, X, prediction_indices)
return predictions
class DeepDenseNodeClassificationDCNN(NodeClassificationDCNN):
"""A Deep DCNN model for node classification.
Composed of one DCNN layer for the input followed by several dense layers.
(K, X) -> DCNN -> Dense -> Dense -> ... -> Dense -> Out
"""
def _register_model_layers(self):
self.l_dcnn = layers.DCNNLayer(
[self.l_in_k, self.l_in_x],
self.params,
1,
)
input = self.l_dcnn
for i in range(self.params.num_dense_layers):
l_dense = lasagne.layers.DenseLayer(
input,
num_units=self.params.dense_layer_size,
nonlinearity=params.nonlinearity_map[self.params.dense_nonlinearity],
)
input = l_dense
self.l_out = lasagne.layers.DenseLayer(
input,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity],
)
class GraphClassificationDCNN(object):
"""A DCNN for graph classification.
DCNN Activations are mean-reduced across nodes.
(P, X) -> DCNN -> Dense -> Out
"""
def __init__(self, parameters):
self.params = parameters
self.var_A = T.matrix('A')
self.var_X = T.matrix('X')
self.var_Y = T.imatrix('Y')
self.l_in_a = lasagne.layers.InputLayer((None, None), input_var=self.var_A)
self.l_in_x = lasagne.layers.InputLayer((None, self.params.num_features), input_var=self.var_X)
# Overridable to customize init behavior.
self._register_model_layers()
loss_fn = params.loss_map[self.params.loss_fn]
update_fn = params.update_map[self.params.update_fn]
prediction = lasagne.layers.get_output(self.l_out)
loss = lasagne.objectives.aggregate(loss_fn(prediction, self.var_Y), mode='mean')
model_parameters = lasagne.layers.get_all_params(self.l_out)
self._updates = update_fn(loss, model_parameters, learning_rate=self.params.learning_rate)
if self.params.momentum:
self._updates = lasagne.updates.apply_momentum(self._updates, model_parameters)
self.apply_loss_and_update = theano.function([self.var_A, self.var_X, self.var_Y], loss, updates=self._updates)
self.apply_loss = theano.function([self.var_A, self.var_X, self.var_Y], loss)
pred = lasagne.layers.get_output(self.l_out)
self.pred_fn = theano.function([self.var_A, self.var_X], T.argmax(pred, axis=1))
def _register_model_layers(self):
self.l_dcnn = layers.AggregatedDCNNLayer(
[self.l_in_a, self.l_in_x],
self.params,
1,
)
self.l_out = lasagne.layers.DenseLayer(
self.l_dcnn,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity],
)
def train_step(self, a, x, y):
return self.apply_loss_and_update(
a, x, y
)
def validation_step(self, a, x, y):
return self.apply_loss(
a, x, y
)
def fit(self, A, X, Y, train_indices, valid_indices):
print 'Training model...'
validation_losses = []
validation_loss_window = np.zeros(self.params.stop_window_size)
validation_loss_window[:] = float('+inf')
for epoch in range(self.params.num_epochs):
np.random.shuffle(train_indices)
train_loss = 0.0
for index in train_indices:
train_loss += self.train_step(A[index], X[index], Y[index])
train_loss /= len(train_indices)
valid_loss = 0.0
for index in valid_indices:
valid_loss = self.validation_step(A[index], X[index], Y[index])
valid_loss /= len(valid_indices)
print "Epoch %d mean training error: %.6f" % (epoch, train_loss)
print "Epoch %d mean validation error: %.6f" % (epoch, valid_loss)
if np.isnan(train_loss) or np.isnan(valid_loss):
raise ValueError
train_acc = 0.0
if self.params.print_train_accuracy:
for index in train_indices:
pred = self.predict(A[index], X[index])
actual = Y[index].argmax()
if pred == actual:
train_acc += 1.0
train_acc /= len(train_indices)
print "Epoch %d training accuracy: %.4f" % (epoch, train_acc)
valid_acc = 0.0
if self.params.print_valid_accuracy:
for index in valid_indices:
pred = self.predict(A[index], X[index])
actual = Y[index].argmax()
if pred == actual:
valid_acc += 1.0
valid_acc /= len(train_indices)
print "Epoch %d validation accuracy: %.4f" % (epoch, valid_acc)
validation_losses.append(valid_loss)
if self.params.stop_early:
if valid_loss >= validation_loss_window.mean():
print 'Validation loss did not decrease. Stopping early.'
break
validation_loss_window[epoch % self.params.stop_window_size] = valid_loss
def predict(self, a, x):
# Return the predictions
predictions = self.pred_fn(a, x)
return predictions
class GraphClassificationFeatureAggregatedDCNN(GraphClassificationDCNN):
"""A DCNN for graph classification.
DCNN Activations are mean-reduced across both nodes and features.
(P, X) -> DCNN -> Dense -> Out
"""
def _register_model_layers(self):
self.l_dcnn = layers.AggregatedFeaturesDCNNLayer(
[self.l_in_a, self.l_in_x],
self.params,
1,
)
self.l_out = lasagne.layers.DenseLayer(
self.l_dcnn,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity],
)
class DeepGraphClassificationDCNN(GraphClassificationDCNN):
"""A Deep DCNN for graph classification.
DCNN Activations are mean-reduced across nodes. Several DCNN layers.
(P, X) -> DCNN -> DCNN -> ... -> DCNN -> Dense -> Out
"""
def _register_model_layers(self):
features_layer = self.l_in_x
num_features = self.params.num_features
for i in range(self.params.num_dcnn_layers - 1):
l_dcnn = layers.UnaggregatedDCNNLayer(
[self.l_in_a, features_layer],
self.params,
i + 1,
num_features=num_features
)
features_layer = l_dcnn
num_features *= (self.params.num_hops + 1)
l_dcnn = layers.AggregatedDCNNLayer(
[self.l_in_a, features_layer],
self.params,
i + 1,
num_features=num_features,
)
self.l_out = lasagne.layers.DenseLayer(
l_dcnn,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity],
)
class DeepGraphClassificationDCNNWithReduction(DeepGraphClassificationDCNN):
"""A Deep DCNN for graph classification with a trivial reduction layer.
DCNN Activations are mean-reduced across nodes. Several DCNN layers.
(P, X) -> DCNN -> Reduction -> DCNN -> ... -> DCNN -> Dense -> Out
"""
def _register_model_layers(self):
graph_layer = self.l_in_a
features_layer = self.l_in_x
num_features = self.params.num_features
for i in range(self.params.num_dcnn_layers - 1):
l_dcnn = layers.UnaggregatedDCNNLayer(
[graph_layer, features_layer],
self.params,
i,
num_features=num_features
)
features_layer = l_dcnn
num_features *= (self.params.num_hops + 1)
graph_layer = layers.GraphReductionLayer(
[graph_layer, features_layer],
self.params,
)
l_dcnn = layers.AggregatedDCNNLayer(
[graph_layer, features_layer],
self.params,
i,
num_features=num_features,
)
self.l_out = lasagne.layers.DenseLayer(
l_dcnn,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity]
)
class DeepGraphClassificationDCNNWithKronReduction(DeepGraphClassificationDCNN):
"""A Deep DCNN for graph classification with a learnable reduction layer.
DCNN Activations are mean-reduced across nodes. Several DCNN layers.
(P, X) -> DCNN -> Reduction -> DCNN -> ... -> DCNN -> Dense -> Out
"""
def _register_model_layers(self):
graph_layer = self.l_in_a
features_layer = self.l_in_x
num_features = self.params.num_features
for i in range(self.params.num_dcnn_layers - 1):
l_dcnn = layers.UnaggregatedDCNNLayer(
[graph_layer, features_layer],
self.params,
i,
num_features=num_features
)
features_layer = l_dcnn
num_features *= (self.params.num_hops + 1)
eigenvec_layer = layers.SmallestEigenvecLayer(
[graph_layer],
self.params
)
graph_layer = layers.KronReductionLayerA(
[graph_layer, eigenvec_layer],
self.params,
)
features_layer = layers.KronReductionLayerX(
[graph_layer, features_layer, eigenvec_layer],
self.params,
)
l_dcnn = layers.AggregatedDCNNLayer(
[graph_layer, features_layer],
self.params,
i,
num_features=num_features,
)
self.l_out = lasagne.layers.DenseLayer(
l_dcnn,
num_units=self.params.num_classes,
nonlinearity=params.nonlinearity_map[self.params.out_nonlinearity]
)
| 34.823435
| 126
| 0.613552
| 2,638
| 21,695
| 4.789613
| 0.07392
| 0.082311
| 0.043213
| 0.008231
| 0.842184
| 0.813217
| 0.781559
| 0.748239
| 0.704234
| 0.678275
| 0
| 0.003298
| 0.287209
| 21,695
| 622
| 127
| 34.879421
| 0.813761
| 0.021203
| 0
| 0.611905
| 0
| 0
| 0.022631
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.019048
| null | null | 0.038095
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
1b6b74b51894760cbb53cca6d0ace0490141530d
| 844
|
py
|
Python
|
programming-for-everybody/Week6-Assignment4-6.py
|
MauMendes/python-for-everybody
|
5dad649bec88c09c087f13fa3f4da8026bb8ab8d
|
[
"MIT"
] | null | null | null |
programming-for-everybody/Week6-Assignment4-6.py
|
MauMendes/python-for-everybody
|
5dad649bec88c09c087f13fa3f4da8026bb8ab8d
|
[
"MIT"
] | null | null | null |
programming-for-everybody/Week6-Assignment4-6.py
|
MauMendes/python-for-everybody
|
5dad649bec88c09c087f13fa3f4da8026bb8ab8d
|
[
"MIT"
] | null | null | null |
<<<<<<< HEAD
<<<<<<< HEAD
def computepay(h,r):
if h<=40:
pay = h*r
else:
pay = 40*r + (h-40)*r*1.5
return pay
hrs = input("Enter Hours:")
h = float(hrs)
rate = input("Enter Rate Per Hour:")
r = float(rate)
p = computepay(h,r)
=======
def computepay(h,r):
if h<=40:
pay = h*r
else:
pay = 40*r + (h-40)*r*1.5
return pay
hrs = input("Enter Hours:")
h = float(hrs)
rate = input("Enter Rate Per Hour:")
r = float(rate)
p = computepay(h,r)
>>>>>>> 23016d10d2185085345ada24602b1839dcc2efb5
=======
def computepay(h,r):
if h<=40:
pay = h*r
else:
pay = 40*r + (h-40)*r*1.5
return pay
hrs = input("Enter Hours:")
h = float(hrs)
rate = input("Enter Rate Per Hour:")
r = float(rate)
p = computepay(h,r)
>>>>>>> 21776b9fadd437428c9fbf1b550d7669b8d9631d
print("Pay",p)
| 18.347826
| 48
| 0.559242
| 130
| 844
| 3.630769
| 0.184615
| 0.038136
| 0.152542
| 0.095339
| 0.794492
| 0.794492
| 0.794492
| 0.794492
| 0.794492
| 0.794492
| 0
| 0.121495
| 0.239336
| 844
| 46
| 49
| 18.347826
| 0.613707
| 0
| 0
| 0.925
| 0
| 0
| 0.11716
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.025
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
1b84399006f35aedb2677c8cd6d98e2484815da0
| 10,028
|
py
|
Python
|
src/wizluk/policies/_cost_to_go_policies.py
|
miquelramirez/width-lookaheads-python
|
122442136d8254be44f9dbcae365327e0f669bfa
|
[
"MIT"
] | 1
|
2019-09-10T20:36:48.000Z
|
2019-09-10T20:36:48.000Z
|
src/wizluk/policies/_cost_to_go_policies.py
|
miquelramirez/width-lookaheads-python
|
122442136d8254be44f9dbcae365327e0f669bfa
|
[
"MIT"
] | null | null | null |
src/wizluk/policies/_cost_to_go_policies.py
|
miquelramirez/width-lookaheads-python
|
122442136d8254be44f9dbcae365327e0f669bfa
|
[
"MIT"
] | 1
|
2019-09-10T20:36:52.000Z
|
2019-09-10T20:36:52.000Z
|
from wizluk.memory.and_or_graph import OR_Node
import copy
import time
def random_rollout(lookahead, env, n : OR_Node) :
sum_reward = 0
#check if node to rollout is terminal or beyond the horizon
terminal = n.terminal
if terminal or n.d > lookahead._horizon :
return 0
if lookahead._atari == "True":
envuw = env.unwrapped
env2 = envuw.clone_full_state()
episode_started_at = env._episode_started_at
elapsed_steps = env._elapsed_steps
env._max_episode_seconds = 2**20
rolloutsComplete = lookahead._num_rollouts
for k in range(0,lookahead._num_rollouts):
if lookahead._atari != "True":
env2 = copy.deepcopy(env)
num_samples = 0
r = 0
state = n.state
lookahead.num_random_rollouts += 1
while True:
# Check for remaining budget
if lookahead.sim_calls - lookahead.init_sim_calls >= lookahead.sim_budget:
rolloutsComplete = k + 1
break
if lookahead._atari == "True":
a =lookahead.base_policy.get_action(env, state)
t0 = time.perf_counter()
state, reward, terminal, _ = env.step(a)
tf = time.perf_counter()
if hasattr(lookahead, 'rollout_runtime_sim'):
lookahead.rollout_runtime_sim += tf - t0
else :
a =lookahead.base_policy.get_action(env2, state)
t0 = time.perf_counter()
state, reward, terminal, _ = env2.step(a)
tf = time.perf_counter()
if hasattr(lookahead, 'rollout_runtime_sim'):
lookahead.rollout_runtime_sim += tf - t0
lookahead.sim_calls += 1
r += reward * lookahead._gamma ** num_samples
num_samples += 1
#checking stopping conditions
if terminal :
continue_rollout = False
lookahead.random_rollouts_reached_terminal_state += 1
break
elif num_samples + n.d > lookahead._horizon :
continue_rollout = False
lookahead.random_rollouts_reached_horizon += 1
break
elif lookahead._gamma ** num_samples < lookahead._epsilon :
continue_rollout = False
lookahead.random_rollouts_reached_discount_value_smaller_than_epsilon += 1
break
sum_reward += r
if lookahead._atari == "True":
envuw.restore_full_state(env2)
env._episode_started_at = episode_started_at
env._elapsed_steps = elapsed_steps
return sum_reward / rolloutsComplete
# Knuth's algorithm for estimating the cost of a tree.
def knuth_alg(lookahead, env, n : OR_Node) :
# Check if node to rollout is terminal or beyond the horizon.
terminal = n.terminal
if terminal or n.d > lookahead._horizon :
return 0
if lookahead._atari == "True":
envuw = env.unwrapped
env2 = envuw.clone_full_state()
episode_started_at = env._episode_started_at
elapsed_steps = env._elapsed_steps
env._max_episode_seconds = 2**20
sum_reward = 0
rolloutsComplete = lookahead._num_rollouts
for k in range(0, lookahead._num_rollouts):
degree = 1 # Number of possible states at the current search depth.
if lookahead._atari != "True":
env2 = copy.deepcopy(env)
num_samples = 0
r = 0
state = n.state
lookahead.num_random_rollouts += 1
while True:
# Check for remaining budget
if lookahead.sim_calls - lookahead.init_sim_calls >= lookahead.sim_budget:
rolloutsComplete = k + 1
break
if lookahead._atari == "True":
a =lookahead.base_policy.get_action(env, state)
t0 = time.perf_counter()
state, reward, terminal, _ = env.step(a)
tf = time.perf_counter()
if hasattr(lookahead, 'rollout_runtime_sim'):
lookahead.rollout_runtime_sim += tf - t0
else :
a =lookahead.base_policy.get_action(env2, state)
t0 = time.perf_counter()
state, reward, terminal, _ = env2.step(a)
tf = time.perf_counter()
if hasattr(lookahead, 'rollout_runtime_sim'):
lookahead.rollout_runtime_sim += tf - t0
lookahead.sim_calls += 1
degree = env.action_space.n * degree
r += degree*(reward * lookahead._gamma ** num_samples)
num_samples += 1
#checking stopping conditions
if terminal :
continue_rollout = False
lookahead.random_rollouts_reached_terminal_state += 1
break
elif num_samples + n.d > lookahead._horizon :
continue_rollout = False
lookahead.random_rollouts_reached_horizon += 1
break
elif lookahead._gamma ** num_samples < lookahead._epsilon :
continue_rollout = False
lookahead.random_rollouts_reached_discount_value_smaller_than_epsilon += 1
break
sum_reward += r
if lookahead._atari == "True":
envuw.restore_full_state(env2)
env._episode_started_at = episode_started_at
env._elapsed_steps = elapsed_steps
return sum_reward / rolloutsComplete
# Stochastic enumeration algorithm for estimating the cost of a tree. TODO: implement Atari verison as well
def stoch_enum_alg(lookahead, env, n : OR_Node) :
numberOfPathsToConsider = lookahead._number_of_paths_to_consider_for_stoch_enum # often considered as computational budget or 'B'
# Check if node to rollout is terminal or beyond the horizon.
terminal = n.terminal
if terminal or n.d > lookahead._horizon :
return 0
if lookahead._atari == "True":
envuw = env.unwrapped
env2 = envuw.clone_full_state()
episode_started_at = env._episode_started_at
elapsed_steps = env._elapsed_steps
env._max_episode_seconds = 2**20
sum_reward = 0
rolloutsComplete = lookahead._num_rollouts
for k in range(0, lookahead._num_rollouts):
degree = 1 # Number of possible states at the current search depth.
if lookahead._atari != "True":
env2 = copy.deepcopy(env)
depthOfSearch = 0
hyperChildren = [(env2, [], False)]
state = n.state
lookahead.num_random_rollouts += 1
r = 0
num_samples = 0
while True:
# Check for remaining budget
if lookahead.sim_calls - lookahead.init_sim_calls >= lookahead.sim_budget:
rolloutsComplete = k + 1
break
rewardForStep = 0
newHyperChildren = []
while len(newHyperChildren) < numberOfPathsToConsider and len(hyperChildren) * env.action_space.n > len(newHyperChildren):
indxChild = random.choice(range(0, len(hyperChildren)))
child, actionsConsidered, isTerminal = hyperChildren[indxChild]
if isTerminal:
continue
childEnv = copy.deepcopy(child)
if lookahead._atari == "True":
a = lookahead.base_policy.get_action(env, state)
if a in actionsConsidered:
continue # Already considered successor
t0 = time.perf_counter()
state, reward, terminal, _ = env.step(a)
tf = time.perf_counter()
if hasattr(lookahead, 'rollout_runtime_sim'):
lookahead.rollout_runtime_sim += tf - t0
else :
a = lookahead.base_policy.get_action(childEnv, state)
if a in actionsConsidered:
continue # Already considered successor
t0 = time.perf_counter()
state, reward, terminal, _ = childEnv.step(a)
tf = time.perf_counter()
if hasattr(lookahead, 'rollout_runtime_sim'):
lookahead.rollout_runtime_sim += tf - t0
newHyperChildren.append((childEnv,[], terminal))
actionsConsidered.append(a)
rewardForStep += reward
lookahead.sim_calls += 1
num_samples += len(newHyperChildren)
depthOfSearch += 1
degree = env.action_space.n * degree # simplificaiton of (env.action_space.n * len(hyperChildren)) / len(hyperChildren) * degree
r += degree * ((rewardForStep * lookahead._gamma ** depthOfSearch) / len(newHyperChildren))
hyperChildren = newHyperChildren
allAreTerminal = True
for dum1, dum2 ,childTerminal in newHyperChildren:
if not childTerminal:
allAreTerminal = False
break
# Checking stopping conditions.
if terminal :
continue_rollout = False
lookahead.random_rollouts_reached_terminal_state += 1
break
elif depthOfSearch + n.d > lookahead._horizon :
continue_rollout = False
lookahead.random_rollouts_reached_horizon += 1
break
elif lookahead._gamma ** depthOfSearch < lookahead._epsilon :
continue_rollout = False
lookahead.random_rollouts_reached_discount_value_smaller_than_epsilon += 1
break
sum_reward += r
if lookahead._atari == "True":
envuw.restore_full_state(env2)
env._episode_started_at = episode_started_at
env._elapsed_steps = elapsed_steps
return sum_reward / rolloutsComplete
| 43.411255
| 140
| 0.58566
| 1,045
| 10,028
| 5.355024
| 0.136842
| 0.029485
| 0.03431
| 0.042888
| 0.819514
| 0.809685
| 0.801823
| 0.791994
| 0.772337
| 0.772337
| 0
| 0.011872
| 0.344834
| 10,028
| 230
| 141
| 43.6
| 0.839878
| 0.081073
| 0
| 0.839806
| 0
| 0
| 0.017613
| 0
| 0
| 0
| 0
| 0.004348
| 0
| 1
| 0.014563
| false
| 0
| 0.014563
| 0
| 0.058252
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
1b9eb574c0533c2cd14fed5e479bc6337a1d4c88
| 34,386
|
py
|
Python
|
sdks/python/http_client/v1/polyaxon_sdk/api/k8s_config_maps_v1_api.py
|
hackerwins/polyaxon
|
ff56a098283ca872abfbaae6ba8abba479ffa394
|
[
"Apache-2.0"
] | null | null | null |
sdks/python/http_client/v1/polyaxon_sdk/api/k8s_config_maps_v1_api.py
|
hackerwins/polyaxon
|
ff56a098283ca872abfbaae6ba8abba479ffa394
|
[
"Apache-2.0"
] | null | null | null |
sdks/python/http_client/v1/polyaxon_sdk/api/k8s_config_maps_v1_api.py
|
hackerwins/polyaxon
|
ff56a098283ca872abfbaae6ba8abba479ffa394
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
#
# Copyright 2019 Polyaxon, 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.
# coding: utf-8
"""
Polyaxon SDKs and REST API specification.
Polyaxon SDKs and REST API specification. # noqa: E501
OpenAPI spec version: 1.0.0
Contact: contact@polyaxon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from polyaxon_sdk.api_client import ApiClient
class K8sConfigMapsV1Api(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def create_k8s_config_maps(self, owner, body, **kwargs): # noqa: E501
"""List runs # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_k8s_config_maps(owner, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param V1K8sResource body: Artifact store body (required)
:return: V1K8sResource
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.create_k8s_config_maps_with_http_info(
owner, body, **kwargs
) # noqa: E501
else:
(data) = self.create_k8s_config_maps_with_http_info(
owner, body, **kwargs
) # noqa: E501
return data
def create_k8s_config_maps_with_http_info(
self, owner, body, **kwargs
): # noqa: E501
"""List runs # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_k8s_config_maps_with_http_info(owner, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param V1K8sResource body: Artifact store body (required)
:return: V1K8sResource
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["owner", "body"] # noqa: E501
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
all_params.append("_request_timeout")
params = locals()
for key, val in six.iteritems(params["kwargs"]):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method create_k8s_config_maps" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'owner' is set
if "owner" not in params or params["owner"] is None:
raise ValueError(
"Missing the required parameter `owner` when calling `create_k8s_config_maps`"
) # noqa: E501
# verify the required parameter 'body' is set
if "body" not in params or params["body"] is None:
raise ValueError(
"Missing the required parameter `body` when calling `create_k8s_config_maps`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "owner" in params:
path_params["owner"] = params["owner"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "body" in params:
body_params = params["body"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
) # noqa: E501
# HTTP header `Content-Type`
header_params[
"Content-Type"
] = self.api_client.select_header_content_type( # noqa: E501
["application/json"]
) # noqa: E501
# Authentication setting
auth_settings = ["ApiKey"] # noqa: E501
return self.api_client.call_api(
"/api/v1/{owner}/k8s_config_maps",
"POST",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="V1K8sResource", # noqa: E501
auth_settings=auth_settings,
async_req=params.get("async_req"),
_return_http_data_only=params.get("_return_http_data_only"),
_preload_content=params.get("_preload_content", True),
_request_timeout=params.get("_request_timeout"),
collection_formats=collection_formats,
)
def delete_k8s_config_map(self, owner, uuid, **kwargs): # noqa: E501
"""Patch run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_k8s_config_map(owner, uuid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param str uuid: Unique integer identifier of the entity (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.delete_k8s_config_map_with_http_info(
owner, uuid, **kwargs
) # noqa: E501
else:
(data) = self.delete_k8s_config_map_with_http_info(
owner, uuid, **kwargs
) # noqa: E501
return data
def delete_k8s_config_map_with_http_info(self, owner, uuid, **kwargs): # noqa: E501
"""Patch run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_k8s_config_map_with_http_info(owner, uuid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param str uuid: Unique integer identifier of the entity (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["owner", "uuid"] # noqa: E501
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
all_params.append("_request_timeout")
params = locals()
for key, val in six.iteritems(params["kwargs"]):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_k8s_config_map" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'owner' is set
if "owner" not in params or params["owner"] is None:
raise ValueError(
"Missing the required parameter `owner` when calling `delete_k8s_config_map`"
) # noqa: E501
# verify the required parameter 'uuid' is set
if "uuid" not in params or params["uuid"] is None:
raise ValueError(
"Missing the required parameter `uuid` when calling `delete_k8s_config_map`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "owner" in params:
path_params["owner"] = params["owner"] # noqa: E501
if "uuid" in params:
path_params["uuid"] = params["uuid"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
) # noqa: E501
# HTTP header `Content-Type`
header_params[
"Content-Type"
] = self.api_client.select_header_content_type( # noqa: E501
["application/json"]
) # noqa: E501
# Authentication setting
auth_settings = ["ApiKey"] # noqa: E501
return self.api_client.call_api(
"/api/v1/{owner}/k8s_config_maps/{uuid}",
"DELETE",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async_req=params.get("async_req"),
_return_http_data_only=params.get("_return_http_data_only"),
_preload_content=params.get("_preload_content", True),
_request_timeout=params.get("_request_timeout"),
collection_formats=collection_formats,
)
def get_k8s_config_map(self, owner, uuid, **kwargs): # noqa: E501
"""Create new run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_k8s_config_map(owner, uuid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param str uuid: Unique integer identifier of the entity (required)
:return: V1K8sResource
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.get_k8s_config_map_with_http_info(
owner, uuid, **kwargs
) # noqa: E501
else:
(data) = self.get_k8s_config_map_with_http_info(
owner, uuid, **kwargs
) # noqa: E501
return data
def get_k8s_config_map_with_http_info(self, owner, uuid, **kwargs): # noqa: E501
"""Create new run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_k8s_config_map_with_http_info(owner, uuid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param str uuid: Unique integer identifier of the entity (required)
:return: V1K8sResource
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["owner", "uuid"] # noqa: E501
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
all_params.append("_request_timeout")
params = locals()
for key, val in six.iteritems(params["kwargs"]):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_k8s_config_map" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'owner' is set
if "owner" not in params or params["owner"] is None:
raise ValueError(
"Missing the required parameter `owner` when calling `get_k8s_config_map`"
) # noqa: E501
# verify the required parameter 'uuid' is set
if "uuid" not in params or params["uuid"] is None:
raise ValueError(
"Missing the required parameter `uuid` when calling `get_k8s_config_map`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "owner" in params:
path_params["owner"] = params["owner"] # noqa: E501
if "uuid" in params:
path_params["uuid"] = params["uuid"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
) # noqa: E501
# HTTP header `Content-Type`
header_params[
"Content-Type"
] = self.api_client.select_header_content_type( # noqa: E501
["application/json"]
) # noqa: E501
# Authentication setting
auth_settings = ["ApiKey"] # noqa: E501
return self.api_client.call_api(
"/api/v1/{owner}/k8s_config_maps/{uuid}",
"GET",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="V1K8sResource", # noqa: E501
auth_settings=auth_settings,
async_req=params.get("async_req"),
_return_http_data_only=params.get("_return_http_data_only"),
_preload_content=params.get("_preload_content", True),
_request_timeout=params.get("_request_timeout"),
collection_formats=collection_formats,
)
def list_k8s_config_map_names(self, owner, **kwargs): # noqa: E501
"""List bookmarked runs for user # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_k8s_config_map_names(owner, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param int offset: Pagination offset.
:param int limit: Limit size.
:param str sort: Sort to order the search.
:param str query: Query filter the search search.
:return: V1ListK8sResourcesResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.list_k8s_config_map_names_with_http_info(
owner, **kwargs
) # noqa: E501
else:
(data) = self.list_k8s_config_map_names_with_http_info(
owner, **kwargs
) # noqa: E501
return data
def list_k8s_config_map_names_with_http_info(self, owner, **kwargs): # noqa: E501
"""List bookmarked runs for user # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_k8s_config_map_names_with_http_info(owner, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param int offset: Pagination offset.
:param int limit: Limit size.
:param str sort: Sort to order the search.
:param str query: Query filter the search search.
:return: V1ListK8sResourcesResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["owner", "offset", "limit", "sort", "query"] # noqa: E501
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
all_params.append("_request_timeout")
params = locals()
for key, val in six.iteritems(params["kwargs"]):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method list_k8s_config_map_names" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'owner' is set
if "owner" not in params or params["owner"] is None:
raise ValueError(
"Missing the required parameter `owner` when calling `list_k8s_config_map_names`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "owner" in params:
path_params["owner"] = params["owner"] # noqa: E501
query_params = []
if "offset" in params:
query_params.append(("offset", params["offset"])) # noqa: E501
if "limit" in params:
query_params.append(("limit", params["limit"])) # noqa: E501
if "sort" in params:
query_params.append(("sort", params["sort"])) # noqa: E501
if "query" in params:
query_params.append(("query", params["query"])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
) # noqa: E501
# HTTP header `Content-Type`
header_params[
"Content-Type"
] = self.api_client.select_header_content_type( # noqa: E501
["application/json"]
) # noqa: E501
# Authentication setting
auth_settings = ["ApiKey"] # noqa: E501
return self.api_client.call_api(
"/api/v1/{owner}/k8s_config_maps/names",
"GET",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="V1ListK8sResourcesResponse", # noqa: E501
auth_settings=auth_settings,
async_req=params.get("async_req"),
_return_http_data_only=params.get("_return_http_data_only"),
_preload_content=params.get("_preload_content", True),
_request_timeout=params.get("_request_timeout"),
collection_formats=collection_formats,
)
def list_k8s_config_maps(self, owner, **kwargs): # noqa: E501
"""List archived runs for user # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_k8s_config_maps(owner, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param int offset: Pagination offset.
:param int limit: Limit size.
:param str sort: Sort to order the search.
:param str query: Query filter the search search.
:return: V1ListK8sResourcesResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.list_k8s_config_maps_with_http_info(
owner, **kwargs
) # noqa: E501
else:
(data) = self.list_k8s_config_maps_with_http_info(
owner, **kwargs
) # noqa: E501
return data
def list_k8s_config_maps_with_http_info(self, owner, **kwargs): # noqa: E501
"""List archived runs for user # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_k8s_config_maps_with_http_info(owner, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param int offset: Pagination offset.
:param int limit: Limit size.
:param str sort: Sort to order the search.
:param str query: Query filter the search search.
:return: V1ListK8sResourcesResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["owner", "offset", "limit", "sort", "query"] # noqa: E501
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
all_params.append("_request_timeout")
params = locals()
for key, val in six.iteritems(params["kwargs"]):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method list_k8s_config_maps" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'owner' is set
if "owner" not in params or params["owner"] is None:
raise ValueError(
"Missing the required parameter `owner` when calling `list_k8s_config_maps`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "owner" in params:
path_params["owner"] = params["owner"] # noqa: E501
query_params = []
if "offset" in params:
query_params.append(("offset", params["offset"])) # noqa: E501
if "limit" in params:
query_params.append(("limit", params["limit"])) # noqa: E501
if "sort" in params:
query_params.append(("sort", params["sort"])) # noqa: E501
if "query" in params:
query_params.append(("query", params["query"])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
) # noqa: E501
# HTTP header `Content-Type`
header_params[
"Content-Type"
] = self.api_client.select_header_content_type( # noqa: E501
["application/json"]
) # noqa: E501
# Authentication setting
auth_settings = ["ApiKey"] # noqa: E501
return self.api_client.call_api(
"/api/v1/{owner}/k8s_config_maps",
"GET",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="V1ListK8sResourcesResponse", # noqa: E501
auth_settings=auth_settings,
async_req=params.get("async_req"),
_return_http_data_only=params.get("_return_http_data_only"),
_preload_content=params.get("_preload_content", True),
_request_timeout=params.get("_request_timeout"),
collection_formats=collection_formats,
)
def patch_k8s_config_map(
self, owner, k8s_resource_uuid, body, **kwargs
): # noqa: E501
"""Update run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_k8s_config_map(owner, k8s_resource_uuid, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param str k8s_resource_uuid: UUID (required)
:param V1K8sResource body: Artifact store body (required)
:return: V1K8sResource
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.patch_k8s_config_map_with_http_info(
owner, k8s_resource_uuid, body, **kwargs
) # noqa: E501
else:
(data) = self.patch_k8s_config_map_with_http_info(
owner, k8s_resource_uuid, body, **kwargs
) # noqa: E501
return data
def patch_k8s_config_map_with_http_info(
self, owner, k8s_resource_uuid, body, **kwargs
): # noqa: E501
"""Update run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_k8s_config_map_with_http_info(owner, k8s_resource_uuid, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param str k8s_resource_uuid: UUID (required)
:param V1K8sResource body: Artifact store body (required)
:return: V1K8sResource
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["owner", "k8s_resource_uuid", "body"] # noqa: E501
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
all_params.append("_request_timeout")
params = locals()
for key, val in six.iteritems(params["kwargs"]):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method patch_k8s_config_map" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'owner' is set
if "owner" not in params or params["owner"] is None:
raise ValueError(
"Missing the required parameter `owner` when calling `patch_k8s_config_map`"
) # noqa: E501
# verify the required parameter 'k8s_resource_uuid' is set
if "k8s_resource_uuid" not in params or params["k8s_resource_uuid"] is None:
raise ValueError(
"Missing the required parameter `k8s_resource_uuid` when calling `patch_k8s_config_map`"
) # noqa: E501
# verify the required parameter 'body' is set
if "body" not in params or params["body"] is None:
raise ValueError(
"Missing the required parameter `body` when calling `patch_k8s_config_map`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "owner" in params:
path_params["owner"] = params["owner"] # noqa: E501
if "k8s_resource_uuid" in params:
path_params["k8s_resource.uuid"] = params["k8s_resource_uuid"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "body" in params:
body_params = params["body"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
) # noqa: E501
# HTTP header `Content-Type`
header_params[
"Content-Type"
] = self.api_client.select_header_content_type( # noqa: E501
["application/json"]
) # noqa: E501
# Authentication setting
auth_settings = ["ApiKey"] # noqa: E501
return self.api_client.call_api(
"/api/v1/{owner}/k8s_config_maps/{k8s_resource.uuid}",
"PATCH",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="V1K8sResource", # noqa: E501
auth_settings=auth_settings,
async_req=params.get("async_req"),
_return_http_data_only=params.get("_return_http_data_only"),
_preload_content=params.get("_preload_content", True),
_request_timeout=params.get("_request_timeout"),
collection_formats=collection_formats,
)
def update_k8s_config_map(
self, owner, k8s_resource_uuid, body, **kwargs
): # noqa: E501
"""Get run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_k8s_config_map(owner, k8s_resource_uuid, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param str k8s_resource_uuid: UUID (required)
:param V1K8sResource body: Artifact store body (required)
:return: V1K8sResource
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.update_k8s_config_map_with_http_info(
owner, k8s_resource_uuid, body, **kwargs
) # noqa: E501
else:
(data) = self.update_k8s_config_map_with_http_info(
owner, k8s_resource_uuid, body, **kwargs
) # noqa: E501
return data
def update_k8s_config_map_with_http_info(
self, owner, k8s_resource_uuid, body, **kwargs
): # noqa: E501
"""Get run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_k8s_config_map_with_http_info(owner, k8s_resource_uuid, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: Owner of the namespace (required)
:param str k8s_resource_uuid: UUID (required)
:param V1K8sResource body: Artifact store body (required)
:return: V1K8sResource
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["owner", "k8s_resource_uuid", "body"] # noqa: E501
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
all_params.append("_request_timeout")
params = locals()
for key, val in six.iteritems(params["kwargs"]):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_k8s_config_map" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'owner' is set
if "owner" not in params or params["owner"] is None:
raise ValueError(
"Missing the required parameter `owner` when calling `update_k8s_config_map`"
) # noqa: E501
# verify the required parameter 'k8s_resource_uuid' is set
if "k8s_resource_uuid" not in params or params["k8s_resource_uuid"] is None:
raise ValueError(
"Missing the required parameter `k8s_resource_uuid` when calling `update_k8s_config_map`"
) # noqa: E501
# verify the required parameter 'body' is set
if "body" not in params or params["body"] is None:
raise ValueError(
"Missing the required parameter `body` when calling `update_k8s_config_map`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "owner" in params:
path_params["owner"] = params["owner"] # noqa: E501
if "k8s_resource_uuid" in params:
path_params["k8s_resource.uuid"] = params["k8s_resource_uuid"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "body" in params:
body_params = params["body"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
) # noqa: E501
# HTTP header `Content-Type`
header_params[
"Content-Type"
] = self.api_client.select_header_content_type( # noqa: E501
["application/json"]
) # noqa: E501
# Authentication setting
auth_settings = ["ApiKey"] # noqa: E501
return self.api_client.call_api(
"/api/v1/{owner}/k8s_config_maps/{k8s_resource.uuid}",
"PUT",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="V1K8sResource", # noqa: E501
auth_settings=auth_settings,
async_req=params.get("async_req"),
_return_http_data_only=params.get("_return_http_data_only"),
_preload_content=params.get("_preload_content", True),
_request_timeout=params.get("_request_timeout"),
collection_formats=collection_formats,
)
| 37.703947
| 109
| 0.593992
| 3,938
| 34,386
| 4.948959
| 0.058405
| 0.048438
| 0.028324
| 0.025861
| 0.953204
| 0.950023
| 0.946021
| 0.93971
| 0.93504
| 0.931962
| 0
| 0.022627
| 0.316233
| 34,386
| 911
| 110
| 37.745335
| 0.806269
| 0.319083
| 0
| 0.770677
| 0
| 0
| 0.194175
| 0.053195
| 0
| 0
| 0
| 0
| 0
| 1
| 0.028195
| false
| 0
| 0.007519
| 0
| 0.077068
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
944348fd8e0ff76f05e349651e681d6e891e90e2
| 191
|
py
|
Python
|
selenium_pages/__init__.py
|
zagaran/selenium-pages
|
0ebbae0df034f3e5eb4c945ffd54b2add42a9d50
|
[
"MIT"
] | 2
|
2019-08-15T23:41:35.000Z
|
2020-09-24T07:16:26.000Z
|
selenium_pages/__init__.py
|
zagaran/selenium-pages
|
0ebbae0df034f3e5eb4c945ffd54b2add42a9d50
|
[
"MIT"
] | 9
|
2019-10-14T13:49:00.000Z
|
2022-03-10T10:32:22.000Z
|
selenium_pages/__init__.py
|
zagaran/selenium-pages
|
0ebbae0df034f3e5eb4c945ffd54b2add42a9d50
|
[
"MIT"
] | null | null | null |
from selenium_pages.page import Page, Locator
from selenium_pages.condition import Condition
from selenium_pages.page_manager import PageManager
from selenium_pages.page_test import PageTest
| 38.2
| 51
| 0.884817
| 27
| 191
| 6.037037
| 0.407407
| 0.294479
| 0.417178
| 0.386503
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089005
| 191
| 4
| 52
| 47.75
| 0.936782
| 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
| 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
| 8
|
9453b6714d8144b08c1dfa7abd1165f0bb18f8e8
| 20,531
|
py
|
Python
|
test_fena/v1_12/test_scoreboards.py
|
Aquafina-water-bottle/Fena
|
00a2b1dbc6f8abd968c46c637d6ad30d5fcde919
|
[
"MIT"
] | 2
|
2017-07-04T02:27:11.000Z
|
2017-07-08T10:39:54.000Z
|
test_fena/v1_12/test_scoreboards.py
|
Aquafina-water-bottle/Fena
|
00a2b1dbc6f8abd968c46c637d6ad30d5fcde919
|
[
"MIT"
] | 6
|
2018-07-07T11:58:15.000Z
|
2018-07-07T13:01:49.000Z
|
test_fena/v1_12/test_scoreboards.py
|
Aquafina-water-bottle/Fena
|
00a2b1dbc6f8abd968c46c637d6ad30d5fcde919
|
[
"MIT"
] | 1
|
2017-07-24T23:52:43.000Z
|
2017-07-24T23:52:43.000Z
|
from test_fena.test_common import test_cmd
def test_scoreboards():
test_cmd("@s _ti = players _ti2", "scoreboard players operation @s fena.ti = players fena.ti2")
test_cmd("@s _ti = @r _ti2", "scoreboard players operation @s fena.ti = @r fena.ti2")
test_cmd("@s _ti = @r", "scoreboard players operation @s fena.ti = @r fena.ti")
test_cmd("@s _ti = 3", "scoreboard players set @s fena.ti 3")
test_cmd(r"@s _ti = 3 {Nbt:1b}", r"scoreboard players set @s fena.ti 3 {Nbt:1b}")
test_cmd("target _ti = players _ti2", "scoreboard players operation target fena.ti = players fena.ti2")
test_cmd("target _ti = @r _ti2", "scoreboard players operation target fena.ti = @r fena.ti2")
test_cmd("target _ti = @r", "scoreboard players operation target fena.ti = @r fena.ti")
test_cmd("target _ti = 3", "scoreboard players set target fena.ti 3")
test_cmd(r"target _ti = 3 {Nbt:1b}", r"scoreboard players set target fena.ti 3 {Nbt:1b}")
test_cmd("setblock _ti = players _ti2", "scoreboard players operation setblock fena.ti = players fena.ti2")
test_cmd("setblock _ti = @r _ti2", "scoreboard players operation setblock fena.ti = @r fena.ti2")
test_cmd("setblock _ti = @r", "scoreboard players operation setblock fena.ti = @r fena.ti")
test_cmd("setblock _ti = 3", "scoreboard players set setblock fena.ti 3")
test_cmd(r"setblock _ti = 3 {Nbt:1b}", r"scoreboard players set setblock fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation @s fena.ti = players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti = @r fena.ti2")
test_cmd("scoreboard players set @s fena.ti 3")
test_cmd(r"scoreboard players set @s fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation target fena.ti = players fena.ti2")
test_cmd("scoreboard players operation target fena.ti = @r fena.ti2")
test_cmd("scoreboard players set target fena.ti 3")
test_cmd(r"scoreboard players set target fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation setblock fena.ti = players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti = @r fena.ti2")
test_cmd("scoreboard players set setblock fena.ti 3")
test_cmd(r"scoreboard players set setblock fena.ti 3 {Nbt:1b}")
test_cmd("@s _ti += players _ti2", "scoreboard players operation @s fena.ti += players fena.ti2")
test_cmd("@s _ti += @r _ti2", "scoreboard players operation @s fena.ti += @r fena.ti2")
test_cmd("@s _ti += @r", "scoreboard players operation @s fena.ti += @r fena.ti")
test_cmd("@s _ti += 3", "scoreboard players add @s fena.ti 3")
test_cmd(r"@s _ti += 3 {Nbt:1b}", r"scoreboard players add @s fena.ti 3 {Nbt:1b}")
test_cmd("target _ti += players _ti2", "scoreboard players operation target fena.ti += players fena.ti2")
test_cmd("target _ti += @r _ti2", "scoreboard players operation target fena.ti += @r fena.ti2")
test_cmd("target _ti += @r", "scoreboard players operation target fena.ti += @r fena.ti")
test_cmd("target _ti += 3", "scoreboard players add target fena.ti 3")
test_cmd(r"target _ti += 3 {Nbt:1b}", r"scoreboard players add target fena.ti 3 {Nbt:1b}")
test_cmd("setblock _ti += players _ti2", "scoreboard players operation setblock fena.ti += players fena.ti2")
test_cmd("setblock _ti += @r _ti2", "scoreboard players operation setblock fena.ti += @r fena.ti2")
test_cmd("setblock _ti += @r", "scoreboard players operation setblock fena.ti += @r fena.ti")
test_cmd("setblock _ti += 3", "scoreboard players add setblock fena.ti 3")
test_cmd(r"setblock _ti += 3 {Nbt:1b}", r"scoreboard players add setblock fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation @s fena.ti += players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti += @r fena.ti2")
test_cmd("scoreboard players add @s fena.ti 3")
test_cmd(r"scoreboard players add @s fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation target fena.ti += players fena.ti2")
test_cmd("scoreboard players operation target fena.ti += @r fena.ti2")
test_cmd("scoreboard players add target fena.ti 3")
test_cmd(r"scoreboard players add target fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation setblock fena.ti += players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti += @r fena.ti2")
test_cmd("scoreboard players add setblock fena.ti 3")
test_cmd(r"scoreboard players add setblock fena.ti 3 {Nbt:1b}")
test_cmd("@s _ti -= players _ti2", "scoreboard players operation @s fena.ti -= players fena.ti2")
test_cmd("@s _ti -= @r _ti2", "scoreboard players operation @s fena.ti -= @r fena.ti2")
test_cmd("@s _ti -= @r", "scoreboard players operation @s fena.ti -= @r fena.ti")
test_cmd("@s _ti -= 3", "scoreboard players remove @s fena.ti 3")
test_cmd(r"@s _ti -= 3 {Nbt:1b}", r"scoreboard players remove @s fena.ti 3 {Nbt:1b}")
test_cmd("target _ti -= players _ti2", "scoreboard players operation target fena.ti -= players fena.ti2")
test_cmd("target _ti -= @r _ti2", "scoreboard players operation target fena.ti -= @r fena.ti2")
test_cmd("target _ti -= @r", "scoreboard players operation target fena.ti -= @r fena.ti")
test_cmd("target _ti -= 3", "scoreboard players remove target fena.ti 3")
test_cmd(r"target _ti -= 3 {Nbt:1b}", r"scoreboard players remove target fena.ti 3 {Nbt:1b}")
test_cmd("setblock _ti -= players _ti2", "scoreboard players operation setblock fena.ti -= players fena.ti2")
test_cmd("setblock _ti -= @r _ti2", "scoreboard players operation setblock fena.ti -= @r fena.ti2")
test_cmd("setblock _ti -= @r", "scoreboard players operation setblock fena.ti -= @r fena.ti")
test_cmd("setblock _ti -= 3", "scoreboard players remove setblock fena.ti 3")
test_cmd(r"setblock _ti -= 3 {Nbt:1b}", r"scoreboard players remove setblock fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation @s fena.ti -= players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti -= @r fena.ti2")
test_cmd("scoreboard players remove @s fena.ti 3")
test_cmd(r"scoreboard players remove @s fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation target fena.ti -= players fena.ti2")
test_cmd("scoreboard players operation target fena.ti -= @r fena.ti2")
test_cmd("scoreboard players remove target fena.ti 3")
test_cmd(r"scoreboard players remove target fena.ti 3 {Nbt:1b}")
test_cmd("scoreboard players operation setblock fena.ti -= players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti -= @r fena.ti2")
test_cmd("scoreboard players remove setblock fena.ti 3")
test_cmd(r"scoreboard players remove setblock fena.ti 3 {Nbt:1b}")
test_cmd("@s _ti *= players _ti2", "scoreboard players operation @s fena.ti *= players fena.ti2")
test_cmd("@s _ti *= @r _ti2", "scoreboard players operation @s fena.ti *= @r fena.ti2")
test_cmd("@s _ti *= @r", "scoreboard players operation @s fena.ti *= @r fena.ti")
test_cmd("@s _ti *= 3", "scoreboard players operation @s fena.ti *= 3 g.number")
test_cmd(r"@s _ti *= 3 {Nbt:1b}", expect_error=True)
test_cmd("target _ti *= players _ti2", "scoreboard players operation target fena.ti *= players fena.ti2")
test_cmd("target _ti *= @r _ti2", "scoreboard players operation target fena.ti *= @r fena.ti2")
test_cmd("target _ti *= @r", "scoreboard players operation target fena.ti *= @r fena.ti")
test_cmd("target _ti *= 3", "scoreboard players operation target fena.ti *= 3 g.number")
test_cmd(r"target _ti *= 3 {Nbt:1b}", expect_error=True)
test_cmd("setblock _ti *= players _ti2", "scoreboard players operation setblock fena.ti *= players fena.ti2")
test_cmd("setblock _ti *= @r _ti2", "scoreboard players operation setblock fena.ti *= @r fena.ti2")
test_cmd("setblock _ti *= @r", "scoreboard players operation setblock fena.ti *= @r fena.ti")
test_cmd("setblock _ti *= 3", "scoreboard players operation setblock fena.ti *= 3 g.number")
test_cmd(r"setblock _ti *= 3 {Nbt:1b}", expect_error=True)
test_cmd("scoreboard players operation @s fena.ti *= players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti *= @r fena.ti2")
test_cmd("scoreboard players operation @s fena.ti *= 3 g.number")
test_cmd("scoreboard players operation target fena.ti *= players fena.ti2")
test_cmd("scoreboard players operation target fena.ti *= @r fena.ti2")
test_cmd("scoreboard players operation target fena.ti *= 3 g.number")
test_cmd("scoreboard players operation setblock fena.ti *= players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti *= @r fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti *= 3 g.number")
test_cmd("@s _ti /= players _ti2", "scoreboard players operation @s fena.ti /= players fena.ti2")
test_cmd("@s _ti /= @r _ti2", "scoreboard players operation @s fena.ti /= @r fena.ti2")
test_cmd("@s _ti /= @r", "scoreboard players operation @s fena.ti /= @r fena.ti")
test_cmd("@s _ti /= 3", "scoreboard players operation @s fena.ti /= 3 g.number")
test_cmd(r"@s _ti /= 3 {Nbt:1b}", expect_error=True)
test_cmd("target _ti /= players _ti2", "scoreboard players operation target fena.ti /= players fena.ti2")
test_cmd("target _ti /= @r _ti2", "scoreboard players operation target fena.ti /= @r fena.ti2")
test_cmd("target _ti /= @r", "scoreboard players operation target fena.ti /= @r fena.ti")
test_cmd("target _ti /= 3", "scoreboard players operation target fena.ti /= 3 g.number")
test_cmd(r"target _ti /= 3 {Nbt:1b}", expect_error=True)
test_cmd("setblock _ti /= players _ti2", "scoreboard players operation setblock fena.ti /= players fena.ti2")
test_cmd("setblock _ti /= @r _ti2", "scoreboard players operation setblock fena.ti /= @r fena.ti2")
test_cmd("setblock _ti /= @r", "scoreboard players operation setblock fena.ti /= @r fena.ti")
test_cmd("setblock _ti /= 3", "scoreboard players operation setblock fena.ti /= 3 g.number")
test_cmd(r"setblock _ti /= 3 {Nbt:1b}", expect_error=True)
test_cmd("scoreboard players operation @s fena.ti /= players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti /= @r fena.ti2")
test_cmd("scoreboard players operation @s fena.ti /= 3 g.number")
test_cmd("scoreboard players operation target fena.ti /= players fena.ti2")
test_cmd("scoreboard players operation target fena.ti /= @r fena.ti2")
test_cmd("scoreboard players operation target fena.ti /= 3 g.number")
test_cmd("scoreboard players operation setblock fena.ti /= players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti /= @r fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti /= 3 g.number")
test_cmd("@s _ti %= players _ti2", "scoreboard players operation @s fena.ti %= players fena.ti2")
test_cmd("@s _ti %= @r _ti2", "scoreboard players operation @s fena.ti %= @r fena.ti2")
test_cmd("@s _ti %= @r", "scoreboard players operation @s fena.ti %= @r fena.ti")
test_cmd("@s _ti %= 3", "scoreboard players operation @s fena.ti %= 3 g.number")
test_cmd(r"@s _ti %= 3 {Nbt:1b}", expect_error=True)
test_cmd("target _ti %= players _ti2", "scoreboard players operation target fena.ti %= players fena.ti2")
test_cmd("target _ti %= @r _ti2", "scoreboard players operation target fena.ti %= @r fena.ti2")
test_cmd("target _ti %= @r", "scoreboard players operation target fena.ti %= @r fena.ti")
test_cmd("target _ti %= 3", "scoreboard players operation target fena.ti %= 3 g.number")
test_cmd(r"target _ti %= 3 {Nbt:1b}", expect_error=True)
test_cmd("setblock _ti %= players _ti2", "scoreboard players operation setblock fena.ti %= players fena.ti2")
test_cmd("setblock _ti %= @r _ti2", "scoreboard players operation setblock fena.ti %= @r fena.ti2")
test_cmd("setblock _ti %= @r", "scoreboard players operation setblock fena.ti %= @r fena.ti")
test_cmd("setblock _ti %= 3", "scoreboard players operation setblock fena.ti %= 3 g.number")
test_cmd(r"setblock _ti %= 3 {Nbt:1b}", expect_error=True)
test_cmd("scoreboard players operation @s fena.ti %= players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti %= @r fena.ti2")
test_cmd("scoreboard players operation @s fena.ti %= 3 g.number")
test_cmd("scoreboard players operation target fena.ti %= players fena.ti2")
test_cmd("scoreboard players operation target fena.ti %= @r fena.ti2")
test_cmd("scoreboard players operation target fena.ti %= 3 g.number")
test_cmd("scoreboard players operation setblock fena.ti %= players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti %= @r fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti %= 3 g.number")
test_cmd("@s _ti <= players _ti2", "scoreboard players operation @s fena.ti < players fena.ti2")
test_cmd("@s _ti <= @r _ti2", "scoreboard players operation @s fena.ti < @r fena.ti2")
test_cmd("@s _ti <= @r", "scoreboard players operation @s fena.ti < @r fena.ti")
test_cmd("@s _ti <= 3", "scoreboard players operation @s fena.ti < 3 g.number")
test_cmd(r"@s _ti <= 3 {Nbt:1b}", expect_error=True)
test_cmd("target _ti <= players _ti2", "scoreboard players operation target fena.ti < players fena.ti2")
test_cmd("target _ti <= @r _ti2", "scoreboard players operation target fena.ti < @r fena.ti2")
test_cmd("target _ti <= @r", "scoreboard players operation target fena.ti < @r fena.ti")
test_cmd("target _ti <= 3", "scoreboard players operation target fena.ti < 3 g.number")
test_cmd(r"target _ti <= 3 {Nbt:1b}", expect_error=True)
test_cmd("setblock _ti <= players _ti2", "scoreboard players operation setblock fena.ti < players fena.ti2")
test_cmd("setblock _ti <= @r _ti2", "scoreboard players operation setblock fena.ti < @r fena.ti2")
test_cmd("setblock _ti <= @r", "scoreboard players operation setblock fena.ti < @r fena.ti")
test_cmd("setblock _ti <= 3", "scoreboard players operation setblock fena.ti < 3 g.number")
test_cmd(r"setblock _ti <= 3 {Nbt:1b}", expect_error=True)
test_cmd("scoreboard players operation @s fena.ti < players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti < @r fena.ti2")
test_cmd("scoreboard players operation @s fena.ti < 3 g.number")
test_cmd("scoreboard players operation target fena.ti < players fena.ti2")
test_cmd("scoreboard players operation target fena.ti < @r fena.ti2")
test_cmd("scoreboard players operation target fena.ti < 3 g.number")
test_cmd("scoreboard players operation setblock fena.ti < players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti < @r fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti < 3 g.number")
test_cmd("@s _ti >= players _ti2", "scoreboard players operation @s fena.ti > players fena.ti2")
test_cmd("@s _ti >= @r _ti2", "scoreboard players operation @s fena.ti > @r fena.ti2")
test_cmd("@s _ti >= @r", "scoreboard players operation @s fena.ti > @r fena.ti")
test_cmd("@s _ti >= 3", "scoreboard players operation @s fena.ti > 3 g.number")
test_cmd(r"@s _ti >= 3 {Nbt:1b}", expect_error=True)
test_cmd("target _ti >= players _ti2", "scoreboard players operation target fena.ti > players fena.ti2")
test_cmd("target _ti >= @r _ti2", "scoreboard players operation target fena.ti > @r fena.ti2")
test_cmd("target _ti >= @r", "scoreboard players operation target fena.ti > @r fena.ti")
test_cmd("target _ti >= 3", "scoreboard players operation target fena.ti > 3 g.number")
test_cmd(r"target _ti >= 3 {Nbt:1b}", expect_error=True)
test_cmd("setblock _ti >= players _ti2", "scoreboard players operation setblock fena.ti > players fena.ti2")
test_cmd("setblock _ti >= @r _ti2", "scoreboard players operation setblock fena.ti > @r fena.ti2")
test_cmd("setblock _ti >= @r", "scoreboard players operation setblock fena.ti > @r fena.ti")
test_cmd("setblock _ti >= 3", "scoreboard players operation setblock fena.ti > 3 g.number")
test_cmd(r"setblock _ti >= 3 {Nbt:1b}", expect_error=True)
test_cmd("scoreboard players operation @s fena.ti > players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti > @r fena.ti2")
test_cmd("scoreboard players operation @s fena.ti > 3 g.number")
test_cmd("scoreboard players operation target fena.ti > players fena.ti2")
test_cmd("scoreboard players operation target fena.ti > @r fena.ti2")
test_cmd("scoreboard players operation target fena.ti > 3 g.number")
test_cmd("scoreboard players operation setblock fena.ti > players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti > @r fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti > 3 g.number")
test_cmd("@s _ti swap players _ti2", "scoreboard players operation @s fena.ti >< players fena.ti2")
test_cmd("@s _ti swap @r _ti2", "scoreboard players operation @s fena.ti >< @r fena.ti2")
test_cmd("@s _ti swap @r", "scoreboard players operation @s fena.ti >< @r fena.ti")
test_cmd("@s _ti swap 3", expect_error=True)
test_cmd(r"@s _ti swap 3 {Nbt:1b}", expect_error=True)
test_cmd("target _ti swap players _ti2", "scoreboard players operation target fena.ti >< players fena.ti2")
test_cmd("target _ti swap @r _ti2", "scoreboard players operation target fena.ti >< @r fena.ti2")
test_cmd("target _ti swap @r", "scoreboard players operation target fena.ti >< @r fena.ti")
test_cmd("target _ti swap 3", expect_error=True)
test_cmd(r"target _ti swap 3 {Nbt:1b}", expect_error=True)
test_cmd("setblock _ti swap players _ti2", "scoreboard players operation setblock fena.ti >< players fena.ti2")
test_cmd("setblock _ti swap @r _ti2", "scoreboard players operation setblock fena.ti >< @r fena.ti2")
test_cmd("setblock _ti swap @r", "scoreboard players operation setblock fena.ti >< @r fena.ti")
test_cmd("setblock _ti swap 3", expect_error=True)
test_cmd(r"setblock _ti swap 3 {Nbt:1b}", expect_error=True)
test_cmd("scoreboard players operation @s fena.ti >< players fena.ti2")
test_cmd("scoreboard players operation @s fena.ti >< @r fena.ti2")
test_cmd("scoreboard players operation target fena.ti >< players fena.ti2")
test_cmd("scoreboard players operation target fena.ti >< @r fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti >< players fena.ti2")
test_cmd("scoreboard players operation setblock fena.ti >< @r fena.ti2")
test_cmd("@s reset _ti", "scoreboard players reset fena.ti @s")
test_cmd("target reset _ti", "scoreboard players reset fena.ti target")
test_cmd("setblock reset _ti", "scoreboard players reset fena.ti setblock")
test_cmd("scoreboard players reset fena.ti @s")
test_cmd("scoreboard players reset fena.ti target")
test_cmd("scoreboard players reset fena.ti setblock")
test_cmd("@s enable _ti", "scoreboard players enable fena.ti @s")
test_cmd("target enable _ti", "scoreboard players enable fena.ti target")
test_cmd("setblock enable _ti", "scoreboard players enable fena.ti setblock")
test_cmd("scoreboard players enable fena.ti @s")
test_cmd("scoreboard players enable fena.ti target")
test_cmd("scoreboard players enable fena.ti setblock")
| 79.88716
| 115
| 0.661488
| 2,978
| 20,531
| 4.407992
| 0.01041
| 0.109698
| 0.326807
| 0.115182
| 0.995886
| 0.994744
| 0.992001
| 0.982098
| 0.949874
| 0.943475
| 0
| 0.020201
| 0.211582
| 20,531
| 256
| 116
| 80.199219
| 0.790758
| 0
| 0
| 0
| 0
| 0
| 0.703034
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.004237
| true
| 0
| 0.004237
| 0
| 0.008475
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
9476225476120d9f6feed14711de83b5e18f3db6
| 152
|
py
|
Python
|
lab03.py
|
Lankersss/csws-week1
|
eb23a7f9b9ea82fb176132c8f21a276eed5d7599
|
[
"Apache-2.0"
] | null | null | null |
lab03.py
|
Lankersss/csws-week1
|
eb23a7f9b9ea82fb176132c8f21a276eed5d7599
|
[
"Apache-2.0"
] | null | null | null |
lab03.py
|
Lankersss/csws-week1
|
eb23a7f9b9ea82fb176132c8f21a276eed5d7599
|
[
"Apache-2.0"
] | null | null | null |
locations = "Italy", "Netherlands","Sweden" , "Germany", "France"
print(locations)
sorted(locations)
print(locations)
sorted(locations)
print(locations)
| 25.333333
| 65
| 0.763158
| 16
| 152
| 7.25
| 0.5
| 0.362069
| 0.344828
| 0.5
| 0.62069
| 0.62069
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072368
| 152
| 6
| 66
| 25.333333
| 0.822695
| 0
| 0
| 0.833333
| 0
| 0
| 0.228758
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 7
|
847dda5d2b1d57547d59b95472844dcfae07d8d3
| 36
|
py
|
Python
|
pingo/parts/spi/__init__.py
|
rbanffy/pingo
|
b448d5eecae17b82aafd708c2594dae6d4194d84
|
[
"MIT"
] | 116
|
2015-05-06T17:49:22.000Z
|
2021-11-16T12:59:35.000Z
|
pingo/parts/spi/__init__.py
|
pingo-io/pingo-py
|
5d7081f99ff13973404dc6361560f30ce8f7009c
|
[
"MIT"
] | 49
|
2015-05-08T23:18:05.000Z
|
2017-07-12T17:11:48.000Z
|
pingo/parts/spi/__init__.py
|
rbanffy/pingo
|
b448d5eecae17b82aafd708c2594dae6d4194d84
|
[
"MIT"
] | 47
|
2015-05-04T07:42:04.000Z
|
2021-08-04T20:49:54.000Z
|
from mcp3008 import Mcp3008 # noqa
| 18
| 35
| 0.777778
| 5
| 36
| 5.6
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.275862
| 0.194444
| 36
| 1
| 36
| 36
| 0.689655
| 0.111111
| 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
| 1
| 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
| 7
|
849de634fab33a6e43f22f65c0e814fc5703faf6
| 77
|
py
|
Python
|
agents/__init__.py
|
AlgTUDelft/AlwaysSafe
|
76beccb698a07c13f3c765c52b62683ad75ba7eb
|
[
"MIT"
] | 10
|
2021-04-19T17:51:10.000Z
|
2022-01-13T06:16:22.000Z
|
agents/__init__.py
|
AlgTUDelft/AlwaysSafe
|
76beccb698a07c13f3c765c52b62683ad75ba7eb
|
[
"MIT"
] | null | null | null |
agents/__init__.py
|
AlgTUDelft/AlwaysSafe
|
76beccb698a07c13f3c765c52b62683ad75ba7eb
|
[
"MIT"
] | 1
|
2021-12-07T13:24:05.000Z
|
2021-12-07T13:24:05.000Z
|
from .opt_cmdp import OptCMDPAgent
from .abs_opt_cmdp import AbsOptCMDPAgent
| 25.666667
| 41
| 0.87013
| 11
| 77
| 5.818182
| 0.636364
| 0.21875
| 0.40625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103896
| 77
| 2
| 42
| 38.5
| 0.927536
| 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
| 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
| 7
|
84aaf9e7e770df74dc25d5e6b83b7988fd5e2cfa
| 8,133
|
py
|
Python
|
Tables.py
|
alabid/dp_quantiles_bounded_space
|
f24411795f1715931224ec1dcc44b0398bf99389
|
[
"MIT"
] | null | null | null |
Tables.py
|
alabid/dp_quantiles_bounded_space
|
f24411795f1715931224ec1dcc44b0398bf99389
|
[
"MIT"
] | null | null | null |
Tables.py
|
alabid/dp_quantiles_bounded_space
|
f24411795f1715931224ec1dcc44b0398bf99389
|
[
"MIT"
] | null | null | null |
import numpy as np
import math
import random
import importlib
import statistics
import Greenwald_Khanna
importlib.reload(Greenwald_Khanna)
from Greenwald_Khanna import GK, FullSpace
from tqdm import tqdm
import pickle
import sys
if __name__=="__main__":
check = 0
if sys.argv[1] == "small":
dbfile_e = open('Small_approx_error', 'rb')
dbfile_s = open('Small_approx_sizes', 'rb')
results = pickle.load(dbfile_e)
sizes = pickle.load(dbfile_s)
dbfile_e.close()
dbfile_s.close()
elif sys.argv[1] == "large":
dbfile_e = open('Large_approx_error', 'rb')
dbfile_s = open('Large_approx_sizes', 'rb')
results = pickle.load(dbfile_e)
sizes = pickle.load(dbfile_s)
dbfile_e.close()
dbfile_s.close()
elif sys.argv[1] =="privsmall":
dbfile_e = open('Small_approx_error_varyeps', 'rb')
results = pickle.load(dbfile_e)
dbfile_e.close()
sizes = []
check = 1
elif sys.argv[1] =="privlarge":
dbfile_e = open('Large_approx_error_varyeps', 'rb')
results = pickle.load(dbfile_e)
dbfile_e.close()
check = 1
sizes = []
print("Results",len(results))
print("Sizes",sizes)
#data = np.array(results[0][1][2])
#print(data)
#data = np.array(results[0][1][3])
#print(data)
if check == 0:
print("Uniform, GKExp")
for result in results:
#print(np.quantile(result[1][2],0.05))
#print("(",result[0],",",format(abs(statistics.mean(result[1][2])-result[1][0]), '.6f'),") +- (",format(np.quantile(result[1][2],0.05)-result[1][0], '.6f'),",",format(np.quantile(result[1][2],0.95)-result[1][0], '.6f'),")")
errors = np.absolute(result[1][2]-result[1][0]*np.ones(len(result[1][2])))
mean = statistics.mean(errors)
lower = format(mean-np.quantile(errors,0.05), '.6f')
upper = format(np.quantile(errors,0.95)-mean, '.6f')
mean = format(mean, '.6f')
#print(errors)
print(result[0],"\t",mean,"\t",lower,"\t",upper)
print("Uniform, Full")
for result in results:
#print(statistics.mean(result[1][3]), " and ", result[1][0])
#print("(",result[0],",",format(abs(statistics.mean(result[1][3])-result[1][0]), '.6f'),") +- (",format(np.quantile(result[1][3],0.05)-result[1][0], '.6f'),",",format(np.quantile(result[1][3],0.95)-result[1][0], '.6f'),")")
errors = np.absolute(result[1][3]-result[1][0]*np.ones(len(result[1][3])))
mean = statistics.mean(errors)
lower = format(mean-np.quantile(errors,0.05), '.6f')
upper = format(np.quantile(errors,0.95)-mean, '.6f')
mean = format(mean, '.6f')
print(result[0],"\t",mean,"\t",lower,"\t",upper)
#print(result[0],"\t",format(abs(statistics.mean(result[1][3])-result[1][0]), '.6f'),"\t",format(np.quantile(result[1][3],0.05)-result[1][0], '.6f'),"\t", format(np.quantile(result[1][3],0.95)-result[1][0], '.6f'))
print("Normal, GKExp")
for result in results:
errors = np.absolute(result[2][2]-result[2][0]*np.ones(len(result[2][2])))
mean = statistics.mean(errors)
lower = format(mean-np.quantile(errors,0.05), '.6f')
upper = format(np.quantile(errors,0.95)-mean, '.6f')
mean = format(mean, '.6f')
print(result[0],"\t",mean,"\t",lower,"\t",upper)
#print("(",result[0],",",format(abs(statistics.mean(result[2][2])-result[2][0]), '.6f'),") +- (",format(np.quantile(result[2][2],0.05) - result[2][0], '.6f'),",",format(np.quantile(result[2][2],0.95) - result[2][0], '.6f'),")")
print("Normal, Full")
for result in results:
errors = np.absolute(result[2][3]-result[2][0]*np.ones(len(result[2][3])))
mean = statistics.mean(errors)
lower = format(mean-np.quantile(errors,0.05), '.6f')
upper = format(np.quantile(errors,0.95)-mean, '.6f')
mean = format(mean, '.6f')
print(result[0],"\t",mean,"\t",lower,"\t",upper)
#print("(",result[0],",",format(abs(statistics.mean(result[2][3])-result[2][0]), '.6f'),") +- (",format(np.quantile(result[2][3],0.05) - result[2][0], '.6f'),",",format(np.quantile(result[2][3],0.95) - result[2][0], '.6f'),")")
print("Uniform distribution sizes")
for size in sizes:
#print("(",size[1],",",size[0],")")
print(size[1],'\t',size[0])
for size in sizes:
#print("(",size[1],",",size[1],")")
print(size[1],'\t',size[1])
print("Normal distribution sizes")
for size in sizes:
#print("(",size[3],",",size[2],")")
print(size[3],'\t',size[2])
for size in sizes:
#print("(",size[3],",",size[3],")")
print(size[3],'\t',size[3])
print("Sizes [len(np_gk_unif.S), len(full_np_gk_unif.S),len(np_gk_normal.S), len(full_np_gk_normal.S)] ", sizes)
elif check==1:
print("Uniform, GKExp")
for result in results:
#print(np.quantile(result[1][2],0.05))
#print("(",result[0],",",format(abs(statistics.mean(result[1][2])-result[1][0]), '.6f'),") +- (",format(np.quantile(result[1][2],0.05)-result[1][0], '.6f'),",",format(np.quantile(result[1][2],0.95)-result[1][0], '.6f'),")")
errors = np.absolute(result[1][2]-result[1][0]*np.ones(len(result[1][2])))
mean = statistics.mean(errors)
lower = format(mean-np.quantile(errors,0.05), '.6f')
upper = format(np.quantile(errors,0.95)-mean, '.6f')
mean = format(mean, '.6f')
#print(errors)
print(result[0],"\t",mean,"\t",lower,"\t",upper)
print("Uniform, Full")
for result in results:
#print(statistics.mean(result[1][3]), " and ", result[1][0])
#print("(",result[0],",",format(abs(statistics.mean(result[1][3])-result[1][0]), '.6f'),") +- (",format(np.quantile(result[1][3],0.05)-result[1][0], '.6f'),",",format(np.quantile(result[1][3],0.95)-result[1][0], '.6f'),")")
errors = np.absolute(result[1][3]-result[1][0]*np.ones(len(result[1][3])))
mean = statistics.mean(errors)
lower = format(mean-np.quantile(errors,0.05), '.6f')
upper = format(np.quantile(errors,0.95)-mean, '.6f')
mean = format(mean, '.6f')
print(result[0],"\t",mean,"\t",lower,"\t",upper)
#print(result[0],"\t",format(abs(statistics.mean(result[1][3])-result[1][0]), '.6f'),"\t",format(np.quantile(result[1][3],0.05)-result[1][0], '.6f'),"\t", format(np.quantile(result[1][3],0.95)-result[1][0], '.6f'))
print("Normal, GKExp")
for result in results:
errors = np.absolute(result[2][2]-result[2][0]*np.ones(len(result[2][2])))
mean = statistics.mean(errors)
lower = format(mean-np.quantile(errors,0.05), '.6f')
upper = format(np.quantile(errors,0.95)-mean, '.6f')
mean = format(mean, '.6f')
print(result[0],"\t",mean,"\t",lower,"\t",upper)
#print("(",result[0],",",format(abs(statistics.mean(result[2][2])-result[2][0]), '.6f'),") +- (",format(np.quantile(result[2][2],0.05) - result[2][0], '.6f'),",",format(np.quantile(result[2][2],0.95) - result[2][0], '.6f'),")")
print("Normal, Full")
for result in results:
errors = np.absolute(result[2][3]-result[2][0]*np.ones(len(result[2][3])))
mean = statistics.mean(errors)
lower = format(mean-np.quantile(errors,0.05), '.6f')
upper = format(np.quantile(errors,0.95)-mean, '.6f')
mean = format(mean, '.6f')
print(result[0],"\t",mean,"\t",lower,"\t",upper)
#print("(",result[0],",",format(abs(statistics.mean(result[2][3])-result[2][0]), '.6f'),") +- (",format(np.quantile(result[2][3],0.05) - result[2][0], '.6f'),",",format(np.quantile(result[2][3],0.95) - result[2][0], '.6f'),")")
| 47.561404
| 239
| 0.541498
| 1,162
| 8,133
| 3.744406
| 0.061102
| 0.086877
| 0.102965
| 0.101126
| 0.901632
| 0.878649
| 0.843714
| 0.842565
| 0.809009
| 0.809009
| 0
| 0.062206
| 0.215296
| 8,133
| 170
| 240
| 47.841176
| 0.619555
| 0.327063
| 0
| 0.711864
| 0
| 0.008475
| 0.103322
| 0.022022
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.09322
| 0
| 0.09322
| 0.211864
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
ca1744bd917f2b63752acc44976bed0be044ea43
| 2,514
|
py
|
Python
|
luwu/core/models/classifier/preset/__init__.py
|
AaronJny/luwu
|
05ee0bc605926661e42cada6cff5e281f4506291
|
[
"MIT"
] | 19
|
2021-01-30T03:04:31.000Z
|
2022-01-09T10:33:12.000Z
|
luwu/core/models/classifier/preset/__init__.py
|
AaronJny/luwu
|
05ee0bc605926661e42cada6cff5e281f4506291
|
[
"MIT"
] | 4
|
2021-04-15T02:10:53.000Z
|
2021-06-24T12:17:29.000Z
|
luwu/core/models/classifier/preset/__init__.py
|
AaronJny/luwu
|
05ee0bc605926661e42cada6cff5e281f4506291
|
[
"MIT"
] | 5
|
2021-03-02T07:29:12.000Z
|
2022-01-09T10:32:49.000Z
|
# -*- coding: utf-8 -*-
# @Date : 2021-01-21
# @Author : AaronJny
# @LastEditTime : 2021-04-06
# @FilePath : /LuWu/luwu/core/models/classifier/preset/__init__.py
# @Desc :
from luwu.core.models.classifier.preset.pre_trained import (
LuwuLeNetImageClassifier,
LuwuPreTrainedImageClassifier,
LuwuDenseNet121ImageClassifier,
LuwuDenseNet169ImageClassifier,
LuwuDenseNet201ImageClassifier,
LuwuVGG16ImageClassifier,
LuwuVGG19ImageClassifier,
LuwuMobileNetImageClassifier,
LuwuMobileNetV2ImageClassifier,
LuwuInceptionResNetV2ImageClassifier,
LuwuInceptionV3ImageClassifier,
LuwuNASNetMobileImageClassifier,
LuwuNASNetLargeImageClassifier,
LuwuResNet50ImageClassifier,
LuwuResNet50V2ImageClassifier,
LuwuResNet101ImageClassifier,
LuwuResNet101V2ImageClassifier,
LuwuResNet152ImageClassifier,
LuwuResNet152V2ImageClassifier,
LuwuMobileNetV3SmallImageClassifier,
LuwuMobileNetV3LargeImageClassifier,
LuwuXceptionImageClassifier,
LuwuEfficientNetB0ImageClassifier,
LuwuEfficientNetB1ImageClassifier,
LuwuEfficientNetB2ImageClassifier,
LuwuEfficientNetB3ImageClassifier,
LuwuEfficientNetB4ImageClassifier,
LuwuEfficientNetB5ImageClassifier,
LuwuEfficientNetB6ImageClassifier,
LuwuEfficientNetB7ImageClassifier,
)
__all__ = [
"LuwuPreTrainedImageClassifier",
"LuwuLeNetImageClassifier",
"LuwuDenseNet121ImageClassifier",
"LuwuDenseNet169ImageClassifier",
"LuwuDenseNet201ImageClassifier",
"LuwuVGG16ImageClassifier",
"LuwuVGG19ImageClassifier",
"LuwuMobileNetImageClassifier",
"LuwuMobileNetV2ImageClassifier",
"LuwuInceptionResNetV2ImageClassifier",
"LuwuInceptionV3ImageClassifier",
"LuwuNASNetMobileImageClassifier",
"LuwuNASNetLargeImageClassifier",
"LuwuResNet50ImageClassifier",
"LuwuResNet50V2ImageClassifier",
"LuwuResNet101ImageClassifier",
"LuwuResNet101V2ImageClassifier",
"LuwuResNet152ImageClassifier",
"LuwuResNet152V2ImageClassifier",
"LuwuMobileNetV3SmallImageClassifier",
"LuwuMobileNetV3LargeImageClassifier",
"LuwuXceptionImageClassifier",
"LuwuEfficientNetB0ImageClassifier",
"LuwuEfficientNetB1ImageClassifier",
"LuwuEfficientNetB2ImageClassifier",
"LuwuEfficientNetB3ImageClassifier",
"LuwuEfficientNetB4ImageClassifier",
"LuwuEfficientNetB5ImageClassifier",
"LuwuEfficientNetB6ImageClassifier",
"LuwuEfficientNetB7ImageClassifier",
]
| 34.916667
| 70
| 0.790772
| 93
| 2,514
| 21.27957
| 0.602151
| 0.008085
| 0.014149
| 0.024255
| 0.895402
| 0.865083
| 0.865083
| 0.865083
| 0.865083
| 0.865083
| 0
| 0.049675
| 0.143198
| 2,514
| 71
| 71
| 35.408451
| 0.869081
| 0.073588
| 0
| 0
| 0
| 0
| 0.391473
| 0.391473
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.015625
| 0
| 0.015625
| 0
| 0
| 0
| 1
| 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
| 7
|
ca1c0a9af3845debff6c5912d38c36a2fd482a2e
| 9,669
|
py
|
Python
|
main.py
|
mabelcalim/Gororoba
|
c402cc6d83888e38fd71d96641c0ef34bcff533e
|
[
"MIT"
] | null | null | null |
main.py
|
mabelcalim/Gororoba
|
c402cc6d83888e38fd71d96641c0ef34bcff533e
|
[
"MIT"
] | null | null | null |
main.py
|
mabelcalim/Gororoba
|
c402cc6d83888e38fd71d96641c0ef34bcff533e
|
[
"MIT"
] | null | null | null |
#encondings: utf-8
# -*- coding: utf-8 -*-
__author__ = 'Mabel'
#__version__ = '0.0.12'
'''GOROROBA App
escrito por: Mabel Calim Costa
data: OUT/2019
DRAFT01
'''
import kivy
kivy.require('1.10.1')
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import Screen, ScreenManager
import time
from kivy.graphics import Color, Ellipse
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.uix.button import Button
import platform
import sys
from kivy.uix.popup import Popup
from functools import partial
from kivy.uix.label import Label
from kivy.factory import Factory as F
from kivy.core.window import Window
from kivy.uix.button import ButtonBehavior
from kivy.uix.image import Image
from kivy.core.window import Window
# Editor
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
import os
class ImageButton(ButtonBehavior, Image):
pass
class LabelButton(ButtonBehavior, Label):
pass
class Rodape(Screen):
pass
class Abertura(Screen):
pass
class Salgados(Screen):
loadfile = ObjectProperty(None)
savefile = ObjectProperty(None)
text_input = ObjectProperty(None)
path_d = str(os.path.abspath(os.path.dirname(__file__))) + "/salgados"
path_f = str(os.path.abspath(os.path.dirname(__file__))) + "/favoritas_S2"
def show_load(self):
self.ids['sal_msg'].text = ""
content = LoadDialog(load=self.load, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def show_save(self):
self.ids['sal_msg'].text = ""
content = SaveDialog(save=self.save, cancel=self.dismiss_popup)
self._popup = Popup(title="Save file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def load(self, path, filename):
self.ids['sal_msg'].text = ""
#path = str(os.path.abspath(os.path.dirname(__file__)))
#path = path + '/doces/'xs
path_d = str(os.path.abspath(os.path.dirname(__file__))) #+ "/doces"
#print (path_d)
with open(os.path.join(path_d, filename[0])) as stream:
self.text_input.text = stream.read()
#self.dismiss_popup()
def save(self, path, filename):
#if self.ids['text_input2'].text == '':
# self.ids['doces_msg'].text = " Atenção, dê um nome para receita modificada aqui embaixo. Ex: nova_receita.txt"
#else:
print (filename)
with open(os.path.join(path, filename[0]), 'w') as stream:
#print (os.path.join(path, filename[0]))
stream.write(self.text_input.text)
self.ids['sal_msg'].text = "Sua receita foi salva com sucesso!"
def fav(self,path, filename):
#if self.ids['text_input2'].text == '':
# self.ids['doces_msg'].text = " Atenção, dê um nome para receita modificada aqui embaixo. Ex: nova_receita.txt"
#else:
pathf = str(os.path.abspath(os.path.dirname(__file__))) + "/favoritas_S2"
print (filename)
#print (filename[0][-1])
nome = filename[0].split("/")[-1]
with open(os.path.join(pathf, nome), 'w') as stream:
#print (os.path.join(pathf, filename[0]))
stream.write(self.text_input.text)
self.ids['sal_msg'].text = "Sua receita favoritada!"
def change_scroll_y(self, ti, scrlv):
y_cursor = ti.cursor_pos[1]
y_bar = scrlv.scroll_y * (ti.height-scrlv.height)
if ti.height > scrlv.height:
if y_cursor >= y_bar + scrlv.height:
dy = y_cursor - (y_bar + scrlv.height)
scrlv.scroll_y = scrlv.scroll_y + scrlv.convert_distance_to_scroll(0, dy)[1]
if y_cursor - ti.line_height <= y_bar:
dy = (y_cursor - ti.line_height) - y_bar
scrlv.scroll_y = scrlv.scroll_y + scrlv.convert_distance_to_scroll(0, dy)[1]
class Doces(Screen):
loadfile = ObjectProperty(None)
savefile = ObjectProperty(None)
text_input = ObjectProperty(None)
path_d = str(os.path.abspath(os.path.dirname(__file__))) + "/doces"
path_f = str(os.path.abspath(os.path.dirname(__file__))) + "/favoritas_S2"
def show_load(self):
self.ids['doces_msg'].text = ""
content = LoadDialog(load=self.load, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def show_save(self):
self.ids['doces_msg'].text = ""
content = SaveDialog(save=self.save, cancel=self.dismiss_popup)
self._popup = Popup(title="Save file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def load(self, path, filename):
self.ids['doces_msg'].text = ""
#path = str(os.path.abspath(os.path.dirname(__file__)))
#path = path + '/doces/'xs
path_d = str(os.path.abspath(os.path.dirname(__file__))) #+ "/doces"
#print (path_d)
with open(os.path.join(path_d, filename[0])) as stream:
self.text_input.text = stream.read()
#self.dismiss_popup()
def save(self, path, filename):
#if self.ids['text_input2'].text == '':
# self.ids['doces_msg'].text = " Atenção, dê um nome para receita modificada aqui embaixo. Ex: nova_receita.txt"
#else:
print (filename)
with open(os.path.join(path, filename[0]), 'w') as stream:
#print (os.path.join(path, filename[0]))
stream.write(self.text_input.text)
self.ids['doces_msg'].text = "Sua receita foi salva com sucesso!"
def fav(self,path, filename):
#if self.ids['text_input2'].text == '':
# self.ids['doces_msg'].text = " Atenção, dê um nome para receita modificada aqui embaixo. Ex: nova_receita.txt"
#else:
pathf = str(os.path.abspath(os.path.dirname(__file__))) + "/favoritas_S2"
print (filename)
#print (filename[0][-1])
nome = filename[0].split("/")[-1]
with open(os.path.join(pathf, nome), 'w') as stream:
#print (os.path.join(pathf, filename[0]))
stream.write(self.text_input.text)
self.ids['doces_msg'].text = "Sua receita favoritada!"
def change_scroll_y(self, ti, scrlv):
y_cursor = ti.cursor_pos[1]
y_bar = scrlv.scroll_y * (ti.height-scrlv.height)
if ti.height > scrlv.height:
if y_cursor >= y_bar + scrlv.height:
dy = y_cursor - (y_bar + scrlv.height)
scrlv.scroll_y = scrlv.scroll_y + scrlv.convert_distance_to_scroll(0, dy)[1]
if y_cursor - ti.line_height <= y_bar:
dy = (y_cursor - ti.line_height) - y_bar
scrlv.scroll_y = scrlv.scroll_y + scrlv.convert_distance_to_scroll(0, dy)[1]
class Favoritas(Screen):
loadfile = ObjectProperty(None)
savefile = ObjectProperty(None)
text_input = ObjectProperty(None)
path_d = str(os.path.abspath(os.path.dirname(__file__))) + "/doces"
path_f = str(os.path.abspath(os.path.dirname(__file__))) + "/favoritas_S2"
def show_load(self):
self.ids['fv_msg'].text = ""
content = LoadDialog(load=self.load, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def show_save(self):
self.ids['fv_msg'].text = ""
content = SaveDialog(save=self.save, cancel=self.dismiss_popup)
self._popup = Popup(title="Save file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def load(self, path, filename):
self.ids['fv_msg'].text = ""
path_f = str(os.path.abspath(os.path.dirname(__file__))) #+ "/favoritas_S2"
#print (path_f)
with open(os.path.join(path_f, filename[0])) as stream:
self.text_input.text = stream.read()
def save(self, path, filename):
print (filename)
with open(os.path.join(path, filename[0]), 'w') as stream:
#print (os.path.join(path, filename[0]))
stream.write(self.text_input.text)
self.ids['fv_msg'].text = "Sua receita foi salva com sucesso!"
def change_scroll_y(self, ti, scrlv):
y_cursor = ti.cursor_pos[1]
y_bar = scrlv.scroll_y * (ti.height-scrlv.height)
if ti.height > scrlv.height:
if y_cursor >= y_bar + scrlv.height:
dy = y_cursor - (y_bar + scrlv.height)
scrlv.scroll_y = scrlv.scroll_y + scrlv.convert_distance_to_scroll(0, dy)[1]
if y_cursor - ti.line_height <= y_bar:
dy = (y_cursor - ti.line_height) - y_bar
scrlv.scroll_y = scrlv.scroll_y + scrlv.convert_distance_to_scroll(0, dy)[1]
GUI = Builder.load_file("main.kv") # Make sure this is after all class definitions!
class GororobaApp(App):
#url = 'https://legec-app.firebaseio.com'
#rm no dir data
def build(self):
self.icon = 'figs/kpi_logo.png'
self.title = 'GOROROBA-APP'
return GUI
def change_screen(self, screen_name):
screen_manager = self.root.ids['screen_manager']
screen_manager.current = screen_name
F.register('Doces', cls=Doces)
F.register('Salgados', cls=Doces)
F.register('Favoritas', cls=Favoritas)
GororobaApp().run()
| 37.045977
| 123
| 0.618471
| 1,316
| 9,669
| 4.364742
| 0.132219
| 0.040738
| 0.031337
| 0.036212
| 0.813545
| 0.799617
| 0.77594
| 0.772458
| 0.760272
| 0.754178
| 0
| 0.011519
| 0.245837
| 9,669
| 260
| 124
| 37.188462
| 0.776193
| 0.136209
| 0
| 0.725714
| 0
| 0
| 0.058552
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.108571
| false
| 0.022857
| 0.137143
| 0
| 0.382857
| 0.028571
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
ca372b4ba478f26337d6f1da94842f75fbcaa244
| 2,195
|
py
|
Python
|
deep_privacy/tests/data_loader_transition.py
|
aaniin/DeepPrivacy
|
068d86ca112ada4b7d37f57c3b1be6e4ca44dad1
|
[
"MIT"
] | 6
|
2019-10-17T13:11:13.000Z
|
2021-10-01T17:35:39.000Z
|
deep_privacy/tests/data_loader_transition.py
|
EugenioRJ/DeepPrivacy
|
3516f6f3bf2dcb6e7ed4d86195a7c1974077cdf8
|
[
"MIT"
] | 4
|
2019-09-26T07:08:49.000Z
|
2019-10-06T12:13:51.000Z
|
deep_privacy/tests/data_loader_transition.py
|
EugenioRJ/DeepPrivacy
|
3516f6f3bf2dcb6e7ed4d86195a7c1974077cdf8
|
[
"MIT"
] | 1
|
2021-04-13T19:14:00.000Z
|
2021-04-13T19:14:00.000Z
|
import matplotlib.pyplot as plt
import numpy as np
import torch
from deep_privacy.data_tools.dataloaders import load_dataset
from deep_privacy import torch_utils
from deep_privacy.data_tools import data_utils
start_imsize = 8
batch_size=32
dl_train, dl_val = load_dataset("fdf", batch_size, start_imsize, False, 14, True)
dl = dl_val
dl.update_next_transition_variable(1.0)
next(iter(dl))
for im, condition, landmark in dl:
im = data_utils.denormalize_img(im)
im = torch_utils.image_to_numpy(im, to_uint8=True)
to_save1 = im
break
to_save1 = np.concatenate(to_save1, axis=1)
dl_train, dl_val = load_dataset("fdf", batch_size, start_imsize*2, False, 14, True)
dl = dl_val
dl.update_next_transition_variable(0.0)
next(iter(dl))
for im, condition, landmark in dl:
im = torch.nn.functional.avg_pool2d(im, 2)
im = data_utils.denormalize_img(im)
im = torch_utils.image_to_numpy(im, to_uint8=True)
to_save2 = im
break
to_save2 = np.concatenate(to_save2, axis=1)
print(to_save1.shape, to_save2.shape)
print("Diff:", abs(to_save1 - to_save2).sum())
to_save = np.concatenate((to_save1, to_save2), axis=0)
plt.imsave(".debug/transition_test_loader_downsample.jpg", to_save)
dl_train, dl_val = load_dataset("fdf", batch_size, start_imsize, False, 14, True)
dl = dl_val
dl.update_next_transition_variable(1.0)
next(iter(dl))
for im, condition, landmark in dl:
im = torch.nn.functional.interpolate(im, scale_factor=2)
im = data_utils.denormalize_img(im)
im = torch_utils.image_to_numpy(im, to_uint8=True)
to_save1 = im
break
to_save1 = np.concatenate(to_save1, axis=1)
dl_train, dl_val = load_dataset("fdf", batch_size, start_imsize*2, False, 14, True)
dl = dl_val
dl.update_next_transition_variable(0.0)
next(iter(dl))
for im, condition, landmark in dl:
im = data_utils.denormalize_img(im)
im = torch_utils.image_to_numpy(im, to_uint8=True)
to_save2 = im
break
to_save2 = np.concatenate(to_save2, axis=1)
print(to_save1.shape, to_save2.shape)
print("Diff upsample:", abs(to_save1 - to_save2).sum())
to_save = np.concatenate((to_save1, to_save2), axis=0)
plt.imsave(".debug/transition_test_loader_upsample.jpg", to_save)
| 29.266667
| 83
| 0.753075
| 374
| 2,195
| 4.136364
| 0.195187
| 0.054299
| 0.058177
| 0.031028
| 0.851972
| 0.820944
| 0.820944
| 0.820944
| 0.820944
| 0.820944
| 0
| 0.03043
| 0.131663
| 2,195
| 75
| 84
| 29.266667
| 0.781217
| 0
| 0
| 0.758621
| 0
| 0
| 0.053279
| 0.039162
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.103448
| 0
| 0.103448
| 0.068966
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
ca61cf60ba5aba8b11e0e02c9443b401526e692b
| 2,214
|
py
|
Python
|
tests/test_data_quality_specific_functions.py
|
umd-lib/dwetl
|
a305851347d9e0824a37b69d7b612cdfe0583f0b
|
[
"Apache-2.0"
] | 1
|
2021-04-08T11:58:51.000Z
|
2021-04-08T11:58:51.000Z
|
tests/test_data_quality_specific_functions.py
|
tsboom/dwetl
|
b137b8ad3fa36fcabb6a0de33c23e1328b6e3a19
|
[
"Apache-2.0"
] | 1
|
2020-05-29T15:30:59.000Z
|
2020-05-29T15:30:59.000Z
|
tests/test_data_quality_specific_functions.py
|
tsboom/dwetl
|
b137b8ad3fa36fcabb6a0de33c23e1328b6e3a19
|
[
"Apache-2.0"
] | 3
|
2019-04-26T11:47:30.000Z
|
2022-03-05T06:11:57.000Z
|
# import unittest
# from dwetl import data_quality_specific_functions
#
# '''
# data_quality_specific_functions.py tests
# '''
#
# class TestDataQualitySpecificFunctions(unittest.TestCase):
#
# def test_dq_z30_temp_location(self):
# self.assertTrue(data_quality_specific_functions.dq_z30_temp_location('Y'))
# self.assertTrue(data_quality_specific_functions.dq_z30_temp_location('N'))
# self.assertFalse(data_quality_specific_functions.dq_z30_temp_location('NotYesOrNo'))
#
# def test_dq_z30_call_no_type__valid_cal_no_type(self):
# self.assertTrue(data_quality_specific_functions.dq_z30_call_no_type__valid_cal_no_type('1'))
# self.assertTrue(data_quality_specific_functions.dq_z30_call_no_type__valid_cal_no_type('-M'))
# self.assertFalse(data_quality_specific_functions.dq_z30_call_no_type__valid_cal_no_type('9'))
# self.assertFalse(data_quality_specific_functions.dq_z30_call_no_type__valid_cal_no_type(''))
# self.assertFalse(data_quality_specific_functions.dq_z30_call_no_type__valid_cal_no_type(None))
#
# def test_dq_z13u_user_defined_10__valid_holding_own_code(self):
# self.assertTrue(data_quality_specific_functions.dq_z13u_user_defined_10__valid_holding_own_code('SMHOL'))
# self.assertFalse(data_quality_specific_functions.dq_z13u_user_defined_10__valid_holding_own_code(''))
# self.assertFalse(data_quality_specific_functions.dq_z13u_user_defined_10__valid_holding_own_code(None))
#
# def test_dq_z13u_user_defined_2(self):
# self.assertTrue(data_quality_specific_functions.dq_z13u_user_defined_2('ocm00003739'))
# self.assertTrue(data_quality_specific_functions.dq_z13u_user_defined_2('ocn000037390'))
# self.assertTrue(data_quality_specific_functions.dq_z13u_user_defined_2('on0000037390'))
# self.assertTrue(data_quality_specific_functions.dq_z13u_user_defined_2(''))
# self.assertFalse(data_quality_specific_functions.dq_z13u_user_defined_2('doesntstartwithocstuff'))
# self.assertFalse(data_quality_specific_functions.dq_z13u_user_defined_2('lengthistoolong123940124814'))
#
#
#
#
#
#
#
#
#
# if __name__ == '__main__':
# unittest.main()
| 49.2
| 115
| 0.796748
| 293
| 2,214
| 5.341297
| 0.174061
| 0.133546
| 0.230671
| 0.339936
| 0.807029
| 0.807029
| 0.80639
| 0.78147
| 0.743131
| 0.740575
| 0
| 0.049696
| 0.109304
| 2,214
| 44
| 116
| 50.318182
| 0.743915
| 0.959801
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
ca875c2216c4933ad776a1c0436546fa36a95a7f
| 22
|
py
|
Python
|
sums/nosum.py
|
dmoney/seeandsay
|
f930c305d8bb9d8d07bdc33dd4d699d7e6beb8eb
|
[
"MIT"
] | null | null | null |
sums/nosum.py
|
dmoney/seeandsay
|
f930c305d8bb9d8d07bdc33dd4d699d7e6beb8eb
|
[
"MIT"
] | null | null | null |
sums/nosum.py
|
dmoney/seeandsay
|
f930c305d8bb9d8d07bdc33dd4d699d7e6beb8eb
|
[
"MIT"
] | null | null | null |
print("499999500000")
| 11
| 21
| 0.772727
| 2
| 22
| 8.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.571429
| 0.045455
| 22
| 1
| 22
| 22
| 0.238095
| 0
| 0
| 0
| 0
| 0
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 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 | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 7
|
0494954dd221da9c4183c6917d6c16ae99c1b71d
| 3,367
|
py
|
Python
|
ex094.py
|
gabrielwai/exercicios_de_Python
|
3767775748db7c501a6e0364edf7ba4f079e62f9
|
[
"MIT"
] | null | null | null |
ex094.py
|
gabrielwai/exercicios_de_Python
|
3767775748db7c501a6e0364edf7ba4f079e62f9
|
[
"MIT"
] | null | null | null |
ex094.py
|
gabrielwai/exercicios_de_Python
|
3767775748db7c501a6e0364edf7ba4f079e62f9
|
[
"MIT"
] | null | null | null |
<<<<<<< HEAD
pessoa = dict()
lista_de_pessoas = list()
while True:
pessoa['nome'] = str(input('Nome: ')).strip()
pessoa['sexo'] = 'A'
while pessoa['sexo'] not in 'MF':
pessoa['sexo'] = str(input('Sexo [M/F]: ')).strip().upper()[0]
if pessoa['sexo'] not in 'MF':
print('Valor incorreto. Tente novamente.')
pessoa['idade'] = int(input('Idade: '))
continuar = 'A'
while continuar not in 'NnSs':
continuar = str(input('Deseja continuar [S/N]?: ')).strip()[0]
if continuar not in 'SsNs':
print('Valor incorreto. Tente novamente.')
lista_de_pessoas.append(pessoa.copy())
if continuar in 'Nn':
break
print('-='*30)
print(lista_de_pessoas)
print(f' - O grupo tem {len(lista_de_pessoas)} pessoas.')
media_idade = 0
mulheres = list()
for c in range(len(lista_de_pessoas)):
media_idade += lista_de_pessoas[c]['idade']
if lista_de_pessoas[c]['sexo'] == 'F':
mulheres.append(lista_de_pessoas[c]['nome'])
media_idade /= len(lista_de_pessoas)
print(f' - A média de idade é de {media_idade:.2f} anos.')
print(' - As mulheres cadastradas foram:', end=' ')
for c in range(len(mulheres)-1):
print(mulheres[c], end=', ')
print(mulheres[-1])
print(' - Lista de pessoas com idade acima da média:', end='\n')
chaves = list(lista_de_pessoas[0].keys())
for c in range(len(lista_de_pessoas)):
if lista_de_pessoas[c]['idade'] > media_idade:
print(f' {chaves[0]} = {lista_de_pessoas[c]["nome"]}; '
f'{chaves[2]} = {lista_de_pessoas[c]["idade"]}; '
f'{chaves[1]} = {lista_de_pessoas[c]["sexo"]}')
print('<< ENCERRADO >>')
=======
pessoa = dict()
lista_de_pessoas = list()
while True:
pessoa['nome'] = str(input('Nome: ')).strip()
pessoa['sexo'] = 'A'
while pessoa['sexo'] not in 'MF':
pessoa['sexo'] = str(input('Sexo [M/F]: ')).strip().upper()[0]
if pessoa['sexo'] not in 'MF':
print('Valor incorreto. Tente novamente.')
pessoa['idade'] = int(input('Idade: '))
continuar = 'A'
while continuar not in 'NnSs':
continuar = str(input('Deseja continuar [S/N]?: ')).strip()[0]
if continuar not in 'SsNs':
print('Valor incorreto. Tente novamente.')
lista_de_pessoas.append(pessoa.copy())
if continuar in 'Nn':
break
print('-='*30)
print(lista_de_pessoas)
print(f' - O grupo tem {len(lista_de_pessoas)} pessoas.')
media_idade = 0
mulheres = list()
for c in range(len(lista_de_pessoas)):
media_idade += lista_de_pessoas[c]['idade']
if lista_de_pessoas[c]['sexo'] == 'F':
mulheres.append(lista_de_pessoas[c]['nome'])
media_idade /= len(lista_de_pessoas)
print(f' - A média de idade é de {media_idade:.2f} anos.')
print(' - As mulheres cadastradas foram:', end=' ')
for c in range(len(mulheres)-1):
print(mulheres[c], end=', ')
print(mulheres[-1])
print(' - Lista de pessoas com idade acima da média:', end='\n\n')
chaves = list(lista_de_pessoas[0].keys())
for c in range(len(lista_de_pessoas)):
if lista_de_pessoas[c]['idade'] > media_idade:
print(f'{chaves[0]} = {lista_de_pessoas[c]["nome"]}; '
f'{chaves[2]} = {lista_de_pessoas[c]["idade"]}; '
f'{chaves[1]} = {lista_de_pessoas[c]["sexo"]}')
print('<< ENCERRADO >>')
>>>>>>> 2c40c1f76c7460c7f674ac76f048fd525a07710e
| 31.175926
| 70
| 0.61093
| 473
| 3,367
| 4.200846
| 0.141649
| 0.112733
| 0.225466
| 0.105687
| 0.977856
| 0.977856
| 0.977856
| 0.977856
| 0.977856
| 0.977856
| 0
| 0.01884
| 0.19602
| 3,367
| 107
| 71
| 31.46729
| 0.715183
| 0
| 0
| 0.941176
| 0
| 0
| 0.301455
| 0.067122
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.282353
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
049d30104d9338db4d8401a10dc40c5130ee5fd5
| 159
|
py
|
Python
|
test/test_import.py
|
jacobneiltaylor/plugable
|
5a54720feb849d6ba68e2b9d74a59d041a06699d
|
[
"MIT"
] | 1
|
2021-11-27T08:03:51.000Z
|
2021-11-27T08:03:51.000Z
|
test/test_import.py
|
jacobneiltaylor/plugable
|
5a54720feb849d6ba68e2b9d74a59d041a06699d
|
[
"MIT"
] | null | null | null |
test/test_import.py
|
jacobneiltaylor/plugable
|
5a54720feb849d6ba68e2b9d74a59d041a06699d
|
[
"MIT"
] | null | null | null |
def test_plugable_import():
import plugable.class_registry # noqa: F401
import plugable.plugable_meta # noqa: F401
import plugable # noqa: F401
| 31.8
| 48
| 0.72956
| 20
| 159
| 5.6
| 0.45
| 0.375
| 0.25
| 0.392857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.070866
| 0.201258
| 159
| 4
| 49
| 39.75
| 0.811024
| 0.201258
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 1
| 0
| 1.25
| 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
| 1
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 8
|
049d3591c409c75f063cab1258104315058821a9
| 95
|
py
|
Python
|
my_utils/decorators/__init__.py
|
RSNirwan/my_utils
|
72402acb4d956b365b3d9f2753e6520aa4a7355b
|
[
"MIT"
] | null | null | null |
my_utils/decorators/__init__.py
|
RSNirwan/my_utils
|
72402acb4d956b365b3d9f2753e6520aa4a7355b
|
[
"MIT"
] | null | null | null |
my_utils/decorators/__init__.py
|
RSNirwan/my_utils
|
72402acb4d956b365b3d9f2753e6520aa4a7355b
|
[
"MIT"
] | null | null | null |
from my_utils.decorators.cache import shallow_cache
from my_utils.decorators.time import timer
| 31.666667
| 51
| 0.873684
| 15
| 95
| 5.333333
| 0.6
| 0.15
| 0.275
| 0.525
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.084211
| 95
| 2
| 52
| 47.5
| 0.91954
| 0
| 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
| 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
| 7
|
04d75dc053bdeb5b524a72984cc15cd0346a5ace
| 345
|
py
|
Python
|
test5a.py
|
cciealem/NetworkProg
|
a8aa39bc4040c3e0bf73ade39b5cbb292332150a
|
[
"MIT"
] | null | null | null |
test5a.py
|
cciealem/NetworkProg
|
a8aa39bc4040c3e0bf73ade39b5cbb292332150a
|
[
"MIT"
] | null | null | null |
test5a.py
|
cciealem/NetworkProg
|
a8aa39bc4040c3e0bf73ade39b5cbb292332150a
|
[
"MIT"
] | null | null | null |
print("this is a test foruth file")
print("this is a test foruth file")
print("this is a test foruth file")
print("this is a test foruth file")
print("this is a test foruth file")
print("this is a test foruth file")
print("this is a test foruth file")
print("this is a test foruth file")
print("this is a test foruth file")
print("time flies")
| 28.75
| 35
| 0.718841
| 66
| 345
| 3.757576
| 0.136364
| 0.326613
| 0.399194
| 0.435484
| 0.96371
| 0.96371
| 0.96371
| 0.96371
| 0.96371
| 0.96371
| 0
| 0
| 0.165217
| 345
| 11
| 36
| 31.363636
| 0.861111
| 0
| 0
| 0.9
| 0
| 0
| 0.707246
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 13
|
04ee64ebce5fdffb7426bfa622cb2acc34d4c410
| 203
|
py
|
Python
|
l1/1.py
|
vvhappyguy/-VEGA
|
c16362a93051f52cbf8543b5552a25a7a9eb1b80
|
[
"MIT"
] | null | null | null |
l1/1.py
|
vvhappyguy/-VEGA
|
c16362a93051f52cbf8543b5552a25a7a9eb1b80
|
[
"MIT"
] | null | null | null |
l1/1.py
|
vvhappyguy/-VEGA
|
c16362a93051f52cbf8543b5552a25a7a9eb1b80
|
[
"MIT"
] | null | null | null |
def lensort(arr):
return sorted(arr, key = lambda word: len(word))
if __name__ == "__main__":
print(lensort(["123","1", "12"]))
print(lensort(["123","1", "12", "312312312", "11", "0"]))
| 33.833333
| 61
| 0.561576
| 27
| 203
| 3.925926
| 0.703704
| 0.226415
| 0.283019
| 0.301887
| 0.339623
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144578
| 0.182266
| 203
| 6
| 61
| 33.833333
| 0.493976
| 0
| 0
| 0
| 0
| 0
| 0.160804
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0
| 0.2
| 0.4
| 0.4
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 7
|
04feb151b6e4acce4d792279792998b95cd440be
| 3,281
|
py
|
Python
|
Problems_1_to_100/Problem_8/tests/test_problem_8.py
|
ikostan/ProjectEuler
|
d54adb72c0844c8ba47bd5f571cd70b7e68ab2aa
|
[
"Unlicense"
] | 1
|
2019-03-25T02:07:32.000Z
|
2019-03-25T02:07:32.000Z
|
Problems_1_to_100/Problem_8/tests/test_problem_8.py
|
ikostan/ProjectEuler
|
d54adb72c0844c8ba47bd5f571cd70b7e68ab2aa
|
[
"Unlicense"
] | null | null | null |
Problems_1_to_100/Problem_8/tests/test_problem_8.py
|
ikostan/ProjectEuler
|
d54adb72c0844c8ba47bd5f571cd70b7e68ab2aa
|
[
"Unlicense"
] | null | null | null |
#!/usr/bin/python
import unittest
import os
from Problems_1_to_100.Problem_8.problem_8 \
import find_greatest_product
class MyTestCase(unittest.TestCase):
print("Running unit tests from: " +
os.path.basename(__file__) + "\n")
def test_basic(self):
number = "73167176531330624919225119674426574742355349194934\
96983520312774506326239578318016984801869478851843\
85861560789112949495459501737958331952853208805511\
12540698747158523863050715693290963295227443043557\
66896648950445244523161731856403098711121722383113\
62229893423380308135336276614282806444486645238749\
70172427121883998797908792274921901699720888093776\
65727333001053367881220235421809751254540594752243\
52584907711670556013604839586446706324415722155397\
53697817977846174064955149290862569321978468622482\
83972241375657056057490261407972968652414535100474\
82166370484403199890008895243450658541227588666881\
16427171479924442928230863465674813919123162824586\
17866458359124566529476545682848912883142607690042\
24219022671055626321111109370544217506941658960408\
07198403850962455444362981230987879927244284909188\
84580156166097919133875499200524063689912560717606\
05886116467109405077541002256983155200055935729725\
71636269561882670428252483600823257530420752963450"
# Removing Spaces from Strings in Python 3.x
number = number.replace(' ', '')
adjacent_digits = 4
expected = 5832
self.assertEqual(expected,
find_greatest_product(number,
adjacent_digits))
def test_13(self):
number = "73167176531330624919225119674426574742355349194934\
96983520312774506326239578318016984801869478851843\
85861560789112949495459501737958331952853208805511\
12540698747158523863050715693290963295227443043557\
66896648950445244523161731856403098711121722383113\
62229893423380308135336276614282806444486645238749\
70172427121883998797908792274921901699720888093776\
65727333001053367881220235421809751254540594752243\
52584907711670556013604839586446706324415722155397\
53697817977846174064955149290862569321978468622482\
83972241375657056057490261407972968652414535100474\
82166370484403199890008895243450658541227588666881\
16427171479924442928230863465674813919123162824586\
17866458359124566529476545682848912883142607690042\
24219022671055626321111109370544217506941658960408\
07198403850962455444362981230987879927244284909188\
84580156166097919133875499200524063689912560717606\
05886116467109405077541002256983155200055935729725\
71636269561882670428252483600823257530420752963450"
# Removing Spaces from Strings in Python 3.x
number = number.replace(' ', '')
adjacent_digits = 13
expected = 23514624000
self.assertEqual(expected,
find_greatest_product(number,
adjacent_digits))
| 47.550725
| 69
| 0.738799
| 132
| 3,281
| 18.204545
| 0.5
| 0.023304
| 0.02372
| 0.091552
| 0.907199
| 0.907199
| 0.907199
| 0.907199
| 0.907199
| 0.855597
| 0
| 0.759653
| 0.226455
| 3,281
| 68
| 70
| 48.25
| 0.187155
| 0.031088
| 0
| 0.779661
| 0
| 0
| 0.009131
| 0
| 0
| 0
| 0
| 0
| 0.033898
| 1
| 0.033898
| false
| 0
| 0.050847
| 0
| 0.101695
| 0.016949
| 0
| 0
| 1
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
f3f1aff3223255d3f607583fb1423c1a9b4e18af
| 5,291
|
py
|
Python
|
tests/test_deep_form_relations.py
|
havron/wtforms-alchemy
|
d61920242e8dbff46e3d9d15415d14631a450672
|
[
"BSD-3-Clause"
] | 161
|
2015-01-04T07:03:07.000Z
|
2022-03-25T06:06:10.000Z
|
tests/test_deep_form_relations.py
|
havron/wtforms-alchemy
|
d61920242e8dbff46e3d9d15415d14631a450672
|
[
"BSD-3-Clause"
] | 72
|
2015-04-16T22:04:15.000Z
|
2021-12-29T05:10:52.000Z
|
tests/test_deep_form_relations.py
|
havron/wtforms-alchemy
|
d61920242e8dbff46e3d9d15415d14631a450672
|
[
"BSD-3-Clause"
] | 49
|
2015-01-06T11:46:04.000Z
|
2021-01-15T22:26:32.000Z
|
import sqlalchemy as sa
from wtforms.fields import FormField
from tests import FormRelationsTestCase, MultiDict
from wtforms_alchemy import ModelFieldList, ModelForm, ModelFormField
class TestDeepFormRelationsOneToManyToOne(FormRelationsTestCase):
def create_models(self):
class Event(self.base):
__tablename__ = 'event'
id = sa.Column(sa.Integer, primary_key=True)
name = sa.Column(sa.Unicode(255), nullable=False)
class Address(self.base):
__tablename__ = 'address'
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
street = sa.Column(sa.Unicode(255), nullable=True)
class Location(self.base):
__tablename__ = 'location'
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
name = sa.Column(sa.Unicode(255), nullable=True)
address_id = sa.Column(sa.Integer, sa.ForeignKey(Address.id))
address = sa.orm.relationship(Address)
event_id = sa.Column(sa.Integer, sa.ForeignKey(Event.id))
event = sa.orm.relationship(Event, backref='locations')
self.Event = Event
self.Location = Location
self.Address = Address
def create_forms(self):
class AddressForm(ModelForm):
class Meta:
model = self.Address
class LocationForm(ModelForm):
class Meta:
model = self.Location
address = ModelFormField(AddressForm)
class EventForm(ModelForm):
class Meta:
model = self.Event
locations = ModelFieldList(FormField(LocationForm))
self.LocationForm = LocationForm
self.EventForm = EventForm
self.AddressForm = AddressForm
def save(self):
data = {
'name': u'Some event',
'locations-0-name': u'Some location',
'locations-0-address-street': u'Some address'
}
event = self.Event()
self.session.add(event)
form = self.EventForm(MultiDict(data))
form.validate()
form.populate_obj(event)
self.session.commit()
def test_assigment_and_deletion(self):
self.save()
event = self.session.query(self.Event).first()
assert event.locations[0].name == u'Some location'
assert event.locations[0].address.street == u'Some address'
data = {
'name': u'Some event'
}
form = self.EventForm(MultiDict(data))
form.validate()
form.populate_obj(event)
self.session.commit()
event = self.session.query(self.Event).first()
assert event.locations == []
class TestDeepFormRelationsOneToOneToMany(FormRelationsTestCase):
def create_models(self):
class Location(self.base):
__tablename__ = 'location'
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
name = sa.Column(sa.Unicode(255), nullable=True)
class Address(self.base):
__tablename__ = 'address'
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
street = sa.Column(sa.Unicode(255), nullable=True)
location_id = sa.Column(sa.Integer, sa.ForeignKey(Location.id))
location = sa.orm.relationship(Location, backref='addresses')
class Event(self.base):
__tablename__ = 'event'
id = sa.Column(sa.Integer, primary_key=True)
name = sa.Column(sa.Unicode(255), nullable=False)
location_id = sa.Column(sa.Integer, sa.ForeignKey(Location.id))
location = sa.orm.relationship(Location)
self.Event = Event
self.Location = Location
self.Address = Address
def create_forms(self):
class AddressForm(ModelForm):
class Meta:
model = self.Address
class LocationForm(ModelForm):
class Meta:
model = self.Location
addresses = ModelFieldList(FormField(AddressForm))
class EventForm(ModelForm):
class Meta:
model = self.Event
location = ModelFormField(LocationForm)
self.LocationForm = LocationForm
self.EventForm = EventForm
self.AddressForm = AddressForm
def save(self):
data = {
'name': u'Some event',
'location-name': u'Some location',
'location-addresses-0-street': u'Some address'
}
event = self.Event()
self.session.add(event)
form = self.EventForm(MultiDict(data))
form.validate()
form.populate_obj(event)
self.session.commit()
def test_assigment_and_deletion(self):
self.save()
event = self.session.query(self.Event).first()
assert event.location.name == u'Some location'
assert event.location.addresses[0].street == u'Some address'
data = {
'name': u'Some event'
}
form = self.EventForm(MultiDict(data))
form.validate()
form.populate_obj(event)
self.session.commit()
event = self.session.query(self.Event).first()
assert event.location.addresses == []
| 33.27673
| 76
| 0.601777
| 550
| 5,291
| 5.7
| 0.129091
| 0.045933
| 0.051037
| 0.038278
| 0.85327
| 0.85327
| 0.803509
| 0.747049
| 0.747049
| 0.710686
| 0
| 0.006421
| 0.293517
| 5,291
| 158
| 77
| 33.487342
| 0.832263
| 0
| 0
| 0.765625
| 0
| 0
| 0.055944
| 0.010017
| 0
| 0
| 0
| 0
| 0.046875
| 1
| 0.0625
| false
| 0
| 0.03125
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
eda4b3d5f27137b7fd7c5c8307773c77246df676
| 6,133
|
py
|
Python
|
tests/test_list_tasks_view.py
|
fillipe-gsm/python-kanban
|
7d2a2f507f6326218413c89d2449b64f58770bd5
|
[
"MIT"
] | 2
|
2021-07-29T00:23:46.000Z
|
2022-01-28T07:17:19.000Z
|
tests/test_list_tasks_view.py
|
fillipe-gsm/python-kanban
|
7d2a2f507f6326218413c89d2449b64f58770bd5
|
[
"MIT"
] | 1
|
2021-11-03T14:17:28.000Z
|
2021-11-05T18:14:14.000Z
|
tests/test_list_tasks_view.py
|
fillipe-gsm/python-kanban
|
7d2a2f507f6326218413c89d2449b64f58770bd5
|
[
"MIT"
] | null | null | null |
import pytest
from mock import Mock
from prompt_toolkit.key_binding.key_processor import KeyPress, KeyProcessor
from prompt_toolkit.keys import Keys
from python_kanban.views.list_tasks_view import ListTasksView
from python_kanban.models import Todo
@pytest.fixture
def todo_entries():
return [
Todo.create(title="Title 1 to do", status=Todo.CHOICES[0][0]),
Todo.create(title="Title 2 to do", status=Todo.CHOICES[0][0]),
Todo.create(title="Title 3 doing", status=Todo.CHOICES[1][0]),
Todo.create(title="Title 4 done", status=Todo.CHOICES[2][0]),
Todo.create(title="Title 5 done", status=Todo.CHOICES[2][0]),
Todo.create(title="Title 6 done", status=Todo.CHOICES[2][0]),
]
@pytest.fixture
def todo_entries_without_status_0():
return [
Todo.create(title="Title 3 doing", status=Todo.CHOICES[1][0]),
Todo.create(title="Title 4 done", status=Todo.CHOICES[2][0]),
Todo.create(title="Title 5 done", status=Todo.CHOICES[2][0]),
Todo.create(title="Title 6 done", status=Todo.CHOICES[2][0]),
]
@pytest.fixture
def todo_entries_without_status_1():
return [
Todo.create(title="Title 1 to do", status=Todo.CHOICES[0][0]),
Todo.create(title="Title 2 to do", status=Todo.CHOICES[0][0]),
Todo.create(title="Title 4 done", status=Todo.CHOICES[2][0]),
Todo.create(title="Title 5 done", status=Todo.CHOICES[2][0]),
Todo.create(title="Title 6 done", status=Todo.CHOICES[2][0]),
]
def test_list_view_layout(todo_entries):
"""
Ensure there are two main portions: the main view with the Kanban table,
and a help text
"""
view = ListTasksView()
layout = view.layout
assert len(layout.container.children) == 2
def test_focus_to_first_container_by_default(todo_entries):
"""Ensure the first status container (Todo) has focus by default"""
view = ListTasksView()
view.load_view()
assert view.focused_element == 0
assert view.layout.has_focus(view.status_containers[0])
def test_focus_to_second_container_if_no_todo_tasks(
todo_entries_without_status_0
):
"""
If there are no tasks in status 'Todo', the focus must be on the second
container
"""
view = ListTasksView()
assert view.focused_element == 1
assert view.layout.has_focus(view.status_containers[1])
def test_a_should_load_add_task_view(todo_entries):
mocked_app = Mock()
view = ListTasksView(app=mocked_app)
processor = KeyProcessor(view.load_key_bindings())
processor.feed(KeyPress("a"))
processor.process_keys()
mocked_app.load_add_task_view.assert_called_once()
def test_right_moves_to_next_container(todo_entries):
"""
Pressing "right" or "l" key should give focus to next status container.
This only goes as farther as the rightmost one.
"""
view = ListTasksView()
processor = KeyProcessor(view.load_key_bindings())
processor.feed(KeyPress("l"))
processor.process_keys()
assert view.focused_element == 1
assert view.layout.has_focus(view.status_containers[1])
processor.feed(KeyPress(Keys.Right))
processor.process_keys()
assert view.focused_element == 2
assert view.layout.has_focus(view.status_containers[2])
processor.feed(KeyPress("l"))
processor.process_keys()
# Further presses should keep the same last container
assert view.focused_element == 2
assert view.layout.has_focus(view.status_containers[2])
processor.feed(KeyPress(Keys.Right))
processor.process_keys()
assert view.focused_element == 2
assert view.layout.has_focus(view.status_containers[2])
def test_right_skips_empty_container(todo_entries_without_status_1):
"""
Here, it should skip container 1 (Doing) since there are no todos there.
"""
view = ListTasksView()
processor = KeyProcessor(view.load_key_bindings())
processor.feed(KeyPress("l"))
processor.process_keys()
assert view.focused_element == 2
assert view.layout.has_focus(view.status_containers[2])
def test_left_moves_to_previous_container(todo_entries):
"""
Pressing "left" or "h" key should give focus to previous status container.
This only goes as farther as the leftmost one.
"""
view = ListTasksView()
# Force focused position in container 2
view.focused_element = 2
processor = KeyProcessor(view.load_key_bindings())
processor.feed(KeyPress("h"))
processor.process_keys()
assert view.focused_element == 1
assert view.layout.has_focus(view.status_containers[1])
processor.feed(KeyPress(Keys.Left))
processor.process_keys()
assert view.focused_element == 0
assert view.layout.has_focus(view.status_containers[0])
processor.feed(KeyPress("h"))
processor.process_keys()
# Further presses should keep the same first container
assert view.focused_element == 0
assert view.layout.has_focus(view.status_containers[0])
processor.feed(KeyPress(Keys.Left))
processor.process_keys()
assert view.focused_element == 0
assert view.layout.has_focus(view.status_containers[0])
def test_left_skips_empty_container(todo_entries_without_status_1):
"""
Here, it should skip container 1 (Doing) since there are no todos there.
"""
view = ListTasksView()
# Force focused position in container 2
view.focused_element = 2
processor = KeyProcessor(view.load_key_bindings())
processor.feed(KeyPress("h"))
processor.process_keys()
assert view.focused_element == 0
assert view.layout.has_focus(view.status_containers[0])
def test_q_quits_application(todo_entries):
mocked_app = Mock()
view = ListTasksView(app=mocked_app)
processor = KeyProcessor(view.load_key_bindings())
processor.feed(KeyPress("q"))
processor.process_keys()
mocked_app.exit.assert_called_once()
def test_check_focus_if_initial_container_is_provided(todo_entries):
view = ListTasksView(initial_container_focus=2)
assert view.focused_element == 2
assert view.layout.has_focus(view.status_containers[2])
| 29.204762
| 78
| 0.713517
| 846
| 6,133
| 4.973995
| 0.148936
| 0.061787
| 0.05347
| 0.071293
| 0.777804
| 0.725048
| 0.725048
| 0.724572
| 0.724572
| 0.680846
| 0
| 0.016598
| 0.174792
| 6,133
| 209
| 79
| 29.344498
| 0.814859
| 0.130768
| 0
| 0.733333
| 0
| 0
| 0.037193
| 0
| 0
| 0
| 0
| 0.019139
| 0.241667
| 1
| 0.108333
| false
| 0
| 0.05
| 0.025
| 0.183333
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
eda8f74857e4e24c8a54d645009969a783af9fe2
| 5,158
|
py
|
Python
|
EmeraldAI/Logic/NLP/Thesaurus.py
|
MaxMorgenstern/EmeraldAI
|
4bbb50f94b656904c428fc28cdbb61e7353e61aa
|
[
"Apache-2.0"
] | null | null | null |
EmeraldAI/Logic/NLP/Thesaurus.py
|
MaxMorgenstern/EmeraldAI
|
4bbb50f94b656904c428fc28cdbb61e7353e61aa
|
[
"Apache-2.0"
] | null | null | null |
EmeraldAI/Logic/NLP/Thesaurus.py
|
MaxMorgenstern/EmeraldAI
|
4bbb50f94b656904c428fc28cdbb61e7353e61aa
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from cachetools import cached
from EmeraldAI.Config.Config import Config
from EmeraldAI.Logic.Singleton import Singleton
if(Config().Get("Database", "ThesaurusDatabaseType").lower() == "sqlite"):
from EmeraldAI.Logic.Database.SQlite3 import SQlite3 as db
elif(Config().Get("Database", "ThesaurusDatabaseType").lower() == "mysql"):
from EmeraldAI.Logic.Database.MySQL import MySQL as db
class Thesaurus(object):
__metaclass__ = Singleton
def __executePragma(self):
db().Fetchall("PRAGMA automatic_index=OFF;")
def __executeQuery(self, query, word):
return db().Fetchall(query.format(lowerword=word.lower()))
@cached(cache={})
def GetSynonymsAndCategory(self, word):
self.__executePragma()
query = """SELECT term.normalized_word, term.word, category.category_name
FROM Thesaurus_Term term, Thesaurus_Category_Link category_link, Thesaurus_Category category
WHERE term.synset_id IN (
SELECT synset_id
FROM Thesaurus_Term term2, Thesaurus_Synset synset
WHERE (term2.word = '{lowerword}' OR term2.normalized_word = '{lowerword}')
and synset.id = term2.synset_id
and synset.is_visible = 1
)
AND category_link.synset_id = term.synset_id
AND category_link.category_id = category.id
ORDER BY term.word"""
return self.__executeQuery(query, word)
#@cached(cache={})
#def GetSynonymsAndCategory(self, word):
# query = """SELECT term.normalized_word, term.word, term2.word, category.category_name
# FROM Thesaurus_Term term, Thesaurus_Synset synset, Thesaurus_Term term2, Thesaurus_Category_Link category_link, Thesaurus_Category category
# WHERE synset.is_visible = 1
# AND synset.id = term.synset_id
# AND term2.synset_id = synset.id
# AND (term2.word = '{lowerword}' OR term2.normalized_word = '{lowerword}')
# AND category_link.synset_id = synset.id
# AND category_link.category_id = category.id
# ORDER BY term.word"""
# return self.__executeQuery(query, word)
@cached(cache={})
def GetSynonyms(self, word):
self.__executePragma()
query = """SELECT term.normalized_word, term.word
FROM Thesaurus_Term term
WHERE term.synset_id IN (
SELECT synset_id
FROM Thesaurus_Term term2, Thesaurus_Synset synset
WHERE (term2.word = '{lowerword}' OR term2.normalized_word = '{lowerword}')
and synset.id = term2.synset_id
and synset.is_visible = 1
)
ORDER BY term.word"""
return self.__executeQuery(query, word)
#@cached(cache={})
#def GetSynonyms(self, word):
# query = """SELECT term.normalized_word, term.word, term2.word
# FROM Thesaurus_Term term, Thesaurus_Synset synset, Thesaurus_Term term2
# WHERE synset.is_visible = 1
# AND synset.id = term.synset_id
# AND term2.synset_id = synset.id
# AND (term2.word = '{lowerword}' OR term2.normalized_word = '{lowerword}')
# ORDER BY term.word"""
# return self.__executeQuery(query, word)
@cached(cache={})
def GetCategory(self, word):
self.__executePragma()
query = """SELECT category.category_name
FROM Thesaurus_Category_Link category_link, Thesaurus_Category category
WHERE category_link.synset_id IN (
SELECT synset_id
FROM Thesaurus_Term term2, Thesaurus_Synset synset
WHERE (term2.word = '{lowerword}' OR term2.normalized_word = '{lowerword}')
and synset.id = term2.synset_id
and synset.is_visible = 1
)
AND category_link.category_id = category.id"""
return self.__executeQuery(query, word)
#@cached(cache={})
#def GetCategory(self, word):
# query = """SELECT term.normalized_word, term.word, category.category_name
# FROM Thesaurus_Term term, Thesaurus_Category_Link category_link, Thesaurus_Synset synset, Thesaurus_Category category
# WHERE synset.is_visible = 1
# AND synset.id = term.synset_id
# AND (term.word = '{lowerword}' OR term.normalized_word = '{lowerword}')
# AND category_link.synset_id = synset.id
# AND category_link.category_id = category.id"""
# return self.__executeQuery(query, word)
@cached(cache={})
def GetOpposite(self, word):
query = """SELECT term.word, term2.word as opposite
FROM Thesaurus_Term term, Thesaurus_Term_Link term_link, Thesaurus_Term term2
WHERE (term.word = '{lowerword}' OR term.normalized_word = '{lowerword}')
AND (
term.id = term_link.term_id AND term_link.target_term_id = term2.id
OR term.id = term_link.target_term_id AND term_link.term_id = term2.id
)"""
return self.__executeQuery(query, word)
| 45.245614
| 152
| 0.636487
| 588
| 5,158
| 5.365646
| 0.115646
| 0.070998
| 0.038352
| 0.059905
| 0.828526
| 0.751189
| 0.709667
| 0.709667
| 0.709667
| 0.645008
| 0
| 0.00922
| 0.264056
| 5,158
| 113
| 153
| 45.646018
| 0.821918
| 0.32784
| 0
| 0.447761
| 0
| 0
| 0.612875
| 0.110982
| 0
| 0
| 0
| 0
| 0
| 1
| 0.089552
| false
| 0
| 0.074627
| 0.014925
| 0.268657
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
edbbc66c157d0d4a7b50fc263fc42e70f58d673b
| 30,041
|
py
|
Python
|
python/tests/test_events_service.py
|
benknoll-umn/mtap
|
67d506aa4ffc960acca1988ec12c5391c15ad736
|
[
"Apache-2.0"
] | 3
|
2020-03-06T21:24:24.000Z
|
2021-03-21T06:38:00.000Z
|
python/tests/test_events_service.py
|
benknoll-umn/mtap
|
67d506aa4ffc960acca1988ec12c5391c15ad736
|
[
"Apache-2.0"
] | 40
|
2019-10-14T17:02:54.000Z
|
2022-03-09T13:35:54.000Z
|
python/tests/test_events_service.py
|
benknoll-umn/mtap
|
67d506aa4ffc960acca1988ec12c5391c15ad736
|
[
"Apache-2.0"
] | 2
|
2019-10-14T15:42:46.000Z
|
2020-03-05T23:29:01.000Z
|
# Copyright 2019 Regents of the University of Minnesota.
#
# 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 grpc
import grpc_testing
import pytest
import mtap.data._base
from mtap._events_service import EventsServicer
from mtap.api.v1 import events_pb2
PHASERS = """Maybe if we felt any human loss as keenly as we feel one of those close to us, human
history would be far less bloody. The Enterprise computer system is controlled by three primary
main processor cores, cross-linked with a redundant melacortz ramistat, fourteen kiloquad interface
modules. Our neural pathways have become accustomed to your sensory input patterns. Mr. Worf, you
do remember how to fire phasers?"""
@pytest.fixture(name='events_server')
def fixture_events_server():
events_service = EventsServicer()
yield grpc_testing.server_from_dictionary(
{
events_pb2.DESCRIPTOR.services_by_name['Events']: events_service
},
grpc_testing.strict_real_time()
)
def test_OpenEvent(events_server: grpc_testing.Server):
request = events_pb2.OpenEventRequest(event_id='1')
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
request,
None
).termination()
assert response.created is True
def test_OpenEvent_without_id(events_server):
request = events_pb2.OpenEventRequest(event_id=None)
_, _, status_code, description = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.INVALID_ARGUMENT
assert description == 'event_id was not set.'
def test_OpenEvent_duplicate(events_server):
request = events_pb2.OpenEventRequest(event_id='1')
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
request,
None
)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
request,
None
).termination()
assert response.created is False
def test_OpenEvent_only_create(events_server):
request = events_pb2.OpenEventRequest(event_id='1', only_create_new=True)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
request,
None
).termination()
assert response.created is True
def test_OpenEvent_only_create_duplicate(events_server):
request = events_pb2.OpenEventRequest(event_id='1', only_create_new=True)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
request,
None
)
_, _, status_code, description = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.ALREADY_EXISTS
def test_CloseEvent_delete(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['CloseEvent'],
{},
events_pb2.CloseEventRequest(event_id='1'),
None
)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
).termination()
assert response.created is True
def test_CloseEvent_no_delete(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['CloseEvent'],
{},
events_pb2.CloseEventRequest(event_id='1'),
None
)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
).termination()
assert response.created is False
def test_AddMetadataBadEvent(events_server):
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddMetadata'],
{},
events_pb2.AddMetadataRequest(event_id='1', key='foo', value='bar'),
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_AddMetadata(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddMetadata'],
{},
events_pb2.AddMetadataRequest(event_id='1', key='foo', value='bar'),
None
).termination()
assert status_code == grpc.StatusCode.OK
def test_AddMetadata_EmptyKey(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddMetadata'],
{},
events_pb2.AddMetadataRequest(event_id='1', key='', value='bar'),
None
).termination()
assert status_code == grpc.StatusCode.INVALID_ARGUMENT
def test_AddMetadata_NoneKey(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddMetadata'],
{},
events_pb2.AddMetadataRequest(event_id='1', key=None, value='bar'),
None
).termination()
assert status_code == grpc.StatusCode.INVALID_ARGUMENT
def test_GetAllMetadata(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddMetadata'],
{},
events_pb2.AddMetadataRequest(event_id='1', key='foo', value='bar'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddMetadata'],
{},
events_pb2.AddMetadataRequest(event_id='1', key='baz', value='buh'),
None
)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetAllMetadata'],
{},
events_pb2.GetAllMetadataRequest(event_id='1'),
None
).termination()
d = dict(response.metadata)
assert d == {'foo': 'bar', 'baz': 'buh'}
def test_GetAllBinaryDataNames(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddBinaryData'],
{},
events_pb2.AddBinaryDataRequest(event_id='1',
binary_data_name='a',
binary_data=b'\xBF\xAF'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddBinaryData'],
{},
events_pb2.AddBinaryDataRequest(event_id='1',
binary_data_name='b',
binary_data=b'\xAF\xBF'),
None
)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetAllBinaryDataNames'],
{},
events_pb2.GetAllBinaryDataNamesRequest(event_id='1'),
None
).termination()
assert 'a' in response.binary_data_names
assert 'b' in response.binary_data_names
assert len(response.binary_data_names) == 2
def test_AddGetBinaryData(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddBinaryData'],
{},
events_pb2.AddBinaryDataRequest(event_id='1',
binary_data_name='a',
binary_data=b'\xBF\xAF'),
None
)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetBinaryData'],
{},
events_pb2.GetBinaryDataRequest(event_id='1', binary_data_name='a'),
None
).termination()
assert response.binary_data == b'\xBF\xAF'
def test_AddDocument_bad_event(events_server):
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_AddDocument(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
).termination()
assert status_code == grpc.StatusCode.OK
def test_AddDocument_empty_name(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='',
text=PHASERS),
None
).termination()
assert status_code == grpc.StatusCode.INVALID_ARGUMENT
def test_AddDocument_empty_text(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=''),
None
).termination()
assert status_code == grpc.StatusCode.OK
def test_AddDocument_exists(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
).termination()
assert status_code == grpc.StatusCode.ALREADY_EXISTS
def test_GetAllDocuments(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=''),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='other',
text=''),
None
)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetAllDocumentNames'],
{},
events_pb2.GetAllDocumentNamesRequest(event_id='1'),
None
).termination()
assert 'plaintext' in response.document_names
assert 'other' in response.document_names
assert len(response.document_names) == 2
def test_GetDocumentText_bad_event(events_server):
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetDocumentText'],
{},
events_pb2.GetDocumentTextRequest(event_id='1',
document_name='plaintext'),
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_GetDocumentText_bad_document(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetDocumentText'],
{},
events_pb2.GetDocumentTextRequest(event_id='1',
document_name='plaintext'),
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_GetDocumentText(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
response, _, _, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetDocumentText'],
{},
events_pb2.GetDocumentTextRequest(event_id='1',
document_name='plaintext'),
None
).termination()
assert response.text == PHASERS
def test_GetLabelIndicesInfo_bad_event(events_server):
request = events_pb2.GetLabelIndicesInfoRequest(event_id='1', document_name='plaintext')
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetLabelIndicesInfo'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_GetLabelIndicesInfo_bad_document(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
request = events_pb2.GetLabelIndicesInfoRequest(event_id='1', document_name='plaintext')
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetLabelIndicesInfo'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_GetLabelIndicesInfo(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
request = events_pb2.AddLabelsRequest(event_id='1',
document_name='plaintext',
index_name='labels')
s = request.generic_labels.labels.add()
s.start_index = 15
s.end_index = 20
s.fields['some_other_field'] = 'blah'
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddLabels'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.OK
request = events_pb2.GetLabelIndicesInfoRequest(event_id='1', document_name='plaintext')
res, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetLabelIndicesInfo'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.OK
assert len(res.label_index_infos) == 1
assert res.label_index_infos[0].index_name == 'labels'
assert res.label_index_infos[0].type == events_pb2.GetLabelIndicesInfoResponse.LabelIndexInfo.GENERIC
def test_AddLabels_bad_event(events_server):
request = events_pb2.AddLabelsRequest(event_id='1',
document_name='plaintext',
index_name='labels')
label = request.generic_labels.labels.add()
label.start_index = 15
label.end_index = 20
label.fields['some_other_field'] = 'blah'
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddLabels'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_AddLabels_bad_document(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
request = events_pb2.AddLabelsRequest(event_id='1',
document_name='plaintext',
index_name='labels')
label = request.generic_labels.labels.add()
label.start_index = 15
label.end_index = 20
label.fields['some_other_field'] = 'blah'
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddLabels'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_AddLabels_bad_index_name(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
request = events_pb2.AddLabelsRequest(event_id='1',
document_name='plaintext',
index_name='')
label = request.generic_labels.labels.add()
label.start_index = 15
label.end_index = 20
label.fields['some_other_field'] = 'blah'
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddLabels'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.INVALID_ARGUMENT
def test_AddLabels(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
request = events_pb2.AddLabelsRequest(event_id='1',
document_name='plaintext',
index_name='labels')
s = request.generic_labels.labels.add()
s.start_index = 15
s.end_index = 20
s.fields['some_other_field'] = 'blah'
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddLabels'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.OK
def test_AddLabels_no_labels(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
request = events_pb2.AddLabelsRequest(event_id='1',
document_name='plaintext',
index_name='labels')
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddLabels'],
{},
request,
None
).termination()
assert status_code == grpc.StatusCode.OK
def test_GetLabels_bad_event(events_server):
r = events_pb2.GetLabelsRequest(event_id='1', document_name='plaintext', index_name='labels')
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetLabels'],
{},
r,
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_GetLabels_bad_document_name(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
r = events_pb2.GetLabelsRequest(event_id='1', document_name='plaintext', index_name='labels')
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetLabels'],
{},
r,
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_GetLabels_bad_index_name(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
r = events_pb2.GetLabelsRequest(event_id='1', document_name='plaintext', index_name='labels')
_, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetLabels'],
{},
r,
None
).termination()
assert status_code == grpc.StatusCode.NOT_FOUND
def test_GetLabels_no_labels(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddLabels'],
{},
events_pb2.AddLabelsRequest(event_id='1',
document_name='plaintext',
index_name='labels'),
None
)
req = events_pb2.GetLabelsRequest(event_id='1', document_name='plaintext', index_name='labels')
res, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetLabels'],
{},
req,
None
).termination()
assert len(res.generic_labels.labels) == 0
def test_GetLabels(events_server):
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['OpenEvent'],
{},
events_pb2.OpenEventRequest(event_id='1'),
None
)
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddDocument'],
{},
events_pb2.AddDocumentRequest(event_id='1',
document_name='plaintext',
text=PHASERS),
None
)
request = events_pb2.AddLabelsRequest(event_id='1',
document_name='plaintext',
index_name='labels')
s = request.generic_labels.labels.add()
s.start_index = 15
s.end_index = 20
s.fields['some_other_field'] = 'blah'
events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['AddLabels'],
{},
request,
None
)
req = events_pb2.GetLabelsRequest(event_id='1', document_name='plaintext', index_name='labels')
res, _, status_code, _ = events_server.invoke_unary_unary(
events_pb2.DESCRIPTOR.services_by_name['Events'].methods_by_name['GetLabels'],
{},
req,
None
).termination()
assert len(res.generic_labels.labels) == 1
label = res.generic_labels.labels[0]
assert label.start_index == 15
assert label.end_index == 20
assert label.fields['some_other_field'] == 'blah'
| 36.860123
| 105
| 0.641457
| 3,218
| 30,041
| 5.590429
| 0.077067
| 0.085548
| 0.090828
| 0.129072
| 0.883324
| 0.874931
| 0.863869
| 0.858199
| 0.852807
| 0.850139
| 0
| 0.013247
| 0.251157
| 30,041
| 814
| 106
| 36.905405
| 0.786451
| 0.019174
| 0
| 0.800558
| 0
| 0
| 0.087026
| 0.000713
| 0
| 0
| 0
| 0
| 0.066946
| 1
| 0.051604
| false
| 0
| 0.008368
| 0
| 0.059972
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
edc1aaf5f89fbc16a91b0282770365aa56d41882
| 34,350
|
py
|
Python
|
tests/v3_api/test_harbor.py
|
TangStone/validation
|
6542f8248f0245ec7382952d7803d5d70fcfed3a
|
[
"Apache-2.0"
] | null | null | null |
tests/v3_api/test_harbor.py
|
TangStone/validation
|
6542f8248f0245ec7382952d7803d5d70fcfed3a
|
[
"Apache-2.0"
] | null | null | null |
tests/v3_api/test_harbor.py
|
TangStone/validation
|
6542f8248f0245ec7382952d7803d5d70fcfed3a
|
[
"Apache-2.0"
] | null | null | null |
import pytest
from .entfunc import *
namespace = {"client": None, "p_client": None, "ns": None, "cluster": None, "project": None}
CATTLE_HARBOR_CONFIG_URL = (CATTLE_API_URL + '/users?action=saveharborconfig').replace('//v3','/v3')
CATTLE_HARBOR_SERVER_URL = (CATTLE_API_URL + '/settings/harbor-server-url').replace('//v3','/v3')
CATTLE_HARBOR_ADMIN_AUTH = (CATTLE_API_URL + '/settings/harbor-admin-auth').replace('//v3','/v3')
CATTLE_HARBOR_AUTH_MODE = (CATTLE_API_URL + '/settings/harbor-auth-mode').replace('//v3','/v3')
RANCHER_HARBOR_URL = os.environ.get('RANCHER_HARBOR_URL', '')
RANCHER_HARBOR_URL_HTTPS = os.environ.get('RANCHER_HARBOR_URL_HTTPS', '')
#RANCHER_HARBOR_HOST = os.environ.get('RANCHER_HARBOR_HOST', RANCHER_HARBOR_URL.split('/')[2].split(':')[0])
RANCHER_HARBOR_HOST = os.environ.get('RANCHER_HARBOR_HOST', '')
RANCHER_HARBOR_ADMIN = os.environ.get('RANCHER_HARBOR_ADMIN', 'admin')
RANCHER_HARBOR_ADMIN_PASSWORD = os.environ.get('RANCHER_HARBOR_ADMIN_PASSWORD', 'Harbor12345')
RANCHER_HARBOR_PUBLIC_IMAGE = os.environ.get('RANCHER_HARBOR_PUBLIC_IMAGE', RANCHER_HARBOR_HOST + '/autotest-public/nginx')
RANCHER_HARBOR_PRIVATE_IMAGE = os.environ.get('RANCHER_HARBOR_PRIVATE_IMAGE', RANCHER_HARBOR_HOST + '/autotest-private/nginx')
RANCHER_USER_TOKEN = os.environ.get('RANCHER_USER_TOKEN', '')
RANCHER_USER = os.environ.get('RANCHER_USER', '')
RANCHER_HARBOR_URL_NEW = os.environ.get('RANCHER_HARBOR_URL_NEW', '')
#RANCHER_HARBOR_HOST_NEW = os.environ.get('RANCHER_HARBOR_HOST_NEW', RANCHER_HARBOR_URL_NEW.split('/')[2].split(':')[0])
RANCHER_HARBOR_HOST_NEW = os.environ.get('RANCHER_HARBOR_HOST_NEW', '')
RANCHER_HARBOR_ADMIN_NEW = os.environ.get('RANCHER_HARBOR_ADMIN_NEW', 'root')
RANCHER_HARBOR_ADMIN_PASSWORD_NEW = os.environ.get('RANCHER_HARBOR_ADMIN_PASSWORD_NEW', 'Harbor12345')
RANCHER_HARBOR_PRIVATE_IMAGE_NEW = os.environ.get('RANCHER_HARBOR_PRIVATE_IMAGE_NEW', RANCHER_HARBOR_HOST_NEW + '/autotest-private/nginx')
headers = {"cookie": "R_SESS="+ADMIN_TOKEN}
registries = {RANCHER_HARBOR_HOST: {}}
harbor_dockercredential_label = {"rancher.cn/registry-harbor-auth":"true",
"rancher.cn/registry-harbor-admin-auth":"true"}
harborcredential = pytest.mark.skipif(not RANCHER_HARBOR_URL,
reason='HARBOR URL Credentials not provided, '
'cannot set harbor')
harborhttpscredential = pytest.mark.skipif(not RANCHER_HARBOR_URL_HTTPS,
reason='HARBOR URL Credentials not provided, '
'cannot set harbor')
@harborcredential
def test_set_http_harborconfig():
harbor_config_r = set_harbor_config(RANCHER_HARBOR_ADMIN,
RANCHER_HARBOR_ADMIN_PASSWORD,
RANCHER_HARBOR_URL)
assert harbor_config_r.status_code == 200
harbor_server_r = set_harbor_server(RANCHER_HARBOR_URL)
assert harbor_server_r.status_code == 200
assert harbor_server_r.json()['value'] == RANCHER_HARBOR_URL
harbor_auth_r = set_harbor_auth(RANCHER_HARBOR_ADMIN)
assert harbor_auth_r.status_code == 200
assert harbor_auth_r.json()['value'] == RANCHER_HARBOR_ADMIN
harbor_mode_r = set_harbor_mode("db_auth")
assert harbor_mode_r.status_code == 200
assert harbor_mode_r.json()['value'] == "db_auth"
@harborhttpscredential
def test_set_https_harborconfig():
harbor_config_json = {"username": RANCHER_HARBOR_ADMIN,
"serverURL": RANCHER_HARBOR_URL_HTTPS,
"password": RANCHER_HARBOR_ADMIN_PASSWORD,
"responseType": "json"}
harbor_config_r = requests.post(CATTLE_HARBOR_CONFIG_URL,
json=harbor_config_json, verify=False, headers=headers)
print(harbor_config_r)
assert harbor_config_r.status_code == 200
harbor_server_json = {"value": RANCHER_HARBOR_URL_HTTPS,
"responseType": "json"}
harbor_server_r = requests.put(CATTLE_HARBOR_SERVER_URL,
json=harbor_server_json, verify=False, headers=headers)
print(harbor_server_r.json())
assert harbor_server_r.status_code == 200
assert harbor_config_r['value'] == RANCHER_HARBOR_URL_HTTPS
harbor_auth_json = {"value": RANCHER_HARBOR_ADMIN,
"responseType": "json"}
harbor_auth_r = requests.put(CATTLE_HARBOR_ADMIN_AUTH,
json=harbor_auth_json, verify=False, headers=headers)
print(harbor_auth_r.json())
assert harbor_auth_r.status_code == 200
assert harbor_auth_r['value'] == RANCHER_HARBOR_ADMIN
harbor_mode_json = {"value": "db_auth",
"responseType": "json"}
harbor_mode_r = requests.put(CATTLE_HARBOR_AUTH_MODE,
json=harbor_mode_json, verify=False, headers=headers)
print(harbor_mode_r.json())
assert harbor_mode_r.status_code == 200
assert harbor_mode_r['value'] == "db_auth"
@harborcredential
def test_error_user_password():
password = random_test_name('Harbor')
print('Error password: ' + password)
r = set_harbor_config(RANCHER_HARBOR_ADMIN,
RANCHER_HARBOR_URL,
password)
assert r.status_code == 410
assert r.json()['code'] == "SyncHarborFailed"
@harborcredential
def test_update_password():
client = namespace['client']
users = client.list_user(username="admin")
assert len(users) == 1
admin_user = users.data[0]
update_harbor_url = admin_user.actions["updateharborauth"]
newPassword = random_test_name("Harbor")
headers = {"cookie": "R_SESS=" + ADMIN_TOKEN, "x-api-harbor-admin-header": "true"}
r1 = update_harbor_password(newPassword,
RANCHER_HARBOR_ADMIN_PASSWORD,
update_harbor_url, headers)
assert r1.status_code == 200
assert_r = set_harbor_config(RANCHER_HARBOR_ADMIN,
newPassword,
RANCHER_HARBOR_URL)
assert assert_r.status_code == 200
r2 = update_harbor_password(RANCHER_HARBOR_ADMIN_PASSWORD,
newPassword,
update_harbor_url, headers)
assert r2.status_code == 200
@harborcredential
def test_user_setharborauth():
client = namespace['client']
users = client.list_user(username = RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
@harborcredential
def test_user_update_password():
client = namespace['client']
users = client.list_user(username = RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
updateharborauth_url = user.actions["updateharborauth"]
print(setharborauth_url)
print(updateharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
setharborauth_r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert setharborauth_r.status_code == 200
newPassword = random_test_name('Harbor')
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN, "x-api-harbor-admin-header": "false"}
r1 = update_harbor_password(newPassword,
RANCHER_HARBOR_ADMIN_PASSWORD,
updateharborauth_url, headers)
assert r1.status_code == 200
r2 = update_harbor_password(RANCHER_HARBOR_ADMIN_PASSWORD,
newPassword, updateharborauth_url, headers)
assert r2.status_code == 200
@harborcredential
def test_public_image_without_dockercredential():
client = namespace['client']
cluster = namespace['cluster']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl.state == 'active'
client.delete(project)
@harborcredential
def test_private_image_without_dockercredential():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
create_workload_unavailable(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
client.delete(project)
@harborcredential
def test_public_image_with_dockercredential():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
name = random_test_name("registry")
p_client.create_dockerCredential(registries=registries, name=name, labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl.state == 'active'
c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN)
ns1 = create_ns(c_client, cluster, project)
wl1 = create_workload(p_client, ns1, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl1.state == 'active'
client.delete(project)
@harborcredential
def test_private_image_with_dockercredential():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
name = random_test_name("registry")
p_client.create_dockerCredential(registries=registries, name=name, labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN)
ns1 = create_ns(c_client, cluster, project)
wl1 = create_workload(p_client, ns1, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl1.state == 'active'
client.delete(project)
@harborcredential
def test_public_image_with_namespacedDockerCredential():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
name = random_test_name("registry")
p_client.create_namespacedDockerCredential(registries=registries, name=name, namespaceId=ns.id,
labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl.state == 'active'
c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN)
ns1 = create_ns(c_client, cluster, project)
wl1 = create_workload(p_client, ns1, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl1.state == 'active'
client.delete(project)
@harborcredential
def test_private_image_with_namespacedDockerCredential():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
name = random_test_name("registry")
p_client.create_namespacedDockerCredential(registries=registries, name=name, namespaceId=ns.id,
labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN)
ns1 = create_ns(c_client, cluster, project)
create_workload_unavailable(p_client, ns1, RANCHER_HARBOR_PRIVATE_IMAGE)
client.delete(project)
@harborcredential
def test_update_password_with_dockerCredential():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
name = random_test_name("registry")
p_client.create_dockerCredential(registries=registries, name=name, labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
users = client.list_user(username="admin")
assert len(users) == 1
admin_user = users.data[0]
update_harbor_url = admin_user.actions["updateharborauth"]
newPassword = random_test_name("Harbor")
headers = {"cookie": "R_SESS=" + ADMIN_TOKEN, "x-api-harbor-admin-header": "true"}
r1 = update_harbor_password(newPassword,
RANCHER_HARBOR_ADMIN_PASSWORD,
update_harbor_url, headers)
assert r1.status_code == 200
assert_r = set_harbor_config(RANCHER_HARBOR_ADMIN,
newPassword,
RANCHER_HARBOR_URL)
assert assert_r.status_code == 200
wl2 = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl2.state == 'active'
r2 = update_harbor_password(RANCHER_HARBOR_ADMIN_PASSWORD,
newPassword,
update_harbor_url, headers)
assert r2.status_code == 200
client.delete(project)
@harborcredential
def test_update_password_with_namespacedDockerCredential():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
name = random_test_name("registry")
p_client.create_namespacedDockerCredential(registries=registries, name=name, namespaceId=ns.id,
labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
users = client.list_user(username="admin")
assert len(users) == 1
admin_user = users.data[0]
update_harbor_url = admin_user.actions["updateharborauth"]
newPassword = random_test_name("Harbor")
headers = {"cookie": "R_SESS=" + ADMIN_TOKEN, "x-api-harbor-admin-header": "true"}
r1 = update_harbor_password(newPassword,
RANCHER_HARBOR_ADMIN_PASSWORD,
update_harbor_url, headers)
assert r1.status_code == 200
assert_r = set_harbor_config(RANCHER_HARBOR_ADMIN,
newPassword,
RANCHER_HARBOR_URL)
assert assert_r.status_code == 200
wl2 = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl2.state == 'active'
r2 = update_harbor_password(RANCHER_HARBOR_ADMIN_PASSWORD,
newPassword,
update_harbor_url, headers)
assert r2.status_code == 200
client.delete(project)
@harborcredential
def test_user_public_image_without_dockercredential():
client = namespace['client']
cluster = namespace['cluster']
users = client.list_user(username = RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
project, ns = create_project_and_ns(RANCHER_USER_TOKEN, cluster)
p_client = get_project_client_for_token(project, RANCHER_USER_TOKEN)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl.state == 'active'
client.delete(project)
@harborcredential
def test_user_private_image_without_dockercredential():
client = namespace['client']
cluster = namespace['cluster']
users = client.list_user(username=RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
project, ns = create_project_and_ns(RANCHER_USER_TOKEN, cluster)
p_client = get_project_client_for_token(project, RANCHER_USER_TOKEN)
create_workload_unavailable(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
client.delete(project)
@harborcredential
def test_user_public_image_with_dockercredential():
client = namespace['client']
cluster = namespace['cluster']
users = client.list_user(username=RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
project, ns = create_project_and_ns(RANCHER_USER_TOKEN, cluster)
p_client = get_project_client_for_token(project, RANCHER_USER_TOKEN)
name = random_test_name("registry")
p_client.create_dockerCredential(registries=registries, name=name, labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl.state == 'active'
c_client = get_cluster_client_for_token(cluster, RANCHER_USER_TOKEN)
ns2 = create_ns(c_client, cluster, project)
wl2 = create_workload(p_client, ns2, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl2.state == 'active'
client.delete(project)
@harborcredential
def test_user_private_image_with_dockercredential():
client = namespace['client']
cluster = namespace['cluster']
users = client.list_user(username=RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
project, ns = create_project_and_ns(RANCHER_USER_TOKEN, cluster)
p_client = get_project_client_for_token(project, RANCHER_USER_TOKEN)
name = random_test_name("registry")
p_client.create_dockerCredential(registries=registries, name=name, labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
c_client = get_cluster_client_for_token(cluster, RANCHER_USER_TOKEN)
ns2 = create_ns(c_client, cluster, project)
wl2 = create_workload(p_client, ns2, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl2.state == 'active'
client.delete(project)
@harborcredential
def test_user_public_image_with_namespacedDockerCredential():
client = namespace['client']
cluster = namespace['cluster']
users = client.list_user(username=RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
project, ns = create_project_and_ns(RANCHER_USER_TOKEN, cluster)
p_client = get_project_client_for_token(project, RANCHER_USER_TOKEN)
name = random_test_name("registry")
p_client.create_namespacedDockerCredential(registries=registries, name=name, namespaceId=ns.id,
labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl.state == 'active'
c_client = get_cluster_client_for_token(cluster, RANCHER_USER_TOKEN)
ns2 = create_ns(c_client, cluster, project)
wl2 = create_workload(p_client, ns2, RANCHER_HARBOR_PUBLIC_IMAGE)
assert wl2.state == 'active'
client.delete(project)
@harborcredential
def test_user_private_image_with_namespacedDockerCredential():
client = namespace['client']
cluster = namespace['cluster']
users = client.list_user(username=RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
project, ns = create_project_and_ns(RANCHER_USER_TOKEN, cluster)
p_client = get_project_client_for_token(project, RANCHER_USER_TOKEN)
name = random_test_name("registry")
p_client.create_namespacedDockerCredential(registries=registries, name=name, namespaceId=ns.id,
labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
c_client = get_cluster_client_for_token(cluster, RANCHER_USER_TOKEN)
ns2 = create_ns(c_client, cluster, project)
create_workload_unavailable(p_client, ns2, RANCHER_HARBOR_PRIVATE_IMAGE)
client.delete(project)
@harborcredential
def test_user_update_password_with_dockerCredential():
client = namespace['client']
cluster = namespace['cluster']
users = client.list_user(username=RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
project, ns = create_project_and_ns(RANCHER_USER_TOKEN, cluster)
p_client = get_project_client_for_token(project, RANCHER_USER_TOKEN)
name = random_test_name("registry")
p_client.create_dockerCredential(registries=registries, name=name,
labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
update_harbor_url = user.actions["updateharborauth"]
newPassword = random_test_name("Harbor")
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN,"x-api-harbor-admin-header": "false"}
r1 = update_harbor_password(newPassword,
RANCHER_HARBOR_ADMIN_PASSWORD,
update_harbor_url, headers)
assert r1.status_code == 200
wl2 = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl2.state == "active"
r2 = update_harbor_password(RANCHER_HARBOR_ADMIN_PASSWORD,
newPassword,
update_harbor_url, headers)
assert r2.status_code == 200
client.delete(project)
@harborcredential
def test_user_update_password_with_namespacedDockerCredential():
client = namespace['client']
cluster = namespace['cluster']
users = client.list_user(username=RANCHER_USER)
assert len(users) == 1
user = users.data[0]
setharborauth_url = user.actions['setharborauth']
print(setharborauth_url)
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN}
r = set_user_harborauth(RANCHER_USER,
RANCHER_HARBOR_ADMIN_PASSWORD,
setharborauth_url, headers)
assert r.status_code == 200
project, ns = create_project_and_ns(RANCHER_USER_TOKEN, cluster)
p_client = get_project_client_for_token(project, RANCHER_USER_TOKEN)
name = random_test_name("registry")
p_client.create_namespacedDockerCredential(registries=registries, name=name, namespaceId=ns.id,
labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
update_harbor_url = user.actions["updateharborauth"]
newPassword = random_test_name("Harbor")
headers = {"cookie": "R_SESS=" + RANCHER_USER_TOKEN, "x-api-harbor-admin-header": "false"}
r1 = update_harbor_password(newPassword,
RANCHER_HARBOR_ADMIN_PASSWORD,
update_harbor_url, headers)
assert r1.status_code == 200
wl2 = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl2.state == "active"
r2 = update_harbor_password(RANCHER_HARBOR_ADMIN_PASSWORD,
newPassword,
update_harbor_url, headers)
assert r2.status_code == 200
client.delete(project)
@harborcredential
def test_update_harbor_with_old_registries():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
name = random_test_name("registry")
p_client.create_dockerCredential(registries=registries, name=name, labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
harbor_config_r = set_harbor_config(RANCHER_HARBOR_ADMIN_NEW,
RANCHER_HARBOR_ADMIN_PASSWORD_NEW,
RANCHER_HARBOR_URL_NEW)
assert harbor_config_r.status_code == 200
harbor_server_r = set_harbor_server(RANCHER_HARBOR_URL_NEW)
assert harbor_server_r.status_code == 200
assert harbor_server_r.json()['value'] == RANCHER_HARBOR_URL_NEW
harbor_auth_r = set_harbor_auth(RANCHER_HARBOR_ADMIN_NEW)
assert harbor_auth_r.status_code == 200
assert harbor_auth_r.json()['value'] == RANCHER_HARBOR_ADMIN_NEW
harbor_mode_r = set_harbor_mode("db_auth")
assert harbor_mode_r.status_code == 200
assert harbor_mode_r.json()['value'] == "db_auth"
create_workload_unavailable(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
client.delete(project)
harbor_config_r = set_harbor_config(RANCHER_HARBOR_ADMIN,
RANCHER_HARBOR_ADMIN_PASSWORD,
RANCHER_HARBOR_URL)
assert harbor_config_r.status_code == 200
harbor_server_r = set_harbor_server(RANCHER_HARBOR_URL)
assert harbor_server_r.status_code == 200
assert harbor_server_r.json()['value'] == RANCHER_HARBOR_URL
harbor_auth_r = set_harbor_auth(RANCHER_HARBOR_ADMIN)
assert harbor_auth_r.status_code == 200
assert harbor_auth_r.json()['value'] == RANCHER_HARBOR_ADMIN
harbor_mode_r = set_harbor_mode("db_auth")
assert harbor_mode_r.status_code == 200
assert harbor_mode_r.json()['value'] == "db_auth"
@harborcredential
def test_update_harbor_with_new_registries():
cluster = namespace['cluster']
client = namespace['client']
project, ns = create_project_and_ns(ADMIN_TOKEN, cluster)
p_client = get_project_client_for_token(project, ADMIN_TOKEN)
name = random_test_name("registry")
p_client.create_dockerCredential(registries=registries, name=name, labels=harbor_dockercredential_label)
wl = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE)
assert wl.state == 'active'
harbor_config_r = set_harbor_config(RANCHER_HARBOR_ADMIN_NEW,
RANCHER_HARBOR_ADMIN_PASSWORD_NEW,
RANCHER_HARBOR_URL_NEW)
assert harbor_config_r.status_code == 200
harbor_server_r = set_harbor_server(RANCHER_HARBOR_URL_NEW)
assert harbor_server_r.status_code == 200
assert harbor_server_r.json()['value'] == RANCHER_HARBOR_URL_NEW
harbor_auth_r = set_harbor_auth(RANCHER_HARBOR_ADMIN_NEW)
assert harbor_auth_r.status_code == 200
assert harbor_auth_r.json()['value'] == RANCHER_HARBOR_ADMIN_NEW
harbor_mode_r = set_harbor_mode("db_auth")
assert harbor_mode_r.status_code == 200
assert harbor_mode_r.json()['value'] == "db_auth"
name2 = random_test_name("registry")
registries2 = {RANCHER_HARBOR_HOST_NEW:{}}
p_client.create_dockerCredential(registries=registries2, name=name2, labels=harbor_dockercredential_label)
wl2 = create_workload(p_client, ns, RANCHER_HARBOR_PRIVATE_IMAGE_NEW)
assert wl2.state == 'active'
client.delete(project)
@harborcredential
def test_delete_harborconfig():
harbor_server_r = set_harbor_server('')
assert harbor_server_r.status_code == 200
assert harbor_server_r.json()['value'] == ''
harbor_auth_r = set_harbor_auth('')
assert harbor_auth_r.status_code == 200
assert harbor_auth_r.json()['value'] == ''
harbor_mode_r = set_harbor_mode('')
assert harbor_mode_r.status_code == 200
assert harbor_mode_r.json()['value'] == ''
@pytest.fixture(scope='module', autouse="True")
def create_project_client(request):
client, cluster = get_admin_client_and_cluster()
create_kubeconfig(cluster)
p, ns = create_project_and_ns(
ADMIN_TOKEN, cluster, random_test_name("testharbor"))
p_client = get_project_client_for_token(p, ADMIN_TOKEN)
namespace["client"] = client
namespace["p_client"] = p_client
namespace["ns"] = ns
namespace["cluster"] = cluster
namespace["project"] = p
def fin():
client = get_admin_client()
time.sleep(30)
client.delete(namespace["project"])
request.addfinalizer(fin)
def create_workload(p_client, ns, image):
workload_name = random_test_name("harbor")
con = [{"name": "test",
"image": image,
"runAsNonRoot": False,
"stdin": True,
"imagePullPolicy": "Always",
}]
workload = p_client.create_workload(name=workload_name,
containers=con,
namespaceId=ns.id)
workload = wait_for_wl_to_active(p_client, workload, timeout=90)
return workload
def create_workload_unavailable(p_client, ns, image):
workload_name = random_test_name("harbor")
con = [{"name": "test",
"image": image,
"runAsNonRoot": False,
"stdin": True,
"imagePullPolicy": "Always",
}]
workload = p_client.create_workload(name=workload_name,
containers=con,
namespaceId=ns.id)
events = wait_for_wl_unavailable(p_client, workload, ['ImagePullBackOff', 'ErrImagePull'], timeout=60)
return events
def wait_for_wl_unavailable(p_client, workload, reasons, timeout):
pods = p_client.list_pod(workloadId=workload.id).data
start = time.time()
while len(pods) == 0 and (time.time() - start) < 30 :
pods = p_client.list_pod(workloadId=workload.id).data
assert len(pods) > 0
p = pods[0]
start = time.time()
while p.state != "running":
if time.time() - start > timeout:
containerStatuses = p.status.containerStatuses[0]
print(containerStatuses)
assert containerStatuses.ready == False
assert containerStatuses.started == False
reason = containerStatuses.state.waiting.reason
exist = False
for r in reasons:
if r == reason:
exist = True
assert exist == True
break
time.sleep(.5)
pods = p_client.list_pod(uuid=p.uuid).data
assert len(pods) == 1
p = pods[0]
assert p.state != "running"
def set_harbor_config(username, password, harbor_url, headers = headers):
harbor_config_json = {"username": username,
"serverURL": harbor_url,
"password": password,
"responseType": "json"}
r = requests.post(CATTLE_HARBOR_CONFIG_URL,
json=harbor_config_json, verify=False, headers=headers)
print(r)
return r
def set_harbor_server(harbor_url, headers = headers):
harbor_server_json = {"value": harbor_url,
"responseType": "json"}
r = requests.put(CATTLE_HARBOR_SERVER_URL,
json=harbor_server_json, verify=False, headers=headers)
print(r.json())
return r
def set_harbor_auth(admin, headers = headers):
harbor_auth_json = {"value": admin,
"responseType": "json"}
r = requests.put(CATTLE_HARBOR_ADMIN_AUTH,
json=harbor_auth_json, verify=False, headers=headers)
print(r.json())
return r
def set_harbor_mode(mode, headers = headers):
harbor_mode_json = {"value": mode,
"responseType": "json"}
r = requests.put(CATTLE_HARBOR_AUTH_MODE,
json=harbor_mode_json, verify=False, headers=headers)
print(r.json())
return r
def update_harbor_password(newPassword, oldPassword, url, headers):
update_json = {"newPassword": newPassword,
"oldPassword": oldPassword,
"responseType": "json"}
r = requests.post(url, json=update_json, verify=False, headers=headers)
return r
def set_user_harborauth(username, password, url, headers):
json = {"username": username,
"password": password,
"email": random_name() + "@rancher.com",
"responseType": "json"}
r = requests.post(url,
json=json, verify=False, headers=headers)
return r
| 40.364277
| 138
| 0.68099
| 4,001
| 34,350
| 5.467633
| 0.043739
| 0.079631
| 0.044432
| 0.023039
| 0.876029
| 0.84531
| 0.827025
| 0.796855
| 0.793152
| 0.776833
| 0
| 0.010378
| 0.225764
| 34,350
| 851
| 139
| 40.364277
| 0.812183
| 0.006579
| 0
| 0.758772
| 0
| 0
| 0.079096
| 0.018697
| 0
| 0
| 0
| 0
| 0.171053
| 1
| 0.052632
| false
| 0.097953
| 0.002924
| 0
| 0.067251
| 0.030702
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 8
|
edf8ac1929e6955eb653f62e6fe718e49d77f4b7
| 16,146
|
py
|
Python
|
deep_rl/network/network_bodies.py
|
Marianoetchart/DeepRL
|
40d4825694c0890440859166de56701fc1f61d5b
|
[
"Apache-2.0"
] | null | null | null |
deep_rl/network/network_bodies.py
|
Marianoetchart/DeepRL
|
40d4825694c0890440859166de56701fc1f61d5b
|
[
"Apache-2.0"
] | null | null | null |
deep_rl/network/network_bodies.py
|
Marianoetchart/DeepRL
|
40d4825694c0890440859166de56701fc1f61d5b
|
[
"Apache-2.0"
] | null | null | null |
#######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
#######################################################################
from .network_utils import *
import time
class NatureConvBody(nn.Module):
def __init__(self, in_channels=4):
super(NatureConvBody, self).__init__()
self.feature_dim = 512
self.conv1 = layer_init(nn.Conv2d(in_channels, 32, kernel_size=8, stride=4))
self.conv2 = layer_init(nn.Conv2d(32, 64, kernel_size=4, stride=2))
self.conv3 = layer_init(nn.Conv2d(64, 64, kernel_size=3, stride=1))
self.fc4 = layer_init(nn.Linear(7 * 7 * 64, self.feature_dim))
def forward(self, x):
y = F.relu(self.conv1(x))
y = F.relu(self.conv2(y))
y = F.relu(self.conv3(y))
y = y.view(y.size(0), -1)
y = F.relu(self.fc4(y))
return y
class DRQNBody(nn.Module):
def __init__(self, in_channels=4):
super(DRQNBody, self).__init__()
self.feature_dim = 512
self.rnn_input_dim = 7*7*64
self.batch_size = 1
self.num_layers = 1
self.unroll = 4
in_channels = 1 # for 1 frame input
self.conv1 = layer_init(nn.Conv2d(in_channels, 32, kernel_size=8, stride=4))
self.conv2 = layer_init(nn.Conv2d(32, 64, kernel_size=4, stride=2))
self.conv3 = layer_init(nn.Conv2d(64, 64, kernel_size=3, stride=1))
self.lstm = nn.LSTM(self.rnn_input_dim, self.feature_dim , num_layers = self.num_layers)
self.hidden = self.init_hidden()
self.reset_flag = False
def init_hidden(self, num_layers = 1, batch = 1):
# initializing the hidden and cell states
if str(Config.DEVICE) == 'cpu':
return (autograd.Variable(torch.zeros(num_layers, batch,self.feature_dim)),
autograd.Variable(torch.zeros(num_layers, batch, self.feature_dim)))
else:
return (autograd.Variable(torch.zeros(num_layers, batch,self.feature_dim)).cuda(),
autograd.Variable(torch.zeros(num_layers, batch, self.feature_dim)).cuda())
def repackage_hidden(self, h):
if isinstance(h, torch.Tensor):
return h.detach()
else:
return tuple(self.repackage_hidden(state) for state in h)
def forward(self, x):
if self.reset_flag:
self.hidden = self.repackage_hidden(self.hidden)
self.reset_flag = False
batch = x.size(0)
output = torch.Tensor()
ycat = torch.Tensor()
xchunks= torch.chunk(x,self.unroll, 1)
self.hidden = self.init_hidden(num_layers=1, batch = batch)
for ts in range(len(xchunks)):
y = F.relu(self.conv1(xchunks[ts]))
y = F.relu(self.conv2(y))
y = F.relu(self.conv3(y))
y = y.view(batch, -1) # flattening
yinput = y.view(-1, batch, self.rnn_input_dim) # Adding dimention
#self.lstm.flatten_parameters()
output, self.hidden = self.lstm(yinput, self.hidden)#output_chunks[yt], self.hidden)
y = output.view(batch, -1)
return y
class SpatialAttDRQNBody(nn.Module):
def __init__(self, in_channels=4):
super(SpatialAttDRQNBody, self).__init__()
self.feature_dim = 256
self.rnn_input_dim = 256
self.batch_size = 1
self.num_layers = 1
self.unroll = 4
in_channels = 1 # for 1 column
self.conv1 = layer_init(nn.Conv2d(in_channels, 32, kernel_size=8, stride=4))
self.conv2 = layer_init(nn.Conv2d(32, 64, kernel_size=4, stride=2))
self.conv3 = layer_init(nn.Conv2d(64, 256, kernel_size=3, stride=1))
self.att1 = nn.Conv2d(self.feature_dim, self.feature_dim, kernel_size=1, stride=1)
self.att2 = nn.Conv2d(self.feature_dim, self.feature_dim, kernel_size=1, stride=1)
self.w_hidden = nn.Linear(self.feature_dim, self.feature_dim, bias = False)
self.lstm = nn.LSTM(self.rnn_input_dim, self.feature_dim, num_layers = self.num_layers)
self.hidden = self.init_hidden()
self.reset_flag = False
def init_hidden(self, num_layers = 1, batch = 1):
# initializing the hidden and cell states
if str(Config.DEVICE) == 'cpu':
return (autograd.Variable(torch.zeros(num_layers, batch,self.feature_dim)),
autograd.Variable(torch.zeros(num_layers, batch, self.feature_dim)))
else:
return (autograd.Variable(torch.zeros(num_layers, batch,self.feature_dim)).cuda(),
autograd.Variable(torch.zeros(num_layers, batch, self.feature_dim)).cuda())
def repackage_hidden(self, h):
if isinstance(h, torch.Tensor):
return h.detach()
else:
return tuple(self.repackage_hidden(state) for state in h)
def forward(self, x):
if self.reset_flag:
#self.hidden = self.repackage_hidden(self.hidden)
self.reset_flag = False
batch = x.size(0)
xchunks= torch.chunk(x,self.unroll, 1)
self.hidden = self.init_hidden(num_layers = self.num_layers, batch = batch)
for ts in range(len(xchunks)):
torch.set_printoptions(threshold=50000)
y = F.relu(self.conv1(xchunks[ts]))
y = F.relu(self.conv2(y))
y = F.relu(self.conv3(y))
#y = y.view(batch, -1, self.feature_dim).detach() # (batch) x 49 (input vector) x 256 (dimension)
hidden= self.hidden[0].view(batch,self.feature_dim).detach() # reshaping hidden state
# Attention Network
ht_1 = self.w_hidden(hidden)
xt_1 = self.att1(y)
ht_1 = ht_1.unsqueeze(2).unsqueeze(3) #.view(batch,self.feature_dim,-1,1)
ht_1 = ht_1.expand_as(xt_1)
combined_att = torch.add(ht_1, xt_1)
combined_att = F.tanh(combined_att)
combined_att2 = self.att2(combined_att)
combined_att2 = combined_att2.view(batch, self.feature_dim,-1)
goutput = combined_att2.softmax(dim=2)#F.softmax(combined_att2, dim=1)
goutput = goutput.view(goutput.size(0),self.feature_dim, -1)
y = y.view(batch, self.feature_dim,-1)
context = (goutput*y)
context= context.sum(2)
#context = context / self.feature_dim
#context = y * context
context = context.view(-1, batch, self.rnn_input_dim) # Adding dimension for lstm
#self.hidden = self.repackage_hidden(self.hidden) # repackage hidden
output, self.hidden = self.lstm(context, self.hidden) #LSTM
y = output.view(batch, -1) # flattens output
return y
class TempAttDRQNBody(nn.Module):
def __init__(self, in_channels=4):
super(TempAttDRQNBody, self).__init__()
self.feature_dim = 512
self.rnn_input_dim = 7*7*64
self.batch_size = 1
self.num_layers = 1
self.unroll = 4
in_channels = 1 # for 1 frame input
self.conv1 = layer_init(nn.Conv2d(in_channels, 32, kernel_size=8, stride=4))
self.conv2 = layer_init(nn.Conv2d(32, 64, kernel_size=4, stride=2))
self.conv3 = layer_init(nn.Conv2d(64, 64, kernel_size=3, stride=1))
self.w_temporal = nn.Linear(self.feature_dim, self.feature_dim, bias = False)
self.lstm = nn.LSTM(self.rnn_input_dim, self.feature_dim , num_layers = self.num_layers)
self.hidden = self.init_hidden()
self.reset_flag = False
def init_hidden(self, num_layers = 1, batch = 1):
# initializing the hidden and cell states
if str(Config.DEVICE) == 'cpu':
return (autograd.Variable(torch.zeros(num_layers, batch,self.feature_dim)),
autograd.Variable(torch.zeros(num_layers, batch, self.feature_dim)))
else:
return (autograd.Variable(torch.zeros(num_layers, batch,self.feature_dim)).cuda(),
autograd.Variable(torch.zeros(num_layers, batch, self.feature_dim)).cuda())
def repackage_hidden(self, h):
if isinstance(h, torch.Tensor):
return h.detach()
else:
return tuple(self.repackage_hidden(state) for state in h)
def forward(self, x):
if self.reset_flag:
self.hidden = self.repackage_hidden(self.hidden)
self.reset_flag = False
batch = x.size(0)
output = torch.Tensor()
ycat = torch.Tensor()
xchunks= torch.chunk(x,self.unroll, 1)
self.hidden = self.init_hidden(num_layers=1, batch = batch)
for ts in range(len(xchunks)):
y = F.relu(self.conv1(xchunks[ts]))
y = F.relu(self.conv2(y))
y = F.relu(self.conv3(y))
y = y.view(batch, -1) # flattening
yinput = y.view(-1, batch, self.rnn_input_dim) # Adding dimention
#self.lstm.flatten_parameters()
hidden = self.hidden[0]
hidden_temporal = self.w_temporal(hidden)
hidden_temporal = F.tanh(torch.add(hidden,hidden_temporal)).softmax(dim = 2)
context_hidden = (hidden_temporal*hidden).sum(0) #inner product
context_hidden = context_hidden.unsqueeze(0) # adding dimension for layer_num
self.hidden = (context_hidden, self.hidden[1]) # repackaging hidden state
output, self.hidden = self.lstm(yinput, self.hidden)#output_chunks[yt], self.hidden)
y = output.view(batch, -1)
return y
class SpatTempAttDRQNBody(nn.Module):
def __init__(self, in_channels=4):
super(SpatTempAttDRQNBody, self).__init__()
self.feature_dim = 256
self.rnn_input_dim = 256
self.batch_size = 1
self.num_layers = 1
self.unroll = 4
in_channels = 1 # for 1 column
self.conv1 = layer_init(nn.Conv2d(in_channels, 32, kernel_size=8, stride=4))
self.conv2 = layer_init(nn.Conv2d(32, 64, kernel_size=4, stride=2))
self.conv3 = layer_init(nn.Conv2d(64, 256, kernel_size=3, stride=1))
self.att1 = nn.Conv2d(self.feature_dim, self.feature_dim, kernel_size=1, stride=1)
self.att2 = nn.Conv2d(self.feature_dim, self.feature_dim, kernel_size=1, stride=1)
self.w_hidden = nn.Linear(self.feature_dim, self.feature_dim, bias = False)
self.w_temporal = nn.Linear(self.feature_dim, self.feature_dim, bias = False)
self.lstm = nn.LSTM(self.rnn_input_dim, self.feature_dim, num_layers = self.num_layers)
self.hidden = self.init_hidden()
self.reset_flag = False
def init_hidden(self, num_layers = 1, batch = 1):
# initializing the hidden and cell states
if str(Config.DEVICE) == 'cpu':
return (autograd.Variable(torch.zeros(num_layers, batch,self.feature_dim)),
autograd.Variable(torch.zeros(num_layers, batch, self.feature_dim)))
else:
return (autograd.Variable(torch.zeros(num_layers, batch,self.feature_dim)).cuda(),
autograd.Variable(torch.zeros(num_layers, batch, self.feature_dim)).cuda())
def repackage_hidden(self, h):
if isinstance(h, torch.Tensor):
return h.detach()
else:
return tuple(self.repackage_hidden(state) for state in h)
def forward(self, x):
if self.reset_flag:
#self.hidden = self.repackage_hidden(self.hidden)
self.reset_flag = False
batch = x.size(0)
xchunks= torch.chunk(x,self.unroll, 1)
self.hidden = self.init_hidden(num_layers = self.num_layers, batch = batch)
for ts in range(len(xchunks)):
torch.set_printoptions(threshold=50000)
y = F.relu(self.conv1(xchunks[ts]))
y = F.relu(self.conv2(y))
y = F.relu(self.conv3(y))
#y = y.view(batch, -1, self.feature_dim).detach() # (batch) x 49 (input vector) x 256 (dimension)
hidden= self.hidden[0].view(batch,self.feature_dim).detach() # reshaping hidden state
# Spatial Attention Network
ht_1 = self.w_hidden(hidden)
xt_1 = self.att1(y)
ht_1 = ht_1.unsqueeze(2).unsqueeze(3) #.view(batch,self.feature_dim,-1,1)
ht_1 = ht_1.expand_as(xt_1)
combined_att = torch.add(ht_1, xt_1)
combined_att = F.tanh(combined_att)
combined_att2 = self.att2(combined_att)
combined_att2 = combined_att2.view(batch, self.feature_dim,-1)
goutput = combined_att2.softmax(dim=2)#F.softmax(combined_att2, dim=1)
goutput = goutput.view(goutput.size(0),self.feature_dim, -1)
y = y.view(batch, self.feature_dim,-1)
context = (goutput*y)
context= context.sum(2)
#context = context / self.feature_dim
#context = y * context
context = context.view(-1, batch, self.rnn_input_dim) # Adding dimension for lstm
# Temporal Attention Network
hidden = self.hidden[0]
hidden_temporal = self.w_temporal(hidden)
hidden_temporal = F.tanh(torch.add(hidden,hidden_temporal)).softmax(dim = 2)
context_hidden = (hidden_temporal*hidden).sum(0) #inner product
context_hidden = context_hidden.unsqueeze(0) # adding dimension for layer_num
self.hidden = (context_hidden, self.hidden[1]) # repackaging hidden state
output, self.hidden = self.lstm(context, self.hidden) #LSTM
y = output.view(batch, -1) # flattens output
return y
class DDPGConvBody(nn.Module):
def __init__(self, in_channels=4):
super(DDPGConvBody, self).__init__()
self.feature_dim = 39 * 39 * 32
self.conv1 = layer_init(nn.Conv2d(in_channels, 32, kernel_size=3, stride=2))
self.conv2 = layer_init(nn.Conv2d(32, 32, kernel_size=3))
def forward(self, x):
y = F.elu(self.conv1(x))
y = F.elu(self.conv2(y))
y = y.view(y.size(0), -1)
return y
class FCBody(nn.Module):
def __init__(self, state_dim, hidden_units=(64, 64), gate=F.relu):
super(FCBody, self).__init__()
dims = (state_dim, ) + hidden_units
self.layers = nn.ModuleList([layer_init(nn.Linear(dim_in, dim_out)) for dim_in, dim_out in zip(dims[:-1], dims[1:])])
self.gate = gate
self.feature_dim = dims[-1]
def forward(self, x):
for layer in self.layers:
x = self.gate(layer(x))
return x
class TwoLayerFCBodyWithAction(nn.Module):
def __init__(self, state_dim, action_dim, hidden_units=(64, 64), gate=F.relu):
super(TwoLayerFCBodyWithAction, self).__init__()
hidden_size1, hidden_size2 = hidden_units
self.fc1 = layer_init(nn.Linear(state_dim, hidden_size1))
self.fc2 = layer_init(nn.Linear(hidden_size1 + action_dim, hidden_size2))
self.gate = gate
self.feature_dim = hidden_size2
def forward(self, x, action):
x = self.gate(self.fc1(x))
phi = self.gate(self.fc2(torch.cat([x, action], dim=1)))
return phi
class OneLayerFCBodyWithAction(nn.Module):
def __init__(self, state_dim, action_dim, hidden_units, gate=F.relu):
super(OneLayerFCBodyWithAction, self).__init__()
self.fc_s = layer_init(nn.Linear(state_dim, hidden_units))
self.fc_a = layer_init(nn.Linear(action_dim, hidden_units))
self.gate = gate
self.feature_dim = hidden_units * 2
def forward(self, x, action):
phi = self.gate(torch.cat([self.fc_s(x), self.fc_a(action)], dim=1))
return phi
class DummyBody(nn.Module):
def __init__(self, state_dim):
super(DummyBody, self).__init__()
self.feature_dim = state_dim
def forward(self, x):
return x
| 42.377953
| 125
| 0.609191
| 2,182
| 16,146
| 4.320348
| 0.081118
| 0.071179
| 0.090591
| 0.048372
| 0.889254
| 0.870691
| 0.859234
| 0.830699
| 0.828471
| 0.800891
| 0
| 0.031368
| 0.263533
| 16,146
| 380
| 126
| 42.489474
| 0.761416
| 0.096309
| 0
| 0.82699
| 0
| 0
| 0.000834
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.096886
| false
| 0
| 0.00692
| 0.00346
| 0.228374
| 0.00692
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
1e9136d06ac4126f599efba5346963ab61277a5e
| 931
|
py
|
Python
|
LinkPrediction/DatasetTrainTestDBLP/createPickleFile.py
|
GiDiPa/LinkPredictionCo-AuthorNetworks
|
d4b7ec6e40102a99c5d659f8cd5729a6b0e7179e
|
[
"MIT"
] | null | null | null |
LinkPrediction/DatasetTrainTestDBLP/createPickleFile.py
|
GiDiPa/LinkPredictionCo-AuthorNetworks
|
d4b7ec6e40102a99c5d659f8cd5729a6b0e7179e
|
[
"MIT"
] | null | null | null |
LinkPrediction/DatasetTrainTestDBLP/createPickleFile.py
|
GiDiPa/LinkPredictionCo-AuthorNetworks
|
d4b7ec6e40102a99c5d659f8cd5729a6b0e7179e
|
[
"MIT"
] | null | null | null |
import networkx as nx
import pickle
''''''
path_file = '/home/dplz/PythonProject/LinkPrediction DBLP/LinkPrediction/DatasetTrainTest/GeneratedData/training.gml'
G = nx.read_gml(path_file)
pickle.dump(G, open('GeneratedData/GTraining.pkl', 'wb'))
path_file = '/home/dplz/PythonProject/LinkPrediction DBLP/LinkPrediction/DatasetTrainTest/GeneratedData/test.gml'
G = nx.read_gml(path_file)
pickle.dump(G, open('GeneratedData/GTest.pkl', 'wb'))
#G = pickle.load(open('GeneratedData/GTraining.pkl', 'rb'))
#G = nx.convert_node_labels_to_integers(G, first_label=0, ordering='default', label_attribute = 'name_label')
#pickle.dump(G, open('GeneratedData/GTrainingIndexedWithLabel.pkl', 'wb'))
#G = pickle.load(open('GeneratedData/GTest.pkl', 'rb'))
#G = nx.convert_node_labels_to_integers(G, first_label=0, ordering='default', label_attribute = 'name_label')
#pickle.dump(G, open('GeneratedData/GTestIndexedWithLabel.pkl', 'wb'))
| 38.791667
| 117
| 0.769066
| 124
| 931
| 5.612903
| 0.330645
| 0.146552
| 0.063218
| 0.086207
| 0.818966
| 0.818966
| 0.818966
| 0.724138
| 0.724138
| 0.724138
| 0
| 0.002309
| 0.069817
| 931
| 24
| 118
| 38.791667
| 0.801386
| 0.504834
| 0
| 0.25
| 1
| 0
| 0.568889
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 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
| 1
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
1ebc4973219e3a32a94a700da6a467fe13575dc1
| 167
|
py
|
Python
|
test/gdsctools/test_tools.py
|
Donnyvdm/gdsctools
|
164ccd284e33202117f505210af96ae44d819203
|
[
"Python-2.0",
"OLDAP-2.7"
] | 28
|
2016-03-19T14:43:00.000Z
|
2022-02-26T14:48:02.000Z
|
test/gdsctools/test_tools.py
|
Donnyvdm/gdsctools
|
164ccd284e33202117f505210af96ae44d819203
|
[
"Python-2.0",
"OLDAP-2.7"
] | 182
|
2015-10-14T10:42:41.000Z
|
2022-01-06T16:17:14.000Z
|
test/gdsctools/test_tools.py
|
Donnyvdm/gdsctools
|
164ccd284e33202117f505210af96ae44d819203
|
[
"Python-2.0",
"OLDAP-2.7"
] | 13
|
2015-12-27T07:43:39.000Z
|
2021-11-14T21:50:32.000Z
|
from gdsctools.tools import Savefig
def test_savefig():
# TODO if required. Most probably used by other tests
# e.g. when creating HTML report.
pass
| 13.916667
| 57
| 0.694611
| 24
| 167
| 4.791667
| 0.958333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.245509
| 167
| 11
| 58
| 15.181818
| 0.912698
| 0.497006
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0
| 1
| 0.333333
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 7
|
bf65406c379b302d0baa07fcd1636796e54c0269
| 31,771
|
py
|
Python
|
sympy/polys/tests/test_solvers.py
|
msgoff/sympy
|
1e7daef7514902f5e89718fa957b7b36c6669a10
|
[
"BSD-3-Clause"
] | null | null | null |
sympy/polys/tests/test_solvers.py
|
msgoff/sympy
|
1e7daef7514902f5e89718fa957b7b36c6669a10
|
[
"BSD-3-Clause"
] | null | null | null |
sympy/polys/tests/test_solvers.py
|
msgoff/sympy
|
1e7daef7514902f5e89718fa957b7b36c6669a10
|
[
"BSD-3-Clause"
] | null | null | null |
"""Tests for low-level linear systems solver. """
from sympy.matrices import Matrix
from sympy.polys.domains import ZZ, QQ
from sympy.polys.fields import field
from sympy.polys.rings import ring
from sympy.polys.solvers import solve_lin_sys, eqs_to_matrix
def test_solve_lin_sys_2x2_one():
domain, x1, x2 = ring("x1,x2", QQ)
eqs = [x1 + x2 - 5, 2 * x1 - x2]
sol = {x1: QQ(5, 3), x2: QQ(10, 3)}
_sol = solve_lin_sys(eqs, domain)
assert _sol == sol and all(isinstance(s, domain.dtype) for s in _sol)
def test_solve_lin_sys_2x4_none():
domain, x1, x2 = ring("x1,x2", QQ)
eqs = [x1 - 1, x1 - x2, x1 - 2 * x2, x2 - 1]
assert solve_lin_sys(eqs, domain) is None
def test_solve_lin_sys_3x4_one():
domain, x1, x2, x3 = ring("x1,x2,x3", QQ)
eqs = [x1 + 2 * x2 + 3 * x3, 2 * x1 - x2 + x3, 3 * x1 + x2 + x3, 5 * x2 + 2 * x3]
sol = {x1: 0, x2: 0, x3: 0}
assert solve_lin_sys(eqs, domain) == sol
def test_solve_lin_sys_3x3_inf():
domain, x1, x2, x3 = ring("x1,x2,x3", QQ)
eqs = [x1 - x2 + 2 * x3 - 1, 2 * x1 + x2 + x3 - 8, x1 + x2 - 5]
sol = {x1: -x3 + 3, x2: x3 + 2}
assert solve_lin_sys(eqs, domain) == sol
def test_solve_lin_sys_3x4_none():
domain, x1, x2, x3, x4 = ring("x1,x2,x3,x4", QQ)
eqs = [
2 * x1 + x2 + 7 * x3 - 7 * x4 - 2,
-3 * x1 + 4 * x2 - 5 * x3 - 6 * x4 - 3,
x1 + x2 + 4 * x3 - 5 * x4 - 2,
]
assert solve_lin_sys(eqs, domain) is None
def test_solve_lin_sys_4x7_inf():
domain, x1, x2, x3, x4, x5, x6, x7 = ring("x1,x2,x3,x4,x5,x6,x7", QQ)
eqs = [
x1 + 4 * x2 - x4 + 7 * x6 - 9 * x7 - 3,
2 * x1 + 8 * x2 - x3 + 3 * x4 + 9 * x5 - 13 * x6 + 7 * x7 - 9,
2 * x3 - 3 * x4 - 4 * x5 + 12 * x6 - 8 * x7 - 1,
-x1 - 4 * x2 + 2 * x3 + 4 * x4 + 8 * x5 - 31 * x6 + 37 * x7 - 4,
]
sol = {
x1: 4 - 4 * x2 - 2 * x5 - x6 + 3 * x7,
x3: 2 - x5 + 3 * x6 - 5 * x7,
x4: 1 - 2 * x5 + 6 * x6 - 6 * x7,
}
assert solve_lin_sys(eqs, domain) == sol
def test_solve_lin_sys_5x5_inf():
domain, x1, x2, x3, x4, x5 = ring("x1,x2,x3,x4,x5", QQ)
eqs = [
x1 - x2 - 2 * x3 + x4 + 11 * x5 - 13,
x1 - x2 + x3 + x4 + 5 * x5 - 16,
2 * x1 - 2 * x2 + x4 + 10 * x5 - 21,
2 * x1 - 2 * x2 - x3 + 3 * x4 + 20 * x5 - 38,
2 * x1 - 2 * x2 + x3 + x4 + 8 * x5 - 22,
]
sol = {x1: 6 + x2 - 3 * x5, x3: 1 + 2 * x5, x4: 9 - 4 * x5}
assert solve_lin_sys(eqs, domain) == sol
def test_solve_lin_sys_6x6_1():
ground, d, r, e, g, i, j, l, o, m, p, q = field("d,r,e,g,i,j,l,o,m,p,q", ZZ)
domain, c, f, h, k, n, b = ring("c,f,h,k,n,b", ground)
eqs = [
b + q / d - c / d,
c * (1 / d + 1 / e + 1 / g) - f / g - q / d,
f * (1 / g + 1 / i + 1 / j) - c / g - h / i,
h * (1 / i + 1 / l + 1 / m) - f / i - k / m,
k * (1 / m + 1 / o + 1 / p) - h / m - n / p,
n / p - k / p,
]
sol = {
b: (
e * i * l * q
+ e * i * m * q
+ e * i * o * q
+ e * j * l * q
+ e * j * m * q
+ e * j * o * q
+ e * l * m * q
+ e * l * o * q
+ g * i * l * q
+ g * i * m * q
+ g * i * o * q
+ g * j * l * q
+ g * j * m * q
+ g * j * o * q
+ g * l * m * q
+ g * l * o * q
+ i * j * l * q
+ i * j * m * q
+ i * j * o * q
+ j * l * m * q
+ j * l * o * q
)
/ (
-d * e * i * l
- d * e * i * m
- d * e * i * o
- d * e * j * l
- d * e * j * m
- d * e * j * o
- d * e * l * m
- d * e * l * o
- d * g * i * l
- d * g * i * m
- d * g * i * o
- d * g * j * l
- d * g * j * m
- d * g * j * o
- d * g * l * m
- d * g * l * o
- d * i * j * l
- d * i * j * m
- d * i * j * o
- d * j * l * m
- d * j * l * o
- e * g * i * l
- e * g * i * m
- e * g * i * o
- e * g * j * l
- e * g * j * m
- e * g * j * o
- e * g * l * m
- e * g * l * o
- e * i * j * l
- e * i * j * m
- e * i * j * o
- e * j * l * m
- e * j * l * o
),
c: (
-e * g * i * l * q
- e * g * i * m * q
- e * g * i * o * q
- e * g * j * l * q
- e * g * j * m * q
- e * g * j * o * q
- e * g * l * m * q
- e * g * l * o * q
- e * i * j * l * q
- e * i * j * m * q
- e * i * j * o * q
- e * j * l * m * q
- e * j * l * o * q
)
/ (
-d * e * i * l
- d * e * i * m
- d * e * i * o
- d * e * j * l
- d * e * j * m
- d * e * j * o
- d * e * l * m
- d * e * l * o
- d * g * i * l
- d * g * i * m
- d * g * i * o
- d * g * j * l
- d * g * j * m
- d * g * j * o
- d * g * l * m
- d * g * l * o
- d * i * j * l
- d * i * j * m
- d * i * j * o
- d * j * l * m
- d * j * l * o
- e * g * i * l
- e * g * i * m
- e * g * i * o
- e * g * j * l
- e * g * j * m
- e * g * j * o
- e * g * l * m
- e * g * l * o
- e * i * j * l
- e * i * j * m
- e * i * j * o
- e * j * l * m
- e * j * l * o
),
f: (
-e * i * j * l * q
- e * i * j * m * q
- e * i * j * o * q
- e * j * l * m * q
- e * j * l * o * q
)
/ (
-d * e * i * l
- d * e * i * m
- d * e * i * o
- d * e * j * l
- d * e * j * m
- d * e * j * o
- d * e * l * m
- d * e * l * o
- d * g * i * l
- d * g * i * m
- d * g * i * o
- d * g * j * l
- d * g * j * m
- d * g * j * o
- d * g * l * m
- d * g * l * o
- d * i * j * l
- d * i * j * m
- d * i * j * o
- d * j * l * m
- d * j * l * o
- e * g * i * l
- e * g * i * m
- e * g * i * o
- e * g * j * l
- e * g * j * m
- e * g * j * o
- e * g * l * m
- e * g * l * o
- e * i * j * l
- e * i * j * m
- e * i * j * o
- e * j * l * m
- e * j * l * o
),
h: (-e * j * l * m * q - e * j * l * o * q)
/ (
-d * e * i * l
- d * e * i * m
- d * e * i * o
- d * e * j * l
- d * e * j * m
- d * e * j * o
- d * e * l * m
- d * e * l * o
- d * g * i * l
- d * g * i * m
- d * g * i * o
- d * g * j * l
- d * g * j * m
- d * g * j * o
- d * g * l * m
- d * g * l * o
- d * i * j * l
- d * i * j * m
- d * i * j * o
- d * j * l * m
- d * j * l * o
- e * g * i * l
- e * g * i * m
- e * g * i * o
- e * g * j * l
- e * g * j * m
- e * g * j * o
- e * g * l * m
- e * g * l * o
- e * i * j * l
- e * i * j * m
- e * i * j * o
- e * j * l * m
- e * j * l * o
),
k: e
* j
* l
* o
* q
/ (
d * e * i * l
+ d * e * i * m
+ d * e * i * o
+ d * e * j * l
+ d * e * j * m
+ d * e * j * o
+ d * e * l * m
+ d * e * l * o
+ d * g * i * l
+ d * g * i * m
+ d * g * i * o
+ d * g * j * l
+ d * g * j * m
+ d * g * j * o
+ d * g * l * m
+ d * g * l * o
+ d * i * j * l
+ d * i * j * m
+ d * i * j * o
+ d * j * l * m
+ d * j * l * o
+ e * g * i * l
+ e * g * i * m
+ e * g * i * o
+ e * g * j * l
+ e * g * j * m
+ e * g * j * o
+ e * g * l * m
+ e * g * l * o
+ e * i * j * l
+ e * i * j * m
+ e * i * j * o
+ e * j * l * m
+ e * j * l * o
),
n: e
* j
* l
* o
* q
/ (
d * e * i * l
+ d * e * i * m
+ d * e * i * o
+ d * e * j * l
+ d * e * j * m
+ d * e * j * o
+ d * e * l * m
+ d * e * l * o
+ d * g * i * l
+ d * g * i * m
+ d * g * i * o
+ d * g * j * l
+ d * g * j * m
+ d * g * j * o
+ d * g * l * m
+ d * g * l * o
+ d * i * j * l
+ d * i * j * m
+ d * i * j * o
+ d * j * l * m
+ d * j * l * o
+ e * g * i * l
+ e * g * i * m
+ e * g * i * o
+ e * g * j * l
+ e * g * j * m
+ e * g * j * o
+ e * g * l * m
+ e * g * l * o
+ e * i * j * l
+ e * i * j * m
+ e * i * j * o
+ e * j * l * m
+ e * j * l * o
),
}
assert solve_lin_sys(eqs, domain) == sol
def test_solve_lin_sys_6x6_2():
ground, d, r, e, g, i, j, l, o, m, p, q = field("d,r,e,g,i,j,l,o,m,p,q", ZZ)
domain, c, f, h, k, n, b = ring("c,f,h,k,n,b", ground)
eqs = [
b + r / d - c / d,
c * (1 / d + 1 / e + 1 / g) - f / g - r / d,
f * (1 / g + 1 / i + 1 / j) - c / g - h / i,
h * (1 / i + 1 / l + 1 / m) - f / i - k / m,
k * (1 / m + 1 / o + 1 / p) - h / m - n / p,
n * (1 / p + 1 / q) - k / p,
]
sol = {
b: -(
(
l * q * e * o
+ l * q * g * o
+ i * m * q * e
+ i * l * q * e
+ i * l * p * e
+ i * j * o * q
+ j * e * o * q
+ g * j * o * q
+ i * e * o * q
+ g * i * o * q
+ e * l * o * p
+ e * l * m * p
+ e * l * m * o
+ e * i * o * p
+ e * i * m * p
+ e * i * m * o
+ e * i * l * o
+ j * e * o * p
+ j * e * m * q
+ j * e * m * p
+ j * e * m * o
+ j * l * m * q
+ j * l * m * p
+ j * l * m * o
+ i * j * m * p
+ i * j * m * o
+ i * j * l * q
+ i * j * l * o
+ i * j * m * q
+ j * l * o * p
+ j * e * l * o
+ g * j * o * p
+ g * j * m * q
+ g * j * m * p
+ i * j * l * p
+ i * j * o * p
+ j * e * l * q
+ j * e * l * p
+ j * l * o * q
+ g * j * m * o
+ g * j * l * q
+ g * j * l * p
+ g * j * l * o
+ g * l * o * p
+ g * l * m * p
+ g * l * m * o
+ g * i * m * o
+ g * i * o * p
+ g * i * m * q
+ g * i * m * p
+ g * i * l * q
+ g * i * l * p
+ g * i * l * o
+ l * m * q * e
+ l * m * q * g
)
* r
)
/ (
l * q * d * e * o
+ l * q * d * g * o
+ l * q * e * g * o
+ i * j * d * o * q
+ i * j * e * o * q
+ j * d * e * o * q
+ g * j * d * o * q
+ g * j * e * o * q
+ g * i * e * o * q
+ i * d * e * o * q
+ g * i * d * o * q
+ g * i * d * o * p
+ g * i * d * m * q
+ g * i * d * m * p
+ g * i * d * m * o
+ g * i * d * l * q
+ g * i * d * l * p
+ g * i * d * l * o
+ g * e * l * m * p
+ g * e * l * o * p
+ g * j * e * l * q
+ g * e * l * m * o
+ g * j * e * m * p
+ g * j * e * m * o
+ d * e * l * m * p
+ d * e * l * m * o
+ i * d * e * m * p
+ g * j * e * l * p
+ g * j * e * l * o
+ d * e * l * o * p
+ i * j * d * l * o
+ i * j * e * o * p
+ i * j * e * m * q
+ i * j * d * m * q
+ i * j * d * m * p
+ i * j * d * m * o
+ i * j * d * l * q
+ i * j * d * l * p
+ i * j * e * m * p
+ i * j * e * m * o
+ i * j * e * l * q
+ i * j * e * l * p
+ i * j * e * l * o
+ i * d * e * m * q
+ i * d * e * m * o
+ i * d * e * l * q
+ i * d * e * l * p
+ j * d * l * o * p
+ j * d * e * l * o
+ g * j * d * o * p
+ g * j * d * m * q
+ g * j * d * m * p
+ g * j * d * m * o
+ g * j * d * l * q
+ g * j * d * l * p
+ g * j * d * l * o
+ g * j * e * o * p
+ g * j * e * m * q
+ g * d * l * o * p
+ g * d * l * m * p
+ g * d * l * m * o
+ j * d * e * m * p
+ i * d * e * o * p
+ j * e * o * q * l
+ j * e * o * p * l
+ j * e * m * q * l
+ j * d * e * o * p
+ j * d * e * m * q
+ i * j * d * o * p
+ g * i * e * o * p
+ j * d * e * m * o
+ j * d * e * l * q
+ j * d * e * l * p
+ j * e * m * p * l
+ j * e * m * o * l
+ g * i * e * m * q
+ g * i * e * m * p
+ g * i * e * m * o
+ g * i * e * l * q
+ g * i * e * l * p
+ g * i * e * l * o
+ j * d * l * o * q
+ j * d * l * m * q
+ j * d * l * m * p
+ j * d * l * m * o
+ i * d * e * l * o
+ l * m * q * d * e
+ l * m * q * d * g
+ l * m * q * e * g
),
c: (
r
* e
* (
l * q * g * o
+ i * j * o * q
+ g * j * o * q
+ g * i * o * q
+ j * l * m * q
+ j * l * m * p
+ j * l * m * o
+ i * j * m * p
+ i * j * m * o
+ i * j * l * q
+ i * j * l * o
+ i * j * m * q
+ j * l * o * p
+ g * j * o * p
+ g * j * m * q
+ g * j * m * p
+ i * j * l * p
+ i * j * o * p
+ j * l * o * q
+ g * j * m * o
+ g * j * l * q
+ g * j * l * p
+ g * j * l * o
+ g * l * o * p
+ g * l * m * p
+ g * l * m * o
+ g * i * m * o
+ g * i * o * p
+ g * i * m * q
+ g * i * m * p
+ g * i * l * q
+ g * i * l * p
+ g * i * l * o
+ l * m * q * g
)
)
/ (
l * q * d * e * o
+ l * q * d * g * o
+ l * q * e * g * o
+ i * j * d * o * q
+ i * j * e * o * q
+ j * d * e * o * q
+ g * j * d * o * q
+ g * j * e * o * q
+ g * i * e * o * q
+ i * d * e * o * q
+ g * i * d * o * q
+ g * i * d * o * p
+ g * i * d * m * q
+ g * i * d * m * p
+ g * i * d * m * o
+ g * i * d * l * q
+ g * i * d * l * p
+ g * i * d * l * o
+ g * e * l * m * p
+ g * e * l * o * p
+ g * j * e * l * q
+ g * e * l * m * o
+ g * j * e * m * p
+ g * j * e * m * o
+ d * e * l * m * p
+ d * e * l * m * o
+ i * d * e * m * p
+ g * j * e * l * p
+ g * j * e * l * o
+ d * e * l * o * p
+ i * j * d * l * o
+ i * j * e * o * p
+ i * j * e * m * q
+ i * j * d * m * q
+ i * j * d * m * p
+ i * j * d * m * o
+ i * j * d * l * q
+ i * j * d * l * p
+ i * j * e * m * p
+ i * j * e * m * o
+ i * j * e * l * q
+ i * j * e * l * p
+ i * j * e * l * o
+ i * d * e * m * q
+ i * d * e * m * o
+ i * d * e * l * q
+ i * d * e * l * p
+ j * d * l * o * p
+ j * d * e * l * o
+ g * j * d * o * p
+ g * j * d * m * q
+ g * j * d * m * p
+ g * j * d * m * o
+ g * j * d * l * q
+ g * j * d * l * p
+ g * j * d * l * o
+ g * j * e * o * p
+ g * j * e * m * q
+ g * d * l * o * p
+ g * d * l * m * p
+ g * d * l * m * o
+ j * d * e * m * p
+ i * d * e * o * p
+ j * e * o * q * l
+ j * e * o * p * l
+ j * e * m * q * l
+ j * d * e * o * p
+ j * d * e * m * q
+ i * j * d * o * p
+ g * i * e * o * p
+ j * d * e * m * o
+ j * d * e * l * q
+ j * d * e * l * p
+ j * e * m * p * l
+ j * e * m * o * l
+ g * i * e * m * q
+ g * i * e * m * p
+ g * i * e * m * o
+ g * i * e * l * q
+ g * i * e * l * p
+ g * i * e * l * o
+ j * d * l * o * q
+ j * d * l * m * q
+ j * d * l * m * p
+ j * d * l * m * o
+ i * d * e * l * o
+ l * m * q * d * e
+ l * m * q * d * g
+ l * m * q * e * g
),
f: (
r
* e
* j
* (
l * q * o
+ l * o * p
+ l * m * q
+ l * m * p
+ l * m * o
+ i * o * q
+ i * o * p
+ i * m * q
+ i * m * p
+ i * m * o
+ i * l * q
+ i * l * p
+ i * l * o
)
)
/ (
l * q * d * e * o
+ l * q * d * g * o
+ l * q * e * g * o
+ i * j * d * o * q
+ i * j * e * o * q
+ j * d * e * o * q
+ g * j * d * o * q
+ g * j * e * o * q
+ g * i * e * o * q
+ i * d * e * o * q
+ g * i * d * o * q
+ g * i * d * o * p
+ g * i * d * m * q
+ g * i * d * m * p
+ g * i * d * m * o
+ g * i * d * l * q
+ g * i * d * l * p
+ g * i * d * l * o
+ g * e * l * m * p
+ g * e * l * o * p
+ g * j * e * l * q
+ g * e * l * m * o
+ g * j * e * m * p
+ g * j * e * m * o
+ d * e * l * m * p
+ d * e * l * m * o
+ i * d * e * m * p
+ g * j * e * l * p
+ g * j * e * l * o
+ d * e * l * o * p
+ i * j * d * l * o
+ i * j * e * o * p
+ i * j * e * m * q
+ i * j * d * m * q
+ i * j * d * m * p
+ i * j * d * m * o
+ i * j * d * l * q
+ i * j * d * l * p
+ i * j * e * m * p
+ i * j * e * m * o
+ i * j * e * l * q
+ i * j * e * l * p
+ i * j * e * l * o
+ i * d * e * m * q
+ i * d * e * m * o
+ i * d * e * l * q
+ i * d * e * l * p
+ j * d * l * o * p
+ j * d * e * l * o
+ g * j * d * o * p
+ g * j * d * m * q
+ g * j * d * m * p
+ g * j * d * m * o
+ g * j * d * l * q
+ g * j * d * l * p
+ g * j * d * l * o
+ g * j * e * o * p
+ g * j * e * m * q
+ g * d * l * o * p
+ g * d * l * m * p
+ g * d * l * m * o
+ j * d * e * m * p
+ i * d * e * o * p
+ j * e * o * q * l
+ j * e * o * p * l
+ j * e * m * q * l
+ j * d * e * o * p
+ j * d * e * m * q
+ i * j * d * o * p
+ g * i * e * o * p
+ j * d * e * m * o
+ j * d * e * l * q
+ j * d * e * l * p
+ j * e * m * p * l
+ j * e * m * o * l
+ g * i * e * m * q
+ g * i * e * m * p
+ g * i * e * m * o
+ g * i * e * l * q
+ g * i * e * l * p
+ g * i * e * l * o
+ j * d * l * o * q
+ j * d * l * m * q
+ j * d * l * m * p
+ j * d * l * m * o
+ i * d * e * l * o
+ l * m * q * d * e
+ l * m * q * d * g
+ l * m * q * e * g
),
h: (j * e * r * l * (o * q + o * p + m * q + m * p + m * o))
/ (
l * q * d * e * o
+ l * q * d * g * o
+ l * q * e * g * o
+ i * j * d * o * q
+ i * j * e * o * q
+ j * d * e * o * q
+ g * j * d * o * q
+ g * j * e * o * q
+ g * i * e * o * q
+ i * d * e * o * q
+ g * i * d * o * q
+ g * i * d * o * p
+ g * i * d * m * q
+ g * i * d * m * p
+ g * i * d * m * o
+ g * i * d * l * q
+ g * i * d * l * p
+ g * i * d * l * o
+ g * e * l * m * p
+ g * e * l * o * p
+ g * j * e * l * q
+ g * e * l * m * o
+ g * j * e * m * p
+ g * j * e * m * o
+ d * e * l * m * p
+ d * e * l * m * o
+ i * d * e * m * p
+ g * j * e * l * p
+ g * j * e * l * o
+ d * e * l * o * p
+ i * j * d * l * o
+ i * j * e * o * p
+ i * j * e * m * q
+ i * j * d * m * q
+ i * j * d * m * p
+ i * j * d * m * o
+ i * j * d * l * q
+ i * j * d * l * p
+ i * j * e * m * p
+ i * j * e * m * o
+ i * j * e * l * q
+ i * j * e * l * p
+ i * j * e * l * o
+ i * d * e * m * q
+ i * d * e * m * o
+ i * d * e * l * q
+ i * d * e * l * p
+ j * d * l * o * p
+ j * d * e * l * o
+ g * j * d * o * p
+ g * j * d * m * q
+ g * j * d * m * p
+ g * j * d * m * o
+ g * j * d * l * q
+ g * j * d * l * p
+ g * j * d * l * o
+ g * j * e * o * p
+ g * j * e * m * q
+ g * d * l * o * p
+ g * d * l * m * p
+ g * d * l * m * o
+ j * d * e * m * p
+ i * d * e * o * p
+ j * e * o * q * l
+ j * e * o * p * l
+ j * e * m * q * l
+ j * d * e * o * p
+ j * d * e * m * q
+ i * j * d * o * p
+ g * i * e * o * p
+ j * d * e * m * o
+ j * d * e * l * q
+ j * d * e * l * p
+ j * e * m * p * l
+ j * e * m * o * l
+ g * i * e * m * q
+ g * i * e * m * p
+ g * i * e * m * o
+ g * i * e * l * q
+ g * i * e * l * p
+ g * i * e * l * o
+ j * d * l * o * q
+ j * d * l * m * q
+ j * d * l * m * p
+ j * d * l * m * o
+ i * d * e * l * o
+ l * m * q * d * e
+ l * m * q * d * g
+ l * m * q * e * g
),
k: (j * e * r * o * l * (q + p))
/ (
l * q * d * e * o
+ l * q * d * g * o
+ l * q * e * g * o
+ i * j * d * o * q
+ i * j * e * o * q
+ j * d * e * o * q
+ g * j * d * o * q
+ g * j * e * o * q
+ g * i * e * o * q
+ i * d * e * o * q
+ g * i * d * o * q
+ g * i * d * o * p
+ g * i * d * m * q
+ g * i * d * m * p
+ g * i * d * m * o
+ g * i * d * l * q
+ g * i * d * l * p
+ g * i * d * l * o
+ g * e * l * m * p
+ g * e * l * o * p
+ g * j * e * l * q
+ g * e * l * m * o
+ g * j * e * m * p
+ g * j * e * m * o
+ d * e * l * m * p
+ d * e * l * m * o
+ i * d * e * m * p
+ g * j * e * l * p
+ g * j * e * l * o
+ d * e * l * o * p
+ i * j * d * l * o
+ i * j * e * o * p
+ i * j * e * m * q
+ i * j * d * m * q
+ i * j * d * m * p
+ i * j * d * m * o
+ i * j * d * l * q
+ i * j * d * l * p
+ i * j * e * m * p
+ i * j * e * m * o
+ i * j * e * l * q
+ i * j * e * l * p
+ i * j * e * l * o
+ i * d * e * m * q
+ i * d * e * m * o
+ i * d * e * l * q
+ i * d * e * l * p
+ j * d * l * o * p
+ j * d * e * l * o
+ g * j * d * o * p
+ g * j * d * m * q
+ g * j * d * m * p
+ g * j * d * m * o
+ g * j * d * l * q
+ g * j * d * l * p
+ g * j * d * l * o
+ g * j * e * o * p
+ g * j * e * m * q
+ g * d * l * o * p
+ g * d * l * m * p
+ g * d * l * m * o
+ j * d * e * m * p
+ i * d * e * o * p
+ j * e * o * q * l
+ j * e * o * p * l
+ j * e * m * q * l
+ j * d * e * o * p
+ j * d * e * m * q
+ i * j * d * o * p
+ g * i * e * o * p
+ j * d * e * m * o
+ j * d * e * l * q
+ j * d * e * l * p
+ j * e * m * p * l
+ j * e * m * o * l
+ g * i * e * m * q
+ g * i * e * m * p
+ g * i * e * m * o
+ g * i * e * l * q
+ g * i * e * l * p
+ g * i * e * l * o
+ j * d * l * o * q
+ j * d * l * m * q
+ j * d * l * m * p
+ j * d * l * m * o
+ i * d * e * l * o
+ l * m * q * d * e
+ l * m * q * d * g
+ l * m * q * e * g
),
n: (j * e * r * o * q * l)
/ (
l * q * d * e * o
+ l * q * d * g * o
+ l * q * e * g * o
+ i * j * d * o * q
+ i * j * e * o * q
+ j * d * e * o * q
+ g * j * d * o * q
+ g * j * e * o * q
+ g * i * e * o * q
+ i * d * e * o * q
+ g * i * d * o * q
+ g * i * d * o * p
+ g * i * d * m * q
+ g * i * d * m * p
+ g * i * d * m * o
+ g * i * d * l * q
+ g * i * d * l * p
+ g * i * d * l * o
+ g * e * l * m * p
+ g * e * l * o * p
+ g * j * e * l * q
+ g * e * l * m * o
+ g * j * e * m * p
+ g * j * e * m * o
+ d * e * l * m * p
+ d * e * l * m * o
+ i * d * e * m * p
+ g * j * e * l * p
+ g * j * e * l * o
+ d * e * l * o * p
+ i * j * d * l * o
+ i * j * e * o * p
+ i * j * e * m * q
+ i * j * d * m * q
+ i * j * d * m * p
+ i * j * d * m * o
+ i * j * d * l * q
+ i * j * d * l * p
+ i * j * e * m * p
+ i * j * e * m * o
+ i * j * e * l * q
+ i * j * e * l * p
+ i * j * e * l * o
+ i * d * e * m * q
+ i * d * e * m * o
+ i * d * e * l * q
+ i * d * e * l * p
+ j * d * l * o * p
+ j * d * e * l * o
+ g * j * d * o * p
+ g * j * d * m * q
+ g * j * d * m * p
+ g * j * d * m * o
+ g * j * d * l * q
+ g * j * d * l * p
+ g * j * d * l * o
+ g * j * e * o * p
+ g * j * e * m * q
+ g * d * l * o * p
+ g * d * l * m * p
+ g * d * l * m * o
+ j * d * e * m * p
+ i * d * e * o * p
+ j * e * o * q * l
+ j * e * o * p * l
+ j * e * m * q * l
+ j * d * e * o * p
+ j * d * e * m * q
+ i * j * d * o * p
+ g * i * e * o * p
+ j * d * e * m * o
+ j * d * e * l * q
+ j * d * e * l * p
+ j * e * m * p * l
+ j * e * m * o * l
+ g * i * e * m * q
+ g * i * e * m * p
+ g * i * e * m * o
+ g * i * e * l * q
+ g * i * e * l * p
+ g * i * e * l * o
+ j * d * l * o * q
+ j * d * l * m * q
+ j * d * l * m * p
+ j * d * l * m * o
+ i * d * e * l * o
+ l * m * q * d * e
+ l * m * q * d * g
+ l * m * q * e * g
),
}
assert solve_lin_sys(eqs, domain) == sol
def test_eqs_to_matrix():
domain, x1, x2 = ring("x1,x2", QQ)
eqs = [x1 + x2 - 5, 2 * x1 - x2]
assert Matrix([[1, 1, 5], [2, -1, 0]]).__eq__(eqs_to_matrix(eqs, domain))
| 30.029301
| 85
| 0.183752
| 4,829
| 31,771
| 1.192586
| 0.019673
| 0.060427
| 0.037507
| 0.020837
| 0.851016
| 0.82497
| 0.80257
| 0.792499
| 0.79111
| 0.780517
| 0
| 0.031819
| 0.66268
| 31,771
| 1,057
| 86
| 30.057711
| 0.505552
| 0.001322
| 0
| 0.871969
| 0
| 0.00194
| 0.004413
| 0.001324
| 0
| 0
| 0
| 0
| 0.009699
| 1
| 0.009699
| false
| 0
| 0.00485
| 0
| 0.014549
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 1
| 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
| 9
|
bf8303526d579d0aa5e6084426f5f53711036796
| 371,051
|
py
|
Python
|
videoapp/videoapp/__init__.py
|
PyDee/Spiders
|
6fc0a414060032b5ba4332302285e3fcc9a6113e
|
[
"Apache-2.0"
] | 6
|
2020-06-02T16:22:58.000Z
|
2021-09-18T03:20:16.000Z
|
videoapp/videoapp/__init__.py
|
PyDee/Spiders
|
6fc0a414060032b5ba4332302285e3fcc9a6113e
|
[
"Apache-2.0"
] | 4
|
2021-03-31T19:54:37.000Z
|
2022-03-12T00:33:41.000Z
|
videoapp/videoapp/__init__.py
|
PyDee/Spiders
|
6fc0a414060032b5ba4332302285e3fcc9a6113e
|
[
"Apache-2.0"
] | 5
|
2020-06-02T16:23:00.000Z
|
2021-09-03T02:16:15.000Z
|
a = {"config": {"main": {"84": {"key": "w", "channelName": "纪实", "name": "纪录片", "playlistCateID": 144,
"channelurl": "\u002F\u002Fjilupian.youku.com\u002F"},
"85": {"key": "v", "name": "综艺", "playlistCateID": 0,
"channelurl": "\u002F\u002Fzy.youku.com\u002F"},
"86": {"key": "u", "name": "娱乐", "playlistCateID": 143,
"channelurl": "\u002F\u002Fent.youku.com\u002F"},
"87": {"key": "t", "name": "教育", "playlistCateID": 142,
"channelurl": "\u002F\u002Fedu.youku.com\u002F",
"channelurl_paid": "\u002F\u002Fstore.youku.com\u002Fstore\u002Fedu"},
"88": {"key": "s", "name": "旅游", "playlistCateID": 141,
"channelurl": "\u002F\u002Ftravel.youku.com\u002F"},
"89": {"key": "q", "name": "时尚", "playlistCateID": 139,
"channelurl": "\u002F\u002Ffashion.youku.com\u002F"},
"90": {"key": "r", "name": "亲子", "playlistCateID": 140,
"channelurl": "\u002F\u002Fbaby.youku.com\u002F"},
"91": {"key": "a", "name": "资讯", "playlistCateID": 123,
"channelurl": "\u002F\u002Fnews.youku.com\u002F"},
"92": {"key": "b", "name": "原创", "playlistCateID": 124,
"channelurl": "\u002F\u002Fdv.youku.com\u002F"},
"94": {"key": "j", "name": "搞笑", "playlistCateID": 126,
"channelurl": "\u002F\u002Ffun.youku.com\u002F"},
"95": {"key": "f", "name": "音乐", "playlistCateID": 127,
"channelurl": "\u002F\u002Fmusic.youku.com\u002F"},
"96": {"key": "c", "name": "电影", "playlistCateID": 128,
"channelurl": "\u002F\u002Fmovie.youku.com\u002F"},
"97": {"key": "d", "name": "电视剧", "channelName": "剧集", "playlistCateID": 129,
"channelurl": "\u002F\u002Ftv.youku.com\u002F"},
"98": {"key": "e", "name": "体育", "playlistCateID": 130,
"channelurl": "\u002F\u002Fsports.youku.com\u002F"},
"99": {"key": "g", "name": "游戏", "playlistCateID": 131,
"channelurl": "\u002F\u002Fgame.youku.com\u002F"},
"100": {"key": "h", "name": "动漫", "playlistCateID": 132,
"channelurl": "\u002F\u002Fcomic.youku.com\u002F"},
"102": {"key": "l",
"name": "广告",
"playlistCateID": 134,
"channelurl": ""},
"103": {"key": "m", "name": "生活", "playlistCateID": 135,
"channelurl": "\u002F\u002Flife.youku.com\u002F"},
"104": {"key": "n", "name": "汽车", "playlistCateID": 136,
"channelurl": "\u002F\u002Fauto.youku.com\u002F"},
"105": {"key": "o", "name": "科技", "playlistCateID": 137,
"channelurl": "\u002F\u002Ftech.youku.com\u002F"},
"106": {"key": "z",
"name": "其他",
"playlistCateID": 138},
"171": {"key": "wdyg", "name": "微电影", "playlistCateID": 0,
"channelurl": "\u002F\u002Fdv.youku.com\u002F"},
"172": {"key": "wgju", "name": "网剧", "playlistCateID": 0,
"channelurl": "\u002F\u002Fdv.youku.com\u002F"},
"173": {"key": "zzhi",
"name": "自制栏目",
"playlistCateID": 0},
"174": {"key": "pker", "name": "拍客", "playlistCateID": 0,
"channelurl": "\u002F\u002Fpaike.youku.com\u002F"},
"175": {"key": "chyi", "channelName": "原创", "name": "创意视频", "playlistCateID": 0,
"channelurl": "\u002F\u002Fdv.youku.com\u002F"},
"176": {"key": "zpai", "channelName": "拍客", "name": "自拍", "playlistCateID": 0,
"channelurl": "\u002F\u002Fpaike.youku.com\u002F"},
"177": {"key": "child", "name": "少儿", "playlistCateID": 177,
"channelurl": "\u002F\u002Fchild.youku.com\u002F"}},
"simpleMode": False,
"origin": "https:\u002F\u002Fv.youku.com",
"componentMap": {"focus": {"key": "type", "value": 10023, "name": "本期看点"},
"typeConf": {"playlistAuthor": 10039, "scgLongVideo": 10038, "series": 10014},
"listView": [{"key": "type", "value": 10026, "name": "花絮"}],
"topManu": {
"体育": {"tags": [{"key": "type", "value": [10017, 10013, 10023], "name": "回看"}]},
"default": {"scg": {"key": "type", "value": 10020, "name": "选集"},
"playlist": {"key": "type", "value": 10020, "name": "选集"},
"single": {"key": "type", "value": 10019, "name": "TA的视频"},
"show": {"key": "type", "value": 10013, "name": "选集"}},
"电视剧": {"tags": [{"key": "type", "value": 10013, "name": "选集"}]},
"动漫": {"tags": [{"key": "type", "value": 10013, "name": "选集"}]},
"电影": {"tags": [{"key": "type", "value": [10014, 10013], "name": "选集"}]}, "综艺": {
"tags": [{"key": "type", "value": "normal_10013", "name": "往期"},
{"key": "type", "value": "vip_10013", "name": "VIP专享"}]}},
"key": "type",
"btmapping": {"BohVideoInfo": 10009, "BohStar": 10022, "BohAlbum": 10023,
"BohSurroundings": 10023, "BohRecommend": 10021, "BohComment": 10091,
"BohAdvert": 10091},
"top": {"ad": 10091, "detail": 10009, "anthology": 10013, "segments": 10026,
"focus": 10023, "playlist": 10020, "single": 10019, "score": 10015,
"series": 10014, "playback": 10017}},
"query": {},
"source": {"serverJS": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002FPage.server.js"},
"jslibSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage\u002F1.3.38\u002Fscripts\u002Flib.js"},
"playerSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fplayer\u002Fbeta-ykplayer\u002F1.12.2\u002Fyouku-player.min.js"},
"baxiaSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fhtml5p2p\u002FHLS\u002F4.15.5060\u002Fdatamanager.min.js"},
"padPlayerSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fplayer\u002Fbeta-ykplayer\u002F1.11.1\u002Fyouku-player.min.js"},
"adProductH5sdk": {
"url": "\u002F\u002Fg.alicdn.com\u002Fmm\u002Fyksdk\u002F0.2.04\u002Fplayersdk.js"},
"vipPaySDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyoukuvip_fe\u002Fvip-public-assets\u002Fpay\u002Fpay.js"},
"pageRuntimeSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002Fruntime~Page.js"},
"pageletRuntimeSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002Fruntime~play-pagelet.js"},
"commentRuntimeSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002Fruntime~comment.js"},
"pageChunkSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002FPage.chunk.js"},
"pageletChunkSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002Fplay-pagelet.chunk.js"},
"pageChunkCss": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fcss\u002FPage.chunk.css"},
"pageADSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fmm\u002Fyksdk\u002F0.2.0\u002Fpagesdk.js"},
"activitySDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Factivity-components\u002F1.0.12\u002Fstatic\u002Fjs\u002Flive-window.js"},
"activityCss": {
"url": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Factivity-components\u002F1.0.12\u002Fstatic\u002Fcss\u002Flive-window.css"},
"barrageCss": {
"url": "\u002F\u002Fg.alicdn.com\u002Fpc-playpage-components\u002Fyouku-barrage\u002F0.1.12\u002Fstyle\u002Findex.css"},
"barrageSDK": {
"url": "\u002F\u002Fg.alicdn.com\u002Fpc-playpage-components\u002Fyouku-barrage\u002F0.1.12\u002Findex.js"}},
"renderType": "ssr",
"ip": "115.171.120.75",
"cna": "YZQ5F5sfrjQCAQHLrksgYyBD",
"device": "",
"env": "prod",
"staticConf": {"isSSR": True,
"serverJS": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002FPage.server.js",
"jslibSDK": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage\u002F1.3.38\u002Fscripts\u002Flib.js",
"playerSDK": "\u002F\u002Fg.alicdn.com\u002Fplayer\u002Fbeta-ykplayer\u002F1.12.2\u002Fyouku-player.min.js",
"baxiaSDK": "\u002F\u002Fg.alicdn.com\u002Fhtml5p2p\u002FHLS\u002F4.15.5060\u002Fdatamanager.min.js",
"padPlayerSDK": "\u002F\u002Fg.alicdn.com\u002Fplayer\u002Fbeta-ykplayer\u002F1.11.1\u002Fyouku-player.min.js",
"adProductH5sdk": "\u002F\u002Fg.alicdn.com\u002Fmm\u002Fyksdk\u002F0.2.04\u002Fplayersdk.js",
"vipPaySDK": "\u002F\u002Fg.alicdn.com\u002Fyoukuvip_fe\u002Fvip-public-assets\u002Fpay\u002Fpay.js",
"pageRuntimeSDK": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002Fruntime~Page.js",
"pageletRuntimeSDK": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002Fruntime~play-pagelet.js",
"commentRuntimeSDK": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002Fruntime~comment.js",
"pageChunkSDK": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002FPage.chunk.js",
"pageletChunkSDK": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fjs\u002Fplay-pagelet.chunk.js",
"pageChunkCss": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Fpc-playpage-v2\u002F1.7.37\u002Fstatic\u002Fcss\u002FPage.chunk.css",
"pageADSDK": "\u002F\u002Fg.alicdn.com\u002Fmm\u002Fyksdk\u002F0.2.0\u002Fpagesdk.js",
"activitySDK": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Factivity-components\u002F1.0.12\u002Fstatic\u002Fjs\u002Flive-window.js",
"activityCss": "\u002F\u002Fg.alicdn.com\u002Fyouku-node\u002Factivity-components\u002F1.0.12\u002Fstatic\u002Fcss\u002Flive-window.css",
"barrageCss": "\u002F\u002Fg.alicdn.com\u002Fpc-playpage-components\u002Fyouku-barrage\u002F0.1.12\u002Fstyle\u002Findex.css",
"barrageSDK": "\u002F\u002Fg.alicdn.com\u002Fpc-playpage-components\u002Fyouku-barrage\u002F0.1.12\u002Findex.js"},
"isOpenClientCDNPriming": True,
"isSimulateMTOPError": False,
"clientIsJump404": True,
"serverUserId": 0},
"data": {"success": True,
"msCode": "detail",
"errorCode": None,
"errorMsg": None,
"data": {"id": 2315, "level": 0, "type": 10001,
"typeName": "DETAIL_NORMAL", "more": True, "style": None,
"render": None,
"data": {
"session": "{\"lastModuleId\":\"12017\",\"level\":\"0\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"pageId\":\"2315\",\"lastModuleIndex\":\"1\"}",
"title": "默认",
"extra": {"videoId": "XNDQ5NjAxOTI2MA==",
"videoLongId": 1124004815,
"videoCategoryId": 96,
"videoCategory": "电影", "videoType": "正片",
"videoTypeCode": None,
"videoImg": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1BD3368B6C0697297A7219",
"videoImgV": "https:\u002F\u002Fvthumb.ykimg.com\u002F057501015E1BD3368B6C0697297A7219",
"showVideoStage": 1,
"videoPublishTime": "2020-01-13 15:20:05",
"videoTitle": "三生有幸",
"showId": "193e465d2e0411efbfbd",
"showLongId": 484651,
"showCategoryId": 96,
"showCategory": "电影", "episodeTotal": 1,
"showName": "三生有幸",
"showSubtitle": "八个短片阅尽人生浮华",
"completed": True,
"showImg": "http:\u002F\u002Fr1.ykimg.com\u002F053500005E1C3EA5ADA7B217270DB35F",
"showImgV": "http:\u002F\u002Fr1.ykimg.com\u002F053400005E1C4C1A859B5EADBA036D12",
"episodeLast": 1,
"showReleaseTime": "2020-01-13 16:00:00",
"episodeFinalStage": 1,
"playlistId": None,
"playlistLongId": None,
"playlistTitle": None, "scgId": None,
"userId": None, "allowComment": True,
"allowShare": True, "allowDownload": True,
"allowLike": True, "isFavorite": False,
"reportUrl": "",
"pageKey": "LOGICSHOW_FILM_DEFAULT",
"prePaid": None, "paid": 0,
"duration": 4860, "totalComment": 6269,
"totalUp": 50, "verticalStyle": 0,
"isNewReservation": False,
"politicsSensitive": None,
"interactiveChapter": 0, "audiolang": [],
"videoSizes": None, "downloadStatus": [],
"videoKind": None, "subCategories": None,
"hasVideoType": None,
"animeEdition": None,
"videoCacheConfig": None,
"streamTypes": ["3gphd", "flvhd", "hd",
"hd2", "hd3",
"mp5hd4v3"]}},
"nodes": [
{"id": 12017,
"level": 1,
"type": 10001,
"typeName": "NORMAL",
"more": False,
"style": None,
"render": None,
"data": {
"session": "{\"level\":\"1\",\"lastComponentId\":\"46263\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"moduleId\":\"12017\",\"lastComponentIndex\":\"4\"}"},
"nodes": [{"id": 46272, "level": 2, "type": 10009,
"typeName": "播放页简介组件", "more": False, "style": None,
"render": [{"type": "NATIVE", "url": None,
"data": {"borderBottomWidth": 1}}],
"data": {
"session": "{\"componentIndex\":\"1\",\"componentId\":\"46272\",\"level\":\"2\",\"itemPageNo\":\"1\",\"lastItemIndex\":\"18\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"group\":\"46262\"}",
"title": "标题",
"subtitle": "简介",
"allowPlay": 0,
"action": {"type": "JUMP_TO_EXPAND", "value": None,
"contentType": None,
"contentValue": None,
"reportDisabled": None, "extra": None,
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "1_0",
"scmAB": "20140719.function",
"scmC": "46262",
"scmD": "other_other",
"index": 0, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"allowRefresh": 1},
"nodes": [
{"id": 445916, "level": 3, "type": 10010,
"typeName": "简介元数据", "more": False, "style": None,
"render": None,
"data": {"heat": "379",
"area": ["中国"],
"scorePrefix": "评分:", "img": "",
"subTitles": [{
"subtitleType": "UPDATE_PREDICT"}],
"youkuRate": "5.7",
"title": "简介元数据",
"socreValue": "5.7",
"totalUp": 50,
"showGenre": "剧情",
"showReleaseYear": 2020,
"heatDesc": "通过播放效果、用户互动等因子综合计算得出",
"introTitle": "三生有幸",
"mark": {"type": "SIMPLE",
"mediaMarkType": "EXCLUSIVE",
"mediaMarkEnum": {
"name": "SHOW"},
"data": {"text": "独播",
"color": "RED",
"colorValue": None,
"img": None}},
"showImg": False,
"desc": "或许,人生是一座大山,是一条大河,我们自出生那一刻便注定是要跨过山河,去追寻自己的。而这跨过的山河,便是这部电影所要讲述的故事。影片由《双亲》、《流星流星》、《狐狸爷爷的礼物》、《1728》、《兔子先生》、《萍聚》、《新愿》、《目送》八个故事组成,诠释了生、老、病、死、求不得、放不下、爱别离、怨长久八种人生滋味。感谢你出现在我的人生中,山水一程,能遇到你,一起相拥,共同浮沉,实在是三生有幸。"},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D988614ADE3068F01F37C",
"title": "刘沛欣", "subtitleType": "GENERAL",
"subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966338&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_2",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966338",
"index": 2, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"personId": 966338}, "nodes": None, "layout": None,
"header": None, "contentId": None, "raxConfig": None,
"config": None}, {"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息",
"more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D96A8AFB4E305AD05E74F",
"title": "孙楚天", "subtitleType": "GENERAL",
"subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966339&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1",
"spmD": "2_3",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966339",
"index": 3, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966339}, "nodes": None,
"layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1C10A814ADE3068F0C0148",
"title": "王博伦", "subtitleType": "GENERAL",
"subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=959552&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_4",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_959552",
"index": 4, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"personId": 959552}, "nodes": None, "layout": None,
"header": None, "contentId": None, "raxConfig": None,
"config": None}, {"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息",
"more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D96F214ADE3068F021DEB",
"title": "伍嘉伟", "subtitleType": "GENERAL",
"subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=965892&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1",
"spmD": "2_5",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_965892",
"index": 5, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 965892}, "nodes": None,
"layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D99C78B35CA0C380D6B9D",
"title": "翟志鹏", "subtitleType": "GENERAL",
"subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966340&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_6",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966340",
"index": 6, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"personId": 966340}, "nodes": None, "layout": None,
"header": None, "contentId": None, "raxConfig": None,
"config": None}, {"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息",
"more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D97C514ADE3068F0026BA",
"title": "胡志强", "subtitleType": "GENERAL",
"subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966341&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1",
"spmD": "2_7",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966341",
"index": 7, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966341}, "nodes": None,
"layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D984014ADE3068F032AEA",
"title": "郭锴", "subtitleType": "GENERAL",
"subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966442&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_8",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966442",
"index": 8, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"personId": 966442}, "nodes": None, "layout": None,
"header": None, "contentId": None, "raxConfig": None,
"config": None}, {"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息",
"more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D97AA57B1FB0BD90492FD",
"title": "朱正", "subtitleType": "GENERAL",
"subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966441&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1",
"spmD": "2_9",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966441",
"index": 9, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966441}, "nodes": None,
"layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1C1818AFB4E305AD07A5DD",
"title": "景湛", "subtitleType": "GENERAL",
"subtitle": "饰养父",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966348&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_10",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966348",
"index": 10, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"personId": 966348}, "nodes": None, "layout": None,
"header": None, "contentId": None, "raxConfig": None,
"config": None}, {"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息",
"more": False, "style": None,
"render": None,
"data": {"title": "王子宸",
"subtitleType": "GENERAL",
"subtitle": "饰小宝", "action": {
"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966349&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1",
"spmD": "2_11",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966349",
"index": 11, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966349},
"nodes": None, "layout": None,
"header": None, "contentId": None,
"raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None,
"data": {"title": "池静娴", "subtitleType": "GENERAL",
"subtitle": "饰彩票站老板",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966350&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_12",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966350",
"index": 12, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966350}, "nodes": None,
"layout": None, "header": None, "contentId": None,
"raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None,
"data": {"title": "吕梦琦", "subtitleType": "GENERAL",
"subtitle": "饰小卖部老板",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966351&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_13",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966351",
"index": 13, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966351}, "nodes": None,
"layout": None, "header": None, "contentId": None,
"raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None,
"data": {"title": "马和平", "subtitleType": "GENERAL",
"subtitle": "饰老刘",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966352&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_14",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966352",
"index": 14, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966352}, "nodes": None,
"layout": None, "header": None, "contentId": None,
"raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None, "data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F05140000597AB0DCADBA1F04A50DA1F4",
"title": "曾曾",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=746723&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_15",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_746723",
"index": 15, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"personId": 746723}, "nodes": None, "layout": None,
"header": None, "contentId": None, "raxConfig": None,
"config": None}, {"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息",
"more": False, "style": None,
"render": None,
"data": {"title": "程鹏飞", "action": {
"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966354&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_16",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966354",
"index": 16, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966354},
"nodes": None, "layout": None,
"header": None, "contentId": None,
"raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011,
"typeName": "播放页简介卡片明星信息", "more": False, "style": None,
"render": None,
"data": {"title": "明水泉", "subtitleType": "GENERAL",
"subtitle": "饰赵民汉",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966355&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_17",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966355",
"index": 17, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966355}, "nodes": None,
"layout": None, "header": None, "contentId": None,
"raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10012,
"typeName": "播放页简介卡片兴趣节点", "more": False, "style": None,
"render": None, "data": {
"img": "https:\u002F\u002Fimage.uc.cn\u002Fo\u002Fwemedia\u002Fs\u002Fupload\u002F17052213163141e4521593108ed021f50b287bb3fe;,3,jpegx;3,310x",
"verified": True, "title": "新片场",
"subtitleType": "GENERAL",
"verifiedIconRect": "https:\u002F\u002Fr1.ykimg.com\u002F05100000591AF15AADC0B0788F0A74AC",
"subtitle": "17.4万人关注",
"action": {"type": "JUMP_TO_NATIVE",
"value": "youku:\u002F\u002Fpersonalchannel\u002Fopenpersonalchannel?uid=353993157&feedtype=YW_ZPD_VIDEO",
"contentType": None, "contentValue": None,
"reportDisabled": None, "extra": None,
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1", "spmD": "2_18",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "other_UMTQxNTk3MjYyOA==",
"index": 18, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"ownerLongId": 353993157,
"ownerUid": "UMTQxNTk3MjYyOA=="}, "nodes": None,
"layout": None, "header": None, "contentId": None,
"raxConfig": None, "config": None}], "layout": None,
"header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 46265, "level": 2, "type": 10013,
"typeName": "播放页选集组件", "more": False, "style": None,
"render": [{"type": "NATIVE", "url": None,
"data": {"borderBottomWidth": 1}}],
"data": {
"session": "{\"componentIndex\":\"2\",\"componentId\":\"46265\",\"level\":\"2\",\"itemPageNo\":\"0\",\"lastItemIndex\":\"0\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"group\":\"0\"}",
"positionStyle": 1, "title": "选集", "allowPlay": 1,
"action": {"type": "JUMP_TO_EXPAND", "value": None,
"contentType": None,
"contentValue": None,
"reportDisabled": None, "extra": None,
"report": {"pageName": "page_playpage",
"arg1": "pc_detail_anthology2",
"spmAB": "a2h08.8165823",
"spmC": "1_2", "spmD": "0_0",
"scmAB": "20140719.function",
"scmC": "46265",
"scmD": "other_other",
"index": 0, "trackInfo": {
"component_id": "pc_detail_anthology2",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46265,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None, "reportConfig": None},
"allowRefresh": 0, "allowDownload": True},
"nodes": [{"id": 1124004815, "level": 3, "type": 10013,
"typeName": "选集视频", "more": False,
"style": None, "render": None, "data": {
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1BD3368B6C0697297A7219",
"titleLine": 2, "test": "三生有幸",
"summaryType": "STAGE", "title": "三生有幸",
"subtitleType": "PLAY_VV", "total": 1,
"seconds": "81:00", "stage": 1,
"subtitle": "热度 345",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5NjAxOTI2MA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None, "extra": {
"showId": "193e465d2e0411efbfbd"},
"report": {
"pageName": "page_playpage",
"arg1": "pc_detail_anthology2",
"spmAB": "a2h08.8165823",
"spmC": "1_2", "spmD": "1_1",
"scmAB": "20140719.apircmd",
"scmC": "46265",
"scmD": "video_XNDQ5NjAxOTI2MA==",
"index": 1, "trackInfo": {
"component_id": "pc_detail_anthology2",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46265,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1BD3368B6C0697297A7219",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"mark": {"type": "SIMPLE",
"mediaMarkType": "HDR",
"mediaMarkEnum": {"name": "VIDEO"},
"data": {"text": "HDR",
"color": "GOLDEN",
"colorValue": None,
"img": None}}},
"nodes": None, "layout": None,
"header": None, "contentId": None,
"raxConfig": None, "config": None}],
"layout": None, "header": None, "contentId": None,
"raxConfig": None, "config": None},
{"id": 46264, "level": 2, "type": 10014,
"typeName": "播放页电影系列组件", "more": False, "style": None,
"render": [{"type": "NATIVE", "url": None,
"data": {"borderBottomWidth": 1}}],
"data": {
"session": "{\"componentIndex\":\"3\",\"componentId\":\"46264\",\"level\":\"2\",\"itemPageNo\":\"1\",\"lastItemIndex\":\"1\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"group\":\"0\"}",
"title": "播放列表", "subtitle": "更多", "allowPlay": 1,
"allowRefresh": 0, "allowDownload": True},
"nodes": [{"id": 1124004815, "level": 3, "type": 10014,
"typeName": "播放页电影系列视频", "more": False,
"style": None, "render": None,
"data": {"summary": "5.7",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1BD3368B6C0697297A7219",
"videoType": "正片",
"summaryType": "YOUKU_SCORE",
"title": "三生有幸",
"subtitle": "热度 345",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5NjAxOTI2MA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_series",
"spmAB": "a2h08.8165823",
"spmC": "1_3",
"spmD": "1_1",
"scmAB": "20140719.apircmd",
"scmC": "46264",
"scmD": "video_XNDQ5NjAxOTI2MA==",
"index": 1,
"trackInfo": {
"component_id": "web_detail_series",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46264,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1BD3368B6C0697297A7219",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"mark": {"type": "SIMPLE",
"mediaMarkType": "EXCLUSIVE",
"mediaMarkEnum": {
"name": "VIDEO"},
"data": {"text": "独播",
"color": "RED",
"colorValue": None,
"img": None}}},
"nodes": None, "layout": None,
"header": None, "contentId": None,
"raxConfig": None, "config": None}],
"layout": None, "header": None, "contentId": None,
"raxConfig": None, "config": None},
{"id": 46263, "level": 2, "type": 10026,
"typeName": "播放页花絮组件", "more": False, "style": None,
"render": [{"type": "NATIVE", "url": None,
"data": {"borderBottomWidth": 1}}],
"data": {"bottom": {
"action": {"type": "NON", "value": None,
"contentType": None,
"contentValue": None,
"reportDisabled": None, "extra": None,
"report": {"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4", "spmD": "1_0",
"scmAB": "20140719.non",
"scmC": "46263",
"scmD": "other_other",
"index": 0, "trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"session": "{\"componentIndex\":\"4\",\"componentId\":\"46263\",\"level\":\"2\",\"itemPageNo\":\"1\",\"lastItemIndex\":\"21\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"group\":\"0\"}",
"title": "精彩看点", "subtitle": "更多",
"allowPlay": 1,
"action": {"type": "JUMP_TO_EXPAND",
"value": None, "contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": None, "report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4", "spmD": "1_0",
"scmAB": "20140719.function",
"scmC": "46263",
"scmD": "other_other", "index": 0,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"allowRefresh": 0}, "nodes": [
{"id": 1124050680, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:03",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E159606ADCA61A81A4A1876",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "山水一程《三生有幸》,八段人生故事治愈人心",
"subtitleType": "PLAY_VV",
"subtitle": "热度 61",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5NjIwMjcyMA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_1",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5NjIwMjcyMA==",
"index": 1,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E159606ADCA61A81A4A1876",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"mark": {"type": "SIMPLE",
"mediaMarkType": None,
"mediaMarkEnum": None,
"data": {
"text": "预告",
"color": "BLUE",
"colorValue": None,
"img": None}}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124803530, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:18",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E154DF21B4D0798B620ED15",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《萍聚》妻子怀二胎求厂长通融,不慎刺死厂长",
"subtitleType": "PLAY_VV",
"subtitle": "热度 64",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIxNDEyMA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_2",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIxNDEyMA==",
"index": 2,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E154DF21B4D0798B620ED15",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124804588, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:17",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D271FADCA61A5982377AD",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《新愿》父亲患癌症,临走前将银行卡交给冷漠儿子",
"subtitleType": "PLAY_VV",
"subtitle": "热度 55",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIxODM1Mg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_3",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIxODM1Mg==",
"index": 3,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D271FADCA61A5982377AD",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124805632, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:06",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D26838B6C06972B94E1B3",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《新愿》老人与癌症孩子偷跑医院,享受人生最后的快乐",
"subtitleType": "PLAY_VV",
"subtitle": "热度 53",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIyMjUyOA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_4",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIyMjUyOA==",
"index": 4,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D26838B6C06972B94E1B3",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124813243, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:44",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D2561ADCA61A599BD31AC",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《新愿》患癌儿童与老人最后分别,老人坦然接受人生重新启程",
"subtitleType": "PLAY_VV",
"subtitle": "热度 51",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTI1Mjk3Mg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_5",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTI1Mjk3Mg==",
"index": 5,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D2561ADCA61A599BD31AC",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124814976, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:57",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1E6A4DADD016A572E01250",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《目送》出租司机与高考少年谈心,回忆当年父子争吵",
"subtitleType": "PLAY_VV",
"subtitle": "热度 50",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTI1OTkwNA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_6",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTI1OTkwNA==",
"index": 6,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1E6A4DADD016A572E01250",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124815666, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:29",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1E6AEFADCA61A4B353212D",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《目送》年轻气盛离家出走,父亲为追儿子出车祸,结局泪目",
"subtitleType": "PLAY_VV",
"subtitle": "热度 53",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTI2MjY2NA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_7",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTI2MjY2NA==",
"index": 7,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1E6AEFADCA61A4B353212D",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124816137, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:17",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D23D7ADD016A870E2DC83",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《目送》人的一生来日未必方长,父亲的背影渐行渐远",
"subtitleType": "PLAY_VV",
"subtitle": "热度 53",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTI2NDU0OA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_8",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTI2NDU0OA==",
"index": 8,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D23D7ADD016A870E2DC83",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124848334, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "00:15",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D2397ADCA61A59B772422",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "癌症患者最后的分别,老人坦然接受人生重新启程",
"subtitleType": "PLAY_VV",
"subtitle": "热度 49",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTM5MzMzNg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_9",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTM5MzMzNg==",
"index": 9,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D2397ADCA61A59B772422",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124848755, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "00:15",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D2333ADCA61A591C14847",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "父亲意外离开,女儿坚强面对感动人心",
"subtitleType": "PLAY_VV",
"subtitle": "热度 54",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTM5NTAyMA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_10",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTM5NTAyMA==",
"index": 10,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D2333ADCA61A591C14847",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124849076, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "00:15",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1E6A59ADCA61A4B3427252",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "为人父母心,孩子走失五年与养父别离",
"subtitleType": "PLAY_VV",
"subtitle": "热度 54",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTM5NjMwNA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_11",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTM5NjMwNA==",
"index": 11,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1E6A59ADCA61A4B3427252",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124802726, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "00:51",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E159B4BADCA61A810B3E775",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《萍聚》父母婚姻破裂大打出手,女儿心理遭受打击",
"subtitleType": "PLAY_VV",
"subtitle": "热度 56",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIxMDkwNA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_12",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIxMDkwNA==",
"index": 12,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E159B4BADCA61A810B3E775",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124801464, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:15",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E159B00ADCA61A81EE09111",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《萍聚》女儿为让家人落叶归根,驱车长途为爱回程",
"subtitleType": "PLAY_VV",
"subtitle": "热度 52",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIwNTg1Ng==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_13",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIwNTg1Ng==",
"index": 13,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E159B00ADCA61A81EE09111",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124800562, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "02:09",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E159A2A8B6C0697263852E5",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《兔子先生》爸爸出任务发生意外,女儿坚强面对感动人心",
"subtitleType": "PLAY_VV",
"subtitle": "热度 47",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIwMjI0OA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_14",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIwMjI0OA==",
"index": 14,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E159A2A8B6C0697263852E5",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124799793, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:20",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1599C1ADCA61A81A591B33",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《兔子先生》幸福三口暖心出游,爸爸父爱溢出屏",
"subtitleType": "PLAY_VV",
"subtitle": "热度 48",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE5OTE3Mg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_15",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE5OTE3Mg==",
"index": 15,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1599C1ADCA61A81A591B33",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124798863, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "02:04",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E15997D0F954C95EEB4D2E2",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《1728》丈夫登上马航MH370再也没有回来,妻子4年希望破灭",
"subtitleType": "PLAY_VV",
"subtitle": "热度 50",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE5NTQ1Mg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_16",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE5NTQ1Mg==",
"index": 16,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E15997D0F954C95EEB4D2E2",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124798178, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:14",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E15992F1B4D0798B5E0AB2A",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《1728》丈夫失踪,妻子苦等,只想要一个答案",
"subtitleType": "PLAY_VV",
"subtitle": "热度 46",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE5MjcxMg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_17",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE5MjcxMg==",
"index": 17,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E15992F1B4D0798B5E0AB2A",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124797356, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:59",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1598A00F954C95E8037DCD",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《狐狸爷爷》老爷爷临终捐献眼角膜,小女孩获得光明",
"subtitleType": "PLAY_VV",
"subtitle": "热度 49",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE4OTQyNA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_18",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE4OTQyNA==",
"index": 18,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1598A00F954C95E8037DCD",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124796562, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:16",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1598568B6C069721D770D7",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《狐狸爷爷》失明女孩形容世界就像动物园,妈妈像母老虎",
"subtitleType": "PLAY_VV",
"subtitle": "热度 48",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE4NjI0OA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_19",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE4NjI0OA==",
"index": 19,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1598568B6C069721D770D7",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124795794, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "02:02",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1597C00F954C95E1D0C506",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《流星流星》自由的梦想无惧困难,终会实现",
"subtitleType": "PLAY_VV",
"subtitle": "热度 72",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE4MzE3Ng==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_20",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE4MzE3Ng==",
"index": 20,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1597C00F954C95E1D0C506",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None},
{"id": 1124791139, "level": 3, "type": 10026,
"typeName": "花絮视频", "more": False, "style": None,
"render": None, "data": {"summary": "01:16",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E15974F8B6C069720811B49",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《双亲》为人父母心,孩子走失五年,人贩子太可恶",
"subtitleType": "PLAY_VV",
"subtitle": "热度 42",
"action": {
"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE2NDU1Ng==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_21",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE2NDU1Ng==",
"index": 21,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E15974F8B6C069720811B49",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None,
"config": None}], "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None}],
"layout": None, "header": None, "contentId": None,
"raxConfig": None, "config": None}
],
"layout": None,
"header": None, "contentId": None, "raxConfig": None,
"config": None},
"debugInfo": None,
"headers": None,
"model": {
"detail": {
"data": {"id": 2315, "level": 0, "type": 10001, "typeName": "DETAIL_NORMAL", "more": True,
"style": None,
"render": None,
"data": {
"session": "{\"lastModuleId\":\"12017\",\"level\":\"0\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"pageId\":\"2315\",\"lastModuleIndex\":\"1\"}",
"title": "默认",
"extra": {"videoId": "XNDQ5NjAxOTI2MA==", "videoLongId": 1124004815,
"videoCategoryId": 96,
"videoCategory": "电影", "videoType": "正片", "videoTypeCode": None,
"videoImg": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1BD3368B6C0697297A7219",
"videoImgV": "https:\u002F\u002Fvthumb.ykimg.com\u002F057501015E1BD3368B6C0697297A7219",
"showVideoStage": 1, "videoPublishTime": "2020-01-13 15:20:05",
"videoTitle": "三生有幸",
"showId": "193e465d2e0411efbfbd", "showLongId": 484651,
"showCategoryId": 96,
"showCategory": "电影", "episodeTotal": 1, "showName": "三生有幸",
"showSubtitle": "八个短片阅尽人生浮华",
"completed": True,
"showImg": "http:\u002F\u002Fr1.ykimg.com\u002F053500005E1C3EA5ADA7B217270DB35F",
"showImgV": "http:\u002F\u002Fr1.ykimg.com\u002F053400005E1C4C1A859B5EADBA036D12",
"episodeLast": 1, "showReleaseTime": "2020-01-13 16:00:00",
"episodeFinalStage": 1,
"playlistId": None, "playlistLongId": None, "playlistTitle": None,
"scgId": None,
"userId": None, "allowComment": True, "allowShare": True,
"allowDownload": True,
"allowLike": True, "isFavorite": False, "reportUrl": "",
"pageKey": "LOGICSHOW_FILM_DEFAULT", "prePaid": None, "paid": 0,
"duration": 4860,
"totalComment": 6269, "totalUp": 50, "verticalStyle": 0,
"isNewReservation": False,
"politicsSensitive": None, "interactiveChapter": 0, "audiolang": [],
"videoSizes": None,
"downloadStatus": [], "videoKind": None, "subCategories": None,
"hasVideoType": None,
"animeEdition": None, "videoCacheConfig": None,
"streamTypes": ["3gphd", "flvhd", "hd", "hd2", "hd3", "mp5hd4v3"]}},
"nodes": [
{"id": 12017, "level": 1, "type": 10001, "typeName": "NORMAL", "more": False,
"style": None,
"render": None, "data": {
"session": "{\"level\":\"1\",\"lastComponentId\":\"46263\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"moduleId\":\"12017\",\"lastComponentIndex\":\"4\"}"},
"nodes": [
{"id": 46272, "level": 2, "type": 10009, "typeName": "播放页简介组件", "more": False,
"style": None,
"render": [{"type": "NATIVE", "url": None, "data": {"borderBottomWidth": 1}}],
"data": {
"session": "{\"componentIndex\":\"1\",\"componentId\":\"46272\",\"level\":\"2\",\"itemPageNo\":\"1\",\"lastItemIndex\":\"18\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"group\":\"46262\"}",
"title": "标题", "subtitle": "简介", "allowPlay": 0,
"action": {"type": "JUMP_TO_EXPAND", "value": None, "contentType": None,
"contentValue": None, "reportDisabled": None, "extra": None,
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "1_0",
"scmAB": "20140719.function", "scmC": "46262",
"scmD": "other_other",
"index": 0,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"allowRefresh": 1}, "nodes": [
{"id": 445916, "level": 3, "type": 10010, "typeName": "简介元数据",
"more": False,
"style": None, "render": None,
"data": {"heat": "379", "area": ["中国"], "scorePrefix": "评分:", "img": "",
"subTitles": [{"subtitleType": "UPDATE_PREDICT"}],
"youkuRate": "5.7",
"title": "简介元数据", "socreValue": "5.7", "totalUp": 50,
"showGenre": "剧情",
"showReleaseYear": 2020, "heatDesc": "通过播放效果、用户互动等因子综合计算得出",
"introTitle": "三生有幸",
"mark": {"type": "SIMPLE", "mediaMarkType": "EXCLUSIVE",
"mediaMarkEnum": {"name": "SHOW"},
"data": {"text": "独播", "color": "RED",
"colorValue": None, "img": None}},
"showImg": False,
"desc": "或许,人生是一座大山,是一条大河,我们自出生那一刻便注定是要跨过山河,去追寻自己的。而这跨过的山河,便是这部电影所要讲述的故事。影片由《双亲》、《流星流星》、《狐狸爷爷的礼物》、《1728》、《兔子先生》、《萍聚》、《新愿》、《目送》八个故事组成,诠释了生、老、病、死、求不得、放不下、爱别离、怨长久八种人生滋味。感谢你出现在我的人生中,山水一程,能遇到你,一起相拥,共同浮沉,实在是三生有幸。"},
"nodes": None, "layout": None, "header": None, "contentId": None,
"raxConfig": None,
"config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D988614ADE3068F01F37C",
"title": "刘沛欣", "subtitleType": "GENERAL", "subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966338&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_2",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_966338", "index": 2,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966338}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D96A8AFB4E305AD05E74F",
"title": "孙楚天", "subtitleType": "GENERAL", "subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966339&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_3",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_966339", "index": 3,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966339}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1C10A814ADE3068F0C0148",
"title": "王博伦", "subtitleType": "GENERAL", "subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=959552&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_4",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_959552", "index": 4,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 959552}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D96F214ADE3068F021DEB",
"title": "伍嘉伟", "subtitleType": "GENERAL", "subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=965892&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_5",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_965892", "index": 5,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 965892}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D99C78B35CA0C380D6B9D",
"title": "翟志鹏", "subtitleType": "GENERAL", "subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966340&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_6",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_966340", "index": 6,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966340}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D97C514ADE3068F0026BA",
"title": "胡志强", "subtitleType": "GENERAL", "subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966341&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_7",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_966341", "index": 7,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966341}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D984014ADE3068F032AEA",
"title": "郭锴", "subtitleType": "GENERAL", "subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966442&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_8",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_966442", "index": 8,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966442}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1D97AA57B1FB0BD90492FD",
"title": "朱正", "subtitleType": "GENERAL", "subtitle": "导演",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966441&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_9",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_966441", "index": 9,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966441}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F051400005E1C1818AFB4E305AD07A5DD",
"title": "景湛", "subtitleType": "GENERAL", "subtitle": "饰养父",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966348&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_10",
"scmAB": "20140719.apircmd", "scmC": "46262",
"scmD": "starcircle_966348", "index": 10,
"trackInfo": {"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966348}, "nodes": None, "layout": None, "header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {"title": "王子宸", "subtitleType": "GENERAL", "subtitle": "饰小宝",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966349&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_11",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966349", "index": 11,
"trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966349}, "nodes": None, "layout": None,
"header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {"title": "池静娴", "subtitleType": "GENERAL", "subtitle": "饰彩票站老板",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966350&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_12",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966350", "index": 12,
"trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966350}, "nodes": None, "layout": None,
"header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {"title": "吕梦琦", "subtitleType": "GENERAL", "subtitle": "饰小卖部老板",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966351&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_13",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966351", "index": 13,
"trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966351}, "nodes": None, "layout": None,
"header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {"title": "马和平", "subtitleType": "GENERAL", "subtitle": "饰老刘",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966352&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_14",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966352", "index": 14,
"trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966352}, "nodes": None, "layout": None,
"header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {
"img": "http:\u002F\u002Fr1.ykimg.com\u002F05140000597AB0DCADBA1F04A50DA1F4",
"title": "曾曾", "action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=746723&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1",
"spmD": "2_15",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_746723",
"index": 15,
"trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}, "personId": 746723},
"nodes": None, "layout": None, "header": None, "contentId": None,
"raxConfig": None,
"config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None, "data": {"title": "程鹏飞",
"action": {
"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966354&_wvUseWKWebView=YES",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1",
"spmD": "2_16",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966354",
"index": 16, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"personId": 966354}, "nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": None, "level": 3, "type": 10011, "typeName": "播放页简介卡片明星信息",
"more": False,
"style": None, "render": None,
"data": {"title": "明水泉", "subtitleType": "GENERAL", "subtitle": "饰赵民汉",
"action": {"type": "JUMP_TO_EXPAND_URL",
"value": "http:\u002F\u002Fm.youku.com\u002Fhtml\u002Fstar.html?id=966355&_wvUseWKWebView=YES",
"contentType": None, "contentValue": None,
"reportDisabled": None,
"extra": {"type": "NORMAL"},
"report": {"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823", "spmC": "1_1",
"spmD": "2_17",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "starcircle_966355", "index": 17,
"trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"personId": 966355}, "nodes": None, "layout": None,
"header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": None, "level": 3, "type": 10012, "typeName": "播放页简介卡片兴趣节点",
"more": False,
"style": None, "render": None, "data": {
"img": "https:\u002F\u002Fimage.uc.cn\u002Fo\u002Fwemedia\u002Fs\u002Fupload\u002F17052213163141e4521593108ed021f50b287bb3fe;,3,jpegx;3,310x",
"verified": True, "title": "新片场", "subtitleType": "GENERAL",
"verifiedIconRect": "https:\u002F\u002Fr1.ykimg.com\u002F05100000591AF15AADC0B0788F0A74AC",
"subtitle": "17.4万人关注", "action": {"type": "JUMP_TO_NATIVE",
"value": "youku:\u002F\u002Fpersonalchannel\u002Fopenpersonalchannel?uid=353993157&feedtype=YW_ZPD_VIDEO",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": None,
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_info",
"spmAB": "a2h08.8165823",
"spmC": "1_1",
"spmD": "2_18",
"scmAB": "20140719.apircmd",
"scmC": "46262",
"scmD": "other_UMTQxNTk3MjYyOA==",
"index": 18, "trackInfo": {
"component_id": "web_detail_info",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46272,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"ownerLongId": 353993157,
"ownerUid": "UMTQxNTk3MjYyOA=="}, "nodes": None, "layout": None,
"header": None,
"contentId": None, "raxConfig": None, "config": None}], "layout": None,
"header": None,
"contentId": None, "raxConfig": None, "config": None},
{"id": 46265, "level": 2, "type": 10013, "typeName": "播放页选集组件", "more": False,
"style": None,
"render": [{"type": "NATIVE", "url": None, "data": {"borderBottomWidth": 1}}],
"data": {
"session": "{\"componentIndex\":\"2\",\"componentId\":\"46265\",\"level\":\"2\",\"itemPageNo\":\"0\",\"lastItemIndex\":\"0\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"group\":\"0\"}",
"positionStyle": 1, "title": "选集", "allowPlay": 1,
"action": {"type": "JUMP_TO_EXPAND", "value": None, "contentType": None,
"contentValue": None, "reportDisabled": None, "extra": None,
"report": {"pageName": "page_playpage",
"arg1": "pc_detail_anthology2",
"spmAB": "a2h08.8165823", "spmC": "1_2",
"spmD": "0_0",
"scmAB": "20140719.function", "scmC": "46265",
"scmD": "other_other",
"index": 0,
"trackInfo": {"component_id": "pc_detail_anthology2",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46265,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"allowRefresh": 0, "allowDownload": True}, "nodes": [
{"id": 1124004815, "level": 3, "type": 10013, "typeName": "选集视频",
"more": False,
"style": None, "render": None, "data": {
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1BD3368B6C0697297A7219",
"titleLine": 2, "test": "三生有幸", "summaryType": "STAGE", "title": "三生有幸",
"subtitleType": "PLAY_VV", "total": 1, "seconds": "81:00", "stage": 1,
"subtitle": "热度 345",
"action": {"type": "JUMP_TO_VIDEO", "value": "XNDQ5NjAxOTI2MA==",
"contentType": None,
"contentValue": None, "reportDisabled": None,
"extra": {"showId": "193e465d2e0411efbfbd"},
"report": {"pageName": "page_playpage",
"arg1": "pc_detail_anthology2",
"spmAB": "a2h08.8165823", "spmC": "1_2",
"spmD": "1_1",
"scmAB": "20140719.apircmd", "scmC": "46265",
"scmD": "video_XNDQ5NjAxOTI2MA==", "index": 1,
"trackInfo": {
"component_id": "pc_detail_anthology2",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46265,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1BD3368B6C0697297A7219",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"mark": {"type": "SIMPLE", "mediaMarkType": "HDR",
"mediaMarkEnum": {"name": "VIDEO"},
"data": {"text": "HDR", "color": "GOLDEN", "colorValue": None,
"img": None}}},
"nodes": None, "layout": None, "header": None, "contentId": None,
"raxConfig": None,
"config": None}], "layout": None, "header": None, "contentId": None,
"raxConfig": None,
"config": None},
{"id": 46264, "level": 2, "type": 10014, "typeName": "播放页电影系列组件", "more": False,
"style": None,
"render": [{"type": "NATIVE", "url": None, "data": {"borderBottomWidth": 1}}],
"data": {
"session": "{\"componentIndex\":\"3\",\"componentId\":\"46264\",\"level\":\"2\",\"itemPageNo\":\"1\",\"lastItemIndex\":\"1\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"group\":\"0\"}",
"title": "播放列表", "subtitle": "更多", "allowPlay": 1, "allowRefresh": 0,
"allowDownload": True}, "nodes": [
{"id": 1124004815, "level": 3, "type": 10014, "typeName": "播放页电影系列视频",
"more": False,
"style": None, "render": None, "data": {"summary": "5.7",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1BD3368B6C0697297A7219",
"videoType": "正片",
"summaryType": "YOUKU_SCORE",
"title": "三生有幸",
"subtitle": "热度 345",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5NjAxOTI2MA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_series",
"spmAB": "a2h08.8165823",
"spmC": "1_3",
"spmD": "1_1",
"scmAB": "20140719.apircmd",
"scmC": "46264",
"scmD": "video_XNDQ5NjAxOTI2MA==",
"index": 1,
"trackInfo": {
"component_id": "web_detail_series",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46264,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1BD3368B6C0697297A7219",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"mark": {"type": "SIMPLE",
"mediaMarkType": "EXCLUSIVE",
"mediaMarkEnum": {
"name": "VIDEO"},
"data": {"text": "独播",
"color": "RED",
"colorValue": None,
"img": None}}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None}],
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 46263, "level": 2, "type": 10026, "typeName": "播放页花絮组件", "more": False,
"style": None,
"render": [{"type": "NATIVE", "url": None, "data": {"borderBottomWidth": 1}}],
"data": {
"bottom": {
"action": {"type": "NON", "value": None, "contentType": None,
"contentValue": None,
"reportDisabled": None, "extra": None,
"report": {"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823", "spmC": "1_4",
"spmD": "1_0",
"scmAB": "20140719.non", "scmC": "46263",
"scmD": "other_other",
"index": 0,
"trackInfo": {"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None}},
"session": "{\"componentIndex\":\"4\",\"componentId\":\"46263\",\"level\":\"2\",\"itemPageNo\":\"1\",\"lastItemIndex\":\"21\",\"pageKey\":\"LOGICSHOW_FILM_DEFAULT\",\"group\":\"0\"}",
"title": "精彩看点", "subtitle": "更多", "allowPlay": 1,
"action": {"type": "JUMP_TO_EXPAND", "value": None, "contentType": None,
"contentValue": None, "reportDisabled": None, "extra": None,
"report": {"pageName": "page_playpage", "arg1": "web_detail_hl",
"spmAB": "a2h08.8165823", "spmC": "1_4",
"spmD": "1_0",
"scmAB": "20140719.function", "scmC": "46263",
"scmD": "other_other",
"index": 0,
"trackInfo": {"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None}, "callback": None,
"reportConfig": None},
"allowRefresh": 0}, "nodes": [
{"id": 1124050680, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:03",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E159606ADCA61A81A4A1876",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "山水一程《三生有幸》,八段人生故事治愈人心",
"subtitleType": "PLAY_VV",
"subtitle": "热度 61",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5NjIwMjcyMA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_1",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5NjIwMjcyMA==",
"index": 1,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E159606ADCA61A81A4A1876",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None},
"mark": {"type": "SIMPLE",
"mediaMarkType": None,
"mediaMarkEnum": None,
"data": {"text": "预告",
"color": "BLUE",
"colorValue": None,
"img": None}}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124803530, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:18",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E154DF21B4D0798B620ED15",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《萍聚》妻子怀二胎求厂长通融,不慎刺死厂长",
"subtitleType": "PLAY_VV",
"subtitle": "热度 64",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIxNDEyMA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_2",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIxNDEyMA==",
"index": 2,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E154DF21B4D0798B620ED15",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124804588, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:17",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D271FADCA61A5982377AD",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《新愿》父亲患癌症,临走前将银行卡交给冷漠儿子",
"subtitleType": "PLAY_VV",
"subtitle": "热度 55",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIxODM1Mg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_3",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIxODM1Mg==",
"index": 3,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D271FADCA61A5982377AD",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124805632, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:06",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D26838B6C06972B94E1B3",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《新愿》老人与癌症孩子偷跑医院,享受人生最后的快乐",
"subtitleType": "PLAY_VV",
"subtitle": "热度 53",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIyMjUyOA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_4",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIyMjUyOA==",
"index": 4,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D26838B6C06972B94E1B3",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124813243, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:44",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D2561ADCA61A599BD31AC",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《新愿》患癌儿童与老人最后分别,老人坦然接受人生重新启程",
"subtitleType": "PLAY_VV",
"subtitle": "热度 51",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTI1Mjk3Mg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_5",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTI1Mjk3Mg==",
"index": 5,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D2561ADCA61A599BD31AC",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124814976, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:57",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1E6A4DADD016A572E01250",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《目送》出租司机与高考少年谈心,回忆当年父子争吵",
"subtitleType": "PLAY_VV",
"subtitle": "热度 50",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTI1OTkwNA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_6",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTI1OTkwNA==",
"index": 6,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1E6A4DADD016A572E01250",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124815666, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:29",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1E6AEFADCA61A4B353212D",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《目送》年轻气盛离家出走,父亲为追儿子出车祸,结局泪目",
"subtitleType": "PLAY_VV",
"subtitle": "热度 53",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTI2MjY2NA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_7",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTI2MjY2NA==",
"index": 7,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1E6AEFADCA61A4B353212D",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124816137, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:17",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D23D7ADD016A870E2DC83",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《目送》人的一生来日未必方长,父亲的背影渐行渐远",
"subtitleType": "PLAY_VV",
"subtitle": "热度 53",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTI2NDU0OA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_8",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTI2NDU0OA==",
"index": 8,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D23D7ADD016A870E2DC83",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124848334, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "00:15",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D2397ADCA61A59B772422",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "癌症患者最后的分别,老人坦然接受人生重新启程",
"subtitleType": "PLAY_VV",
"subtitle": "热度 49",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTM5MzMzNg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_9",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTM5MzMzNg==",
"index": 9,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D2397ADCA61A59B772422",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124848755, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "00:15",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1D2333ADCA61A591C14847",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "父亲意外离开,女儿坚强面对感动人心",
"subtitleType": "PLAY_VV",
"subtitle": "热度 54",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTM5NTAyMA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_10",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTM5NTAyMA==",
"index": 10,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1D2333ADCA61A591C14847",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124849076, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "00:15",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1E6A59ADCA61A4B3427252",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "为人父母心,孩子走失五年与养父别离",
"subtitleType": "PLAY_VV",
"subtitle": "热度 54",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTM5NjMwNA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_11",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTM5NjMwNA==",
"index": 11,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1E6A59ADCA61A4B3427252",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124802726, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "00:51",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E159B4BADCA61A810B3E775",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《萍聚》父母婚姻破裂大打出手,女儿心理遭受打击",
"subtitleType": "PLAY_VV",
"subtitle": "热度 56",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIxMDkwNA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_12",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIxMDkwNA==",
"index": 12,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E159B4BADCA61A810B3E775",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124801464, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:15",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E159B00ADCA61A81EE09111",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《萍聚》女儿为让家人落叶归根,驱车长途为爱回程",
"subtitleType": "PLAY_VV",
"subtitle": "热度 52",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIwNTg1Ng==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_13",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIwNTg1Ng==",
"index": 13,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E159B00ADCA61A81EE09111",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124800562, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "02:09",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E159A2A8B6C0697263852E5",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《兔子先生》爸爸出任务发生意外,女儿坚强面对感动人心",
"subtitleType": "PLAY_VV",
"subtitle": "热度 47",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTIwMjI0OA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_14",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTIwMjI0OA==",
"index": 14,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E159A2A8B6C0697263852E5",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124799793, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:20",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1599C1ADCA61A81A591B33",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《兔子先生》幸福三口暖心出游,爸爸父爱溢出屏",
"subtitleType": "PLAY_VV",
"subtitle": "热度 48",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE5OTE3Mg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_15",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE5OTE3Mg==",
"index": 15,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1599C1ADCA61A81A591B33",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124798863, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "02:04",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E15997D0F954C95EEB4D2E2",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《1728》丈夫登上马航MH370再也没有回来,妻子4年希望破灭",
"subtitleType": "PLAY_VV",
"subtitle": "热度 50",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE5NTQ1Mg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_16",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE5NTQ1Mg==",
"index": 16,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E15997D0F954C95EEB4D2E2",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124798178, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:14",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E15992F1B4D0798B5E0AB2A",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《1728》丈夫失踪,妻子苦等,只想要一个答案",
"subtitleType": "PLAY_VV",
"subtitle": "热度 46",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE5MjcxMg==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_17",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE5MjcxMg==",
"index": 17,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E15992F1B4D0798B5E0AB2A",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124797356, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:59",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1598A00F954C95E8037DCD",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《狐狸爷爷》老爷爷临终捐献眼角膜,小女孩获得光明",
"subtitleType": "PLAY_VV",
"subtitle": "热度 49",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE4OTQyNA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_18",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE4OTQyNA==",
"index": 18,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1598A00F954C95E8037DCD",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124796562, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:16",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1598568B6C069721D770D7",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《狐狸爷爷》失明女孩形容世界就像动物园,妈妈像母老虎",
"subtitleType": "PLAY_VV",
"subtitle": "热度 48",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE4NjI0OA==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_19",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE4NjI0OA==",
"index": 19,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1598568B6C069721D770D7",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124795794, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "02:02",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E1597C00F954C95E1D0C506",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《流星流星》自由的梦想无惧困难,终会实现",
"subtitleType": "PLAY_VV",
"subtitle": "热度 72",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE4MzE3Ng==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_20",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE4MzE3Ng==",
"index": 20,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E1597C00F954C95E1D0C506",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None},
{"id": 1124791139, "level": 3, "type": 10026, "typeName": "花絮视频",
"more": False,
"style": None, "render": None, "data": {"summary": "01:16",
"img": "https:\u002F\u002Fvthumb.ykimg.com\u002F054101015E15974F8B6C069720811B49",
"titleLine": 2,
"summaryType": "SECONDS",
"title": "《双亲》为人父母心,孩子走失五年,人贩子太可恶",
"subtitleType": "PLAY_VV",
"subtitle": "热度 42",
"action": {"type": "JUMP_TO_VIDEO",
"value": "XNDQ5OTE2NDU1Ng==",
"contentType": None,
"contentValue": None,
"reportDisabled": None,
"extra": {
"showId": 484651},
"report": {
"pageName": "page_playpage",
"arg1": "web_detail_hl",
"spmAB": "a2h08.8165823",
"spmC": "1_4",
"spmD": "1_21",
"scmAB": "20140719.apircmd",
"scmC": "46263",
"scmD": "video_XNDQ5OTE2NDU1Ng==",
"index": 21,
"trackInfo": {
"component_id": "web_detail_hl",
"pvv_vid": "XNDQ5NjAxOTI2MA==",
"component_instance_id": 46263,
"servertime": 1589341589359,
"pageid": "LOGICSHOW_FILM_DEFAULT",
"drawerid": "12017",
"material_id": "media_054101015E15974F8B6C069720811B49",
"pvv_sid": "193e465d2e0411efbfbd",
"cms_req_id": "0badab5a15893415893456910efed7"},
"utParam": None},
"callback": None,
"reportConfig": None}},
"nodes": None,
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None}],
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None}],
"layout": None, "header": None, "contentId": None, "raxConfig": None,
"config": None}],
"layout": None,
"header": None,
"contentId": None,
"raxConfig": None,
"config": None}}}
},
"videoId": "XNDQ5NjAxOTI2MA==",
"showId": "193e465d2e0411efbfbd",
"playlistId": None,
"ip": "115.171.120.75"}
| 101.741431
| 271
| 0.225497
| 13,450
| 371,051
| 6.07881
| 0.061115
| 0.018493
| 0.024951
| 0.022994
| 0.968811
| 0.96842
| 0.967148
| 0.966487
| 0.963356
| 0.963173
| 0
| 0.14296
| 0.696675
| 371,051
| 3,646
| 272
| 101.769336
| 0.583479
| 0
| 0
| 0.853458
| 0
| 0.019759
| 0.203622
| 0.063609
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
44d1b19ef5452636746f9b12f13cffa7992cbed6
| 43,168
|
py
|
Python
|
hs_access_control/tests/utilities.py
|
tommac7/hydroshare
|
87c4543a55f98103d2614bf4c47f7904c3f9c029
|
[
"BSD-3-Clause"
] | null | null | null |
hs_access_control/tests/utilities.py
|
tommac7/hydroshare
|
87c4543a55f98103d2614bf4c47f7904c3f9c029
|
[
"BSD-3-Clause"
] | null | null | null |
hs_access_control/tests/utilities.py
|
tommac7/hydroshare
|
87c4543a55f98103d2614bf4c47f7904c3f9c029
|
[
"BSD-3-Clause"
] | null | null | null |
"""
These functions enable matrix testing of access control.
This is a method in which the whole state of the access
control system is checked after every change.
"""
# import unittest
# from django.http import Http404
# from django.test import TestCase
# from django.utils import timezone
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import User, Group
from pprint import pprint
from hs_access_control.models import UserAccess, GroupAccess, ResourceAccess, \
UserResourcePrivilege, GroupResourcePrivilege, UserGroupPrivilege, PrivilegeCodes, \
UserResourceProvenance, GroupResourceProvenance, UserGroupProvenance
# from hs_core import hydroshare
from hs_core.models import BaseResource
# from hs_core.testing import MockIRODSTestCaseMixin
def global_reset():
UserResourcePrivilege.objects.all().delete()
UserGroupPrivilege.objects.all().delete()
GroupResourcePrivilege.objects.all().delete()
UserResourceProvenance.objects.all().delete()
UserGroupProvenance.objects.all().delete()
GroupResourceProvenance.objects.all().delete()
UserAccess.objects.all().delete()
GroupAccess.objects.all().delete()
ResourceAccess.objects.all().delete()
User.objects.all().delete()
Group.objects.all().delete()
BaseResource.objects.all().delete()
def is_equal_to_as_set(l1, l2):
""" return true if two lists contain the same content
:param l1: first list
:param l2: second list
:return: whether lists match
"""
# Note specifically that set(l1) == set(l2) does not work as expected.
return len(
set(l1) & set(l2)) == len(
set(l1)) and len(
set(l1) | set(l2)) == len(
set(l1))
def is_subset_of(l1, l2):
""" return true if the first list is a subset of the second
:param l1: first list
:param l2: second list
:return: whether first is a subset of second.
"""
return len(set(l1) | set(l2)) == len(set(l2))
def is_disjoint_from(l1, l2):
""" return true if two lists contain completely different content.
:param l1: first list
:param l2: second list
:return: whether lists contain distinct content.
"""
return len(set(l1) & set(l2)) == 0
def assertResourceOwnersAre(self, this_resource, these_users):
""" check all routines that depend upon ownership """
self.assertTrue(
is_equal_to_as_set(
these_users,
this_resource.raccess.owners))
if not this_resource.raccess.immutable:
self.assertTrue(
is_subset_of(
these_users,
this_resource.raccess.edit_users))
else:
self.assertTrue(
is_equal_to_as_set(
this_resource.raccess.edit_users,
[]))
self.assertTrue(
is_subset_of(
these_users,
this_resource.raccess.view_users))
for u in these_users:
self.assertTrue(u.uaccess.owns_resource(this_resource))
if not this_resource.raccess.immutable:
self.assertTrue(u.uaccess.can_change_resource(this_resource))
else:
self.assertFalse(u.uaccess.can_change_resource(this_resource))
self.assertTrue(u.uaccess.can_change_resource_flags(this_resource))
self.assertTrue(u.uaccess.can_view_resource(this_resource))
self.assertTrue(u.uaccess.can_delete_resource(this_resource))
self.assertTrue(this_resource in u.uaccess.owned_resources)
if not this_resource.raccess.immutable:
self.assertTrue(this_resource in u.uaccess.edit_resources)
else:
self.assertTrue(this_resource not in u.uaccess.edit_resources)
self.assertTrue(this_resource in u.uaccess.view_resources)
self.assertTrue(
this_resource in u.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.OWNER))
self.assertTrue(
this_resource not in u.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.CHANGE))
self.assertTrue(
this_resource not in u.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.VIEW))
self.assertTrue(u in this_resource.raccess.view_users)
if not this_resource.raccess.immutable:
self.assertTrue(u in this_resource.raccess.edit_users)
else:
self.assertTrue(u not in this_resource.raccess.edit_users)
self.assertTrue(u in this_resource.raccess.owners)
self.assertEqual(
this_resource.raccess.get_effective_privilege(u),
PrivilegeCodes.OWNER)
def assertResourceEditorsAre(self, this_resource, these_users):
""" these users are all editors without ownership """
self.assertTrue(
is_disjoint_from(
these_users,
this_resource.raccess.owners))
if not this_resource.raccess.immutable:
self.assertTrue(
is_subset_of(
these_users,
this_resource.raccess.edit_users))
else:
self.assertTrue(
is_equal_to_as_set(
this_resource.raccess.edit_users,
[]))
self.assertTrue(
is_subset_of(
these_users,
this_resource.raccess.edit_users))
for u in these_users:
self.assertFalse(u.uaccess.owns_resource(this_resource))
if not this_resource.raccess.immutable:
self.assertTrue(u.uaccess.can_change_resource(this_resource))
else:
self.assertFalse(u.uaccess.can_change_resource(this_resource))
self.assertFalse(u.uaccess.can_change_resource_flags(this_resource))
self.assertTrue(u.uaccess.can_view_resource(this_resource))
self.assertFalse(u.uaccess.can_delete_resource(this_resource))
self.assertTrue(this_resource not in u.uaccess.owned_resources)
self.assertTrue(this_resource in u.uaccess.edit_resources)
self.assertTrue(
is_equal_to_as_set(
u.uaccess.owned_resources,
u.uaccess.get_resources_with_explicit_access(
PrivilegeCodes.OWNER)))
self.assertTrue(is_equal_to_as_set(
set(u.uaccess.edit_resources) -
set(u.uaccess.owned_resources),
u.uaccess.get_resources_with_explicit_access(PrivilegeCodes.CHANGE)))
self.assertTrue(this_resource in u.uaccess.view_resources)
self.assertTrue(
this_resource not in u.uaccess.get_resources_with_explicit_access(
PrivilegeCodes.OWNER))
self.assertTrue(
this_resource in u.uaccess.get_resources_with_explicit_access(
PrivilegeCodes.CHANGE))
self.assertTrue(
this_resource not in u.uaccess.get_resources_with_explicit_access(
PrivilegeCodes.VIEW))
self.assertTrue(u in this_resource.raccess.view_users)
self.assertTrue(u not in this_resource.raccess.owners)
self.assertTrue(u in this_resource.raccess.edit_users)
self.assertEqual(
this_resource.raccess.get_effective_privilege(u),
PrivilegeCodes.CHANGE)
def assertResourceViewersAre(self, this_resource, these_users):
""" these users are all viewers without edit privilege or ownership"""
self.assertTrue(
is_disjoint_from(
these_users,
this_resource.raccess.owners))
self.assertTrue(
is_disjoint_from(
these_users,
this_resource.raccess.owners))
self.assertTrue(
is_disjoint_from(
these_users,
this_resource.raccess.edit_users))
self.assertTrue(
is_subset_of(
these_users,
this_resource.raccess.view_users))
for u in these_users:
self.assertFalse(u.uaccess.owns_resource(this_resource))
self.assertFalse(u.uaccess.can_change_resource(this_resource))
self.assertFalse(u.uaccess.can_change_resource_flags(this_resource))
self.assertTrue(u.uaccess.can_view_resource(this_resource))
self.assertFalse(u.uaccess.can_delete_resource(this_resource))
self.assertTrue(this_resource not in u.uaccess.owned_resources)
self.assertTrue(this_resource not in u.uaccess.edit_resources)
self.assertTrue(this_resource in u.uaccess.view_resources)
self.assertTrue(
this_resource not in u.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.OWNER))
self.assertTrue(
this_resource not in u.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.CHANGE))
self.assertTrue(
this_resource in u.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.VIEW))
self.assertTrue(u in this_resource.raccess.view_users)
self.assertTrue(u not in this_resource.raccess.owners)
self.assertTrue(u not in this_resource.raccess.edit_users)
self.assertEqual(
this_resource.raccess.get_effective_privilege(u),
PrivilegeCodes.VIEW)
def assertResourceUserState(self, this_resource, owners, editors, viewers):
self.assertTrue(is_disjoint_from(owners, editors))
self.assertTrue(is_disjoint_from(owners, viewers))
self.assertTrue(is_disjoint_from(editors, viewers))
self.assertTrue(
is_equal_to_as_set(
this_resource.raccess.view_users,
set(owners) | set(editors) | set(viewers)))
assertResourceOwnersAre(self, this_resource, owners)
assertResourceEditorsAre(self, this_resource, editors)
assertResourceViewersAre(self, this_resource, viewers)
def assertOwnedResourcesAre(self, this_user, these_resources):
""" this user owns these resources """
self.assertTrue(
is_equal_to_as_set(
this_user.uaccess.owned_resources,
these_resources))
self.assertTrue(
is_subset_of(
these_resources,
this_user.uaccess.view_resources))
self.assertTrue(
is_equal_to_as_set(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.OWNER)))
self.assertTrue(
is_disjoint_from(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.CHANGE)))
self.assertTrue(
is_disjoint_from(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.VIEW)))
for r in these_resources:
self.assertTrue(this_user.uaccess.owns_resource(r))
if not r.raccess.immutable:
self.assertTrue(this_user.uaccess.can_change_resource(r))
else:
self.assertFalse(this_user.uaccess.can_change_resource(r))
self.assertTrue(this_user.uaccess.can_change_resource_flags(r))
self.assertTrue(this_user.uaccess.can_view_resource(r))
self.assertTrue(this_user.uaccess.can_delete_resource(r))
self.assertTrue(this_user in r.raccess.owners)
if not r.raccess.immutable:
self.assertTrue(this_user in r.raccess.edit_users)
self.assertTrue(r in this_user.uaccess.edit_resources)
else:
self.assertTrue(this_user not in r.raccess.edit_users)
self.assertTrue(r not in this_user.uaccess.edit_resources)
self.assertTrue(this_user in r.raccess.view_users)
self.assertEqual(
r.raccess.get_effective_privilege(this_user),
PrivilegeCodes.OWNER)
def assertEditableResourcesAre(self, this_user, these_resources):
""" this user owns these resources """
self.assertTrue(
is_disjoint_from(
this_user.uaccess.owned_resources,
these_resources))
self.assertTrue(
is_subset_of(
these_resources,
this_user.uaccess.view_resources))
self.assertTrue(
is_disjoint_from(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.OWNER)))
self.assertTrue(
is_equal_to_as_set(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.CHANGE)))
self.assertTrue(
is_disjoint_from(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.VIEW)))
for r in these_resources:
self.assertFalse(this_user.uaccess.owns_resource(r))
if not r.raccess.immutable:
self.assertTrue(this_user.uaccess.can_change_resource(r))
else:
self.assertFalse(this_user.uaccess.can_change_resource(r))
self.assertFalse(this_user.uaccess.can_change_resource_flags(r))
self.assertTrue(this_user.uaccess.can_view_resource(r))
self.assertFalse(this_user.uaccess.can_delete_resource(r))
# these cannot be granted by groups
self.assertFalse(this_user in r.raccess.owners)
# these only apply to non-group privilege
self.assertTrue(this_user in r.raccess.edit_users)
self.assertTrue(this_user in r.raccess.view_users)
self.assertTrue(r in this_user.uaccess.edit_resources)
self.assertEqual(
r.raccess.get_effective_privilege(this_user),
PrivilegeCodes.CHANGE)
def assertViewableResourcesAre(self, this_user, these_resources):
""" this user owns these resources """
self.assertTrue(
is_disjoint_from(
these_resources,
this_user.uaccess.owned_resources))
self.assertTrue(
is_disjoint_from(
these_resources,
this_user.uaccess.edit_resources))
self.assertTrue(
is_subset_of(
these_resources,
this_user.uaccess.view_resources))
self.assertTrue(
is_disjoint_from(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.OWNER)))
self.assertTrue(
is_disjoint_from(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.CHANGE)))
self.assertTrue(
is_equal_to_as_set(
these_resources,
this_user.uaccess .get_resources_with_explicit_access(
PrivilegeCodes.VIEW)))
for r in these_resources:
self.assertFalse(this_user.uaccess.owns_resource(r))
self.assertFalse(this_user.uaccess.can_change_resource(r))
self.assertFalse(this_user.uaccess.can_change_resource_flags(r))
self.assertTrue(this_user.uaccess.can_view_resource(r))
self.assertFalse(this_user.uaccess.can_delete_resource(r))
self.assertTrue(this_user not in r.raccess.owners)
self.assertTrue(this_user not in r.raccess.edit_users)
self.assertTrue(this_user in r.raccess.view_users)
self.assertEqual(
r.raccess.get_effective_privilege(this_user),
PrivilegeCodes.VIEW)
def assertUserResourceState(self, this_user, owned, editable, viewable):
self.assertTrue(is_disjoint_from(owned, editable))
self.assertTrue(is_disjoint_from(owned, viewable))
self.assertTrue(is_disjoint_from(editable, viewable))
assertOwnedResourcesAre(self, this_user, owned)
assertEditableResourcesAre(self, this_user, editable)
assertViewableResourcesAre(self, this_user, viewable)
def assertGroupOwnersAre(self, this_group, these_users):
""" These users are owners of this group """
self.assertTrue(is_equal_to_as_set(these_users, this_group.gaccess.owners))
self.assertTrue(is_disjoint_from(these_users,
set(this_group.gaccess.edit_users) -
set(this_group.gaccess.owners)))
self.assertTrue(is_disjoint_from(these_users,
set(this_group.gaccess.members) -
set(this_group.gaccess.owners)))
for u in these_users:
self.assertTrue(u.uaccess.owns_group(this_group))
self.assertTrue(u.uaccess.can_change_group(this_group))
self.assertTrue(u.uaccess.can_change_group_flags(this_group))
self.assertTrue(u.uaccess.can_view_group(this_group))
self.assertTrue(u.uaccess.can_delete_group(this_group))
self.assertTrue(this_group in u.uaccess.owned_groups)
self.assertTrue(this_group in u.uaccess.view_groups)
self.assertTrue(this_group in u.uaccess
.get_groups_with_explicit_access(PrivilegeCodes.OWNER))
self.assertTrue(
this_group not in u.uaccess .get_groups_with_explicit_access(
PrivilegeCodes.CHANGE))
self.assertTrue(this_group not in u.uaccess
.get_groups_with_explicit_access(PrivilegeCodes.VIEW))
self.assertEqual(
this_group.gaccess.get_effective_privilege(u),
PrivilegeCodes.OWNER)
def assertGroupEditorsAre(self, this_group, these_users):
""" these_users are all editors without ownership """
self.assertTrue(is_disjoint_from(these_users, this_group.gaccess.owners))
self.assertTrue(is_equal_to_as_set(these_users,
set(this_group.gaccess.edit_users) -
set(this_group.gaccess.owners)))
self.assertTrue(is_disjoint_from(these_users,
set(this_group.gaccess.members) -
set(this_group.gaccess.edit_users)))
for u in these_users:
self.assertFalse(u.uaccess.owns_group(this_group))
self.assertTrue(u.uaccess.can_change_group(this_group))
self.assertFalse(u.uaccess.can_change_group_flags(this_group))
self.assertTrue(u.uaccess.can_view_group(this_group))
self.assertFalse(u.uaccess.can_delete_group(this_group))
self.assertTrue(this_group not in u.uaccess.owned_groups)
self.assertTrue(this_group in u.uaccess.view_groups)
self.assertTrue(this_group not in u.uaccess
.get_groups_with_explicit_access(PrivilegeCodes.OWNER))
self.assertTrue(
this_group in u.uaccess .get_groups_with_explicit_access(
PrivilegeCodes.CHANGE))
self.assertTrue(this_group not in u.uaccess
.get_groups_with_explicit_access(PrivilegeCodes.VIEW))
self.assertEqual(
this_group.gaccess.get_effective_privilege(u),
PrivilegeCodes.CHANGE)
def assertGroupViewersAre(self, this_group, these_users):
""" these_users are all viewers without ownership or edit """
self.assertTrue(is_disjoint_from(these_users, this_group.gaccess.owners))
self.assertTrue(is_disjoint_from(these_users,
set(this_group.gaccess.edit_users) -
set(this_group.gaccess.owners)))
self.assertTrue(is_equal_to_as_set(these_users,
set(this_group.gaccess.members) -
set(this_group.gaccess.edit_users)))
for u in these_users:
self.assertFalse(u.uaccess.owns_group(this_group))
self.assertFalse(u.uaccess.can_change_group(this_group))
self.assertFalse(u.uaccess.can_change_group_flags(this_group))
self.assertTrue(u.uaccess.can_view_group(this_group))
self.assertFalse(u.uaccess.can_delete_group(this_group))
self.assertTrue(this_group not in u.uaccess.owned_groups)
self.assertTrue(this_group in u.uaccess.view_groups)
self.assertTrue(this_group not in u.uaccess
.get_groups_with_explicit_access(PrivilegeCodes.OWNER))
self.assertTrue(
this_group not in u.uaccess .get_groups_with_explicit_access(
PrivilegeCodes.CHANGE))
self.assertTrue(this_group in u.uaccess
.get_groups_with_explicit_access(PrivilegeCodes.VIEW))
self.assertEqual(
this_group.gaccess.get_effective_privilege(u),
PrivilegeCodes.VIEW)
def assertGroupUserState(self, this_group, owners, editors, viewers):
self.assertTrue(is_disjoint_from(owners, editors))
self.assertTrue(is_disjoint_from(owners, viewers))
self.assertTrue(is_disjoint_from(editors, viewers))
self.assertTrue(
is_equal_to_as_set(
this_group.gaccess.members,
set(owners) | set(editors) | set(viewers)))
self.assertTrue(is_equal_to_as_set(this_group.gaccess.edit_users,
set(owners) | set(editors)))
assertGroupOwnersAre(self, this_group, owners)
assertGroupEditorsAre(self, this_group, editors)
assertGroupViewersAre(self, this_group, viewers)
def assertOwnedGroupsAre(self, this_user, these_groups):
""" This user is owner of these groups """
self.assertTrue(
is_equal_to_as_set(
these_groups,
this_user.uaccess.owned_groups))
self.assertTrue(is_subset_of(these_groups, this_user.uaccess.edit_groups))
self.assertTrue(is_subset_of(these_groups, this_user.uaccess.view_groups))
self.assertTrue(is_disjoint_from(these_groups,
set(this_user.uaccess.edit_groups) -
set(this_user.uaccess.owned_groups)))
self.assertTrue(is_disjoint_from(these_groups,
set(this_user.uaccess.view_groups) -
set(this_user.uaccess.owned_groups)))
self.assertTrue(
is_equal_to_as_set(
these_groups,
this_user.uaccess.get_groups_with_explicit_access(
PrivilegeCodes.OWNER)))
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess.get_groups_with_explicit_access(
PrivilegeCodes.CHANGE)))
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess.get_groups_with_explicit_access(
PrivilegeCodes.VIEW)))
for g in these_groups:
self.assertTrue(this_user in g.gaccess.owners)
self.assertTrue(this_user in g.gaccess.edit_users)
self.assertTrue(this_user in g.gaccess.members)
self.assertTrue(this_user.uaccess.owns_group(g))
self.assertTrue(this_user.uaccess.can_change_group(g))
self.assertTrue(this_user.uaccess.can_change_group_flags(g))
self.assertTrue(this_user.uaccess.can_view_group(g))
self.assertTrue(this_user.uaccess.can_delete_group(g))
self.assertEqual(
g.gaccess.get_effective_privilege(this_user),
PrivilegeCodes.OWNER)
def assertEditableGroupsAre(self, this_user, these_groups):
""" This user is editor of these groups """
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess.owned_groups))
self.assertTrue(is_subset_of(these_groups, this_user.uaccess.edit_groups))
self.assertTrue(is_subset_of(these_groups, this_user.uaccess.view_groups))
self.assertTrue(is_equal_to_as_set(these_groups,
set(this_user.uaccess.edit_groups) -
set(this_user.uaccess.owned_groups)))
self.assertTrue(is_disjoint_from(these_groups,
set(this_user.uaccess.view_groups) -
set(this_user.uaccess.owned_groups) -
set(this_user.uaccess.edit_groups)))
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess .get_groups_with_explicit_access(
PrivilegeCodes.OWNER)))
self.assertTrue(
is_equal_to_as_set(
these_groups,
this_user.uaccess .get_groups_with_explicit_access(
PrivilegeCodes.CHANGE)))
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess .get_groups_with_explicit_access(
PrivilegeCodes.VIEW)))
for g in these_groups:
self.assertTrue(this_user not in g.gaccess.owners)
self.assertTrue(this_user in g.gaccess.edit_users)
self.assertTrue(this_user in g.gaccess.members)
self.assertFalse(this_user.uaccess.owns_group(g))
self.assertTrue(this_user.uaccess.can_change_group(g))
self.assertFalse(this_user.uaccess.can_change_group_flags(g))
self.assertTrue(this_user.uaccess.can_view_group(g))
self.assertFalse(this_user.uaccess.can_delete_group(g))
self.assertEqual(
g.gaccess.get_effective_privilege(this_user),
PrivilegeCodes.CHANGE)
def assertViewableGroupsAre(self, this_user, these_groups):
""" This user can view these groups """
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess.owned_groups))
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess.edit_groups))
self.assertTrue(is_subset_of(these_groups, this_user.uaccess.view_groups))
self.assertTrue(is_equal_to_as_set(these_groups,
set(this_user.uaccess.view_groups) -
set(this_user.uaccess.edit_groups) -
set(this_user.uaccess.owned_groups)))
self.assertTrue(is_disjoint_from(these_groups,
set(this_user.uaccess.edit_groups) -
set(this_user.uaccess.view_groups)))
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess. get_groups_with_explicit_access(
PrivilegeCodes.OWNER)))
self.assertTrue(
is_disjoint_from(
these_groups,
this_user.uaccess. get_groups_with_explicit_access(
PrivilegeCodes.CHANGE)))
self.assertTrue(
is_equal_to_as_set(
these_groups,
this_user.uaccess. get_groups_with_explicit_access(
PrivilegeCodes.VIEW)))
for g in these_groups:
self.assertTrue(this_user not in g.gaccess.owners)
self.assertTrue(this_user not in g.gaccess.edit_users)
self.assertTrue(this_user in g.gaccess.members)
self.assertFalse(this_user.uaccess.owns_group(g))
self.assertFalse(this_user.uaccess.can_change_group(g))
self.assertFalse(this_user.uaccess.can_change_group_flags(g))
self.assertTrue(this_user.uaccess.can_view_group(g))
self.assertFalse(this_user.uaccess.can_delete_group(g))
self.assertEqual(
g.gaccess.get_effective_privilege(this_user),
PrivilegeCodes.VIEW)
def assertUserGroupState(self, this_user, owned, editable, viewable):
self.assertTrue(is_disjoint_from(owned, editable))
self.assertTrue(is_disjoint_from(owned, viewable))
self.assertTrue(is_disjoint_from(editable, viewable))
self.assertTrue(
is_equal_to_as_set(
this_user.uaccess.view_groups,
set(owned) | set(editable) | set(viewable)))
assertOwnedGroupsAre(self, this_user, owned)
assertEditableGroupsAre(self, this_user, editable)
assertViewableGroupsAre(self, this_user, viewable)
def assertResourceGroupEditorsAre(self, this_resource, these_groups):
""" these groups are all editors without ownership """
self.assertTrue(
is_equal_to_as_set(
these_groups,
this_resource.raccess.edit_groups))
self.assertTrue(
is_subset_of(
these_groups,
this_resource.raccess.view_groups))
for g in these_groups:
self.assertTrue(this_resource in g.gaccess.edit_resources)
self.assertTrue(this_resource in g.gaccess.view_resources)
self.assertTrue(
this_resource not in g.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.OWNER))
self.assertTrue(
this_resource in g.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.CHANGE))
self.assertTrue(
this_resource not in g.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.VIEW))
def assertResourceGroupViewersAre(self, this_resource, these_groups):
""" these groups are all editors without ownership """
self.assertTrue(
is_disjoint_from(
these_groups,
this_resource.raccess.edit_groups))
self.assertTrue(
is_subset_of(
these_groups,
this_resource.raccess.view_groups))
self.assertTrue(is_equal_to_as_set(these_groups,
set(this_resource.raccess.view_groups) -
set(this_resource.raccess.edit_groups)))
for g in these_groups:
self.assertTrue(this_resource not in g.gaccess.edit_resources)
self.assertTrue(this_resource in g.gaccess.view_resources)
self.assertTrue(
this_resource not in g.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.OWNER))
self.assertTrue(
this_resource not in g.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.CHANGE))
self.assertTrue(
this_resource in g.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.VIEW))
def assertResourceGroupState(self, this_resource, editors, viewers):
self.assertTrue(is_disjoint_from(editors, viewers))
self.assertTrue(
is_equal_to_as_set(
this_resource.raccess.view_groups,
set(editors) | set(viewers)))
assertResourceGroupEditorsAre(self, this_resource, editors)
assertResourceGroupViewersAre(self, this_resource, viewers)
def assertGroupEditableResourcesAre(self, this_group, these_resources):
""" these resources are all editable by this_group"""
self.assertTrue(
is_subset_of(
these_resources,
this_group.gaccess.view_resources))
self.assertTrue(
is_equal_to_as_set(
these_resources,
this_group.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.CHANGE)))
self.assertTrue(
is_disjoint_from(
these_resources,
this_group.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.VIEW)))
self.assertTrue(
is_equal_to_as_set(
these_resources,
this_group.gaccess.edit_resources))
for r in these_resources:
self.assertTrue(this_group in r.raccess.edit_groups)
self.assertTrue(this_group in r.raccess.view_groups)
def assertGroupViewableResourcesAre(self, this_group, these_resources):
""" these resources are all editable by this_group"""
self.assertTrue(
is_subset_of(
these_resources,
this_group.gaccess.view_resources))
self.assertTrue(
is_disjoint_from(
these_resources,
this_group.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.CHANGE)))
self.assertTrue(
is_equal_to_as_set(
these_resources,
this_group.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.VIEW)))
self.assertTrue(
is_disjoint_from(
these_resources,
this_group.gaccess.edit_resources))
for r in these_resources:
self.assertTrue(this_group not in r.raccess.edit_groups)
self.assertTrue(this_group in r.raccess.view_groups)
def assertGroupResourceState(self, this_group, editable, viewable):
self.assertTrue(is_disjoint_from(editable, viewable))
self.assertTrue(is_equal_to_as_set(this_group.gaccess.view_resources,
set(editable) | set(viewable)))
assertGroupEditableResourcesAre(self, this_group, editable)
assertGroupViewableResourcesAre(self, this_group, viewable)
#######################
# printing functions to help with debugging
#######################
def getUserResourceState(this_user):
return {
"OWNER": this_user.uaccess.get_resources_with_explicit_access(
PrivilegeCodes.OWNER),
"CHANGE": this_user.uaccess.get_resources_with_explicit_access(
PrivilegeCodes.CHANGE),
"VIEW": this_user.uaccess.get_resources_with_explicit_access(
PrivilegeCodes.VIEW)}
def getUserGroupState(this_user):
return {
"OWNER": this_user.uaccess.get_groups_with_explicit_access(
PrivilegeCodes.OWNER), "CHANGE": this_user.uaccess.get_groups_with_explicit_access(
PrivilegeCodes.CHANGE), "VIEW": this_user.uaccess.get_groups_with_explicit_access(
PrivilegeCodes.VIEW)}
def getGroupResourceState(this_group):
return {
"OWNER": this_group.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.OWNER),
"CHANGE": this_group.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.CHANGE),
"VIEW": this_group.gaccess.get_resources_with_explicit_access(
PrivilegeCodes.VIEW)}
def printUserResourceState(this_user):
pprint({'resources': {this_user: getUserResourceState(this_user)}})
def printUserGroupState(this_user):
pprint({'groups': {this_user: getUserGroupState(this_user)}})
def printGroupResourceState(this_group):
pprint({'resources': {this_group: getGroupResourceState(this_group)}})
def assertUserResourceUnshareCoherence(self):
"""
Assert that the routines managing unshare for resources are coherent over all users.
This tests that a user is in the list of unshare users whenever the unshare routine will work
and whenever the can_unshare routine will return True.
:param self: an instance of testCase
:return: None
"""
for r in BaseResource.objects.all(): # all resources
for u in User.objects.all(): # all instigating users
for v in User.objects.all(): # all target users
if u.uaccess.can_unshare_resource_with_user(r, v):
self.assertTrue(
v in u.uaccess.get_resource_unshare_users(r))
record = UserResourcePrivilege.objects.get(
user=v, resource=r)
if u != v and not u.is_superuser and record.grantor != v:
# can only undo unshare in this case(!)
u.uaccess.unshare_resource_with_user(r, v)
record.grantor.uaccess.share_resource_with_user(
r, v, record.privilege)
else:
self.assertFalse(
v in u.uaccess.get_resource_unshare_users(r))
with self.assertRaises(PermissionDenied):
u.uaccess.unshare_resource_with_user(r, v)
def assertUserGroupUnshareCoherence(self):
"""
Assert that the routines managing unshare for groups are coherent over all users.
This tests that a user is in the list of unshare users whenever the unshare routine will work
and whenever the can_unshare routine will return True.
:param self: an instance of testCase
:return: None
"""
for g in Group.objects.all().exclude(
pk=self.group.pk): # all groups except Hydroshare Author
for u in User.objects.all(): # all instigating users
for v in User.objects.all(): # all target users
if u.uaccess.can_unshare_group_with_user(g, v):
self.assertTrue(v in u.uaccess.get_group_unshare_users(g))
record = UserGroupPrivilege.objects.get(user=v, group=g)
if u != v and not u.is_superuser and record.grantor != v:
# can only undo unshare in this case(!)
u.uaccess.unshare_group_with_user(g, v)
record.grantor.uaccess.share_group_with_user(
g, v, record.privilege)
else:
self.assertFalse(v in u.uaccess.get_group_unshare_users(g))
with self.assertRaises(PermissionDenied):
u.uaccess.unshare_group_with_user(g, v)
def assertGroupResourceUnshareCoherence(self):
"""
Assert that the routines managing unshare for resources are coherent over all users.
This tests that a user is in the list of unshare users whenever the unshare routine will work
and whenever the can_unshare routine will return True.
:param self: an instance of testCase
:return: None
"""
for r in BaseResource.objects.all(): # all resources
for u in User.objects.all(): # all instigating users
for g in Group.objects.all().exclude(
pk=self.group.pk): # all groups except "author"
if u.uaccess.can_unshare_resource_with_group(r, g):
self.assertTrue(
g in u.uaccess.get_resource_unshare_groups(r))
record = GroupResourcePrivilege.objects.get(
group=g, resource=r)
# can only undo unshare in this case(!)
if not u.is_superuser:
u.uaccess.unshare_resource_with_group(r, g)
record.grantor.uaccess.share_resource_with_group(
r, g, record.privilege)
else:
self.assertFalse(
g in u.uaccess.get_resource_unshare_groups(r))
with self.assertRaises(PermissionDenied):
u.uaccess.unshare_resource_with_group(r, g)
def check_provenance_synchronization(self):
for u in User.objects.all():
for r in BaseResource.objects.all():
prov = UserResourceProvenance.get_privilege(resource=r, user=u)
priv = UserResourcePrivilege.get_privilege(resource=r, user=u)
self.assertEqual(prov, priv,
str.format("prov={}, priv={}, resource={}, user={}",
prov, priv, r, u))
for u in User.objects.all():
for g in Group.objects.all():
prov = UserGroupProvenance.get_privilege(group=g, user=u)
priv = UserGroupPrivilege.get_privilege(group=g, user=u)
self.assertEqual(prov, priv,
str.format("prov={}, priv={}, group={}, user={}",
prov, priv, g, u))
for g in Group.objects.all():
for r in BaseResource.objects.all():
prov = GroupResourceProvenance.get_privilege(resource=r, group=g)
priv = GroupResourcePrivilege.get_privilege(resource=r, group=g)
self.assertEqual(prov, priv,
str.format("prov={}, priv={}, group={}, resource={}",
prov, priv, g, r))
def printGroupResourceProvenance():
print "==================================="
print "GroupResourcePrivilege"
priv = GroupResourcePrivilege.objects.all().order_by('group__id', 'resource__id')
o = None
for p in priv:
if o is not None and (p.group != o.group or p.resource != o.resource):
print "------------------------------"
print(p)
o = p
print "==================================="
print "GroupResourceProvenance"
prov = GroupResourceProvenance.objects.all().order_by(
'group__id', 'resource__id', 'start')
o = None
for p in prov:
if o is not None and (p.group != o.group or p.resource != o.resource):
print "------------------------------"
current = GroupResourceProvenance.get_current_record(
resource=p.resource, group=p.group)
star = ''
if current == p:
star = 'CURRENT'
print(p, star)
o = p
def printUserResourceProvenance():
print "==================================="
print "UserResourcePrivilege"
priv = UserResourcePrivilege.objects.all().order_by('user__id', 'resource__id')
o = None
for p in priv:
if o is not None and (p.user != o.user or p.resource != o.resource):
print "------------------------------"
print(p)
o = p
print "==================================="
print "UserResourceProvenance"
prov = UserResourceProvenance.objects.all().order_by(
'user__id', 'resource__id', 'start')
o = None
for p in prov:
if o is not None and (p.user != o.user or p.resource != o.resource):
print "------------------------------"
current = UserResourceProvenance.get_current_record(
resource=p.resource, user=p.user)
star = ''
if current == p:
star = 'CURRENT'
print(p, star)
o = p
def printUserGroupProvenance():
print "==================================="
print "UserGroupPrivilege"
priv = UserGroupPrivilege.objects.all().order_by('user__id', 'group__id')
o = None
for p in priv:
if o is not None and (p.user != o.user or p.group != o.group):
print "------------------------------"
pprint(p)
o = p
print "==================================="
print "UserGroupProvenance"
prov = UserGroupProvenance.objects.all().order_by(
'user__id', 'group__id', 'start')
o = None
for p in prov:
if o is not None and (p.user != o.user or p.group != o.group):
print "------------------------------"
current = UserGroupProvenance.get_current_record(
group=p.group, user=p.user)
star = ''
if current == p:
star = 'CURRENT'
print(p, star)
o = p
| 43.56004
| 98
| 0.630537
| 4,820
| 43,168
| 5.381535
| 0.046473
| 0.113343
| 0.059216
| 0.070319
| 0.840857
| 0.829099
| 0.809322
| 0.793361
| 0.760592
| 0.734415
| 0
| 0.000933
| 0.279652
| 43,168
| 990
| 99
| 43.60404
| 0.833226
| 0.015891
| 0
| 0.762077
| 0
| 0
| 0.021731
| 0.012249
| 0
| 0
| 0
| 0
| 0.368357
| 0
| null | null | 0
| 0.006039
| null | null | 0.041063
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
153487134be47ea154d7f07a255bf0e568aadcf4
| 11,790
|
py
|
Python
|
exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2_grpc.py
|
burk/python-sdk
|
83fb81d09e0d6a407c8907a75bebb895decc7edc
|
[
"MIT"
] | null | null | null |
exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2_grpc.py
|
burk/python-sdk
|
83fb81d09e0d6a407c8907a75bebb895decc7edc
|
[
"MIT"
] | null | null | null |
exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2_grpc.py
|
burk/python-sdk
|
83fb81d09e0d6a407c8907a75bebb895decc7edc
|
[
"MIT"
] | null | null | null |
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from .....exabel.api.management.v1 import folder_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2
from .....exabel.api.management.v1 import library_service_pb2 as exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class LibraryServiceStub(object):
"""Service to manage library items.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.ListFolders = channel.unary_unary('/exabel.api.management.v1.LibraryService/ListFolders', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.FromString)
self.GetFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/GetFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString)
self.ListItems = channel.unary_unary('/exabel.api.management.v1.LibraryService/ListItems', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.FromString)
self.ListSharedGroups = channel.unary_unary('/exabel.api.management.v1.LibraryService/ListSharedGroups', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListSharedGroupsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListSharedGroupsResponse.FromString)
self.ShareFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/ShareFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString)
self.UnshareFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/UnshareFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString)
self.TransferOwnership = channel.unary_unary('/exabel.api.management.v1.LibraryService/TransferOwnership', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.TransferOwnershipRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.TransferOwnershipResponse.FromString)
class LibraryServiceServicer(object):
"""Service to manage library items.
"""
def ListFolders(self, request, context):
"""List all folders. Folders are returned without folder items.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetFolder(self, request, context):
"""Get a folder including its items.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListItems(self, request, context):
"""List all items of a specific type.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListSharedGroups(self, request, context):
"""List the groups that a specific folder is shared with.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ShareFolder(self, request, context):
"""Share a folder with a group.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UnshareFolder(self, request, context):
"""Remove sharing of a folder with a group.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TransferOwnership(self, request, context):
"""Transfer ownership of items from one user to another.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_LibraryServiceServicer_to_server(servicer, server):
rpc_method_handlers = {'ListFolders': grpc.unary_unary_rpc_method_handler(servicer.ListFolders, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.SerializeToString), 'GetFolder': grpc.unary_unary_rpc_method_handler(servicer.GetFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.SerializeToString), 'ListItems': grpc.unary_unary_rpc_method_handler(servicer.ListItems, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.SerializeToString), 'ListSharedGroups': grpc.unary_unary_rpc_method_handler(servicer.ListSharedGroups, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListSharedGroupsRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListSharedGroupsResponse.SerializeToString), 'ShareFolder': grpc.unary_unary_rpc_method_handler(servicer.ShareFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'UnshareFolder': grpc.unary_unary_rpc_method_handler(servicer.UnshareFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'TransferOwnership': grpc.unary_unary_rpc_method_handler(servicer.TransferOwnership, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.TransferOwnershipRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.TransferOwnershipResponse.SerializeToString)}
generic_handler = grpc.method_handlers_generic_handler('exabel.api.management.v1.LibraryService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class LibraryService(object):
"""Service to manage library items.
"""
@staticmethod
def ListFolders(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None):
return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/ListFolders', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None):
return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/GetFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListItems(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None):
return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/ListItems', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListSharedGroups(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None):
return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/ListSharedGroups', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListSharedGroupsRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListSharedGroupsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ShareFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None):
return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/ShareFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def UnshareFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None):
return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/UnshareFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TransferOwnership(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None):
return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/TransferOwnership', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.TransferOwnershipRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.TransferOwnershipResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
| 104.336283
| 2,142
| 0.835539
| 1,396
| 11,790
| 6.582378
| 0.088825
| 0.037218
| 0.049625
| 0.062031
| 0.864403
| 0.855153
| 0.823049
| 0.786266
| 0.746654
| 0.746654
| 0
| 0.009575
| 0.087617
| 11,790
| 113
| 2,143
| 104.336283
| 0.844659
| 0.05123
| 0
| 0.411765
| 0
| 0
| 0.107468
| 0.070714
| 0
| 0
| 0
| 0
| 0
| 1
| 0.235294
| false
| 0
| 0.058824
| 0.102941
| 0.441176
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 10
|
157ad22dbddb470a1da177fd06e292813bb619bd
| 123
|
py
|
Python
|
dlhub_sdk/__init__.py
|
DLHub-Argonne/dlhub_sdk
|
9449f120490cba40fa43d4ccb06a0d1d7e78f1fd
|
[
"Apache-2.0"
] | 24
|
2018-11-01T12:48:21.000Z
|
2021-12-30T21:19:16.000Z
|
dlhub_sdk/__init__.py
|
DLHub-Argonne/dlhub_sdk
|
9449f120490cba40fa43d4ccb06a0d1d7e78f1fd
|
[
"Apache-2.0"
] | 79
|
2018-11-27T16:41:29.000Z
|
2022-03-25T17:32:09.000Z
|
dlhub_sdk/__init__.py
|
DLHub-Argonne/dlhub_toolbox
|
d8e06ba4247ebd3a955782099a4a9fa68890bea4
|
[
"Apache-2.0"
] | 4
|
2019-02-27T16:23:19.000Z
|
2020-09-19T01:25:30.000Z
|
from .client import DLHubClient # noqa F401 (import unused)
from .version import __version__ # noqa F401 (import unused)
| 41
| 61
| 0.772358
| 16
| 123
| 5.6875
| 0.5
| 0.175824
| 0.307692
| 0.43956
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058252
| 0.162602
| 123
| 2
| 62
| 61.5
| 0.825243
| 0.414634
| 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
| 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
| 7
|
1588bc54dd9dc8957a77d31fc50e616327beb3b3
| 221
|
py
|
Python
|
shconfparser/__init__.py
|
vittico/shconfparser
|
3e1c3655d57dc384205cbb31009bfacbb5ac5051
|
[
"MIT"
] | 17
|
2019-06-15T13:43:27.000Z
|
2022-02-16T09:57:49.000Z
|
shconfparser/__init__.py
|
vroncevic/shconfparser
|
370559a791d427a5eb0f2e45095f9f43f679eac3
|
[
"MIT"
] | 14
|
2019-01-25T06:07:30.000Z
|
2021-07-14T11:13:45.000Z
|
shconfparser/__init__.py
|
vroncevic/shconfparser
|
370559a791d427a5eb0f2e45095f9f43f679eac3
|
[
"MIT"
] | 14
|
2019-12-20T14:58:22.000Z
|
2022-01-31T01:09:13.000Z
|
import logging
from datetime import datetime
logging.basicConfig(level=logging.DEBUG)
# logging.basicConfig(filename='logs/shconfparser.log', level=logging.DEBUG)
logging.info('Logging Time : {}'.format(datetime.now()))
| 31.571429
| 76
| 0.791855
| 27
| 221
| 6.481481
| 0.555556
| 0.205714
| 0.194286
| 0.274286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067873
| 221
| 6
| 77
| 36.833333
| 0.849515
| 0.334842
| 0
| 0
| 0
| 0
| 0.117241
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 7
|
ec59e08c597bdfb41f29560f4f8169997db8d7fa
| 854
|
py
|
Python
|
leetcode-life/array/NO_1_two_sum_easy.py
|
sunrong1990/PythonLife
|
ce288e4fcccc76cd647c80f47f83bf16117269ba
|
[
"MIT"
] | null | null | null |
leetcode-life/array/NO_1_two_sum_easy.py
|
sunrong1990/PythonLife
|
ce288e4fcccc76cd647c80f47f83bf16117269ba
|
[
"MIT"
] | null | null | null |
leetcode-life/array/NO_1_two_sum_easy.py
|
sunrong1990/PythonLife
|
ce288e4fcccc76cd647c80f47f83bf16117269ba
|
[
"MIT"
] | null | null | null |
class Solution():
def twoSum(self, nums, target):
"""
方法1:字典方法
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
mapping = {}
for index, val in enumerate(nums):
diff = target - val
if diff in mapping:
return [index, mapping[diff]]
else:
mapping[val] = index
def twoSum2(self, nums, target):
"""
方法1:字典方法
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
mapping = {}
for index, val in enumerate(nums):
diff = target - val
if diff in mapping:
return [index, mapping[diff]]
else:
mapping[val] = index
| 25.878788
| 49
| 0.419204
| 80
| 854
| 4.475
| 0.3
| 0.078212
| 0.078212
| 0.094972
| 0.910615
| 0.910615
| 0.910615
| 0.910615
| 0.910615
| 0.910615
| 0
| 0.006772
| 0.481265
| 854
| 32
| 50
| 26.6875
| 0.801354
| 0.155738
| 0
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.117647
| false
| 0
| 0
| 0
| 0.294118
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
ec94ef7b372c9ee8717a37051ec5397e9de1021d
| 19,817
|
py
|
Python
|
sdk/python/pulumi_sakuracloud/proxy_lbacme.py
|
sacloud/pulumi-sakuracloud
|
3eff14c6ec8ef4ad6422e0cdf15585df67eb4d6e
|
[
"ECL-2.0",
"Apache-2.0"
] | 6
|
2019-12-07T07:46:05.000Z
|
2020-12-19T02:41:42.000Z
|
sdk/python/pulumi_sakuracloud/proxy_lbacme.py
|
sacloud/pulumi-sakuracloud
|
3eff14c6ec8ef4ad6422e0cdf15585df67eb4d6e
|
[
"ECL-2.0",
"Apache-2.0"
] | 5
|
2019-09-11T04:41:06.000Z
|
2021-10-19T07:50:34.000Z
|
sdk/python/pulumi_sakuracloud/proxy_lbacme.py
|
sacloud/pulumi-sakuracloud
|
3eff14c6ec8ef4ad6422e0cdf15585df67eb4d6e
|
[
"ECL-2.0",
"Apache-2.0"
] | 2
|
2019-09-08T05:38:16.000Z
|
2021-06-24T01:32:47.000Z
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *
__all__ = ['ProxyLBACMEArgs', 'ProxyLBACME']
@pulumi.input_type
class ProxyLBACMEArgs:
def __init__(__self__, *,
accept_tos: pulumi.Input[bool],
common_name: pulumi.Input[str],
proxylb_id: pulumi.Input[str],
subject_alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
update_delay_sec: Optional[pulumi.Input[int]] = None):
"""
The set of arguments for constructing a ProxyLBACME resource.
:param pulumi.Input[bool] accept_tos: The flag to accept the current Let's Encrypt terms of service(see: https://letsencrypt.org/repository/). This must be set `true` explicitly. Changing this forces a new resource to be created.
:param pulumi.Input[str] common_name: The FQDN used by ACME. This must set resolvable value. Changing this forces a new resource to be created.
:param pulumi.Input[str] proxylb_id: The id of the ProxyLB that set ACME settings to. Changing this forces a new resource to be created.
:param pulumi.Input[Sequence[pulumi.Input[str]]] subject_alt_names: The Subject alternative names used by ACME. Changing this forces a new resource to be created.
:param pulumi.Input[int] update_delay_sec: The wait time in seconds. This typically used for waiting for a DNS propagation. Changing this forces a new resource to be created.
"""
pulumi.set(__self__, "accept_tos", accept_tos)
pulumi.set(__self__, "common_name", common_name)
pulumi.set(__self__, "proxylb_id", proxylb_id)
if subject_alt_names is not None:
pulumi.set(__self__, "subject_alt_names", subject_alt_names)
if update_delay_sec is not None:
pulumi.set(__self__, "update_delay_sec", update_delay_sec)
@property
@pulumi.getter(name="acceptTos")
def accept_tos(self) -> pulumi.Input[bool]:
"""
The flag to accept the current Let's Encrypt terms of service(see: https://letsencrypt.org/repository/). This must be set `true` explicitly. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "accept_tos")
@accept_tos.setter
def accept_tos(self, value: pulumi.Input[bool]):
pulumi.set(self, "accept_tos", value)
@property
@pulumi.getter(name="commonName")
def common_name(self) -> pulumi.Input[str]:
"""
The FQDN used by ACME. This must set resolvable value. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "common_name")
@common_name.setter
def common_name(self, value: pulumi.Input[str]):
pulumi.set(self, "common_name", value)
@property
@pulumi.getter(name="proxylbId")
def proxylb_id(self) -> pulumi.Input[str]:
"""
The id of the ProxyLB that set ACME settings to. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "proxylb_id")
@proxylb_id.setter
def proxylb_id(self, value: pulumi.Input[str]):
pulumi.set(self, "proxylb_id", value)
@property
@pulumi.getter(name="subjectAltNames")
def subject_alt_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The Subject alternative names used by ACME. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "subject_alt_names")
@subject_alt_names.setter
def subject_alt_names(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "subject_alt_names", value)
@property
@pulumi.getter(name="updateDelaySec")
def update_delay_sec(self) -> Optional[pulumi.Input[int]]:
"""
The wait time in seconds. This typically used for waiting for a DNS propagation. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "update_delay_sec")
@update_delay_sec.setter
def update_delay_sec(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "update_delay_sec", value)
@pulumi.input_type
class _ProxyLBACMEState:
def __init__(__self__, *,
accept_tos: Optional[pulumi.Input[bool]] = None,
certificates: Optional[pulumi.Input[Sequence[pulumi.Input['ProxyLBACMECertificateArgs']]]] = None,
common_name: Optional[pulumi.Input[str]] = None,
proxylb_id: Optional[pulumi.Input[str]] = None,
subject_alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
update_delay_sec: Optional[pulumi.Input[int]] = None):
"""
Input properties used for looking up and filtering ProxyLBACME resources.
:param pulumi.Input[bool] accept_tos: The flag to accept the current Let's Encrypt terms of service(see: https://letsencrypt.org/repository/). This must be set `true` explicitly. Changing this forces a new resource to be created.
:param pulumi.Input[Sequence[pulumi.Input['ProxyLBACMECertificateArgs']]] certificates: A list of `certificate` blocks as defined below.
:param pulumi.Input[str] common_name: The FQDN used by ACME. This must set resolvable value. Changing this forces a new resource to be created.
:param pulumi.Input[str] proxylb_id: The id of the ProxyLB that set ACME settings to. Changing this forces a new resource to be created.
:param pulumi.Input[Sequence[pulumi.Input[str]]] subject_alt_names: The Subject alternative names used by ACME. Changing this forces a new resource to be created.
:param pulumi.Input[int] update_delay_sec: The wait time in seconds. This typically used for waiting for a DNS propagation. Changing this forces a new resource to be created.
"""
if accept_tos is not None:
pulumi.set(__self__, "accept_tos", accept_tos)
if certificates is not None:
pulumi.set(__self__, "certificates", certificates)
if common_name is not None:
pulumi.set(__self__, "common_name", common_name)
if proxylb_id is not None:
pulumi.set(__self__, "proxylb_id", proxylb_id)
if subject_alt_names is not None:
pulumi.set(__self__, "subject_alt_names", subject_alt_names)
if update_delay_sec is not None:
pulumi.set(__self__, "update_delay_sec", update_delay_sec)
@property
@pulumi.getter(name="acceptTos")
def accept_tos(self) -> Optional[pulumi.Input[bool]]:
"""
The flag to accept the current Let's Encrypt terms of service(see: https://letsencrypt.org/repository/). This must be set `true` explicitly. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "accept_tos")
@accept_tos.setter
def accept_tos(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "accept_tos", value)
@property
@pulumi.getter
def certificates(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ProxyLBACMECertificateArgs']]]]:
"""
A list of `certificate` blocks as defined below.
"""
return pulumi.get(self, "certificates")
@certificates.setter
def certificates(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ProxyLBACMECertificateArgs']]]]):
pulumi.set(self, "certificates", value)
@property
@pulumi.getter(name="commonName")
def common_name(self) -> Optional[pulumi.Input[str]]:
"""
The FQDN used by ACME. This must set resolvable value. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "common_name")
@common_name.setter
def common_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "common_name", value)
@property
@pulumi.getter(name="proxylbId")
def proxylb_id(self) -> Optional[pulumi.Input[str]]:
"""
The id of the ProxyLB that set ACME settings to. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "proxylb_id")
@proxylb_id.setter
def proxylb_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "proxylb_id", value)
@property
@pulumi.getter(name="subjectAltNames")
def subject_alt_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The Subject alternative names used by ACME. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "subject_alt_names")
@subject_alt_names.setter
def subject_alt_names(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "subject_alt_names", value)
@property
@pulumi.getter(name="updateDelaySec")
def update_delay_sec(self) -> Optional[pulumi.Input[int]]:
"""
The wait time in seconds. This typically used for waiting for a DNS propagation. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "update_delay_sec")
@update_delay_sec.setter
def update_delay_sec(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "update_delay_sec", value)
class ProxyLBACME(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
accept_tos: Optional[pulumi.Input[bool]] = None,
common_name: Optional[pulumi.Input[str]] = None,
proxylb_id: Optional[pulumi.Input[str]] = None,
subject_alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
update_delay_sec: Optional[pulumi.Input[int]] = None,
__props__=None):
"""
Manages a SakuraCloud ProxyLB ACME Setting.
## Example Usage
```python
import pulumi
import pulumi_sakuracloud as sakuracloud
foobar_proxy_lbacme = sakuracloud.ProxyLBACME("foobarProxyLBACME",
proxylb_id=sakuracloud_proxylb["foobar"]["id"],
accept_tos=True,
common_name="www.example.com",
subject_alt_names=["www1.example.com"],
update_delay_sec=120)
foobar_proxy_lb = sakuracloud.get_proxy_lb(filter=sakuracloud.GetProxyLBFilterArgs(
names=["foobar"],
))
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[bool] accept_tos: The flag to accept the current Let's Encrypt terms of service(see: https://letsencrypt.org/repository/). This must be set `true` explicitly. Changing this forces a new resource to be created.
:param pulumi.Input[str] common_name: The FQDN used by ACME. This must set resolvable value. Changing this forces a new resource to be created.
:param pulumi.Input[str] proxylb_id: The id of the ProxyLB that set ACME settings to. Changing this forces a new resource to be created.
:param pulumi.Input[Sequence[pulumi.Input[str]]] subject_alt_names: The Subject alternative names used by ACME. Changing this forces a new resource to be created.
:param pulumi.Input[int] update_delay_sec: The wait time in seconds. This typically used for waiting for a DNS propagation. Changing this forces a new resource to be created.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: ProxyLBACMEArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Manages a SakuraCloud ProxyLB ACME Setting.
## Example Usage
```python
import pulumi
import pulumi_sakuracloud as sakuracloud
foobar_proxy_lbacme = sakuracloud.ProxyLBACME("foobarProxyLBACME",
proxylb_id=sakuracloud_proxylb["foobar"]["id"],
accept_tos=True,
common_name="www.example.com",
subject_alt_names=["www1.example.com"],
update_delay_sec=120)
foobar_proxy_lb = sakuracloud.get_proxy_lb(filter=sakuracloud.GetProxyLBFilterArgs(
names=["foobar"],
))
```
:param str resource_name: The name of the resource.
:param ProxyLBACMEArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(ProxyLBACMEArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
accept_tos: Optional[pulumi.Input[bool]] = None,
common_name: Optional[pulumi.Input[str]] = None,
proxylb_id: Optional[pulumi.Input[str]] = None,
subject_alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
update_delay_sec: Optional[pulumi.Input[int]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = ProxyLBACMEArgs.__new__(ProxyLBACMEArgs)
if accept_tos is None and not opts.urn:
raise TypeError("Missing required property 'accept_tos'")
__props__.__dict__["accept_tos"] = accept_tos
if common_name is None and not opts.urn:
raise TypeError("Missing required property 'common_name'")
__props__.__dict__["common_name"] = common_name
if proxylb_id is None and not opts.urn:
raise TypeError("Missing required property 'proxylb_id'")
__props__.__dict__["proxylb_id"] = proxylb_id
__props__.__dict__["subject_alt_names"] = subject_alt_names
__props__.__dict__["update_delay_sec"] = update_delay_sec
__props__.__dict__["certificates"] = None
super(ProxyLBACME, __self__).__init__(
'sakuracloud:index/proxyLBACME:ProxyLBACME',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
accept_tos: Optional[pulumi.Input[bool]] = None,
certificates: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ProxyLBACMECertificateArgs']]]]] = None,
common_name: Optional[pulumi.Input[str]] = None,
proxylb_id: Optional[pulumi.Input[str]] = None,
subject_alt_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
update_delay_sec: Optional[pulumi.Input[int]] = None) -> 'ProxyLBACME':
"""
Get an existing ProxyLBACME resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[bool] accept_tos: The flag to accept the current Let's Encrypt terms of service(see: https://letsencrypt.org/repository/). This must be set `true` explicitly. Changing this forces a new resource to be created.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ProxyLBACMECertificateArgs']]]] certificates: A list of `certificate` blocks as defined below.
:param pulumi.Input[str] common_name: The FQDN used by ACME. This must set resolvable value. Changing this forces a new resource to be created.
:param pulumi.Input[str] proxylb_id: The id of the ProxyLB that set ACME settings to. Changing this forces a new resource to be created.
:param pulumi.Input[Sequence[pulumi.Input[str]]] subject_alt_names: The Subject alternative names used by ACME. Changing this forces a new resource to be created.
:param pulumi.Input[int] update_delay_sec: The wait time in seconds. This typically used for waiting for a DNS propagation. Changing this forces a new resource to be created.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _ProxyLBACMEState.__new__(_ProxyLBACMEState)
__props__.__dict__["accept_tos"] = accept_tos
__props__.__dict__["certificates"] = certificates
__props__.__dict__["common_name"] = common_name
__props__.__dict__["proxylb_id"] = proxylb_id
__props__.__dict__["subject_alt_names"] = subject_alt_names
__props__.__dict__["update_delay_sec"] = update_delay_sec
return ProxyLBACME(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="acceptTos")
def accept_tos(self) -> pulumi.Output[bool]:
"""
The flag to accept the current Let's Encrypt terms of service(see: https://letsencrypt.org/repository/). This must be set `true` explicitly. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "accept_tos")
@property
@pulumi.getter
def certificates(self) -> pulumi.Output[Sequence['outputs.ProxyLBACMECertificate']]:
"""
A list of `certificate` blocks as defined below.
"""
return pulumi.get(self, "certificates")
@property
@pulumi.getter(name="commonName")
def common_name(self) -> pulumi.Output[str]:
"""
The FQDN used by ACME. This must set resolvable value. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "common_name")
@property
@pulumi.getter(name="proxylbId")
def proxylb_id(self) -> pulumi.Output[str]:
"""
The id of the ProxyLB that set ACME settings to. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "proxylb_id")
@property
@pulumi.getter(name="subjectAltNames")
def subject_alt_names(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
The Subject alternative names used by ACME. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "subject_alt_names")
@property
@pulumi.getter(name="updateDelaySec")
def update_delay_sec(self) -> pulumi.Output[Optional[int]]:
"""
The wait time in seconds. This typically used for waiting for a DNS propagation. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "update_delay_sec")
| 49.173697
| 237
| 0.668971
| 2,486
| 19,817
| 5.117056
| 0.080048
| 0.081283
| 0.045122
| 0.052276
| 0.84561
| 0.830674
| 0.813144
| 0.791054
| 0.775961
| 0.774703
| 0
| 0.000593
| 0.234647
| 19,817
| 402
| 238
| 49.29602
| 0.838135
| 0.383913
| 0
| 0.633929
| 1
| 0
| 0.11606
| 0.015587
| 0
| 0
| 0
| 0
| 0
| 1
| 0.15625
| false
| 0.004464
| 0.03125
| 0
| 0.28125
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
ecd59184eb7d43a9bf1300742472a2fd7e583d9e
| 51,018
|
py
|
Python
|
Alignment/MuonAlignmentAlgorithms/scripts/signConventions.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 852
|
2015-01-11T21:03:51.000Z
|
2022-03-25T21:14:00.000Z
|
Alignment/MuonAlignmentAlgorithms/scripts/signConventions.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 30,371
|
2015-01-02T00:14:40.000Z
|
2022-03-31T23:26:05.000Z
|
Alignment/MuonAlignmentAlgorithms/scripts/signConventions.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 3,240
|
2015-01-02T05:53:18.000Z
|
2022-03-31T17:24:21.000Z
|
signConventions = {
("DT", -2, 1, 1): (1, -1, -1, 432.946, 0.0904811, -533.35),
("DT", -2, 1, 2): (1, -1, -1, 432.946, 0.61408, -533.35),
("DT", -2, 1, 3): (1, -1, -1, 432.946, 1.13768, -533.35),
("DT", -2, 1, 4): (1, -1, -1, 432.946, 1.66128, -533.35),
("DT", -2, 1, 5): (1, -1, -1, 432.946, 2.18488, -533.35),
("DT", -2, 1, 6): (1, -1, -1, 432.946, 2.70847, -533.35),
("DT", -2, 1, 7): (1, -1, -1, 432.946, -3.05111, -533.35),
("DT", -2, 1, 8): (1, -1, -1, 432.946, -2.52751, -533.35),
("DT", -2, 1, 9): (1, -1, -1, 432.946, -2.00391, -533.35),
("DT", -2, 1, 10): (1, -1, -1, 432.946, -1.48032, -533.35),
("DT", -2, 1, 11): (1, -1, -1, 432.946, -0.956716, -533.35),
("DT", -2, 1, 12): (1, -1, -1, 432.946, -0.433118, -533.35),
("DT", -2, 2, 1): (1, -1, -1, 512.923, -0.0417923, -533.35),
("DT", -2, 2, 2): (1, -1, -1, 512.923, 0.481806, -533.35),
("DT", -2, 2, 3): (1, -1, -1, 512.923, 1.00541, -533.35),
("DT", -2, 2, 4): (1, -1, -1, 512.923, 1.529, -533.35),
("DT", -2, 2, 5): (1, -1, -1, 512.923, 2.0526, -533.35),
("DT", -2, 2, 6): (1, -1, -1, 512.923, 2.5762, -533.35),
("DT", -2, 2, 7): (1, -1, -1, 512.923, 3.0998, -533.35),
("DT", -2, 2, 8): (1, -1, -1, 512.923, -2.65979, -533.35),
("DT", -2, 2, 9): (1, -1, -1, 512.923, -2.13619, -533.35),
("DT", -2, 2, 10): (1, -1, -1, 512.923, -1.61259, -533.35),
("DT", -2, 2, 11): (1, -1, -1, 512.923, -1.08899, -533.35),
("DT", -2, 2, 12): (1, -1, -1, 512.923, -0.565391, -533.35),
("DT", -2, 3, 1): (1, -1, -1, 618.269, 0.0357202, -533.35),
("DT", -2, 3, 2): (1, -1, -1, 618.269, 0.559319, -533.35),
("DT", -2, 3, 3): (1, -1, -1, 618.269, 1.08292, -533.35),
("DT", -2, 3, 4): (1, -1, -1, 618.269, 1.60652, -533.35),
("DT", -2, 3, 5): (1, -1, -1, 618.269, 2.13012, -533.35),
("DT", -2, 3, 6): (1, -1, -1, 618.269, 2.65371, -533.35),
("DT", -2, 3, 7): (1, -1, -1, 618.269, -3.10587, -533.35),
("DT", -2, 3, 8): (1, -1, -1, 618.269, -2.58227, -533.35),
("DT", -2, 3, 9): (1, -1, -1, 618.269, -2.05868, -533.35),
("DT", -2, 3, 10): (1, -1, -1, 618.269, -1.53508, -533.35),
("DT", -2, 3, 11): (1, -1, -1, 618.269, -1.01148, -533.35),
("DT", -2, 3, 12): (1, -1, -1, 618.269, -0.487879, -533.35),
("DT", -2, 4, 1): (1, -1, -1, 726.425, -0.131007, -533.35),
("DT", -2, 4, 2): (1, -1, -1, 726.425, 0.392591, -533.35),
("DT", -2, 4, 3): (1, -1, -1, 726.425, 0.91619, -533.35),
("DT", -2, 4, 4): (1, -1, -1, 737.922, 1.35119, -533.35),
("DT", -2, 4, 13): (1, -1, -1, 737.922, 1.7904, -533.35),
("DT", -2, 4, 5): (1, -1, -1, 726.425, 2.2254, -533.35),
("DT", -2, 4, 6): (1, -1, -1, 726.425, 2.749, -533.35),
("DT", -2, 4, 7): (1, -1, -1, 726.425, -3.01059, -533.35),
("DT", -2, 4, 8): (1, -1, -1, 725.376, -2.49846, -533.35),
("DT", -2, 4, 9): (1, -1, -1, 722.674, -2.08612, -533.35),
("DT", -2, 4, 10): (1, -1, -1, 733.072, -1.75847, -533.35),
("DT", -2, 4, 14): (1, -1, -1, 733.072, -1.38313, -533.35),
("DT", -2, 4, 11): (1, -1, -1, 722.674, -1.05548, -533.35),
("DT", -2, 4, 12): (1, -1, -1, 725.376, -0.643132, -533.35),
("DT", -1, 1, 1): (1, -1, -1, 432.946, 0.0904811, -267.75),
("DT", -1, 1, 2): (1, -1, -1, 432.946, 0.61408, -267.75),
("DT", -1, 1, 3): (1, -1, -1, 432.946, 1.13768, -287.25),
("DT", -1, 1, 4): (1, -1, -1, 432.946, 1.66128, -267.75),
("DT", -1, 1, 5): (1, -1, -1, 432.946, 2.18488, -267.75),
("DT", -1, 1, 6): (1, -1, -1, 432.946, 2.70847, -267.75),
("DT", -1, 1, 7): (1, -1, -1, 432.946, -3.05111, -267.75),
("DT", -1, 1, 8): (1, -1, -1, 432.946, -2.52751, -267.75),
("DT", -1, 1, 9): (1, -1, -1, 432.946, -2.00391, -267.75),
("DT", -1, 1, 10): (1, -1, -1, 432.946, -1.48032, -267.75),
("DT", -1, 1, 11): (1, -1, -1, 432.946, -0.956716, -267.75),
("DT", -1, 1, 12): (1, -1, -1, 432.946, -0.433118, -267.75),
("DT", -1, 2, 1): (1, -1, -1, 512.923, -0.0417923, -267.75),
("DT", -1, 2, 2): (1, -1, -1, 512.923, 0.481806, -267.75),
("DT", -1, 2, 3): (1, -1, -1, 512.923, 1.00541, -287.25),
("DT", -1, 2, 4): (1, -1, -1, 512.923, 1.529, -267.75),
("DT", -1, 2, 5): (1, -1, -1, 512.923, 2.0526, -267.75),
("DT", -1, 2, 6): (1, -1, -1, 512.923, 2.5762, -267.75),
("DT", -1, 2, 7): (1, -1, -1, 512.923, 3.0998, -267.75),
("DT", -1, 2, 8): (1, -1, -1, 512.923, -2.65979, -267.75),
("DT", -1, 2, 9): (1, -1, -1, 512.923, -2.13619, -267.75),
("DT", -1, 2, 10): (1, -1, -1, 512.923, -1.61259, -267.75),
("DT", -1, 2, 11): (1, -1, -1, 512.923, -1.08899, -267.75),
("DT", -1, 2, 12): (1, -1, -1, 512.923, -0.565391, -267.75),
("DT", -1, 3, 1): (1, -1, -1, 618.269, 0.0357202, -267.75),
("DT", -1, 3, 2): (1, -1, -1, 618.269, 0.559319, -267.75),
("DT", -1, 3, 3): (1, -1, -1, 618.269, 1.08292, -287.25),
("DT", -1, 3, 4): (1, -1, -1, 618.269, 1.60652, -267.75),
("DT", -1, 3, 5): (1, -1, -1, 618.269, 2.13012, -267.75),
("DT", -1, 3, 6): (1, -1, -1, 618.269, 2.65371, -267.75),
("DT", -1, 3, 7): (1, -1, -1, 618.269, -3.10587, -267.75),
("DT", -1, 3, 8): (1, -1, -1, 618.269, -2.58227, -267.75),
("DT", -1, 3, 9): (1, -1, -1, 618.269, -2.05868, -267.75),
("DT", -1, 3, 10): (1, -1, -1, 618.269, -1.53508, -267.75),
("DT", -1, 3, 11): (1, -1, -1, 618.269, -1.01148, -267.75),
("DT", -1, 3, 12): (1, -1, -1, 618.269, -0.487879, -267.75),
("DT", -1, 4, 1): (1, -1, -1, 726.425, -0.131007, -267.75),
("DT", -1, 4, 2): (1, -1, -1, 726.425, 0.392591, -267.75),
("DT", -1, 4, 3): (1, -1, -1, 726.425, 0.91619, -287.25),
("DT", -1, 4, 4): (1, -1, -1, 737.922, 1.35119, -267.75),
("DT", -1, 4, 13): (1, -1, -1, 737.922, 1.7904, -267.75),
("DT", -1, 4, 5): (1, -1, -1, 726.425, 2.2254, -267.75),
("DT", -1, 4, 6): (1, -1, -1, 726.425, 2.749, -267.75),
("DT", -1, 4, 7): (1, -1, -1, 726.425, -3.01059, -267.75),
("DT", -1, 4, 8): (1, -1, -1, 725.376, -2.49846, -267.75),
("DT", -1, 4, 9): (1, -1, -1, 722.674, -2.08612, -267.75),
("DT", -1, 4, 10): (1, -1, -1, 733.072, -1.75847, -267.75),
("DT", -1, 4, 14): (1, -1, -1, 733.072, -1.38313, -267.75),
("DT", -1, 4, 11): (1, -1, -1, 722.674, -1.05548, -267.75),
("DT", -1, 4, 12): (1, -1, -1, 725.376, -0.643132, -267.75),
("DT", 0, 1, 1): (1, -1, -1, 432.946, 0.0904811, 0.85),
("DT", 0, 1, 5): (1, -1, -1, 432.946, 2.18488, 0.85),
("DT", 0, 1, 9): (1, -1, -1, 432.946, -2.00391, 0.85),
("DT", 0, 1, 2): (-1, 1, -1, 432.946, 0.61408, -0.85),
("DT", 0, 1, 6): (-1, 1, -1, 432.946, 2.70847, -0.85),
("DT", 0, 1, 10): (-1, 1, -1, 432.946, -1.48032, -0.85),
("DT", 0, 1, 3): (-1, 1, -1, 432.946, 1.13768, -0.85),
("DT", 0, 1, 7): (-1, 1, -1, 432.946, -3.05111, -0.85),
("DT", 0, 1, 11): (-1, 1, -1, 432.946, -0.956716, -0.85),
("DT", 0, 1, 4): (1, -1, -1, 432.946, 1.66128, 0.85),
("DT", 0, 1, 8): (1, -1, -1, 432.946, -2.52751, 0.85),
("DT", 0, 1, 12): (1, -1, -1, 432.946, -0.433118, 0.85),
("DT", 0, 2, 1): (1, -1, -1, 512.923, -0.0417923, 0.85),
("DT", 0, 2, 5): (1, -1, -1, 512.923, 2.0526, 0.85),
("DT", 0, 2, 9): (1, -1, -1, 512.923, -2.13619, 0.85),
("DT", 0, 2, 2): (-1, 1, -1, 512.923, 0.481806, -0.85),
("DT", 0, 2, 6): (-1, 1, -1, 512.923, 2.5762, -0.85),
("DT", 0, 2, 10): (-1, 1, -1, 512.923, -1.61259, -0.85),
("DT", 0, 2, 3): (-1, 1, -1, 512.923, 1.00541, -0.85),
("DT", 0, 2, 7): (-1, 1, -1, 512.923, 3.0998, -0.85),
("DT", 0, 2, 11): (-1, 1, -1, 512.923, -1.08899, -0.85),
("DT", 0, 2, 4): (1, -1, -1, 512.923, 1.529, 0.85),
("DT", 0, 2, 8): (1, -1, -1, 512.923, -2.65979, 0.85),
("DT", 0, 2, 12): (1, -1, -1, 512.923, -0.565391, 0.85),
("DT", 0, 3, 1): (1, -1, -1, 618.269, 0.0357202, 0.85),
("DT", 0, 3, 5): (1, -1, -1, 618.269, 2.13012, 0.85),
("DT", 0, 3, 9): (1, -1, -1, 618.269, -2.05868, 0.85),
("DT", 0, 3, 2): (-1, 1, -1, 618.269, 0.559319, -0.85),
("DT", 0, 3, 6): (-1, 1, -1, 618.269, 2.65371, -0.85),
("DT", 0, 3, 10): (-1, 1, -1, 618.269, -1.53508, -0.85),
("DT", 0, 3, 3): (-1, 1, -1, 618.269, 1.08292, -0.85),
("DT", 0, 3, 7): (-1, 1, -1, 618.269, -3.10587, -0.85),
("DT", 0, 3, 11): (-1, 1, -1, 618.269, -1.01148, -0.85),
("DT", 0, 3, 4): (1, -1, -1, 618.269, 1.60652, 0.85),
("DT", 0, 3, 8): (1, -1, -1, 618.269, -2.58227, 0.85),
("DT", 0, 3, 12): (1, -1, -1, 618.269, -0.487879, 0.85),
("DT", 0, 4, 1): (1, -1, -1, 726.425, -0.131007, 0.85),
("DT", 0, 4, 2): (-1, 1, -1, 726.425, 0.392591, -0.85),
("DT", 0, 4, 3): (-1, 1, -1, 726.425, 0.91619, -0.85),
("DT", 0, 4, 4): (1, -1, -1, 737.922, 1.35119, 0.85),
("DT", 0, 4, 13): (1, -1, -1, 737.922, 1.7904, 0.85),
("DT", 0, 4, 5): (1, -1, -1, 726.425, 2.2254, 0.85),
("DT", 0, 4, 6): (-1, 1, -1, 726.425, 2.749, -0.85),
("DT", 0, 4, 7): (-1, 1, -1, 726.425, -3.01059, -0.85),
("DT", 0, 4, 8): (1, -1, -1, 725.376, -2.49846, 0.85),
("DT", 0, 4, 9): (1, -1, -1, 722.674, -2.08612, 0.85),
("DT", 0, 4, 10): (-1, 1, -1, 733.072, -1.75847, -0.85),
("DT", 0, 4, 14): (-1, 1, -1, 733.072, -1.38313, -0.85),
("DT", 0, 4, 11): (-1, 1, -1, 722.674, -1.05548, -0.85),
("DT", 0, 4, 12): (1, -1, -1, 725.376, -0.643132, 0.85),
("DT", 1, 1, 1): (-1, 1, -1, 432.946, 0.0904811, 267.75),
("DT", 1, 1, 2): (-1, 1, -1, 432.946, 0.61408, 267.75),
("DT", 1, 1, 3): (-1, 1, -1, 432.946, 1.13768, 267.75),
("DT", 1, 1, 4): (-1, 1, -1, 432.946, 1.66128, 287.25),
("DT", 1, 1, 5): (-1, 1, -1, 432.946, 2.18488, 267.75),
("DT", 1, 1, 6): (-1, 1, -1, 432.946, 2.70847, 267.75),
("DT", 1, 1, 7): (-1, 1, -1, 432.946, -3.05111, 267.75),
("DT", 1, 1, 8): (-1, 1, -1, 432.946, -2.52751, 267.75),
("DT", 1, 1, 9): (-1, 1, -1, 432.946, -2.00391, 267.75),
("DT", 1, 1, 10): (-1, 1, -1, 432.946, -1.48032, 267.75),
("DT", 1, 1, 11): (-1, 1, -1, 432.946, -0.956716, 267.75),
("DT", 1, 1, 12): (-1, 1, -1, 432.946, -0.433118, 267.75),
("DT", 1, 2, 1): (-1, 1, -1, 512.923, -0.0417923, 267.75),
("DT", 1, 2, 2): (-1, 1, -1, 512.923, 0.481806, 267.75),
("DT", 1, 2, 3): (-1, 1, -1, 512.923, 1.00541, 267.75),
("DT", 1, 2, 4): (-1, 1, -1, 512.923, 1.529, 287.25),
("DT", 1, 2, 5): (-1, 1, -1, 512.923, 2.0526, 267.75),
("DT", 1, 2, 6): (-1, 1, -1, 512.923, 2.5762, 267.75),
("DT", 1, 2, 7): (-1, 1, -1, 512.923, 3.0998, 267.75),
("DT", 1, 2, 8): (-1, 1, -1, 512.923, -2.65979, 267.75),
("DT", 1, 2, 9): (-1, 1, -1, 512.923, -2.13619, 267.75),
("DT", 1, 2, 10): (-1, 1, -1, 512.923, -1.61259, 267.75),
("DT", 1, 2, 11): (-1, 1, -1, 512.923, -1.08899, 267.75),
("DT", 1, 2, 12): (-1, 1, -1, 512.923, -0.565391, 267.75),
("DT", 1, 3, 1): (-1, 1, -1, 618.269, 0.0357202, 267.75),
("DT", 1, 3, 2): (-1, 1, -1, 618.269, 0.559319, 267.75),
("DT", 1, 3, 3): (-1, 1, -1, 618.269, 1.08292, 267.75),
("DT", 1, 3, 4): (-1, 1, -1, 618.269, 1.60652, 287.25),
("DT", 1, 3, 5): (-1, 1, -1, 618.269, 2.13012, 267.75),
("DT", 1, 3, 6): (-1, 1, -1, 618.269, 2.65371, 267.75),
("DT", 1, 3, 7): (-1, 1, -1, 618.269, -3.10587, 267.75),
("DT", 1, 3, 8): (-1, 1, -1, 618.269, -2.58227, 267.75),
("DT", 1, 3, 9): (-1, 1, -1, 618.269, -2.05868, 267.75),
("DT", 1, 3, 10): (-1, 1, -1, 618.269, -1.53508, 267.75),
("DT", 1, 3, 11): (-1, 1, -1, 618.269, -1.01148, 267.75),
("DT", 1, 3, 12): (-1, 1, -1, 618.269, -0.487879, 267.75),
("DT", 1, 4, 1): (-1, 1, -1, 726.425, -0.131007, 267.75),
("DT", 1, 4, 2): (-1, 1, -1, 726.425, 0.392591, 267.75),
("DT", 1, 4, 3): (-1, 1, -1, 726.425, 0.91619, 267.75),
("DT", 1, 4, 4): (-1, 1, -1, 737.922, 1.35119, 287.25),
("DT", 1, 4, 13): (-1, 1, -1, 737.922, 1.7904, 287.25),
("DT", 1, 4, 5): (-1, 1, -1, 726.425, 2.2254, 267.75),
("DT", 1, 4, 6): (-1, 1, -1, 726.425, 2.749, 267.75),
("DT", 1, 4, 7): (-1, 1, -1, 726.425, -3.01059, 267.75),
("DT", 1, 4, 8): (-1, 1, -1, 725.376, -2.49846, 267.75),
("DT", 1, 4, 9): (-1, 1, -1, 722.674, -2.08612, 267.75),
("DT", 1, 4, 10): (-1, 1, -1, 733.072, -1.75847, 267.75),
("DT", 1, 4, 14): (-1, 1, -1, 733.072, -1.38313, 267.75),
("DT", 1, 4, 11): (-1, 1, -1, 722.674, -1.05548, 267.75),
("DT", 1, 4, 12): (-1, 1, -1, 725.376, -0.643132, 267.75),
("DT", 2, 1, 1): (-1, 1, -1, 432.946, 0.0904811, 533.35),
("DT", 2, 1, 2): (-1, 1, -1, 432.946, 0.61408, 533.35),
("DT", 2, 1, 3): (-1, 1, -1, 432.946, 1.13768, 533.35),
("DT", 2, 1, 4): (-1, 1, -1, 432.946, 1.66128, 533.35),
("DT", 2, 1, 5): (-1, 1, -1, 432.946, 2.18488, 533.35),
("DT", 2, 1, 6): (-1, 1, -1, 432.946, 2.70847, 533.35),
("DT", 2, 1, 7): (-1, 1, -1, 432.946, -3.05111, 533.35),
("DT", 2, 1, 8): (-1, 1, -1, 432.946, -2.52751, 533.35),
("DT", 2, 1, 9): (-1, 1, -1, 432.946, -2.00391, 533.35),
("DT", 2, 1, 10): (-1, 1, -1, 432.946, -1.48032, 533.35),
("DT", 2, 1, 11): (-1, 1, -1, 432.946, -0.956716, 533.35),
("DT", 2, 1, 12): (-1, 1, -1, 432.946, -0.433118, 533.35),
("DT", 2, 2, 1): (-1, 1, -1, 512.923, -0.0417923, 533.35),
("DT", 2, 2, 2): (-1, 1, -1, 512.923, 0.481806, 533.35),
("DT", 2, 2, 3): (-1, 1, -1, 512.923, 1.00541, 533.35),
("DT", 2, 2, 4): (-1, 1, -1, 512.923, 1.529, 533.35),
("DT", 2, 2, 5): (-1, 1, -1, 512.923, 2.0526, 533.35),
("DT", 2, 2, 6): (-1, 1, -1, 512.923, 2.5762, 533.35),
("DT", 2, 2, 7): (-1, 1, -1, 512.923, 3.0998, 533.35),
("DT", 2, 2, 8): (-1, 1, -1, 512.923, -2.65979, 533.35),
("DT", 2, 2, 9): (-1, 1, -1, 512.923, -2.13619, 533.35),
("DT", 2, 2, 10): (-1, 1, -1, 512.923, -1.61259, 533.35),
("DT", 2, 2, 11): (-1, 1, -1, 512.923, -1.08899, 533.35),
("DT", 2, 2, 12): (-1, 1, -1, 512.923, -0.565391, 533.35),
("DT", 2, 3, 1): (-1, 1, -1, 618.269, 0.0357202, 533.35),
("DT", 2, 3, 2): (-1, 1, -1, 618.269, 0.559319, 533.35),
("DT", 2, 3, 3): (-1, 1, -1, 618.269, 1.08292, 533.35),
("DT", 2, 3, 4): (-1, 1, -1, 618.269, 1.60652, 533.35),
("DT", 2, 3, 5): (-1, 1, -1, 618.269, 2.13012, 533.35),
("DT", 2, 3, 6): (-1, 1, -1, 618.269, 2.65371, 533.35),
("DT", 2, 3, 7): (-1, 1, -1, 618.269, -3.10587, 533.35),
("DT", 2, 3, 8): (-1, 1, -1, 618.269, -2.58227, 533.35),
("DT", 2, 3, 9): (-1, 1, -1, 618.269, -2.05868, 533.35),
("DT", 2, 3, 10): (-1, 1, -1, 618.269, -1.53508, 533.35),
("DT", 2, 3, 11): (-1, 1, -1, 618.269, -1.01148, 533.35),
("DT", 2, 3, 12): (-1, 1, -1, 618.269, -0.487879, 533.35),
("DT", 2, 4, 1): (-1, 1, -1, 726.425, -0.131007, 533.35),
("DT", 2, 4, 2): (-1, 1, -1, 726.425, 0.392591, 533.35),
("DT", 2, 4, 3): (-1, 1, -1, 726.425, 0.91619, 533.35),
("DT", 2, 4, 4): (-1, 1, -1, 737.922, 1.35119, 533.35),
("DT", 2, 4, 13): (-1, 1, -1, 737.922, 1.7904, 533.35),
("DT", 2, 4, 5): (-1, 1, -1, 726.425, 2.2254, 533.35),
("DT", 2, 4, 6): (-1, 1, -1, 726.425, 2.749, 533.35),
("DT", 2, 4, 7): (-1, 1, -1, 726.425, -3.01059, 533.35),
("DT", 2, 4, 8): (-1, 1, -1, 725.376, -2.49846, 533.35),
("DT", 2, 4, 9): (-1, 1, -1, 722.674, -2.08612, 533.35),
("DT", 2, 4, 10): (-1, 1, -1, 733.072, -1.75847, 533.35),
("DT", 2, 4, 14): (-1, 1, -1, 733.072, -1.38313, 533.35),
("DT", 2, 4, 11): (-1, 1, -1, 722.674, -1.05548, 533.35),
("DT", 2, 4, 12): (-1, 1, -1, 725.376, -0.643132, 533.35),
("CSC", 1, 1, 1, 1): (1, 1, -1, 181.5, -1.74066e-15, 616.95),
("CSC", 1, 1, 1, 3): (1, 1, -1, 181.5, 0.349066, 616.95),
("CSC", 1, 1, 1, 5): (1, 1, -1, 181.5, 0.698132, 616.95),
("CSC", 1, 1, 1, 7): (1, 1, -1, 181.5, 1.0472, 616.95),
("CSC", 1, 1, 1, 9): (1, 1, -1, 181.5, 1.39626, 616.95),
("CSC", 1, 1, 1, 11): (1, 1, -1, 181.5, 1.74533, 616.95),
("CSC", 1, 1, 1, 13): (1, 1, -1, 181.5, 2.0944, 616.95),
("CSC", 1, 1, 1, 15): (1, 1, -1, 181.5, 2.44346, 616.95),
("CSC", 1, 1, 1, 17): (1, 1, -1, 181.5, 2.79253, 616.95),
("CSC", 1, 1, 1, 19): (1, 1, -1, 181.5, 3.14159, 616.95),
("CSC", 1, 1, 1, 21): (1, 1, -1, 181.5, -2.79253, 616.95),
("CSC", 1, 1, 1, 23): (1, 1, -1, 181.5, -2.44346, 616.95),
("CSC", 1, 1, 1, 25): (1, 1, -1, 181.5, -2.0944, 616.95),
("CSC", 1, 1, 1, 27): (1, 1, -1, 181.5, -1.74533, 616.95),
("CSC", 1, 1, 1, 29): (1, 1, -1, 181.5, -1.39626, 616.95),
("CSC", 1, 1, 1, 31): (1, 1, -1, 181.5, -1.0472, 616.95),
("CSC", 1, 1, 1, 33): (1, 1, -1, 181.5, -0.698132, 616.95),
("CSC", 1, 1, 1, 35): (1, 1, -1, 181.5, -0.349066, 616.95),
("CSC", 1, 1, 1, 2): (1, 1, -1, 181.5, 0.174533, 587.65),
("CSC", 1, 1, 1, 4): (1, 1, -1, 181.5, 0.523599, 587.65),
("CSC", 1, 1, 1, 6): (1, 1, -1, 181.5, 0.872665, 587.65),
("CSC", 1, 1, 1, 8): (1, 1, -1, 181.5, 1.22173, 587.65),
("CSC", 1, 1, 1, 10): (1, 1, -1, 181.5, 1.5708, 587.65),
("CSC", 1, 1, 1, 12): (1, 1, -1, 181.5, 1.91986, 587.65),
("CSC", 1, 1, 1, 14): (1, 1, -1, 181.5, 2.26893, 587.65),
("CSC", 1, 1, 1, 16): (1, 1, -1, 181.5, 2.61799, 587.65),
("CSC", 1, 1, 1, 18): (1, 1, -1, 181.5, 2.96706, 587.65),
("CSC", 1, 1, 1, 20): (1, 1, -1, 181.5, -2.96706, 587.65),
("CSC", 1, 1, 1, 22): (1, 1, -1, 181.5, -2.61799, 587.65),
("CSC", 1, 1, 1, 24): (1, 1, -1, 181.5, -2.26893, 587.65),
("CSC", 1, 1, 1, 26): (1, 1, -1, 181.5, -1.91986, 587.65),
("CSC", 1, 1, 1, 28): (1, 1, -1, 181.5, -1.5708, 587.65),
("CSC", 1, 1, 1, 30): (1, 1, -1, 181.5, -1.22173, 587.65),
("CSC", 1, 1, 1, 32): (1, 1, -1, 181.5, -0.872665, 587.65),
("CSC", 1, 1, 1, 34): (1, 1, -1, 181.5, -0.523599, 587.65),
("CSC", 1, 1, 1, 36): (1, 1, -1, 181.5, -0.174533, 587.65),
("CSC", 1, 1, 2, 1): (1, 1, -1, 369.7, -1.19913e-15, 712.761),
("CSC", 1, 1, 2, 3): (1, 1, -1, 369.7, 0.349066, 712.761),
("CSC", 1, 1, 2, 5): (1, 1, -1, 369.7, 0.698132, 712.761),
("CSC", 1, 1, 2, 7): (1, 1, -1, 369.7, 1.0472, 712.761),
("CSC", 1, 1, 2, 9): (1, 1, -1, 369.7, 1.39626, 712.761),
("CSC", 1, 1, 2, 11): (1, 1, -1, 369.7, 1.74533, 712.761),
("CSC", 1, 1, 2, 13): (1, 1, -1, 369.7, 2.0944, 712.761),
("CSC", 1, 1, 2, 15): (1, 1, -1, 369.7, 2.44346, 712.761),
("CSC", 1, 1, 2, 17): (1, 1, -1, 369.7, 2.79253, 712.761),
("CSC", 1, 1, 2, 19): (1, 1, -1, 369.7, 3.14159, 712.761),
("CSC", 1, 1, 2, 21): (1, 1, -1, 369.7, -2.79253, 712.761),
("CSC", 1, 1, 2, 23): (1, 1, -1, 369.7, -2.44346, 712.761),
("CSC", 1, 1, 2, 25): (1, 1, -1, 369.7, -2.0944, 712.761),
("CSC", 1, 1, 2, 27): (1, 1, -1, 369.7, -1.74533, 712.761),
("CSC", 1, 1, 2, 29): (1, 1, -1, 369.7, -1.39626, 712.761),
("CSC", 1, 1, 2, 31): (1, 1, -1, 369.7, -1.0472, 712.761),
("CSC", 1, 1, 2, 33): (1, 1, -1, 369.7, -0.698132, 712.761),
("CSC", 1, 1, 2, 35): (1, 1, -1, 369.7, -0.349066, 712.761),
("CSC", 1, 1, 2, 2): (1, 1, -1, 369.7, 0.174533, 685.361),
("CSC", 1, 1, 2, 4): (1, 1, -1, 369.7, 0.523599, 685.361),
("CSC", 1, 1, 2, 6): (1, 1, -1, 369.7, 0.872665, 685.361),
("CSC", 1, 1, 2, 8): (1, 1, -1, 369.7, 1.22173, 685.361),
("CSC", 1, 1, 2, 10): (1, 1, -1, 369.7, 1.5708, 685.361),
("CSC", 1, 1, 2, 12): (1, 1, -1, 369.7, 1.91986, 685.361),
("CSC", 1, 1, 2, 14): (1, 1, -1, 369.7, 2.26893, 685.361),
("CSC", 1, 1, 2, 16): (1, 1, -1, 369.7, 2.61799, 685.361),
("CSC", 1, 1, 2, 18): (1, 1, -1, 369.7, 2.96706, 685.361),
("CSC", 1, 1, 2, 20): (1, 1, -1, 369.7, -2.96706, 685.361),
("CSC", 1, 1, 2, 22): (1, 1, -1, 369.7, -2.61799, 685.361),
("CSC", 1, 1, 2, 24): (1, 1, -1, 369.7, -2.26893, 685.361),
("CSC", 1, 1, 2, 26): (1, 1, -1, 369.7, -1.91986, 685.361),
("CSC", 1, 1, 2, 28): (1, 1, -1, 369.7, -1.5708, 685.361),
("CSC", 1, 1, 2, 30): (1, 1, -1, 369.7, -1.22173, 685.361),
("CSC", 1, 1, 2, 32): (1, 1, -1, 369.7, -0.872665, 685.361),
("CSC", 1, 1, 2, 34): (1, 1, -1, 369.7, -0.523599, 685.361),
("CSC", 1, 1, 2, 36): (1, 1, -1, 369.7, -0.174533, 685.361),
("CSC", 1, 1, 3, 1): (1, 1, -1, 595.15, -9.19576e-16, 695.159),
("CSC", 1, 1, 3, 2): (1, 1, -1, 595.15, 0.174533, 695.159),
("CSC", 1, 1, 3, 3): (1, 1, -1, 595.15, 0.349066, 695.159),
("CSC", 1, 1, 3, 4): (1, 1, -1, 595.15, 0.523599, 695.159),
("CSC", 1, 1, 3, 5): (1, 1, -1, 595.15, 0.698132, 695.159),
("CSC", 1, 1, 3, 6): (1, 1, -1, 595.15, 0.872665, 695.159),
("CSC", 1, 1, 3, 7): (1, 1, -1, 595.15, 1.0472, 695.159),
("CSC", 1, 1, 3, 8): (1, 1, -1, 595.15, 1.22173, 695.159),
("CSC", 1, 1, 3, 9): (1, 1, -1, 595.15, 1.39626, 695.159),
("CSC", 1, 1, 3, 10): (1, 1, -1, 595.15, 1.5708, 695.159),
("CSC", 1, 1, 3, 11): (1, 1, -1, 595.15, 1.74533, 695.159),
("CSC", 1, 1, 3, 12): (1, 1, -1, 595.15, 1.91986, 695.159),
("CSC", 1, 1, 3, 13): (1, 1, -1, 595.15, 2.0944, 695.159),
("CSC", 1, 1, 3, 14): (1, 1, -1, 595.15, 2.26893, 695.159),
("CSC", 1, 1, 3, 15): (1, 1, -1, 595.15, 2.44346, 695.159),
("CSC", 1, 1, 3, 16): (1, 1, -1, 595.15, 2.61799, 695.159),
("CSC", 1, 1, 3, 17): (1, 1, -1, 595.15, 2.79253, 695.159),
("CSC", 1, 1, 3, 18): (1, 1, -1, 595.15, 2.96706, 695.159),
("CSC", 1, 1, 3, 19): (1, 1, -1, 595.15, -3.14159, 695.159),
("CSC", 1, 1, 3, 20): (1, 1, -1, 595.15, -2.96706, 695.159),
("CSC", 1, 1, 3, 21): (1, 1, -1, 595.15, -2.79253, 695.159),
("CSC", 1, 1, 3, 22): (1, 1, -1, 595.15, -2.61799, 695.159),
("CSC", 1, 1, 3, 23): (1, 1, -1, 595.15, -2.44346, 695.159),
("CSC", 1, 1, 3, 24): (1, 1, -1, 595.15, -2.26893, 695.159),
("CSC", 1, 1, 3, 25): (1, 1, -1, 595.15, -2.0944, 695.159),
("CSC", 1, 1, 3, 26): (1, 1, -1, 595.15, -1.91986, 695.159),
("CSC", 1, 1, 3, 27): (1, 1, -1, 595.15, -1.74533, 695.159),
("CSC", 1, 1, 3, 28): (1, 1, -1, 595.15, -1.5708, 695.159),
("CSC", 1, 1, 3, 29): (1, 1, -1, 595.15, -1.39626, 695.159),
("CSC", 1, 1, 3, 30): (1, 1, -1, 595.15, -1.22173, 695.159),
("CSC", 1, 1, 3, 31): (1, 1, -1, 595.15, -1.0472, 695.159),
("CSC", 1, 1, 3, 32): (1, 1, -1, 595.15, -0.872665, 695.159),
("CSC", 1, 1, 3, 33): (1, 1, -1, 595.15, -0.698132, 695.159),
("CSC", 1, 1, 3, 34): (1, 1, -1, 595.15, -0.523599, 695.159),
("CSC", 1, 1, 3, 35): (1, 1, -1, 595.15, -0.349066, 695.159),
("CSC", 1, 1, 3, 36): (1, 1, -1, 595.15, -0.174533, 695.159),
("CSC", 1, 1, 4, 1): (1, 1, -1, 181.5, -1.74066e-15, 616.95),
("CSC", 1, 1, 4, 3): (1, 1, -1, 181.5, 0.349066, 616.95),
("CSC", 1, 1, 4, 5): (1, 1, -1, 181.5, 0.698132, 616.95),
("CSC", 1, 1, 4, 7): (1, 1, -1, 181.5, 1.0472, 616.95),
("CSC", 1, 1, 4, 9): (1, 1, -1, 181.5, 1.39626, 616.95),
("CSC", 1, 1, 4, 11): (1, 1, -1, 181.5, 1.74533, 616.95),
("CSC", 1, 1, 4, 13): (1, 1, -1, 181.5, 2.0944, 616.95),
("CSC", 1, 1, 4, 15): (1, 1, -1, 181.5, 2.44346, 616.95),
("CSC", 1, 1, 4, 17): (1, 1, -1, 181.5, 2.79253, 616.95),
("CSC", 1, 1, 4, 19): (1, 1, -1, 181.5, 3.14159, 616.95),
("CSC", 1, 1, 4, 21): (1, 1, -1, 181.5, -2.79253, 616.95),
("CSC", 1, 1, 4, 23): (1, 1, -1, 181.5, -2.44346, 616.95),
("CSC", 1, 1, 4, 25): (1, 1, -1, 181.5, -2.0944, 616.95),
("CSC", 1, 1, 4, 27): (1, 1, -1, 181.5, -1.74533, 616.95),
("CSC", 1, 1, 4, 29): (1, 1, -1, 181.5, -1.39626, 616.95),
("CSC", 1, 1, 4, 31): (1, 1, -1, 181.5, -1.0472, 616.95),
("CSC", 1, 1, 4, 33): (1, 1, -1, 181.5, -0.698132, 616.95),
("CSC", 1, 1, 4, 35): (1, 1, -1, 181.5, -0.349066, 616.95),
("CSC", 1, 1, 4, 2): (1, 1, -1, 181.5, 0.174533, 587.65),
("CSC", 1, 1, 4, 4): (1, 1, -1, 181.5, 0.523599, 587.65),
("CSC", 1, 1, 4, 6): (1, 1, -1, 181.5, 0.872665, 587.65),
("CSC", 1, 1, 4, 8): (1, 1, -1, 181.5, 1.22173, 587.65),
("CSC", 1, 1, 4, 10): (1, 1, -1, 181.5, 1.5708, 587.65),
("CSC", 1, 1, 4, 12): (1, 1, -1, 181.5, 1.91986, 587.65),
("CSC", 1, 1, 4, 14): (1, 1, -1, 181.5, 2.26893, 587.65),
("CSC", 1, 1, 4, 16): (1, 1, -1, 181.5, 2.61799, 587.65),
("CSC", 1, 1, 4, 18): (1, 1, -1, 181.5, 2.96706, 587.65),
("CSC", 1, 1, 4, 20): (1, 1, -1, 181.5, -2.96706, 587.65),
("CSC", 1, 1, 4, 22): (1, 1, -1, 181.5, -2.61799, 587.65),
("CSC", 1, 1, 4, 24): (1, 1, -1, 181.5, -2.26893, 587.65),
("CSC", 1, 1, 4, 26): (1, 1, -1, 181.5, -1.91986, 587.65),
("CSC", 1, 1, 4, 28): (1, 1, -1, 181.5, -1.5708, 587.65),
("CSC", 1, 1, 4, 30): (1, 1, -1, 181.5, -1.22173, 587.65),
("CSC", 1, 1, 4, 32): (1, 1, -1, 181.5, -0.872665, 587.65),
("CSC", 1, 1, 4, 34): (1, 1, -1, 181.5, -0.523599, 587.65),
("CSC", 1, 1, 4, 36): (1, 1, -1, 181.5, -0.174533, 587.65),
("CSC", 1, 2, 1, 1): (1, 1, -1, 242.7, 0.0872665, 840.961),
("CSC", 1, 2, 1, 3): (1, 1, -1, 242.7, 0.785398, 840.961),
("CSC", 1, 2, 1, 5): (1, 1, -1, 242.7, 1.48353, 840.961),
("CSC", 1, 2, 1, 7): (1, 1, -1, 242.7, 2.18166, 840.961),
("CSC", 1, 2, 1, 9): (1, 1, -1, 242.7, 2.87979, 840.961),
("CSC", 1, 2, 1, 11): (1, 1, -1, 242.7, -2.70526, 840.961),
("CSC", 1, 2, 1, 13): (1, 1, -1, 242.7, -2.00713, 840.961),
("CSC", 1, 2, 1, 15): (1, 1, -1, 242.7, -1.309, 840.961),
("CSC", 1, 2, 1, 17): (1, 1, -1, 242.7, -0.610865, 840.961),
("CSC", 1, 2, 1, 2): (1, 1, -1, 242.7, 0.436332, 816.161),
("CSC", 1, 2, 1, 4): (1, 1, -1, 242.7, 1.13446, 816.161),
("CSC", 1, 2, 1, 6): (1, 1, -1, 242.7, 1.8326, 816.161),
("CSC", 1, 2, 1, 8): (1, 1, -1, 242.7, 2.53073, 816.161),
("CSC", 1, 2, 1, 10): (1, 1, -1, 242.7, -3.05433, 816.161),
("CSC", 1, 2, 1, 12): (1, 1, -1, 242.7, -2.35619, 816.161),
("CSC", 1, 2, 1, 14): (1, 1, -1, 242.7, -1.65806, 816.161),
("CSC", 1, 2, 1, 16): (1, 1, -1, 242.7, -0.959931, 816.161),
("CSC", 1, 2, 1, 18): (1, 1, -1, 242.7, -0.261799, 816.161),
("CSC", 1, 2, 2, 1): (1, 1, -1, 526.5, -1.07735e-15, 840.961),
("CSC", 1, 2, 2, 3): (1, 1, -1, 526.5, 0.349066, 840.961),
("CSC", 1, 2, 2, 5): (1, 1, -1, 526.5, 0.698132, 840.961),
("CSC", 1, 2, 2, 7): (1, 1, -1, 526.5, 1.0472, 840.961),
("CSC", 1, 2, 2, 9): (1, 1, -1, 526.5, 1.39626, 840.961),
("CSC", 1, 2, 2, 11): (1, 1, -1, 526.5, 1.74533, 840.961),
("CSC", 1, 2, 2, 13): (1, 1, -1, 526.5, 2.0944, 840.961),
("CSC", 1, 2, 2, 15): (1, 1, -1, 526.5, 2.44346, 840.961),
("CSC", 1, 2, 2, 17): (1, 1, -1, 526.5, 2.79253, 840.961),
("CSC", 1, 2, 2, 19): (1, 1, -1, 526.5, -3.14159, 840.961),
("CSC", 1, 2, 2, 21): (1, 1, -1, 526.5, -2.79253, 840.961),
("CSC", 1, 2, 2, 23): (1, 1, -1, 526.5, -2.44346, 840.961),
("CSC", 1, 2, 2, 25): (1, 1, -1, 526.5, -2.0944, 840.961),
("CSC", 1, 2, 2, 27): (1, 1, -1, 526.5, -1.74533, 840.961),
("CSC", 1, 2, 2, 29): (1, 1, -1, 526.5, -1.39626, 840.961),
("CSC", 1, 2, 2, 31): (1, 1, -1, 526.5, -1.0472, 840.961),
("CSC", 1, 2, 2, 33): (1, 1, -1, 526.5, -0.698132, 840.961),
("CSC", 1, 2, 2, 35): (1, 1, -1, 526.5, -0.349066, 840.961),
("CSC", 1, 2, 2, 2): (1, 1, -1, 526.5, 0.174533, 816.161),
("CSC", 1, 2, 2, 4): (1, 1, -1, 526.5, 0.523599, 816.161),
("CSC", 1, 2, 2, 6): (1, 1, -1, 526.5, 0.872665, 816.161),
("CSC", 1, 2, 2, 8): (1, 1, -1, 526.5, 1.22173, 816.161),
("CSC", 1, 2, 2, 10): (1, 1, -1, 526.5, 1.5708, 816.161),
("CSC", 1, 2, 2, 12): (1, 1, -1, 526.5, 1.91986, 816.161),
("CSC", 1, 2, 2, 14): (1, 1, -1, 526.5, 2.26893, 816.161),
("CSC", 1, 2, 2, 16): (1, 1, -1, 526.5, 2.61799, 816.161),
("CSC", 1, 2, 2, 18): (1, 1, -1, 526.5, 2.96706, 816.161),
("CSC", 1, 2, 2, 20): (1, 1, -1, 526.5, -2.96706, 816.161),
("CSC", 1, 2, 2, 22): (1, 1, -1, 526.5, -2.61799, 816.161),
("CSC", 1, 2, 2, 24): (1, 1, -1, 526.5, -2.26893, 816.161),
("CSC", 1, 2, 2, 26): (1, 1, -1, 526.5, -1.91986, 816.161),
("CSC", 1, 2, 2, 28): (1, 1, -1, 526.5, -1.5708, 816.161),
("CSC", 1, 2, 2, 30): (1, 1, -1, 526.5, -1.22173, 816.161),
("CSC", 1, 2, 2, 32): (1, 1, -1, 526.5, -0.872665, 816.161),
("CSC", 1, 2, 2, 34): (1, 1, -1, 526.5, -0.523599, 816.161),
("CSC", 1, 2, 2, 36): (1, 1, -1, 526.5, -0.174533, 816.161),
("CSC", 1, 3, 1, 1): (-1, 1, 1, 252.7, 0.0872665, 923.039),
("CSC", 1, 3, 1, 3): (-1, 1, 1, 252.7, 0.785398, 923.039),
("CSC", 1, 3, 1, 5): (-1, 1, 1, 252.7, 1.48353, 923.039),
("CSC", 1, 3, 1, 7): (-1, 1, 1, 252.7, 2.18166, 923.039),
("CSC", 1, 3, 1, 9): (-1, 1, 1, 252.7, 2.87979, 923.039),
("CSC", 1, 3, 1, 11): (-1, 1, 1, 252.7, -2.70526, 923.039),
("CSC", 1, 3, 1, 13): (-1, 1, 1, 252.7, -2.00713, 923.039),
("CSC", 1, 3, 1, 15): (-1, 1, 1, 252.7, -1.309, 923.039),
("CSC", 1, 3, 1, 17): (-1, 1, 1, 252.7, -0.610865, 923.039),
("CSC", 1, 3, 1, 2): (-1, 1, 1, 252.7, 0.436332, 947.839),
("CSC", 1, 3, 1, 4): (-1, 1, 1, 252.7, 1.13446, 947.839),
("CSC", 1, 3, 1, 6): (-1, 1, 1, 252.7, 1.8326, 947.839),
("CSC", 1, 3, 1, 8): (-1, 1, 1, 252.7, 2.53073, 947.839),
("CSC", 1, 3, 1, 10): (-1, 1, 1, 252.7, -3.05433, 947.839),
("CSC", 1, 3, 1, 12): (-1, 1, 1, 252.7, -2.35619, 947.839),
("CSC", 1, 3, 1, 14): (-1, 1, 1, 252.7, -1.65806, 947.839),
("CSC", 1, 3, 1, 16): (-1, 1, 1, 252.7, -0.959931, 947.839),
("CSC", 1, 3, 1, 18): (-1, 1, 1, 252.7, -0.261799, 947.839),
("CSC", 1, 3, 2, 1): (-1, 1, 1, 526.5, -1.13392e-15, 923.039),
("CSC", 1, 3, 2, 3): (-1, 1, 1, 526.5, 0.349066, 923.039),
("CSC", 1, 3, 2, 5): (-1, 1, 1, 526.5, 0.698132, 923.039),
("CSC", 1, 3, 2, 7): (-1, 1, 1, 526.5, 1.0472, 923.039),
("CSC", 1, 3, 2, 9): (-1, 1, 1, 526.5, 1.39626, 923.039),
("CSC", 1, 3, 2, 11): (-1, 1, 1, 526.5, 1.74533, 923.039),
("CSC", 1, 3, 2, 13): (-1, 1, 1, 526.5, 2.0944, 923.039),
("CSC", 1, 3, 2, 15): (-1, 1, 1, 526.5, 2.44346, 923.039),
("CSC", 1, 3, 2, 17): (-1, 1, 1, 526.5, 2.79253, 923.039),
("CSC", 1, 3, 2, 19): (-1, 1, 1, 526.5, 3.14159, 923.039),
("CSC", 1, 3, 2, 21): (-1, 1, 1, 526.5, -2.79253, 923.039),
("CSC", 1, 3, 2, 23): (-1, 1, 1, 526.5, -2.44346, 923.039),
("CSC", 1, 3, 2, 25): (-1, 1, 1, 526.5, -2.0944, 923.039),
("CSC", 1, 3, 2, 27): (-1, 1, 1, 526.5, -1.74533, 923.039),
("CSC", 1, 3, 2, 29): (-1, 1, 1, 526.5, -1.39626, 923.039),
("CSC", 1, 3, 2, 31): (-1, 1, 1, 526.5, -1.0472, 923.039),
("CSC", 1, 3, 2, 33): (-1, 1, 1, 526.5, -0.698132, 923.039),
("CSC", 1, 3, 2, 35): (-1, 1, 1, 526.5, -0.349066, 923.039),
("CSC", 1, 3, 2, 2): (-1, 1, 1, 526.5, 0.174533, 947.839),
("CSC", 1, 3, 2, 4): (-1, 1, 1, 526.5, 0.523599, 947.839),
("CSC", 1, 3, 2, 6): (-1, 1, 1, 526.5, 0.872665, 947.839),
("CSC", 1, 3, 2, 8): (-1, 1, 1, 526.5, 1.22173, 947.839),
("CSC", 1, 3, 2, 10): (-1, 1, 1, 526.5, 1.5708, 947.839),
("CSC", 1, 3, 2, 12): (-1, 1, 1, 526.5, 1.91986, 947.839),
("CSC", 1, 3, 2, 14): (-1, 1, 1, 526.5, 2.26893, 947.839),
("CSC", 1, 3, 2, 16): (-1, 1, 1, 526.5, 2.61799, 947.839),
("CSC", 1, 3, 2, 18): (-1, 1, 1, 526.5, 2.96706, 947.839),
("CSC", 1, 3, 2, 20): (-1, 1, 1, 526.5, -2.96706, 947.839),
("CSC", 1, 3, 2, 22): (-1, 1, 1, 526.5, -2.61799, 947.839),
("CSC", 1, 3, 2, 24): (-1, 1, 1, 526.5, -2.26893, 947.839),
("CSC", 1, 3, 2, 26): (-1, 1, 1, 526.5, -1.91986, 947.839),
("CSC", 1, 3, 2, 28): (-1, 1, 1, 526.5, -1.5708, 947.839),
("CSC", 1, 3, 2, 30): (-1, 1, 1, 526.5, -1.22173, 947.839),
("CSC", 1, 3, 2, 32): (-1, 1, 1, 526.5, -0.872665, 947.839),
("CSC", 1, 3, 2, 34): (-1, 1, 1, 526.5, -0.523599, 947.839),
("CSC", 1, 3, 2, 36): (-1, 1, 1, 526.5, -0.174533, 947.839),
("CSC", 1, 4, 1, 1): (-1, 1, 1, 262.65, 0.0872665, 1012.54),
("CSC", 1, 4, 1, 3): (-1, 1, 1, 262.65, 0.785398, 1012.54),
("CSC", 1, 4, 1, 5): (-1, 1, 1, 262.65, 1.48353, 1012.54),
("CSC", 1, 4, 1, 7): (-1, 1, 1, 262.65, 2.18166, 1012.54),
("CSC", 1, 4, 1, 9): (-1, 1, 1, 262.65, 2.87979, 1012.54),
("CSC", 1, 4, 1, 11): (-1, 1, 1, 262.65, -2.70526, 1012.54),
("CSC", 1, 4, 1, 13): (-1, 1, 1, 262.65, -2.00713, 1012.54),
("CSC", 1, 4, 1, 15): (-1, 1, 1, 262.65, -1.309, 1012.54),
("CSC", 1, 4, 1, 17): (-1, 1, 1, 262.65, -0.610865, 1012.54),
("CSC", 1, 4, 1, 2): (-1, 1, 1, 262.65, 0.436332, 1037.34),
("CSC", 1, 4, 1, 4): (-1, 1, 1, 262.65, 1.13446, 1037.34),
("CSC", 1, 4, 1, 6): (-1, 1, 1, 262.65, 1.8326, 1037.34),
("CSC", 1, 4, 1, 8): (-1, 1, 1, 262.65, 2.53073, 1037.34),
("CSC", 1, 4, 1, 10): (-1, 1, 1, 262.65, -3.05433, 1037.34),
("CSC", 1, 4, 1, 12): (-1, 1, 1, 262.65, -2.35619, 1037.34),
("CSC", 1, 4, 1, 14): (-1, 1, 1, 262.65, -1.65806, 1037.34),
("CSC", 1, 4, 1, 16): (-1, 1, 1, 262.65, -0.959931, 1037.34),
("CSC", 1, 4, 1, 18): (-1, 1, 1, 262.65, -0.261799, 1037.34),
("CSC", 1, 4, 2, 1): (-1, 1, 1, 526.5, -1.19637e-15, 1012.54),
("CSC", 1, 4, 2, 3): (-1, 1, 1, 526.5, 0.349066, 1012.54),
("CSC", 1, 4, 2, 5): (-1, 1, 1, 526.5, 0.698132, 1012.54),
("CSC", 1, 4, 2, 7): (-1, 1, 1, 526.5, 1.0472, 1012.54),
("CSC", 1, 4, 2, 9): (-1, 1, 1, 526.5, 1.39626, 1012.54),
("CSC", 1, 4, 2, 11): (-1, 1, 1, 526.5, 1.74533, 1012.54),
("CSC", 1, 4, 2, 13): (-1, 1, 1, 526.5, 2.0944, 1012.54),
("CSC", 1, 4, 2, 15): (-1, 1, 1, 526.5, 2.44346, 1012.54),
("CSC", 1, 4, 2, 17): (-1, 1, 1, 526.5, 2.79253, 1012.54),
("CSC", 1, 4, 2, 19): (-1, 1, 1, 526.5, 3.14159, 1012.54),
("CSC", 1, 4, 2, 21): (-1, 1, 1, 526.5, -2.79253, 1012.54),
("CSC", 1, 4, 2, 23): (-1, 1, 1, 526.5, -2.44346, 1012.54),
("CSC", 1, 4, 2, 25): (-1, 1, 1, 526.5, -2.0944, 1012.54),
("CSC", 1, 4, 2, 27): (-1, 1, 1, 526.5, -1.74533, 1012.54),
("CSC", 1, 4, 2, 29): (-1, 1, 1, 526.5, -1.39626, 1012.54),
("CSC", 1, 4, 2, 31): (-1, 1, 1, 526.5, -1.0472, 1012.54),
("CSC", 1, 4, 2, 33): (-1, 1, 1, 526.5, -0.698132, 1012.54),
("CSC", 1, 4, 2, 35): (-1, 1, 1, 526.5, -0.349066, 1012.54),
("CSC", 1, 4, 2, 2): (-1, 1, 1, 526.5, 0.174533, 1037.34),
("CSC", 1, 4, 2, 4): (-1, 1, 1, 526.5, 0.523599, 1037.34),
("CSC", 1, 4, 2, 6): (-1, 1, 1, 526.5, 0.872665, 1037.34),
("CSC", 1, 4, 2, 8): (-1, 1, 1, 526.5, 1.22173, 1037.34),
("CSC", 1, 4, 2, 10): (-1, 1, 1, 526.5, 1.5708, 1037.34),
("CSC", 1, 4, 2, 12): (-1, 1, 1, 526.5, 1.91986, 1037.34),
("CSC", 1, 4, 2, 14): (-1, 1, 1, 526.5, 2.26893, 1037.34),
("CSC", 1, 4, 2, 16): (-1, 1, 1, 526.5, 2.61799, 1037.34),
("CSC", 1, 4, 2, 18): (-1, 1, 1, 526.5, 2.96706, 1037.34),
("CSC", 1, 4, 2, 20): (-1, 1, 1, 526.5, -2.96706, 1037.34),
("CSC", 1, 4, 2, 22): (-1, 1, 1, 526.5, -2.61799, 1037.34),
("CSC", 1, 4, 2, 24): (-1, 1, 1, 526.5, -2.26893, 1037.34),
("CSC", 1, 4, 2, 26): (-1, 1, 1, 526.5, -1.91986, 1037.34),
("CSC", 1, 4, 2, 28): (-1, 1, 1, 526.5, -1.5708, 1037.34),
("CSC", 1, 4, 2, 30): (-1, 1, 1, 526.5, -1.22173, 1037.34),
("CSC", 1, 4, 2, 32): (-1, 1, 1, 526.5, -0.872665, 1037.34),
("CSC", 1, 4, 2, 34): (-1, 1, 1, 526.5, -0.523599, 1037.34),
("CSC", 1, 4, 2, 36): (-1, 1, 1, 526.5, -0.174533, 1037.34),
("CSC", 2, 1, 1, 1): (-1, 1, 1, 181.5, 1.12532e-15, -616.95),
("CSC", 2, 1, 1, 3): (-1, 1, 1, 181.5, 0.349066, -616.95),
("CSC", 2, 1, 1, 5): (-1, 1, 1, 181.5, 0.698132, -616.95),
("CSC", 2, 1, 1, 7): (-1, 1, 1, 181.5, 1.0472, -616.95),
("CSC", 2, 1, 1, 9): (-1, 1, 1, 181.5, 1.39626, -616.95),
("CSC", 2, 1, 1, 11): (-1, 1, 1, 181.5, 1.74533, -616.95),
("CSC", 2, 1, 1, 13): (-1, 1, 1, 181.5, 2.0944, -616.95),
("CSC", 2, 1, 1, 15): (-1, 1, 1, 181.5, 2.44346, -616.95),
("CSC", 2, 1, 1, 17): (-1, 1, 1, 181.5, 2.79253, -616.95),
("CSC", 2, 1, 1, 19): (-1, 1, 1, 181.5, -3.14159, -616.95),
("CSC", 2, 1, 1, 21): (-1, 1, 1, 181.5, -2.79253, -616.95),
("CSC", 2, 1, 1, 23): (-1, 1, 1, 181.5, -2.44346, -616.95),
("CSC", 2, 1, 1, 25): (-1, 1, 1, 181.5, -2.0944, -616.95),
("CSC", 2, 1, 1, 27): (-1, 1, 1, 181.5, -1.74533, -616.95),
("CSC", 2, 1, 1, 29): (-1, 1, 1, 181.5, -1.39626, -616.95),
("CSC", 2, 1, 1, 31): (-1, 1, 1, 181.5, -1.0472, -616.95),
("CSC", 2, 1, 1, 33): (-1, 1, 1, 181.5, -0.698132, -616.95),
("CSC", 2, 1, 1, 35): (-1, 1, 1, 181.5, -0.349066, -616.95),
("CSC", 2, 1, 1, 2): (-1, 1, 1, 181.5, 0.174533, -587.65),
("CSC", 2, 1, 1, 4): (-1, 1, 1, 181.5, 0.523599, -587.65),
("CSC", 2, 1, 1, 6): (-1, 1, 1, 181.5, 0.872665, -587.65),
("CSC", 2, 1, 1, 8): (-1, 1, 1, 181.5, 1.22173, -587.65),
("CSC", 2, 1, 1, 10): (-1, 1, 1, 181.5, 1.5708, -587.65),
("CSC", 2, 1, 1, 12): (-1, 1, 1, 181.5, 1.91986, -587.65),
("CSC", 2, 1, 1, 14): (-1, 1, 1, 181.5, 2.26893, -587.65),
("CSC", 2, 1, 1, 16): (-1, 1, 1, 181.5, 2.61799, -587.65),
("CSC", 2, 1, 1, 18): (-1, 1, 1, 181.5, 2.96706, -587.65),
("CSC", 2, 1, 1, 20): (-1, 1, 1, 181.5, -2.96706, -587.65),
("CSC", 2, 1, 1, 22): (-1, 1, 1, 181.5, -2.61799, -587.65),
("CSC", 2, 1, 1, 24): (-1, 1, 1, 181.5, -2.26893, -587.65),
("CSC", 2, 1, 1, 26): (-1, 1, 1, 181.5, -1.91986, -587.65),
("CSC", 2, 1, 1, 28): (-1, 1, 1, 181.5, -1.5708, -587.65),
("CSC", 2, 1, 1, 30): (-1, 1, 1, 181.5, -1.22173, -587.65),
("CSC", 2, 1, 1, 32): (-1, 1, 1, 181.5, -0.872665, -587.65),
("CSC", 2, 1, 1, 34): (-1, 1, 1, 181.5, -0.523599, -587.65),
("CSC", 2, 1, 1, 36): (-1, 1, 1, 181.5, -0.174533, -587.65),
("CSC", 2, 1, 2, 1): (-1, 1, 1, 369.7, 5.85335e-16, -712.761),
("CSC", 2, 1, 2, 3): (-1, 1, 1, 369.7, 0.349066, -712.761),
("CSC", 2, 1, 2, 5): (-1, 1, 1, 369.7, 0.698132, -712.761),
("CSC", 2, 1, 2, 7): (-1, 1, 1, 369.7, 1.0472, -712.761),
("CSC", 2, 1, 2, 9): (-1, 1, 1, 369.7, 1.39626, -712.761),
("CSC", 2, 1, 2, 11): (-1, 1, 1, 369.7, 1.74533, -712.761),
("CSC", 2, 1, 2, 13): (-1, 1, 1, 369.7, 2.0944, -712.761),
("CSC", 2, 1, 2, 15): (-1, 1, 1, 369.7, 2.44346, -712.761),
("CSC", 2, 1, 2, 17): (-1, 1, 1, 369.7, 2.79253, -712.761),
("CSC", 2, 1, 2, 19): (-1, 1, 1, 369.7, -3.14159, -712.761),
("CSC", 2, 1, 2, 21): (-1, 1, 1, 369.7, -2.79253, -712.761),
("CSC", 2, 1, 2, 23): (-1, 1, 1, 369.7, -2.44346, -712.761),
("CSC", 2, 1, 2, 25): (-1, 1, 1, 369.7, -2.0944, -712.761),
("CSC", 2, 1, 2, 27): (-1, 1, 1, 369.7, -1.74533, -712.761),
("CSC", 2, 1, 2, 29): (-1, 1, 1, 369.7, -1.39626, -712.761),
("CSC", 2, 1, 2, 31): (-1, 1, 1, 369.7, -1.0472, -712.761),
("CSC", 2, 1, 2, 33): (-1, 1, 1, 369.7, -0.698132, -712.761),
("CSC", 2, 1, 2, 35): (-1, 1, 1, 369.7, -0.349066, -712.761),
("CSC", 2, 1, 2, 2): (-1, 1, 1, 369.7, 0.174533, -685.361),
("CSC", 2, 1, 2, 4): (-1, 1, 1, 369.7, 0.523599, -685.361),
("CSC", 2, 1, 2, 6): (-1, 1, 1, 369.7, 0.872665, -685.361),
("CSC", 2, 1, 2, 8): (-1, 1, 1, 369.7, 1.22173, -685.361),
("CSC", 2, 1, 2, 10): (-1, 1, 1, 369.7, 1.5708, -685.361),
("CSC", 2, 1, 2, 12): (-1, 1, 1, 369.7, 1.91986, -685.361),
("CSC", 2, 1, 2, 14): (-1, 1, 1, 369.7, 2.26893, -685.361),
("CSC", 2, 1, 2, 16): (-1, 1, 1, 369.7, 2.61799, -685.361),
("CSC", 2, 1, 2, 18): (-1, 1, 1, 369.7, 2.96706, -685.361),
("CSC", 2, 1, 2, 20): (-1, 1, 1, 369.7, -2.96706, -685.361),
("CSC", 2, 1, 2, 22): (-1, 1, 1, 369.7, -2.61799, -685.361),
("CSC", 2, 1, 2, 24): (-1, 1, 1, 369.7, -2.26893, -685.361),
("CSC", 2, 1, 2, 26): (-1, 1, 1, 369.7, -1.91986, -685.361),
("CSC", 2, 1, 2, 28): (-1, 1, 1, 369.7, -1.5708, -685.361),
("CSC", 2, 1, 2, 30): (-1, 1, 1, 369.7, -1.22173, -685.361),
("CSC", 2, 1, 2, 32): (-1, 1, 1, 369.7, -0.872665, -685.361),
("CSC", 2, 1, 2, 34): (-1, 1, 1, 369.7, -0.523599, -685.361),
("CSC", 2, 1, 2, 36): (-1, 1, 1, 369.7, -0.174533, -685.361),
("CSC", 2, 1, 3, 1): (-1, 1, 1, 595.15, 3.06347e-16, -695.159),
("CSC", 2, 1, 3, 2): (-1, 1, 1, 595.15, 0.174533, -695.159),
("CSC", 2, 1, 3, 3): (-1, 1, 1, 595.15, 0.349066, -695.159),
("CSC", 2, 1, 3, 4): (-1, 1, 1, 595.15, 0.523599, -695.159),
("CSC", 2, 1, 3, 5): (-1, 1, 1, 595.15, 0.698132, -695.159),
("CSC", 2, 1, 3, 6): (-1, 1, 1, 595.15, 0.872665, -695.159),
("CSC", 2, 1, 3, 7): (-1, 1, 1, 595.15, 1.0472, -695.159),
("CSC", 2, 1, 3, 8): (-1, 1, 1, 595.15, 1.22173, -695.159),
("CSC", 2, 1, 3, 9): (-1, 1, 1, 595.15, 1.39626, -695.159),
("CSC", 2, 1, 3, 10): (-1, 1, 1, 595.15, 1.5708, -695.159),
("CSC", 2, 1, 3, 11): (-1, 1, 1, 595.15, 1.74533, -695.159),
("CSC", 2, 1, 3, 12): (-1, 1, 1, 595.15, 1.91986, -695.159),
("CSC", 2, 1, 3, 13): (-1, 1, 1, 595.15, 2.0944, -695.159),
("CSC", 2, 1, 3, 14): (-1, 1, 1, 595.15, 2.26893, -695.159),
("CSC", 2, 1, 3, 15): (-1, 1, 1, 595.15, 2.44346, -695.159),
("CSC", 2, 1, 3, 16): (-1, 1, 1, 595.15, 2.61799, -695.159),
("CSC", 2, 1, 3, 17): (-1, 1, 1, 595.15, 2.79253, -695.159),
("CSC", 2, 1, 3, 18): (-1, 1, 1, 595.15, 2.96706, -695.159),
("CSC", 2, 1, 3, 19): (-1, 1, 1, 595.15, -3.14159, -695.159),
("CSC", 2, 1, 3, 20): (-1, 1, 1, 595.15, -2.96706, -695.159),
("CSC", 2, 1, 3, 21): (-1, 1, 1, 595.15, -2.79253, -695.159),
("CSC", 2, 1, 3, 22): (-1, 1, 1, 595.15, -2.61799, -695.159),
("CSC", 2, 1, 3, 23): (-1, 1, 1, 595.15, -2.44346, -695.159),
("CSC", 2, 1, 3, 24): (-1, 1, 1, 595.15, -2.26893, -695.159),
("CSC", 2, 1, 3, 25): (-1, 1, 1, 595.15, -2.0944, -695.159),
("CSC", 2, 1, 3, 26): (-1, 1, 1, 595.15, -1.91986, -695.159),
("CSC", 2, 1, 3, 27): (-1, 1, 1, 595.15, -1.74533, -695.159),
("CSC", 2, 1, 3, 28): (-1, 1, 1, 595.15, -1.5708, -695.159),
("CSC", 2, 1, 3, 29): (-1, 1, 1, 595.15, -1.39626, -695.159),
("CSC", 2, 1, 3, 30): (-1, 1, 1, 595.15, -1.22173, -695.159),
("CSC", 2, 1, 3, 31): (-1, 1, 1, 595.15, -1.0472, -695.159),
("CSC", 2, 1, 3, 32): (-1, 1, 1, 595.15, -0.872665, -695.159),
("CSC", 2, 1, 3, 33): (-1, 1, 1, 595.15, -0.698132, -695.159),
("CSC", 2, 1, 3, 34): (-1, 1, 1, 595.15, -0.523599, -695.159),
("CSC", 2, 1, 3, 35): (-1, 1, 1, 595.15, -0.349066, -695.159),
("CSC", 2, 1, 3, 36): (-1, 1, 1, 595.15, -0.174533, -695.159),
("CSC", 2, 1, 4, 1): (-1, 1, 1, 181.5, 1.12532e-15, -616.95),
("CSC", 2, 1, 4, 3): (-1, 1, 1, 181.5, 0.349066, -616.95),
("CSC", 2, 1, 4, 5): (-1, 1, 1, 181.5, 0.698132, -616.95),
("CSC", 2, 1, 4, 7): (-1, 1, 1, 181.5, 1.0472, -616.95),
("CSC", 2, 1, 4, 9): (-1, 1, 1, 181.5, 1.39626, -616.95),
("CSC", 2, 1, 4, 11): (-1, 1, 1, 181.5, 1.74533, -616.95),
("CSC", 2, 1, 4, 13): (-1, 1, 1, 181.5, 2.0944, -616.95),
("CSC", 2, 1, 4, 15): (-1, 1, 1, 181.5, 2.44346, -616.95),
("CSC", 2, 1, 4, 17): (-1, 1, 1, 181.5, 2.79253, -616.95),
("CSC", 2, 1, 4, 19): (-1, 1, 1, 181.5, -3.14159, -616.95),
("CSC", 2, 1, 4, 21): (-1, 1, 1, 181.5, -2.79253, -616.95),
("CSC", 2, 1, 4, 23): (-1, 1, 1, 181.5, -2.44346, -616.95),
("CSC", 2, 1, 4, 25): (-1, 1, 1, 181.5, -2.0944, -616.95),
("CSC", 2, 1, 4, 27): (-1, 1, 1, 181.5, -1.74533, -616.95),
("CSC", 2, 1, 4, 29): (-1, 1, 1, 181.5, -1.39626, -616.95),
("CSC", 2, 1, 4, 31): (-1, 1, 1, 181.5, -1.0472, -616.95),
("CSC", 2, 1, 4, 33): (-1, 1, 1, 181.5, -0.698132, -616.95),
("CSC", 2, 1, 4, 35): (-1, 1, 1, 181.5, -0.349066, -616.95),
("CSC", 2, 1, 4, 2): (-1, 1, 1, 181.5, 0.174533, -587.65),
("CSC", 2, 1, 4, 4): (-1, 1, 1, 181.5, 0.523599, -587.65),
("CSC", 2, 1, 4, 6): (-1, 1, 1, 181.5, 0.872665, -587.65),
("CSC", 2, 1, 4, 8): (-1, 1, 1, 181.5, 1.22173, -587.65),
("CSC", 2, 1, 4, 10): (-1, 1, 1, 181.5, 1.5708, -587.65),
("CSC", 2, 1, 4, 12): (-1, 1, 1, 181.5, 1.91986, -587.65),
("CSC", 2, 1, 4, 14): (-1, 1, 1, 181.5, 2.26893, -587.65),
("CSC", 2, 1, 4, 16): (-1, 1, 1, 181.5, 2.61799, -587.65),
("CSC", 2, 1, 4, 18): (-1, 1, 1, 181.5, 2.96706, -587.65),
("CSC", 2, 1, 4, 20): (-1, 1, 1, 181.5, -2.96706, -587.65),
("CSC", 2, 1, 4, 22): (-1, 1, 1, 181.5, -2.61799, -587.65),
("CSC", 2, 1, 4, 24): (-1, 1, 1, 181.5, -2.26893, -587.65),
("CSC", 2, 1, 4, 26): (-1, 1, 1, 181.5, -1.91986, -587.65),
("CSC", 2, 1, 4, 28): (-1, 1, 1, 181.5, -1.5708, -587.65),
("CSC", 2, 1, 4, 30): (-1, 1, 1, 181.5, -1.22173, -587.65),
("CSC", 2, 1, 4, 32): (-1, 1, 1, 181.5, -0.872665, -587.65),
("CSC", 2, 1, 4, 34): (-1, 1, 1, 181.5, -0.523599, -587.65),
("CSC", 2, 1, 4, 36): (-1, 1, 1, 181.5, -0.174533, -587.65),
("CSC", 2, 2, 1, 1): (-1, 1, 1, 242.7, 0.0872665, -840.961),
("CSC", 2, 2, 1, 3): (-1, 1, 1, 242.7, 0.785398, -840.961),
("CSC", 2, 2, 1, 5): (-1, 1, 1, 242.7, 1.48353, -840.961),
("CSC", 2, 2, 1, 7): (-1, 1, 1, 242.7, 2.18166, -840.961),
("CSC", 2, 2, 1, 9): (-1, 1, 1, 242.7, 2.87979, -840.961),
("CSC", 2, 2, 1, 11): (-1, 1, 1, 242.7, -2.70526, -840.961),
("CSC", 2, 2, 1, 13): (-1, 1, 1, 242.7, -2.00713, -840.961),
("CSC", 2, 2, 1, 15): (-1, 1, 1, 242.7, -1.309, -840.961),
("CSC", 2, 2, 1, 17): (-1, 1, 1, 242.7, -0.610865, -840.961),
("CSC", 2, 2, 1, 2): (-1, 1, 1, 242.7, 0.436332, -816.161),
("CSC", 2, 2, 1, 4): (-1, 1, 1, 242.7, 1.13446, -816.161),
("CSC", 2, 2, 1, 6): (-1, 1, 1, 242.7, 1.8326, -816.161),
("CSC", 2, 2, 1, 8): (-1, 1, 1, 242.7, 2.53073, -816.161),
("CSC", 2, 2, 1, 10): (-1, 1, 1, 242.7, -3.05433, -816.161),
("CSC", 2, 2, 1, 12): (-1, 1, 1, 242.7, -2.35619, -816.161),
("CSC", 2, 2, 1, 14): (-1, 1, 1, 242.7, -1.65806, -816.161),
("CSC", 2, 2, 1, 16): (-1, 1, 1, 242.7, -0.959931, -816.161),
("CSC", 2, 2, 1, 18): (-1, 1, 1, 242.7, -0.261799, -816.161),
("CSC", 2, 2, 2, 1): (-1, 1, 1, 526.5, 4.63998e-16, -840.961),
("CSC", 2, 2, 2, 3): (-1, 1, 1, 526.5, 0.349066, -840.961),
("CSC", 2, 2, 2, 5): (-1, 1, 1, 526.5, 0.698132, -840.961),
("CSC", 2, 2, 2, 7): (-1, 1, 1, 526.5, 1.0472, -840.961),
("CSC", 2, 2, 2, 9): (-1, 1, 1, 526.5, 1.39626, -840.961),
("CSC", 2, 2, 2, 11): (-1, 1, 1, 526.5, 1.74533, -840.961),
("CSC", 2, 2, 2, 13): (-1, 1, 1, 526.5, 2.0944, -840.961),
("CSC", 2, 2, 2, 15): (-1, 1, 1, 526.5, 2.44346, -840.961),
("CSC", 2, 2, 2, 17): (-1, 1, 1, 526.5, 2.79253, -840.961),
("CSC", 2, 2, 2, 19): (-1, 1, 1, 526.5, -3.14159, -840.961),
("CSC", 2, 2, 2, 21): (-1, 1, 1, 526.5, -2.79253, -840.961),
("CSC", 2, 2, 2, 23): (-1, 1, 1, 526.5, -2.44346, -840.961),
("CSC", 2, 2, 2, 25): (-1, 1, 1, 526.5, -2.0944, -840.961),
("CSC", 2, 2, 2, 27): (-1, 1, 1, 526.5, -1.74533, -840.961),
("CSC", 2, 2, 2, 29): (-1, 1, 1, 526.5, -1.39626, -840.961),
("CSC", 2, 2, 2, 31): (-1, 1, 1, 526.5, -1.0472, -840.961),
("CSC", 2, 2, 2, 33): (-1, 1, 1, 526.5, -0.698132, -840.961),
("CSC", 2, 2, 2, 35): (-1, 1, 1, 526.5, -0.349066, -840.961),
("CSC", 2, 2, 2, 2): (-1, 1, 1, 526.5, 0.174533, -816.161),
("CSC", 2, 2, 2, 4): (-1, 1, 1, 526.5, 0.523599, -816.161),
("CSC", 2, 2, 2, 6): (-1, 1, 1, 526.5, 0.872665, -816.161),
("CSC", 2, 2, 2, 8): (-1, 1, 1, 526.5, 1.22173, -816.161),
("CSC", 2, 2, 2, 10): (-1, 1, 1, 526.5, 1.5708, -816.161),
("CSC", 2, 2, 2, 12): (-1, 1, 1, 526.5, 1.91986, -816.161),
("CSC", 2, 2, 2, 14): (-1, 1, 1, 526.5, 2.26893, -816.161),
("CSC", 2, 2, 2, 16): (-1, 1, 1, 526.5, 2.61799, -816.161),
("CSC", 2, 2, 2, 18): (-1, 1, 1, 526.5, 2.96706, -816.161),
("CSC", 2, 2, 2, 20): (-1, 1, 1, 526.5, -2.96706, -816.161),
("CSC", 2, 2, 2, 22): (-1, 1, 1, 526.5, -2.61799, -816.161),
("CSC", 2, 2, 2, 24): (-1, 1, 1, 526.5, -2.26893, -816.161),
("CSC", 2, 2, 2, 26): (-1, 1, 1, 526.5, -1.91986, -816.161),
("CSC", 2, 2, 2, 28): (-1, 1, 1, 526.5, -1.5708, -816.161),
("CSC", 2, 2, 2, 30): (-1, 1, 1, 526.5, -1.22173, -816.161),
("CSC", 2, 2, 2, 32): (-1, 1, 1, 526.5, -0.872665, -816.161),
("CSC", 2, 2, 2, 34): (-1, 1, 1, 526.5, -0.523599, -816.161),
("CSC", 2, 2, 2, 36): (-1, 1, 1, 526.5, -0.174533, -816.161),
("CSC", 2, 3, 1, 1): (1, 1, -1, 252.7, 0.0872665, -923.039),
("CSC", 2, 3, 1, 3): (1, 1, -1, 252.7, 0.785398, -923.039),
("CSC", 2, 3, 1, 5): (1, 1, -1, 252.7, 1.48353, -923.039),
("CSC", 2, 3, 1, 7): (1, 1, -1, 252.7, 2.18166, -923.039),
("CSC", 2, 3, 1, 9): (1, 1, -1, 252.7, 2.87979, -923.039),
("CSC", 2, 3, 1, 11): (1, 1, -1, 252.7, -2.70526, -923.039),
("CSC", 2, 3, 1, 13): (1, 1, -1, 252.7, -2.00713, -923.039),
("CSC", 2, 3, 1, 15): (1, 1, -1, 252.7, -1.309, -923.039),
("CSC", 2, 3, 1, 17): (1, 1, -1, 252.7, -0.610865, -923.039),
("CSC", 2, 3, 1, 2): (1, 1, -1, 252.7, 0.436332, -947.839),
("CSC", 2, 3, 1, 4): (1, 1, -1, 252.7, 1.13446, -947.839),
("CSC", 2, 3, 1, 6): (1, 1, -1, 252.7, 1.8326, -947.839),
("CSC", 2, 3, 1, 8): (1, 1, -1, 252.7, 2.53073, -947.839),
("CSC", 2, 3, 1, 10): (1, 1, -1, 252.7, -3.05433, -947.839),
("CSC", 2, 3, 1, 12): (1, 1, -1, 252.7, -2.35619, -947.839),
("CSC", 2, 3, 1, 14): (1, 1, -1, 252.7, -1.65806, -947.839),
("CSC", 2, 3, 1, 16): (1, 1, -1, 252.7, -0.959931, -947.839),
("CSC", 2, 3, 1, 18): (1, 1, -1, 252.7, -0.261799, -947.839),
("CSC", 2, 3, 2, 1): (1, 1, -1, 526.5, 5.2127e-16, -923.039),
("CSC", 2, 3, 2, 3): (1, 1, -1, 526.5, 0.349066, -923.039),
("CSC", 2, 3, 2, 5): (1, 1, -1, 526.5, 0.698132, -923.039),
("CSC", 2, 3, 2, 7): (1, 1, -1, 526.5, 1.0472, -923.039),
("CSC", 2, 3, 2, 9): (1, 1, -1, 526.5, 1.39626, -923.039),
("CSC", 2, 3, 2, 11): (1, 1, -1, 526.5, 1.74533, -923.039),
("CSC", 2, 3, 2, 13): (1, 1, -1, 526.5, 2.0944, -923.039),
("CSC", 2, 3, 2, 15): (1, 1, -1, 526.5, 2.44346, -923.039),
("CSC", 2, 3, 2, 17): (1, 1, -1, 526.5, 2.79253, -923.039),
("CSC", 2, 3, 2, 19): (1, 1, -1, 526.5, -3.14159, -923.039),
("CSC", 2, 3, 2, 21): (1, 1, -1, 526.5, -2.79253, -923.039),
("CSC", 2, 3, 2, 23): (1, 1, -1, 526.5, -2.44346, -923.039),
("CSC", 2, 3, 2, 25): (1, 1, -1, 526.5, -2.0944, -923.039),
("CSC", 2, 3, 2, 27): (1, 1, -1, 526.5, -1.74533, -923.039),
("CSC", 2, 3, 2, 29): (1, 1, -1, 526.5, -1.39626, -923.039),
("CSC", 2, 3, 2, 31): (1, 1, -1, 526.5, -1.0472, -923.039),
("CSC", 2, 3, 2, 33): (1, 1, -1, 526.5, -0.698132, -923.039),
("CSC", 2, 3, 2, 35): (1, 1, -1, 526.5, -0.349066, -923.039),
("CSC", 2, 3, 2, 2): (1, 1, -1, 526.5, 0.174533, -947.839),
("CSC", 2, 3, 2, 4): (1, 1, -1, 526.5, 0.523599, -947.839),
("CSC", 2, 3, 2, 6): (1, 1, -1, 526.5, 0.872665, -947.839),
("CSC", 2, 3, 2, 8): (1, 1, -1, 526.5, 1.22173, -947.839),
("CSC", 2, 3, 2, 10): (1, 1, -1, 526.5, 1.5708, -947.839),
("CSC", 2, 3, 2, 12): (1, 1, -1, 526.5, 1.91986, -947.839),
("CSC", 2, 3, 2, 14): (1, 1, -1, 526.5, 2.26893, -947.839),
("CSC", 2, 3, 2, 16): (1, 1, -1, 526.5, 2.61799, -947.839),
("CSC", 2, 3, 2, 18): (1, 1, -1, 526.5, 2.96706, -947.839),
("CSC", 2, 3, 2, 20): (1, 1, -1, 526.5, -2.96706, -947.839),
("CSC", 2, 3, 2, 22): (1, 1, -1, 526.5, -2.61799, -947.839),
("CSC", 2, 3, 2, 24): (1, 1, -1, 526.5, -2.26893, -947.839),
("CSC", 2, 3, 2, 26): (1, 1, -1, 526.5, -1.91986, -947.839),
("CSC", 2, 3, 2, 28): (1, 1, -1, 526.5, -1.5708, -947.839),
("CSC", 2, 3, 2, 30): (1, 1, -1, 526.5, -1.22173, -947.839),
("CSC", 2, 3, 2, 32): (1, 1, -1, 526.5, -0.872665, -947.839),
("CSC", 2, 3, 2, 34): (1, 1, -1, 526.5, -0.523599, -947.839),
("CSC", 2, 3, 2, 36): (1, 1, -1, 526.5, -0.174533, -947.839),
("CSC", 2, 4, 1, 1): (1, 1, -1, 262.65, 0.0872665, -1012.54),
("CSC", 2, 4, 1, 3): (1, 1, -1, 262.65, 0.785398, -1012.54),
("CSC", 2, 4, 1, 5): (1, 1, -1, 262.65, 1.48353, -1012.54),
("CSC", 2, 4, 1, 7): (1, 1, -1, 262.65, 2.18166, -1012.54),
("CSC", 2, 4, 1, 9): (1, 1, -1, 262.65, 2.87979, -1012.54),
("CSC", 2, 4, 1, 11): (1, 1, -1, 262.65, -2.70526, -1012.54),
("CSC", 2, 4, 1, 13): (1, 1, -1, 262.65, -2.00713, -1012.54),
("CSC", 2, 4, 1, 15): (1, 1, -1, 262.65, -1.309, -1012.54),
("CSC", 2, 4, 1, 17): (1, 1, -1, 262.65, -0.610865, -1012.54),
("CSC", 2, 4, 1, 2): (1, 1, -1, 262.65, 0.436332, -1037.34),
("CSC", 2, 4, 1, 4): (1, 1, -1, 262.65, 1.13446, -1037.34),
("CSC", 2, 4, 1, 6): (1, 1, -1, 262.65, 1.8326, -1037.34),
("CSC", 2, 4, 1, 8): (1, 1, -1, 262.65, 2.53073, -1037.34),
("CSC", 2, 4, 1, 10): (1, 1, -1, 262.65, -3.05433, -1037.34),
("CSC", 2, 4, 1, 12): (1, 1, -1, 262.65, -2.35619, -1037.34),
("CSC", 2, 4, 1, 14): (1, 1, -1, 262.65, -1.65806, -1037.34),
("CSC", 2, 4, 1, 16): (1, 1, -1, 262.65, -0.959931, -1037.34),
("CSC", 2, 4, 1, 18): (1, 1, -1, 262.65, -0.261799, -1037.34),
("CSC", 2, 4, 2, 1): (1, 1, -1, 526.5, 5.83721e-16, -1012.54),
("CSC", 2, 4, 2, 3): (1, 1, -1, 526.5, 0.349066, -1012.54),
("CSC", 2, 4, 2, 5): (1, 1, -1, 526.5, 0.698132, -1012.54),
("CSC", 2, 4, 2, 7): (1, 1, -1, 526.5, 1.0472, -1012.54),
("CSC", 2, 4, 2, 9): (1, 1, -1, 526.5, 1.39626, -1012.54),
("CSC", 2, 4, 2, 11): (1, 1, -1, 526.5, 1.74533, -1012.54),
("CSC", 2, 4, 2, 13): (1, 1, -1, 526.5, 2.0944, -1012.54),
("CSC", 2, 4, 2, 15): (1, 1, -1, 526.5, 2.44346, -1012.54),
("CSC", 2, 4, 2, 17): (1, 1, -1, 526.5, 2.79253, -1012.54),
("CSC", 2, 4, 2, 19): (1, 1, -1, 526.5, -3.14159, -1012.54),
("CSC", 2, 4, 2, 21): (1, 1, -1, 526.5, -2.79253, -1012.54),
("CSC", 2, 4, 2, 23): (1, 1, -1, 526.5, -2.44346, -1012.54),
("CSC", 2, 4, 2, 25): (1, 1, -1, 526.5, -2.0944, -1012.54),
("CSC", 2, 4, 2, 27): (1, 1, -1, 526.5, -1.74533, -1012.54),
("CSC", 2, 4, 2, 29): (1, 1, -1, 526.5, -1.39626, -1012.54),
("CSC", 2, 4, 2, 31): (1, 1, -1, 526.5, -1.0472, -1012.54),
("CSC", 2, 4, 2, 33): (1, 1, -1, 526.5, -0.698132, -1012.54),
("CSC", 2, 4, 2, 35): (1, 1, -1, 526.5, -0.349066, -1012.54),
("CSC", 2, 4, 2, 2): (1, 1, -1, 526.5, 0.174533, -1037.34),
("CSC", 2, 4, 2, 4): (1, 1, -1, 526.5, 0.523599, -1037.34),
("CSC", 2, 4, 2, 6): (1, 1, -1, 526.5, 0.872665, -1037.34),
("CSC", 2, 4, 2, 8): (1, 1, -1, 526.5, 1.22173, -1037.34),
("CSC", 2, 4, 2, 10): (1, 1, -1, 526.5, 1.5708, -1037.34),
("CSC", 2, 4, 2, 12): (1, 1, -1, 526.5, 1.91986, -1037.34),
("CSC", 2, 4, 2, 14): (1, 1, -1, 526.5, 2.26893, -1037.34),
("CSC", 2, 4, 2, 16): (1, 1, -1, 526.5, 2.61799, -1037.34),
("CSC", 2, 4, 2, 18): (1, 1, -1, 526.5, 2.96706, -1037.34),
("CSC", 2, 4, 2, 20): (1, 1, -1, 526.5, -2.96706, -1037.34),
("CSC", 2, 4, 2, 22): (1, 1, -1, 526.5, -2.61799, -1037.34),
("CSC", 2, 4, 2, 24): (1, 1, -1, 526.5, -2.26893, -1037.34),
("CSC", 2, 4, 2, 26): (1, 1, -1, 526.5, -1.91986, -1037.34),
("CSC", 2, 4, 2, 28): (1, 1, -1, 526.5, -1.5708, -1037.34),
("CSC", 2, 4, 2, 30): (1, 1, -1, 526.5, -1.22173, -1037.34),
("CSC", 2, 4, 2, 32): (1, 1, -1, 526.5, -0.872665, -1037.34),
("CSC", 2, 4, 2, 34): (1, 1, -1, 526.5, -0.523599, -1037.34),
("CSC", 2, 4, 2, 36): (1, 1, -1, 526.5, -0.174533, -1037.34),
}
| 58.980347
| 63
| 0.444823
| 11,833
| 51,018
| 1.917857
| 0.015719
| 0.177756
| 0.126245
| 0.057108
| 0.995417
| 0.978497
| 0.968714
| 0.968714
| 0.964176
| 0.925575
| 0
| 0.486549
| 0.181034
| 51,018
| 864
| 64
| 59.048611
| 0.056603
| 0
| 0
| 0
| 0
| 0
| 0.045788
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 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
| 9
|
ecf4e73a534627f95399084a0ed1c0d41c8a6e2f
| 84
|
py
|
Python
|
codigo/Live39/xpto.py
|
cassiasamp/live-de-python
|
00b5e51793097544ba9b75c97a0d30e63970bf45
|
[
"MIT"
] | 572
|
2018-04-03T03:17:08.000Z
|
2022-03-31T19:05:32.000Z
|
codigo/Live39/xpto.py
|
cassiasamp/live-de-python
|
00b5e51793097544ba9b75c97a0d30e63970bf45
|
[
"MIT"
] | 176
|
2018-05-18T15:56:16.000Z
|
2022-03-28T20:39:07.000Z
|
codigo/Live39/xpto.py
|
cassiasamp/live-de-python
|
00b5e51793097544ba9b75c97a0d30e63970bf45
|
[
"MIT"
] | 140
|
2018-04-18T13:59:11.000Z
|
2022-03-29T00:43:49.000Z
|
a = [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]
| 42
| 83
| 0.47619
| 40
| 84
| 1
| 0.05
| 1.9
| 2.775
| 3.6
| 0.975
| 0.975
| 0.975
| 0.975
| 0.975
| 0.975
| 0
| 0.481481
| 0.035714
| 84
| 1
| 84
| 84
| 0.012346
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 13
|
01fd75d384169ee0e0ab869ade8456fef030b51f
| 66
|
py
|
Python
|
Chapter 01/Chap01_Example1.13.py
|
bpbpublications/Programming-Techniques-using-Python
|
49b785f37e95a3aad1d36cef51e219ac56e5e9f0
|
[
"MIT"
] | null | null | null |
Chapter 01/Chap01_Example1.13.py
|
bpbpublications/Programming-Techniques-using-Python
|
49b785f37e95a3aad1d36cef51e219ac56e5e9f0
|
[
"MIT"
] | null | null | null |
Chapter 01/Chap01_Example1.13.py
|
bpbpublications/Programming-Techniques-using-Python
|
49b785f37e95a3aad1d36cef51e219ac56e5e9f0
|
[
"MIT"
] | null | null | null |
print("Hello 'Students' World")
print('Hello "Students" World')
| 22
| 32
| 0.69697
| 8
| 66
| 5.75
| 0.5
| 0.434783
| 0.782609
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 66
| 2
| 33
| 33
| 0.793103
| 0
| 0
| 0
| 0
| 0
| 0.6875
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 8
|
178020735338c8222f9329beac8083d9a1b8eb2e
| 165,800
|
py
|
Python
|
theory/sfem/sfem_tria3_example.py
|
compmech/particles
|
d23ae69ad4c79024b997a232247b4ae0e1e7031c
|
[
"BSD-2-Clause"
] | 8
|
2017-06-16T15:50:43.000Z
|
2021-12-01T10:20:36.000Z
|
theory/sfem/sfem_tria3_example.py
|
compmech/particles
|
d23ae69ad4c79024b997a232247b4ae0e1e7031c
|
[
"BSD-2-Clause"
] | 2
|
2017-12-27T11:07:04.000Z
|
2019-01-22T19:34:33.000Z
|
theory/sfem/sfem_tria3_example.py
|
compmech/particles
|
d23ae69ad4c79024b997a232247b4ae0e1e7031c
|
[
"BSD-2-Clause"
] | 4
|
2017-05-17T17:53:20.000Z
|
2019-04-03T01:57:58.000Z
|
"""SFEM - Tria 3, implementation as per phungvan2013
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.sparse import coo_matrix
from composites.laminate import read_stack
from structsolve import solve
XGLOBAL = np.array([1., 0, 0])
YGLOBAL = np.array([0, 1., 0])
ZGLOBAL = np.array([0, 0, 1.])
def area_of_polygon(x, y):
"""Area of an arbitrary 2D polygon given its verticies
"""
area = 0.0
for i in range(-1, len(x)-1):
area += x[i] * (y[i+1] - y[i-1])
return abs(area) / 2.0
def unitvec(vector):
"""Return the unit vector
"""
return vector / np.linalg.norm(vector)
class Property(object):
def __init__(self, A, B, D, E):
self.A = A
self.B = B
self.D = D
self.E = E
class IntegrationPoint(object):
def __init__(self, tria, n1, n2, n3, f1, f2, f3, nx, ny, nz, le):
self.pos = (f1*n1 + f2*n2 + f3*n3).pos
self.tria = tria
self.n1 = n1
self.n2 = n2
self.n3 = n3
self.f1 = f1
self.f2 = f2
self.f3 = f3
self.nx = nx
self.ny = ny
self.nz = nz # 3D case
self.le = le # length of the line where the integration point lies on
class Tria(object):
def __init__(self, n1, n2, n3):
self.n1 = n1
self.n2 = n2
self.n3 = n3
self.nodes = [n1, n2, n3]
#NOTE perhaps not needed
self.A = area_of_polygon([n1.pos[0], n2.pos[0], n3.pos[0]],
[n1.pos[1], n2.pos[1], n3.pos[1]])
self.prop = None # either define here or in Node
def getMid(self):
return 1/3*(self.n1 + self.n2 + self.n3)
class Edge(object):
def __init__(self, n1, n2):
self.n1 = n1
self.n2 = n2
self.nodes = [n1, n2]
self.trias = []
self.sdomain = []
self.ipts = []
self.Ac = None
def getMid(self):
return 0.5*(self.n1 + self.n2)
class Node(object):
def __init__(self, x, y, z):
self.pos = np.array([x, y, z], dtype=float)
self.trias = set()
self.sdomain = None
self.index = None
self.prop = None # either define here or in Tria
def __add__(self, val):
if isinstance(val, Node):
return Node(*(self.pos + val.pos))
else:
return Node(*(self.pos + val))
def __sub__(self, val):
if isinstance(val, Node):
return Node(*(self.pos - val.pos))
else:
return Node(*(self.pos - val))
def __rmul__(self, val):
if isinstance(val, Node):
return Node(*(self.pos * val.pos))
else:
return Node(*(self.pos * val))
def __lmul__(self, val):
return self.__rmul__(val)
a = 7.
b = 2.
plt.figure(dpi=300)
nodes = np.array([
Node(0, 0, 0),
Node(a/3, 0, 0),
Node(2*a/3, 0, 0),
Node(a, 0, 0),
Node(0, b/3, 0),
Node(a/3, b/3, 0),
Node(2*a/3, b/3, 0),
Node(a, b/3, 0),
Node(0, 2*b/3, 0),
Node(a/3, 2*b/3, 0),
Node(2*a/3, 2*b/3, 0),
Node(a, 2*b/3, 0),
Node(0, b, 0),
Node(a/3, b, 0),
Node(2*a/3, b, 0),
Node(a, b, 0),
])
trias = [
Tria(nodes[0], nodes[1], nodes[5]),
Tria(nodes[1], nodes[2], nodes[6]),
Tria(nodes[2], nodes[3], nodes[7]),
Tria(nodes[0], nodes[5], nodes[4]),
Tria(nodes[1], nodes[6], nodes[5]),
Tria(nodes[2], nodes[7], nodes[6]),
Tria(nodes[4], nodes[5], nodes[9]),
Tria(nodes[5], nodes[6], nodes[10]),
Tria(nodes[6], nodes[7], nodes[11]),
Tria(nodes[4], nodes[9], nodes[8]),
Tria(nodes[5], nodes[10], nodes[9]),
Tria(nodes[6], nodes[11], nodes[10]),
Tria(nodes[8], nodes[9], nodes[13]),
Tria(nodes[9], nodes[10], nodes[14]),
Tria(nodes[10], nodes[11], nodes[15]),
Tria(nodes[8], nodes[13], nodes[12]),
Tria(nodes[9], nodes[14], nodes[13]),
Tria(nodes[10], nodes[15], nodes[14]),
]
# __________________________________________________________________
#
# the code above will come from an external triangulation algorithm
# __________________________________________________________________
#
# FOCUS HERE AND BELOW
# __________________________________________________________________
xcord = [node.pos[0] for node in nodes]
ycord = [node.pos[1] for node in nodes]
plt.scatter(xcord, ycord)
plt.gca().set_aspect('equal')
# ASSEMBLYING GLOBAL MATRICES
# renumbering nodes using Liu's suggested algorithm
# - sorting nodes from a minimum spatial position to a maximum one
# - Node oject will carry an index that will position it in the global
# stiffness matrix
nodes_xyz = np.array([n.pos for n in nodes])
index_ref_point = nodes_xyz.min(axis=0)
index_dist = ((nodes_xyz - index_ref_point)**2).sum(axis=-1)
indices = np.argsort(index_dist)
ind2node = {}
for i, node in enumerate(nodes):
node.index = i
#node.index = indices[i]
#ind2node[node.index] = node
n = nodes.shape[0]
dof = 5
# material properties
E11 = 71.e9
nu = 0.33
plyt = 0.01
lam = read_stack([0], plyt=plyt, laminaprop=(E11, E11, nu))
prop = Property(lam.A, lam.B, lam.D, lam.E)
for tria in trias:
tria.prop = prop
#TODO allocate less memory here...
k0 = np.zeros((n*dof, n*dof), dtype=np.float64)
prop_from_node = False
count = 0
Atotal = 0
for tria in trias:
Ac = tria.A
if prop_from_node:
raise
#A = f1*ipt.n1.prop.A + f2*ipt.n2.prop.A + f3*ipt.n3.prop.A
#B = f1*ipt.n1.prop.B + f2*ipt.n2.prop.B + f3*ipt.n3.prop.B
#D = f1*ipt.n1.prop.D + f2*ipt.n2.prop.D + f3*ipt.n3.prop.D
#E = f1*ipt.n1.prop.E + f2*ipt.n2.prop.E + f3*ipt.n3.prop.E
else:
A = tria.prop.A
B = tria.prop.B
D = tria.prop.D
A11 = A[0, 0]
A12 = A[0, 1]
A16 = A[0, 2]
A22 = A[1, 1]
A26 = A[1, 2]
A66 = A[2, 2]
B11 = B[0, 0]
B12 = B[0, 1]
B16 = B[0, 2]
B22 = B[1, 1]
B26 = B[1, 2]
B66 = B[2, 2]
D11 = D[0, 0]
D12 = D[0, 1]
D16 = D[0, 2]
D22 = D[1, 1]
D26 = D[1, 2]
D66 = D[2, 2]
#TODO interpolate nodal properties when used
if prop_from_node:
raise NotImplementedError('')
k = 5/6 #TODO!!!
E = k * tria.prop.E
E44 = E[0, 0]
E45 = E[0, 1]
E55 = E[1, 1]
n1, n2, n3 = tria.nodes
mid = tria.getMid()
if np.dot(np.cross((n1 - mid).pos, (n2 - mid).pos), ZGLOBAL) < 0:
n1, n2, n3 = n2, n1, n3
#TODO calculate triangle area here, in case nodes coordinate are updated
# during solution
Ac = tria.A
# sub-tria 1
x1, y1, z1 = mid.pos
x2, y2, z2 = n2.pos
x3, y3, z3 = n3.pos
a1 = x2 - x1
b1 = y2 - y1
c1 = y3 - y1
d1 = x3 - x1
tmp = [mid, n2, n3]
Ac1 = area_of_polygon([n.pos[0] for n in tmp], [n.pos[1] for n in tmp])
# sub-tria 2
x1, y1, z1 = n1.pos
x2, y2, z2 = mid.pos
x3, y3, z3 = n3.pos
a2 = x2 - x1
b2 = y2 - y1
c2 = y3 - y1
d2 = x3 - x1
tmp = [n1, mid, n3]
Ac2 = area_of_polygon([n.pos[0] for n in tmp], [n.pos[1] for n in tmp])
# sub-tria 3
x1, y1, z1 = n1.pos
x2, y2, z2 = n2.pos
x3, y3, z3 = mid.pos
a3 = x2 - x1
b3 = y2 - y1
c3 = y3 - y1
d3 = x3 - x1
tmp = [n1, n2, mid]
Ac3 = area_of_polygon([n.pos[0] for n in tmp], [n.pos[1] for n in tmp])
i1 = n1.index
i2 = n2.index
i3 = n3.index
k0[i1*dof+0, i1*dof+0] += Ac*((A11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+0, i1*dof+1] += Ac*((A12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i1*dof+0, i1*dof+3] += Ac*((B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+0, i1*dof+4] += Ac*(-0.166666666666667*d2*(B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)/Ac + (B12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i1*dof+0, i2*dof+0] += Ac*((A11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+0, i2*dof+1] += Ac*((A12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i1*dof+0, i2*dof+3] += Ac*((B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+0, i2*dof+4] += Ac*((B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (B12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i1*dof+0, i3*dof+0] += Ac*((A11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+0, i3*dof+1] += Ac*((A12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + A66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i1*dof+0, i3*dof+3] += Ac*((B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+0, i3*dof+4] += Ac*(-0.166666666666667*d2*(B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)/Ac + (B12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i1*dof+1, i1*dof+0] += Ac*((A12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+1, i1*dof+1] += Ac*((A22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i1*dof+1, i1*dof+3] += Ac*((B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+1, i1*dof+4] += Ac*(-0.166666666666667*d2*(B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)/Ac + (B22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i1*dof+1, i2*dof+0] += Ac*((A12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+1, i2*dof+1] += Ac*((A22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i1*dof+1, i2*dof+3] += Ac*((B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+1, i2*dof+4] += Ac*((B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (B22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i1*dof+1, i3*dof+0] += Ac*((A12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+1, i3*dof+1] += Ac*((A22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (A26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + A66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i1*dof+1, i3*dof+3] += Ac*((B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+1, i3*dof+4] += Ac*(-0.166666666666667*d2*(B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)/Ac + (B22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i1*dof+2, i1*dof+2] += Ac*((E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+2, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)/Ac + (E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac)
k0[i1*dof+2, i1*dof+4] += Ac*((0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)/Ac + (E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i1*dof+2, i2*dof+2] += Ac*((E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+2, i2*dof+3] += Ac*((E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)
k0[i1*dof+2, i2*dof+4] += Ac*((E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)
k0[i1*dof+2, i3*dof+2] += Ac*((E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+2, i3*dof+3] += Ac*((E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)
k0[i1*dof+2, i3*dof+4] += Ac*((E44*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E45*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + E55*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i1*dof+3, i1*dof+0] += Ac*((B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+3, i1*dof+1] += Ac*((B12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i1*dof+3, i1*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+3, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)/Ac + (D11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac)
k0[i1*dof+3, i1*dof+4] += Ac*(-0.166666666666667*d2*(D11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)/Ac + (0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)/Ac + (D12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i1*dof+3, i2*dof+0] += Ac*((B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+3, i2*dof+1] += Ac*((B12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i1*dof+3, i2*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+3, i2*dof+3] += Ac*((D11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)
k0[i1*dof+3, i2*dof+4] += Ac*((D11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (D12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)
k0[i1*dof+3, i3*dof+0] += Ac*((B11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+3, i3*dof+1] += Ac*((B12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + B66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i1*dof+3, i3*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+3, i3*dof+3] += Ac*((D11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)
k0[i1*dof+3, i3*dof+4] += Ac*(-0.166666666666667*d2*(D11*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D16*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)/Ac + (D12*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + D66*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E44*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E45*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + E55*(-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i1*dof+4, i1*dof+0] += Ac*((-0.166666666666667*B11*d2/Ac + B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+4, i1*dof+1] += Ac*((-0.166666666666667*B12*d2/Ac + B22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i1*dof+4, i1*dof+2] += Ac*((E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+4, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)/Ac + (E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + (-0.166666666666667*D11*d2/Ac + D12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i1*dof+4, i1*dof+4] += Ac*(-0.166666666666667*d2*(-0.166666666666667*D11*d2/Ac + D12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)/Ac + (0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)/Ac + (E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac + (-0.166666666666667*D12*d2/Ac + D22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i1*dof+4, i2*dof+0] += Ac*((-0.166666666666667*B11*d2/Ac + B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+4, i2*dof+1] += Ac*((-0.166666666666667*B12*d2/Ac + B22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i1*dof+4, i2*dof+2] += Ac*((E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+4, i2*dof+3] += Ac*((E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac + (-0.166666666666667*D11*d2/Ac + D12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i1*dof+4, i2*dof+4] += Ac*((E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac + (-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)*(-0.166666666666667*D12*d2/Ac + D22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)/Ac + (-d1/2 - 0.166666666666667*d2 - d3/2)*(-0.166666666666667*D11*d2/Ac + D12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i1*dof+4, i3*dof+0] += Ac*((-0.166666666666667*B11*d2/Ac + B12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+4, i3*dof+1] += Ac*((-0.166666666666667*B12*d2/Ac + B22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + B66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i1*dof+4, i3*dof+2] += Ac*((E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+4, i3*dof+3] += Ac*((E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac + (-0.166666666666667*D11*d2/Ac + D12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i1*dof+4, i3*dof+4] += Ac*(-0.166666666666667*d2*(-0.166666666666667*D11*d2/Ac + D12*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D16*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)/Ac + (E44*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac + (-0.166666666666667*D12*d2/Ac + D22*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D26*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + D66*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i2*dof+0, i1*dof+0] += Ac*((A11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+0, i1*dof+1] += Ac*((A12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i2*dof+0, i1*dof+3] += Ac*((B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+0, i1*dof+4] += Ac*(-0.166666666666667*d2*(B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)/Ac + (B12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i2*dof+0, i2*dof+0] += Ac*((A11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+0, i2*dof+1] += Ac*((A12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i2*dof+0, i2*dof+3] += Ac*((B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+0, i2*dof+4] += Ac*((B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (B12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i2*dof+0, i3*dof+0] += Ac*((A11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+0, i3*dof+1] += Ac*((A12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + A66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i2*dof+0, i3*dof+3] += Ac*((B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+0, i3*dof+4] += Ac*(-0.166666666666667*d2*(B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)/Ac + (B12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i2*dof+1, i1*dof+0] += Ac*((A12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+1, i1*dof+1] += Ac*((A22*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i2*dof+1, i1*dof+3] += Ac*((B12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+1, i1*dof+4] += Ac*(-0.166666666666667*d2*(B12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)/Ac + (B22*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i2*dof+1, i2*dof+0] += Ac*((A12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+1, i2*dof+1] += Ac*((A22*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i2*dof+1, i2*dof+3] += Ac*((B12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+1, i2*dof+4] += Ac*((B12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (B22*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i2*dof+1, i3*dof+0] += Ac*((A12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+1, i3*dof+1] += Ac*((A22*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (A26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + A66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i2*dof+1, i3*dof+3] += Ac*((B12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+1, i3*dof+4] += Ac*(-0.166666666666667*d2*(B12*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)/Ac + (B22*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i2*dof+2, i1*dof+2] += Ac*((E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+2, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)/Ac + (E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac)
k0[i2*dof+2, i1*dof+4] += Ac*((0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)/Ac + (E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i2*dof+2, i2*dof+2] += Ac*((E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+2, i2*dof+3] += Ac*((E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)
k0[i2*dof+2, i2*dof+4] += Ac*((E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)
k0[i2*dof+2, i3*dof+2] += Ac*((E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+2, i3*dof+3] += Ac*((E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)
k0[i2*dof+2, i3*dof+4] += Ac*((E44*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E45*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + E55*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i2*dof+3, i1*dof+0] += Ac*((B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+3, i1*dof+1] += Ac*((B12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i2*dof+3, i1*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+3, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)/Ac + (D11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac)
k0[i2*dof+3, i1*dof+4] += Ac*(-0.166666666666667*d2*(D11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)/Ac + (0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)/Ac + (D12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i2*dof+3, i2*dof+0] += Ac*((B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+3, i2*dof+1] += Ac*((B12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i2*dof+3, i2*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+3, i2*dof+3] += Ac*((D11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)
k0[i2*dof+3, i2*dof+4] += Ac*((D11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (D12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)
k0[i2*dof+3, i3*dof+0] += Ac*((B11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+3, i3*dof+1] += Ac*((B12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + B66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i2*dof+3, i3*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+3, i3*dof+3] += Ac*((D11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)
k0[i2*dof+3, i3*dof+4] += Ac*(-0.166666666666667*d2*(D11*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D16*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)/Ac + (D12*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + D66*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E44*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E45*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + E55*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i2*dof+4, i1*dof+0] += Ac*((B11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+4, i1*dof+1] += Ac*((B12*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B22*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (B16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i2*dof+4, i1*dof+2] += Ac*((E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+4, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)/Ac + (E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + (D11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (D16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i2*dof+4, i1*dof+4] += Ac*(-0.166666666666667*d2*(D11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)/Ac + (0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)/Ac + (E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac + (D12*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D22*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (D16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i2*dof+4, i2*dof+0] += Ac*((B11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+4, i2*dof+1] += Ac*((B12*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B22*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (B16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i2*dof+4, i2*dof+2] += Ac*((E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+4, i2*dof+3] += Ac*((E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac + (D11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (D16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i2*dof+4, i2*dof+4] += Ac*((E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac + (-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)*(D12*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D22*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)/Ac + (-d1/2 - 0.166666666666667*d2 - d3/2)*(D11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)/Ac + (D16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i2*dof+4, i3*dof+0] += Ac*((B11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+4, i3*dof+1] += Ac*((B12*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B22*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (B16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + B26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i2*dof+4, i3*dof+2] += Ac*((E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+4, i3*dof+3] += Ac*((E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac + (D11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (D16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i2*dof+4, i3*dof+4] += Ac*(-0.166666666666667*d2*(D11*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D12*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)/Ac + (E44*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac + (D12*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D22*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D26*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (D16*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + D26*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i3*dof+0, i1*dof+0] += Ac*((A11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+0, i1*dof+1] += Ac*((A12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i3*dof+0, i1*dof+3] += Ac*((B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+0, i1*dof+4] += Ac*(-0.166666666666667*d2*(B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)/Ac + (B12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i3*dof+0, i2*dof+0] += Ac*((A11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+0, i2*dof+1] += Ac*((A12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i3*dof+0, i2*dof+3] += Ac*((B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+0, i2*dof+4] += Ac*((B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (B12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i3*dof+0, i3*dof+0] += Ac*((A11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+0, i3*dof+1] += Ac*((A12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + A66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i3*dof+0, i3*dof+3] += Ac*((B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+0, i3*dof+4] += Ac*(-0.166666666666667*d2*(B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)/Ac + (B12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i3*dof+1, i1*dof+0] += Ac*((A12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+1, i1*dof+1] += Ac*((A22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i3*dof+1, i1*dof+3] += Ac*((B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+1, i1*dof+4] += Ac*(-0.166666666666667*d2*(B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)/Ac + (B22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i3*dof+1, i2*dof+0] += Ac*((A12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+1, i2*dof+1] += Ac*((A22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i3*dof+1, i2*dof+3] += Ac*((B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+1, i2*dof+4] += Ac*((B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (B22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i3*dof+1, i3*dof+0] += Ac*((A12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+1, i3*dof+1] += Ac*((A22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (A26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + A66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i3*dof+1, i3*dof+3] += Ac*((B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+1, i3*dof+4] += Ac*(-0.166666666666667*d2*(B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)/Ac + (B22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i3*dof+2, i1*dof+2] += Ac*((E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+2, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)/Ac + (E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac)
k0[i3*dof+2, i1*dof+4] += Ac*((0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)/Ac + (E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i3*dof+2, i2*dof+2] += Ac*((E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+2, i2*dof+3] += Ac*((E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)
k0[i3*dof+2, i2*dof+4] += Ac*((E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)
k0[i3*dof+2, i3*dof+2] += Ac*((E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+2, i3*dof+3] += Ac*((E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)
k0[i3*dof+2, i3*dof+4] += Ac*((E44*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E45*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + E55*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i3*dof+3, i1*dof+0] += Ac*((B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+3, i1*dof+1] += Ac*((B12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i3*dof+3, i1*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+3, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)/Ac + (D11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac)
k0[i3*dof+3, i1*dof+4] += Ac*(-0.166666666666667*d2*(D11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)/Ac + (0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)/Ac + (D12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i3*dof+3, i2*dof+0] += Ac*((B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+3, i2*dof+1] += Ac*((B12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i3*dof+3, i2*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+3, i2*dof+3] += Ac*((D11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac)
k0[i3*dof+3, i2*dof+4] += Ac*((D11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-d1/2 - 0.166666666666667*d2 - d3/2)/Ac + (D12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac)
k0[i3*dof+3, i3*dof+0] += Ac*((B11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+3, i3*dof+1] += Ac*((B12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + B66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i3*dof+3, i3*dof+2] += Ac*((E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+3, i3*dof+3] += Ac*((D11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)
k0[i3*dof+3, i3*dof+4] += Ac*(-0.166666666666667*d2*(D11*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D16*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)/Ac + (D12*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + D66*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E44*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E45*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + E55*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)
k0[i3*dof+4, i1*dof+0] += Ac*((-0.166666666666667*B11*d2/Ac + B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+4, i1*dof+1] += Ac*((-0.166666666666667*B12*d2/Ac + B22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i3*dof+4, i1*dof+2] += Ac*((E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+4, i1*dof+3] += Ac*((-0.0833333333333333*a2*d2 + 0.0833333333333333*a3*d3)*(E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)/Ac + (E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a2*c2 - 0.0833333333333333*b3*d3)/Ac + (-0.166666666666667*D11*d2/Ac + D12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + 0.333333333333333*d2 + d3/2)/Ac)
k0[i3*dof+4, i1*dof+4] += Ac*(-0.166666666666667*d2*(-0.166666666666667*D11*d2/Ac + D12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)/Ac + (0.0833333333333333*b2*c2 - 0.0833333333333333*b3*c3)*(E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)/Ac + (E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + Ac2/2 + Ac3/2 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac + (-0.166666666666667*D12*d2/Ac + D22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 - a2/2 - 0.333333333333333*a3 + 0.166666666666667*d1 + d2/2 + d3/2)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 + b2/2 + 0.333333333333333*b3 - 0.166666666666667*c1 - 0.333333333333333*c2 - c3/2)/Ac)
k0[i3*dof+4, i2*dof+0] += Ac*((-0.166666666666667*B11*d2/Ac + B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+4, i2*dof+1] += Ac*((-0.166666666666667*B12*d2/Ac + B22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i3*dof+4, i2*dof+2] += Ac*((E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+4, i2*dof+3] += Ac*((E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + 0.0833333333333333*a2*c2 + a3*c3/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-a1*d1/4 - 0.0833333333333333*a2*d2 - 0.166666666666667*a3*d3)/Ac + (-0.166666666666667*D11*d2/Ac + D12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.166666666666667*a1 + 0.166666666666667*a3 - 0.333333333333333*d1 - 0.166666666666667*d2 - d3/2)/Ac)
k0[i3*dof+4, i2*dof+4] += Ac*((E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(b1*c1/4 + 0.0833333333333333*b2*c2 + 0.166666666666667*b3*c3)/Ac + (E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a3*c3 - b1*d1/4 - 0.0833333333333333*b2*d2 - b3*d3/4)/Ac + (-0.166666666666667*a1 + 0.166666666666667*a3 + 0.166666666666667*d1)*(-0.166666666666667*D12*d2/Ac + D22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)/Ac + (-d1/2 - 0.166666666666667*d2 - d3/2)*(-0.166666666666667*D11*d2/Ac + D12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.166666666666667*b1 - 0.166666666666667*b3 + 0.333333333333333*c1 + 0.166666666666667*c2 + c3/2)/Ac)
k0[i3*dof+4, i3*dof+0] += Ac*((-0.166666666666667*B11*d2/Ac + B12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+4, i3*dof+1] += Ac*((-0.166666666666667*B12*d2/Ac + B22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac + (-0.166666666666667*B16*d2/Ac + B26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + B66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
k0[i3*dof+4, i3*dof+2] += Ac*((E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+4, i3*dof+3] += Ac*((E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + 0.0833333333333333*a2*c2 - b1*d1/4 - b2*d2/4 - 0.0833333333333333*b3*d3)/Ac + (E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(a1*d1/4 + 0.166666666666667*a2*d2 + 0.0833333333333333*a3*d3)/Ac + (-0.166666666666667*D11*d2/Ac + D12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1 - 0.166666666666667*d2)/Ac)
k0[i3*dof+4, i3*dof+4] += Ac*(-0.166666666666667*d2*(-0.166666666666667*D11*d2/Ac + D12*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D16*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)/Ac + (E44*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E45*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + (E45*(-b1*c1/4 - 0.166666666666667*b2*c2 - 0.0833333333333333*b3*c3)/Ac + E55*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac)*(0.166666666666667*Ac1 + a1*c1/4 + a2*c2/4 + 0.0833333333333333*a3*c3 - 0.0833333333333333*b2*d2)/Ac + (-0.166666666666667*D12*d2/Ac + D22*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D26*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + (-0.166666666666667*D16*d2/Ac + D26*(0.333333333333333*a1 + a2/2 + 0.166666666666667*a3 + 0.166666666666667*d1)/Ac + D66*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)*(-0.333333333333333*b1 - b2/2 - 0.166666666666667*b3 - 0.166666666666667*c1 + 0.166666666666667*c2)/Ac)
print('Atotal:', Atotal)
puvw = 2
for subcase in (1, 3):
if subcase == 1:
print('SUBCASE %d' % subcase)
k0run = k0.copy()
# force vector
fext = np.zeros(n*dof, dtype=np.float64)
fext[nodes[3].index*dof + puvw] = 500.
fext[nodes[7].index*dof + puvw] = 1000.
fext[nodes[11].index*dof + puvw] = 1000.
fext[nodes[15].index*dof + puvw] = 500.
i, j = np.indices(k0run.shape)
#k0run[i, j] = k0run[j, i]
print('symmetry check 1:', np.abs(k0run[i, j] - k0run[j, i]).max())
print('symmetry check 2:', k0run[i>j].sum(), k0run[i<j].sum())
# boundary conditions
for i in [0, 4, 8, 12]:
for j in [0, 1, 2, 3]:
k0run[nodes[i].index*dof+j, :] = 0
k0run[:, nodes[i].index*dof+j] = 0
k0run = coo_matrix(k0run)
u = solve(k0run, fext, silent=True)
xcord = np.array([node.pos[0] for node in nodes])
ycord = np.array([node.pos[1] for node in nodes])
wmin = u[puvw::dof].min()
wmax = u[puvw::dof].max()
levels = np.linspace(wmin, wmax, 400)
print(u[puvw::dof].reshape(4, 4))
elif subcase == 3:
print('SUBCASE %d' % subcase)
k0run = k0.copy()
# force vector
fext = np.zeros(n*dof, dtype=np.float64)
fext[nodes[14].index*dof + puvw] = -1000.
fext[nodes[2].index*dof + puvw] = 1000.
# boundary conditions
for i in [0, 4, 8, 12]:
for j in [0, 1, 2, 3]:
k0run[nodes[i].index*dof+j, :] = 0
k0run[:, nodes[i].index*dof+j] = 0
for i in [3, 7, 11, 15]:
for j in [0, 1, 2]:
k0run[nodes[i].index*dof+j, :] = 0
k0run[:, nodes[i].index*dof+j] = 0
k0run = coo_matrix(k0run)
u = solve(k0run, fext, silent=True)
xcord = np.array([node.pos[0] for node in nodes])
ycord = np.array([node.pos[1] for node in nodes])
wmin = u[puvw::dof].min()
wmax = u[puvw::dof].max()
levels = np.linspace(wmin, wmax, 400)
print(u[puvw::dof].reshape(4, 4))
plt.contourf(xcord.reshape(4, 4), ycord.reshape(4, 4), u[puvw::dof].reshape(4, 4),
levels=levels)
plt.savefig('plot_sfem_tria3_example.png', bbox_inches='tight')
| 291.901408
| 1,495
| 0.704735
| 26,210
| 165,800
| 4.447615
| 0.011675
| 0.449645
| 0.059354
| 0.069485
| 0.971906
| 0.971014
| 0.969058
| 0.968354
| 0.966887
| 0.966544
| 0
| 0.657708
| 0.105688
| 165,800
| 567
| 1,496
| 292.416226
| 0.128469
| 0.00845
| 0
| 0.138767
| 0
| 0
| 0.000596
| 0.000164
| 0
| 0
| 0
| 0.001764
| 0
| 1
| 0.028634
| false
| 0
| 0.011013
| 0.006608
| 0.07489
| 0.015419
| 0
| 0
| 0
| null | 1
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 11
|
da0400caf5649b380246d2ceea406e211e0326be
| 56,975
|
py
|
Python
|
infoblox_netmri/api/broker/v3_6_0/device_flow_filter_cfg_broker.py
|
IngmarVG-IB/infoblox-netmri
|
b0c725fd64aee1890d83917d911b89236207e564
|
[
"Apache-2.0"
] | null | null | null |
infoblox_netmri/api/broker/v3_6_0/device_flow_filter_cfg_broker.py
|
IngmarVG-IB/infoblox-netmri
|
b0c725fd64aee1890d83917d911b89236207e564
|
[
"Apache-2.0"
] | null | null | null |
infoblox_netmri/api/broker/v3_6_0/device_flow_filter_cfg_broker.py
|
IngmarVG-IB/infoblox-netmri
|
b0c725fd64aee1890d83917d911b89236207e564
|
[
"Apache-2.0"
] | null | null | null |
from ..broker import Broker
class DeviceFlowFilterCfgBroker(Broker):
controller = "device_flow_filter_cfgs"
def show(self, **kwargs):
"""Shows the details for the specified device flow filter cfg.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param DeviceFlowFilterCfgID: The internal NetMRI identifier for this ip packet flow definition.
:type DeviceFlowFilterCfgID: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param methods: A list of device flow filter cfg methods. The listed methods will be called on each device flow filter cfg returned and included in the output. Available methods are: src_device_zone, dest_device_zone, data_source, device.
:type methods: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param include: A list of associated object types to include in the output. The listed associations will be returned as outputs named according to the association name (see outputs below). Available includes are: src_device_zone, dest_device_zone, data_source, device.
:type include: Array of String
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return device_flow_filter_cfg: The device flow filter cfg identified by the specified DeviceFlowFilterCfgID.
:rtype device_flow_filter_cfg: DeviceFlowFilterCfg
"""
return self.api_request(self._get_method_fullname("show"), kwargs)
def index(self, **kwargs):
"""Lists the available device flow filter cfgs. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is most efficient.
**Inputs**
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param DeviceFlowFilterCfgID: The internal NetMRI identifier for this ip packet flow definition.
:type DeviceFlowFilterCfgID: Array of Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param DeviceGroupID: The internal NetMRI identifier of the device groups to which to limit the results.
:type DeviceGroupID: Array of Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param timestamp: The data returned will represent the device flow filter cfgs as of this date and time. If omitted, the result will indicate the most recently collected data.
:type timestamp: DateTime
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param methods: A list of device flow filter cfg methods. The listed methods will be called on each device flow filter cfg returned and included in the output. Available methods are: src_device_zone, dest_device_zone, data_source, device.
:type methods: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param include: A list of associated object types to include in the output. The listed associations will be returned as outputs named according to the association name (see outputs below). Available includes are: src_device_zone, dest_device_zone, data_source, device.
:type include: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 0
:param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
:type start: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 1000
:param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
:type limit: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` DeviceFlowFilterCfgID
:param sort: The data field(s) to use for sorting the output. Default is DeviceFlowFilterCfgID. Valid values are DeviceFlowFilterCfgID, DeviceID, DataSourceID, FfcName, FfcData, FfcFirstSeenTime, FfcStartTime, FfcEndTime, FfcTimestamp, FfcChangedCols, SrcDeviceZoneID, DestDeviceZoneID, FfcType, FfcDisplayText, FfcConfigText, FfcProvisionData.
:type sort: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` asc
:param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
:type dir: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param select: The list of attributes to return for each DeviceFlowFilterCfg. Valid values are DeviceFlowFilterCfgID, DeviceID, DataSourceID, FfcName, FfcData, FfcFirstSeenTime, FfcStartTime, FfcEndTime, FfcTimestamp, FfcChangedCols, SrcDeviceZoneID, DestDeviceZoneID, FfcType, FfcDisplayText, FfcConfigText, FfcProvisionData. If empty or omitted, all attributes will be returned.
:type select: Array
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
:type goto_field: String
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
:type goto_value: String
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return device_flow_filter_cfgs: An array of the DeviceFlowFilterCfg objects that match the specified input criteria.
:rtype device_flow_filter_cfgs: Array of DeviceFlowFilterCfg
"""
return self.api_list_request(self._get_method_fullname("index"), kwargs)
def search(self, **kwargs):
"""Lists the available device flow filter cfgs matching the input criteria. This method provides a more flexible search interface than the index method, but searching using this method is more demanding on the system and will not perform to the same level as the index method. The input fields listed below will be used as in the index method, to filter the result, along with the optional query string and XML filter described below.
**Inputs**
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param DataSourceID: The internal NetMRI identifier for the collector NetMRI that collected this data record.
:type DataSourceID: Array of Integer
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param DestDeviceZoneID: The internal NetMRI identifier of the Zone that is destination point for this ip packet flow definition.
:type DestDeviceZoneID: Array of Integer
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param DeviceFlowFilterCfgID: The internal NetMRI identifier for this ip packet flow definition.
:type DeviceFlowFilterCfgID: Array of Integer
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param DeviceID: The internal NetMRI identifier for the device to which belongs this ip packet flow definition
:type DeviceID: Array of Integer
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcChangedCols: The fields that changed between this revision of the record and the previous revision.
:type FfcChangedCols: Array of String
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcConfigText: The text that was defined in the configuration for this ip packet flow definition.
:type FfcConfigText: Array of String
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcData: Extra data for this usage of the rulelist. May depend on the vendor implementation.
:type FfcData: Array of String
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcDisplayText: The associated text for display.
:type FfcDisplayText: Array of String
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcEndTime: The ending effective time of this record, or empty if still in effect.
:type FfcEndTime: Array of DateTime
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcFirstSeenTime: The timestamp of when NetMRI saw for the first time this ip packet flow definition
:type FfcFirstSeenTime: Array of DateTime
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcName: The name associated with this usage of the rulelist.
:type FfcName: Array of String
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcProvisionData: Internal data - do not modify, may change without warning.
:type FfcProvisionData: Array of String
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcStartTime: The starting effective time of this record.
:type FfcStartTime: Array of DateTime
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcTimestamp: The date and time this record was collected or calculated.
:type FfcTimestamp: Array of DateTime
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param FfcType: The type of operation applied on this ip packet flow definition. One of : 'filter', 'nat', 'vpn',
:type FfcType: Array of String
| ``api version min:`` 2.6
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param SrcDeviceZoneID: The internal NetMRI identifier of the Zone that is source point for this ip packet flow definition
:type SrcDeviceZoneID: Array of Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param DeviceGroupID: The internal NetMRI identifier of the device groups to which to limit the results.
:type DeviceGroupID: Array of Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param timestamp: The data returned will represent the device flow filter cfgs as of this date and time. If omitted, the result will indicate the most recently collected data.
:type timestamp: DateTime
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param methods: A list of device flow filter cfg methods. The listed methods will be called on each device flow filter cfg returned and included in the output. Available methods are: src_device_zone, dest_device_zone, data_source, device.
:type methods: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param include: A list of associated object types to include in the output. The listed associations will be returned as outputs named according to the association name (see outputs below). Available includes are: src_device_zone, dest_device_zone, data_source, device.
:type include: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 0
:param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
:type start: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 1000
:param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
:type limit: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` DeviceFlowFilterCfgID
:param sort: The data field(s) to use for sorting the output. Default is DeviceFlowFilterCfgID. Valid values are DeviceFlowFilterCfgID, DeviceID, DataSourceID, FfcName, FfcData, FfcFirstSeenTime, FfcStartTime, FfcEndTime, FfcTimestamp, FfcChangedCols, SrcDeviceZoneID, DestDeviceZoneID, FfcType, FfcDisplayText, FfcConfigText, FfcProvisionData.
:type sort: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` asc
:param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
:type dir: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param select: The list of attributes to return for each DeviceFlowFilterCfg. Valid values are DeviceFlowFilterCfgID, DeviceID, DataSourceID, FfcName, FfcData, FfcFirstSeenTime, FfcStartTime, FfcEndTime, FfcTimestamp, FfcChangedCols, SrcDeviceZoneID, DestDeviceZoneID, FfcType, FfcDisplayText, FfcConfigText, FfcProvisionData. If empty or omitted, all attributes will be returned.
:type select: Array
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
:type goto_field: String
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
:type goto_value: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param query: This value will be matched against device flow filter cfgs, looking to see if one or more of the listed attributes contain the passed value. You may also surround the value with '/' and '/' to perform a regular expression search rather than a containment operation. Any record that matches will be returned. The attributes searched are: DataSourceID, DestDeviceZoneID, DeviceFlowFilterCfgID, DeviceID, FfcChangedCols, FfcConfigText, FfcData, FfcDisplayText, FfcEndTime, FfcFirstSeenTime, FfcName, FfcProvisionData, FfcStartTime, FfcTimestamp, FfcType, SrcDeviceZoneID.
:type query: String
| ``api version min:`` 2.3
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param xml_filter: A SetFilter XML structure to further refine the search. The SetFilter will be applied AFTER any search query or field values, but before any limit options. The limit and pagination will be enforced after the filter. Remind that this kind of filter may be costly and inefficient if not associated with a database filtering.
:type xml_filter: String
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return device_flow_filter_cfgs: An array of the DeviceFlowFilterCfg objects that match the specified input criteria.
:rtype device_flow_filter_cfgs: Array of DeviceFlowFilterCfg
"""
return self.api_list_request(self._get_method_fullname("search"), kwargs)
def find(self, **kwargs):
"""Lists the available device flow filter cfgs matching the input specification. This provides the most flexible search specification of all the query mechanisms, enabling searching using comparison operations other than equality. However, it is more complex to use and will not perform as efficiently as the index or search methods. In the input descriptions below, 'field names' refers to the following fields: DataSourceID, DestDeviceZoneID, DeviceFlowFilterCfgID, DeviceID, FfcChangedCols, FfcConfigText, FfcData, FfcDisplayText, FfcEndTime, FfcFirstSeenTime, FfcName, FfcProvisionData, FfcStartTime, FfcTimestamp, FfcType, SrcDeviceZoneID.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_DataSourceID: The operator to apply to the field DataSourceID. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. DataSourceID: The internal NetMRI identifier for the collector NetMRI that collected this data record. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_DataSourceID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_DataSourceID: If op_DataSourceID is specified, the field named in this input will be compared to the value in DataSourceID using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_DataSourceID must be specified if op_DataSourceID is specified.
:type val_f_DataSourceID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_DataSourceID: If op_DataSourceID is specified, this value will be compared to the value in DataSourceID using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_DataSourceID must be specified if op_DataSourceID is specified.
:type val_c_DataSourceID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_DestDeviceZoneID: The operator to apply to the field DestDeviceZoneID. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. DestDeviceZoneID: The internal NetMRI identifier of the Zone that is destination point for this ip packet flow definition. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_DestDeviceZoneID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_DestDeviceZoneID: If op_DestDeviceZoneID is specified, the field named in this input will be compared to the value in DestDeviceZoneID using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_DestDeviceZoneID must be specified if op_DestDeviceZoneID is specified.
:type val_f_DestDeviceZoneID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_DestDeviceZoneID: If op_DestDeviceZoneID is specified, this value will be compared to the value in DestDeviceZoneID using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_DestDeviceZoneID must be specified if op_DestDeviceZoneID is specified.
:type val_c_DestDeviceZoneID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_DeviceFlowFilterCfgID: The operator to apply to the field DeviceFlowFilterCfgID. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. DeviceFlowFilterCfgID: The internal NetMRI identifier for this ip packet flow definition. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_DeviceFlowFilterCfgID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_DeviceFlowFilterCfgID: If op_DeviceFlowFilterCfgID is specified, the field named in this input will be compared to the value in DeviceFlowFilterCfgID using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_DeviceFlowFilterCfgID must be specified if op_DeviceFlowFilterCfgID is specified.
:type val_f_DeviceFlowFilterCfgID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_DeviceFlowFilterCfgID: If op_DeviceFlowFilterCfgID is specified, this value will be compared to the value in DeviceFlowFilterCfgID using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_DeviceFlowFilterCfgID must be specified if op_DeviceFlowFilterCfgID is specified.
:type val_c_DeviceFlowFilterCfgID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_DeviceID: The operator to apply to the field DeviceID. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. DeviceID: The internal NetMRI identifier for the device to which belongs this ip packet flow definition For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_DeviceID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_DeviceID: If op_DeviceID is specified, the field named in this input will be compared to the value in DeviceID using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_DeviceID must be specified if op_DeviceID is specified.
:type val_f_DeviceID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_DeviceID: If op_DeviceID is specified, this value will be compared to the value in DeviceID using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_DeviceID must be specified if op_DeviceID is specified.
:type val_c_DeviceID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcChangedCols: The operator to apply to the field FfcChangedCols. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcChangedCols: The fields that changed between this revision of the record and the previous revision. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcChangedCols: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcChangedCols: If op_FfcChangedCols is specified, the field named in this input will be compared to the value in FfcChangedCols using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcChangedCols must be specified if op_FfcChangedCols is specified.
:type val_f_FfcChangedCols: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcChangedCols: If op_FfcChangedCols is specified, this value will be compared to the value in FfcChangedCols using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcChangedCols must be specified if op_FfcChangedCols is specified.
:type val_c_FfcChangedCols: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcConfigText: The operator to apply to the field FfcConfigText. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcConfigText: The text that was defined in the configuration for this ip packet flow definition. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcConfigText: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcConfigText: If op_FfcConfigText is specified, the field named in this input will be compared to the value in FfcConfigText using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcConfigText must be specified if op_FfcConfigText is specified.
:type val_f_FfcConfigText: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcConfigText: If op_FfcConfigText is specified, this value will be compared to the value in FfcConfigText using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcConfigText must be specified if op_FfcConfigText is specified.
:type val_c_FfcConfigText: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcData: The operator to apply to the field FfcData. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcData: Extra data for this usage of the rulelist. May depend on the vendor implementation. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcData: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcData: If op_FfcData is specified, the field named in this input will be compared to the value in FfcData using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcData must be specified if op_FfcData is specified.
:type val_f_FfcData: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcData: If op_FfcData is specified, this value will be compared to the value in FfcData using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcData must be specified if op_FfcData is specified.
:type val_c_FfcData: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcDisplayText: The operator to apply to the field FfcDisplayText. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcDisplayText: The associated text for display. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcDisplayText: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcDisplayText: If op_FfcDisplayText is specified, the field named in this input will be compared to the value in FfcDisplayText using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcDisplayText must be specified if op_FfcDisplayText is specified.
:type val_f_FfcDisplayText: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcDisplayText: If op_FfcDisplayText is specified, this value will be compared to the value in FfcDisplayText using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcDisplayText must be specified if op_FfcDisplayText is specified.
:type val_c_FfcDisplayText: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcEndTime: The operator to apply to the field FfcEndTime. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcEndTime: The ending effective time of this record, or empty if still in effect. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcEndTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcEndTime: If op_FfcEndTime is specified, the field named in this input will be compared to the value in FfcEndTime using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcEndTime must be specified if op_FfcEndTime is specified.
:type val_f_FfcEndTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcEndTime: If op_FfcEndTime is specified, this value will be compared to the value in FfcEndTime using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcEndTime must be specified if op_FfcEndTime is specified.
:type val_c_FfcEndTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcFirstSeenTime: The operator to apply to the field FfcFirstSeenTime. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcFirstSeenTime: The timestamp of when NetMRI saw for the first time this ip packet flow definition For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcFirstSeenTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcFirstSeenTime: If op_FfcFirstSeenTime is specified, the field named in this input will be compared to the value in FfcFirstSeenTime using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcFirstSeenTime must be specified if op_FfcFirstSeenTime is specified.
:type val_f_FfcFirstSeenTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcFirstSeenTime: If op_FfcFirstSeenTime is specified, this value will be compared to the value in FfcFirstSeenTime using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcFirstSeenTime must be specified if op_FfcFirstSeenTime is specified.
:type val_c_FfcFirstSeenTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcName: The operator to apply to the field FfcName. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcName: The name associated with this usage of the rulelist. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcName: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcName: If op_FfcName is specified, the field named in this input will be compared to the value in FfcName using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcName must be specified if op_FfcName is specified.
:type val_f_FfcName: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcName: If op_FfcName is specified, this value will be compared to the value in FfcName using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcName must be specified if op_FfcName is specified.
:type val_c_FfcName: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcProvisionData: The operator to apply to the field FfcProvisionData. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcProvisionData: Internal data - do not modify, may change without warning. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcProvisionData: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcProvisionData: If op_FfcProvisionData is specified, the field named in this input will be compared to the value in FfcProvisionData using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcProvisionData must be specified if op_FfcProvisionData is specified.
:type val_f_FfcProvisionData: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcProvisionData: If op_FfcProvisionData is specified, this value will be compared to the value in FfcProvisionData using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcProvisionData must be specified if op_FfcProvisionData is specified.
:type val_c_FfcProvisionData: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcStartTime: The operator to apply to the field FfcStartTime. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcStartTime: The starting effective time of this record. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcStartTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcStartTime: If op_FfcStartTime is specified, the field named in this input will be compared to the value in FfcStartTime using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcStartTime must be specified if op_FfcStartTime is specified.
:type val_f_FfcStartTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcStartTime: If op_FfcStartTime is specified, this value will be compared to the value in FfcStartTime using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcStartTime must be specified if op_FfcStartTime is specified.
:type val_c_FfcStartTime: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcTimestamp: The operator to apply to the field FfcTimestamp. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcTimestamp: The date and time this record was collected or calculated. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcTimestamp: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcTimestamp: If op_FfcTimestamp is specified, the field named in this input will be compared to the value in FfcTimestamp using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcTimestamp must be specified if op_FfcTimestamp is specified.
:type val_f_FfcTimestamp: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcTimestamp: If op_FfcTimestamp is specified, this value will be compared to the value in FfcTimestamp using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcTimestamp must be specified if op_FfcTimestamp is specified.
:type val_c_FfcTimestamp: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_FfcType: The operator to apply to the field FfcType. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. FfcType: The type of operation applied on this ip packet flow definition. One of : 'filter', 'nat', 'vpn', For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_FfcType: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_FfcType: If op_FfcType is specified, the field named in this input will be compared to the value in FfcType using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_FfcType must be specified if op_FfcType is specified.
:type val_f_FfcType: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_FfcType: If op_FfcType is specified, this value will be compared to the value in FfcType using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_FfcType must be specified if op_FfcType is specified.
:type val_c_FfcType: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_SrcDeviceZoneID: The operator to apply to the field SrcDeviceZoneID. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. SrcDeviceZoneID: The internal NetMRI identifier of the Zone that is source point for this ip packet flow definition For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_SrcDeviceZoneID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_SrcDeviceZoneID: If op_SrcDeviceZoneID is specified, the field named in this input will be compared to the value in SrcDeviceZoneID using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_SrcDeviceZoneID must be specified if op_SrcDeviceZoneID is specified.
:type val_f_SrcDeviceZoneID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_SrcDeviceZoneID: If op_SrcDeviceZoneID is specified, this value will be compared to the value in SrcDeviceZoneID using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_SrcDeviceZoneID must be specified if op_SrcDeviceZoneID is specified.
:type val_c_SrcDeviceZoneID: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param DeviceGroupID: The internal NetMRI identifier of the device groups to which to limit the results.
:type DeviceGroupID: Array of Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param timestamp: The data returned will represent the device flow filter cfgs as of this date and time. If omitted, the result will indicate the most recently collected data.
:type timestamp: DateTime
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param methods: A list of device flow filter cfg methods. The listed methods will be called on each device flow filter cfg returned and included in the output. Available methods are: src_device_zone, dest_device_zone, data_source, device.
:type methods: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param include: A list of associated object types to include in the output. The listed associations will be returned as outputs named according to the association name (see outputs below). Available includes are: src_device_zone, dest_device_zone, data_source, device.
:type include: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 0
:param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
:type start: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 1000
:param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
:type limit: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` DeviceFlowFilterCfgID
:param sort: The data field(s) to use for sorting the output. Default is DeviceFlowFilterCfgID. Valid values are DeviceFlowFilterCfgID, DeviceID, DataSourceID, FfcName, FfcData, FfcFirstSeenTime, FfcStartTime, FfcEndTime, FfcTimestamp, FfcChangedCols, SrcDeviceZoneID, DestDeviceZoneID, FfcType, FfcDisplayText, FfcConfigText, FfcProvisionData.
:type sort: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` asc
:param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
:type dir: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param select: The list of attributes to return for each DeviceFlowFilterCfg. Valid values are DeviceFlowFilterCfgID, DeviceID, DataSourceID, FfcName, FfcData, FfcFirstSeenTime, FfcStartTime, FfcEndTime, FfcTimestamp, FfcChangedCols, SrcDeviceZoneID, DestDeviceZoneID, FfcType, FfcDisplayText, FfcConfigText, FfcProvisionData. If empty or omitted, all attributes will be returned.
:type select: Array
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
:type goto_field: String
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
:type goto_value: String
| ``api version min:`` 2.3
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param xml_filter: A SetFilter XML structure to further refine the search. The SetFilter will be applied AFTER any search query or field values, but before any limit options. The limit and pagination will be enforced after the filter. Remind that this kind of filter may be costly and inefficient if not associated with a database filtering.
:type xml_filter: String
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return device_flow_filter_cfgs: An array of the DeviceFlowFilterCfg objects that match the specified input criteria.
:rtype device_flow_filter_cfgs: Array of DeviceFlowFilterCfg
"""
return self.api_list_request(self._get_method_fullname("find"), kwargs)
def src_device_zone(self, **kwargs):
"""The DeviceZone that is source point for this ip packet flow definition.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param DeviceFlowFilterCfgID: The internal NetMRI identifier for this ip packet flow definition.
:type DeviceFlowFilterCfgID: Integer
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return : The DeviceZone that is source point for this ip packet flow definition.
:rtype : DeviceZone
"""
return self.api_request(self._get_method_fullname("src_device_zone"), kwargs)
def dest_device_zone(self, **kwargs):
"""The DeviceZone that is destination point for this ip packet flow definition.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param DeviceFlowFilterCfgID: The internal NetMRI identifier for this ip packet flow definition.
:type DeviceFlowFilterCfgID: Integer
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return : The DeviceZone that is destination point for this ip packet flow definition.
:rtype : DeviceZone
"""
return self.api_request(self._get_method_fullname("dest_device_zone"), kwargs)
def device(self, **kwargs):
"""The device from which this data was collected.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param DeviceFlowFilterCfgID: The internal NetMRI identifier for this ip packet flow definition.
:type DeviceFlowFilterCfgID: Integer
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return : The device from which this data was collected.
:rtype : Device
"""
return self.api_request(self._get_method_fullname("device"), kwargs)
def data_source(self, **kwargs):
"""The collector NetMRI that collected this data record.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param DeviceFlowFilterCfgID: The internal NetMRI identifier for this ip packet flow definition.
:type DeviceFlowFilterCfgID: Integer
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return : The collector NetMRI that collected this data record.
:rtype : DataSource
"""
return self.api_request(self._get_method_fullname("data_source"), kwargs)
| 54.521531
| 652
| 0.620974
| 6,943
| 56,975
| 5.035431
| 0.045369
| 0.06636
| 0.043134
| 0.056406
| 0.940019
| 0.939104
| 0.909985
| 0.897057
| 0.885015
| 0.88367
| 0
| 0.002832
| 0.299552
| 56,975
| 1,045
| 653
| 54.521531
| 0.873208
| 0.823168
| 0
| 0
| 0
| 0
| 0.065265
| 0.016679
| 0
| 0
| 0
| 0
| 0
| 1
| 0.421053
| false
| 0
| 0.052632
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 9
|
da15be72276d5aa5aae273cd0eaa7947c72d00e3
| 19,857
|
py
|
Python
|
goldstone/user/tests.py
|
Solinea/goldstone-server
|
91b078ca9fed1b33f48dc79f4af5c9d1817a1bc5
|
[
"Apache-2.0"
] | 14
|
2015-05-18T22:11:11.000Z
|
2020-08-14T06:50:09.000Z
|
goldstone/user/tests.py
|
lexjacobs/goldstone-server
|
91b078ca9fed1b33f48dc79f4af5c9d1817a1bc5
|
[
"Apache-2.0"
] | 568
|
2015-05-17T01:26:36.000Z
|
2021-06-10T20:36:47.000Z
|
goldstone/user/tests.py
|
lexjacobs/goldstone-server
|
91b078ca9fed1b33f48dc79f4af5c9d1817a1bc5
|
[
"Apache-2.0"
] | 22
|
2015-05-25T20:16:06.000Z
|
2021-08-08T20:25:24.000Z
|
"""Custom User model tests."""
# Copyright 2015 Solinea, 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 json
from copy import deepcopy
from django.contrib.auth import get_user_model
from rest_framework.status import HTTP_200_OK, HTTP_401_UNAUTHORIZED, \
HTTP_400_BAD_REQUEST
from goldstone.tenants.models import Tenant, Cloud
from goldstone.test_utils import create_and_login, Setup, USER_URL, \
AUTHORIZATION_PAYLOAD, CONTENT_NO_CREDENTIALS, CONTENT_BAD_TOKEN, \
CONTENT_MISSING_USERNAME, TEST_USER_1, check_response_without_uuid, \
BAD_TOKEN
# Test content.
EXPECTED_CONTENT = {"username": TEST_USER_1[0],
"first_name": '',
"last_name": '',
"email": TEST_USER_1[1],
"tenant_admin": False,
"is_superuser": False,
"default_tenant_admin": False}
class NoAccess(Setup):
"""The user attempts access without being logged in, or presenting a bad
authentication token."""
def test_get_nologin(self):
"""Getting while not logged in."""
response = self.client.get(USER_URL)
self.assertContains(response,
CONTENT_NO_CREDENTIALS,
status_code=HTTP_401_UNAUTHORIZED)
def test_get_badtoken(self):
"""Getting while not logged in, using any token."""
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % BAD_TOKEN)
self.assertContains(response,
CONTENT_BAD_TOKEN,
status_code=HTTP_401_UNAUTHORIZED)
def test_loggedin_get_badtoken(self):
"""Getting while logged in, using a bad token."""
# Create a user.
create_and_login()
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % BAD_TOKEN)
self.assertContains(response,
CONTENT_BAD_TOKEN,
status_code=HTTP_401_UNAUTHORIZED)
def test_put_nologin(self):
"""Putting (trying to change user attributes) while not logged in."""
response = self.client.put(USER_URL,
json.dumps({"first_name": "Dirk"}),
content_type="application/json")
self.assertContains(response,
CONTENT_NO_CREDENTIALS,
status_code=HTTP_401_UNAUTHORIZED)
class BadPut(Setup):
"""Bad PUT requests to change account attributes."""
def test_put_badtoken(self):
"""Putting (trying to change user attributes) while logged in, but
using a bad token."""
# Create a user.
create_and_login()
response = self.client.put(
USER_URL,
json.dumps({"first_name": "Dirk"}),
content_type="application/json",
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % BAD_TOKEN)
self.assertContains(response,
CONTENT_BAD_TOKEN,
status_code=HTTP_401_UNAUTHORIZED)
def test_no_username(self):
"""Try changing account attributes with a good token, but a bad
username."""
# Create a user and get the authorization token.
token = create_and_login()
response = self.client.put(
USER_URL,
json.dumps({"first_name": "Dirk"}),
content_type="application/json",
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
self.assertContains(response,
CONTENT_MISSING_USERNAME,
status_code=HTTP_400_BAD_REQUEST)
class GetPut(Setup):
"""The user gets her account's User data, and changes some attributes."""
def test_get(self): # pylint: disable=R0201
"""Get data from the default created account."""
# Create a user and get their authorization token.
token = create_and_login()
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
check_response_without_uuid(response,
HTTP_200_OK,
EXPECTED_CONTENT,
extra_keys=["last_login", "date_joined"])
def test_change_one_field(self):
"""Change one field in the account."""
expected_content = deepcopy(EXPECTED_CONTENT)
expected_content["first_name"] = "Dirk"
# Create a user and get their authorization token.
token = create_and_login()
# Change some attributes from the default. Note, the username is
# required by djoser UserView/PUT.
response = self.client.put(
USER_URL,
json.dumps({"username": TEST_USER_1[0],
"first_name": "Dirk"}),
content_type="application/json",
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# pylint: disable=E1101
self.assertEqual(response.status_code, HTTP_200_OK)
# Now get the account attributes and see if they've changed.
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
check_response_without_uuid(response,
HTTP_200_OK,
expected_content,
extra_keys=["last_login", "date_joined"])
def test_change_some_fields(self):
"""Get data from an account, after we've modified some fields."""
expected_content = deepcopy(EXPECTED_CONTENT)
expected_content["first_name"] = "Dirk"
expected_content["last_name"] = "Diggler"
# Create a user and get their authorization token.
token = create_and_login()
# Change some attributes from the default. Note, the username is
# required by djoser UserView/PUT.
response = self.client.put(
USER_URL,
json.dumps({"username": TEST_USER_1[0],
"first_name": "Dirk",
"last_name": "Diggler"}),
content_type="application/json",
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# pylint: disable=E1101
self.assertEqual(response.status_code, HTTP_200_OK)
# Now get the account attributes and see if they've changed.
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
check_response_without_uuid(response,
HTTP_200_OK,
expected_content,
extra_keys=["last_login", "date_joined"])
def test_change_all_fields(self):
"""Get data from an account, after we've modified all the
user-modifiable fields."""
expected_content = deepcopy(EXPECTED_CONTENT)
expected_content["username"] = "Heywood"
expected_content["first_name"] = "Dirk"
expected_content["last_name"] = "Diggler"
expected_content["email"] = "john@siberia.com"
# Create a user and get their authorization token.
token = create_and_login()
# Change some attributes from the default. Note, the username is
# required by djoser UserView/PUT.
response = self.client.put(
USER_URL,
json.dumps({"username": "Heywood",
"first_name": "Dirk",
"last_name": "Diggler",
"email": "john@siberia.com"}),
content_type="application/json",
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# pylint: disable=E1101
self.assertEqual(response.status_code, HTTP_200_OK)
# Now get the account attributes and see if they've changed.
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
check_response_without_uuid(response,
HTTP_200_OK,
expected_content,
extra_keys=["last_login", "date_joined"])
def test_get_restricted_fields(self):
"""Try getting fields that are restricted to tenant_admins."""
cloud_fields = {"tenant_name": "cloud name 0",
"username": "abracadabra",
"password": "boomlackalackalacka",
"auth_url": "http://10.11.12.13:5000/v3/"}
# Make a tenant, and one Cloud under it.
tenant = Tenant.objects.create(name='hellothere',
owner='John',
owner_contact='206.867.5309')
cloud_fields["tenant"] = tenant
Cloud.objects.create(**cloud_fields)
# Create a normal user.
token = create_and_login()
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# None of the Tenant or Cloud fields should be in the response.
check_response_without_uuid(response,
HTTP_200_OK,
EXPECTED_CONTENT,
extra_keys=["last_login", "date_joined"])
def test_post_restricted_fields(self):
"""Try changing fields that are restricted to tenant_admins."""
cloud_fields = {"tenant_name": "cloud name 0",
"username": "abracadabra",
"password": "boomlackalackalacka",
"auth_url": "http://10.11.12.13:5000/v3/"}
# Make a tenant, and one Cloud under it.
tenant = Tenant.objects.create(name='hellothere',
owner='John',
owner_contact='206.867.5309')
cloud_fields["tenant"] = tenant
Cloud.objects.create(**cloud_fields)
# Create a normal user.
token = create_and_login()
# Try to change some attributes. Note, the username is required by
# djoser UserView/PUT.
response = self.client.put(
USER_URL,
json.dumps({"username": TEST_USER_1[0],
"os_username": "B minus",
"os_password": "12344321",
"tenant_name": "$20k"}), # tenant_name won't change.
content_type="application/json",
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# pylint: disable=E1101
self.assertEqual(response.status_code, HTTP_200_OK)
# Now get the account attributes and see if they've changed.
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# None of the Tenant or Cloud fields should be in the response.
check_response_without_uuid(response,
HTTP_200_OK,
EXPECTED_CONTENT,
extra_keys=["last_login", "date_joined"])
class GetPutTenantAdmin(Setup):
"""The tenant_admin user gets and changes her Cloud credentials."""
def test_no_tenant(self):
"""Get or change Cloud data when there's no Goldstone tenant."""
expected_content = deepcopy(EXPECTED_CONTENT)
expected_content["tenant_admin"] = True
# Make a tenant
tenant = Tenant.objects.create(name='hellothere',
owner='John',
owner_contact='206.867.5309')
# Create a tenant_admin of the tenant. Then nullify the Tenant field.
token = create_and_login(tenant=tenant)
user = get_user_model().objects.all()[0]
user.tenant = None
user.save()
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
check_response_without_uuid(response,
HTTP_200_OK,
expected_content,
extra_keys=["last_login", "date_joined"])
def test_no_cloud(self):
"""Get or change Cloud data when there's no Cloud."""
expected_content = deepcopy(EXPECTED_CONTENT)
expected_content["tenant_admin"] = True
expected_content["tenant_name"] = "hellothere"
# Make a tenant. Don't make a Cloud under it.
tenant = Tenant.objects.create(name='hellothere',
owner='John',
owner_contact='206.867.5309')
# Create a tenant_admin of the tenant.
token = create_and_login(tenant=tenant)
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
check_response_without_uuid(response,
HTTP_200_OK,
expected_content,
extra_keys=["last_login", "date_joined"])
def test_get_data(self):
"""Get Cloud data."""
cloud_fields = {"tenant_name": "cloud name 0",
"username": "abracadabra",
"password": "boomlackalackalacka",
"auth_url": "http://10.11.12.13:5000/v3/"}
# Make a tenant, and one Cloud under it.
tenant = Tenant.objects.create(name='hellothere',
owner='John',
owner_contact='206.867.5309')
cloud_fields["tenant"] = tenant
Cloud.objects.create(**cloud_fields)
# Create a tenant_admin of the tenant.
token = create_and_login(tenant=tenant)
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# Concoct the results we expect, which includes the cloud credentials.
expected_content = deepcopy(EXPECTED_CONTENT)
expected_content["tenant_admin"] = True
expected_content["tenant_name"] = tenant.name
expected_content["os_name"] = cloud_fields["tenant_name"]
expected_content["os_username"] = cloud_fields["username"]
expected_content["os_password"] = cloud_fields["password"]
expected_content["os_auth_url"] = cloud_fields["auth_url"]
check_response_without_uuid(response,
HTTP_200_OK,
expected_content,
extra_keys=["last_login", "date_joined"])
def test_change_bogus_field(self):
"""Try changing fields that don't exist."""
cloud_fields = {"tenant_name": "cloud name 0",
"username": "abracadabra",
"password": "boomlackalackalacka",
"auth_url": "http://10.11.12.13:5000/v3/"}
# Make a tenant, and one Cloud under it.
tenant = Tenant.objects.create(name='hellothere',
owner='John',
owner_contact='206.867.5309')
cloud_fields["tenant"] = tenant
Cloud.objects.create(**cloud_fields)
# Create a tenant_admin of the tenant.
token = create_and_login(tenant=tenant)
# Try changing some bogus attributes. Note, the username is required by
# djoser UserView/PUT.
response = self.client.put(
USER_URL,
json.dumps({"username": TEST_USER_1[0],
"os_bloodtype": "B minus",
"tenant_taxes": "$20k"}),
content_type="application/json",
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# pylint: disable=E1101
self.assertEqual(response.status_code, HTTP_200_OK)
# Now get the account attributes and see if they've changed.
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# Concoct the results we expect, which includes the cloud credentials.
expected_content = deepcopy(EXPECTED_CONTENT)
expected_content["tenant_admin"] = True
expected_content["tenant_name"] = tenant.name
expected_content["os_name"] = cloud_fields["tenant_name"]
expected_content["os_username"] = cloud_fields["username"]
expected_content["os_password"] = cloud_fields["password"]
expected_content["os_auth_url"] = cloud_fields["auth_url"]
check_response_without_uuid(response,
HTTP_200_OK,
expected_content,
extra_keys=["last_login", "date_joined"])
def test_change_some_fields(self):
"""Get Cloud data and change some fields."""
cloud_fields = {"tenant_name": "cloud name 0",
"username": "abracadabra",
"password": "boomlackalackalacka",
"auth_url": "http://10.11.12.13:5000/v3/"}
# Make a tenant, and one Cloud under it.
tenant = Tenant.objects.create(name='hellothere',
owner='John',
owner_contact='206.867.5309')
cloud_fields["tenant"] = tenant
Cloud.objects.create(**cloud_fields)
# Create a tenant_admin of the tenant.
token = create_and_login(tenant=tenant)
# Change some attributes. Note, the username is required by djoser
# UserView/PUT.
response = self.client.put(
USER_URL,
json.dumps({"username": TEST_USER_1[0],
"os_username": "B minus",
"os_password": "12344321",
"tenant_name": "$20k"}), # tenant_name won't change.
content_type="application/json",
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# pylint: disable=E1101
self.assertEqual(response.status_code, HTTP_200_OK)
# Now get the account attributes and see if they've changed.
response = self.client.get(
USER_URL,
HTTP_AUTHORIZATION=AUTHORIZATION_PAYLOAD % token)
# Concoct the results we expect, which includes the cloud credentials.
expected_content = deepcopy(EXPECTED_CONTENT)
expected_content["tenant_admin"] = True
expected_content["tenant_name"] = tenant.name
expected_content["os_name"] = cloud_fields["tenant_name"]
expected_content["os_username"] = "B minus"
expected_content["os_password"] = "12344321"
expected_content["os_auth_url"] = cloud_fields["auth_url"]
check_response_without_uuid(response,
HTTP_200_OK,
expected_content,
extra_keys=["last_login", "date_joined"])
| 38.783203
| 79
| 0.570731
| 2,068
| 19,857
| 5.242747
| 0.117021
| 0.077476
| 0.038185
| 0.071666
| 0.815993
| 0.804187
| 0.792935
| 0.785648
| 0.771537
| 0.769415
| 0
| 0.022941
| 0.341441
| 19,857
| 511
| 80
| 38.8591
| 0.806148
| 0.198872
| 0
| 0.81759
| 0
| 0
| 0.124944
| 0
| 0
| 0
| 0
| 0
| 0.039088
| 1
| 0.055375
| false
| 0.032573
| 0.019544
| 0
| 0.087948
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
da3e3791eef44782ab6c54f48af3f239f418599e
| 128
|
py
|
Python
|
python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_1/_pkg1_0_1_1/_pkg1_0_1_1_1/_mod1_0_1_1_1_3.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_1/_pkg1_0_1_1/_pkg1_0_1_1_1/_mod1_0_1_1_1_3.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_1/_pkg1_0_1_1/_pkg1_0_1_1_1/_mod1_0_1_1_1_3.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
name1_0_1_1_1_3_0 = None
name1_0_1_1_1_3_1 = None
name1_0_1_1_1_3_2 = None
name1_0_1_1_1_3_3 = None
name1_0_1_1_1_3_4 = None
| 14.222222
| 24
| 0.820313
| 40
| 128
| 1.875
| 0.175
| 0.266667
| 0.466667
| 0.533333
| 0.88
| 0.88
| 0.746667
| 0
| 0
| 0
| 0
| 0.318182
| 0.140625
| 128
| 9
| 25
| 14.222222
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
e53e0c5ec3b28a39e4b9775d1822ca5101da9e0c
| 28,899
|
py
|
Python
|
mkt/feed/migrations/0001_initial.py
|
diox/zamboni
|
3d3bebdffe034a5cd97a66cedc32a598264c2e42
|
[
"BSD-3-Clause"
] | null | null | null |
mkt/feed/migrations/0001_initial.py
|
diox/zamboni
|
3d3bebdffe034a5cd97a66cedc32a598264c2e42
|
[
"BSD-3-Clause"
] | null | null | null |
mkt/feed/migrations/0001_initial.py
|
diox/zamboni
|
3d3bebdffe034a5cd97a66cedc32a598264c2e42
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mkt.site.fields
import mkt.constants.carriers
import mkt.ratings.validators
import mkt.feed.models
import mkt.constants.regions
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='FeedApp',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('image_hash', models.CharField(default=None, max_length=8, null=True, blank=True)),
('slug', models.CharField(unique=True, max_length=30)),
('color', models.CharField(max_length=20, null=True, blank=True)),
('type', models.CharField(max_length=30, choices=[(b'icon', b'icon'), (b'image', b'image'), (b'description', b'description'), (b'quote', b'quote'), (b'preview', b'preview')])),
('pullquote_attribution', models.CharField(max_length=50, null=True, blank=True)),
('pullquote_rating', models.PositiveSmallIntegerField(blank=True, null=True, validators=[mkt.ratings.validators.validate_rating])),
('background_color', mkt.site.fields.ColorField(max_length=7, null=True)),
],
options={
'db_table': 'mkt_feed_app',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='FeedBrand',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('slug', models.CharField(help_text=b'Used in collection URLs.', unique=True, max_length=30, blank=True)),
('layout', models.CharField(max_length=30, choices=[(b'grid', b'grid'), (b'list', b'list')])),
('type', models.CharField(max_length=30, choices=[(b'apps-for-albania', b'apps-for-albania'), (b'apps-for-argentina', b'apps-for-argentina'), (b'apps-for-bangladesh', b'apps-for-bangladesh'), (b'apps-for-brazil', b'apps-for-brazil'), (b'apps-for-bulgaria', b'apps-for-bulgaria'), (b'apps-for-chile', b'apps-for-chile'), (b'apps-for-china', b'apps-for-china'), (b'apps-for-colombia', b'apps-for-colombia'), (b'apps-for-costa-rica', b'apps-for-costa-rica'), (b'apps-for-croatia', b'apps-for-croatia'), (b'apps-for-czech-republic', b'apps-for-czech-republic'), (b'apps-for-ecuador', b'apps-for-ecuador'), (b'apps-for-el-salvador', b'apps-for-el-salvador'), (b'apps-for-france', b'apps-for-france'), (b'apps-for-germany', b'apps-for-germany'), (b'apps-for-greece', b'apps-for-greece'), (b'apps-for-hungary', b'apps-for-hungary'), (b'apps-for-india', b'apps-for-india'), (b'apps-for-italy', b'apps-for-italy'), (b'apps-for-japan', b'apps-for-japan'), (b'apps-for-macedonia', b'apps-for-macedonia'), (b'apps-for-mexico', b'apps-for-mexico'), (b'apps-for-montenegro', b'apps-for-montenegro'), (b'apps-for-nicaragua', b'apps-for-nicaragua'), (b'apps-for-panama', b'apps-for-panama'), (b'apps-for-peru', b'apps-for-peru'), (b'apps-for-poland', b'apps-for-poland'), (b'apps-for-russia', b'apps-for-russia'), (b'apps-for-serbia', b'apps-for-serbia'), (b'apps-for-south-africa', b'apps-for-south-africa'), (b'apps-for-spain', b'apps-for-spain'), (b'apps-for-uruguay', b'apps-for-uruguay'), (b'apps-for-venezuela', b'apps-for-venezuela'), (b'arts-entertainment', b'arts-entertainment'), (b'book', b'book'), (b'creativity', b'creativity'), (b'education', b'education'), (b'games', b'games'), (b'groundbreaking', b'groundbreaking'), (b'health-fitness', b'health-fitness'), (b'hidden-gem', b'hidden-gem'), (b'lifestyle', b'lifestyle'), (b'local-favorite', b'local-favorite'), (b'maps-navigation', b'maps-navigation'), (b'music', b'music'), (b'mystery-app', b'mystery-app'), (b'news-weather', b'news-weather'), (b'photo-video', b'photo-video'), (b'shopping', b'shopping'), (b'social', b'social'), (b'sports', b'sports'), (b'tools-time-savers', b'tools-time-savers'), (b'travel', b'travel'), (b'work-business', b'work-business')])),
],
options={
'ordering': ('-id',),
'abstract': False,
'db_table': 'mkt_feed_brand',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='FeedBrandMembership',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('order', models.SmallIntegerField(null=True)),
],
options={
'ordering': ('order',),
'abstract': False,
'db_table': 'mkt_feed_brand_membership',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='FeedCollection',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('slug', models.CharField(help_text=b'Used in collection URLs.', unique=True, max_length=30, blank=True)),
('image_hash', models.CharField(default=None, max_length=8, null=True, blank=True)),
('color', models.CharField(max_length=20, null=True, blank=True)),
('type', models.CharField(max_length=30, null=True, choices=[(b'promo', b'promo'), (b'listing', b'listing')])),
('background_color', models.CharField(max_length=7, null=True, blank=True)),
],
options={
'ordering': ('-id',),
'abstract': False,
'db_table': 'mkt_feed_collection',
},
bases=(mkt.feed.models.GroupedAppsMixin, models.Model),
),
migrations.CreateModel(
name='FeedCollectionMembership',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('order', models.SmallIntegerField(null=True)),
],
options={
'ordering': ('order',),
'abstract': False,
'db_table': 'mkt_feed_collection_membership',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='FeedItem',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('category', models.CharField(blank=True, max_length=30, null=True, choices=[(b'books-comics', 'Books & Comics'), (b'business', 'Business'), (b'education', 'Education'), (b'entertainment', 'Entertainment'), (b'food-drink', 'Food & Drink'), (b'kids', 'Kids'), (b'games', 'Games'), (b'health-fitness', 'Health & Fitness'), (b'humor', 'Humor'), (b'internet', 'Internet'), (b'lifestyle', 'Lifestyle'), (b'maps-navigation', 'Maps & Navigation'), (b'music', 'Music'), (b'news', 'News'), (b'personalization', 'Personalization'), (b'photo-video', 'Photo & Video'), (b'productivity', 'Productivity'), (b'reference', 'Reference'), (b'science-tech', 'Science & Tech'), (b'shopping', 'Shopping'), (b'social', 'Social'), (b'sports', 'Sports'), (b'travel', 'Travel'), (b'utilities', 'Utilities'), (b'weather', 'Weather')])),
('region', models.PositiveIntegerField(default=None, null=True, db_index=True, blank=True, choices=[(1, mkt.constants.regions.RESTOFWORLD), (63, mkt.constants.regions.AND), (241, mkt.constants.regions.ARE), (58, mkt.constants.regions.AFG), (67, mkt.constants.regions.ATG), (65, mkt.constants.regions.AIA), (60, mkt.constants.regions.ALB), (68, mkt.constants.regions.ARM), (64, mkt.constants.regions.AGO), (66, mkt.constants.regions.ATA), (20, mkt.constants.regions.ARG), (62, mkt.constants.regions.ASM), (71, mkt.constants.regions.AUT), (70, mkt.constants.regions.AUS), (69, mkt.constants.regions.ABW), (59, mkt.constants.regions.ALA), (72, mkt.constants.regions.AZE), (84, mkt.constants.regions.BIH), (75, mkt.constants.regions.BRB), (31, mkt.constants.regions.BGD), (77, mkt.constants.regions.BEL), (89, mkt.constants.regions.BFA), (88, mkt.constants.regions.BGR), (74, mkt.constants.regions.BHR), (90, mkt.constants.regions.BDI), (79, mkt.constants.regions.BEN), (253, mkt.constants.regions.BLM), (80, mkt.constants.regions.BMU), (87, mkt.constants.regions.BRN), (82, mkt.constants.regions.BOL), (252, mkt.constants.regions.BES), (7, mkt.constants.regions.BRA), (73, mkt.constants.regions.BHS), (81, mkt.constants.regions.BTN), (85, mkt.constants.regions.BVT), (45, mkt.constants.regions.BWA), (76, mkt.constants.regions.BLR), (78, mkt.constants.regions.BLZ), (92, mkt.constants.regions.CAN), (97, mkt.constants.regions.CCK), (100, mkt.constants.regions.COD), (54, mkt.constants.regions.CAF), (99, mkt.constants.regions.COG), (226, mkt.constants.regions.CHE), (40, mkt.constants.regions.CIV), (101, mkt.constants.regions.COK), (23, mkt.constants.regions.CHL), (42, mkt.constants.regions.CMR), (21, mkt.constants.regions.CHN), (9, mkt.constants.regions.COL), (27, mkt.constants.regions.CRI), (103, mkt.constants.regions.CUB), (93, mkt.constants.regions.CPV), (254, mkt.constants.regions.CUW), (96, mkt.constants.regions.CXR), (105, mkt.constants.regions.CYP), (34, mkt.constants.regions.CZE), (14, mkt.constants.regions.DEU), (107, mkt.constants.regions.DJI), (106, mkt.constants.regions.DNK), (108, mkt.constants.regions.DMA), (109, mkt.constants.regions.DOM), (61, mkt.constants.regions.DZA), (26, mkt.constants.regions.ECU), (112, mkt.constants.regions.EST), (43, mkt.constants.regions.EGY), (248, mkt.constants.regions.ESH), (111, mkt.constants.regions.ERI), (8, mkt.constants.regions.ESP), (113, mkt.constants.regions.ETH), (117, mkt.constants.regions.FIN), (116, mkt.constants.regions.FJI), (114, mkt.constants.regions.FLK), (168, mkt.constants.regions.FSM), (115, mkt.constants.regions.FRO), (30, mkt.constants.regions.FRA), (121, mkt.constants.regions.GAB), (127, mkt.constants.regions.GRD), (123, mkt.constants.regions.GEO), (118, mkt.constants.regions.GUF), (130, mkt.constants.regions.GGY), (124, mkt.constants.regions.GHA), (125, mkt.constants.regions.GIB), (126, mkt.constants.regions.GRL), (122, mkt.constants.regions.GMB), (55, mkt.constants.regions.GIN), (128, mkt.constants.regions.GLP), (110, mkt.constants.regions.GNQ), (17, mkt.constants.regions.GRC), (218, mkt.constants.regions.SGS), (25, mkt.constants.regions.GTM), (129, mkt.constants.regions.GUM), (46, mkt.constants.regions.GNB), (131, mkt.constants.regions.GUY), (136, mkt.constants.regions.HKG), (133, mkt.constants.regions.HMD), (135, mkt.constants.regions.HND), (102, mkt.constants.regions.HRV), (132, mkt.constants.regions.HTI), (13, mkt.constants.regions.HUN), (138, mkt.constants.regions.IDN), (140, mkt.constants.regions.IRL), (142, mkt.constants.regions.ISR), (141, mkt.constants.regions.IMN), (32, mkt.constants.regions.IND), (86, mkt.constants.regions.IOT), (139, mkt.constants.regions.IRQ), (137, mkt.constants.regions.ISL), (22, mkt.constants.regions.ITA), (144, mkt.constants.regions.JEY), (143, mkt.constants.regions.JAM), (51, mkt.constants.regions.JOR), (33, mkt.constants.regions.JPN), (56, mkt.constants.regions.KEN), (149, mkt.constants.regions.KGZ), (91, mkt.constants.regions.KHM), (146, mkt.constants.regions.KIR), (98, mkt.constants.regions.COM), (201, mkt.constants.regions.KNA), (147, mkt.constants.regions.KOR), (148, mkt.constants.regions.KWT), (94, mkt.constants.regions.CYM), (145, mkt.constants.regions.KAZ), (150, mkt.constants.regions.LAO), (152, mkt.constants.regions.LBN), (202, mkt.constants.regions.LCA), (156, mkt.constants.regions.LIE), (220, mkt.constants.regions.LKA), (154, mkt.constants.regions.LBR), (153, mkt.constants.regions.LSO), (38, mkt.constants.regions.LTU), (157, mkt.constants.regions.LUX), (151, mkt.constants.regions.LVA), (155, mkt.constants.regions.LBY), (173, mkt.constants.regions.MAR), (170, mkt.constants.regions.MCO), (169, mkt.constants.regions.MDA), (15, mkt.constants.regions.MNE), (255, mkt.constants.regions.MAF), (49, mkt.constants.regions.MDG), (164, mkt.constants.regions.MHL), (159, mkt.constants.regions.MKD), (48, mkt.constants.regions.MLI), (53, mkt.constants.regions.MMR), (171, mkt.constants.regions.MNG), (158, mkt.constants.regions.MAC), (184, mkt.constants.regions.MNP), (165, mkt.constants.regions.MTQ), (166, mkt.constants.regions.MRT), (172, mkt.constants.regions.MSR), (163, mkt.constants.regions.MLT), (50, mkt.constants.regions.MUS), (162, mkt.constants.regions.MDV), (160, mkt.constants.regions.MWI), (12, mkt.constants.regions.MEX), (161, mkt.constants.regions.MYS), (174, mkt.constants.regions.MOZ), (175, mkt.constants.regions.NAM), (179, mkt.constants.regions.NCL), (52, mkt.constants.regions.NER), (183, mkt.constants.regions.NFK), (181, mkt.constants.regions.NGA), (29, mkt.constants.regions.NIC), (178, mkt.constants.regions.NLD), (185, mkt.constants.regions.NOR), (177, mkt.constants.regions.NPL), (176, mkt.constants.regions.NRU), (182, mkt.constants.regions.NIU), (180, mkt.constants.regions.NZL), (186, mkt.constants.regions.OMN), (28, mkt.constants.regions.PAN), (18, mkt.constants.regions.PER), (119, mkt.constants.regions.PYF), (190, mkt.constants.regions.PNG), (35, mkt.constants.regions.PHL), (187, mkt.constants.regions.PAK), (11, mkt.constants.regions.POL), (204, mkt.constants.regions.SPM), (192, mkt.constants.regions.PCN), (194, mkt.constants.regions.PRI), (189, mkt.constants.regions.PSE), (193, mkt.constants.regions.PRT), (188, mkt.constants.regions.PLW), (191, mkt.constants.regions.PRY), (195, mkt.constants.regions.QAT), (196, mkt.constants.regions.REU), (197, mkt.constants.regions.ROU), (16, mkt.constants.regions.SRB), (36, mkt.constants.regions.RUS), (198, mkt.constants.regions.RWA), (209, mkt.constants.regions.SAU), (216, mkt.constants.regions.SLB), (210, mkt.constants.regions.SYC), (221, mkt.constants.regions.SDN), (225, mkt.constants.regions.SWE), (212, mkt.constants.regions.SGP), (200, mkt.constants.regions.SHN), (215, mkt.constants.regions.SVN), (223, mkt.constants.regions.SJM), (214, mkt.constants.regions.SVK), (211, mkt.constants.regions.SLE), (207, mkt.constants.regions.SMR), (41, mkt.constants.regions.SEN), (217, mkt.constants.regions.SOM), (222, mkt.constants.regions.SUR), (219, mkt.constants.regions.SSD), (208, mkt.constants.regions.STP), (24, mkt.constants.regions.SLV), (256, mkt.constants.regions.SXM), (227, mkt.constants.regions.SYR), (224, mkt.constants.regions.SWZ), (237, mkt.constants.regions.TCA), (95, mkt.constants.regions.TCD), (120, mkt.constants.regions.ATF), (231, mkt.constants.regions.TGO), (229, mkt.constants.regions.THA), (228, mkt.constants.regions.TJK), (232, mkt.constants.regions.TKL), (230, mkt.constants.regions.TLS), (236, mkt.constants.regions.TKM), (39, mkt.constants.regions.TUN), (233, mkt.constants.regions.TON), (235, mkt.constants.regions.TUR), (234, mkt.constants.regions.TTO), (238, mkt.constants.regions.TUV), (57, mkt.constants.regions.TWN), (44, mkt.constants.regions.TZA), (240, mkt.constants.regions.UKR), (239, mkt.constants.regions.UGA), (4, mkt.constants.regions.GBR), (257, mkt.constants.regions.UMI), (2, mkt.constants.regions.USA), (19, mkt.constants.regions.URY), (243, mkt.constants.regions.UZB), (134, mkt.constants.regions.VAT), (205, mkt.constants.regions.VCT), (10, mkt.constants.regions.VEN), (245, mkt.constants.regions.VGB), (246, mkt.constants.regions.VIR), (244, mkt.constants.regions.VNM), (47, mkt.constants.regions.VUT), (247, mkt.constants.regions.WLF), (206, mkt.constants.regions.WSM), (249, mkt.constants.regions.YEM), (167, mkt.constants.regions.MYT), (37, mkt.constants.regions.ZAF), (250, mkt.constants.regions.ZMB), (251, mkt.constants.regions.ZWE)])),
('carrier', models.IntegerField(default=None, null=True, db_index=True, blank=True, choices=[(15, mkt.constants.carriers.TELENOR), (7, mkt.constants.carriers.KDDI), (11, mkt.constants.carriers.SINGTEL), (13, mkt.constants.carriers.SPRINT), (14, mkt.constants.carriers.TELECOM_ITALIA_GROUP), (17, mkt.constants.carriers.VIMPELCOM), (9, mkt.constants.carriers.MEGAFON), (2, mkt.constants.carriers.AMERICA_MOVIL), (6, mkt.constants.carriers.HUTCHINSON_THREE_GROUP), (19, mkt.constants.carriers.CONGSTAR), (22, mkt.constants.carriers.ORANGE), (21, mkt.constants.carriers.MTN), (0, mkt.constants.carriers.UNKNOWN_CARRIER), (20, mkt.constants.carriers.O2), (12, mkt.constants.carriers.SMART), (5, mkt.constants.carriers.ETISALAT), (18, mkt.constants.carriers.GRAMEENPHONE), (8, mkt.constants.carriers.KT), (10, mkt.constants.carriers.QTEL), (3, mkt.constants.carriers.CHINA_UNICOM), (1, mkt.constants.carriers.TELEFONICA), (16, mkt.constants.carriers.TMN), (4, mkt.constants.carriers.DEUTSCHE_TELEKOM)])),
('order', models.SmallIntegerField(null=True)),
('item_type', models.CharField(max_length=30)),
],
options={
'ordering': ('order',),
'db_table': 'mkt_feed_item',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='FeedShelf',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('slug', models.CharField(help_text=b'Used in collection URLs.', unique=True, max_length=30, blank=True)),
('image_hash', models.CharField(default=None, max_length=8, null=True, blank=True)),
('carrier', models.IntegerField(choices=[(15, mkt.constants.carriers.TELENOR), (7, mkt.constants.carriers.KDDI), (11, mkt.constants.carriers.SINGTEL), (13, mkt.constants.carriers.SPRINT), (14, mkt.constants.carriers.TELECOM_ITALIA_GROUP), (17, mkt.constants.carriers.VIMPELCOM), (9, mkt.constants.carriers.MEGAFON), (2, mkt.constants.carriers.AMERICA_MOVIL), (6, mkt.constants.carriers.HUTCHINSON_THREE_GROUP), (19, mkt.constants.carriers.CONGSTAR), (22, mkt.constants.carriers.ORANGE), (21, mkt.constants.carriers.MTN), (0, mkt.constants.carriers.UNKNOWN_CARRIER), (20, mkt.constants.carriers.O2), (12, mkt.constants.carriers.SMART), (5, mkt.constants.carriers.ETISALAT), (18, mkt.constants.carriers.GRAMEENPHONE), (8, mkt.constants.carriers.KT), (10, mkt.constants.carriers.QTEL), (3, mkt.constants.carriers.CHINA_UNICOM), (1, mkt.constants.carriers.TELEFONICA), (16, mkt.constants.carriers.TMN), (4, mkt.constants.carriers.DEUTSCHE_TELEKOM)])),
('region', models.PositiveIntegerField(choices=[(1, mkt.constants.regions.RESTOFWORLD), (63, mkt.constants.regions.AND), (241, mkt.constants.regions.ARE), (58, mkt.constants.regions.AFG), (67, mkt.constants.regions.ATG), (65, mkt.constants.regions.AIA), (60, mkt.constants.regions.ALB), (68, mkt.constants.regions.ARM), (64, mkt.constants.regions.AGO), (66, mkt.constants.regions.ATA), (20, mkt.constants.regions.ARG), (62, mkt.constants.regions.ASM), (71, mkt.constants.regions.AUT), (70, mkt.constants.regions.AUS), (69, mkt.constants.regions.ABW), (59, mkt.constants.regions.ALA), (72, mkt.constants.regions.AZE), (84, mkt.constants.regions.BIH), (75, mkt.constants.regions.BRB), (31, mkt.constants.regions.BGD), (77, mkt.constants.regions.BEL), (89, mkt.constants.regions.BFA), (88, mkt.constants.regions.BGR), (74, mkt.constants.regions.BHR), (90, mkt.constants.regions.BDI), (79, mkt.constants.regions.BEN), (253, mkt.constants.regions.BLM), (80, mkt.constants.regions.BMU), (87, mkt.constants.regions.BRN), (82, mkt.constants.regions.BOL), (252, mkt.constants.regions.BES), (7, mkt.constants.regions.BRA), (73, mkt.constants.regions.BHS), (81, mkt.constants.regions.BTN), (85, mkt.constants.regions.BVT), (45, mkt.constants.regions.BWA), (76, mkt.constants.regions.BLR), (78, mkt.constants.regions.BLZ), (92, mkt.constants.regions.CAN), (97, mkt.constants.regions.CCK), (100, mkt.constants.regions.COD), (54, mkt.constants.regions.CAF), (99, mkt.constants.regions.COG), (226, mkt.constants.regions.CHE), (40, mkt.constants.regions.CIV), (101, mkt.constants.regions.COK), (23, mkt.constants.regions.CHL), (42, mkt.constants.regions.CMR), (21, mkt.constants.regions.CHN), (9, mkt.constants.regions.COL), (27, mkt.constants.regions.CRI), (103, mkt.constants.regions.CUB), (93, mkt.constants.regions.CPV), (254, mkt.constants.regions.CUW), (96, mkt.constants.regions.CXR), (105, mkt.constants.regions.CYP), (34, mkt.constants.regions.CZE), (14, mkt.constants.regions.DEU), (107, mkt.constants.regions.DJI), (106, mkt.constants.regions.DNK), (108, mkt.constants.regions.DMA), (109, mkt.constants.regions.DOM), (61, mkt.constants.regions.DZA), (26, mkt.constants.regions.ECU), (112, mkt.constants.regions.EST), (43, mkt.constants.regions.EGY), (248, mkt.constants.regions.ESH), (111, mkt.constants.regions.ERI), (8, mkt.constants.regions.ESP), (113, mkt.constants.regions.ETH), (117, mkt.constants.regions.FIN), (116, mkt.constants.regions.FJI), (114, mkt.constants.regions.FLK), (168, mkt.constants.regions.FSM), (115, mkt.constants.regions.FRO), (30, mkt.constants.regions.FRA), (121, mkt.constants.regions.GAB), (127, mkt.constants.regions.GRD), (123, mkt.constants.regions.GEO), (118, mkt.constants.regions.GUF), (130, mkt.constants.regions.GGY), (124, mkt.constants.regions.GHA), (125, mkt.constants.regions.GIB), (126, mkt.constants.regions.GRL), (122, mkt.constants.regions.GMB), (55, mkt.constants.regions.GIN), (128, mkt.constants.regions.GLP), (110, mkt.constants.regions.GNQ), (17, mkt.constants.regions.GRC), (218, mkt.constants.regions.SGS), (25, mkt.constants.regions.GTM), (129, mkt.constants.regions.GUM), (46, mkt.constants.regions.GNB), (131, mkt.constants.regions.GUY), (136, mkt.constants.regions.HKG), (133, mkt.constants.regions.HMD), (135, mkt.constants.regions.HND), (102, mkt.constants.regions.HRV), (132, mkt.constants.regions.HTI), (13, mkt.constants.regions.HUN), (138, mkt.constants.regions.IDN), (140, mkt.constants.regions.IRL), (142, mkt.constants.regions.ISR), (141, mkt.constants.regions.IMN), (32, mkt.constants.regions.IND), (86, mkt.constants.regions.IOT), (139, mkt.constants.regions.IRQ), (137, mkt.constants.regions.ISL), (22, mkt.constants.regions.ITA), (144, mkt.constants.regions.JEY), (143, mkt.constants.regions.JAM), (51, mkt.constants.regions.JOR), (33, mkt.constants.regions.JPN), (56, mkt.constants.regions.KEN), (149, mkt.constants.regions.KGZ), (91, mkt.constants.regions.KHM), (146, mkt.constants.regions.KIR), (98, mkt.constants.regions.COM), (201, mkt.constants.regions.KNA), (147, mkt.constants.regions.KOR), (148, mkt.constants.regions.KWT), (94, mkt.constants.regions.CYM), (145, mkt.constants.regions.KAZ), (150, mkt.constants.regions.LAO), (152, mkt.constants.regions.LBN), (202, mkt.constants.regions.LCA), (156, mkt.constants.regions.LIE), (220, mkt.constants.regions.LKA), (154, mkt.constants.regions.LBR), (153, mkt.constants.regions.LSO), (38, mkt.constants.regions.LTU), (157, mkt.constants.regions.LUX), (151, mkt.constants.regions.LVA), (155, mkt.constants.regions.LBY), (173, mkt.constants.regions.MAR), (170, mkt.constants.regions.MCO), (169, mkt.constants.regions.MDA), (15, mkt.constants.regions.MNE), (255, mkt.constants.regions.MAF), (49, mkt.constants.regions.MDG), (164, mkt.constants.regions.MHL), (159, mkt.constants.regions.MKD), (48, mkt.constants.regions.MLI), (53, mkt.constants.regions.MMR), (171, mkt.constants.regions.MNG), (158, mkt.constants.regions.MAC), (184, mkt.constants.regions.MNP), (165, mkt.constants.regions.MTQ), (166, mkt.constants.regions.MRT), (172, mkt.constants.regions.MSR), (163, mkt.constants.regions.MLT), (50, mkt.constants.regions.MUS), (162, mkt.constants.regions.MDV), (160, mkt.constants.regions.MWI), (12, mkt.constants.regions.MEX), (161, mkt.constants.regions.MYS), (174, mkt.constants.regions.MOZ), (175, mkt.constants.regions.NAM), (179, mkt.constants.regions.NCL), (52, mkt.constants.regions.NER), (183, mkt.constants.regions.NFK), (181, mkt.constants.regions.NGA), (29, mkt.constants.regions.NIC), (178, mkt.constants.regions.NLD), (185, mkt.constants.regions.NOR), (177, mkt.constants.regions.NPL), (176, mkt.constants.regions.NRU), (182, mkt.constants.regions.NIU), (180, mkt.constants.regions.NZL), (186, mkt.constants.regions.OMN), (28, mkt.constants.regions.PAN), (18, mkt.constants.regions.PER), (119, mkt.constants.regions.PYF), (190, mkt.constants.regions.PNG), (35, mkt.constants.regions.PHL), (187, mkt.constants.regions.PAK), (11, mkt.constants.regions.POL), (204, mkt.constants.regions.SPM), (192, mkt.constants.regions.PCN), (194, mkt.constants.regions.PRI), (189, mkt.constants.regions.PSE), (193, mkt.constants.regions.PRT), (188, mkt.constants.regions.PLW), (191, mkt.constants.regions.PRY), (195, mkt.constants.regions.QAT), (196, mkt.constants.regions.REU), (197, mkt.constants.regions.ROU), (16, mkt.constants.regions.SRB), (36, mkt.constants.regions.RUS), (198, mkt.constants.regions.RWA), (209, mkt.constants.regions.SAU), (216, mkt.constants.regions.SLB), (210, mkt.constants.regions.SYC), (221, mkt.constants.regions.SDN), (225, mkt.constants.regions.SWE), (212, mkt.constants.regions.SGP), (200, mkt.constants.regions.SHN), (215, mkt.constants.regions.SVN), (223, mkt.constants.regions.SJM), (214, mkt.constants.regions.SVK), (211, mkt.constants.regions.SLE), (207, mkt.constants.regions.SMR), (41, mkt.constants.regions.SEN), (217, mkt.constants.regions.SOM), (222, mkt.constants.regions.SUR), (219, mkt.constants.regions.SSD), (208, mkt.constants.regions.STP), (24, mkt.constants.regions.SLV), (256, mkt.constants.regions.SXM), (227, mkt.constants.regions.SYR), (224, mkt.constants.regions.SWZ), (237, mkt.constants.regions.TCA), (95, mkt.constants.regions.TCD), (120, mkt.constants.regions.ATF), (231, mkt.constants.regions.TGO), (229, mkt.constants.regions.THA), (228, mkt.constants.regions.TJK), (232, mkt.constants.regions.TKL), (230, mkt.constants.regions.TLS), (236, mkt.constants.regions.TKM), (39, mkt.constants.regions.TUN), (233, mkt.constants.regions.TON), (235, mkt.constants.regions.TUR), (234, mkt.constants.regions.TTO), (238, mkt.constants.regions.TUV), (57, mkt.constants.regions.TWN), (44, mkt.constants.regions.TZA), (240, mkt.constants.regions.UKR), (239, mkt.constants.regions.UGA), (4, mkt.constants.regions.GBR), (257, mkt.constants.regions.UMI), (2, mkt.constants.regions.USA), (19, mkt.constants.regions.URY), (243, mkt.constants.regions.UZB), (134, mkt.constants.regions.VAT), (205, mkt.constants.regions.VCT), (10, mkt.constants.regions.VEN), (245, mkt.constants.regions.VGB), (246, mkt.constants.regions.VIR), (244, mkt.constants.regions.VNM), (47, mkt.constants.regions.VUT), (247, mkt.constants.regions.WLF), (206, mkt.constants.regions.WSM), (249, mkt.constants.regions.YEM), (167, mkt.constants.regions.MYT), (37, mkt.constants.regions.ZAF), (250, mkt.constants.regions.ZMB), (251, mkt.constants.regions.ZWE)])),
('image_landing_hash', models.CharField(default=None, max_length=8, null=True, blank=True)),
],
options={
'ordering': ('-id',),
'abstract': False,
'db_table': 'mkt_feed_shelf',
},
bases=(mkt.feed.models.GroupedAppsMixin, models.Model),
),
migrations.CreateModel(
name='FeedShelfMembership',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('order', models.SmallIntegerField(null=True)),
],
options={
'ordering': ('order',),
'abstract': False,
'db_table': 'mkt_feed_shelf_membership',
},
bases=(models.Model,),
),
]
| 185.25
| 8,457
| 0.681165
| 3,913
| 28,899
| 4.997189
| 0.183235
| 0.333845
| 0.482919
| 0.021274
| 0.904521
| 0.896083
| 0.888258
| 0.836299
| 0.824639
| 0.822389
| 0
| 0.05481
| 0.120558
| 28,899
| 155
| 8,458
| 186.445161
| 0.714578
| 0.000727
| 0
| 0.651007
| 0
| 0
| 0.1032
| 0.007376
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.04698
| 0
| 0.067114
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
e578efe30367999a7c5b4dd9f17822641613a885
| 17,364
|
py
|
Python
|
qmc/wavefunction.py
|
BrettLeroux/GRIPS-MCMC
|
154457acfc47977e25870aed76c7dc49d70608af
|
[
"MIT"
] | null | null | null |
qmc/wavefunction.py
|
BrettLeroux/GRIPS-MCMC
|
154457acfc47977e25870aed76c7dc49d70608af
|
[
"MIT"
] | null | null | null |
qmc/wavefunction.py
|
BrettLeroux/GRIPS-MCMC
|
154457acfc47977e25870aed76c7dc49d70608af
|
[
"MIT"
] | 1
|
2020-07-08T07:39:23.000Z
|
2020-07-08T07:39:23.000Z
|
import torch
import numpy as np
from qmc.local_energy import auto_hamiltonian_generator_atoms
from qmc.tracehess import autograd_trace_hessian
from torch import nn, optim
from torch.distributions import Normal, Bernoulli
LOGPI = np.log(np.pi)
class TwoParticlesInOneDimBox(nn.Module):
def __init__(self, alpha):
super(TwoParticlesInOneDimBox, self).__init__()
self.alpha = nn.Parameter(alpha)
#def forward(self,x):
# two_dim_slater =(1-(x[...,0]*x[...,0])**self.alpha[...,0])*torch.sin(np.pi*self.alpha[...,1]*x[...,1])-(1-(x[...,1]*x[...,1])**self.alpha[...,0])*torch.sin(np.pi*self.alpha[...,1]*x[...,0])#(1-(x[...,0]*x[...,0])**self.alpha[...,1])
# abs_psi_squared = two_dim_slater**2
# return torch.log(abs_psi_squared)
#forward with cubic ansatz
def forward(self,x):
two_dim_slater = (torch.ones(1)-torch.abs(x[...,0])**self.alpha[...,0])*(torch.ones(1)-torch.abs(x[...,1])**self.alpha[...,1])
abs_psi_squared = two_dim_slater**2
abs_psi_squared[x[...,0].abs() >= 1] = 0
abs_psi_squared[x[...,1].abs() >= 1] = 0
return torch.log(abs_psi_squared)
# def forward(self, x):
# two_dim_slater=(torch.sin(np.pi*self.alpha[...,0]*x[...,0]**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,1]**2)-torch.sin(np.pi*self.alpha[...,0]*x[...,1]**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,0]**2))
# abs_psi_squared = torch.abs(two_dim_slater)**2
# return torch.log(abs_psi_squared)
#def slater_ansatz_2_particle_in_box(self,x):
# two_dim_slater_ansatz=(torch.sin(np.pi*self.alpha[...,0]*x[...,0]**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,1]**2)-torch.sin(np.pi*self.alpha[...,0]*x[...,1]**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,0]**2))
# return two_dim_slater_ansatz
#def non_slater_ansatz(self,x):
# no_slater=torch.sin(np.pi*self.alpha[...,0]*x[...,0])*torch.sin(np.pi*self.alpha[...,1]*x[...,1])
# return no_slater
#ansatz from forward
def slater_ansatz_2_particle_in_box(self,x):
# return (1-(x[...,0]*x[...,0])**self.alpha[...,0])*(1-(x[...,0]*x[...,0])**(self.alpha[...,1]))*x[...,0]-(1-(x[...,1]*x[...,1])**self.alpha[...,0])*(1-(x[...,0]*x[...,0])**(self.alpha[...,1]))*x[...,0]
#def slater_ansatz_2_particle_in_box(self,x):
# two_dim_slater =(1-(x[...,0]*x[...,0])**self.alpha[...,0])*torch.sin(np.pi*self.alpha[...,1]*x[...,1])-(1-(x[...,1]*x[...,1])**self.alpha[...,0])*torch.sin(np.pi*self.alpha[...,1]*x[...,0])
# return two_dim_slater
two_dim_slater = (1-torch.abs(x[...,0])**self.alpha[...,0])*(1-torch.abs(x[...,1])**self.alpha[...,1])
return two_dim_slater
# def local_energy(self,x):
#return ((torch.cos(np.pi*self.alpha[...,0]*x[...,0]**2)*2*np.pi*self.alpha[...,0]-((np.pi*self.alpha[...,0])**2)*torch.sin(np.pi*self.alpha[...,0]*x[...,0]**2))*torch.sin(np.pi*self.alpha[...,1]*x[...,1]**2)
#+(torch.cos(np.pi*self.alpha[...,1]*x[...,1]**2)*2*np.pi*self.alpha[...,1]-((np.pi*self.alpha[...,1])**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,1]**2))*torch.sin(np.pi*self.alpha[...,0]*x[...,0]**2)
#-(torch.cos(np.pi*self.alpha[...,0]*x[...,1]**2)*2*np.pi*self.alpha[...,0]-((np.pi*self.alpha[...,0])**2)*torch.sin(np.pi*self.alpha[...,0]*x[...,1]**2))*torch.sin(np.pi*self.alpha[...,1]*x[...,0]**2)
# -(torch.cos(np.pi*self.alpha[...,1]*x[...,0]**2)*2*np.pi*self.alpha[...,1]-((np.pi*self.alpha[...,1])**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,0]**2))*torch.sin(np.pi*self.alpha[...,0]*x[...,1]**2))/(torch.sin(np.pi*self.alpha[...,0]*x[...,0]**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,1]**2)-torch.sin(np.pi*self.alpha[...,0]*x[...,1]**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,0]**2))
def local_energy(self,x):
# return -0.5*autograd_trace_hessian(self.slater_ansatz_2_particle_in_box,x)/self.slater_ansatz_2_particle_in_box(x)
return -autograd_trace_hessian(self.slater_ansatz_2_particle_in_box,x,return_grad = False)/self.slater_ansatz_2_particle_in_box(x)
class OneParticlesInOneDimBox(nn.Module):
def __init__(self, alpha):
super(OneParticlesInOneDimBox, self).__init__()
self.alpha = nn.Parameter(alpha)
def forward(self,x):
one_dim_slater = (torch.ones(1)-(x*x)**self.alpha).squeeze(dim=-1)
abs_psi_squared = one_dim_slater**2
return torch.log(abs_psi_squared)
def slater_ansatz_1_particle_in_box(self,x):
one_dim_slater = (torch.ones(1)-(x*x)**self.alpha).squeeze(dim=-1)
return one_dim_slater
# def local_energy(self,x):
#return ((torch.cos(np.pi*self.alpha[...,0]*x[...,0]**2)*2*np.pi*self.alpha[...,0]-((np.pi*self.alpha[...,0])**2)*torch.sin(np.pi*self.alpha[...,0]*x[...,0]**2))*torch.sin(np.pi*self.alpha[...,1]*x[...,1]**2)
#+(torch.cos(np.pi*self.alpha[...,1]*x[...,1]**2)*2*np.pi*self.alpha[...,1]-((np.pi*self.alpha[...,1])**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,1]**2))*torch.sin(np.pi*self.alpha[...,0]*x[...,0]**2)
#-(torch.cos(np.pi*self.alpha[...,0]*x[...,1]**2)*2*np.pi*self.alpha[...,0]-((np.pi*self.alpha[...,0])**2)*torch.sin(np.pi*self.alpha[...,0]*x[...,1]**2))*torch.sin(np.pi*self.alpha[...,1]*x[...,0]**2)
# -(torch.cos(np.pi*self.alpha[...,1]*x[...,0]**2)*2*np.pi*self.alpha[...,1]-((np.pi*self.alpha[...,1])**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,0]**2))*torch.sin(np.pi*self.alpha[...,0]*x[...,1]**2))/(torch.sin(np.pi*self.alpha[...,0]*x[...,0]**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,1]**2)-torch.sin(np.pi*self.alpha[...,0]*x[...,1]**2)*torch.sin(np.pi*self.alpha[...,1]*x[...,0]**2))
#def local_energy(self,x):
# return self.alpha*(self.alpha-1)*(torch.abs(x)**(self.alpha-2)).squeeze(dim=-1)/((1-torch.abs(x)**self.alpha).squeeze(dim=-1))
#def local_energy(self,x):
#return -0.5*autograd_trace_hessian(self.slater_ansatz_1_particle_in_box,x)/self.slater_ansatz_1_particle_in_box(x)
def local_energy(self,x):
return (self.alpha*(2*self.alpha-1)*(x*x)**(self.alpha-1))/(1-(x*x)**self.alpha)
class ParticleBoxFunction(nn.Module):
def __init__(self, alpha):
super(ParticleBoxFunction, self).__init__()
self.alpha = nn.Parameter(alpha)
def forward(self, x):
#
prod_sin_alpha_pi_x = torch.sin(np.pi*self.alpha*x).prod(dim=-1)
abs_psi_squared = (np.sqrt(8.0)*prod_sin_alpha_pi_x)**2.0
return torch.log(abs_psi_squared)
def local_energy(self, x):
return ((self.alpha*np.pi)**2.0).sum(dim=-1)
class HarmonicTrialFunction(nn.Module):
def __init__(self, alpha):
super(HarmonicTrialFunction, self).__init__()
self.alpha = nn.Parameter(alpha)
def forward(self, x):
# outputs logprob
# 2.0 * because it's |\Psi|^2
# squeeze last dim bc it's 1D and output here is a scalar logprob per point
return 2.0 * (0.5 * torch.log(self.alpha) - 0.25 * LOGPI - 0.5 * x * x * self.alpha * self.alpha).squeeze(dim=-1)
def harmoni_ansatz_sup(self, x):
# output dimensions should be either num_walkers x num_samples or just num_samples
return torch.sqrt(self.alpha)*torch.exp(-0.5*self.alpha*x**2).squeeze(dim=-1)
def local_energy(self, x):
return ((x**2).squeeze(dim=-1)-(autograd_trace_hessian(self.harmoni_ansatz_sup,x)/(self.harmoni_ansatz_sup(x))))
# def local_energy(self, x):
# squeeze last dim bc it's 1D and output here is a scalar energy per point
# return (self.alpha * self.alpha + (x * x) * (1.0 - self.alpha ** 4.0)).squeeze(dim=-1)
def harmonic_true_mean_energy(alpha):
return ((alpha**2)/2) + (1.0/(2*(alpha**2)))
def harmonic_true_variance(alpha):
return ((alpha**4 - 1)**2)/(2*alpha**4)
class HydrogenTrialWavefunction(nn.Module):
def __init__(self, alpha):
super(HydrogenTrialWavefunction, self).__init__()
self.alpha = nn.Parameter(alpha)
def forward(self, x):
#outputs logprob
#2.0 * because it's |\Psi|^2
# return 2.0 * (torch.log(self.alpha) + torch.log(x) - self.alpha * x).squeeze(dim=-1)
# relu(x) here makes negatives 0, so that the whole thing is -inf when x negative
return 2.0 * (torch.log(self.alpha) + torch.log(torch.nn.functional.relu(x)) - self.alpha * x).squeeze(dim=-1)
def hydro_ansatz_sup(self, x):
x = x.squeeze(dim=-1)
return self.alpha*x*torch.exp(-self.alpha*x)
def local_energy(self, x):
return (-(1.0/x.squeeze(dim=-1))-(0.5*autograd_trace_hessian(self.hydro_ansatz_sup,x)/(self.hydro_ansatz_sup(x))))
#def local_energy(self, x):
# return (-(1.0 / x) - (self.alpha / 2) * (self.alpha - (2.0 / x))).squeeze(dim=-1)
class HeliumTrialWavefunction(nn.Module):
def __init__(self, alpha):
super(HeliumTrialWavefunction, self).__init__()
self.alpha = nn.Parameter(alpha.clone())
def forward(self, x):
# outputs logprob
# 2.0 * because it's |\Psi|^2
negative_parts = -(1/torch.nn.functional.relu(x)).sum(dim=-1)
return 2.0*(negative_parts - self.alpha*(x[...,0]+x[...,1])-1/(x[...,0])-1/(x[...,1]))#+2*torch.log(self.alpha) + 2*torch.log(x[...,0]+x[...,1])
#def helium_ansatz_sup_simple(self,x):
# x = x.squeeze(dim=-1)
# return torch.exp(-self.alpha*(x[...,0]+x[...,1]))
#def helium_ansatz_sup(self, x):
# return (((2-self.alpha)**3)/np.pi)*torch.exp(-(2-self.alpha)*(x[:, 0]+x[:, 1]))
#def helium_ansatz_sup1(self, x):
# return (((2-self.alpha)**3)/np.pi)*torch.exp(-(2-self.alpha)*(x[:, 0]))
#def helium_ansatz_sup2(self, x):
# return (((2-self.alpha)**3)/np.pi)*torch.exp(-(2-self.alpha)*(x[:, 1]))
#def local_energy(self, x):
# return autograd_trace_hessian(self.helium_ansatz_sup1,x)*self.helium_ansatz_sup2(x)+autograd_trace_hessian(self.helium_ansatz_sup2,x)*self.helium_ansatz_sup1(x)+2*(1/x[:,0]+1/x[:,1])+1/(torch.sqrt(x[:,0]**2+x[:,1]**2+torch.abs(x[:,1])*torch.abs(x[:,0])*torch.cos(x[:,2])))
def wave(self, x):
return torch.exp(self.forward(x) / 2.0)
def existing_local_energy(self, x):
return -(self.alpha) ** 2 + (self.alpha / (x[..., 0]) + self.alpha / (x[..., 1]) - 2 * (
1 / (x[..., 0]) + 1 / (x[..., 1])) + 1 / (torch.sqrt(
x[..., 0] ** 2 + x[..., 1] ** 2 + torch.abs(x[..., 1]) * torch.abs(x[..., 0]) * torch.cos(x[..., 2]))))
def local_energy(self, x):
return auto_hamiltonian_generator_atoms(self, 2, x) / self.wave(x)
# def local_energy(self, x):
# return -(self.alpha)**2+(self.alpha/(x[...,0])+self.alpha/(x[...,1])-2*(1/(x[...,0])+1/(x[...,1]))+1/(torch.sqrt(x[...,0]**2+x[...,1]**2+torch.abs(x[...,1])*torch.abs(x[...,0])*torch.cos(x[...,2]))))
class ThreeElectronBasicAnsatzNoVandermonde(nn.Module):
def __init__(self, alpha):
super (ThreeElectronBasicAnsatzNoVandermonde, self).__init__()
self.alpha = nn.Parameter(alpha.clone().detach())
#def forward(self, x):
# outputs logprob
# 2.0 * because it's |\Psi|^2
#return Automatize log of mod squred calculatio
def three_elec_ansatz_sup_simple(self,x):
x = x.squeeze(dim=-1)
class NelectronVander(nn.Module):
#ansatz given by the Vandermonde determinant of the one electron wavefunctions e^(-alpha*r_i)
#input is 1-element tensor alpha and 1D tensor dim which determines the number of particles (i.e. the dimension)
def __init__(self, alpha, dim):
super(NelectronVander, self).__init__()
self.alpha = nn.Parameter(alpha)
self.dim = dim
def forward(self, x):
#returns the log prob. of the wavefunction
#input is tensor of size m x alpha.size or m x n x alpha.size
a = torch.exp(-self.alpha*x.unsqueeze(-1)) - torch.exp(-self.alpha*x.unsqueeze(-2))
return 2 * torch.sum(torch.log(torch.abs(a[...,torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[0],torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[1] ])),-1)
def wave(self,x):
# Returns the value of the wavefunction
#input is tensor of size m x alpha.size or m x n x alpha.size
a = torch.exp(-self.alpha*x.unsqueeze(-1)) - torch.exp(-self.alpha*x.unsqueeze(-2))
return torch.prod(a[...,torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[0],torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[1] ],-1)
class NelectronVanderCusp(nn.Module):
#ansatz given by the Vandermonde determinant of the one electron wavefunctions e^(-alpha*r_i) multiplied by product of e^(-1/r_i) for all i
#input is 1-element tensor alpha and 1D tensor dim which determines the number of particles (i.e. the dimension)
def __init__(self, alpha, dim):
super(NelectronVanderCusp, self).__init__()
self.alpha = nn.Parameter(alpha)
self.dim = dim
def forward(self, x):
#returns the log prob. of the wavefunction
#input is tensor of size m x alpha.size or m x n x alpha.size
a = torch.exp(-self.alpha*x.unsqueeze(-1)) - torch.exp(-self.alpha*x.unsqueeze(-2))
return 2 * (-torch.sum(1/x, -1) + torch.sum(torch.log(torch.abs(a[...,torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[0],torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[1] ])),-1))
def wave(self,x):
# Returns the value of the wavefunction
#input is tensor of size m x alpha.size or m x n x alpha.size
a = torch.exp(-self.alpha*x.unsqueeze(-1)) - torch.exp(-self.alpha*x.unsqueeze(-2))
return torch.exp(-torch.sum(1/x, -1)) * torch.prod(a[...,torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[0],torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[1] ],-1)
class NelectronVanderWithMult(nn.Module):
#ansatz given by the Vandermonde determinant of the one electron wavefunctions e^(-alpha * r_i)
#multiplied by e^(-beta * (r_1 + r_2 + ... r_N))
#input is 1-element tensors alpha, beta and 1D tensor dim which determines the number of particles (i.e. the dimension)
def __init__(self, alpha, beta, dim):
super(NelectronVanderWithMult, self).__init__()
self.alpha = nn.Parameter(alpha)
self.beta = nn.Parameter(beta)
self.dim = dim
def forward(self, x):
#returns the log prob. of the wavefunction
#input is tensor of size m x alpha.size or m x n x alpha.size
a = torch.exp(-self.alpha*x.unsqueeze(-1)) - torch.exp(-self.alpha*x.unsqueeze(-2))
return 2 * ( -self.beta * torch.sum(x, -1)
+ torch.sum(torch.log(torch.abs(a[...,torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[0],torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[1] ])),-1) )
def wave(self, x):
# Returns the value of the wavefunction
#input is tensor of size m x alpha.size or m x n x alpha.size
a = torch.exp(-self.alpha*x.unsqueeze(-1)) - torch.exp(-self.alpha*x.unsqueeze(-2))
return torch.exp(-self.beta * torch.sum(x, -1)) * torch.prod(a[...,torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[0],torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[1] ],-1)
class NelectronVanderCuspWithMult(nn.Module):
#ansatz given by the Vandermonde determinant of the one electron wavefunctions e^(-alpha * r_i)
#multiplied by e^(-beta * (r_1 + r_2 + ... r_N)) and multiplied by product of e^(-1/r_i) for all i
#input is 1-element tensors alpha, beta and 1D tensor dim which determines the number of particles (i.e. the dimension)
def __init__(self, alpha, beta, dim):
super(NelectronVanderCuspWithMult, self).__init__()
self.alpha = nn.Parameter(alpha)
self.beta = nn.Parameter(beta)
self.dim = dim
def forward(self, x):
#returns the log prob. of the wavefunction
#input is tensor of size m x alpha.size or m x n x alpha.size
a = torch.exp(-self.alpha*x.unsqueeze(-1)) - torch.exp(-self.alpha*x.unsqueeze(-2))
return 2 * ( -self.beta * torch.sum(x, -1) - torch.sum(1/x, -1)
+ torch.sum(torch.log(torch.abs(a[...,torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[0],torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[1] ])),-1) )
def wave(self,x):
# Returns the value of the wavefunction
#input is tensor of size m x alpha.size or m x n x alpha.size
a = torch.exp(-self.alpha*x.unsqueeze(-1)) - torch.exp(-self.alpha*x.unsqueeze(-2))
return torch.exp(-torch.sum(1/x, -1)) * torch.exp(-self.beta * torch.sum(x, -1)) * torch.prod(a[...,torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[0],torch.triu(torch.ones(self.dim,self.dim), diagonal=1).nonzero(as_tuple = True)[1] ],-1)
| 53.925466
| 408
| 0.604584
| 2,841
| 17,364
| 3.582893
| 0.061598
| 0.137931
| 0.049514
| 0.08046
| 0.833972
| 0.797917
| 0.775715
| 0.746733
| 0.700363
| 0.677375
| 0
| 0.034358
| 0.170295
| 17,364
| 321
| 409
| 54.093458
| 0.672173
| 0.445865
| 0
| 0.460432
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.28777
| false
| 0
| 0.043165
| 0.093525
| 0.611511
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 8
|
e5a708250d14babf3d216e752c898b66a4581c81
| 606
|
py
|
Python
|
assets/InterruptDriver.py
|
taartspi/Pi4J_V2-TemperatureSensor
|
c218ca6a3941375ab226bc4045bdc51a91a77bd0
|
[
"Apache-2.0"
] | null | null | null |
assets/InterruptDriver.py
|
taartspi/Pi4J_V2-TemperatureSensor
|
c218ca6a3941375ab226bc4045bdc51a91a77bd0
|
[
"Apache-2.0"
] | null | null | null |
assets/InterruptDriver.py
|
taartspi/Pi4J_V2-TemperatureSensor
|
c218ca6a3941375ab226bc4045bdc51a91a77bd0
|
[
"Apache-2.0"
] | 1
|
2022-01-07T16:38:57.000Z
|
2022-01-07T16:38:57.000Z
|
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(16, GPIO.OUT)
GPIO.output(16,GPIO.LOW)
time. sleep(5)
GPIO.output( 16 , GPIO.HIGH)
time. sleep(5)
GPIO.output(16,GPIO.LOW)
time. sleep(5)
GPIO.output( 16 , GPIO.HIGH)
GPIO.setup(12, GPIO.OUT)
GPIO.output(12,GPIO.LOW)
time. sleep(5)
GPIO.output( 12 , GPIO.HIGH)
time. sleep(5)
GPIO.output(12,GPIO.LOW)
time. sleep(5)
GPIO.output( 12 , GPIO.HIGH)
GPIO.setup(18, GPIO.OUT)
GPIO.output(18,GPIO.LOW)
time. sleep(5)
GPIO.output( 18 , GPIO.HIGH)
time. sleep(5)
GPIO.output(18,GPIO.LOW)
time. sleep(5)
GPIO.output( 18 , GPIO.HIGH)
| 16.378378
| 28
| 0.70132
| 113
| 606
| 3.761062
| 0.150442
| 0.282353
| 0.211765
| 0.296471
| 0.762353
| 0.762353
| 0.762353
| 0.691765
| 0.691765
| 0.691765
| 0
| 0.073308
| 0.122112
| 606
| 36
| 29
| 16.833333
| 0.725564
| 0
| 0
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.074074
| 0
| 0.074074
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
e5a9d02791274a21d7a7f250a7b2888efc8b9b4d
| 10,410
|
py
|
Python
|
u24_lymphocyte/third_party/treeano/sandbox/nodes/bachelor_normalization.py
|
ALSM-PhD/quip_classification
|
7347bfaa5cf11ae2d7a528fbcc43322a12c795d3
|
[
"BSD-3-Clause"
] | 45
|
2015-04-26T04:45:51.000Z
|
2022-01-24T15:03:55.000Z
|
u24_lymphocyte/third_party/treeano/sandbox/nodes/bachelor_normalization.py
|
ALSM-PhD/quip_classification
|
7347bfaa5cf11ae2d7a528fbcc43322a12c795d3
|
[
"BSD-3-Clause"
] | 8
|
2018-07-20T20:54:51.000Z
|
2020-06-12T05:36:04.000Z
|
u24_lymphocyte/third_party/treeano/sandbox/nodes/bachelor_normalization.py
|
ALSM-PhD/quip_classification
|
7347bfaa5cf11ae2d7a528fbcc43322a12c795d3
|
[
"BSD-3-Clause"
] | 22
|
2018-05-21T23:57:20.000Z
|
2022-02-21T00:48:32.000Z
|
import theano
import theano.tensor as T
import treeano
from treeano.sandbox.nodes import bttf_mean
fX = theano.config.floatX
@treeano.register_node("bachelor_normalization")
class BachelorNormalizationNode(treeano.NodeImpl):
hyperparameter_names = ("bttf_alpha",
"alpha",
"epsilon",
"normalization_axes",
"update_averages",
"deterministic")
def compute_output(self, network, in_vw):
alpha = network.find_hyperparameter(["bttf_alpha", "alpha"], 0.95)
epsilon = network.find_hyperparameter(["epsilon"], 1e-4)
normalization_axes = network.find_hyperparameter(["normalization_axes"],
(1,))
# HACK: using "deterministic" to mean test time
deterministic = network.find_hyperparameter(["deterministic"], False)
update_averages = network.find_hyperparameter(["update_averages"],
not deterministic)
alpha = treeano.utils.as_fX(alpha)
if update_averages:
backprop_to_the_future_mean = bttf_mean.backprop_to_the_future_mean_with_updates
else:
backprop_to_the_future_mean = bttf_mean.backprop_to_the_future_mean_no_updates
state_shape = tuple([in_vw.shape[axis] for axis in normalization_axes])
state_pattern = ["x"] * in_vw.ndim
for idx, axis in enumerate(normalization_axes):
state_pattern[axis] = idx
def make_state(name, tags, default_inits=None):
if default_inits is None:
default_inits = []
return network.create_vw(
name=name,
is_shared=True,
shape=state_shape,
tags=tags,
default_inits=default_inits,
).variable
gamma = make_state("gamma", {"parameter", "weight"})
beta = make_state("beta", {"parameter", "bias"})
# mean of input
mean = make_state("mean", {"state"})
# gradient of mean of input
mean_grad = make_state("mean_grad", {"state"})
# mean of input^2
squared_mean = make_state("squared_mean", {"state"},
# initializing to 1, so that std = 1
default_inits=[treeano.inits.ConstantInit(1.)])
# gradient of mean of input^2
squared_mean_grad = make_state("squared_mean_grad", {"state"})
in_var = in_vw.variable
mean_axes = tuple([axis for axis in range(in_var.ndim)
if axis not in normalization_axes])
batch_mean = in_var.mean(axis=mean_axes)
squared_batch_mean = T.sqr(in_var).mean(axis=mean_axes)
# expectation of input (x)
E_x = backprop_to_the_future_mean(batch_mean,
mean,
mean_grad,
alpha)
# TODO try mixing batch mean with E_x
# expectation of input squared
E_x_squared = backprop_to_the_future_mean(squared_batch_mean,
squared_mean,
squared_mean_grad,
alpha)
# HACK mixing batch and rolling means
# E_x = 0.5 * E_x + 0.5 * batch_mean
# E_x_squared = 0.5 * E_x_squared + 0.5 * squared_batch_mean
if 1:
mu = E_x
sigma = T.sqrt(E_x_squared - T.sqr(E_x) + epsilon)
mu = mu.dimshuffle(state_pattern)
sigma = sigma.dimshuffle(state_pattern)
gamma = gamma.dimshuffle(state_pattern)
beta = beta.dimshuffle(state_pattern)
else:
# HACK mixing current value
E_x = E_x.dimshuffle(state_pattern)
E_x_squared = E_x_squared.dimshuffle(state_pattern)
gamma = gamma.dimshuffle(state_pattern)
beta = beta.dimshuffle(state_pattern)
E_x = 0.1 * in_var + 0.9 * E_x
E_x_squared = 0.1 * T.sqr(in_var) + 0.9 * E_x_squared
mu = E_x
sigma = T.sqrt(E_x_squared - T.sqr(E_x) + epsilon)
if 0:
# HACK don't backprop through sigma
sigma = T.consider_constant(sigma)
if 1:
# HACK using batch mean
mu = batch_mean
mu = mu.dimshuffle(state_pattern)
if 0:
# HACK using batch variance
sigma = T.sqrt(in_var.var(axis=mean_axes) + epsilon)
sigma = sigma.dimshuffle(state_pattern)
out_var = (in_var - mu) * (T.exp(gamma) / sigma) + beta
network.create_vw(
name="default",
variable=out_var,
shape=in_vw.shape,
tags={"output"},
)
if 1:
# HACK monitoring state
network.create_vw(
name="mu_mean",
variable=mu.mean(),
shape=(),
tags={"monitor"},
)
network.create_vw(
name="sigma_mean",
variable=sigma.mean(),
shape=(),
tags={"monitor"},
)
network.create_vw(
name="gamma_mean",
variable=gamma.mean(),
shape=(),
tags={"monitor"},
)
network.create_vw(
name="beta_mean",
variable=beta.mean(),
shape=(),
tags={"monitor"},
)
@treeano.register_node("bachelor_normalization2")
class BachelorNormalization2Node(treeano.NodeImpl):
hyperparameter_names = ("bttf_alpha",
"alpha",
"epsilon",
"normalization_axes",
"update_averages",
"deterministic")
def compute_output(self, network, in_vw):
alpha = network.find_hyperparameter(["bttf_alpha", "alpha"], 0.95)
epsilon = network.find_hyperparameter(["epsilon"], 1e-4)
normalization_axes = network.find_hyperparameter(["normalization_axes"],
(1,))
# HACK: using "deterministic" to mean test time
deterministic = network.find_hyperparameter(["deterministic"], False)
update_averages = network.find_hyperparameter(["update_averages"],
not deterministic)
alpha = treeano.utils.as_fX(alpha)
if update_averages:
backprop_to_the_future_mean = bttf_mean.backprop_to_the_future_mean_with_updates
else:
backprop_to_the_future_mean = bttf_mean.backprop_to_the_future_mean_no_updates
state_shape = tuple([in_vw.shape[axis] for axis in normalization_axes])
state_pattern = ["x"] * in_vw.ndim
for idx, axis in enumerate(normalization_axes):
state_pattern[axis] = idx
def make_state(name, tags, default_inits=None):
if default_inits is None:
default_inits = []
return network.create_vw(
name=name,
is_shared=True,
shape=state_shape,
tags=tags,
default_inits=default_inits,
).variable
gamma = make_state("gamma", {"parameter", "weight"})
beta = make_state("beta", {"parameter", "bias"})
# mean of input
mean = make_state("mean", {"state"})
# gradient of mean of input
mean_grad = make_state("mean_grad", {"state"})
var_state_mean = make_state("var_state_mean", {"state"},
# initializing to 1, so that std = 1
default_inits=[treeano.inits.ConstantInit(1.)])
var_state_mean_grad = make_state("var_state_mean_grad", {"state"})
in_var = in_vw.variable
mean_axes = tuple([axis for axis in range(in_var.ndim)
if axis not in normalization_axes])
batch_mean = in_var.mean(axis=mean_axes)
# expectation of input (x)
E_x = backprop_to_the_future_mean(batch_mean,
mean,
mean_grad,
alpha)
# TODO try mixing batch mean with E_x
if 1:
batch_var_state = 1. / T.sqrt(in_var.var(axis=mean_axes) + epsilon)
var_state = backprop_to_the_future_mean(batch_var_state,
var_state_mean,
var_state_mean_grad,
alpha)
inv_std = var_state
# HACK mixing batch and rolling means
# E_x = 0.5 * E_x + 0.5 * batch_mean
# E_x_squared = 0.5 * E_x_squared + 0.5 * squared_batch_mean
mu = E_x
mu = mu.dimshuffle(state_pattern)
inv_std = inv_std.dimshuffle(state_pattern)
gamma = gamma.dimshuffle(state_pattern)
beta = beta.dimshuffle(state_pattern)
out_var = (in_var - mu) * (T.exp(gamma) * inv_std) + beta
network.create_vw(
name="default",
variable=out_var,
shape=in_vw.shape,
tags={"output"},
)
if 1:
# HACK monitoring state
network.create_vw(
name="mu_mean",
variable=mu.mean(),
shape=(),
tags={"monitor"},
)
network.create_vw(
name="var_state_effective_mean",
variable=var_state.mean(),
shape=(),
tags={"monitor"},
)
network.create_vw(
name="gamma_mean",
variable=gamma.mean(),
shape=(),
tags={"monitor"},
)
network.create_vw(
name="beta_mean",
variable=beta.mean(),
shape=(),
tags={"monitor"},
)
| 36.271777
| 92
| 0.511239
| 1,077
| 10,410
| 4.656453
| 0.119777
| 0.011167
| 0.061416
| 0.045464
| 0.84666
| 0.808574
| 0.790229
| 0.790229
| 0.790229
| 0.777468
| 0
| 0.008626
| 0.398655
| 10,410
| 286
| 93
| 36.398601
| 0.792492
| 0.08146
| 0
| 0.780952
| 0
| 0
| 0.072268
| 0.007237
| 0
| 0
| 0
| 0.003497
| 0
| 1
| 0.019048
| false
| 0
| 0.019048
| 0
| 0.066667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
e5f441c085a28dcee62a4278401a14b9d022e6e7
| 187
|
py
|
Python
|
lecciones/16/bucles_1.py
|
ImAlexisSaez/curso-python-desde-0
|
c4a84dae0804adefe4ee6024b411d8ed288da759
|
[
"MIT"
] | 2
|
2020-08-31T02:17:36.000Z
|
2022-01-29T15:25:27.000Z
|
lecciones/16/bucles_1.py
|
ImAlexisSaez/curso-python-desde-0
|
c4a84dae0804adefe4ee6024b411d8ed288da759
|
[
"MIT"
] | null | null | null |
lecciones/16/bucles_1.py
|
ImAlexisSaez/curso-python-desde-0
|
c4a84dae0804adefe4ee6024b411d8ed288da759
|
[
"MIT"
] | null | null | null |
for i in range(5):
print(f"valor de la variable {i}")
for i in range(5, 10):
print(f"valor de la variable {i}")
for i in range(5, 50, 5):
print(f"valor de la variable {i}")
| 20.777778
| 38
| 0.604278
| 39
| 187
| 2.897436
| 0.333333
| 0.106195
| 0.159292
| 0.292035
| 0.964602
| 0.867257
| 0.867257
| 0.867257
| 0.637168
| 0.637168
| 0
| 0.055944
| 0.235294
| 187
| 8
| 39
| 23.375
| 0.734266
| 0
| 0
| 0.5
| 0
| 0
| 0.385027
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 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
| 8
|
f90b2b24628e9889e85eba77120a46ed4227f280
| 1,892
|
py
|
Python
|
rahulCode_redo/project1Part3/nfl/getPlayerUrls.py
|
bam2332g/proj1part3
|
9179289cacb6aa64c2d9853b6959dda8948a105a
|
[
"MIT"
] | null | null | null |
rahulCode_redo/project1Part3/nfl/getPlayerUrls.py
|
bam2332g/proj1part3
|
9179289cacb6aa64c2d9853b6959dda8948a105a
|
[
"MIT"
] | null | null | null |
rahulCode_redo/project1Part3/nfl/getPlayerUrls.py
|
bam2332g/proj1part3
|
9179289cacb6aa64c2d9853b6959dda8948a105a
|
[
"MIT"
] | null | null | null |
import requests
from lxml import html
with open('qbLinks','w') as f:
url= "http://sports.yahoo.com/nfl/players?type=position&c=NFL&pos=QB"
r=requests.get(url)
tree = html.fromstring(r.content)
oneHalf=tree.xpath('//tr[@class="ysprow1"]')
secondHalf=tree.xpath('//tr[@class="ysprow2"]')
for element in oneHalf:
temp=element[0].cssselect('a')[0].get('href')
f.write(temp)
f.write("\n")
for element in secondHalf:
temp=element[0].cssselect('a')[0].get('href')
f.write(temp)
f.write("\n")
with open('rbLinks','w') as f:
url= "http://sports.yahoo.com/nfl/players?type=position&c=NFL&pos=RB"
r=requests.get(url)
tree = html.fromstring(r.content)
oneHalf=tree.xpath('//tr[@class="ysprow1"]')
secondHalf=tree.xpath('//tr[@class="ysprow2"]')
for element in oneHalf:
temp=element[0].cssselect('a')[0].get('href')
f.write(temp)
f.write("\n")
for element in secondHalf:
temp=element[0].cssselect('a')[0].get('href')
f.write(temp)
f.write("\n")
with open('wrLinks','w') as f:
url= "http://sports.yahoo.com/nfl/players?type=position&c=NFL&pos=WR"
r=requests.get(url)
tree = html.fromstring(r.content)
oneHalf=tree.xpath('//tr[@class="ysprow1"]')
secondHalf=tree.xpath('//tr[@class="ysprow2"]')
for element in oneHalf:
temp=element[0].cssselect('a')[0].get('href')
f.write(temp)
f.write("\n")
for element in secondHalf:
temp=element[0].cssselect('a')[0].get('href')
f.write(temp)
f.write("\n")
url= "http://sports.yahoo.com/nfl/players?type=position&c=NFL&pos=TE"
r=requests.get(url)
tree = html.fromstring(r.content)
oneHalf=tree.xpath('//tr[@class="ysprow1"]')
secondHalf=tree.xpath('//tr[@class="ysprow2"]')
for element in oneHalf:
temp=element[0].cssselect('a')[0].get('href')
f.write(temp)
f.write("\n")
for element in secondHalf:
temp=element[0].cssselect('a')[0].get('href')
f.write(temp)
f.write("\n")
| 23.949367
| 70
| 0.662262
| 304
| 1,892
| 4.121711
| 0.164474
| 0.076616
| 0.070231
| 0.102155
| 0.944932
| 0.944932
| 0.944932
| 0.944932
| 0.944932
| 0.944932
| 0
| 0.01421
| 0.107294
| 1,892
| 78
| 71
| 24.25641
| 0.72765
| 0
| 0
| 0.842105
| 0
| 0.070175
| 0.266526
| 0.093072
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.035088
| 0
| 0.035088
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
005459a95cf3ad257905d8364ff03899d4b66877
| 44
|
py
|
Python
|
parameters_8000.py
|
otaviocarvalho/forca-inf
|
93b61f1d6988d4fb00a1736633d85b4f99a2f259
|
[
"BSD-3-Clause"
] | null | null | null |
parameters_8000.py
|
otaviocarvalho/forca-inf
|
93b61f1d6988d4fb00a1736633d85b4f99a2f259
|
[
"BSD-3-Clause"
] | null | null | null |
parameters_8000.py
|
otaviocarvalho/forca-inf
|
93b61f1d6988d4fb00a1736633d85b4f99a2f259
|
[
"BSD-3-Clause"
] | 1
|
2022-03-10T19:53:44.000Z
|
2022-03-10T19:53:44.000Z
|
password="9336ebf25087d91c818ee6e9ec29f8c1"
| 22
| 43
| 0.909091
| 2
| 44
| 20
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.465116
| 0.022727
| 44
| 1
| 44
| 44
| 0.465116
| 0
| 0
| 0
| 0
| 0
| 0.727273
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 9
|
006dac0f7d1c7c3b9b00e9ba4b1fe7b5706e8f9f
| 83
|
py
|
Python
|
src/__init__.py
|
dilawar/tinypandas
|
439a1994b6167628ecbddb37369bffd20813c24c
|
[
"BSD-3-Clause"
] | null | null | null |
src/__init__.py
|
dilawar/tinypandas
|
439a1994b6167628ecbddb37369bffd20813c24c
|
[
"BSD-3-Clause"
] | null | null | null |
src/__init__.py
|
dilawar/tinypandas
|
439a1994b6167628ecbddb37369bffd20813c24c
|
[
"BSD-3-Clause"
] | null | null | null |
from tinypandas.DataFrame import DataFrame
from tinypandas.DataFrame import Series
| 27.666667
| 42
| 0.879518
| 10
| 83
| 7.3
| 0.5
| 0.383562
| 0.630137
| 0.794521
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096386
| 83
| 2
| 43
| 41.5
| 0.973333
| 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
| 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
| 7
|
00bf0d15d11f47b1823515b0f08902bd89e3a9f0
| 14,676
|
py
|
Python
|
tests/unit/test_backup.py
|
nordic-institute/X-Road-Security-Server-toolkit
|
1538dbf3d76647f4fb3a72bbe93bf54f414ee9fb
|
[
"MIT"
] | 7
|
2020-11-01T19:50:11.000Z
|
2022-01-18T17:45:19.000Z
|
tests/unit/test_backup.py
|
nordic-institute/X-Road-Security-Server-toolkit
|
1538dbf3d76647f4fb3a72bbe93bf54f414ee9fb
|
[
"MIT"
] | 24
|
2020-11-09T08:09:10.000Z
|
2021-06-16T07:22:14.000Z
|
tests/unit/test_backup.py
|
nordic-institute/X-Road-Security-Server-toolkit
|
1538dbf3d76647f4fb3a72bbe93bf54f414ee9fb
|
[
"MIT"
] | 1
|
2021-04-27T14:39:48.000Z
|
2021-04-27T14:39:48.000Z
|
import sys
import unittest
from argparse import Namespace
from datetime import datetime
from unittest import mock
import pytest
from xrdsst.controllers.backup import BackupController
from xrdsst.main import XRDSSTTest
from xrdsst.models import Backup, TokensLoggedOut
class TestBackup(unittest.TestCase):
ss_config = {
'admin_credentials': 'TOOLKIT_ADMIN_CREDENTIALS',
'logging': {'file': '/tmp/xrdsst_test_token_log', 'level': 'INFO'},
'ssh_access': {'user': 'TOOLKIT_SSH_USER', 'private_key': 'TOOLKIT_SSH_PRIVATE_KEY'},
'security_server':
[{'name': 'ssX',
'url': 'https://non.existing.url.blah:8999/api/v1',
'api_key': 'TOOLKIT_SS1_API_KEY',
'api_key_url': 'https://localhost:4000/api/v1/api-keys',
'owner_member_class': 'GOV',
'owner_member_code': '9876',
'owner_dn_org': 'NIIS',
'clients': [
{
'member_class': 'GOV',
'member_code': '9876',
'member_name': 'TEST',
'subsystem_code': 'SUB1',
'connection_type': 'HTTP',
'service_descriptions': [{
'url': 'https://openapi3',
'rest_service_code': 'RestService',
'type': 'OPENAPI3'
},
{
'url': 'https://wsdl',
'rest_service_code': '',
'type': 'WSDL'
}
]
}
]},
{'name': 'ssY',
'url': 'https://non.existing.url.blah:8999/api/v1',
'api_key': 'TOOLKIT_SS2_API_KEY',
'api_key_url': 'https://localhost:4000/api/v1/api-keys',
'owner_member_class': 'GOV',
'owner_member_code': '9876',
'owner_dn_org': 'NIIS',
'clients': [
{
'member_class': 'GOV',
'member_code': '9876',
'member_name': 'TEST',
'subsystem_code': 'SUB1',
'connection_type': 'HTTP',
'service_descriptions': [{
'url': 'https://openapi3',
'rest_service_code': 'RestService',
'type': 'OPENAPI3'
},
{
'url': 'https://wsdl',
'rest_service_code': '',
'type': 'WSDL'
}
]
}
]}
]}
@pytest.fixture(autouse=True)
def capsys(self, capsys):
self.capsys = capsys
def test_backup_list_render_tabulated(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX')
with mock.patch('xrdsst.controllers.base.BaseController.is_output_tabulated', return_value=True):
with mock.patch('xrdsst.api.backups_api.BackupsApi.get_backups',
return_value=[Backup(filename='backup.tar', created_at=datetime.now())]):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.list()
assert backup_controller.app._last_rendered[0][1][1] is 'backup.tar'
def test_backup_list_render_as_object(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX')
with mock.patch('xrdsst.controllers.base.BaseController.is_output_tabulated', return_value=False):
with mock.patch('xrdsst.api.backups_api.BackupsApi.get_backups',
return_value=[Backup(filename='backup.tar', created_at=datetime.now())]):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.list()
assert backup_controller.app._last_rendered[0][0]["file_name"] is 'backup.tar'
def test_backup_list_fail_ss_name_missing(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss=None)
with mock.patch('xrdsst.controllers.base.BaseController.is_output_tabulated', return_value=True):
with mock.patch('xrdsst.api.backups_api.BackupsApi.get_backups',
return_value=[Backup(filename='backup.tar', created_at=datetime.now())]):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.list()
assert backup_controller.app._last_rendered is None
def test_backup_add(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX')
with mock.patch('xrdsst.controllers.base.BaseController.is_output_tabulated', return_value=False):
with mock.patch('xrdsst.api.backups_api.BackupsApi.add_backup',
return_value=Backup(filename='backup.tar', created_at=datetime.now())):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.add()
out, err = self.capsys.readouterr()
assert out.count("Created backup") > 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_add_fail_ss_name_missing(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss=None)
with mock.patch('xrdsst.controllers.base.BaseController.is_output_tabulated', return_value=False):
with mock.patch('xrdsst.api.backups_api.BackupsApi.add_backup',
return_value=Backup(filename='backup.tar', created_at=datetime.now())):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.add()
out, err = self.capsys.readouterr()
assert out.count("Creates backup") == 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_download(self):
class MockBackup:
def __init__(self, status, data):
self.status = status
self.data = data
def mocked_download_backup():
return MockBackup(
200,
b'073656375726974795f58524f41445f362e32345f4445562f474f562f313233342f7373333134303733333332373531303037323432'
)
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX', file='backup.tar')
with mock.patch('xrdsst.api.backups_api.BackupsApi.download_backup', return_value=mocked_download_backup()):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.download()
out, err = self.capsys.readouterr()
assert out.count("Downloaded backup") > 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_download_fail_ss_name_missing(self):
class MockBackup:
def __init__(self, status, data):
self.status = status
self.data = data
def mocked_download_backup():
return MockBackup(
200,
b'073656375726974795f58524f41445f362e32345f4445562f474f562f313233342f7373333134303733333332373531303037323432'
)
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss=None, file='backup.tar')
with mock.patch('xrdsst.api.backups_api.BackupsApi.download_backup', return_value=mocked_download_backup()):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.download()
out, err = self.capsys.readouterr()
assert out.count("Downloaded backup") == 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_download_fail_file_name_missing(self):
class MockBackup:
def __init__(self, status, data):
self.status = status
self.data = data
def mocked_download_backup():
return MockBackup(
200,
b'073656375726974795f58524f41445f362e32345f4445562f474f562f313233342f7373333134303733333332373531303037323432'
)
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX', file=None)
with mock.patch('xrdsst.api.backups_api.BackupsApi.download_backup', return_value=mocked_download_backup()):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.download()
out, err = self.capsys.readouterr()
assert out.count("Downloaded backup") == 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_delete(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX', file='backup.tar')
with mock.patch('xrdsst.api.backups_api.BackupsApi.delete_backup', return_value=None):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.delete()
out, err = self.capsys.readouterr()
assert out.count("Deleted backup") > 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_delete_fail_ss_name_missing(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss=None, file='backup.tar')
with mock.patch('xrdsst.api.backups_api.BackupsApi.delete_backup', return_value=None):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.delete()
out, err = self.capsys.readouterr()
assert out.count("Deleted backup") == 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_delete_fail_file_name_missing(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX', file=None)
with mock.patch('xrdsst.api.backups_api.BackupsApi.delete_backup', return_value=None):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.delete()
out, err = self.capsys.readouterr()
assert out.count("Deleted backup") == 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_restore(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX', file='backup.tar')
with mock.patch('xrdsst.api.backups_api.BackupsApi.restore_backup', return_value=TokensLoggedOut(hsm_tokens_logged_out=True)):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.restore()
out, err = self.capsys.readouterr()
assert out.count("Restored from backup") > 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_restore_fail_ss_name_missing(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss=None, file='backup.tar')
with mock.patch('xrdsst.api.backups_api.BackupsApi.restore_backup', return_value=TokensLoggedOut(hsm_tokens_logged_out=True)):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.restore()
out, err = self.capsys.readouterr()
assert out.count("Restored from backup") == 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
def test_backup_restore_fail_file_name_missing(self):
with XRDSSTTest() as app:
app._parsed_args = Namespace(ss='ssX', file=None)
with mock.patch('xrdsst.api.backups_api.BackupsApi.restore_backup', return_value=TokensLoggedOut(hsm_tokens_logged_out=True)):
backup_controller = BackupController()
backup_controller.app = app
backup_controller.load_config = (lambda: self.ss_config)
backup_controller.restore()
out, err = self.capsys.readouterr()
assert out.count("Restored from backup") == 0
with self.capsys.disabled():
sys.stdout.write(out)
sys.stderr.write(err)
| 44.880734
| 138
| 0.556691
| 1,409
| 14,676
| 5.556423
| 0.10291
| 0.120577
| 0.031549
| 0.046111
| 0.927449
| 0.922979
| 0.922979
| 0.915826
| 0.915826
| 0.915826
| 0
| 0.037785
| 0.345394
| 14,676
| 326
| 139
| 45.018405
| 0.777142
| 0
| 0
| 0.785714
| 0
| 0
| 0.174707
| 0.091306
| 0
| 0
| 0
| 0
| 0.05
| 1
| 0.075
| false
| 0
| 0.032143
| 0.010714
| 0.135714
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 7
|
dab3a10ef0a256d9573128007a4b812ab4993ab3
| 44
|
py
|
Python
|
tests/strider_test.py
|
jcftang/strider
|
432a68eb1303541b6d955bd6ecf7439d1f9b0d48
|
[
"Apache-2.0"
] | 16
|
2016-02-10T13:06:50.000Z
|
2021-02-28T06:21:16.000Z
|
tests/strider_test.py
|
jcftang/strider
|
432a68eb1303541b6d955bd6ecf7439d1f9b0d48
|
[
"Apache-2.0"
] | 4
|
2016-02-20T16:33:40.000Z
|
2016-05-28T10:46:06.000Z
|
tests/strider_test.py
|
jcftang/strider
|
432a68eb1303541b6d955bd6ecf7439d1f9b0d48
|
[
"Apache-2.0"
] | 1
|
2016-09-01T11:06:56.000Z
|
2016-09-01T11:06:56.000Z
|
import pytest
def test_strider():
pass
| 8.8
| 19
| 0.704545
| 6
| 44
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.227273
| 44
| 4
| 20
| 11
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0.333333
| 0.333333
| 0
| 0.666667
| 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
| 1
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 8
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.