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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36a3a7ac8442bd11734a2b74a2d3ed6bef5724c9
| 9,534
|
py
|
Python
|
leetcode_python/Binary_Search_Tree/lowest-common-ancestor-of-a-binary-search-tree.py
|
yennanliu/CS_basics
|
3c50c819897a572ff38179bfb0083a19b2325fde
|
[
"Unlicense"
] | 18
|
2019-08-01T07:45:02.000Z
|
2022-03-31T18:05:44.000Z
|
leetcode_python/Binary_Search_Tree/lowest-common-ancestor-of-a-binary-search-tree.py
|
yennanliu/CS_basics
|
3c50c819897a572ff38179bfb0083a19b2325fde
|
[
"Unlicense"
] | null | null | null |
leetcode_python/Binary_Search_Tree/lowest-common-ancestor-of-a-binary-search-tree.py
|
yennanliu/CS_basics
|
3c50c819897a572ff38179bfb0083a19b2325fde
|
[
"Unlicense"
] | 15
|
2019-12-29T08:46:20.000Z
|
2022-03-08T14:14:05.000Z
|
"""
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”
Example 1:
Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 8
Output: 6
Explanation: The LCA of nodes 2 and 8 is 6.
Example 2:
Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 4
Output: 2
Explanation: The LCA of nodes 2 and 4 is 2, since a node can be a descendant of itself according to the LCA definition.
Example 3:
Input: root = [2,1], p = 2, q = 1
Output: 2
Constraints:
The number of nodes in the tree is in the range [2, 105].
-109 <= Node.val <= 109
All Node.val are unique.
p != q
p and q will exist in the BST.
"""
# V0
# IDEA : RECURSION
class Solution:
def lowestCommonAncestor(self, root, p, q):
### NOTE : we need to assign root.val, p, q to other var first (before they are changed)
# Value of current node or parent node.
parent_val = root.val
# Value of p
p_val = p.val
# Value of q
q_val = q.val
# If both p and q are greater than parent
if p_val > parent_val and q_val > parent_val:
### NOTE : we need to `return` below func call
return self.lowestCommonAncestor(root.right, p, q)
# If both p and q are lesser than parent
elif p_val < parent_val and q_val < parent_val:
### NOTE : we need to `return` below func call
return self.lowestCommonAncestor(root.left, p, q)
# We have found the split point, i.e. the LCA node.
else:
### NOTE : not root.val but root
return root
# V0'
# IDEA : ITERATION
# https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/solution/
class Solution:
def lowestCommonAncestor(self, root, p, q):
"""
:type root: TreeNode
:type p: TreeNode
:type q: TreeNode
:rtype: TreeNode
"""
# Value of p
p_val = p.val
# Value of q
q_val = q.val
# Start from the root node of the tree
node = root
# Traverse the tree
while node:
# Value of current node or parent node.
parent_val = node.val
if p_val > parent_val and q_val > parent_val:
# If both p and q are greater than parent
node = node.right
elif p_val < parent_val and q_val < parent_val:
# If both p and q are lesser than parent
node = node.left
else:
# We have found the split point, i.e. the LCA node.
return node
# V0''
# IDEA : GO THROUGH ALL BST (no need to use BFS, or DFS, can just use BST property)
# THIS METHOD IS MORE GENERAL
class Solution(object):
def lowestCommonAncestor(self, root, p, q):
pathp = self.findPath(root, p)
pathq = self.findPath(root, q)
res = root
for i in range(1, min(len(pathp), len(pathq))):
### NOTE : we need to find Lowest common ancestor (LCA),
# -> so need to go through pathp, pathq,
# -> and find the lowest overlap
if pathp[i] == pathq[i]:
res = pathp[i]
return res
def findPath(self, root, p):
path = []
### NOTE :
# -> here we use "BFS" like way go through the BST
# -> however, this is not a BFS, since we ONLY go throgh the BST with ONE ROUTE which has x
# -> (and also there is no queue here)
while root.val != p.val:
path.append(root)
if p.val > root.val:
root = root.right
elif p.val < root.val:
root = root.left
# NOTE this : we append p to path
path.append(p)
return path
# V0'''
# IDEA : BST PROPERTY
class Solution(object):
def lowestCommonAncestor(self, root, p, q):
"""
:type root: TreeNode
:type p: TreeNode
:type q: TreeNode
:rtype: TreeNode
"""
pointer = root
while pointer:
if p.val > pointer.val and q.val > pointer.val:
pointer = pointer.right
elif p.val < pointer.val and q.val < pointer.val:
pointer = pointer.left
else:
return pointer
# V0''''
# IDEA : BST PROPERTY
class Solution(object):
def lowestCommonAncestor(self, root, p, q):
if not root or root == q or root == p:
return root
if p.val < root.val and q.val < root.val:
return self.lowestCommonAncestor(root.left, p, q)
elif p.val > root.val and q.val > root.val:
return self.lowestCommonAncestor(root.right, p, q)
return root
# V1
# IDEA : RECURSION
# https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/solution/
class Solution:
def lowestCommonAncestor(self, root, p, q):
"""
:type root: TreeNode
:type p: TreeNode
:type q: TreeNode
:rtype: TreeNode
"""
# Value of current node or parent node.
parent_val = root.val
# Value of p
p_val = p.val
# Value of q
q_val = q.val
# If both p and q are greater than parent
if p_val > parent_val and q_val > parent_val:
return self.lowestCommonAncestor(root.right, p, q)
# If both p and q are lesser than parent
elif p_val < parent_val and q_val < parent_val:
return self.lowestCommonAncestor(root.left, p, q)
# We have found the split point, i.e. the LCA node.
else:
return root
# V1''
# IDEA : ITERATION
# https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/solution/
class Solution:
def lowestCommonAncestor(self, root, p, q):
"""
:type root: TreeNode
:type p: TreeNode
:type q: TreeNode
:rtype: TreeNode
"""
# Value of p
p_val = p.val
# Value of q
q_val = q.val
# Start from the root node of the tree
node = root
# Traverse the tree
while node:
# Value of current node or parent node.
parent_val = node.val
if p_val > parent_val and q_val > parent_val:
# If both p and q are greater than parent
node = node.right
elif p_val < parent_val and q_val < parent_val:
# If both p and q are lesser than parent
node = node.left
else:
# We have found the split point, i.e. the LCA node.
return node
# V1'
# https://blog.csdn.net/coder_orz/article/details/51498796
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def lowestCommonAncestor(self, root, p, q):
"""
:type root: TreeNode
:type p: TreeNode
:type q: TreeNode
:rtype: TreeNode
"""
pointer = root
while pointer:
if p.val > pointer.val and q.val > pointer.val:
pointer = pointer.right
elif p.val < pointer.val and q.val < pointer.val:
pointer = pointer.left
else:
return pointer
# V1''
# https://blog.csdn.net/coder_orz/article/details/51498796
class Solution(object):
def lowestCommonAncestor(self, root, p, q):
"""
:type root: TreeNode
:type p: TreeNode
:type q: TreeNode
:rtype: TreeNode
"""
if not root:
return None
if p.val < root.val and q.val < root.val:
return self.lowestCommonAncestor(root.left, p, q)
elif p.val > root.val and q.val > root.val:
return self.lowestCommonAncestor(root.right, p, q)
else:
return root
# V1'''
# https://blog.csdn.net/coder_orz/article/details/51498796
class Solution(object):
def lowestCommonAncestor(self, root, p, q):
"""
:type root: TreeNode
:type p: TreeNode
:type q: TreeNode
:rtype: TreeNode
"""
pathp = self.findPath(root, p)
pathq = self.findPath(root, q)
res = root
for i in xrange(1, min(len(pathp), len(pathq))):
if pathp[i] == pathq[i]:
res = pathp[i]
return res
def findPath(self, root, p):
path = []
while root.val != p.val:
path.append(root)
if p.val > root.val:
root = root.right
elif p.val < root.val:
root = root.left
path.append(p)
return path
# V2
# Time: O(n)
# Space: O(1)
class Solution(object):
# @param {TreeNode} root
# @param {TreeNode} p
# @param {TreeNode} q
# @return {TreeNode}
def lowestCommonAncestor(self, root, p, q):
s, b = sorted([p.val, q.val])
while not s <= root.val <= b:
# Keep searching since root is outside of [s, b].
root = root.left if s <= root.val else root.right
# s <= root.val <= b.
return root
| 29.887147
| 229
| 0.553178
| 1,318
| 9,534
| 3.962822
| 0.140364
| 0.023741
| 0.03676
| 0.030634
| 0.749952
| 0.733869
| 0.719127
| 0.708405
| 0.699598
| 0.689642
| 0
| 0.013914
| 0.351689
| 9,534
| 319
| 230
| 29.887147
| 0.831095
| 0.405496
| 0
| 0.938931
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.099237
| false
| 0
| 0
| 0
| 0.358779
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
36a7437880b48fb284de120e104dac0f8eb73053
| 92
|
py
|
Python
|
enthought/chaco/selectable_legend.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 3
|
2016-12-09T06:05:18.000Z
|
2018-03-01T13:00:29.000Z
|
enthought/chaco/selectable_legend.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 1
|
2020-12-02T00:51:32.000Z
|
2020-12-02T08:48:55.000Z
|
enthought/chaco/selectable_legend.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | null | null | null |
# proxy module
from __future__ import absolute_import
from chaco.selectable_legend import *
| 23
| 38
| 0.847826
| 12
| 92
| 6
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119565
| 92
| 3
| 39
| 30.666667
| 0.888889
| 0.130435
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
36cef281da82ac17ac6018586d71d5d8bd8ca7b0
| 1,314
|
py
|
Python
|
years/AoC2021/tasks.py
|
yuriisthebest/Advent-of-Code
|
1a4b3d6e57b0751dec097ccfc83472c458605e37
|
[
"MIT"
] | null | null | null |
years/AoC2021/tasks.py
|
yuriisthebest/Advent-of-Code
|
1a4b3d6e57b0751dec097ccfc83472c458605e37
|
[
"MIT"
] | null | null | null |
years/AoC2021/tasks.py
|
yuriisthebest/Advent-of-Code
|
1a4b3d6e57b0751dec097ccfc83472c458605e37
|
[
"MIT"
] | null | null | null |
from years.AoC2021.task_1 import Task1
from years.AoC2021.task_2 import Task2
from years.AoC2021.task_3 import Task3
from years.AoC2021.task_4 import Task4
from years.AoC2021.task_5 import Task5
from years.AoC2021.task_6 import Task6
from years.AoC2021.task_7 import Task7
from years.AoC2021.task_8 import Task8
from years.AoC2021.task_9 import Task9
from years.AoC2021.task_10 import Task10
from years.AoC2021.task_11 import Task11
from years.AoC2021.task_12 import Task12
from years.AoC2021.task_13 import Task13
from years.AoC2021.task_14 import Task14
from years.AoC2021.task_15 import Task15
from years.AoC2021.task_16 import Task16
from years.AoC2021.task_17 import Task17
from years.AoC2021.task_18 import Task18
from years.AoC2021.task_19 import Task19
from years.AoC2021.task_20 import Task20
from years.AoC2021.task_21 import Task21
from years.AoC2021.task_22 import Task22
from years.AoC2021.task_23 import Task23
from years.AoC2021.task_24 import Task24
from years.AoC2021.task_25 import Task25
TASKS2021 = [
Task1,
Task2,
Task3,
Task4,
Task5,
Task6,
Task7,
Task8,
Task9,
Task10,
Task11,
Task12,
Task13,
Task14,
Task15,
Task16,
Task17,
Task18,
Task19,
Task20,
Task21,
Task22,
Task23,
Task24,
Task25
]
| 24.333333
| 40
| 0.766362
| 201
| 1,314
| 4.885572
| 0.278607
| 0.229124
| 0.407332
| 0.509165
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.20941
| 0.175038
| 1,314
| 53
| 41
| 24.792453
| 0.696494
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.480769
| 0
| 0.480769
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
36d22f43bc34086ae304137401fe2970f8adb64c
| 215
|
py
|
Python
|
src/utils/tests/strings_test.py
|
danieltvaz/ava-api
|
1c0d6f6ba91763a893acd2d2055d5301c701e2d5
|
[
"MIT"
] | 2
|
2021-07-28T18:05:48.000Z
|
2021-07-31T00:47:12.000Z
|
src/utils/tests/strings_test.py
|
danieltvaz/ava-api
|
1c0d6f6ba91763a893acd2d2055d5301c701e2d5
|
[
"MIT"
] | null | null | null |
src/utils/tests/strings_test.py
|
danieltvaz/ava-api
|
1c0d6f6ba91763a893acd2d2055d5301c701e2d5
|
[
"MIT"
] | 1
|
2022-02-22T00:59:04.000Z
|
2022-02-22T00:59:04.000Z
|
from ..strings import clean
def test_clean_spaces_line_jump():
assert clean('\n\nhello world \n') == 'hello world'
def test_clean_and_replace():
assert clean('\n\nhello world% \n', {'%': ''}) == 'hello world'
| 30.714286
| 65
| 0.674419
| 31
| 215
| 4.451613
| 0.516129
| 0.101449
| 0.173913
| 0.26087
| 0.492754
| 0.492754
| 0.492754
| 0.492754
| 0
| 0
| 0
| 0
| 0.139535
| 215
| 7
| 65
| 30.714286
| 0.745946
| 0
| 0
| 0
| 0
| 0
| 0.282407
| 0
| 0
| 0
| 0
| 0
| 0.4
| 1
| 0.4
| true
| 0
| 0.2
| 0
| 0.6
| 0
| 0
| 0
| 0
| null | 0
| 0
| 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
| 0
| 0
| 1
| 0
|
0
| 5
|
7fd0112a5aa0cf8e5c386bc183fffcd5972c8b2f
| 3,037
|
py
|
Python
|
tests/test_strings.py
|
havok2063/SQLAlchemy-boolean-search
|
cda25e7b7ba887cd1bfc5a870affebe8cba45837
|
[
"BSD-3-Clause"
] | 3
|
2016-04-21T20:00:08.000Z
|
2022-03-24T20:25:18.000Z
|
tests/test_strings.py
|
sdss/sqlalchemy-boolean-search
|
cda25e7b7ba887cd1bfc5a870affebe8cba45837
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_strings.py
|
sdss/sqlalchemy-boolean-search
|
cda25e7b7ba887cd1bfc5a870affebe8cba45837
|
[
"BSD-3-Clause"
] | 1
|
2021-05-18T06:02:57.000Z
|
2021-05-18T06:02:57.000Z
|
# Copyright 2015 SolidBuilds.com. All rights reserved.
#
# Authors: Ling Thio <ling.thio@gmail.com>
from __future__ import print_function
from sqlalchemy_boolean_search import parse_boolean_search
from .models import Record
import pytest
def add_records(db, records):
for record in records:
db.session.add(record)
db.session.commit()
def delete_records(db, records):
for record in records:
db.session.delete(record)
db.session.commit()
@pytest.mark.skip(reason="strings conditions no longer work the same way")
def test_strings(db):
all_records = [
Record(string='abc'),
Record(string='abcx'),
Record(string='xabc'),
Record(string='xabcx'),
]
add_records(db, all_records)
expression = parse_boolean_search('string==abc')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 1
for record in records:
assert record.string == 'abc'
expression = parse_boolean_search('string!=abc')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 3
for record in records:
assert record.string != 'abc'
expression = parse_boolean_search('not string==abc')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 3
for record in records:
assert record.string != 'abc'
expression = parse_boolean_search('string<xabc')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 2
for record in records:
assert record.string < 'xabc'
expression = parse_boolean_search('string<=xabc')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 3
for record in records:
assert record.string <= 'xabc'
expression = parse_boolean_search('string>xabc')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 1
for record in records:
assert record.string > 'xabc'
expression = parse_boolean_search('string>=xabc')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 2
for record in records:
assert record.string >= 'xabc'
expression = parse_boolean_search('string=abc')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 4
for record in records:
assert 'abc' in record.string
expression = parse_boolean_search('string=*x and string=x*')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 1
for record in records:
assert record.string[0:1] == 'x' and record.string[-1:] == 'x'
expression = parse_boolean_search('string=*x or string=x*')
records = Record.query.filter(expression.filter(Record)).all()
assert len(records) == 3
for record in records:
assert record.string[0:1] == 'x' or record.string[-1:] == 'x'
delete_records(db, all_records)
| 32.308511
| 74
| 0.676655
| 387
| 3,037
| 5.21447
| 0.162791
| 0.095144
| 0.065411
| 0.107037
| 0.747275
| 0.735382
| 0.700694
| 0.700694
| 0.700694
| 0.658077
| 0
| 0.0082
| 0.196905
| 3,037
| 93
| 75
| 32.655914
| 0.819188
| 0.030622
| 0
| 0.486111
| 0
| 0
| 0.078912
| 0
| 0
| 0
| 0
| 0
| 0.277778
| 1
| 0.041667
| false
| 0
| 0.055556
| 0
| 0.097222
| 0.013889
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
7fd3c94fd557a7102be167e49b05a8a1e210ceeb
| 111
|
py
|
Python
|
cowin18-api/helpers/instances.py
|
harishb93/cowin18plus
|
3e6541efa04486eea04bf6dda7c61713c72cddac
|
[
"Apache-2.0"
] | 1
|
2021-04-30T05:15:03.000Z
|
2021-04-30T05:15:03.000Z
|
cowin18-api/helpers/instances.py
|
harishb93/cowin18plus
|
3e6541efa04486eea04bf6dda7c61713c72cddac
|
[
"Apache-2.0"
] | 1
|
2021-04-30T05:06:41.000Z
|
2021-04-30T05:06:41.000Z
|
cowin18-api/helpers/instances.py
|
harishb93/cowin18plus
|
3e6541efa04486eea04bf6dda7c61713c72cddac
|
[
"Apache-2.0"
] | 1
|
2021-04-30T05:03:58.000Z
|
2021-04-30T05:03:58.000Z
|
import os
from .redis import Redis
redis = Redis(host=os.getenv("REDIS_HOST"), port=os.getenv("REDIS_PORT"))
| 18.5
| 73
| 0.738739
| 18
| 111
| 4.444444
| 0.388889
| 0.25
| 0.325
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 111
| 5
| 74
| 22.2
| 0.808081
| 0
| 0
| 0
| 0
| 0
| 0.18018
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
3d111c7095b5d2ed9762d8ea379e830f6c586e97
| 2,135
|
py
|
Python
|
tests/cli/97_test_site_update.py
|
dnimtheory/WordOps
|
82fc71f5f563df0e4249cc178f768f6cf6c005f6
|
[
"MIT"
] | 2
|
2019-09-03T03:39:40.000Z
|
2021-04-22T12:09:50.000Z
|
tests/cli/97_test_site_update.py
|
BreezeRo/WordOps
|
3c5cb8ba0ed8d619cddb170386a07102cb385727
|
[
"MIT"
] | null | null | null |
tests/cli/97_test_site_update.py
|
BreezeRo/WordOps
|
3c5cb8ba0ed8d619cddb170386a07102cb385727
|
[
"MIT"
] | 2
|
2021-01-02T07:49:51.000Z
|
2022-03-26T15:58:50.000Z
|
from wo.utils import test
from wo.cli.main import get_test_app
class CliTestCaseSite(test.WOTestCase):
def test_wo_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_site_update_html(self):
self.app = get_test_app(argv=['site', 'update', 'example2.com',
'--html'])
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_site_update_php(self):
self.app = get_test_app(argv=['site', 'update', 'example1.com',
'--php'])
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_site_update_mysql(self):
self.app = get_test_app(argv=['site', 'update', 'example1.com',
'--html'])
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_site_update_wp(self):
self.app = get_test_app(argv=['site', 'update', 'example5.com',
'--wp'])
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_site_update_wpsubdir(self):
self.app = get_test_app(argv=['site', 'update', 'example4.com',
'--wpsubdir'])
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_site_update_wpsubdomain(self):
self.app = get_test_app(argv=['site', 'update', 'example7.com',
'--wpsubdomain'])
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_site_update_wpfc(self):
self.app = get_test_app(argv=['site', 'update', 'example9.com',
'--wpfc'])
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_site_update_wpsc(self):
self.app = get_test_app(argv=['site', 'update', 'example6.com',
'--wpsc'])
self.app.setup()
self.app.run()
self.app.close()
| 31.865672
| 71
| 0.511007
| 255
| 2,135
| 4.043137
| 0.141176
| 0.237633
| 0.087294
| 0.104753
| 0.771096
| 0.771096
| 0.771096
| 0.771096
| 0.771096
| 0.534433
| 0
| 0.00571
| 0.343794
| 2,135
| 66
| 72
| 32.348485
| 0.730193
| 0
| 0
| 0.563636
| 0
| 0
| 0.108665
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.163636
| false
| 0
| 0.036364
| 0
| 0.218182
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
3d38846d4b6079c317bbeb3183ddf21fc43bf2f1
| 101
|
py
|
Python
|
local_ci/errors.py
|
ownport/local-ci
|
7836a2803e18ccbf46bc9cae5f08fb85a1527dcb
|
[
"Apache-2.0"
] | 6
|
2016-06-23T09:07:05.000Z
|
2022-03-04T08:55:53.000Z
|
local_ci/errors.py
|
ownport/local-ci
|
7836a2803e18ccbf46bc9cae5f08fb85a1527dcb
|
[
"Apache-2.0"
] | 10
|
2016-06-23T21:46:41.000Z
|
2016-11-12T06:19:22.000Z
|
local_ci/errors.py
|
ownport/local-ci
|
7836a2803e18ccbf46bc9cae5f08fb85a1527dcb
|
[
"Apache-2.0"
] | null | null | null |
class IncorrectFileFormat(Exception):
pass
class NoConfigFileFound(Exception):
pass
| 10.1
| 37
| 0.712871
| 8
| 101
| 9
| 0.625
| 0.361111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.227723
| 101
| 9
| 38
| 11.222222
| 0.923077
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
3d41f39d2bab3410a32ad516a1e829b6b8ac8c8f
| 299
|
py
|
Python
|
quantdsl/infrastructure/event_sourced_repos/market_simulation_repo.py
|
johnbywater/quantdsl
|
81c1c69f27e094a6ed0542b28cf1ac8fcce5494a
|
[
"BSD-3-Clause"
] | 269
|
2015-01-09T00:56:41.000Z
|
2022-03-30T17:09:46.000Z
|
quantdsl/infrastructure/event_sourced_repos/market_simulation_repo.py
|
johnbywater/quantdsl
|
81c1c69f27e094a6ed0542b28cf1ac8fcce5494a
|
[
"BSD-3-Clause"
] | 22
|
2017-04-01T13:44:56.000Z
|
2018-09-10T11:48:56.000Z
|
quantdsl/infrastructure/event_sourced_repos/market_simulation_repo.py
|
johnbywater/quantdsl
|
81c1c69f27e094a6ed0542b28cf1ac8fcce5494a
|
[
"BSD-3-Clause"
] | 59
|
2015-01-09T00:56:50.000Z
|
2022-03-13T23:52:27.000Z
|
from eventsourcing.infrastructure.event_sourced_repo import EventSourcedRepository
from quantdsl.domain.model.market_simulation import MarketSimulation, MarketSimulationRepository
class MarketSimulationRepo(MarketSimulationRepository, EventSourcedRepository):
domain_class = MarketSimulation
| 37.375
| 96
| 0.889632
| 24
| 299
| 10.916667
| 0.708333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.073579
| 299
| 7
| 97
| 42.714286
| 0.945848
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
3d4a0c9e026a59b544652f919d04c093fe80074f
| 132
|
py
|
Python
|
documentos/admin.py
|
CARocha/cafod-joa
|
e207b29375cd1f2219086b54ec6280e5c5789c32
|
[
"MIT"
] | 1
|
2021-11-05T11:33:01.000Z
|
2021-11-05T11:33:01.000Z
|
documentos/admin.py
|
CARocha/cafod-joa
|
e207b29375cd1f2219086b54ec6280e5c5789c32
|
[
"MIT"
] | 6
|
2020-06-05T18:13:39.000Z
|
2022-01-13T00:45:03.000Z
|
documentos/admin.py
|
CARocha/cafod-joa
|
e207b29375cd1f2219086b54ec6280e5c5789c32
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import SubirArchivos
# Register your models here.
admin.site.register(SubirArchivos)
| 22
| 34
| 0.825758
| 17
| 132
| 6.411765
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113636
| 132
| 5
| 35
| 26.4
| 0.931624
| 0.19697
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
3d547a83639b38b68b71cd564e1ee72147e93ac6
| 238
|
py
|
Python
|
tests/base/eval_model_train_dataloaders.py
|
girishponkiya/pytorch-lightning
|
42d5cfc3b056b4c82a77a7cdcb8eafc63a812b67
|
[
"Apache-2.0"
] | 1
|
2020-05-07T15:15:40.000Z
|
2020-05-07T15:15:40.000Z
|
tests/base/eval_model_train_dataloaders.py
|
girishponkiya/pytorch-lightning
|
42d5cfc3b056b4c82a77a7cdcb8eafc63a812b67
|
[
"Apache-2.0"
] | null | null | null |
tests/base/eval_model_train_dataloaders.py
|
girishponkiya/pytorch-lightning
|
42d5cfc3b056b4c82a77a7cdcb8eafc63a812b67
|
[
"Apache-2.0"
] | 1
|
2020-05-12T10:59:54.000Z
|
2020-05-12T10:59:54.000Z
|
from abc import ABC, abstractmethod
class TrainDataloaderVariations(ABC):
@abstractmethod
def dataloader(self, train: bool):
"""placeholder"""
def train_dataloader(self):
return self.dataloader(train=True)
| 19.833333
| 42
| 0.697479
| 24
| 238
| 6.875
| 0.583333
| 0.206061
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.205882
| 238
| 11
| 43
| 21.636364
| 0.873016
| 0.046218
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.166667
| 0.166667
| 0.833333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
e9faf4d2308d5743525c61401b5134006844edbd
| 171
|
py
|
Python
|
cgxsh_edit_config.py
|
ebob9/cgxsh
|
0682922bae4354d2e306147e314dd309da968059
|
[
"MIT"
] | null | null | null |
cgxsh_edit_config.py
|
ebob9/cgxsh
|
0682922bae4354d2e306147e314dd309da968059
|
[
"MIT"
] | 3
|
2020-02-10T00:01:18.000Z
|
2022-03-28T00:26:45.000Z
|
cgxsh_edit_config.py
|
ebob9/cgxsh
|
0682922bae4354d2e306147e314dd309da968059
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from cgxsh_lib.file_crypto import edit_config_file
if __name__ == '__main__':
sys.exit(edit_config_file())
| 19
| 50
| 0.71345
| 26
| 171
| 4.153846
| 0.769231
| 0.185185
| 0.259259
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013605
| 0.140351
| 171
| 8
| 51
| 21.375
| 0.721088
| 0.251462
| 0
| 0
| 0
| 0
| 0.063492
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e9fc0883cf5dad7786e4fd71f424dc3ba47cc3a4
| 201
|
py
|
Python
|
Bundesliga/Bundesliga/views.py
|
Sunchasing/Bundesliga_Website
|
b2afc64da11d2d75120ea706b25bdfd85e3e3975
|
[
"MIT"
] | null | null | null |
Bundesliga/Bundesliga/views.py
|
Sunchasing/Bundesliga_Website
|
b2afc64da11d2d75120ea706b25bdfd85e3e3975
|
[
"MIT"
] | null | null | null |
Bundesliga/Bundesliga/views.py
|
Sunchasing/Bundesliga_Website
|
b2afc64da11d2d75120ea706b25bdfd85e3e3975
|
[
"MIT"
] | null | null | null |
from datetime import datetime
from django.http import HttpResponse, HttpRequest
from .settings import start_time
def is_up(_: HttpRequest):
return HttpResponse(f"{datetime.now() - start_time}")
| 22.333333
| 57
| 0.781095
| 26
| 201
| 5.884615
| 0.615385
| 0.117647
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134328
| 201
| 8
| 58
| 25.125
| 0.87931
| 0
| 0
| 0
| 0
| 0
| 0.144279
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.6
| 0.2
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
180a4ad09e79709677bb4ff4b0fc08cf69604716
| 295
|
py
|
Python
|
Tensile/Tests/nightly/global_split_u/test_global_split_u.py
|
yxsamliu/Tensile
|
e6c4302bbaa31190972f27828a55959ea434b3c1
|
[
"MIT"
] | null | null | null |
Tensile/Tests/nightly/global_split_u/test_global_split_u.py
|
yxsamliu/Tensile
|
e6c4302bbaa31190972f27828a55959ea434b3c1
|
[
"MIT"
] | null | null | null |
Tensile/Tests/nightly/global_split_u/test_global_split_u.py
|
yxsamliu/Tensile
|
e6c4302bbaa31190972f27828a55959ea434b3c1
|
[
"MIT"
] | null | null | null |
import Tensile.Tensile as Tensile
def test_hgemm_gsu(tmpdir):
Tensile.Tensile([Tensile.TensileTestPath("nightly/global_split_u/hgemm_gsu.yaml"), tmpdir.strpath])
def test_sgemm_gsu(tmpdir):
Tensile.Tensile([Tensile.TensileTestPath("nightly/global_split_u/sgemm_gsu.yaml"), tmpdir.strpath])
| 32.777778
| 100
| 0.816949
| 41
| 295
| 5.634146
| 0.390244
| 0.30303
| 0.138528
| 0.199134
| 0.554113
| 0.554113
| 0.554113
| 0.554113
| 0.554113
| 0.554113
| 0
| 0
| 0.057627
| 295
| 8
| 101
| 36.875
| 0.830935
| 0
| 0
| 0
| 0
| 0
| 0.251701
| 0.251701
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.2
| 0
| 0.6
| 0
| 0
| 0
| 0
| null | 1
| 0
| 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
| 0
| 1
| 0
|
0
| 5
|
1842c8cf04a4fe67ada4120f2141bb77ef9789b6
| 142
|
py
|
Python
|
js_components/admin.py
|
compoundpartners/js-components
|
a58a944254354078a0a7b53a4c9a7df50790267a
|
[
"BSD-3-Clause"
] | null | null | null |
js_components/admin.py
|
compoundpartners/js-components
|
a58a944254354078a0a7b53a4c9a7df50790267a
|
[
"BSD-3-Clause"
] | null | null | null |
js_components/admin.py
|
compoundpartners/js-components
|
a58a944254354078a0a7b53a4c9a7df50790267a
|
[
"BSD-3-Clause"
] | null | null | null |
from django.contrib import admin
from filer.admin.fileadmin import FileAdmin
from .models import Video
admin.site.register(Video, FileAdmin)
| 23.666667
| 43
| 0.830986
| 20
| 142
| 5.9
| 0.55
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105634
| 142
| 5
| 44
| 28.4
| 0.929134
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 5
|
18488dded8fd794731403780e0ab090c118d416c
| 41
|
py
|
Python
|
fluent_pages/forms/__init__.py
|
vinnyrose/django-fluent-pages
|
960b40dcf4e5cecd440f6414d28be6b51f31eb4e
|
[
"Apache-2.0"
] | null | null | null |
fluent_pages/forms/__init__.py
|
vinnyrose/django-fluent-pages
|
960b40dcf4e5cecd440f6414d28be6b51f31eb4e
|
[
"Apache-2.0"
] | 1
|
2021-03-24T18:53:10.000Z
|
2021-03-24T18:53:10.000Z
|
fluent_pages/forms/__init__.py
|
masschallenge/django-fluent-pages
|
8beb083d89fba935ef3bfeda8cacf566f28b1334
|
[
"Apache-2.0"
] | null | null | null |
"""
Form fields
"""
from .fields import *
| 10.25
| 21
| 0.634146
| 5
| 41
| 5.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170732
| 41
| 4
| 21
| 10.25
| 0.764706
| 0.268293
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
186c4f194f1395af894ab136bf7751d001414672
| 24
|
py
|
Python
|
logparser/LogCluster/__init__.py
|
CUHK-CSE/logalizer
|
e8d96cd4de1121c5d2b517982c6028cd06e643f1
|
[
"MIT"
] | 859
|
2017-05-06T03:06:22.000Z
|
2022-03-31T12:02:29.000Z
|
logparser/LogCluster/__init__.py
|
mandychenze/logparser
|
8f1f1face2c0e270fd9bcecdefe37ebc6ba76e9d
|
[
"MIT"
] | 71
|
2018-02-24T08:11:32.000Z
|
2022-03-15T11:44:29.000Z
|
logparser/LogCluster/__init__.py
|
mandychenze/logparser
|
8f1f1face2c0e270fd9bcecdefe37ebc6ba76e9d
|
[
"MIT"
] | 445
|
2017-06-19T01:26:16.000Z
|
2022-03-29T08:27:17.000Z
|
from LogCluster import *
| 24
| 24
| 0.833333
| 3
| 24
| 6.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 24
| 1
| 24
| 24
| 0.952381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
43e97096f2b4c67f08887dcb16773d99a5058dcc
| 149
|
py
|
Python
|
lib/mpl_toolkits/axes_grid/axisline_style.py
|
adrn/matplotlib
|
7a9f2347a3b1c1efaef6e547930661a547c20ef2
|
[
"MIT",
"BSD-3-Clause"
] | null | null | null |
lib/mpl_toolkits/axes_grid/axisline_style.py
|
adrn/matplotlib
|
7a9f2347a3b1c1efaef6e547930661a547c20ef2
|
[
"MIT",
"BSD-3-Clause"
] | null | null | null |
lib/mpl_toolkits/axes_grid/axisline_style.py
|
adrn/matplotlib
|
7a9f2347a3b1c1efaef6e547930661a547c20ef2
|
[
"MIT",
"BSD-3-Clause"
] | null | null | null |
from __future__ import absolute_import, division, print_function, unicode_literals
import six
from mpl_toolkits.axisartist.axisline_style import *
| 24.833333
| 82
| 0.85906
| 19
| 149
| 6.263158
| 0.789474
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.100671
| 149
| 5
| 83
| 29.8
| 0.88806
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a125e6a00b3b5c2f5b1e668aef87c71739d5ac8c
| 252
|
py
|
Python
|
spider/concurrent/__init__.py
|
zhouqijun/a_simple_spider_frame
|
424572cee9479fe3c54481928d1b780e1d800cde
|
[
"BSD-2-Clause"
] | 1
|
2017-11-23T05:20:10.000Z
|
2017-11-23T05:20:10.000Z
|
spider/concurrent/__init__.py
|
zhouqijun/a_simple_spider_frame
|
424572cee9479fe3c54481928d1b780e1d800cde
|
[
"BSD-2-Clause"
] | null | null | null |
spider/concurrent/__init__.py
|
zhouqijun/a_simple_spider_frame
|
424572cee9479fe3c54481928d1b780e1d800cde
|
[
"BSD-2-Clause"
] | null | null | null |
# _*_ coding: utf-8 _*_
"""
define ThreadPool as WebSpider, and DistThreadPool as WebSpiderDist
"""
from .concur_abase import TPEnum
from .concur_threads import ThreadPool as WebSpider
from .distributed_threads import DistThreadPool as WebSpiderDist
| 25.2
| 67
| 0.809524
| 30
| 252
| 6.566667
| 0.566667
| 0.121827
| 0.213198
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004566
| 0.130952
| 252
| 9
| 68
| 28
| 0.894977
| 0.357143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 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
| 5
|
a1932f028265a0d62378b5d1b96ff03b39f992da
| 90
|
py
|
Python
|
snake_rl/reinforcement_learning/environment/__init__.py
|
Rozzerus/lua_snake_ml_rl
|
351f1675e728275a7ddd1c69cc1970d70a21f750
|
[
"Apache-2.0"
] | null | null | null |
snake_rl/reinforcement_learning/environment/__init__.py
|
Rozzerus/lua_snake_ml_rl
|
351f1675e728275a7ddd1c69cc1970d70a21f750
|
[
"Apache-2.0"
] | null | null | null |
snake_rl/reinforcement_learning/environment/__init__.py
|
Rozzerus/lua_snake_ml_rl
|
351f1675e728275a7ddd1c69cc1970d70a21f750
|
[
"Apache-2.0"
] | null | null | null |
from snake_rl.reinforcement_learning.environment.snake_environment import SnakeEnvironment
| 90
| 90
| 0.933333
| 10
| 90
| 8.1
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033333
| 90
| 1
| 90
| 90
| 0.931034
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a1a789a803a8f0a8ce7e3b5505060745bec1cbb0
| 208
|
py
|
Python
|
MovieRecommendationApp/web/admin.py
|
akash7301/MovieRecommendation
|
e4644591ebf12b9fc1360d4b693f486ea943b6b2
|
[
"Apache-2.0"
] | null | null | null |
MovieRecommendationApp/web/admin.py
|
akash7301/MovieRecommendation
|
e4644591ebf12b9fc1360d4b693f486ea943b6b2
|
[
"Apache-2.0"
] | null | null | null |
MovieRecommendationApp/web/admin.py
|
akash7301/MovieRecommendation
|
e4644591ebf12b9fc1360d4b693f486ea943b6b2
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from .models import Movie,Myrating,MovieBulkUpload
admin.site.register(Movie)
admin.site.register(Myrating)
admin.site.register(MovieBulkUpload)
# Register your models here.
| 26
| 50
| 0.831731
| 27
| 208
| 6.407407
| 0.481481
| 0.156069
| 0.294798
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081731
| 208
| 7
| 51
| 29.714286
| 0.905759
| 0.125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
a1c237b17330b8bad03bdbbe260a4838e2dad9e7
| 49
|
py
|
Python
|
notebooks/simple.py
|
minodes/nbpymd
|
d0da4ebe651ae310997a8933f9edeecec2ae7b48
|
[
"MIT"
] | 180
|
2017-11-28T22:01:15.000Z
|
2019-03-10T09:43:11.000Z
|
notebooks/simple.py
|
minodes/nbpymd
|
d0da4ebe651ae310997a8933f9edeecec2ae7b48
|
[
"MIT"
] | 9
|
2017-12-08T15:57:50.000Z
|
2018-12-10T11:07:49.000Z
|
notebooks/simple.py
|
minodes/nbpymd
|
d0da4ebe651ae310997a8933f9edeecec2ae7b48
|
[
"MIT"
] | 6
|
2017-11-28T14:32:31.000Z
|
2018-12-10T10:54:31.000Z
|
# Contents of simple.py
def cells():
1 + 2
| 8.166667
| 23
| 0.571429
| 8
| 49
| 3.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0.306122
| 49
| 5
| 24
| 9.8
| 0.764706
| 0.428571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 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
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a1d05c061494f4a416acf406cbd4049a3a4495a5
| 115
|
py
|
Python
|
L1TriggerConfig/DTTPGConfigProducers/python/L1DTTPGConfigFromDB_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 852
|
2015-01-11T21:03:51.000Z
|
2022-03-25T21:14:00.000Z
|
L1TriggerConfig/DTTPGConfigProducers/python/L1DTTPGConfigFromDB_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 30,371
|
2015-01-02T00:14:40.000Z
|
2022-03-31T23:26:05.000Z
|
L1TriggerConfig/DTTPGConfigProducers/python/L1DTTPGConfigFromDB_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 3,240
|
2015-01-02T05:53:18.000Z
|
2022-03-31T17:24:21.000Z
|
import FWCore.ParameterSet.Config as cms
from L1TriggerConfig.DTTPGConfigProducers.L1DTConfigFromDB_cfi import *
| 23
| 71
| 0.869565
| 12
| 115
| 8.25
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019048
| 0.086957
| 115
| 4
| 72
| 28.75
| 0.92381
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a1e36330469182a81bb29f71293b07a36988fea9
| 89
|
py
|
Python
|
toontown/pets/PetDCImportsAI.py
|
TheFamiliarScoot/open-toontown
|
678313033174ea7d08e5c2823bd7b473701ff547
|
[
"BSD-3-Clause"
] | 99
|
2019-11-02T22:25:00.000Z
|
2022-02-03T03:48:00.000Z
|
toontown/pets/PetDCImportsAI.py
|
TheFamiliarScoot/open-toontown
|
678313033174ea7d08e5c2823bd7b473701ff547
|
[
"BSD-3-Clause"
] | 42
|
2019-11-03T05:31:08.000Z
|
2022-03-16T22:50:32.000Z
|
toontown/pets/PetDCImportsAI.py
|
TheFamiliarScoot/open-toontown
|
678313033174ea7d08e5c2823bd7b473701ff547
|
[
"BSD-3-Clause"
] | 57
|
2019-11-03T07:47:37.000Z
|
2022-03-22T00:41:49.000Z
|
if hasattr(simbase, 'wantPets') and simbase.wantPets:
from . import DistributedPetAI
| 29.666667
| 53
| 0.764045
| 10
| 89
| 6.8
| 0.8
| 0.441176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146067
| 89
| 2
| 54
| 44.5
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0.089888
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
a1e7dc6b244b7178455759824143f43307b848e2
| 1,211
|
py
|
Python
|
Lib/site-packages/tensorflow/_api/v2/distribute/experimental/__init__.py
|
xorb813/Text-Mining
|
3dced9dd06fc9334d631ddf608b2ed96c2493276
|
[
"CNRI-Python-GPL-Compatible"
] | 1
|
2021-05-24T10:08:51.000Z
|
2021-05-24T10:08:51.000Z
|
Lib/site-packages/tensorflow/_api/v2/distribute/experimental/__init__.py
|
xorb813/Text-Mining
|
3dced9dd06fc9334d631ddf608b2ed96c2493276
|
[
"CNRI-Python-GPL-Compatible"
] | null | null | null |
Lib/site-packages/tensorflow/_api/v2/distribute/experimental/__init__.py
|
xorb813/Text-Mining
|
3dced9dd06fc9334d631ddf608b2ed96c2493276
|
[
"CNRI-Python-GPL-Compatible"
] | null | null | null |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Public API for tf.distribute.experimental namespace.
"""
from __future__ import print_function as _print_function
import sys as _sys
from . import coordinator
from . import partitioners
from tensorflow.python.distribute.central_storage_strategy import CentralStorageStrategy
from tensorflow.python.distribute.collective_all_reduce_strategy import _CollectiveAllReduceStrategyExperimental as MultiWorkerMirroredStrategy
from tensorflow.python.distribute.collective_util import CommunicationImplementation
from tensorflow.python.distribute.collective_util import CommunicationImplementation as CollectiveCommunication
from tensorflow.python.distribute.collective_util import Hints as CollectiveHints
from tensorflow.python.distribute.collective_util import _OptionsExported as CommunicationOptions
from tensorflow.python.distribute.distribute_lib import ValueContext
from tensorflow.python.distribute.parameter_server_strategy_v2 import ParameterServerStrategyV2 as ParameterServerStrategy
from tensorflow.python.distribute.tpu_strategy import TPUStrategy
del _print_function
| 52.652174
| 143
| 0.884393
| 135
| 1,211
| 7.725926
| 0.42963
| 0.153404
| 0.172579
| 0.258869
| 0.281879
| 0.243528
| 0.243528
| 0.147651
| 0
| 0
| 0
| 0.001784
| 0.074319
| 1,211
| 22
| 144
| 55.045455
| 0.928635
| 0.147812
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.928571
| 0
| 0.928571
| 0.142857
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
b806f2cdaf74c464176e8690f8724e113b55a5d3
| 114
|
py
|
Python
|
cyder/cydns/mx/urls.py
|
drkitty/cyder
|
1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8
|
[
"BSD-3-Clause"
] | 6
|
2015-04-16T23:18:22.000Z
|
2020-08-25T22:50:13.000Z
|
cyder/cydns/mx/urls.py
|
drkitty/cyder
|
1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8
|
[
"BSD-3-Clause"
] | 267
|
2015-01-01T00:18:57.000Z
|
2015-10-14T00:01:13.000Z
|
cyder/cydns/mx/urls.py
|
drkitty/cyder
|
1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8
|
[
"BSD-3-Clause"
] | 5
|
2015-03-23T00:57:09.000Z
|
2019-09-09T22:42:37.000Z
|
from django.conf.urls.defaults import *
from cyder.cydns.urls import cydns_urls
urlpatterns = cydns_urls('mx')
| 16.285714
| 39
| 0.780702
| 17
| 114
| 5.117647
| 0.588235
| 0.310345
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122807
| 114
| 6
| 40
| 19
| 0.87
| 0
| 0
| 0
| 0
| 0
| 0.017544
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
b8080a5098f043e6c1139057bd9a6cea2e45d102
| 13,758
|
py
|
Python
|
data/imagenetloader.py
|
JosephKJ/NCL
|
e40bcbb6caf0f02764f46c1abc1e9597b6c96103
|
[
"Apache-2.0"
] | null | null | null |
data/imagenetloader.py
|
JosephKJ/NCL
|
e40bcbb6caf0f02764f46c1abc1e9597b6c96103
|
[
"Apache-2.0"
] | null | null | null |
data/imagenetloader.py
|
JosephKJ/NCL
|
e40bcbb6caf0f02764f46c1abc1e9597b6c96103
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import print_function
from PIL import Image
import os
import os.path
import numpy as np
import sys
if sys.version_info[0] == 2:
import cPickle as pickle
else:
import pickle
import torch.backends.cudnn as cudnn
import random
import torch.utils.data as data
import torch
import torchvision
import torchvision.transforms as transforms
from torch.utils.data.dataloader import default_collate, DataLoader
from .utils import TransformTwice, TransformKtimes, RandomTranslateWithReflect, TwoStreamBatchSampler
from .concat import ConcatDataset
def find_classes_from_folder(dir):
classes = [d for d in os.listdir(dir) if os.path.isdir(os.path.join(dir, d))]
classes.sort()
class_to_idx = {classes[i]: i for i in range(len(classes))}
return classes, class_to_idx
def find_classes_from_file(file_path):
with open(file_path) as f:
classes = f.readlines()
classes = [x.strip() for x in classes]
classes.sort()
class_to_idx = {classes[i]: i for i in range(len(classes))}
return classes, class_to_idx
def make_dataset(dir, classes, class_to_idx):
samples = []
for target in classes:
d = os.path.join(dir, target)
# print('Looking for files in {}'.format(d))
if not os.path.isdir(d):
continue
for root, _, fnames in sorted(os.walk(d)):
for fname in sorted(fnames):
path = os.path.join(root, fname)
item = (path, class_to_idx[target])
if 'JPEG' in path or 'jpg' in path:
samples.append(item)
return samples
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',
]
def pil_loader(path):
return Image.open(path).convert('RGB')
class ImageFolder(data.Dataset):
def __init__(self, transform=None, target_transform=None, samples=None, loader=pil_loader):
if len(samples) == 0:
raise(RuntimeError("Found 0 images in subfolders \n"
"Supported image extensions are: " + ",".join(IMG_EXTENSIONS)))
self.samples=samples
self.transform = transform
self.target_transform = target_transform
self.loader = loader
def __getitem__(self, index):
path = self.samples[index][0]
target = self.samples[index][1]
img = self.loader(path)
if self.transform is not None:
img = self.transform(img)
if self.target_transform is not None:
target = self.target_transform(target)
return img, target, index
def __len__(self):
return len(self.samples)
def ImageNet882(aug=None, subfolder='train', path='./data/datasets/ImageNet/'):
img_split = 'images/'+subfolder
classes_118, class_to_idx_118 = find_classes_from_file(os.path.join(path, 'imagenet_rand118/imagenet_118.txt'))
samples_118 = make_dataset(path+img_split, classes_118, class_to_idx_118)
classes_1000, _ = find_classes_from_folder(os.path.join(path, img_split))
classes_882 = list(set(classes_1000) - set(classes_118))
class_to_idx_882 = {classes_882[i]: i for i in range(len(classes_882))}
samples_882 = make_dataset(path+img_split, classes_882, class_to_idx_882)
if aug==None:
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
if aug=='none_pre':
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
# transforms.ToTensor(),
# transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
elif aug=='once':
transform = transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
elif aug=='once_pre':
transform = transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
# transforms.ToTensor(),
# transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
elif aug=='twice':
transform = TransformTwice(transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
]))
elif aug=='twice_pre':
transform = TransformTwice(transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
# transforms.ToTensor(),
# transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
]))
elif aug=='ktimes':
transform = TransformKtimes(transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
]), k=10)
dataset = ImageFolder(transform=transform, samples=samples_882)
return dataset
def ImageNet30(path='./data/datasets/ImageNet/', subset='A', aug=None, subfolder='train'):
classes_30, class_to_idx_30 = find_classes_from_file(os.path.join(path, 'imagenet_rand118/imagenet_30_{}.txt'.format(subset)))
samples_30 = make_dataset(path+'images/{}'.format(subfolder), classes_30, class_to_idx_30)
if aug==None:
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
elif aug=='none_pre':
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
# transforms.ToTensor(),
])
elif aug=='once':
transform = transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
elif aug=='once_pre':
transform = transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
# transforms.ToTensor(),
# transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
elif aug=='twice':
transform = TransformTwice(transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
]))
elif aug=='twice_pre':
transform = TransformTwice(transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
# transforms.ToTensor(),
# transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
]))
elif aug=='ktimes':
transform = TransformKtimes(transforms.Compose([
transforms.RandomResizedCrop(224, scale=(0.5, 1.0)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
]), k=10)
dataset = ImageFolder(transform=transform, samples=samples_30)
return dataset
def ImageNetLoader30(batch_size, num_workers=2, path='./data/datasets/ImageNet/', subset='A', aug=None, shuffle=False, subfolder='train'):
dataset = ImageNet30(path, subset, aug, subfolder)
dataloader_30 = DataLoader(dataset, batch_size=batch_size, shuffle=shuffle, num_workers=num_workers, pin_memory=True)
return dataloader_30
def ImageNetLoader30_pre(batch_size, num_workers=2, path='./data/datasets/ImageNet/', subset='A', aug=None, shuffle=False, subfolder='train'):
dataset = ImageNet30(path, subset, aug, subfolder)
if shuffle:
# Shuffling is done for training. For training, use fast_collate2, and for testing use fast_collate
dataloader_30 = DataLoader(dataset, batch_size=batch_size, shuffle=shuffle, num_workers=num_workers, pin_memory=True, collate_fn=fast_collate2)
else:
dataloader_30 = DataLoader(dataset, batch_size=batch_size, shuffle=shuffle, num_workers=num_workers, pin_memory=True, collate_fn=fast_collate)
dataloader_30.labeled_length = 882
return dataloader_30
def ImageNetLoader882(batch_size, num_workers=2, path='./data/datasets/ImageNet/', aug=None, shuffle=False, subfolder='train'):
dataset = ImageNet882(aug=aug, subfolder=subfolder, path=path)
dataloader_882 = DataLoader(dataset, batch_size=batch_size, shuffle=shuffle, num_workers=num_workers, pin_memory=True)
dataloader_882.labeled_length = len(dataset)
return dataloader_882
def ImageNetLoader882_pre(batch_size, num_workers=2, path='./data/datasets/ImageNet/', aug=None, shuffle=False, subfolder='train'):
dataset = ImageNet882(aug=aug, subfolder=subfolder, path=path)
dataloader_882 = DataLoader(dataset, batch_size=batch_size, shuffle=shuffle, num_workers=num_workers, pin_memory=True, collate_fn=fast_collate2)
dataloader_882.labeled_length = len(dataset)
return dataloader_882
def ImageNetLoader882_30Mix(batch_size, num_workers=2, path='./data/datasets/ImageNet/', unlabeled_subset='A', aug=None, shuffle=False, subfolder='train', unlabeled_batch_size=64):
dataset_labeled = ImageNet882(aug=aug, subfolder=subfolder, path=path)
dataset_unlabeled = ImageNet30(path, unlabeled_subset, aug, subfolder)
dataset= ConcatDataset((dataset_labeled, dataset_unlabeled))
labeled_idxs = range(len(dataset_labeled))
unlabeled_idxs = range(len(dataset_labeled), len(dataset_labeled)+len(dataset_unlabeled))
batch_sampler = TwoStreamBatchSampler(labeled_idxs, unlabeled_idxs, batch_size, unlabeled_batch_size)
loader = data.DataLoader(dataset, batch_sampler=batch_sampler, num_workers=num_workers)
loader.labeled_length = len(dataset_labeled)
loader.unlabeled_length = len(dataset_unlabeled)
return loader
def ImageNetLoader882_30Mix_pre(batch_size, num_workers=2, path='./data/datasets/ImageNet/', unlabeled_subset='A', aug=None, shuffle=False, subfolder='train', unlabeled_batch_size=64):
dataset_labeled = ImageNet882(aug=aug, subfolder=subfolder, path=path)
dataset_unlabeled = ImageNet30(path, unlabeled_subset, aug, subfolder)
dataset= ConcatDataset((dataset_labeled, dataset_unlabeled))
labeled_idxs = range(len(dataset_labeled))
unlabeled_idxs = range(len(dataset_labeled), len(dataset_labeled)+len(dataset_unlabeled))
batch_sampler = TwoStreamBatchSampler(labeled_idxs, unlabeled_idxs, batch_size, unlabeled_batch_size)
loader = data.DataLoader(dataset, batch_sampler=batch_sampler, num_workers=num_workers, collate_fn=fast_collate2)
loader.labeled_length = len(dataset_labeled)
loader.unlabeled_length = len(dataset_unlabeled)
return loader
def fast_collate(batch):
imgs = [img[0] for img in batch]
targets = torch.tensor([target[1] for target in batch], dtype=torch.int64)
idxs = torch.tensor([idx[2] for idx in batch], dtype=torch.int64)
w = imgs[0].size[0]
h = imgs[0].size[1]
tensor = torch.zeros((len(imgs), 3, h, w), dtype=torch.uint8)
for i, img in enumerate(imgs):
nump_array = np.asarray(img, dtype=np.uint8)
tens = torch.from_numpy(nump_array)
if (nump_array.ndim < 3):
nump_array = np.expand_dims(nump_array, axis=-1)
nump_array = np.rollaxis(nump_array, 2)
tensor[i] += torch.from_numpy(nump_array)
return tensor, targets, idxs
def fast_collate2(batch):
targets = torch.tensor([target[1] for target in batch], dtype=torch.int64)
idxs = torch.tensor([idx[2] for idx in batch], dtype=torch.int64)
imgs = [img[0][0] for img in batch]
w = imgs[0].size[0]
h = imgs[0].size[1]
tensor = torch.zeros((len(imgs), 3, h, w), dtype=torch.uint8)
for i, img in enumerate(imgs):
nump_array = np.asarray(img, dtype=np.uint8)
tens = torch.from_numpy(nump_array)
if (nump_array.ndim < 3):
nump_array = np.expand_dims(nump_array, axis=-1)
nump_array = np.rollaxis(nump_array, 2)
tensor[i] += torch.from_numpy(nump_array)
imgs1 = [img[0][1] for img in batch]
w = imgs1[0].size[0]
h = imgs1[0].size[1]
tensor1 = torch.zeros((len(imgs1), 3, h, w), dtype=torch.uint8)
for i, img in enumerate(imgs1):
nump_array = np.asarray(img, dtype=np.uint8)
tens = torch.from_numpy(nump_array)
if (nump_array.ndim < 3):
nump_array = np.expand_dims(nump_array, axis=-1)
nump_array = np.rollaxis(nump_array, 2)
tensor1[i] += torch.from_numpy(nump_array)
return tensor, tensor1, targets, idxs
| 44.960784
| 185
| 0.650676
| 1,729
| 13,758
| 5.0214
| 0.115674
| 0.024879
| 0.043538
| 0.055402
| 0.740382
| 0.730938
| 0.714697
| 0.714697
| 0.702142
| 0.702142
| 0
| 0.059566
| 0.222707
| 13,758
| 305
| 186
| 45.108197
| 0.752291
| 0.047827
| 0
| 0.589844
| 0
| 0
| 0.040119
| 0.02048
| 0
| 0
| 0
| 0
| 0
| 1
| 0.066406
| false
| 0
| 0.066406
| 0.007813
| 0.199219
| 0.003906
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b815a26bf853b7e184acd0f987dc34c9c666f316
| 16
|
bzl
|
Python
|
version.bzl
|
UebelAnon/rules_rust
|
51c447857250b308a52f42304ce6ba063ee40329
|
[
"Apache-2.0"
] | null | null | null |
version.bzl
|
UebelAnon/rules_rust
|
51c447857250b308a52f42304ce6ba063ee40329
|
[
"Apache-2.0"
] | null | null | null |
version.bzl
|
UebelAnon/rules_rust
|
51c447857250b308a52f42304ce6ba063ee40329
|
[
"Apache-2.0"
] | null | null | null |
VERSION = 0.9.0
| 8
| 15
| 0.625
| 4
| 16
| 2.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.230769
| 0.1875
| 16
| 1
| 16
| 16
| 0.538462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b816c7a67c1fcc38d333f31043dd04ab95ad0a13
| 27
|
py
|
Python
|
Activities/running_activity.py
|
lvraikkonen/DailySportsTracker
|
e60a1fc4ff33895676b8abaf6a758aca78870909
|
[
"Apache-2.0"
] | null | null | null |
Activities/running_activity.py
|
lvraikkonen/DailySportsTracker
|
e60a1fc4ff33895676b8abaf6a758aca78870909
|
[
"Apache-2.0"
] | null | null | null |
Activities/running_activity.py
|
lvraikkonen/DailySportsTracker
|
e60a1fc4ff33895676b8abaf6a758aca78870909
|
[
"Apache-2.0"
] | null | null | null |
# Parse running activities
| 13.5
| 26
| 0.814815
| 3
| 27
| 7.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 27
| 1
| 27
| 27
| 0.956522
| 0.888889
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
629a33dad94b74044a1561f0363c41497213d7fb
| 135
|
py
|
Python
|
pyActionRec/__init__.py
|
Tikquuss/anet2016-cuhk
|
a742e1686fbeef8e35b7d792542f3b89aa46fa24
|
[
"BSD-2-Clause"
] | 1
|
2020-10-28T08:24:17.000Z
|
2020-10-28T08:24:17.000Z
|
pyActionRec/__init__.py
|
Tikquuss/anet2016-cuhk
|
a742e1686fbeef8e35b7d792542f3b89aa46fa24
|
[
"BSD-2-Clause"
] | null | null | null |
pyActionRec/__init__.py
|
Tikquuss/anet2016-cuhk
|
a742e1686fbeef8e35b7d792542f3b89aa46fa24
|
[
"BSD-2-Clause"
] | null | null | null |
import os
import sys
sys.path.append(os.path.join(os.environ['ANET_HOME'], "pyActionRec"))
from config import ANET_CFG
import anet_db
| 19.285714
| 69
| 0.785185
| 23
| 135
| 4.478261
| 0.608696
| 0.194175
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096296
| 135
| 7
| 70
| 19.285714
| 0.844262
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.8
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
62a7ec6214d2f5da19bff09f4f69636ffea37435
| 3,422
|
py
|
Python
|
mongoconnector.py
|
alexbredo/site-packages
|
cd104ad21c00acc6984e26e35031fda8f4e93fc0
|
[
"BSD-2-Clause"
] | null | null | null |
mongoconnector.py
|
alexbredo/site-packages
|
cd104ad21c00acc6984e26e35031fda8f4e93fc0
|
[
"BSD-2-Clause"
] | 1
|
2021-03-24T17:24:17.000Z
|
2021-03-24T17:24:17.000Z
|
mongoconnector.py
|
alexbredo/site-packages
|
cd104ad21c00acc6984e26e35031fda8f4e93fc0
|
[
"BSD-2-Clause"
] | null | null | null |
# Copyright (c) 2014 Alexander Bredo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# -*- coding: utf-8 -*-
from pymongo import MongoClient
class MongoConnector(object):
def __init__(self, host, port, database, collection, username=None, password=None):
self.__client = MongoClient(host, port)
self.__db = self.__client['alarm-center']
if username and password:
self.__db.authenticate(username, password)
self.__collection = self.__db[collection]
def count(self):
return self.getCollection().count()
def getCollection(self):
return self.__collection
def find(self, condition):
return self.getCollection().find(condition)
# Group+Count with Map-Reduce
def getGroupedCollection(self, field, condition={}):
return self.getCollection().group({field:1}, condition, {"count": 0}, 'function(obj, prev){prev.count++}')
def getGroupedCollectionCount(self, field, condition={}):
return len(self.getGroupedCollection(field, condition))
def CountByField(field, value):
return self.find({field: re.compile(value, re.IGNORECASE)}).count()
def insert(self, service, timestamp, ip, port, type, command, successful, session):
data = dict(service=service, timestamp=timestamp, ip=ip, port=port, type=type, command=command, successful=successful, session=session)
return self.getCollection().insert(data)
# TODO:
# Range Zeit. 1 Tag. Nach 30 Tagen Inhalte löschen
# THRESHOLD PER HOST/SVC
# def getFieldMaxValue(self, field):
# return self.getCollection().find_one(cond={"session": ses['session']},sort=[("timestamp", -1)])['timestamp']
# def getFieldMinValue(self, field):
# return self.getCollection().find_one(sort=[(field, 1)])[field]
#for ses in self.getGroupedCollection('session'):
# print ses['session']
# print ses['count']
# print "lmax %s" % events.find({"session": ses['session']}).sort([("timestamp", -1)]).limit(1)[0]['timestamp']
# print "lmin %s" % events.find({"session": ses['session']}).sort([("timestamp", 1)]).limit(1)[0]['timestamp']
| 42.775
| 143
| 0.708358
| 431
| 3,422
| 5.577726
| 0.436195
| 0.033278
| 0.057404
| 0.033694
| 0.170133
| 0.150166
| 0.137271
| 0.104825
| 0.104825
| 0.104825
| 0
| 0.00709
| 0.175628
| 3,422
| 80
| 144
| 42.775
| 0.84509
| 0.59059
| 0
| 0
| 0
| 0
| 0.036846
| 0
| 0
| 0
| 0
| 0.0125
| 0
| 1
| 0.347826
| false
| 0.130435
| 0.043478
| 0.26087
| 0.73913
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 5
|
62c76d27700df34b85869e7a0bcbaa45cfae238c
| 223
|
py
|
Python
|
tests/test_preparation.py
|
satishukadam/regression
|
a135bf99411fc22ab71297727e4542cb505b4bcf
|
[
"MIT"
] | null | null | null |
tests/test_preparation.py
|
satishukadam/regression
|
a135bf99411fc22ab71297727e4542cb505b4bcf
|
[
"MIT"
] | 7
|
2019-11-07T15:11:32.000Z
|
2019-11-07T15:11:41.000Z
|
tests/test_preparation.py
|
satishukadam/regression
|
a135bf99411fc22ab71297727e4542cb505b4bcf
|
[
"MIT"
] | null | null | null |
from configs import config
from regression.preparation import load_dataset, get_features
def test_preparation_get_features():
assert get_features(load_dataset())[0] == config.NUMERICAL_FEATURES, 'test successful'
| 20.272727
| 90
| 0.802691
| 28
| 223
| 6.107143
| 0.571429
| 0.192982
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005102
| 0.121076
| 223
| 10
| 91
| 22.3
| 0.867347
| 0
| 0
| 0
| 0
| 0
| 0.068493
| 0
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0.25
| true
| 0
| 0.5
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
62d6d1b2a9cee9b1bce12c5b35819974a5fc3287
| 247
|
py
|
Python
|
mediapanel/config/__init__.py
|
mediapanel/util
|
0af19d13c1cc9dc32608ee61cb2e8471352c7a64
|
[
"MIT"
] | null | null | null |
mediapanel/config/__init__.py
|
mediapanel/util
|
0af19d13c1cc9dc32608ee61cb2e8471352c7a64
|
[
"MIT"
] | 1
|
2020-04-03T13:20:06.000Z
|
2020-04-03T13:20:06.000Z
|
mediapanel/config/__init__.py
|
mediapanel/util
|
0af19d13c1cc9dc32608ee61cb2e8471352c7a64
|
[
"MIT"
] | null | null | null |
# flake8: noqa
"""
Container module for mediaPanel configuration classes.
"""
from .general import GeneralConfig
from .layout import LayoutConfig
from .events import EventsConfig
from .ads import AdsConfig, AdsVerticalConfig, AdsHorizontalConfig
| 24.7
| 66
| 0.817814
| 26
| 247
| 7.769231
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004608
| 0.121457
| 247
| 9
| 67
| 27.444444
| 0.926267
| 0.275304
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
62f8f53a51de9575954b7cdd0ee0cede6d963e00
| 46
|
py
|
Python
|
python/testData/inspections/RedundantParenthesesMore_after.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/inspections/RedundantParenthesesMore_after.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/inspections/RedundantParenthesesMore_after.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
while (close_hr - current_hr_it) >= .5:
pass
| 23
| 39
| 0.673913
| 8
| 46
| 3.5
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026316
| 0.173913
| 46
| 2
| 40
| 23
| 0.710526
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
a7facf6fcf70309251757e3fb90b89255e13133f
| 91
|
py
|
Python
|
webdriver/tests/element_send_keys/__init__.py
|
ziransun/wpt
|
ab8f451eb39eb198584d547f5d965ef54df2a86a
|
[
"BSD-3-Clause"
] | 14,668
|
2015-01-01T01:57:10.000Z
|
2022-03-31T23:33:32.000Z
|
webdriver/tests/element_send_keys/__init__.py
|
ziransun/wpt
|
ab8f451eb39eb198584d547f5d965ef54df2a86a
|
[
"BSD-3-Clause"
] | 7,642
|
2018-05-28T09:38:03.000Z
|
2022-03-31T20:55:48.000Z
|
webdriver/tests/element_send_keys/__init__.py
|
ziransun/wpt
|
ab8f451eb39eb198584d547f5d965ef54df2a86a
|
[
"BSD-3-Clause"
] | 5,941
|
2015-01-02T11:32:21.000Z
|
2022-03-31T16:35:46.000Z
|
def map_files_to_multiline_text(files):
return "\n".join(map(lambda f: str(f), files))
| 30.333333
| 50
| 0.714286
| 16
| 91
| 3.8125
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.120879
| 91
| 2
| 51
| 45.5
| 0.7625
| 0
| 0
| 0
| 0
| 0
| 0.021978
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
c5037fc3e0944189908a673a983c831434930b27
| 91
|
py
|
Python
|
payment/views.py
|
rblcoder/backend-cetak
|
0009ed2e535cbeb17da9cdd057b91b6faac3f7bf
|
[
"BSD-3-Clause"
] | null | null | null |
payment/views.py
|
rblcoder/backend-cetak
|
0009ed2e535cbeb17da9cdd057b91b6faac3f7bf
|
[
"BSD-3-Clause"
] | null | null | null |
payment/views.py
|
rblcoder/backend-cetak
|
0009ed2e535cbeb17da9cdd057b91b6faac3f7bf
|
[
"BSD-3-Clause"
] | null | null | null |
import datetime
import json
from django.shortcuts import render
# Create your views here.
| 15.166667
| 35
| 0.813187
| 13
| 91
| 5.692308
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 91
| 5
| 36
| 18.2
| 0.961039
| 0.252747
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c507651e2c22909a70ba070b0a8f15a2d227aeef
| 171
|
py
|
Python
|
yletunnus/urls.py
|
seitztimo/tunnistamo
|
666601489d38ab168f9a2e2020f7441c233282a9
|
[
"MIT"
] | 8
|
2018-11-13T06:05:07.000Z
|
2021-09-18T22:01:52.000Z
|
yletunnus/urls.py
|
seitztimo/tunnistamo
|
666601489d38ab168f9a2e2020f7441c233282a9
|
[
"MIT"
] | 185
|
2017-06-08T12:48:47.000Z
|
2022-03-22T08:26:36.000Z
|
yletunnus/urls.py
|
seitztimo/tunnistamo
|
666601489d38ab168f9a2e2020f7441c233282a9
|
[
"MIT"
] | 19
|
2017-06-08T13:02:37.000Z
|
2021-02-15T13:10:35.000Z
|
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import YleTunnusProvider
urlpatterns = default_urlpatterns(YleTunnusProvider)
| 28.5
| 75
| 0.877193
| 17
| 171
| 8.705882
| 0.647059
| 0.243243
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006329
| 0.076023
| 171
| 5
| 76
| 34.2
| 0.93038
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c51bcb9f012ad6a3aef5cec29157950a86aedf62
| 156
|
py
|
Python
|
tests/test_fbro.py
|
MartinThoma/fbro
|
9febbad4bcc1d568310bff51779e46100d9f6b95
|
[
"MIT"
] | null | null | null |
tests/test_fbro.py
|
MartinThoma/fbro
|
9febbad4bcc1d568310bff51779e46100d9f6b95
|
[
"MIT"
] | 1
|
2020-04-18T21:07:49.000Z
|
2020-04-18T21:07:49.000Z
|
tests/test_fbro.py
|
MartinThoma/fbro
|
9febbad4bcc1d568310bff51779e46100d9f6b95
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
"""Tests for `fbro` package."""
# First party modules
import fbro
def test_version():
assert fbro.__version__.count(".") == 2
| 14.181818
| 43
| 0.660256
| 21
| 156
| 4.666667
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007692
| 0.166667
| 156
| 10
| 44
| 15.6
| 0.746154
| 0.423077
| 0
| 0
| 0
| 0
| 0.012048
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
3d7291fcaba604d16edfd3e436f9ec703d902931
| 8,198
|
py
|
Python
|
tests/mega/match/values/collection_test.py
|
felipead/sqs-mega-python
|
82da3b1650a891336c13c80648edda3d3d2967de
|
[
"MIT"
] | null | null | null |
tests/mega/match/values/collection_test.py
|
felipead/sqs-mega-python
|
82da3b1650a891336c13c80648edda3d3d2967de
|
[
"MIT"
] | 1
|
2020-05-19T18:57:05.000Z
|
2020-05-19T18:57:05.000Z
|
tests/mega/match/values/collection_test.py
|
mega-distributed/sqs-mega-python
|
82da3b1650a891336c13c80648edda3d3d2967de
|
[
"MIT"
] | null | null | null |
import pytest
from parameterized import parameterized
from mega.match.functions import eq, gt, not_, match, one_of, gte, and_, lt
from mega.match.values import Collection
from mega.match.values.value import RightHandSideTypeError, LeftHandSideTypeError
def test_empty_collection_rhs_is_equal_to_none_lhs():
assert Collection([]).equal(None) is True
def test_empty_collection_rhs_matches_none_lhs():
assert Collection([]).match(None) is True
def test_non_empty_collection_rhs_is_not_equal_to_none_lhs():
assert Collection([1, 2, 3]).equal(None) is False
def test_non_empty_collection_rhs_does_not_match_none_lhs():
assert Collection([1, 2, 3]).match(None) is False
@parameterized.expand([
[[1], [1]],
[['a'], ['a']],
[[None], [None]],
[[1, 2, 3], (1, 2, 3)],
[[1, 2, 3], [1, 2, 3]],
[[1, 2, 3], {1, 2, 3}],
[[1, 2, 3], [3, 2, 1]],
[[1, 2, 3], [eq(2), 3, 1]],
[[1, 2, 3], [3, gt(1), not_(5)]],
[['999', '998', '997'], [997, 998, 999]],
[['foo', 'bar'], ['bar', one_of('foo', 'FOO', 'Foo', '_foo_')]],
[['foo', 'bar', 'barz'], ['bar', match(r'bar[zZ]'), eq('foo')]],
[['Raphael', 'Leonardo', 'Donatello', 'Venus de Milo', 'Michelangelo'],
['Leonardo', match(r'[Dd]onatel.*'), 'Raphael', 'Michelangelo', match(r'Venus [Dd]e Milo')]]
])
def test_collection_rhs_is_equal_to_collection_lhs(lhs, rhs):
assert Collection(rhs).equal(lhs) is True
@parameterized.expand([
[[], ['a', 'b', 'c']],
[['five'], []],
[[1], [2]],
[['a'], ['D']],
[[None], ['foo', 'bar']],
[[1, 2, 3], (1, 2, 3, 4)],
[[1, 2, 3], [3, 5, 1]],
[['foo', 'bar'], ['bar']],
[['foo', 'bar'], ['foo', 'BAR']],
[['foo', 'bar'], ['bar', not_(one_of('foo', 'FOO', 'Foo', '_foo_'))]],
[['Raphael', 'Leonardo', 'DANTE', 'Venus de Milo', 'Michelangelo'],
['Leonardo', match(r'[Dd]onatel.*'), 'Raphael', 'Michelangelo', match(r'Venus [Dd]e Milo')]],
])
def test_collection_rhs_is_not_equal_to_collection_lhs(lhs, rhs):
assert Collection(rhs).equal(lhs) is False
@parameterized.expand([
[[1, 2, 3], [1, 2, 3]],
[['a', 'b', 'c'], ['c', 'b', 'a']],
[[1, 2, 3, 4, 5], [3, 4, gte(5)]],
[['bar', 'foo', 'barz'], ['foo', 'bar']],
[['foo', 'bar'], ['bar', one_of('foo', 'FOO', 'Foo', '_foo_')]],
[['foo', 'bar', 'barz'], ['bar', match(r'bar[zZ]'), eq('foo')]],
[['Raphael', 'Leonardo', 'Donatello', 'Venus de Milo', 'Michelangelo'],
[match(r'[Dd]onatel.*'), 'Michelangelo']]
])
def test_collection_rhs_matches_collection_lhs(lhs, rhs):
assert Collection(rhs).match(lhs) is True
@parameterized.expand([
[[1, 2, 3], [1, 2, 3, 4]],
[['a', 'b', 'c'], ['c', 'd', 'a']],
[[1, 2, 3, 4, 5], [3, 4, gt(5)]],
[['bar', 'foo', 'barz'], ['foo', 'BAR']],
[['foo'], ['bar', one_of('foo', 'FOO', 'Foo', '_foo_')]],
[['bar', 'barz'], ['bar', match(r'bar[zZ]'), eq('foo')]],
[['Raphael', 'Leonardo', 'Donatello', 'Venus de Milo', 'Michelangelo'], ['Dante', 'Michelangelo']]
])
def test_collection_rhs_does_not_match_collection_lhs(lhs, rhs):
assert Collection(rhs).match(lhs) is False
@parameterized.expand([
[1, [1, 2, 3]],
['bar', ['foo', match(r'[Bb]ar.*'), 'barz']],
])
def test_collection_rhs_matches_scalar_lhs(lhs, rhs):
assert Collection(rhs).match(lhs) is True
@parameterized.expand([
[None, [5]],
[42, [1, 2, 3]],
['FooBar', ['foo', match(r'[Bb]ar.*'), 'barz']],
])
def test_collection_rhs_does_not_match_scalar_lhs(lhs, rhs):
assert Collection(rhs).match(lhs) is False
@parameterized.expand([
[None, [None]],
['a', ['b', 'c', 'a']],
[1, [1, 2, gt(3)]],
['bar', ['foo', match(r'[Bb]ar.*'), 'barz']],
])
def test_collection_rhs_contains_scalar_lhs(lhs, rhs):
assert Collection(rhs).contains(lhs) is True
@parameterized.expand([
[None, [42]],
['foobar', ['b', 'c', 'a']],
[1000000, [1, 2, and_(gte(3), lt(100))]],
['BAR', ['foo', match(r'[Bb]ar.*'), 'barz']],
])
def test_collection_rhs_does_not_contain_scalar_lhs(lhs, rhs):
assert Collection(rhs).contains(lhs) is False
@parameterized.expand([
[None],
[''],
['2020-05-15#!'],
[True],
[1999],
[object()],
[{'foo': 'bar'}]
])
def test_collection_does_not_accept_invalid_rhs(rhs):
with pytest.raises(RightHandSideTypeError) as e:
Collection(rhs)
assert '[Collection] Invalid right-hand side <{}>'.format(type(rhs).__name__) in str(e.value)
@parameterized.expand([
[0, []],
[1, [1]],
['a', ['a', 'b', 'c']],
[1, ['a', 'b', 'c']],
[True, [True, False]]
])
def test_collection_equal_does_not_accept_scalar_lhs(lhs, rhs):
with pytest.raises(LeftHandSideTypeError) as e:
Collection(rhs).equal(lhs)
assert '[Collection.equal] Could not apply left-hand side <{}>'.format(type(lhs).__name__) in str(e.value)
@parameterized.expand([
[object(), [1, 2, 3]],
[{'foo': 'bar'}, ['foo', 'bar']],
])
def test_collection_equal_does_not_accept_invalid_lhs(lhs, rhs):
with pytest.raises(LeftHandSideTypeError) as e:
Collection(rhs).equal(lhs)
assert '[Collection.equal] Could not apply left-hand side <{}>'.format(type(lhs).__name__) in str(e.value)
@parameterized.expand([
[[1, 'a', 3], ['a', lt(5), 'b']],
[[1, 2, 3], ['a', 'b']],
[[True], ['a', 'b', 'c']],
[['Raphael', 'Leonardo', 'Donatello', 42, 'Venus de Milo', 'Michelangelo'],
['Leonardo', match(r'[Dd]onatel.*'), 'Raphael', 'Michelangelo', match(r'Venus [Dd]e Milo')]]
])
def test_collection_equal_does_not_accept_collection_lhs_with_incompatible_types(lhs, rhs):
with pytest.raises(LeftHandSideTypeError) as e:
Collection(rhs).equal(lhs)
assert (
'[Collection.equal] Could not apply left-hand side <list> ([…]) to right-hand side <list> ([…]). '
'Collections have incompatible types.' in str(e.value)
)
@parameterized.expand([
[object(), [1, 2, 3]],
[{'foo': 'bar'}, ['foo', 'bar']],
])
def test_collection_match_does_not_accept_invalid_lhs(lhs, rhs):
with pytest.raises(LeftHandSideTypeError) as e:
Collection(rhs).match(lhs)
assert '[Collection.match] Could not apply left-hand side <{}>'.format(type(lhs).__name__) in str(e.value)
@parameterized.expand([
[[1, 'a', 3], ['a', lt(5), 'b']],
[['Raphael', 'Leonardo', 'Donatello', 42, 'Venus de Milo', 'Michelangelo'],
['Leonardo', match(r'[Dd]onatel.*'), 'Raphael', 'Michelangelo', match(r'Venus [Dd]e Milo')]]
])
def test_collection_match_does_not_accept_collection_lhs_with_incompatible_types(lhs, rhs):
with pytest.raises(LeftHandSideTypeError) as e:
Collection(rhs).match(lhs)
assert '[Collection.match] Could not apply left-hand side' in str(e.value)
assert 'Collections have incompatible types.' in str(e.value)
@parameterized.expand([
[5, ['a', eq(5), 'b']],
[True, ['a', 'b']],
['one', [1, 2, 3]]
])
def test_collection_match_does_not_accept_scalar_lhs_with_incompatible_types(lhs, rhs):
with pytest.raises(LeftHandSideTypeError) as e:
Collection(rhs).match(lhs)
assert '[Collection.match] Could not apply left-hand side' in str(e.value)
assert 'Left-hand side is not compatible with collection type.' in str(e.value)
@parameterized.expand([
['foo', [1, 2, 3]],
[42, ['a', match('[Bb].*'), 'c']],
[['foo'], ['foo', 'bar']],
[[1, 2, 3], [1, 2, 3, 4, 5, 6]],
[{'foo': 'bar'}, ['foo', 'bar']],
])
def test_collection_contains_does_not_accept_invalid_lhs(lhs, rhs):
with pytest.raises(LeftHandSideTypeError) as e:
Collection(rhs).contains(lhs)
assert '[Collection.contains] Could not apply left-hand side <{}>'.format(type(lhs).__name__) in str(e.value)
@parameterized.expand([
[5, ['a', eq(5), 'b']],
[True, ['a', 'b']],
['one', [1, 2, 3]]
])
def test_collection_contains_does_not_accept_scalar_lhs_with_incompatible_types(lhs, rhs):
with pytest.raises(LeftHandSideTypeError) as e:
Collection(rhs).contains(lhs)
assert '[Collection.contains] Could not apply left-hand side' in str(e.value)
assert 'Left-hand side is not compatible with collection type.' in str(e.value)
| 32.275591
| 113
| 0.599414
| 1,135
| 8,198
| 4.162115
| 0.09163
| 0.013971
| 0.019052
| 0.027942
| 0.849492
| 0.801651
| 0.751905
| 0.702371
| 0.683954
| 0.67845
| 0
| 0.028534
| 0.170651
| 8,198
| 253
| 114
| 32.403162
| 0.665392
| 0
| 0
| 0.453608
| 0
| 0.005155
| 0.204562
| 0.005123
| 0
| 0
| 0
| 0
| 0.123711
| 1
| 0.108247
| false
| 0
| 0.025773
| 0
| 0.134021
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
3db48b89909d178d815485774a2ecde8aaa808f2
| 47
|
py
|
Python
|
Chapter 07/Chap07_Example7.47.py
|
Anancha/Programming-Techniques-using-Python
|
e80c329d2a27383909d358741a5cab03cb22fd8b
|
[
"MIT"
] | null | null | null |
Chapter 07/Chap07_Example7.47.py
|
Anancha/Programming-Techniques-using-Python
|
e80c329d2a27383909d358741a5cab03cb22fd8b
|
[
"MIT"
] | null | null | null |
Chapter 07/Chap07_Example7.47.py
|
Anancha/Programming-Techniques-using-Python
|
e80c329d2a27383909d358741a5cab03cb22fd8b
|
[
"MIT"
] | null | null | null |
myl1 = [1,2,3,4,5]
myl3 = myl1 + 6
print(myl3)
| 11.75
| 18
| 0.574468
| 11
| 47
| 2.454545
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.263158
| 0.191489
| 47
| 3
| 19
| 15.666667
| 0.447368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
3dc436a480afb8182719b946a9f1a7c1ac58b311
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/poetry/console/commands/update.py
|
Retraces/UkraineBot
|
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/poetry/console/commands/update.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/poetry/console/commands/update.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/71/fb/dc/ddd9d4c4d76c4a0959ece9968a38e3b0429b9b6157ec9afb70da86d584
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.375
| 0
| 96
| 1
| 96
| 96
| 0.520833
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
3de1b371fc3dcbab0273952dd2c24bcf8a77e5c9
| 324
|
py
|
Python
|
Python/empire/system/processes/process_util.py
|
Tombmyst/Empire
|
f28782787c5fa9127e353549b73ec90d3c82c003
|
[
"Apache-2.0"
] | null | null | null |
Python/empire/system/processes/process_util.py
|
Tombmyst/Empire
|
f28782787c5fa9127e353549b73ec90d3c82c003
|
[
"Apache-2.0"
] | null | null | null |
Python/empire/system/processes/process_util.py
|
Tombmyst/Empire
|
f28782787c5fa9127e353549b73ec90d3c82c003
|
[
"Apache-2.0"
] | null | null | null |
class ProcessUtil:
pass
# TODO: in separated classes:
# facade the psutil lib (in this class)
# check for facilitating the Popen call (in Process class that should be instantiable, as well as providing static methods to spawn process returning the raw Popen object)
# keep track of spawned system
| 40.5
| 177
| 0.725309
| 46
| 324
| 5.108696
| 0.804348
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.237654
| 324
| 7
| 178
| 46.285714
| 0.951417
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
3de58967f9307cd3c09ea975c20572c2f12af095
| 34
|
py
|
Python
|
starter_code/Learning File.py
|
kor-happydude/kits19
|
4db8e9bb95807e2f59a3bff4e5b13322ad811c3d
|
[
"MIT"
] | null | null | null |
starter_code/Learning File.py
|
kor-happydude/kits19
|
4db8e9bb95807e2f59a3bff4e5b13322ad811c3d
|
[
"MIT"
] | null | null | null |
starter_code/Learning File.py
|
kor-happydude/kits19
|
4db8e9bb95807e2f59a3bff4e5b13322ad811c3d
|
[
"MIT"
] | null | null | null |
##Make a python file for learning
| 17
| 33
| 0.764706
| 6
| 34
| 4.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 34
| 1
| 34
| 34
| 0.928571
| 0.911765
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9a81e8aefd4d9f9acd5cb60c870ef3a7bd3cafe0
| 93
|
py
|
Python
|
misc_code/monkey_patching_class/test.py
|
jmcguire/learning
|
acdb5e420d60dc4dd816e124c59f99c17310002b
|
[
"MIT"
] | null | null | null |
misc_code/monkey_patching_class/test.py
|
jmcguire/learning
|
acdb5e420d60dc4dd816e124c59f99c17310002b
|
[
"MIT"
] | null | null | null |
misc_code/monkey_patching_class/test.py
|
jmcguire/learning
|
acdb5e420d60dc4dd816e124c59f99c17310002b
|
[
"MIT"
] | null | null | null |
import alpha
import patch_alpha
patch_alpha.patch()
me = alpha.Alpha('justin')
me.speak()
| 10.333333
| 26
| 0.741935
| 14
| 93
| 4.785714
| 0.428571
| 0.298507
| 0.447761
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 93
| 8
| 27
| 11.625
| 0.82716
| 0
| 0
| 0
| 0
| 0
| 0.065217
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
9a99acb9d40314a2bc5fa1ca78519fbad96f1a46
| 27
|
py
|
Python
|
replace_package_name/__init__.py
|
OpenVoiceOS/template-package-repo
|
993ae6057f7c7b8c3dc6719c11c6bb030336c53c
|
[
"Apache-2.0"
] | null | null | null |
replace_package_name/__init__.py
|
OpenVoiceOS/template-package-repo
|
993ae6057f7c7b8c3dc6719c11c6bb030336c53c
|
[
"Apache-2.0"
] | 5
|
2022-02-24T23:57:43.000Z
|
2022-02-25T00:14:07.000Z
|
replace_package_name/__init__.py
|
OpenVoiceOS/template-package-repo
|
993ae6057f7c7b8c3dc6719c11c6bb030336c53c
|
[
"Apache-2.0"
] | null | null | null |
# a wild commit appeared
| 13.5
| 26
| 0.703704
| 4
| 27
| 4.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.259259
| 27
| 1
| 27
| 27
| 0.95
| 0.814815
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9aa934db5dd2796abb426e5f037847ac8ef37df8
| 191
|
py
|
Python
|
src/tracker/mot/FairMOT/src/lib/trains/train_factory.py
|
ToumaKazusa3/WP-MTMCT
|
915795f798075453916f41e8d2a900ab4884d9ae
|
[
"Apache-2.0"
] | 1
|
2021-07-13T06:14:49.000Z
|
2021-07-13T06:14:49.000Z
|
src/tracker/mot/FairMOT/src/lib/trains/train_factory.py
|
ToumaKazusa3/WP-MTMCT
|
915795f798075453916f41e8d2a900ab4884d9ae
|
[
"Apache-2.0"
] | null | null | null |
src/tracker/mot/FairMOT/src/lib/trains/train_factory.py
|
ToumaKazusa3/WP-MTMCT
|
915795f798075453916f41e8d2a900ab4884d9ae
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .mot import MotTrainer
train_factory = {
'mot': MotTrainer,
}
| 17.363636
| 39
| 0.764398
| 22
| 191
| 5.954545
| 0.5
| 0.229008
| 0.366412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.193717
| 191
| 10
| 40
| 19.1
| 0.850649
| 0
| 0
| 0
| 0
| 0
| 0.016575
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.571429
| 0
| 0.571429
| 0.142857
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9abaccdc764633e82ccd0511d67bc3a323b928e8
| 116
|
py
|
Python
|
framework/cei_python3/exception/ceiexception.py
|
macomfan/cei
|
49efb1baf39e0bb3e390791fafa3508226644975
|
[
"MIT"
] | 2
|
2020-05-09T01:54:04.000Z
|
2020-12-31T02:36:45.000Z
|
framework/cei_python3/exception/ceiexception.py
|
macomfan/cei
|
49efb1baf39e0bb3e390791fafa3508226644975
|
[
"MIT"
] | 27
|
2020-04-18T11:21:07.000Z
|
2022-02-26T22:22:33.000Z
|
framework/cei_python3/exception/ceiexception.py
|
macomfan/cei
|
49efb1baf39e0bb3e390791fafa3508226644975
|
[
"MIT"
] | 1
|
2020-04-26T10:58:02.000Z
|
2020-04-26T10:58:02.000Z
|
class CEIException(Exception):
def __init__(self, error_message):
self.error_message = error_message
| 29
| 43
| 0.724138
| 13
| 116
| 5.923077
| 0.615385
| 0.467532
| 0.415584
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.198276
| 116
| 3
| 44
| 38.666667
| 0.827957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9ac16014002318c702057aeb3b5320e8e23c7db0
| 137
|
py
|
Python
|
coindata/__init__.py
|
mertdede/coindata
|
e38dae98ea4fea90fd35b53a39596df4d6b174c9
|
[
"MIT"
] | 3
|
2018-03-23T12:39:01.000Z
|
2018-07-17T11:40:25.000Z
|
coindata/__init__.py
|
mertdede/coindata
|
e38dae98ea4fea90fd35b53a39596df4d6b174c9
|
[
"MIT"
] | null | null | null |
coindata/__init__.py
|
mertdede/coindata
|
e38dae98ea4fea90fd35b53a39596df4d6b174c9
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from .parser import vector_of as get
from .cacher import cache
from .request import ISO8601
from . import utils
| 19.571429
| 36
| 0.729927
| 21
| 137
| 4.714286
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044248
| 0.175182
| 137
| 6
| 37
| 22.833333
| 0.831858
| 0.153285
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9ad810c875cfd488e81c576b6cff38fe9ecef349
| 15,513
|
py
|
Python
|
box/tests/test_client.py
|
rca/box
|
9232593d0ad9367b27aea7541d216dbbb443961a
|
[
"Apache-2.0"
] | null | null | null |
box/tests/test_client.py
|
rca/box
|
9232593d0ad9367b27aea7541d216dbbb443961a
|
[
"Apache-2.0"
] | null | null | null |
box/tests/test_client.py
|
rca/box
|
9232593d0ad9367b27aea7541d216dbbb443961a
|
[
"Apache-2.0"
] | null | null | null |
import functools
import json
import mock
import unittest
from requests.exceptions import HTTPError
from box import Client
from box.models import FILE_URL, FOLDER_URL, FOLDERS_URL, UPDATE_FILE_URL, UPLOAD_FILE_URL
class ClientTestCase(unittest.TestCase):
def setUp(self):
self.oauth2_client = mock.Mock()
self.client = Client(self.oauth2_client)
def test_add_tags(self):
item = {'id': 1234}
tags = ['foo']
added_tags = ['bar']
self.client.get_tags = mock.Mock()
self.client.get_tags.return_value = tags[:] # make a copy of the list
new_tags = self.client.add_tags(item, added_tags)
expected_tags = tags + added_tags
self.assertEqual(expected_tags, new_tags)
url = FILE_URL.format(item['id'])
self.oauth2_client.put.assert_called_with(url, data=json.dumps({'tags': expected_tags}))
def test_add_tags_none_added(self):
item = {'id': 1234}
tags = ['foo']
added_tags = ['bar']
expected_tags = tags + added_tags
self.client.get_tags = mock.Mock()
self.client.get_tags.return_value = expected_tags
new_tags = self.client.add_tags(item, added_tags)
self.assertEqual(expected_tags, new_tags)
self.assertEqual(False, self.oauth2_client.put.called)
def test_create_folder(self):
name = 'foo'
parent = {'id': 0, 'name': 'root'}
expected = {'status': 'ok'}
self.oauth2_client.post().json.return_value = expected
json_data = self.client.create_folder(name, parent=parent)
payload = json.dumps({'name': name, 'parent': {'id': parent['id']}})
self.oauth2_client.post.assert_called_with(FOLDERS_URL, data=payload)
self.assertEqual(expected, json_data)
def test_delete(self):
file_id = 123
self.client.delete({'id': file_id, 'etag': 1})
url = FILE_URL.format(file_id)
self.oauth2_client.delete.assert_called_with(url, headers={'If-Match': 1})
def test_delete_folder(self):
folder_id = 123
self.client.delete_folder({'id': folder_id})
url = FOLDER_URL.format(folder_id)
self.oauth2_client.delete.assert_called_with(url, params={'recursive': False})
def test_delete_folder_recursive(self):
folder_id = 123
self.client.delete_folder({'id': folder_id}, recursive=True)
url = FOLDER_URL.format(folder_id)
self.oauth2_client.delete.assert_called_with(url, params={'recursive': True})
def test_file_info(self):
item = {'id': 1234}
url = FILE_URL.format(item['id'])
expected = {}
self.oauth2_client.get.return_value.json.return_value = expected
info = self.client.file_info(item)
self.oauth2_client.get.assert_called_with(url, params={})
self.assertEqual(expected, info)
def test_file_info_with_fields(self):
item = {'id': 1234}
url = FILE_URL.format(item['id'])
expected = {}
self.oauth2_client.get.return_value.json.return_value = expected
info = self.client.file_info(item, fields='tags')
self.oauth2_client.get.assert_called_with(url, params={'fields': 'tags'})
self.assertEqual(expected, info)
def test_folders(self):
"""
Ensures only one item is returned even though the limit is 100 by default
"""
response = mock.Mock()
response.json.return_value = {'total_count': 1, 'entries': ['folder']}
self.oauth2_client.get.return_value = response
folders = list(self.client.folder_items())
self.assertEqual(['folder'], folders)
def test_folders_inner_limit(self):
"""
Ensures the limit is honored even if an upstream result contains more items
"""
response = mock.Mock()
def get_json(get_mock):
_args, _kwargs = get_mock.call_args
return {'total_count': 100, 'entries': ['folder'] * _kwargs['params']['limit']}
response.json.side_effect = functools.partial(get_json, self.oauth2_client.get)
self.oauth2_client.get.return_value = response
folders = list(self.client.folder_items(limit=10))
self.assertEqual(['folder']*10, folders)
def test_get_etag(self):
item = {'id': 1234}
expected = 'etag'
self.oauth2_client.get.return_value.json.return_value = {'etag': expected}
etag = self.client.get_etag(item)
self.assertEqual(expected, etag)
def test_get_tags(self):
item = {'id': 1234}
expected = ['foo', 'bar']
self.oauth2_client.get.return_value.json.return_value = {'tags': expected}
tags = self.client.get_tags(item)
self.assertEqual(expected, tags)
def test_remove_tags(self):
item = {'id': 1234}
tags = ['foo']
removed_tags = ['bar']
self.client.get_tags = mock.Mock()
self.client.get_tags.return_value = tags + removed_tags
new_tags = self.client.remove_tags(item, removed_tags)
self.assertEqual(tags, new_tags)
url = FILE_URL.format(item['id'])
self.oauth2_client.put.assert_called_with(url, data=json.dumps({'tags': tags}))
def test_remove_tags_none_removed(self):
item = {'id': 1234}
tags = ['foo']
removed_tags = ['bar']
self.client.get_tags = mock.Mock()
self.client.get_tags.return_value = tags
new_tags = self.client.remove_tags(item, removed_tags)
self.assertEqual(tags, new_tags)
self.assertEqual(False, self.oauth2_client.put.called)
def test_total_count(self):
"""
Make sure additional requests aren't made when total_count is hit
"""
response = mock.Mock()
def get_json(get_mock, total_count=1):
_args, _kwargs = get_mock.call_args
num_folders = min(_kwargs['params']['limit'], total_count)
return {'total_count': total_count, 'entries': ['folder'] * num_folders}
response.json.side_effect = functools.partial(get_json, self.oauth2_client.get)
self.oauth2_client.get.return_value = response
# wrap in list() call in order for the debugger step into folder_items(),
# i.e., the generator has to be evaluated.
list(self.client.folder_items(limit=10))
self.assertEqual(1, self.oauth2_client.get.call_count)
def test_folders_outer_limit(self):
"""
Ensures multiple requests are made to honor the outer limit
"""
response = mock.Mock()
response.json.return_value = {'total_count': 300, 'entries': ['folder'] * 100}
self.oauth2_client.get.return_value = response
folders = list(self.client.folder_items(limit=200))
self.assertEqual(['folder']*200, folders)
def test_folders_parent_id(self):
"""
Ensures only one item is returned even though the limit is 100 by default
"""
response = mock.Mock()
response.json.return_value = {'total_count': 300, 'entries': ['folder'] * 100}
self.oauth2_client.get.return_value = response
folders = list(self.client.folder_items(parent={'id': 123}))
self.assertEqual(['folder']*100, folders)
self.oauth2_client.get.assert_called_with(
'https://api.box.com/2.0/folders/123/items',
params={'limit': 100, 'offset': 0}
)
def test_set_tags(self):
item = {'id': 123}
tags = ['foo']
url = FILE_URL.format(item['id'])
params = {'fields': 'tags'}
data = json.dumps({'tags': tags})
self.client.set_tags(item, tags)
self.oauth2_client.put.assert_called_with(url, data=data)
def test_update(self):
item = {'id': 1234}
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
self.client.update(item, fileobj, etag='etag')
url = UPDATE_FILE_URL.format(item['id'])
self.oauth2_client.post.assert_called_with(
url,
files={'filename': (fileobj.name, fileobj)},
headers={'If-Match': 'etag'}
)
def test_update_etag_none(self):
item = {'id': 1234}
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
self.client.file_info = mock.Mock()
self.client.file_info.return_value = {'etag': 'et'}
self.client.update(item, fileobj)
self.client.file_info.assert_called_with(item, fields='etag')
url = UPDATE_FILE_URL.format(item['id'])
self.oauth2_client.post.assert_called_with(
url,
files={'filename': (fileobj.name, fileobj)},
headers={'If-Match': 'et'}
)
def test_update_with_hash(self):
item = {'id': 1234}
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
self.client.update(item, fileobj, etag='etag', content_hash='hash')
url = UPDATE_FILE_URL.format(item['id'])
self.oauth2_client.post.assert_called_with(
url,
files={'filename': (fileobj.name, fileobj)},
headers={
'Content-MD5': 'hash',
'If-Match': 'etag',
},
)
def test_update_file_info(self):
expected = {'return': 'value'}
self.oauth2_client.put.return_value.json.return_value = expected
etag = 'etag'
item = {'id': 1234}
info = {'name': 'foo'}
self.client.file_info = mock.Mock()
self.client.file_info.return_value = {'etag': etag}
response_json = self.client.update_file_info(item, info)
url = FILE_URL.format(item['id'])
self.oauth2_client.put.assert_called_with(
url, data=json.dumps(info), headers={'If-Match': etag})
self.assertEqual(expected, response_json)
def test_update_folder_info(self):
expected = {'return': 'value'}
self.oauth2_client.put.return_value.json.return_value = expected
etag = 'etag'
item = {'id': 1234}
info = {'name': 'foo'}
self.client.folder_info = mock.Mock()
self.client.folder_info.return_value = {'etag': etag}
response_json = self.client.update_folder_info(item, info)
url = FOLDER_URL.format(item['id'])
self.oauth2_client.put.assert_called_with(
url, data=json.dumps(info), headers={'If-Match': etag})
self.assertEqual(expected, response_json)
def test_upload(self):
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
parent = {'id': 0}
expected = {'status': 'ok'}
self.oauth2_client.post.return_value.json.return_value = expected
response_json = self.client.upload(parent, fileobj)
self.oauth2_client.post.assert_called_with(
UPLOAD_FILE_URL,
data={'parent_id': parent['id']},
files={'filename': (fileobj.name, fileobj)},
headers={},
)
self.assertEqual(expected, response_json)
def test_upload_with_hash(self):
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
parent = {'id': 0}
expected = {'status': 'ok'}
self.oauth2_client.post.return_value.json.return_value = expected
response_json = self.client.upload(parent, fileobj, content_hash='hash')
self.oauth2_client.post.assert_called_with(
UPLOAD_FILE_URL,
data={'parent_id': parent['id']},
files={'filename': (fileobj.name, fileobj)},
headers={'Content-MD5': 'hash'},
)
self.assertEqual(expected, response_json)
def test_upload_existing_file(self):
fileobj = mock.Mock()
parent = {'id': 0}
# setup POST to have two responses
self.oauth2_client.post.side_effect = [HTTPError]
self.assertRaises(HTTPError, self.client.upload, parent, fileobj)
def test_upload_or_update(self):
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
parent = {'id': 0}
expected = {'status': 'ok'}
self.oauth2_client.post.return_value.json.return_value = expected
response_json, uploaded = self.client.upload_or_update(parent, fileobj)
self.oauth2_client.post.assert_called_with(
UPLOAD_FILE_URL,
data={'parent_id': parent['id']},
files={'filename': (fileobj.name, fileobj)},
headers={},
)
self.assertEqual(expected, response_json)
self.assertEqual(True, uploaded)
def test_upload_or_update_with_hash(self):
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
parent = {'id': 0}
expected = {'status': 'ok'}
self.oauth2_client.post.return_value.json.return_value = expected
response_json, uploaded = self.client.upload_or_update(parent, fileobj, content_hash='hash')
self.oauth2_client.post.assert_called_with(
UPLOAD_FILE_URL,
data={'parent_id': parent['id']},
files={'filename': (fileobj.name, fileobj)},
headers={'Content-MD5': 'hash'},
)
self.assertEqual(expected, response_json)
self.assertEqual(True, uploaded)
def test_upload_or_update_existing_file(self):
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
parent = {'id': 0}
error_response_mock = mock.Mock(status_code=409)
error_json = {'context_info': {'conflicts': {'id': 1234, 'etag': 'etag'}}}
error_response_mock.json.return_value = error_json
error = HTTPError(response=error_response_mock)
expected = {'status': 'ok'}
response = mock.Mock()
response.json.return_value = expected
# setup POST to have two responses
self.oauth2_client.post.side_effect = [error, response]
response_json, uploaded = self.client.upload_or_update(parent, fileobj)
self.oauth2_client.post.assert_called_with(
UPDATE_FILE_URL.format(error_json['context_info']['conflicts']['id']),
headers={'If-Match': error_json['context_info']['conflicts']['etag']},
files={'filename': (fileobj.name, fileobj)}
)
self.assertEqual(expected, response_json)
self.assertEqual(False, uploaded)
def test_upload_or_update_existing_file_with_hash(self):
fileobj = mock.Mock()
fileobj.name = 'foo.txt'
parent = {'id': 0}
error_response_mock = mock.Mock(status_code=409)
error_json = {'context_info': {'conflicts': {'id': 1234, 'etag': 'etag'}}}
error_response_mock.json.return_value = error_json
error = HTTPError(response=error_response_mock)
expected = {'status': 'ok'}
response = mock.Mock()
response.json.return_value = expected
self.oauth2_client.post.side_effect = [error, response]
response_json, uploaded = self.client.upload_or_update(parent, fileobj, content_hash='hash')
self.oauth2_client.post.assert_called_with(
UPDATE_FILE_URL.format(error_json['context_info']['conflicts']['id']),
headers={
'If-Match': error_json['context_info']['conflicts']['etag'],
'Content-MD5': 'hash',
},
files={'filename': (fileobj.name, fileobj)}
)
self.assertEqual(expected, response_json)
self.assertEqual(False, uploaded)
| 31.026
| 100
| 0.615935
| 1,875
| 15,513
| 4.8736
| 0.086933
| 0.051434
| 0.082294
| 0.039396
| 0.790764
| 0.762311
| 0.734625
| 0.725979
| 0.700153
| 0.648282
| 0
| 0.016433
| 0.25469
| 15,513
| 499
| 101
| 31.088176
| 0.773915
| 0.035648
| 0
| 0.597523
| 0
| 0
| 0.069474
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 1
| 0.102167
| false
| 0
| 0.021672
| 0
| 0.133127
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b12c09aefa12a7f85eab97759c69540e33cf4a4a
| 499
|
py
|
Python
|
tests/test_corpus.py
|
polyswarm/polyswarm-client
|
1ce057725d7db59c3582e4cd3cf148cde7ddddeb
|
[
"MIT"
] | 21
|
2018-09-15T00:12:42.000Z
|
2020-10-28T00:42:59.000Z
|
tests/test_corpus.py
|
polyswarm/polyswarm-client
|
1ce057725d7db59c3582e4cd3cf148cde7ddddeb
|
[
"MIT"
] | 435
|
2018-09-05T18:53:21.000Z
|
2021-11-30T17:32:10.000Z
|
tests/test_corpus.py
|
polyswarm/polyswarm-client
|
1ce057725d7db59c3582e4cd3cf148cde7ddddeb
|
[
"MIT"
] | 3
|
2019-07-26T00:14:47.000Z
|
2021-04-26T10:57:56.000Z
|
import os
from polyswarmclient.corpus import DownloadToFileSystemCorpus
def test_download_truth_artifact():
pass
# d = DownloadToFileSystemCorpus()
# t = d.download_truth()
# assert os.path.exists(d.truth_db_pth)
def test_download_raw_artifacts():
pass
# d = DownloadToFileSystemCorpus()
# d.download_and_unpack()
# assert d.get_malicious_file_list()
# assert d.get_benign_file_list()
# d.generate_truth()
# assert os.path.exists(d.truth_db_pth)
| 19.96
| 61
| 0.717435
| 62
| 499
| 5.451613
| 0.467742
| 0.04142
| 0.088757
| 0.100592
| 0.201183
| 0.201183
| 0.201183
| 0.201183
| 0.201183
| 0
| 0
| 0
| 0.186373
| 499
| 24
| 62
| 20.791667
| 0.832512
| 0.549098
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0.333333
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
492152609ee2a872d396f494e4e77a0ac5a96ae3
| 31
|
py
|
Python
|
codechain/sdk/key/remotekeystore.py
|
CodeChain-io/codechain-sdk-python
|
e21420fe8e1105f23f04fc6ca3f18a444c2bf9a3
|
[
"0BSD"
] | 11
|
2018-08-22T09:42:54.000Z
|
2019-11-30T07:19:42.000Z
|
codechain/sdk/key/remotekeystore.py
|
CodeChain-io/codechain-sdk-python
|
e21420fe8e1105f23f04fc6ca3f18a444c2bf9a3
|
[
"0BSD"
] | 38
|
2019-07-22T06:13:39.000Z
|
2021-06-02T00:43:21.000Z
|
codechain/sdk/key/remotekeystore.py
|
CodeChain-io/codechain-sdk-python
|
e21420fe8e1105f23f04fc6ca3f18a444c2bf9a3
|
[
"0BSD"
] | 5
|
2019-07-24T19:13:00.000Z
|
2020-03-18T12:13:27.000Z
|
class RemoteKeyStore:
pass
| 10.333333
| 21
| 0.741935
| 3
| 31
| 7.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.225806
| 31
| 2
| 22
| 15.5
| 0.958333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
4937fb73840599a353f023dd734dea35e26eec6a
| 95
|
py
|
Python
|
quantecon/optimize/__init__.py
|
imaginarymuffin72/start
|
d6130c1dac2e1ea87929d767a74fef5ab80157ec
|
[
"BSD-3-Clause"
] | null | null | null |
quantecon/optimize/__init__.py
|
imaginarymuffin72/start
|
d6130c1dac2e1ea87929d767a74fef5ab80157ec
|
[
"BSD-3-Clause"
] | null | null | null |
quantecon/optimize/__init__.py
|
imaginarymuffin72/start
|
d6130c1dac2e1ea87929d767a74fef5ab80157ec
|
[
"BSD-3-Clause"
] | null | null | null |
"""
Initialization of the optimize subpackage
"""
from .scalar_maximization import brent_max
| 13.571429
| 42
| 0.789474
| 11
| 95
| 6.636364
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136842
| 95
| 6
| 43
| 15.833333
| 0.890244
| 0.431579
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4970851403c95605e11c60a8c46fd920fb4bc4a9
| 79
|
py
|
Python
|
multisieve_coreference/__main__.py
|
mpvharmelen/coref_draft
|
30674e94bc9b3743bc9c9b01f26dc8e9b21cb6a8
|
[
"Apache-2.0"
] | null | null | null |
multisieve_coreference/__main__.py
|
mpvharmelen/coref_draft
|
30674e94bc9b3743bc9c9b01f26dc8e9b21cb6a8
|
[
"Apache-2.0"
] | 4
|
2019-06-14T08:55:32.000Z
|
2019-07-03T11:58:07.000Z
|
multisieve_coreference/__main__.py
|
mpvharmelen/coref_draft
|
30674e94bc9b3743bc9c9b01f26dc8e9b21cb6a8
|
[
"Apache-2.0"
] | 1
|
2021-03-29T17:19:58.000Z
|
2021-03-29T17:19:58.000Z
|
from multisieve_coreference.main import parse_args, main
main(**parse_args())
| 19.75
| 56
| 0.810127
| 11
| 79
| 5.545455
| 0.636364
| 0.295082
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088608
| 79
| 3
| 57
| 26.333333
| 0.847222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
770b9cfa7fb8b2d6b8e86175844fc414568a6f9e
| 14,066
|
py
|
Python
|
test_suite/gap/test_gap_state.py
|
AGlass0fMilk/mbed-os-bluetooth-integration-testsuite
|
0fbcfcc84b27ec82505192bf181abb1df024c53c
|
[
"Apache-2.0"
] | null | null | null |
test_suite/gap/test_gap_state.py
|
AGlass0fMilk/mbed-os-bluetooth-integration-testsuite
|
0fbcfcc84b27ec82505192bf181abb1df024c53c
|
[
"Apache-2.0"
] | 1
|
2021-12-13T20:47:57.000Z
|
2021-12-13T20:47:57.000Z
|
test_suite/gap/test_gap_state.py
|
paul-szczepanek-arm/mbed-os-bluetooth-integration-testsuite-old
|
a3ef22262fcc5a367e346d272e88502287628a10
|
[
"Apache-2.0"
] | null | null | null |
# Copyright (c) 2009-2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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.
from time import sleep
from typing import Mapping
import pytest
from common.ble_device import LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED
from common.fixtures import BoardAllocator
class TestParams:
def __init__(self):
self.advFlags = ["LE_GENERAL_DISCOVERABLE", "BREDR_NOT_SUPPORTED"]
self.advData = {
"companyID": "004C",
"ID": "02",
"len": "15",
"proximityUUID": "E20A39F473F54BC4A12F17D1AD07A961",
"majorNumber": "0001",
"minorNumber": "0001",
"txPower": "C8"
}
self.advData = "".join(self.advData.values())
# Scan parameter
self.scanTimeout = 2000
self.scanParams = [10, 10, False]
# Set some connection parameters
self.connectionParams = [50, 100, 0, 600]
self.connectionTimeout = 10000
self.connectionScanParams = [100, 100, 0, False]
def get_connection_args(self, address: Mapping[str, str]):
connection_args = [address["address_type"], address["address"]]
return connection_args
@pytest.fixture(scope="module")
def test_params():
yield TestParams()
@pytest.fixture(scope="function")
def peripheral(board_allocator: BoardAllocator, test_params: TestParams):
device = board_allocator.allocate('peripheral')
assert device is not None
# initialize the ble stack
device.ble.init()
# setup advertising intervals
device.advParams.setPrimaryInterval(100, 100)
device.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
yield device
device.ble.shutdown()
board_allocator.release(device)
@pytest.fixture(scope="function")
def central(board_allocator: BoardAllocator):
device = board_allocator.allocate('central')
assert device is not None
device.ble.init()
yield device
device.ble.shutdown()
board_allocator.release(device)
@pytest.fixture(scope="function")
def peripheral_address(peripheral):
yield peripheral.gap.getAddress().result
@pytest.fixture(scope="function")
def central_address(central):
yield central.gap.getAddress().result
@pytest.mark.ble41
def test_advertising(peripheral, peripheral_address, central, test_params):
"""validate that when a device is advertising and not disconnected,
Gap::state.isAdvertisingActive==True """
# start advertising on device 1
peripheral.advParams.setType("CONNECTABLE_UNDIRECTED")
peripheral.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
peripheral.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# get the Gap state of device 1 and assert that it is equal to what is expected
state = peripheral.gap.isAdvertisingActive(LEGACY_ADVERTISING_HANDLE).result
assert state is True
# Check that the device is actually advertising
central.scanParams.set1mPhyConfiguration(*test_params.scanParams)
central.gap.setScanParameters() # apply scanParams
scan_records = central.gap.scanForAddress(peripheral_address['address'], test_params.scanTimeout).result
assert len(scan_records) > 0
@pytest.mark.ble41
def test_stop_advertising(peripheral, peripheral_address, central, test_params):
"""validate that when a device stop advertising and is disconnected,
Gap::isAdvertisingActive==False"""
# start advertising on broadcaster then stop it
peripheral.advParams.setType("CONNECTABLE_UNDIRECTED")
peripheral.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
peripheral.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
peripheral.gap.stopAdvertising(LEGACY_ADVERTISING_HANDLE)
sleep(1) # advertising takes a bit of time to end
# get the Gap state of device 1 and assert that it is equal to what is expected
state = peripheral.gap.isAdvertisingActive(LEGACY_ADVERTISING_HANDLE).result
assert state is False
sleep(1)
# Check that the device is no longer advertising
central.scanParams.set1mPhyConfiguration(*test_params.scanParams)
central.gap.setScanParameters() # apply scanParams
scan_records = central.gap.scanForAddress(peripheral_address['address'], test_params.scanTimeout).result
assert len(scan_records) == 0
@pytest.mark.ble41
def test_connected(peripheral, peripheral_address, central, test_params):
"""validate that when a peripheral has been connected,
Gap::isAdvertisingActive==False and the connection event is received"""
# start advertising as connectable on peripheral
peripheral.advParams.setType("CONNECTABLE_UNDIRECTED")
peripheral.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
peripheral.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# Assert connection will happen on the peripheral side
connection = peripheral.gap.waitForConnection.setAsync()(50000)
# wait for advertising to end
sleep(1)
# Establish the connection
central.gap.connect(*test_params.get_connection_args(peripheral_address))
assert connection.error is None and connection.result['status'] == "BLE_ERROR_NONE"
# get the Gap state of device 1 and assert that it is equal to what is expected
state = peripheral.gap.isAdvertisingActive(LEGACY_ADVERTISING_HANDLE).result
assert state is False
# Check that the device is no longer advertising
central.scanParams.set1mPhyConfiguration(*test_params.scanParams)
central.gap.setScanParameters() # apply scanParams
scan_records = central.gap.scanForAddress(peripheral_address['address'], test_params.scanTimeout).result
assert len(scan_records) == 0
@pytest.mark.ble41
def test_peripheral_advertising_while_connected(peripheral, peripheral_address, central, test_params):
"""validate that when a peripheral has been connected then start advertising during the connection,
Gap::isAdvertisingActive==True """
# start advertising as connectable on peripheral
peripheral.advParams.setType("CONNECTABLE_UNDIRECTED")
peripheral.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
peripheral.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# Establish the connection
peripheral_connection = peripheral.gap.waitForConnection.setAsync()(10000)
central.gap.connect(*test_params.get_connection_args(peripheral_address))
# wait for advertising to end
assert peripheral_connection.error is None and peripheral_connection.result['status'] == "BLE_ERROR_NONE"
# start non connectable advertising on peripheral
peripheral.advParams.setType("NON_CONNECTABLE_UNDIRECTED")
peripheral.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
peripheral.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# get the Gap state of device 1 and assert that it is equal to what is expected
state = peripheral.gap.isAdvertisingActive(LEGACY_ADVERTISING_HANDLE).result
assert state
# Check that the device is actually advertising
central.scanParams.set1mPhyConfiguration(*test_params.scanParams)
central.gap.setScanParameters() # apply scanParams
scan_records = central.gap.scanForAddress(peripheral_address['address'], test_params.scanTimeout).result
assert len(scan_records) > 0
@pytest.mark.ble41
def test_central_advertising_while_connected(peripheral, peripheral_address, central, central_address, test_params):
"""validate that when a central has been connected then start advertising during the connection,
Gap::isAdvertisingActive==True """
# start advertising as connectable on peripheral
peripheral.advParams.setType("CONNECTABLE_UNDIRECTED")
peripheral.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
peripheral.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# Assert connection will happen on the peripheral side
connection = peripheral.gap.waitForConnection.setAsync()(10000)
# Establish the connection
central.gap.connect(*test_params.get_connection_args(peripheral_address))
# wait for advertising to end
assert connection.error is None and connection.result['status'] == "BLE_ERROR_NONE"
# start non connectable advertising on central
central.advParams.setType("NON_CONNECTABLE_UNDIRECTED")
central.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
central.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# get the Gap state of device 2 and assert that it is equal to what is expected
state = central.gap.isAdvertisingActive(LEGACY_ADVERTISING_HANDLE).result
assert state
# Check that the central is actually advertising
peripheral.scanParams.set1mPhyConfiguration(*test_params.scanParams)
peripheral.gap.setScanParameters() # apply scanParams
scan_records = peripheral.gap.scanForAddress(central_address['address'], test_params.scanTimeout).result
assert len(scan_records) > 0
@pytest.mark.ble41
def test_disconnection(peripheral, peripheral_address, central, central_address, test_params):
"""validate that when a central and peripheral are connected and not advertising, after the disconnection,
Gap::isAdvertisingActive==False """
# start advertising as connectable on peripheral
peripheral.advParams.setType("CONNECTABLE_UNDIRECTED")
peripheral.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
peripheral.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# Assert connection will happen on the peripheral side
peripheral_connection = peripheral.gap.waitForConnection.setAsync()(10000)
# Establish the connection
conn_handle = central.gap.connect(*test_params.get_connection_args(peripheral_address)).result['connection_handle']
# wait for advertising to end
assert peripheral_connection.error is None and peripheral_connection.result['status'] == "BLE_ERROR_NONE"
# disconnect
central.gap.disconnect(conn_handle, "USER_TERMINATION")
# wait for peripheral disconnection to settle
sleep(1)
# get the advertising state of both devices and assert that they are equal to what are expected
state = central.gap.isAdvertisingActive(LEGACY_ADVERTISING_HANDLE).result
assert state is False
state = peripheral.gap.isAdvertisingActive(LEGACY_ADVERTISING_HANDLE).result
assert state is False
# Check that the central is not advertising
peripheral.scanParams.set1mPhyConfiguration(*test_params.scanParams)
peripheral.gap.setScanParameters() # apply scanParams
scan_records = peripheral.gap.scanForAddress(central_address['address'], test_params.scanTimeout).result
assert len(scan_records) == 0
# Check that the peripheral is not advertising
central.scanParams.set1mPhyConfiguration(*test_params.scanParams)
central.gap.setScanParameters() # apply scanParams
scan_records = central.gap.scanForAddress(peripheral_address['address'], test_params.scanTimeout).result
assert len(scan_records) == 0
@pytest.mark.ble41
@pytest.mark.smoketest
def test_advertising_after_disconnection(peripheral, peripheral_address, central, central_address, test_params):
"""validate that when a central and peripheral are connected and advertising after the disconnection,
Gap::isAdvertisingActive==True and advertisements are received"""
# start advertising as connectable on peripheral
peripheral.advParams.setType("CONNECTABLE_UNDIRECTED")
peripheral.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
peripheral.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# Assert connection will happen on the peripheral side
peripheral_connection = peripheral.gap.waitForConnection.setAsync()(10000)
# Establish the connection
conn_handle = central.gap.connect(*test_params.get_connection_args(peripheral_address)).result['connection_handle']
# wait for advertising to end
assert peripheral_connection.error is None and peripheral_connection.result['status'] == "BLE_ERROR_NONE"
# disconnect
central.gap.disconnect(conn_handle, "USER_TERMINATION")
# wait for peripheral disconnection to settle
sleep(1)
for device in [peripheral, central]:
# start non connectable advertising
device.advParams.setType("NON_CONNECTABLE_UNDIRECTED")
device.gap.setAdvertisingParameters(LEGACY_ADVERTISING_HANDLE)
device.gap.startAdvertising(LEGACY_ADVERTISING_HANDLE, ADV_DURATION_FOREVER, ADV_MAX_EVENTS_UNLIMITED)
# get the advertising state and assert that it is equal to what is expected
state = device.gap.isAdvertisingActive(LEGACY_ADVERTISING_HANDLE).result
assert state
# set up scanning for the other device
device.scanParams.set1mPhyConfiguration(*test_params.scanParams)
device.gap.setScanParameters() # apply scanParams
scan_records = central.gap.scanForAddress(peripheral_address['address'], test_params.scanTimeout).result
assert len(scan_records) > 0
scan_records = peripheral.gap.scanForAddress(central_address['address'], test_params.scanTimeout).result
assert len(scan_records) > 0
| 43.28
| 119
| 0.773567
| 1,642
| 14,066
| 6.457369
| 0.143118
| 0.04046
| 0.067245
| 0.026974
| 0.793549
| 0.75837
| 0.728945
| 0.719136
| 0.713289
| 0.712817
| 0
| 0.012711
| 0.149865
| 14,066
| 324
| 120
| 43.41358
| 0.873976
| 0.261624
| 0
| 0.651163
| 0
| 0
| 0.066621
| 0.027995
| 0
| 0
| 0
| 0
| 0.139535
| 1
| 0.081395
| false
| 0
| 0.02907
| 0
| 0.122093
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
91f043e6d2c5099a9473e9d4bdbc4889ceae88c4
| 5,829
|
py
|
Python
|
lab_2_conda/logic/graph.py
|
AlexPraefectus/DM_Python
|
45b465a63bf92f382ee375cf779652be422747e6
|
[
"BSD-3-Clause"
] | 1
|
2018-04-25T20:18:41.000Z
|
2018-04-25T20:18:41.000Z
|
lab_2_conda/logic/graph.py
|
AlexPraefectus/DM_Python
|
45b465a63bf92f382ee375cf779652be422747e6
|
[
"BSD-3-Clause"
] | null | null | null |
lab_2_conda/logic/graph.py
|
AlexPraefectus/DM_Python
|
45b465a63bf92f382ee375cf779652be422747e6
|
[
"BSD-3-Clause"
] | null | null | null |
import networkx as nx
from logic.relations import RelationMaker
import matplotlib.pyplot as plt
class GraphDrawer:
def __init__(self, set_a, set_b):
self.relation_maker = RelationMaker(set_a, set_b)
self.relation_maker.delete_impossible_mother_relation()
self.relation_maker.delete_impossible_for_mother_in_law_relation()
self.relation_maker.form_mother_child_relation()
self.relation_maker.form_mother_in_law_relation()
self.graph_mother = nx.DiGraph()
self.graph_mother_in_law = nx.DiGraph()
self.graph_operation = nx.DiGraph()
def add_nodes(self):
for i in self.relation_maker.set_a:
self.graph_mother.add_node(i.name, set='a')
self.graph_mother_in_law.add_node(i.name, set='a')
self.graph_operation.add_node(i.name, set='a')
for i in self.relation_maker.set_b:
self.graph_mother.add_node(i.name, set='b')
self.graph_mother_in_law.add_node(i.name, set='b')
self.graph_operation.add_node(i.name, set='b')
@staticmethod
def _clear_plot():
plt.clf()
plt.cla()
plt.close()
def draw_graph_mother(self):
self._clear_plot()
self.add_nodes()
# self.add_edges_mother()
pos = nx.spring_layout(self.graph_mother)
nx.draw_networkx_nodes(self.graph_mother,
pos=pos,
nodelist=[i.name for i in self.relation_maker.set_b],
node_color='yellow')
nx.draw_networkx_nodes(self.graph_mother,
pos=pos,
nodelist=[i.name for i in self.relation_maker.set_a],
node_color='b')
nx.draw_networkx_labels(self.graph_mother,
pos=pos,
labels=dict(zip([i.name for i in self.relation_maker.set_a],
[i.name for i in self.relation_maker.set_a])),
font_color='black')
nx.draw_networkx_labels(self.graph_mother,
pos=pos,
labels=dict(zip([i.name for i in self.relation_maker.set_b],
[i.name for i in self.relation_maker.set_b])),
font_color='black')
nx.draw_networkx_edges(self.graph_mother,
pos=pos,
edgelist=self.relation_maker.s_relation,
edge_color='red')
print(self.relation_maker.s_relation)
plt.show()
def draw_graph_mother_in_law(self):
self._clear_plot()
self.add_nodes()
# self.add_edges_mother_in_law()
pos = nx.spring_layout(self.graph_mother_in_law)
nx.draw_networkx_nodes(self.graph_mother_in_law,
pos=pos,
nodelist=[i.name for i in self.relation_maker.set_b],
node_color='yellow')
nx.draw_networkx_nodes(self.graph_mother_in_law,
pos=pos,
nodelist=[i.name for i in self.relation_maker.set_a],
node_color='b')
nx.draw_networkx_labels(self.graph_mother_in_law,
pos=pos,
labels=dict(zip([i.name for i in self.relation_maker.set_a],
[i.name for i in self.relation_maker.set_a])),
font_color='black')
nx.draw_networkx_labels(self.graph_mother_in_law,
pos=pos,
labels=dict(zip([i.name for i in self.relation_maker.set_b],
[i.name for i in self.relation_maker.set_b])),
font_color='black')
nx.draw_networkx_edges(self.graph_mother_in_law,
pos=pos,
edgelist=self.relation_maker.r_relation,
edge_color='red')
print(self.relation_maker.r_relation)
plt.show()
def draw_graph_operation(self, operation_edge_list):
self.add_nodes()
pos = nx.spring_layout(self.graph_mother)
nx.draw_networkx_nodes(self.graph_mother,
pos=pos,
nodelist=[i.name for i in self.relation_maker.set_b],
node_color='yellow')
nx.draw_networkx_nodes(self.graph_mother,
pos=pos,
nodelist=[i.name for i in self.relation_maker.set_a],
node_color='b')
nx.draw_networkx_labels(self.graph_mother,
pos=pos,
labels=dict(zip([i.name for i in self.relation_maker.set_a],
[i.name for i in self.relation_maker.set_a])),
font_color='black')
nx.draw_networkx_labels(self.graph_mother_in_law,
pos=pos,
labels=dict(zip([i.name for i in self.relation_maker.set_b],
[i.name for i in self.relation_maker.set_b])),
font_color='black')
nx.draw_networkx_edges(self.graph_mother_in_law,
pos=pos,
edgelist=operation_edge_list,
edge_color='red')
plt.show()
| 48.983193
| 94
| 0.505919
| 668
| 5,829
| 4.103293
| 0.095808
| 0.126961
| 0.179861
| 0.072966
| 0.865378
| 0.835826
| 0.762495
| 0.732579
| 0.634805
| 0.634805
| 0
| 0
| 0.41019
| 5,829
| 118
| 95
| 49.398305
| 0.797266
| 0.009264
| 0
| 0.66055
| 0
| 0
| 0.011435
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.055046
| false
| 0
| 0.027523
| 0
| 0.091743
| 0.018349
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
6225eeb762b91df87c6056812c4c9c2804250b4a
| 270
|
py
|
Python
|
07-Social-Analytics/config.py
|
jdouangs/homework
|
bab023b2c968aba904eaa874976eb9c9e6bc9f30
|
[
"MIT"
] | null | null | null |
07-Social-Analytics/config.py
|
jdouangs/homework
|
bab023b2c968aba904eaa874976eb9c9e6bc9f30
|
[
"MIT"
] | null | null | null |
07-Social-Analytics/config.py
|
jdouangs/homework
|
bab023b2c968aba904eaa874976eb9c9e6bc9f30
|
[
"MIT"
] | null | null | null |
# Twitter API Keys
consumer_key = "Evvpt1h8W6NqFGat2DCJyIQJE"
consumer_secret = "tilsyGyNG371CbwOeYH8iGcJnL0v8xBZbCMCgrZtsCwiIv6SD4"
access_token = "51217498-4WaAePQqz3vijoVdDZ9XtUoxmqPHGQNWVLxPchNdj"
access_token_secret = "sHp0FDUeg2DSPJmJ37kZhNoKvnfOD2LiRJqv71etJgTeu"
| 67.5
| 70
| 0.892593
| 17
| 270
| 13.882353
| 0.764706
| 0.09322
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 0.055556
| 270
| 4
| 71
| 67.5
| 0.807843
| 0.218519
| 0
| 0
| 0
| 0
| 0.671937
| 0.671937
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
6232b1b768e0e3abe187d8174145d982200862bb
| 84
|
py
|
Python
|
Notebook example/notebook.py
|
beatrixorange/Pi_digit_recognition
|
8f4754448792df2c39bf70574255cd16367090cc
|
[
"MIT"
] | null | null | null |
Notebook example/notebook.py
|
beatrixorange/Pi_digit_recognition
|
8f4754448792df2c39bf70574255cd16367090cc
|
[
"MIT"
] | null | null | null |
Notebook example/notebook.py
|
beatrixorange/Pi_digit_recognition
|
8f4754448792df2c39bf70574255cd16367090cc
|
[
"MIT"
] | null | null | null |
import numpy
# This is NOT a jupiter notebook. Make sure to open the .ipynb file
| 28
| 68
| 0.738095
| 15
| 84
| 4.133333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.22619
| 84
| 3
| 68
| 28
| 0.953846
| 0.77381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
624543137f846231b9eee403c334ceded8242d5e
| 146
|
py
|
Python
|
examples/example.py
|
tkc285/AI-Feynman
|
2b2b0478c834f78a9f3a23b122a24df567c94b30
|
[
"MIT"
] | 2
|
2021-01-18T21:53:38.000Z
|
2021-07-24T09:33:30.000Z
|
examples/example.py
|
ignsebastian/AI-Feynman
|
81c77793dfe4c3793f40d55418ae3fe0a4dc8971
|
[
"MIT"
] | null | null | null |
examples/example.py
|
ignsebastian/AI-Feynman
|
81c77793dfe4c3793f40d55418ae3fe0a4dc8971
|
[
"MIT"
] | null | null | null |
from feynman import run_aifeynman
run_aifeynman("../example_data/", "example1.txt", 30,
"14ops.txt", polyfit_deg=3, NN_epochs=500)
| 29.2
| 56
| 0.684932
| 20
| 146
| 4.75
| 0.85
| 0.252632
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07438
| 0.171233
| 146
| 4
| 57
| 36.5
| 0.710744
| 0
| 0
| 0
| 0
| 0
| 0.253425
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
62801e6d76829b004734caa7bf2927ed0a2d4d49
| 207
|
py
|
Python
|
src/server.py
|
rkruegs123/geo-model-builder
|
f070afe18ed874b3a31db519ea6f593f40a1be00
|
[
"Apache-2.0"
] | 3
|
2020-12-12T10:39:25.000Z
|
2021-04-25T14:15:24.000Z
|
src/server.py
|
rkruegs123/geo-model-builder
|
f070afe18ed874b3a31db519ea6f593f40a1be00
|
[
"Apache-2.0"
] | null | null | null |
src/server.py
|
rkruegs123/geo-model-builder
|
f070afe18ed874b3a31db519ea6f593f40a1be00
|
[
"Apache-2.0"
] | 2
|
2020-12-12T10:40:12.000Z
|
2021-09-15T14:03:39.000Z
|
"""
Copyright (c) 2020 Ryan Krueger. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Ryan Krueger, Jesse Michael Han, Daniel Selsam
"""
from app import app
| 25.875
| 67
| 0.763285
| 32
| 207
| 4.9375
| 0.875
| 0.139241
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034682
| 0.164251
| 207
| 7
| 68
| 29.571429
| 0.878613
| 0.855072
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
6555240df0f3b7bd6e610b8b9cfa9cf0fe89172c
| 3,388
|
py
|
Python
|
zhihuuser/pipelines.py
|
amosannn/zhihu-analysis
|
19f68fd24fb64e0549bf7fa93738b474597c7477
|
[
"Apache-2.0"
] | null | null | null |
zhihuuser/pipelines.py
|
amosannn/zhihu-analysis
|
19f68fd24fb64e0549bf7fa93738b474597c7477
|
[
"Apache-2.0"
] | null | null | null |
zhihuuser/pipelines.py
|
amosannn/zhihu-analysis
|
19f68fd24fb64e0549bf7fa93738b474597c7477
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymysql
def dbHandle():
conn = pymysql.connect(
host='127.0.0.1',
user='root',
passwd='root',
charset='utf8',
use_unicode=False
)
return conn
class ZhihuPipeline(object):
def process_item(self, item, spider):
dbObject = dbHandle() # 写入数据库
cursor = dbObject.cursor()
#sql = "insert into scrapy.zhihu_user(user_name,sex,user_sign,user_avatar,user_url,locations,voteup_count,thanked_count,follower_count,following_count,following_topic_count,following_question_count,following_favlists_count,following_columns_count,answer_count,articles_count,question_count,commercial_question_count,favorite_count,favorited_count,is_bind_sina,is_following,is_followed,mutual_followees_count,vote_to_count,vote_from_count,thank_to_count,thank_from_count,description) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
#param = (item['user_name'],item['sex'],item['user_sign'],item['user_avatar'],item['user_url'],item['locations'],item['voteup_count'],item['thanked_count'],item['follower_count'],item['following_count'],item['following_topic_count'],item['following_question_count'],item['following_favlists_count'],item['following_columns_count'],item['answer_count'],item['articles_count'],item['question_count'],item['commercial_question_count'],item['favorite_count'],item['favorited_count'],item['is_bind_sina'],item['is_following'],item['is_followed'],item['mutual_followees_count'],item['vote_to_count'],item['vote_from_count'],item['thank_to_count'],item['thank_from_count'],item['description'])
sql = "insert into scrapy.zhihu_user(user_name,sex,user_sign,user_avatar,user_url,locations,voteup_count,thanked_count,follower_count,following_count,following_topic_count,following_question_count,following_favlists_count,following_columns_count,answer_count,articles_count,question_count,commercial_question_count,favorite_count,favorited_count,is_bind_sina,is_following,is_followed,mutual_followees_count,vote_to_count,vote_from_count,thank_to_count,thank_from_count,description) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19},{20},{21},{22},{23},{24},{25},{26},{27},{28})"
try:
cursor.execute(sql.format("\'"+item['user_name']+"\'",item['sex'],"\'"+item['user_sign']+"\'","\'"+item['user_avatar']+"\'","\'"+item['user_url']+"\'","\'"+item['locations']+"\'",item['voteup_count'],item['thanked_count'],item['follower_count'],item['following_count'],item['following_topic_count'],item['following_question_count'],item['following_favlists_count'],item['following_columns_count'],item['answer_count'],item['articles_count'],item['question_count'],item['commercial_question_count'],item['favorite_count'],item['favorited_count'],item['is_bind_sina'],item['is_following'],item['is_followed'],item['mutual_followees_count'],item['vote_to_count'],item['vote_from_count'],item['thank_to_count'],item['thank_from_count'],"\'"+item['description']+"\'"))
dbObject.commit()
except Exception as e:
print(e)
dbObject.rollback()
return item
| 96.8
| 775
| 0.730224
| 481
| 3,388
| 4.825364
| 0.261954
| 0.14735
| 0.034899
| 0.044808
| 0.793193
| 0.793193
| 0.793193
| 0.793193
| 0.793193
| 0.793193
| 0
| 0.017909
| 0.077037
| 3,388
| 34
| 776
| 99.647059
| 0.724336
| 0.427686
| 0
| 0
| 0
| 0.045455
| 0.558031
| 0.384974
| 0
| 0
| 0
| 0
| 0
| 1
| 0.090909
| false
| 0.045455
| 0.045455
| 0
| 0.272727
| 0.045455
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
655ebe6ffca827a59d6159b360765ab9d7169e24
| 115
|
py
|
Python
|
dalloriam/orc/__init__.py
|
dalloriam/python-stdlib
|
2ce4ebf4545e2ce9c74ef1f2735929f0202598b5
|
[
"MIT"
] | null | null | null |
dalloriam/orc/__init__.py
|
dalloriam/python-stdlib
|
2ce4ebf4545e2ce9c74ef1f2735929f0202598b5
|
[
"MIT"
] | 2
|
2019-02-10T16:25:58.000Z
|
2019-03-13T01:40:15.000Z
|
dalloriam/orc/__init__.py
|
dalloriam/python-stdlib
|
2ce4ebf4545e2ce9c74ef1f2735929f0202598b5
|
[
"MIT"
] | null | null | null |
from .client import ORCClient as Client
from .keyval import KeyValStore as KeyVal
from .task import Task, requires
| 28.75
| 41
| 0.817391
| 17
| 115
| 5.529412
| 0.529412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147826
| 115
| 3
| 42
| 38.333333
| 0.959184
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
655fa3e679316cb7d8856856890fee8a72705af0
| 81
|
py
|
Python
|
tools/echo-toupper.py
|
cstrotm/VolksForth
|
e41222945951e495e1d1606c757353e85b0bac58
|
[
"BSD-2-Clause"
] | 14
|
2017-04-24T06:10:25.000Z
|
2020-02-05T21:55:10.000Z
|
tools/echo-toupper.py
|
cstrotm/VolksForth
|
e41222945951e495e1d1606c757353e85b0bac58
|
[
"BSD-2-Clause"
] | null | null | null |
tools/echo-toupper.py
|
cstrotm/VolksForth
|
e41222945951e495e1d1606c757353e85b0bac58
|
[
"BSD-2-Clause"
] | 3
|
2017-07-20T06:00:00.000Z
|
2020-01-08T17:29:09.000Z
|
#!/usr/bin/python3
import sys
print(' '.join(a.upper() for a in sys.argv[1:]))
| 13.5
| 48
| 0.62963
| 15
| 81
| 3.4
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.028571
| 0.135802
| 81
| 5
| 49
| 16.2
| 0.7
| 0.209877
| 0
| 0
| 0
| 0
| 0.015873
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
65647cd5a68e38f6f1546d619ddd026baf1ca0f8
| 16,154
|
py
|
Python
|
tests/units/fastsync/commons/test_fastsync_target_postgres.py
|
deanmorin/pipelinewise
|
acde3c18f4dd116113f47f3dc50d31fdcf59a1d6
|
[
"Apache-2.0"
] | null | null | null |
tests/units/fastsync/commons/test_fastsync_target_postgres.py
|
deanmorin/pipelinewise
|
acde3c18f4dd116113f47f3dc50d31fdcf59a1d6
|
[
"Apache-2.0"
] | 15
|
2021-10-04T05:11:43.000Z
|
2022-03-21T05:12:11.000Z
|
tests/units/fastsync/commons/test_fastsync_target_postgres.py
|
alastairstuart/pipelinewise
|
acde3c18f4dd116113f47f3dc50d31fdcf59a1d6
|
[
"Apache-2.0"
] | null | null | null |
from unittest import TestCase
from pipelinewise.fastsync.commons.target_postgres import FastSyncTargetPostgres
class FastSyncTargetPostgresMock(FastSyncTargetPostgres):
"""
Mocked FastSyncTargetPostgres class
"""
def __init__(self, connection_config, transformation_config=None):
super().__init__(connection_config, transformation_config)
self.executed_queries = []
def query(self, query, params=None):
self.executed_queries.append(query)
class TestFastSyncTargetPostgres(TestCase):
"""
Unit tests for fastsync target postgres
"""
def setUp(self) -> None:
"""Initialise test FastSyncTargetPostgres object"""
self.postgres = FastSyncTargetPostgresMock(
connection_config={}, transformation_config={}
)
def test_create_schema(self):
"""Validate if create schema queries generated correctly"""
self.postgres.create_schema('new_schema')
assert self.postgres.executed_queries == [
'CREATE SCHEMA IF NOT EXISTS new_schema'
]
def test_drop_table(self):
"""Validate if drop table queries generated correctly"""
self.postgres.drop_table('test_schema', 'test_table')
self.postgres.drop_table('test_schema', 'test_table', is_temporary=True)
self.postgres.drop_table('test_schema', 'UPPERCASE_TABLE')
self.postgres.drop_table('test_schema', 'UPPERCASE_TABLE', is_temporary=True)
self.postgres.drop_table('test_schema', 'test table with space')
self.postgres.drop_table(
'test_schema', 'test table with space', is_temporary=True
)
assert self.postgres.executed_queries == [
'DROP TABLE IF EXISTS test_schema."test_table"',
'DROP TABLE IF EXISTS test_schema."test_table_temp"',
'DROP TABLE IF EXISTS test_schema."uppercase_table"',
'DROP TABLE IF EXISTS test_schema."uppercase_table_temp"',
'DROP TABLE IF EXISTS test_schema."test table with space"',
'DROP TABLE IF EXISTS test_schema."test table with space_temp"',
]
def test_create_table(self):
"""Validate if create table queries generated correctly"""
# Create table with standard table and column names
self.postgres.executed_queries = []
self.postgres.create_table(
target_schema='test_schema',
table_name='test_table',
columns=['"id" INTEGER', '"txt" CHARACTER VARYING'],
primary_key=['"id"'],
)
assert self.postgres.executed_queries == [
'CREATE TABLE IF NOT EXISTS test_schema."test_table" ('
'"id" integer,"txt" character varying,'
'_sdc_extracted_at timestamp without time zone,'
'_sdc_batched_at timestamp without time zone,'
'_sdc_deleted_at character varying'
', PRIMARY KEY ("id"))'
]
# Create table with reserved words in table and column names
self.postgres.executed_queries = []
self.postgres.create_table(
target_schema='test_schema',
table_name='ORDER',
columns=[
'"id" INTEGER',
'"txt" CHARACTER VARYING',
'"SELECT" CHARACTER VARYING',
],
primary_key=['"id"'],
)
assert self.postgres.executed_queries == [
'CREATE TABLE IF NOT EXISTS test_schema."order" ('
'"id" integer,"txt" character varying,"select" character varying,'
'_sdc_extracted_at timestamp without time zone,'
'_sdc_batched_at timestamp without time zone,'
'_sdc_deleted_at character varying'
', PRIMARY KEY ("id"))'
]
# Create table with mixed lower and uppercase and space characters
self.postgres.executed_queries = []
self.postgres.create_table(
target_schema='test_schema',
table_name='TABLE with SPACE',
columns=['"id" INTEGER', '"column_with space" CHARACTER VARYING'],
primary_key=['"id"'],
)
assert self.postgres.executed_queries == [
'CREATE TABLE IF NOT EXISTS test_schema."table with space" ('
'"id" integer,"column_with space" character varying,'
'_sdc_extracted_at timestamp without time zone,'
'_sdc_batched_at timestamp without time zone,'
'_sdc_deleted_at character varying'
', PRIMARY KEY ("id"))'
]
# Create table with composite primary key
self.postgres.executed_queries = []
self.postgres.create_table(
target_schema='test_schema',
table_name='TABLE with SPACE',
columns=[
'"id" INTEGER',
'"num" INTEGER',
'"column_with space" CHARACTER VARYING',
],
primary_key=['"id"', '"num"'],
)
assert self.postgres.executed_queries == [
'CREATE TABLE IF NOT EXISTS test_schema."table with space" ('
'"id" integer,"num" integer,"column_with space" character varying,'
'_sdc_extracted_at timestamp without time zone,'
'_sdc_batched_at timestamp without time zone,'
'_sdc_deleted_at character varying'
', PRIMARY KEY ("id","num"))'
]
# Create table with no primary key
self.postgres.executed_queries = []
self.postgres.create_table(
target_schema='test_schema',
table_name='test_table_no_pk',
columns=['"id" INTEGER', '"txt" CHARACTER VARYING'],
primary_key=None,
)
assert self.postgres.executed_queries == [
'CREATE TABLE IF NOT EXISTS test_schema."test_table_no_pk" ('
'"id" integer,"txt" character varying,'
'_sdc_extracted_at timestamp without time zone,'
'_sdc_batched_at timestamp without time zone,'
'_sdc_deleted_at character varying)'
]
def test_grant_select_on_table(self):
"""Validate if GRANT command generated correctly"""
# GRANT table with standard table and column names
self.postgres.executed_queries = []
self.postgres.grant_select_on_table(
target_schema='test_schema',
table_name='test_table',
role='test_role',
is_temporary=False,
)
assert self.postgres.executed_queries == [
'GRANT SELECT ON test_schema."test_table" TO GROUP test_role'
]
# GRANT table with reserved word in table and column names in temp table
self.postgres.executed_queries = []
self.postgres.grant_select_on_table(
target_schema='test_schema',
table_name='full',
role='test_role',
is_temporary=False,
)
assert self.postgres.executed_queries == [
'GRANT SELECT ON test_schema."full" TO GROUP test_role'
]
# GRANT table with with space and uppercase in table name and s3 key
self.postgres.executed_queries = []
self.postgres.grant_select_on_table(
target_schema='test_schema',
table_name='table with SPACE and UPPERCASE',
role='test_role',
is_temporary=False,
)
assert self.postgres.executed_queries == [
'GRANT SELECT ON test_schema."table with space and uppercase" TO GROUP test_role'
]
def test_grant_usage_on_schema(self):
"""Validate if GRANT command generated correctly"""
self.postgres.executed_queries = []
self.postgres.grant_usage_on_schema(
target_schema='test_schema', role='test_role'
)
assert self.postgres.executed_queries == [
'GRANT USAGE ON SCHEMA test_schema TO GROUP test_role'
]
def test_grant_select_on_schema(self):
"""Validate if GRANT command generated correctly"""
self.postgres.executed_queries = []
self.postgres.grant_select_on_schema(
target_schema='test_schema', role='test_role'
)
assert self.postgres.executed_queries == [
'GRANT SELECT ON ALL TABLES IN SCHEMA test_schema TO GROUP test_role'
]
def test_swap_tables(self):
"""Validate if swap table commands generated correctly"""
# Swap tables with standard table and column names
self.postgres.executed_queries = []
self.postgres.swap_tables(schema='test_schema', table_name='test_table')
assert self.postgres.executed_queries == [
'DROP TABLE IF EXISTS test_schema."test_table"',
'ALTER TABLE test_schema."test_table_temp" RENAME TO "test_table"',
]
# Swap tables with reserved word in table and column names in temp table
self.postgres.executed_queries = []
self.postgres.swap_tables(schema='test_schema', table_name='full')
assert self.postgres.executed_queries == [
'DROP TABLE IF EXISTS test_schema."full"',
'ALTER TABLE test_schema."full_temp" RENAME TO "full"',
]
# Swap tables with with space and uppercase in table name
self.postgres.executed_queries = []
self.postgres.swap_tables(
schema='test_schema', table_name='table with SPACE and UPPERCASE'
)
assert self.postgres.executed_queries == [
'DROP TABLE IF EXISTS test_schema."table with space and uppercase"',
'ALTER TABLE test_schema."table with space and uppercase_temp" '
'RENAME TO "table with space and uppercase"',
]
def test_obfuscate_columns_case1(self):
"""
Test obfuscation where given transformations are emtpy
Test should pass with no executed queries
"""
target_schema = 'my_schema'
table_name = 'public.my_table'
self.postgres.transformation_config = {}
self.postgres.obfuscate_columns(target_schema, table_name)
self.assertFalse(self.postgres.executed_queries)
def test_obfuscate_columns_case2(self):
"""
Test obfuscation where given transformations has an unsupported transformation type
Test should fail
"""
target_schema = 'my_schema'
table_name = 'public.my_table'
self.postgres.transformation_config = {
'transformations': [
{
'field_id': 'col_7',
'tap_stream_name': 'public-my_table',
'type': 'RANDOM',
}
]
}
with self.assertRaises(ValueError):
self.postgres.obfuscate_columns(target_schema, table_name)
self.assertFalse(self.postgres.executed_queries)
def test_obfuscate_columns_case3(self):
"""
Test obfuscation where given transformations have no conditions
Test should pass
"""
target_schema = 'my_schema'
table_name = 'public.my_table'
self.postgres.transformation_config = {
'transformations': [
{
'field_id': 'col_1',
'tap_stream_name': 'public-my_table',
'type': 'SET-NULL',
},
{
'field_id': 'col_2',
'tap_stream_name': 'public-my_table',
'type': 'MASK-HIDDEN',
},
{
'field_id': 'col_3',
'tap_stream_name': 'public-my_table',
'type': 'MASK-DATE',
},
{
'field_id': 'col_4',
'tap_stream_name': 'public-my_table',
'safe_field_id': '"col_4"',
'type': 'MASK-NUMBER',
},
{
'field_id': 'col_5',
'tap_stream_name': 'public-my_table',
'type': 'HASH',
},
{
'field_id': 'col_6',
'tap_stream_name': 'public-my_table',
'type': 'HASH-SKIP-FIRST-5',
},
]
}
self.postgres.obfuscate_columns(target_schema, table_name)
self.assertListEqual(
self.postgres.executed_queries,
[
'UPDATE "my_schema"."my_table" SET '
'"col_1" = NULL, '
'"col_2" = \'hidden\', '
'"col_3" = MAKE_TIMESTAMP(DATE_PART(\'year\', "col_3")::int, 1, 1, DATE_PART(\'hour\', "col_3")::int, '
'DATE_PART(\'minute\', "col_3")::int, DATE_PART(\'second\', "col_3")::double precision), '
'"col_4" = 0, '
'"col_5" = ENCODE(DIGEST("col_5", \'sha256\'), \'hex\'), '
'"col_6" = CONCAT(SUBSTRING("col_6", 1, 5), '
'ENCODE(DIGEST(SUBSTRING("col_6", 5 + 1), \'sha256\'), \'hex\'));'
],
)
def test_obfuscate_columns_case4(self):
"""
Test obfuscation where given transformations have conditions
Test should pass
"""
target_schema = 'my_schema'
table_name = 'public.my_table'
self.postgres.transformation_config = {
'transformations': [
{
'field_id': 'col_1',
'tap_stream_name': 'public-my_table',
'type': 'SET-NULL',
},
{
'field_id': 'col_2',
'tap_stream_name': 'public-my_table',
'type': 'MASK-HIDDEN',
'when': [
{'column': 'col_4', 'safe_column': '"col_4"', 'equals': None},
{
'column': 'col_1',
},
],
},
{
'field_id': 'col_3',
'tap_stream_name': 'public-my_table',
'type': 'MASK-DATE',
'when': [{'column': 'col_5', 'equals': 'some_value'}],
},
{
'field_id': 'col_4',
'tap_stream_name': 'public-my_table',
'type': 'MASK-NUMBER',
},
{
'field_id': 'col_5',
'tap_stream_name': 'public-my_table',
'type': 'HASH',
},
{
'field_id': 'col_6',
'tap_stream_name': 'public-my_table',
'type': 'HASH-SKIP-FIRST-5',
'when': [
{'column': 'col_1', 'equals': 30},
{'column': 'col_2', 'regex_match': r'[0-9]{3}\.[0-9]{3}'},
],
},
]
}
self.postgres.obfuscate_columns(target_schema, table_name, is_temporary=True)
self.assertListEqual(
self.postgres.executed_queries,
[
'UPDATE "my_schema"."my_table_temp" SET "col_2" = \'hidden\' WHERE ("col_4" IS NULL);',
'UPDATE "my_schema"."my_table_temp" SET '
'"col_3" = MAKE_TIMESTAMP(DATE_PART(\'year\', "col_3")::int, 1, 1, DATE_PART(\'hour\', "col_3")::int, '
'DATE_PART(\'minute\', "col_3")::int, DATE_PART(\'second\', "col_3")::double precision) '
'WHERE ("col_5" = \'some_value\');',
'UPDATE "my_schema"."my_table_temp" SET '
'"col_6" = CONCAT(SUBSTRING("col_6", 1, 5), '
'ENCODE(DIGEST(SUBSTRING("col_6", 5 + 1), \'sha256\'), \'hex\')) WHERE ("col_1" = 30) AND '
'("col_2" ~ \'[0-9]{3}\.[0-9]{3}\');', # pylint: disable=W1401 # noqa: W605
'UPDATE "my_schema"."my_table_temp" SET "col_1" = NULL, '
'"col_4" = 0, "col_5" = ENCODE(DIGEST("col_5", \'sha256\'), \'hex\');',
],
)
| 39.690418
| 119
| 0.548595
| 1,665
| 16,154
| 5.059459
| 0.10991
| 0.086895
| 0.075973
| 0.102564
| 0.815171
| 0.795821
| 0.776828
| 0.735043
| 0.662274
| 0.637227
| 0
| 0.009922
| 0.338678
| 16,154
| 406
| 120
| 39.788177
| 0.77862
| 0.091123
| 0
| 0.496933
| 0
| 0
| 0.346529
| 0.042142
| 0
| 0
| 0
| 0
| 0.06135
| 1
| 0.042945
| false
| 0
| 0.006135
| 0
| 0.055215
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
658fc291d25a3a8a917ba7d77c275d7b69570e87
| 19,228
|
py
|
Python
|
tests/emm/clients/test_git_proxy.py
|
evergreen-ci/evg-module-manager
|
c72bcd480b8d983e14e4f16c7f9c1ca8ffb577f5
|
[
"Apache-2.0"
] | null | null | null |
tests/emm/clients/test_git_proxy.py
|
evergreen-ci/evg-module-manager
|
c72bcd480b8d983e14e4f16c7f9c1ca8ffb577f5
|
[
"Apache-2.0"
] | 18
|
2021-11-19T16:43:39.000Z
|
2022-03-31T20:02:20.000Z
|
tests/emm/clients/test_git_proxy.py
|
evergreen-ci/evg-module-manager
|
c72bcd480b8d983e14e4f16c7f9c1ca8ffb577f5
|
[
"Apache-2.0"
] | 2
|
2021-11-09T16:02:57.000Z
|
2022-02-09T18:35:24.000Z
|
"""Unit tests for git_proxy.py."""
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from click import UsageError
import emm.clients.git_proxy as under_test
# TODO: Find a better way to handle the Path module when testing 3.7
# We shouldn't have to mock the entire Path module when testing
NAMESPACE = "emm.clients.git_proxy"
def ns(local_path: str) -> str:
return f"{NAMESPACE}.{local_path}"
def make_fake_path() -> Path:
return Path("./fake/path")
@pytest.fixture()
def mock_git():
git_mock = MagicMock()
git_mock.assert_git_call = lambda args: git_mock.__getitem__.assert_any_call(args)
return git_mock
@pytest.fixture()
def git_proxy(mock_git) -> under_test.GitProxy:
git_proxy = under_test.GitProxy(mock_git)
return git_proxy
class TestClone:
@patch(ns("local"))
def test_clone_should_call_git_clone(self, local_mock, git_proxy, mock_git):
path = Path("/path/to/modules").absolute()
git_proxy.clone("module_name", "repo", path, branch=None)
mock_git.assert_git_call(["clone", "repo", "module_name"])
local_mock.cwd.assert_called_with(path)
@patch(ns("local"))
def test_clone_with_branch_should_call_git_clone_with_branch(
self, local_mock, git_proxy, mock_git
):
path = Path("/path/to/modules").absolute()
git_proxy.clone("module_name", "repo", path, branch="main")
mock_git.assert_git_call(["clone", "--branch", "main", "repo", "module_name"])
local_mock.cwd.assert_called_with(path)
class TestFetch:
@patch(ns("local"))
@patch(ns("Path"))
def test_fetch_should_call_git_fetch(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.fetch()
mock_git.assert_git_call(["fetch", "origin"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_fetch_with_directory_should_call_git_fetch_from_dir(
self, local_mock, git_proxy, mock_git
):
path = Path("/path/to/modules").absolute()
git_proxy.fetch(directory=path)
mock_git.assert_git_call(["fetch", "origin"])
local_mock.cwd.assert_called_with(path)
class TestPull:
@patch(ns("local"))
@patch(ns("Path"))
def test_pull_should_call_git_pull(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.pull()
mock_git.assert_git_call(["pull"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_pull_with_directory_should_call_git_pull_from_directory(
self, local_mock, git_proxy, mock_git
):
path = Path("/path/to/modules").absolute()
git_proxy.pull(directory=path)
mock_git.assert_git_call(["pull"])
local_mock.cwd.assert_called_with(path)
@patch(ns("local"))
@patch(ns("Path"))
def test_rebase_option_should_call_git_pull_with_rebase(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.pull(rebase=True)
mock_git.assert_git_call(["pull", "--rebase"])
local_mock.cwd.assert_called_with(test_path)
class TestCheckout:
@patch(ns("local"))
@patch(ns("Path"))
def test_checkout_should_call_git_checkout(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.checkout("abc123", directory=None, branch_name=None)
mock_git.assert_git_call(["checkout", "abc123"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
@patch(ns("Path"))
def test_checkout_with_branch_should_call_git_checkout_with_branch(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.checkout("abc123", directory=None, branch_name="main")
mock_git.assert_git_call(["checkout", "-b", "main", "abc123"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_checkout_with_directory_should_call_git_checkout_from_directory(
self, local_mock, git_proxy, mock_git
):
path = Path("/path/to/repo").absolute()
git_proxy.checkout("abc123", directory=path, branch_name=None)
mock_git.assert_git_call(["checkout", "abc123"])
local_mock.cwd.assert_called_with(path)
class TestBranch:
@patch(ns("local"))
@patch(ns("Path"))
def test_branch_should_call_git_branch(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.branch(directory=None)
mock_git.assert_git_call(["branch"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
@patch(ns("Path"))
def test_branch_with_delete_should_call_git_branch_delete(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.branch("abc123", directory=None)
mock_git.assert_git_call(["branch", "-D", "abc123"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_branch_with_directory_should_call_git_branch_from_directory(
self, local_mock, git_proxy, mock_git
):
path = Path("/path/to/repo").absolute()
git_proxy.branch(directory=path)
mock_git.assert_git_call(["branch"])
local_mock.cwd.assert_called_with(path)
class TestStatus:
@patch(ns("local"))
@patch(ns("Path"))
def test_status_should_call_git_status(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.status()
mock_git.assert_git_call(["status"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
@patch(ns("Path"))
def test_status_with_short_should_call_git_status_short(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.status(short=True)
mock_git.assert_git_call(["status", "--short"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_status_with_directory_should_call_git_status_from_directory(
self, local_mock, git_proxy, mock_git
):
path = Path("/path/to/repo").absolute()
git_proxy.status(directory=path)
mock_git.assert_git_call(["status"])
local_mock.cwd.assert_called_with(path)
class TestLsFiles:
@patch(ns("local"))
@patch(ns("Path"))
def test_ls_files_should_call_git_ls_files(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.ls_files(["."])
mock_git.assert_git_call(["ls-files", "."])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
@patch(ns("Path"))
def test_ls_files_with_options_should_call_git_ls_files_with_options(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.ls_files(["."], cached=True, others=True, ignore_file="ignore-me")
mock_git.assert_git_call(
["ls-files", "--cached", "--others", "--exclude-from=ignore-me", "."]
)
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_ls_files_with_directory_should_call_git_ls_files_from_directory(
self, local_mock, git_proxy, mock_git
):
path = Path("/path/to/repo").absolute()
git_proxy.ls_files(["."], directory=path)
mock_git.assert_git_call(["ls-files", "."])
local_mock.cwd.assert_called_with(path)
class TestAdd:
@patch(ns("local"))
@patch(ns("Path"))
def test_add_with_no_directory_should_call_git_add(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.add(".")
mock_git.assert_git_call(["add", "."])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_add_with_directory_should_switch_directories(self, local_mock, git_proxy, mock_git):
path = Path("/path/to/repo").absolute()
git_proxy.add(["."], directory=path)
mock_git.assert_git_call(["add", "."])
local_mock.cwd.assert_called_with(path)
class TestRestore:
@patch(ns("local"))
@patch(ns("Path"))
def test_restore_with_no_directory_should_call_git_restore(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.restore(".")
mock_git.assert_git_call(["restore", "."])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
@patch(ns("Path"))
def test_restore_with_staged_should_call_git_with_staged_option(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.restore(".", staged=True)
mock_git.assert_git_call(["restore", "--staged", "."])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_restore_with_directory_should_switch_directories(
self, local_mock, git_proxy, mock_git
):
path = Path("/path/to/repo").absolute()
git_proxy.restore(["."], directory=path)
mock_git.assert_git_call(["restore", "."])
local_mock.cwd.assert_called_with(path)
class TestRebase:
@patch(ns("local"))
@patch(ns("Path"))
def test_rebase_with_no_directory_should_call_git_rebase(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.rebase(onto="abc123")
mock_git.assert_git_call(["rebase", "--onto", "abc123"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_rebase_with_directory_should_switch_directories(self, local_mock, git_proxy, mock_git):
path = Path("/path/to/repo").absolute()
git_proxy.rebase(onto="abc123", directory=path)
mock_git.assert_git_call(["rebase", "--onto", "abc123"])
local_mock.cwd.assert_called_with(path)
class TestMerge:
@patch(ns("local"))
@patch(ns("Path"))
def test_merge_with_no_directory_should_call_git_rebase(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.merge("abc123")
mock_git.assert_git_call(["merge", "abc123"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_merge_with_directory_should_switch_directories(self, local_mock, git_proxy, mock_git):
path = Path("/path/to/repo").absolute()
git_proxy.merge("abc123", directory=path)
mock_git.assert_git_call(["merge", "abc123"])
local_mock.cwd.assert_called_with(path)
class TestCurrentCommit:
@patch(ns("local"))
@patch(ns("Path"))
def test_current_commit_with_no_directory_should_return_git_hash(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
mock_git.__getitem__.return_value.return_value = "abc123\n"
git_commit = git_proxy.current_commit()
mock_git.assert_git_call(["rev-parse", "HEAD"])
assert git_commit == "abc123"
@patch(ns("local"))
def test_current_commit_with_directory_should_switch_directories(
self, local_mock, git_proxy, mock_git
):
mock_git.__getitem__.return_value.return_value = "abc123\n"
path = Path("/path/to/repo").absolute()
git_commit = git_proxy.current_commit(directory=path)
mock_git.assert_git_call(["rev-parse", "HEAD"])
assert git_commit == "abc123"
local_mock.cwd.assert_called_with(path)
class TestMergeBase:
@patch(ns("local"))
@patch(ns("Path"))
def test_merge_base_with_no_directory_should_return_merge_base(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
mock_git.__getitem__.return_value.return_value = "abc123\n"
git_commit = git_proxy.merge_base("commit_1", "HEAD")
mock_git.assert_git_call(["merge-base", "commit_1", "HEAD"])
assert git_commit == "abc123"
@patch(ns("local"))
def test_merge_base_with_directory_should_switch_directories(
self, local_mock, git_proxy, mock_git
):
mock_git.__getitem__.return_value.return_value = "abc123\n"
path = Path("/path/to/repo").absolute()
git_commit = git_proxy.merge_base("commit_1", "HEAD", directory=path)
mock_git.assert_git_call(["merge-base", "commit_1", "HEAD"])
assert git_commit == "abc123"
local_mock.cwd.assert_called_with(path)
class TestCommit:
@patch(ns("local"))
@patch(ns("Path"))
def test_commit_with_no_directory_should_call_git_commit(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.commit("commit message")
mock_git.assert_git_call(["commit", "--message", "commit message"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
@patch(ns("Path"))
def test_commit_with_amend_should_call_git_commit_with_amend(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.commit(amend=True)
mock_git.assert_git_call(["commit", "--amend", "--reuse-message=HEAD"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
@patch(ns("Path"))
def test_commit_with_add_should_call_git_commit_with_add(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
git_proxy.commit(amend=True, add=True)
mock_git.assert_git_call(["commit", "--amend", "--reuse-message=HEAD", "--all"])
local_mock.cwd.assert_called_with(test_path)
@patch(ns("local"))
def test_commit_with_directory_should_switch_directories(self, local_mock, git_proxy, mock_git):
path = Path("/path/to/repo").absolute()
git_proxy.commit("commit message", directory=path)
mock_git.assert_git_call(["commit", "--message", "commit message"])
local_mock.cwd.assert_called_with(path)
class TestGetBaseName:
@patch(ns("local"))
@patch(ns("Path"))
def test_get_base_name_should_return_default_basename(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
mock_git.__getitem__.return_value.return_value = "origin/master"
basename = git_proxy.get_mergebase_branch_name()
mock_git.assert_git_call(["symbolic-ref", "refs/remotes/origin/HEAD"])
assert basename == "master"
class TestCheckChanges:
@patch(ns("local"))
@patch(ns("Path"))
def test_check_changes_should_return_changes(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
mock_git.__getitem__.return_value.return_value = "diff --git aaa bbb\n"
diff = git_proxy.check_changes("master")
mock_git.assert_git_call(["diff", "master..HEAD"])
assert diff is True
@patch(ns("local"))
@patch(ns("Path"))
def test_current_branch_should_return_branch_name(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
mock_git.__getitem__.return_value.return_value = "branch\n"
diff = git_proxy.current_branch()
mock_git.assert_git_call(["rev-parse", "--abbrev-ref", "HEAD"])
assert diff == "branch"
@patch(ns("local"))
@patch(ns("Path"))
def test_branch_exist_on_remote_should_return_remote_branch(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
mock_git.__getitem__.return_value.return_value = "origin/branch\n"
remote_branch = git_proxy.current_branch_exist_on_remote("branch")
mock_git.assert_git_call(["branch", "--remotes", "--contains", "branch"])
assert remote_branch == "origin/branch"
class TestPushBranchToRemote:
@patch(ns("local"))
@patch(ns("Path"))
def test_push_should_call_git_push(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
mock_git.__getitem__.return_value.return_value = "my-branch"
git_proxy.push_branch_to_remote()
mock_git.assert_git_call(["push", "-u", "origin", "HEAD"])
@patch(ns("local"))
@patch(ns("Path"))
def test_push_should_fail_on_protected_branch(self, path_mock, local_mock, git_proxy, mock_git):
test_path = make_fake_path()
path_mock.return_value = test_path
mock_git.__getitem__.return_value.return_value = "master"
with pytest.raises(UsageError):
git_proxy.push_branch_to_remote()
@patch(ns("local"))
@patch(ns("Path"))
def test_push_with_directory_should_switch_directories(
self, path_mock, local_mock, git_proxy, mock_git
):
test_path = make_fake_path()
path_mock.return_value = test_path
path = Path("/path/to/repo").absolute()
git_proxy.push_branch_to_remote(directory=path)
mock_git.assert_git_call(["push", "-u", "origin", "HEAD"])
local_mock.cwd.assert_called_with(path)
class TestDetermineDirectory:
@patch(ns("local"))
def test_directory_of_none_should_return_cwd(self, local_mock, git_proxy):
local_mock.cwd = "fake"
assert git_proxy._determine_directory(None) == Path(local_mock.cwd)
@patch(ns("local"))
def test_relative_directory_should_return_full_path(self, local_mock, git_proxy):
directory = Path("a/relative/path")
local_mock.cwd = "fake"
assert git_proxy._determine_directory(directory) == Path(local_mock.cwd / directory)
@patch(ns("local"))
def test_absolute_directory_should_return_directory(self, local_mock, git_proxy):
directory = Path("/a/absolute/path").absolute()
assert git_proxy._determine_directory(directory) == directory
| 33.971731
| 100
| 0.679582
| 2,626
| 19,228
| 4.550647
| 0.062833
| 0.084351
| 0.046192
| 0.065439
| 0.822427
| 0.774393
| 0.729038
| 0.713556
| 0.671883
| 0.618577
| 0
| 0.005057
| 0.197784
| 19,228
| 565
| 101
| 34.031858
| 0.76966
| 0.008217
| 0
| 0.645977
| 0
| 0
| 0.087762
| 0.004879
| 0
| 0
| 0
| 0.00177
| 0.204598
| 1
| 0.114943
| false
| 0
| 0.011494
| 0.004598
| 0.177011
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
659f6965c3a0426b57f75d6fde06f3bdc0844c8e
| 40
|
py
|
Python
|
response_helpers/models.py
|
imtapps/django-response-helpers
|
6ede01edcbc3e04a77604d852c497c9bdefb5acd
|
[
"BSD-2-Clause"
] | 1
|
2016-11-28T05:54:21.000Z
|
2016-11-28T05:54:21.000Z
|
response_helpers/models.py
|
imtapps/django-response-helpers
|
6ede01edcbc3e04a77604d852c497c9bdefb5acd
|
[
"BSD-2-Clause"
] | 1
|
2022-01-24T14:00:37.000Z
|
2022-01-24T14:00:37.000Z
|
response_helpers/models.py
|
imtapps/django-response-helpers
|
6ede01edcbc3e04a77604d852c497c9bdefb5acd
|
[
"BSD-2-Clause"
] | null | null | null |
# Django needs a models.py for each app
| 20
| 39
| 0.75
| 8
| 40
| 3.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 40
| 1
| 40
| 40
| 0.9375
| 0.925
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
65bd9c6bae71d1fab44fbbca5f789e3427497188
| 116
|
py
|
Python
|
test.py
|
AyushBhargav/Isolation-Game-AI
|
6e5913c4efb83eb6c3f1b33de2a08646fea9ec5f
|
[
"MIT"
] | null | null | null |
test.py
|
AyushBhargav/Isolation-Game-AI
|
6e5913c4efb83eb6c3f1b33de2a08646fea9ec5f
|
[
"MIT"
] | null | null | null |
test.py
|
AyushBhargav/Isolation-Game-AI
|
6e5913c4efb83eb6c3f1b33de2a08646fea9ec5f
|
[
"MIT"
] | null | null | null |
from gamestate import GameState
from minimax_helper import terminal_test
g = GameState(2,3)
print(terminal_test(g))
| 23.2
| 40
| 0.827586
| 18
| 116
| 5.166667
| 0.611111
| 0.258065
| 0.27957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019231
| 0.103448
| 116
| 4
| 41
| 29
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0.25
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
029ccbca23f328330922fd757063f9c2f7ea5561
| 118
|
py
|
Python
|
runcode/admin.py
|
vansjyo/OSVI-RemoteControl
|
6d3dd6aa1cceac2254171d57b33975df08cda2a8
|
[
"MIT"
] | null | null | null |
runcode/admin.py
|
vansjyo/OSVI-RemoteControl
|
6d3dd6aa1cceac2254171d57b33975df08cda2a8
|
[
"MIT"
] | null | null | null |
runcode/admin.py
|
vansjyo/OSVI-RemoteControl
|
6d3dd6aa1cceac2254171d57b33975df08cda2a8
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Pycode
# Register your models here.
admin.site.register(Pycode)
| 19.666667
| 32
| 0.805085
| 17
| 118
| 5.588235
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.127119
| 118
| 5
| 33
| 23.6
| 0.92233
| 0.220339
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
02bf4c7880fcb78f8c59c9a07821e5e869859703
| 46
|
py
|
Python
|
spacings/__init__.py
|
philippeller/spacings
|
cd33ee01939dfcd27b7fa404f8a18eae07b9eee7
|
[
"Apache-2.0"
] | 6
|
2021-07-23T12:35:42.000Z
|
2022-02-22T16:50:23.000Z
|
spacings/__init__.py
|
philippeller/spacings
|
cd33ee01939dfcd27b7fa404f8a18eae07b9eee7
|
[
"Apache-2.0"
] | null | null | null |
spacings/__init__.py
|
philippeller/spacings
|
cd33ee01939dfcd27b7fa404f8a18eae07b9eee7
|
[
"Apache-2.0"
] | null | null | null |
from .rps import rps
from .moran import moran
| 15.333333
| 24
| 0.782609
| 8
| 46
| 4.5
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173913
| 46
| 2
| 25
| 23
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f3069576522984ce2462eec828da4837a96a4f50
| 60
|
py
|
Python
|
linguistictoolkit/__init__.py
|
valestanov/LinguisticToolkit
|
a57b1ac084449cbf37ee0123b6e907a6674bece4
|
[
"MIT"
] | null | null | null |
linguistictoolkit/__init__.py
|
valestanov/LinguisticToolkit
|
a57b1ac084449cbf37ee0123b6e907a6674bece4
|
[
"MIT"
] | null | null | null |
linguistictoolkit/__init__.py
|
valestanov/LinguisticToolkit
|
a57b1ac084449cbf37ee0123b6e907a6674bece4
|
[
"MIT"
] | null | null | null |
import os
import sys
from linguistictoolkit.tools import io
| 15
| 38
| 0.85
| 9
| 60
| 5.666667
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 60
| 3
| 39
| 20
| 0.980769
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f316c883e4d3eab5d92889f8008f9d18d07e387d
| 91,515
|
py
|
Python
|
idaes/models_extra/power_generation/flowsheets/subcritical_power_plant/generic_surrogate_dict.py
|
OOAmusat/idaes-pse
|
ae7d3bb8e372bc32822dcdcb75e9fd96b78da539
|
[
"RSA-MD"
] | null | null | null |
idaes/models_extra/power_generation/flowsheets/subcritical_power_plant/generic_surrogate_dict.py
|
OOAmusat/idaes-pse
|
ae7d3bb8e372bc32822dcdcb75e9fd96b78da539
|
[
"RSA-MD"
] | null | null | null |
idaes/models_extra/power_generation/flowsheets/subcritical_power_plant/generic_surrogate_dict.py
|
OOAmusat/idaes-pse
|
ae7d3bb8e372bc32822dcdcb75e9fd96b78da539
|
[
"RSA-MD"
] | 1
|
2022-03-17T11:08:43.000Z
|
2022-03-17T11:08:43.000Z
|
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the software owners: The Regents of the University of California, through
# Lawrence Berkeley National Laboratory, National Technology & Engineering
# Solutions of Sandia, LLC, Carnegie Mellon University, West Virginia University
# Research Corporation, et al. All rights reserved.
#
# Please see the files COPYRIGHT.md and LICENSE.md for full copyright and
# license information.
#################################################################################
data_dic = {
1: "(74904.4 * b.wall_temperature_waterwall[t, 1] \
+11301.8 * b.wall_temperature_waterwall[t, 2] \
+2427.54 * b.wall_temperature_waterwall[t, 3] \
+2891.35 * b.wall_temperature_waterwall[t, 4] \
-28320.8 * b.wall_temperature_waterwall[t, 5] \
+171.944 * b.wall_temperature_waterwall[t, 6] \
+14462.9 * b.wall_temperature_waterwall[t, 7] \
+677.973 * b.wall_temperature_waterwall[t, 8] \
-122.598 * b.wall_temperature_waterwall[t, 9] \
-300.609 * b.wall_temperature_waterwall[t, 12] \
+1770.05 * b.wall_temperature_platen[t] \
-169.562 * b.wall_temperature_roof[t] \
+1.92447e+06 * b.flowrate_coal_raw[t] \
+8.65298e+07 * b.mf_H2O_coal_raw[t] \
+1.46803e+09 * b.SR[t] \
-1.68637e+08 * b.SR_lf[t] \
-6385.5 * b.secondary_air_inlet.temperature[t] \
+952262 * b.ratio_PA2coal[t] \
-2.10696e+07 * log(b.wall_temperature_waterwall[t, 1]) \
-5.56721e+06 * log(b.wall_temperature_waterwall[t, 2]) \
-1.21448e+06 * log(b.wall_temperature_waterwall[t, 3]) \
-3.48806e+06 * log(b.wall_temperature_waterwall[t, 4]) \
+1.02069e+07 * log(b.wall_temperature_waterwall[t, 5]) \
-5.47775e+06 * log(b.wall_temperature_waterwall[t, 7]) \
-279177 * log(b.wall_temperature_waterwall[t, 8]) \
+111061 * log(b.wall_temperature_waterwall[t, 9]) \
-646506 * log(b.wall_temperature_platen[t]) \
+3.96004e+06 * log(b.flowrate_coal_raw[t]) \
+45092.6 * log(b.mf_H2O_coal_raw[t]) \
-3.9193e+08 * log(b.SR[t]) \
+1.61406e+08 * log(b.SR_lf[t]) \
-3.84139e+06 * log(b.secondary_air_inlet.temperature[t]) \
+556876 * log(b.ratio_PA2coal[t]) \
-9.88017e+07 * exp(b.mf_H2O_coal_raw[t]) \
-2.86022e+08 * exp(b.SR[t]) \
-35.7424 * b.wall_temperature_waterwall[t, 1]**2 \
+10.3165 * b.wall_temperature_waterwall[t, 5]**2 \
-4.85009 * b.wall_temperature_waterwall[t, 7]**2 \
-21190.8 * b.flowrate_coal_raw[t]**2 \
-5.00302e+08 * b.SR[t]**2 \
+179.062 * b.flowrate_coal_raw[t]**3 \
+2.33815e+08 * b.SR[t]**3 \
-74.5573 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-0.202341 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 3] \
-52.6317 * b.wall_temperature_waterwall[t, 2]*b.flowrate_coal_raw[t] \
+0.243508 * b.wall_temperature_waterwall[t, 2]*b.secondary_air_inlet.temperature[t] \
-39.6689 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
-0.320972 * b.wall_temperature_waterwall[t, 3]*b.wall_temperature_waterwall[t, 4] \
-9.03032 * b.wall_temperature_waterwall[t, 3]*b.flowrate_coal_raw[t] \
+1.08186 * b.wall_temperature_waterwall[t, 3]*b.secondary_air_inlet.temperature[t] \
+0.525868 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
-39.011 * b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t] \
+4489.28 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
-629.837 * b.wall_temperature_waterwall[t, 5]*b.SR_lf[t] \
+44.344 * b.wall_temperature_waterwall[t, 5]*b.ratio_PA2coal[t] \
+1.72535 * b.wall_temperature_waterwall[t, 7]*b.flowrate_coal_raw[t] \
+796.63 * b.wall_temperature_waterwall[t, 7]*b.mf_H2O_coal_raw[t] \
+0.282511 * b.wall_temperature_waterwall[t, 7]*b.secondary_air_inlet.temperature[t] \
+0.447853 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_waterwall[t, 12] \
-0.343465 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_platen[t] \
-32.6091 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
+1107.94 * b.wall_temperature_waterwall[t, 8]*b.mf_H2O_coal_raw[t] \
+0.0605128 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 11] \
-0.463551 * b.wall_temperature_platen[t]*b.wall_temperature_roof[t] \
+6.50059 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
-1051.37 * b.wall_temperature_platen[t]*b.mf_H2O_coal_raw[t] \
-6.1049 * b.wall_temperature_platen[t]*b.ratio_PA2coal[t] \
-5465.56 * b.wall_temperature_roof[t]*b.mf_H2O_coal_raw[t] \
+0.833308 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-1.75056e+06 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-183240 * b.flowrate_coal_raw[t]*b.SR[t] \
-310130 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+957.014 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-39804.2 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+4.49631e+06 * b.mf_H2O_coal_raw[t]*b.SR[t] \
+2.16414e+07 * b.mf_H2O_coal_raw[t]*b.SR_lf[t] \
-19740 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-4.21302e+06 * b.SR[t]*b.SR_lf[t] \
+132221 * b.SR[t]*b.ratio_PA2coal[t] \
+20016.4 * b.SR_lf[t]*b.secondary_air_inlet.temperature[t] \
-2318.51 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.000979408 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
+0.000719763 * (b.wall_temperature_waterwall[t, 2]*b.flowrate_coal_raw[t])**2 \
+0.000572793 * (b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t])**2 \
-1.27643 * (b.wall_temperature_waterwall[t, 4]*b.SR[t])**2 \
+0.000450081 * (b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t])**2 \
+140272 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
+666.822 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-3994.96 * (b.flowrate_coal_raw[t]*b.SR_lf[t])**2 \
-0.00660786 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2 \
+85.0348 * (b.flowrate_coal_raw[t]*b.ratio_PA2coal[t])**2 \
+0.102891 * (b.wall_temperature_roof[t]*b.mf_H2O_coal_raw[t])**3 \
-7838.06 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**3)",
2: "(9402.37 * b.wall_temperature_waterwall[t, 1] \
+63618 * b.wall_temperature_waterwall[t, 2] \
+2118.88 * b.wall_temperature_waterwall[t, 3] \
+1821.84 * b.wall_temperature_waterwall[t, 4] \
-24586.5 * b.wall_temperature_waterwall[t, 5] \
+166.046 * b.wall_temperature_waterwall[t, 6] \
+695.921 * b.wall_temperature_waterwall[t, 7] \
+1070.12 * b.wall_temperature_waterwall[t, 8] \
-231.135 * b.wall_temperature_waterwall[t, 9] \
+18.6849 * b.wall_temperature_waterwall[t, 12] \
+1794.21 * b.wall_temperature_platen[t] \
+2842.9 * b.wall_temperature_roof[t] \
+2.04728e+06 * b.flowrate_coal_raw[t] \
+9.13283e+07 * b.mf_H2O_coal_raw[t] \
+6.91793e+06 * b.SR[t] \
+4.81359e+08 * b.SR_lf[t] \
-40341.5 * b.secondary_air_inlet.temperature[t] \
+1.1322e+06 * b.ratio_PA2coal[t] \
-4.24844e+06 * log(b.wall_temperature_waterwall[t, 1]) \
-1.67693e+07 * log(b.wall_temperature_waterwall[t, 2]) \
-1.2861e+06 * log(b.wall_temperature_waterwall[t, 3]) \
-4.45769e+06 * log(b.wall_temperature_waterwall[t, 4]) \
+9.0161e+06 * log(b.wall_temperature_waterwall[t, 5]) \
-537334 * log(b.wall_temperature_waterwall[t, 8]) \
+181486 * log(b.wall_temperature_waterwall[t, 9]) \
-715084 * log(b.wall_temperature_platen[t]) \
+4.61896e+06 * log(b.flowrate_coal_raw[t]) \
+30243.2 * log(b.mf_H2O_coal_raw[t]) \
-8.42989e+06 * log(b.SR[t]) \
-1.45952e+08 * log(b.SR_lf[t]) \
+9.65255e+06 * log(b.secondary_air_inlet.temperature[t]) \
+490346 * log(b.ratio_PA2coal[t]) \
-1.04352e+08 * exp(b.mf_H2O_coal_raw[t]) \
-1.24828e+08 * exp(b.SR_lf[t]) \
-30.804 * b.wall_temperature_waterwall[t, 2]**2 \
+9.2668 * b.wall_temperature_waterwall[t, 5]**2 \
-21962.3 * b.flowrate_coal_raw[t]**2 \
+185.889 * b.flowrate_coal_raw[t]**3 \
+0.0096263 * b.secondary_air_inlet.temperature[t]**3 \
-76.1054 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-81.3516 * b.wall_temperature_waterwall[t, 2]*b.flowrate_coal_raw[t] \
+1570.34 * b.wall_temperature_waterwall[t, 2]*b.mf_H2O_coal_raw[t] \
-2440.82 * b.wall_temperature_waterwall[t, 2]*b.SR_lf[t] \
+0.527827 * b.wall_temperature_waterwall[t, 2]*b.secondary_air_inlet.temperature[t] \
-31.6806 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
-11.9902 * b.wall_temperature_waterwall[t, 3]*b.flowrate_coal_raw[t] \
+1.17551 * b.wall_temperature_waterwall[t, 3]*b.secondary_air_inlet.temperature[t] \
+0.712584 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
-8.98673 * b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t] \
+6307.56 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
+1.03784 * b.wall_temperature_waterwall[t, 4]*b.secondary_air_inlet.temperature[t] \
-3.53159 * b.wall_temperature_waterwall[t, 5]*b.flowrate_coal_raw[t] \
-1225.87 * b.wall_temperature_waterwall[t, 5]*b.SR_lf[t] \
+85.2083 * b.wall_temperature_waterwall[t, 5]*b.ratio_PA2coal[t] \
+656.338 * b.wall_temperature_waterwall[t, 7]*b.mf_H2O_coal_raw[t] \
-674.09 * b.wall_temperature_waterwall[t, 7]*b.SR_lf[t] \
-0.265762 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_platen[t] \
-8.30267 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
+1227.37 * b.wall_temperature_waterwall[t, 8]*b.mf_H2O_coal_raw[t] \
+0.0526552 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 11] \
-0.407706 * b.wall_temperature_platen[t]*b.wall_temperature_roof[t] \
+7.81514 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
-1118.85 * b.wall_temperature_platen[t]*b.mf_H2O_coal_raw[t] \
-15.2498 * b.wall_temperature_platen[t]*b.ratio_PA2coal[t] \
-4845.51 * b.wall_temperature_roof[t]*b.mf_H2O_coal_raw[t] \
-3234.16 * b.wall_temperature_roof[t]*b.SR_lf[t] \
+0.69596 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-1.8204e+06 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-159924 * b.flowrate_coal_raw[t]*b.SR[t] \
-398436 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+1029.33 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-42896.7 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+3.55413e+06 * b.mf_H2O_coal_raw[t]*b.SR[t] \
+2.26223e+07 * b.mf_H2O_coal_raw[t]*b.SR_lf[t] \
-20279.8 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-3.77353e+06 * b.SR[t]*b.SR_lf[t] \
+308.059 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
+107358 * b.SR[t]*b.ratio_PA2coal[t] \
+20666.6 * b.SR_lf[t]*b.secondary_air_inlet.temperature[t] \
-2564.62 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.00107543 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
+0.000875275 * (b.wall_temperature_waterwall[t, 2]*b.flowrate_coal_raw[t])**2 \
-1.75451 * (b.wall_temperature_waterwall[t, 4]*b.SR[t])**2 \
+149896 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
+654.854 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-3875.11 * (b.flowrate_coal_raw[t]*b.SR_lf[t])**2 \
-0.00723196 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2 \
+91.9401 * (b.flowrate_coal_raw[t]*b.ratio_PA2coal[t])**2 \
+0.0961783 * (b.wall_temperature_roof[t]*b.mf_H2O_coal_raw[t])**3 \
-8608.57 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**3)",
3: "(2825.25 * b.wall_temperature_waterwall[t, 1] \
+3496.16 * b.wall_temperature_waterwall[t, 2] \
+39611.4 * b.wall_temperature_waterwall[t, 3] \
+2064.54 * b.wall_temperature_waterwall[t, 4] \
-19353.7 * b.wall_temperature_waterwall[t, 5] \
+140.98 * b.wall_temperature_waterwall[t, 6] \
-95.4723 * b.wall_temperature_waterwall[t, 7] \
+180.791 * b.wall_temperature_waterwall[t, 8] \
+20.6861 * b.wall_temperature_waterwall[t, 12] \
-77.5609 * b.wall_temperature_platen[t] \
+1.76659e+06 * b.flowrate_coal_raw[t] \
+2.73809e+07 * b.mf_H2O_coal_raw[t] \
+1.30314e+07 * b.SR[t] \
+2.99323e+08 * b.SR_lf[t] \
-8992.63 * b.secondary_air_inlet.temperature[t] \
+743538 * b.ratio_PA2coal[t] \
-1.21925e+06 * log(b.wall_temperature_waterwall[t, 1]) \
-1.70788e+06 * log(b.wall_temperature_waterwall[t, 2]) \
-1.11283e+07 * log(b.wall_temperature_waterwall[t, 3]) \
-1.15967e+06 * log(b.wall_temperature_waterwall[t, 4]) \
+6.95686e+06 * log(b.wall_temperature_waterwall[t, 5]) \
+3.12918e+06 * log(b.flowrate_coal_raw[t]) \
+86928.8 * log(b.mf_H2O_coal_raw[t]) \
-1.11133e+07 * log(b.SR[t]) \
-8.27815e+07 * log(b.SR_lf[t]) \
+317858 * log(b.ratio_PA2coal[t]) \
-4.84182e+07 * exp(b.mf_H2O_coal_raw[t]) \
-969324 * exp(b.SR[t]) \
-8.1132e+07 * exp(b.SR_lf[t]) \
-20.0424 * b.wall_temperature_waterwall[t, 3]**2 \
+7.21081 * b.wall_temperature_waterwall[t, 5]**2 \
+0.177218 * b.wall_temperature_waterwall[t, 8]**2 \
+0.469474 * b.wall_temperature_platen[t]**2 \
-19318.5 * b.flowrate_coal_raw[t]**2 \
+3.33513 * b.secondary_air_inlet.temperature[t]**2 \
+149.518 * b.flowrate_coal_raw[t]**3 \
-29.4453 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-32.348 * b.wall_temperature_waterwall[t, 2]*b.flowrate_coal_raw[t] \
+0.37361 * b.wall_temperature_waterwall[t, 2]*b.secondary_air_inlet.temperature[t] \
-49.1179 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
-0.0559492 * b.wall_temperature_waterwall[t, 3]*b.wall_temperature_waterwall[t, 8] \
-24.6599 * b.wall_temperature_waterwall[t, 3]*b.flowrate_coal_raw[t] \
+1.0472 * b.wall_temperature_waterwall[t, 3]*b.secondary_air_inlet.temperature[t] \
+0.051371 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 8] \
+0.291925 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
-7.09556 * b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t] \
-579.937 * b.wall_temperature_waterwall[t, 5]*b.SR_lf[t] \
+30.4256 * b.wall_temperature_waterwall[t, 5]*b.ratio_PA2coal[t] \
+0.187627 * b.wall_temperature_waterwall[t, 7]*b.wall_temperature_roof[t] \
+506.243 * b.wall_temperature_waterwall[t, 7]*b.mf_H2O_coal_raw[t] \
-0.209174 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_platen[t] \
-27.8211 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
+808.58 * b.wall_temperature_waterwall[t, 8]*b.mf_H2O_coal_raw[t] \
+0.0378872 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 11] \
-0.427984 * b.wall_temperature_platen[t]*b.wall_temperature_roof[t] \
+3.97146 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
-2.56524 * b.wall_temperature_platen[t]*b.ratio_PA2coal[t] \
-1.1316e+06 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-149208 * b.flowrate_coal_raw[t]*b.SR[t] \
-620763 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+692.429 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-27383.3 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+2.74367e+06 * b.mf_H2O_coal_raw[t]*b.SR[t] \
+2.19307e+07 * b.mf_H2O_coal_raw[t]*b.SR_lf[t] \
-12923.6 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-1.89277e+06 * b.SR[t]*b.SR_lf[t] \
+538.573 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
+91705.4 * b.SR[t]*b.ratio_PA2coal[t] \
+9695.45 * b.SR_lf[t]*b.secondary_air_inlet.temperature[t] \
-1698.89 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.000466813 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
+0.000489048 * (b.wall_temperature_waterwall[t, 2]*b.flowrate_coal_raw[t])**2 \
-0.0629385 * (b.wall_temperature_waterwall[t, 4]*b.SR[t])**2 \
+0.000414 * (b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t])**2 \
+94334.8 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
+647.348 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-0.00513905 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2 \
+57.4901 * (b.flowrate_coal_raw[t]*b.ratio_PA2coal[t])**2 \
-5271.02 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**3)",
4: "(30998 * b.wall_temperature_waterwall[t, 1] \
+2457.99 * b.wall_temperature_waterwall[t, 2] \
+1137.13 * b.wall_temperature_waterwall[t, 3] \
+19608.1 * b.wall_temperature_waterwall[t, 4] \
-19918.2 * b.wall_temperature_waterwall[t, 5] \
+919.01 * b.wall_temperature_waterwall[t, 6] \
+369.947 * b.wall_temperature_waterwall[t, 7] \
+646.454 * b.wall_temperature_waterwall[t, 8] \
+102.897 * b.wall_temperature_waterwall[t, 10] \
+24.8228 * b.wall_temperature_waterwall[t, 12] \
+1739.59 * b.wall_temperature_platen[t] \
+1.89204e+06 * b.flowrate_coal_raw[t] \
+6.68693e+07 * b.mf_H2O_coal_raw[t] \
+4.63505e+06 * b.SR[t] \
+4.53751e+08 * b.SR_lf[t] \
+1612.6 * b.secondary_air_inlet.temperature[t] \
+924842 * b.ratio_PA2coal[t] \
-1.07435e+07 * log(b.wall_temperature_waterwall[t, 1]) \
-1.48504e+06 * log(b.wall_temperature_waterwall[t, 2]) \
-750102 * log(b.wall_temperature_waterwall[t, 3]) \
-7.28634e+06 * log(b.wall_temperature_waterwall[t, 4]) \
+7.19016e+06 * log(b.wall_temperature_waterwall[t, 5]) \
-342011 * log(b.wall_temperature_waterwall[t, 6]) \
-465932 * log(b.wall_temperature_waterwall[t, 7]) \
-275633 * log(b.wall_temperature_waterwall[t, 8]) \
-500395 * log(b.wall_temperature_platen[t]) \
+3.33092e+06 * log(b.flowrate_coal_raw[t]) \
-1.06661e+07 * log(b.SR[t]) \
-1.71633e+08 * log(b.SR_lf[t]) \
-3.18827e+06 * log(b.secondary_air_inlet.temperature[t]) \
-8.32439e+07 * exp(b.mf_H2O_coal_raw[t]) \
-1.05477e+08 * exp(b.SR_lf[t]) \
-10.3499 * b.wall_temperature_waterwall[t, 1]**2 \
-12.7144 * b.wall_temperature_waterwall[t, 4]**2 \
+7.8685 * b.wall_temperature_waterwall[t, 5]**2 \
-19144.9 * b.flowrate_coal_raw[t]**2 \
+143.33 * b.flowrate_coal_raw[t]**3 \
-24.1862 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-28.4264 * b.wall_temperature_waterwall[t, 1]*b.mf_H2O_coal_raw[t] \
-312.37 * b.wall_temperature_waterwall[t, 1]*b.SR_lf[t] \
-3.62923 * b.wall_temperature_waterwall[t, 2]*b.flowrate_coal_raw[t] \
+0.58587 * b.wall_temperature_waterwall[t, 2]*b.secondary_air_inlet.temperature[t] \
-20.9999 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
-4.26059 * b.wall_temperature_waterwall[t, 3]*b.flowrate_coal_raw[t] \
+0.849726 * b.wall_temperature_waterwall[t, 3]*b.secondary_air_inlet.temperature[t] \
+0.383348 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
-31.1716 * b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t] \
+6795.15 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
-0.334707 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 6] \
+0.0296533 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_roof[t] \
-6.75789 * b.wall_temperature_waterwall[t, 5]*b.flowrate_coal_raw[t] \
-887.887 * b.wall_temperature_waterwall[t, 5]*b.SR_lf[t] \
+54.121 * b.wall_temperature_waterwall[t, 5]*b.ratio_PA2coal[t] \
+0.390219 * b.wall_temperature_waterwall[t, 7]*b.wall_temperature_roof[t] \
+617.963 * b.wall_temperature_waterwall[t, 7]*b.mf_H2O_coal_raw[t] \
-354.236 * b.wall_temperature_waterwall[t, 7]*b.SR_lf[t] \
+0.668885 * b.wall_temperature_waterwall[t, 7]*b.secondary_air_inlet.temperature[t] \
+0.368313 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_waterwall[t, 10] \
-0.224167 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_platen[t] \
-32.5371 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
+944.267 * b.wall_temperature_waterwall[t, 8]*b.mf_H2O_coal_raw[t] \
-0.444565 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_platen[t] \
+482.957 * b.wall_temperature_waterwall[t, 11]*b.mf_H2O_coal_raw[t] \
-0.448545 * b.wall_temperature_platen[t]*b.wall_temperature_roof[t] \
-92.9318 * b.wall_temperature_roof[t]*b.ratio_PA2coal[t] \
-965339 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-238814 * b.flowrate_coal_raw[t]*b.SR[t] \
-656822 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+742.242 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-26766.3 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
-1.27395e+06 * b.mf_H2O_coal_raw[t]*b.SR[t] \
+2.30581e+07 * b.mf_H2O_coal_raw[t]*b.SR_lf[t] \
-13952.1 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-269639 * b.mf_H2O_coal_raw[t]*b.ratio_PA2coal[t] \
+841.556 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
+84459.4 * b.SR[t]*b.ratio_PA2coal[t] \
+7494.08 * b.SR_lf[t]*b.secondary_air_inlet.temperature[t] \
-1672.75 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.000370175 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
-1.84302 * (b.wall_temperature_waterwall[t, 4]*b.SR[t])**2 \
+0.000463608 * (b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t])**2 \
+45660.1 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
+978.377 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-0.00577998 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2 \
+51.3598 * (b.flowrate_coal_raw[t]*b.ratio_PA2coal[t])**2 \
+1.03552e+07 * (b.mf_H2O_coal_raw[t]*b.SR[t])**2)",
5: "(1381.36 * b.wall_temperature_waterwall[t, 1] \
+2323.67 * b.wall_temperature_waterwall[t, 2] \
+16.5773 * b.wall_temperature_waterwall[t, 3] \
+1352.22 * b.wall_temperature_waterwall[t, 4] \
-16466.5 * b.wall_temperature_waterwall[t, 5] \
+899.714 * b.wall_temperature_waterwall[t, 6] \
+3.93998 * b.wall_temperature_waterwall[t, 7] \
+1266.5 * b.wall_temperature_waterwall[t, 8] \
+27.0207 * b.wall_temperature_waterwall[t, 12] \
+1538.23 * b.wall_temperature_platen[t] \
+2873.09 * b.wall_temperature_roof[t] \
+1.97605e+06 * b.flowrate_coal_raw[t] \
-1.23146e+08 * b.mf_H2O_coal_raw[t] \
+7.90727e+06 * b.SR[t] \
-8.28156e+07 * b.SR_lf[t] \
+8409.65 * b.secondary_air_inlet.temperature[t] \
+771488 * b.ratio_PA2coal[t] \
-512140 * log(b.wall_temperature_waterwall[t, 1]) \
-960400 * log(b.wall_temperature_waterwall[t, 2]) \
-1.69396e+06 * log(b.wall_temperature_waterwall[t, 5]) \
-578390 * log(b.wall_temperature_waterwall[t, 8]) \
-500164 * log(b.wall_temperature_platen[t]) \
+3.27151e+06 * log(b.flowrate_coal_raw[t]) \
-207751 * log(b.mf_H2O_coal_raw[t]) \
-1.3498e+07 * log(b.SR[t]) \
+7.59142e+07 * log(b.SR_lf[t]) \
-3.4224e+06 * log(b.secondary_air_inlet.temperature[t]) \
+1.08294e+08 * exp(b.mf_H2O_coal_raw[t]) \
+0.728811 * b.wall_temperature_waterwall[t, 4]**2 \
-18833.1 * b.flowrate_coal_raw[t]**2 \
-9.85614e+07 * b.mf_H2O_coal_raw[t]**2 \
+120.533 * b.flowrate_coal_raw[t]**3 \
-0.0492326 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 11] \
-22.6501 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-0.453682 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-0.372273 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_platen[t] \
+0.420252 * b.wall_temperature_waterwall[t, 2]*b.secondary_air_inlet.temperature[t] \
-78.644 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
-0.548922 * b.wall_temperature_waterwall[t, 3]*b.wall_temperature_waterwall[t, 4] \
+0.782376 * b.wall_temperature_waterwall[t, 3]*b.wall_temperature_waterwall[t, 11] \
+176.927 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
-0.0216351 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 8] \
+0.521495 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
-23.7278 * b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t] \
-354.669 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
-1800.24 * b.wall_temperature_waterwall[t, 4]*b.SR_lf[t] \
+1.00785 * b.wall_temperature_waterwall[t, 4]*b.secondary_air_inlet.temperature[t] \
-0.320146 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 6] \
-36.3443 * b.wall_temperature_waterwall[t, 5]*b.flowrate_coal_raw[t] \
-276.22 * b.wall_temperature_waterwall[t, 5]*b.SR[t] \
+31986.7 * b.wall_temperature_waterwall[t, 5]*b.SR_lf[t] \
-33.1281 * b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t] \
+0.337834 * b.wall_temperature_waterwall[t, 7]*b.secondary_air_inlet.temperature[t] \
-22.6854 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
+0.0949332 * b.wall_temperature_waterwall[t, 9]*b.wall_temperature_waterwall[t, 10] \
-0.836476 * b.wall_temperature_waterwall[t, 11]*b.secondary_air_inlet.temperature[t] \
-0.524954 * b.wall_temperature_platen[t]*b.wall_temperature_roof[t] \
+3.06373 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+424.529 * b.wall_temperature_roof[t]*b.mf_H2O_coal_raw[t] \
-2856.66 * b.wall_temperature_roof[t]*b.SR_lf[t] \
-983765 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-407939 * b.flowrate_coal_raw[t]*b.SR[t] \
-532340 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+744.637 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-24675.1 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+6.59033e+06 * b.mf_H2O_coal_raw[t]*b.SR[t] \
+1.76578e+07 * b.mf_H2O_coal_raw[t]*b.SR_lf[t] \
-14012.2 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
+2047.81 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
+136654 * b.SR[t]*b.ratio_PA2coal[t] \
-1520.71 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.000356587 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
+0.000348091 * (b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t])**2 \
-11.5928 * (b.wall_temperature_waterwall[t, 5]*b.SR_lf[t])**2 \
+0.000500883 * (b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t])**2 \
+0.000224347 * (b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t])**2 \
-0.0108347 * (b.wall_temperature_roof[t]*b.ratio_PA2coal[t])**2 \
+46556.5 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
+1577.66 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-0.00554362 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2 \
+43.5639 * (b.flowrate_coal_raw[t]*b.ratio_PA2coal[t])**2)",
6: "(23766.1 * b.wall_temperature_waterwall[t, 1] \
+1109.67 * b.wall_temperature_waterwall[t, 2] \
-411.801 * b.wall_temperature_waterwall[t, 3] \
+1277.07 * b.wall_temperature_waterwall[t, 4] \
+1664.61 * b.wall_temperature_waterwall[t, 5] \
-144143 * b.wall_temperature_waterwall[t, 6] \
+321.352 * b.wall_temperature_waterwall[t, 7] \
+2667.15 * b.wall_temperature_waterwall[t, 8] \
+812.223 * b.wall_temperature_waterwall[t, 9] \
+278.07 * b.wall_temperature_waterwall[t, 10] \
-357.846 * b.wall_temperature_waterwall[t, 11] \
+955.339 * b.wall_temperature_waterwall[t, 12] \
+1101.44 * b.wall_temperature_platen[t] \
-1083.91 * b.wall_temperature_roof[t] \
+1.87747e+06 * b.flowrate_coal_raw[t] \
+6.52201e+07 * b.mf_H2O_coal_raw[t] \
+1.15786e+07 * b.SR[t] \
+78146.6 * b.SR_lf[t] \
+8886.98 * b.secondary_air_inlet.temperature[t] \
+349860 * b.ratio_PA2coal[t] \
-1.03956e+07 * log(b.wall_temperature_waterwall[t, 1]) \
+410736 * log(b.wall_temperature_waterwall[t, 3]) \
+2.84904e+07 * log(b.wall_temperature_waterwall[t, 6]) \
-982762 * log(b.wall_temperature_waterwall[t, 8]) \
-638942 * log(b.wall_temperature_platen[t]) \
+2.51419e+06 * log(b.flowrate_coal_raw[t]) \
-355831 * log(b.mf_H2O_coal_raw[t]) \
-3.22971e+07 * log(b.SR[t]) \
-3.53833e+06 * log(b.secondary_air_inlet.temperature[t]) \
-7.27122e+07 * exp(b.mf_H2O_coal_raw[t]) \
+121.792 * b.wall_temperature_waterwall[t, 6]**2 \
-17167.1 * b.flowrate_coal_raw[t]**2 \
-0.00511324 * b.wall_temperature_waterwall[t, 1]**3 \
-0.0481974 * b.wall_temperature_waterwall[t, 6]**3 \
+74.4938 * b.flowrate_coal_raw[t]**3 \
-0.919796 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 8] \
+0.0606529 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 10] \
-46.0797 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-0.499405 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-181.556 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
+116.97 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
+0.393401 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 6] \
+0.675614 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 10] \
-753.901 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
-2042.45 * b.wall_temperature_waterwall[t, 4]*b.SR_lf[t] \
+2.15852 * b.wall_temperature_waterwall[t, 4]*b.secondary_air_inlet.temperature[t] \
-0.224207 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 8] \
+0.275077 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 10] \
-620.705 * b.wall_temperature_waterwall[t, 5]*b.SR[t] \
-99.9039 * b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t] \
-14.5881 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
-534.118 * b.wall_temperature_waterwall[t, 9]*b.SR[t] \
-1.31088 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 12] \
-1.41959 * b.wall_temperature_waterwall[t, 11]*b.flowrate_coal_raw[t] \
+177.07 * b.wall_temperature_waterwall[t, 11]*b.ratio_PA2coal[t] \
+0.753534 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+7.17536 * b.wall_temperature_roof[t]*b.flowrate_coal_raw[t] \
+1.88795 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-83.1177 * b.wall_temperature_roof[t]*b.ratio_PA2coal[t] \
-796480 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-1.00571e+06 * b.flowrate_coal_raw[t]*b.SR[t] \
+101563 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+662.665 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-12441.5 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+1.61179e+07 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-11495.5 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
+8.29731e+06 * b.SR[t]*b.SR_lf[t] \
+6537.87 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
+160251 * b.SR[t]*b.ratio_PA2coal[t] \
-9390.64 * b.SR_lf[t]*b.secondary_air_inlet.temperature[t] \
-957.772 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.000819586 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
+0.00102671 * (b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t])**2 \
-2.36557e-06 * (b.wall_temperature_waterwall[t, 7]*b.flowrate_coal_raw[t])**2 \
+37045.4 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
+3479.38 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-0.00390226 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2)",
7: "(353.147 * b.wall_temperature_waterwall[t, 1] \
+944.788 * b.wall_temperature_waterwall[t, 2] \
-715.67 * b.wall_temperature_waterwall[t, 3] \
-113.773 * b.wall_temperature_waterwall[t, 4] \
+1714.33 * b.wall_temperature_waterwall[t, 5] \
+1186.75 * b.wall_temperature_waterwall[t, 6] \
-41011.8 * b.wall_temperature_waterwall[t, 7] \
+2313.62 * b.wall_temperature_waterwall[t, 8] \
+1044.74 * b.wall_temperature_waterwall[t, 9] \
-193.394 * b.wall_temperature_waterwall[t, 10] \
-1258.23 * b.wall_temperature_waterwall[t, 11] \
+971.027 * b.wall_temperature_waterwall[t, 12] \
+1359.51 * b.wall_temperature_platen[t] \
-694.308 * b.wall_temperature_roof[t] \
+1.69143e+06 * b.flowrate_coal_raw[t] \
-1.14413e+07 * b.mf_H2O_coal_raw[t] \
+8.24903e+06 * b.SR[t] \
-157814 * b.SR_lf[t] \
+2768.6 * b.secondary_air_inlet.temperature[t] \
+477829 * b.ratio_PA2coal[t] \
+146588 * log(b.wall_temperature_waterwall[t, 1]) \
+581939 * log(b.wall_temperature_waterwall[t, 3]) \
-224896 * log(b.wall_temperature_waterwall[t, 4]) \
-1.10027e+06 * log(b.wall_temperature_waterwall[t, 8]) \
-785548 * log(b.wall_temperature_platen[t]) \
+2.17579e+06 * log(b.flowrate_coal_raw[t]) \
-254748 * log(b.mf_H2O_coal_raw[t]) \
-2.27807e+07 * log(b.SR[t]) \
+59.8201 * b.wall_temperature_waterwall[t, 7]**2 \
-13890.7 * b.flowrate_coal_raw[t]**2 \
-3.2383e+07 * b.mf_H2O_coal_raw[t]**2 \
-0.0319362 * b.wall_temperature_waterwall[t, 7]**3 \
+52.1526 * b.flowrate_coal_raw[t]**3 \
-0.830502 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 8] \
+0.226652 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 10] \
-76.2281 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
+779.831 * b.wall_temperature_waterwall[t, 1]*b.SR_lf[t] \
-0.348643 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-196.262 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
+127.532 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
+0.125889 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 6] \
-0.214732 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 8] \
+0.810439 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 10] \
-698.238 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
+1.85785 * b.wall_temperature_waterwall[t, 4]*b.secondary_air_inlet.temperature[t] \
-0.436732 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 8] \
+0.407706 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 10] \
-4.17827 * b.wall_temperature_waterwall[t, 5]*b.flowrate_coal_raw[t] \
-703.956 * b.wall_temperature_waterwall[t, 5]*b.SR[t] \
-0.85661 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_waterwall[t, 12] \
-9.60464 * b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t] \
-34.2924 * b.wall_temperature_waterwall[t, 7]*b.flowrate_coal_raw[t] \
+1107.63 * b.wall_temperature_waterwall[t, 7]*b.mf_H2O_coal_raw[t] \
+1.26848 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_waterwall[t, 11] \
-17.4004 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
-658.546 * b.wall_temperature_waterwall[t, 9]*b.SR[t] \
-1.01075 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 12] \
-2.06046 * b.wall_temperature_waterwall[t, 11]*b.flowrate_coal_raw[t] \
+177.497 * b.wall_temperature_waterwall[t, 11]*b.ratio_PA2coal[t] \
+52.1763 * b.wall_temperature_waterwall[t, 12]*b.flowrate_coal_raw[t] \
+0.450986 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+7.72431 * b.wall_temperature_roof[t]*b.flowrate_coal_raw[t] \
+1.57739 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-173.703 * b.wall_temperature_roof[t]*b.ratio_PA2coal[t] \
-718200 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-942875 * b.flowrate_coal_raw[t]*b.SR[t] \
+175527 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+441.476 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-10706.6 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+1.62442e+07 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-8678.04 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
+5.56242e+06 * b.SR[t]*b.SR_lf[t] \
+7113.57 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
-9979.24 * b.SR_lf[t]*b.secondary_air_inlet.temperature[t] \
-650.626 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.00138792 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
-0.00105797 * (b.wall_temperature_waterwall[t, 12]*b.flowrate_coal_raw[t])**2 \
+33941.2 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
+2634.71 * (b.flowrate_coal_raw[t]*b.SR[t])**2)",
8: "(30738.3 * b.wall_temperature_waterwall[t, 1] \
+635.315 * b.wall_temperature_waterwall[t, 2] \
-737.628 * b.wall_temperature_waterwall[t, 3] \
+613.096 * b.wall_temperature_waterwall[t, 4] \
+1198.21 * b.wall_temperature_waterwall[t, 5] \
+28980.1 * b.wall_temperature_waterwall[t, 6] \
-86338.9 * b.wall_temperature_waterwall[t, 7] \
-16399.5 * b.wall_temperature_waterwall[t, 8] \
+1028.24 * b.wall_temperature_waterwall[t, 9] \
+288.999 * b.wall_temperature_waterwall[t, 10] \
-1919.18 * b.wall_temperature_waterwall[t, 11] \
+1183.65 * b.wall_temperature_waterwall[t, 12] \
+1613.28 * b.wall_temperature_platen[t] \
-809.056 * b.wall_temperature_roof[t] \
+1.29475e+06 * b.flowrate_coal_raw[t] \
+2.75866e+07 * b.mf_H2O_coal_raw[t] \
+6.67449e+06 * b.SR[t] \
+5.28363e+07 * b.SR_lf[t] \
-3717.86 * b.secondary_air_inlet.temperature[t] \
+385624 * b.ratio_PA2coal[t] \
-1.00557e+07 * log(b.wall_temperature_waterwall[t, 1]) \
+559241 * log(b.wall_temperature_waterwall[t, 3]) \
-1.01411e+07 * log(b.wall_temperature_waterwall[t, 6]) \
+1.14643e+07 * log(b.wall_temperature_waterwall[t, 7]) \
+9.46655e+06 * log(b.wall_temperature_waterwall[t, 8]) \
-894841 * log(b.wall_temperature_platen[t]) \
+1.54449e+06 * log(b.flowrate_coal_raw[t]) \
-122538 * log(b.mf_H2O_coal_raw[t]) \
-1.6811e+07 * log(b.SR[t]) \
-5.55471e+07 * log(b.SR_lf[t]) \
-2.83514e+06 * log(b.secondary_air_inlet.temperature[t]) \
-4.07619e+07 * exp(b.mf_H2O_coal_raw[t]) \
-10.6528 * b.wall_temperature_waterwall[t, 1]**2 \
+0.272176 * b.wall_temperature_waterwall[t, 4]**2 \
-9.34661 * b.wall_temperature_waterwall[t, 6]**2 \
+86.226 * b.wall_temperature_waterwall[t, 7]**2 \
-6869.16 * b.flowrate_coal_raw[t]**2 \
-0.0341736 * b.wall_temperature_waterwall[t, 7]**3 \
-0.908054 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 8] \
-64.9931 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-0.1575 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-145.333 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
+124.842 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
+0.652536 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 10] \
-697.56 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
-1290.22 * b.wall_temperature_waterwall[t, 4]*b.SR_lf[t] \
+1.54101 * b.wall_temperature_waterwall[t, 4]*b.secondary_air_inlet.temperature[t] \
-0.340243 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 8] \
+0.186733 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 10] \
+0.264209 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 12] \
-600.521 * b.wall_temperature_waterwall[t, 5]*b.SR[t] \
-1.06736 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_waterwall[t, 12] \
-8.99471 * b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t] \
+2.71176 * b.wall_temperature_waterwall[t, 7]*b.flowrate_coal_raw[t] \
+0.727491 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_waterwall[t, 11] \
-50.9128 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
-666.436 * b.wall_temperature_waterwall[t, 8]*b.SR[t] \
-0.100745 * b.wall_temperature_waterwall[t, 9]*b.wall_temperature_waterwall[t, 10] \
-530.861 * b.wall_temperature_waterwall[t, 9]*b.SR[t] \
-0.824416 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 12] \
-2.53957 * b.wall_temperature_waterwall[t, 11]*b.flowrate_coal_raw[t] \
+166.069 * b.wall_temperature_waterwall[t, 11]*b.ratio_PA2coal[t] \
+0.638522 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+6.65548 * b.wall_temperature_roof[t]*b.flowrate_coal_raw[t] \
+1.65814 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-132.374 * b.wall_temperature_roof[t]*b.ratio_PA2coal[t] \
-636864 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-703357 * b.flowrate_coal_raw[t]*b.SR[t] \
+191874 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+531.415 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-9232.96 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+1.59172e+07 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-8594.17 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
+3.30615e+06 * b.SR[t]*b.SR_lf[t] \
+6573.55 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
-555.335 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.00118832 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
+0.846319 * (b.wall_temperature_waterwall[t, 11]*b.SR_lf[t])**2 \
+28243.5 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
-834.918 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-0.00281944 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2 \
+23.2033 * (b.flowrate_coal_raw[t]*b.SR[t])**3)",
9: "(1554.78 * b.wall_temperature_waterwall[t, 1] \
+292.513 * b.wall_temperature_waterwall[t, 2] \
-686.842 * b.wall_temperature_waterwall[t, 3] \
+504.056 * b.wall_temperature_waterwall[t, 4] \
+1072 * b.wall_temperature_waterwall[t, 5] \
+33410.5 * b.wall_temperature_waterwall[t, 6] \
+52811.6 * b.wall_temperature_waterwall[t, 7] \
+2682.22 * b.wall_temperature_waterwall[t, 8] \
+59476.3 * b.wall_temperature_waterwall[t, 9] \
+1980.99 * b.wall_temperature_waterwall[t, 10] \
-418.882 * b.wall_temperature_waterwall[t, 11] \
+979.077 * b.wall_temperature_waterwall[t, 12] \
+2613.03 * b.wall_temperature_platen[t] \
-325.642 * b.wall_temperature_roof[t] \
+1.11231e+06 * b.flowrate_coal_raw[t] \
+2.63584e+07 * b.mf_H2O_coal_raw[t] \
+5.72152e+06 * b.SR[t] \
+3.15685e+08 * b.SR_lf[t] \
-6126.97 * b.secondary_air_inlet.temperature[t] \
-349285 * b.ratio_PA2coal[t] \
+417256 * log(b.wall_temperature_waterwall[t, 1]) \
+3.53244e+06 * log(b.wall_temperature_waterwall[t, 3]) \
-360670 * log(b.wall_temperature_waterwall[t, 4]) \
+4.18922e+06 * log(b.wall_temperature_waterwall[t, 5]) \
-1.17359e+07 * log(b.wall_temperature_waterwall[t, 6]) \
-1.90854e+07 * log(b.wall_temperature_waterwall[t, 7]) \
-1.19489e+06 * log(b.wall_temperature_waterwall[t, 8]) \
-1.73885e+07 * log(b.wall_temperature_waterwall[t, 9]) \
-848457 * log(b.wall_temperature_waterwall[t, 10]) \
-1.39216e+06 * log(b.wall_temperature_platen[t]) \
+20679.5 * log(b.wall_temperature_roof[t]) \
+1.18208e+06 * log(b.flowrate_coal_raw[t]) \
-138694 * log(b.mf_H2O_coal_raw[t]) \
-3.86313e+06 * log(b.SR[t]) \
-1.78945e+08 * log(b.SR_lf[t]) \
-3.73556e+07 * exp(b.mf_H2O_coal_raw[t]) \
-11.0194 * b.wall_temperature_waterwall[t, 6]**2 \
-17.719 * b.wall_temperature_waterwall[t, 7]**2 \
-26.8571 * b.wall_temperature_waterwall[t, 9]**2 \
-3871.37 * b.flowrate_coal_raw[t]**2 \
-6.88157e+07 * b.SR_lf[t]**2 \
-24.6314 * b.flowrate_coal_raw[t]**3 \
-0.898065 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 8] \
-50.8152 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-1.50253 * b.wall_temperature_waterwall[t, 1]*b.secondary_air_inlet.temperature[t] \
-0.176067 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-0.045357 * b.wall_temperature_waterwall[t, 3]*b.wall_temperature_waterwall[t, 12] \
-6290.31 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
+0.0280148 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 6] \
-0.0760966 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_platen[t] \
-543.634 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
+1.55669 * b.wall_temperature_waterwall[t, 4]*b.secondary_air_inlet.temperature[t] \
-0.462604 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 8] \
+0.552709 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 10] \
-0.187582 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 11] \
+0.311448 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 12] \
-9598.22 * b.wall_temperature_waterwall[t, 5]*b.SR[t] \
-0.893275 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_waterwall[t, 12] \
-0.0718352 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_roof[t] \
-7.00461 * b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t] \
-0.347099 * b.wall_temperature_waterwall[t, 7]*b.wall_temperature_waterwall[t, 10] \
+0.986772 * b.wall_temperature_waterwall[t, 7]*b.flowrate_coal_raw[t] \
+0.874394 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_waterwall[t, 11] \
-13.7583 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
-0.111941 * b.wall_temperature_waterwall[t, 9]*b.wall_temperature_waterwall[t, 10] \
-38.4122 * b.wall_temperature_waterwall[t, 9]*b.flowrate_coal_raw[t] \
-926.033 * b.wall_temperature_waterwall[t, 9]*b.SR[t] \
-0.719251 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 12] \
+0.311257 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+0.973601 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-86.0127 * b.wall_temperature_roof[t]*b.ratio_PA2coal[t] \
-573877 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-518729 * b.flowrate_coal_raw[t]*b.SR[t] \
+177185 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+356.318 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-8350.35 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+1.40375e+07 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-7543.82 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
+6147.42 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
+695872 * b.SR_lf[t]*b.ratio_PA2coal[t] \
-464.964 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.000944236 * (b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t])**2 \
+1.68544 * (b.wall_temperature_waterwall[t, 3]*b.SR[t])**2 \
+2.37726 * (b.wall_temperature_waterwall[t, 5]*b.SR[t])**2 \
-2.11316e-05 * (b.wall_temperature_waterwall[t, 11]*b.flowrate_coal_raw[t])**2 \
+23969.4 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
-2523.54 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
+31.1715 * (b.flowrate_coal_raw[t]*b.SR[t])**3)",
10: "(1837.36 * b.wall_temperature_waterwall[t, 1] \
+729.997 * b.wall_temperature_waterwall[t, 2] \
-230.755 * b.wall_temperature_waterwall[t, 3] \
+862.309 * b.wall_temperature_waterwall[t, 4] \
-167.942 * b.wall_temperature_waterwall[t, 5] \
+2060.72 * b.wall_temperature_waterwall[t, 6] \
+47434.8 * b.wall_temperature_waterwall[t, 7] \
+2552 * b.wall_temperature_waterwall[t, 8] \
+2565.36 * b.wall_temperature_waterwall[t, 9] \
+12188 * b.wall_temperature_waterwall[t, 10] \
-383.468 * b.wall_temperature_waterwall[t, 11] \
-125.387 * b.wall_temperature_waterwall[t, 12] \
+5141.33 * b.wall_temperature_platen[t] \
-312.616 * b.wall_temperature_roof[t] \
+1.17132e+06 * b.flowrate_coal_raw[t] \
+4.60141e+07 * b.mf_H2O_coal_raw[t] \
+2.69988e+06 * b.SR[t] \
+2.93429e+08 * b.SR_lf[t] \
-7395.61 * b.secondary_air_inlet.temperature[t] \
+367885 * b.ratio_PA2coal[t] \
-112755 * log(b.wall_temperature_waterwall[t, 1]) \
-816926 * log(b.wall_temperature_waterwall[t, 4]) \
-627025 * log(b.wall_temperature_waterwall[t, 6]) \
-1.72497e+07 * log(b.wall_temperature_waterwall[t, 7]) \
-1.30207e+06 * log(b.wall_temperature_waterwall[t, 8]) \
-833056 * log(b.wall_temperature_waterwall[t, 9]) \
-2.73476e+06 * log(b.wall_temperature_platen[t]) \
+790545 * log(b.flowrate_coal_raw[t]) \
-289014 * log(b.mf_H2O_coal_raw[t]) \
-8.88643e+06 * log(b.SR[t]) \
-1.68062e+08 * log(b.SR_lf[t]) \
-5.5004e+07 * exp(b.mf_H2O_coal_raw[t]) \
-4.59464e+07 * exp(b.SR_lf[t]) \
-15.9244 * b.wall_temperature_waterwall[t, 7]**2 \
-12.4671 * b.wall_temperature_waterwall[t, 10]**2 \
-0.0548467 * b.wall_temperature_platen[t]**2 \
-3084.74 * b.flowrate_coal_raw[t]**2 \
-20.7712 * b.flowrate_coal_raw[t]**3 \
-3.52178 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-2.37475 * b.wall_temperature_waterwall[t, 1]*b.secondary_air_inlet.temperature[t] \
-0.208333 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-171.455 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
+306.026 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
-0.15677 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 6] \
+1.33655 * b.wall_temperature_waterwall[t, 4]*b.secondary_air_inlet.temperature[t] \
+0.485426 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 10] \
+0.374308 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 12] \
-0.828451 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_waterwall[t, 12] \
-0.180578 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_roof[t] \
-13.9066 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
-671.924 * b.wall_temperature_waterwall[t, 9]*b.SR[t] \
+0.538709 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 11] \
-56.0447 * b.wall_temperature_waterwall[t, 10]*b.flowrate_coal_raw[t] \
-712.621 * b.wall_temperature_waterwall[t, 10]*b.SR[t] \
+44.9712 * b.wall_temperature_waterwall[t, 12]*b.flowrate_coal_raw[t] \
+75.2145 * b.wall_temperature_waterwall[t, 12]*b.ratio_PA2coal[t] \
-5.25712 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+0.836281 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-693841 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-489211 * b.flowrate_coal_raw[t]*b.SR[t] \
+199410 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+409.786 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-9506.34 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+1.57634e+07 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-9269.71 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
+7874.35 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
-575.815 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.019545 * (b.wall_temperature_waterwall[t, 11]*b.ratio_PA2coal[t])**2 \
-0.000956923 * (b.wall_temperature_waterwall[t, 12]*b.flowrate_coal_raw[t])**2 \
+26897.5 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
-3926.81 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-6.04217e-05 * (b.wall_temperature_waterwall[t, 4]*b.SR[t])**3 \
+39.5236 * (b.flowrate_coal_raw[t]*b.SR[t])**3)",
11: "(265.482 * b.wall_temperature_waterwall[t, 1] \
+24.2531 * b.wall_temperature_waterwall[t, 2] \
-632.925 * b.wall_temperature_waterwall[t, 3] \
+114.247 * b.wall_temperature_waterwall[t, 4] \
+28.3431 * b.wall_temperature_waterwall[t, 5] \
+445.719 * b.wall_temperature_waterwall[t, 6] \
+1363.91 * b.wall_temperature_waterwall[t, 7] \
+595.684 * b.wall_temperature_waterwall[t, 8] \
+1378.1 * b.wall_temperature_waterwall[t, 9] \
+1082.57 * b.wall_temperature_waterwall[t, 10] \
+29176.4 * b.wall_temperature_waterwall[t, 11] \
+385.741 * b.wall_temperature_waterwall[t, 12] \
-9989.8 * b.wall_temperature_platen[t] \
-387.904 * b.wall_temperature_roof[t] \
+459422 * b.flowrate_coal_raw[t] \
-8.16755e+06 * b.mf_H2O_coal_raw[t] \
-2.7349e+06 * b.SR[t] \
+2.68906e+07 * b.SR_lf[t] \
-3539.12 * b.secondary_air_inlet.temperature[t] \
+341694 * b.ratio_PA2coal[t] \
+143448 * log(b.wall_temperature_waterwall[t, 1]) \
+137163 * log(b.wall_temperature_waterwall[t, 3]) \
-174890 * log(b.wall_temperature_waterwall[t, 4]) \
-283768 * log(b.wall_temperature_waterwall[t, 6]) \
-313430 * log(b.wall_temperature_waterwall[t, 7]) \
-421769 * log(b.wall_temperature_waterwall[t, 8]) \
-498950 * log(b.wall_temperature_waterwall[t, 9]) \
-628469 * log(b.wall_temperature_waterwall[t, 10]) \
-4.79246e+06 * log(b.wall_temperature_waterwall[t, 11]) \
+2.7541e+06 * log(b.wall_temperature_platen[t]) \
-30902.5 * log(b.flowrate_coal_raw[t]) \
+423000 * log(b.SR[t]) \
-2.62773e+07 * log(b.SR_lf[t]) \
-856849 * log(b.secondary_air_inlet.temperature[t]) \
-976839 * exp(b.SR_lf[t]) \
-18.8883 * b.wall_temperature_waterwall[t, 11]**2 \
-397.68 * b.flowrate_coal_raw[t]**2 \
+0.00509064 * b.wall_temperature_platen[t]**3 \
+0.000109843 * b.wall_temperature_roof[t]**3 \
-13.0398 * b.flowrate_coal_raw[t]**3 \
-7.10244e+06 * b.mf_H2O_coal_raw[t]**3 \
-0.475103 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 12] \
-1.28357 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
+86.2882 * b.wall_temperature_waterwall[t, 1]*b.SR[t] \
+446.141 * b.wall_temperature_waterwall[t, 1]*b.SR_lf[t] \
-0.996705 * b.wall_temperature_waterwall[t, 1]*b.secondary_air_inlet.temperature[t] \
+0.0280906 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
+0.232787 * b.wall_temperature_waterwall[t, 2]*b.secondary_air_inlet.temperature[t] \
-48.0401 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
+162.375 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
+297.717 * b.wall_temperature_waterwall[t, 3]*b.SR_lf[t] \
+0.232195 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
+2.02509 * b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t] \
+0.0771506 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 12] \
-2.17805 * b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t] \
+2186.86 * b.wall_temperature_waterwall[t, 6]*b.mf_H2O_coal_raw[t] \
-2.97757 * b.wall_temperature_waterwall[t, 6]*b.ratio_PA2coal[t] \
-0.0238492 * b.wall_temperature_waterwall[t, 7]*b.wall_temperature_waterwall[t, 11] \
+226.047 * b.wall_temperature_waterwall[t, 7]*b.SR[t] \
-1085.84 * b.wall_temperature_waterwall[t, 7]*b.SR_lf[t] \
+0.236826 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_waterwall[t, 10] \
-2.73927 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
+539.145 * b.wall_temperature_waterwall[t, 8]*b.mf_H2O_coal_raw[t] \
-0.104024 * b.wall_temperature_waterwall[t, 9]*b.wall_temperature_roof[t] \
-291.787 * b.wall_temperature_waterwall[t, 9]*b.SR[t] \
+13.4721 * b.wall_temperature_waterwall[t, 10]*b.flowrate_coal_raw[t] \
-124.929 * b.wall_temperature_waterwall[t, 10]*b.SR[t] \
-15.757 * b.wall_temperature_waterwall[t, 11]*b.flowrate_coal_raw[t] \
-4817.97 * b.wall_temperature_waterwall[t, 11]*b.SR[t] \
+1892.85 * b.wall_temperature_waterwall[t, 11]*b.SR_lf[t] \
+1.63258 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+2676.98 * b.wall_temperature_platen[t]*b.SR[t] \
+0.49742 * b.wall_temperature_platen[t]*b.secondary_air_inlet.temperature[t] \
-72.8604 * b.wall_temperature_platen[t]*b.ratio_PA2coal[t] \
+0.430275 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-310586 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-142967 * b.flowrate_coal_raw[t]*b.SR[t] \
+88449.6 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+217.961 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-7117.74 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+6.1753e+06 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-3411.28 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-106414 * b.mf_H2O_coal_raw[t]*b.ratio_PA2coal[t] \
+845856 * b.SR[t]*b.SR_lf[t] \
+4202.28 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
-340.792 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
-5.1335e-05 * (b.wall_temperature_waterwall[t, 9]*b.flowrate_coal_raw[t])**2 \
-0.000310581 * (b.wall_temperature_waterwall[t, 10]*b.flowrate_coal_raw[t])**2 \
+1.18396 * (b.wall_temperature_waterwall[t, 11]*b.SR[t])**2 \
-0.716778 * (b.wall_temperature_platen[t]*b.SR[t])**2 \
+11739 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
-2422.02 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-0.000797508 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2 \
+16.1006 * (b.flowrate_coal_raw[t]*b.ratio_PA2coal[t])**2 \
-0.0417793 * (b.wall_temperature_waterwall[t, 6]*b.mf_H2O_coal_raw[t])**3 \
+19.1183 * (b.flowrate_coal_raw[t]*b.SR[t])**3)",
12: "(220.386 * b.wall_temperature_waterwall[t, 1] \
+67.4508 * b.wall_temperature_waterwall[t, 2] \
-53.5201 * b.wall_temperature_waterwall[t, 3] \
+168.186 * b.wall_temperature_waterwall[t, 4] \
+164.298 * b.wall_temperature_waterwall[t, 5] \
+274.74 * b.wall_temperature_waterwall[t, 6] \
+159.494 * b.wall_temperature_waterwall[t, 7] \
+274.631 * b.wall_temperature_waterwall[t, 8] \
+589.546 * b.wall_temperature_waterwall[t, 9] \
+692.692 * b.wall_temperature_waterwall[t, 10] \
-125.502 * b.wall_temperature_waterwall[t, 11] \
+43494.6 * b.wall_temperature_waterwall[t, 12] \
-33880.3 * b.wall_temperature_platen[t] \
-9863.55 * b.wall_temperature_roof[t] \
+241200 * b.flowrate_coal_raw[t] \
+2.77276e+07 * b.mf_H2O_coal_raw[t] \
-2.88054e+06 * b.SR[t] \
+1.06869e+07 * b.SR_lf[t] \
-14610.7 * b.secondary_air_inlet.temperature[t] \
+172036 * b.ratio_PA2coal[t] \
+47797.2 * log(b.wall_temperature_waterwall[t, 1]) \
-11594.2 * log(b.wall_temperature_waterwall[t, 3]) \
-125501 * log(b.wall_temperature_waterwall[t, 4]) \
-144576 * log(b.wall_temperature_waterwall[t, 6]) \
-198449 * log(b.wall_temperature_waterwall[t, 7]) \
-221594 * log(b.wall_temperature_waterwall[t, 8]) \
-199032 * log(b.wall_temperature_waterwall[t, 9]) \
-258237 * log(b.wall_temperature_waterwall[t, 10]) \
-387498 * log(b.wall_temperature_waterwall[t, 11]) \
-1.13543e+07 * log(b.wall_temperature_waterwall[t, 12]) \
+8.627e+06 * log(b.wall_temperature_platen[t]) \
+3.05064e+06 * log(b.wall_temperature_roof[t]) \
-246256 * log(b.flowrate_coal_raw[t]) \
-79998 * log(b.mf_H2O_coal_raw[t]) \
+2.16333e+06 * log(b.SR[t]) \
-1.1065e+07 * log(b.SR_lf[t]) \
+4.91018e+06 * log(b.secondary_air_inlet.temperature[t]) \
-2.68698e+07 * exp(b.mf_H2O_coal_raw[t]) \
-23.3046 * b.wall_temperature_waterwall[t, 12]**2 \
+16.9006 * b.wall_temperature_platen[t]**2 \
+4.26692 * b.wall_temperature_roof[t]**2 \
+1231.98 * b.flowrate_coal_raw[t]**2 \
+4.60765 * b.secondary_air_inlet.temperature[t]**2 \
-20.1062 * b.flowrate_coal_raw[t]**3 \
-0.0208005 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_platen[t] \
+0.211335 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
+142.559 * b.wall_temperature_waterwall[t, 1]*b.SR[t] \
-0.708488 * b.wall_temperature_waterwall[t, 1]*b.secondary_air_inlet.temperature[t] \
+0.104243 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-43.2466 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
+84.0522 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
-0.097681 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 6] \
+0.168211 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
+0.0311415 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_platen[t] \
-201.961 * b.wall_temperature_waterwall[t, 5]*b.SR_lf[t] \
+0.0979395 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_platen[t] \
+152.533 * b.wall_temperature_waterwall[t, 7]*b.SR[t] \
+0.138216 * b.wall_temperature_waterwall[t, 8]*b.wall_temperature_waterwall[t, 12] \
+358.824 * b.wall_temperature_waterwall[t, 8]*b.mf_H2O_coal_raw[t] \
-1.73455 * b.wall_temperature_waterwall[t, 9]*b.flowrate_coal_raw[t] \
-132.667 * b.wall_temperature_waterwall[t, 9]*b.SR[t] \
-0.128919 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_roof[t] \
-1.61439 * b.wall_temperature_waterwall[t, 10]*b.flowrate_coal_raw[t] \
-51.0787 * b.wall_temperature_waterwall[t, 10]*b.SR[t] \
+0.415955 * b.wall_temperature_waterwall[t, 11]*b.flowrate_coal_raw[t] \
-109.65 * b.wall_temperature_waterwall[t, 11]*b.SR[t] \
+976.739 * b.wall_temperature_waterwall[t, 11]*b.SR_lf[t] \
-3.17061 * b.wall_temperature_waterwall[t, 12]*b.flowrate_coal_raw[t] \
-220.696 * b.wall_temperature_waterwall[t, 12]*b.SR[t] \
+31.6233 * b.wall_temperature_waterwall[t, 12]*b.ratio_PA2coal[t] \
+3.78535 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+2053.18 * b.wall_temperature_platen[t]*b.SR[t] \
+0.387234 * b.wall_temperature_platen[t]*b.secondary_air_inlet.temperature[t] \
-46.3757 * b.wall_temperature_platen[t]*b.ratio_PA2coal[t] \
+0.097768 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
+2.52659 * b.wall_temperature_roof[t]*b.ratio_PA2coal[t] \
-249015 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-15466 * b.flowrate_coal_raw[t]*b.SR[t] \
+58532.1 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+121.404 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-3138.31 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+2.05815e+06 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-164857 * b.mf_H2O_coal_raw[t]*b.SR_lf[t] \
-2532.86 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-861.46 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
-209.784 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+0.00576341 * (b.wall_temperature_waterwall[t, 11]*b.ratio_PA2coal[t])**2 \
-0.000253398 * (b.wall_temperature_waterwall[t, 12]*b.flowrate_coal_raw[t])**2 \
-0.592335 * (b.wall_temperature_platen[t]*b.SR[t])**2 \
+9328.86 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
-2333.23 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
+3.15989e+06 * (b.mf_H2O_coal_raw[t]*b.SR[t])**2 \
+1.25506 * (b.SR[t]*b.secondary_air_inlet.temperature[t])**2 \
-0.000219682 * (b.wall_temperature_waterwall[t, 12]*b.SR_lf[t])**3 \
+14.8923 * (b.flowrate_coal_raw[t]*b.SR[t])**3)",
"pl": "(411941 * b.wall_temperature_waterwall[t, 1] \
+2599.73 * b.wall_temperature_waterwall[t, 2] \
-946.452 * b.wall_temperature_waterwall[t, 3] \
+3366.98 * b.wall_temperature_waterwall[t, 4] \
+208.286 * b.wall_temperature_waterwall[t, 5] \
+9022.67 * b.wall_temperature_waterwall[t, 6] \
+1152.84 * b.wall_temperature_waterwall[t, 7] \
+5576.24 * b.wall_temperature_waterwall[t, 8] \
+9303.39 * b.wall_temperature_waterwall[t, 9] \
+8901.32 * b.wall_temperature_waterwall[t, 10] \
+2840.75 * b.wall_temperature_waterwall[t, 11] \
-110147 * b.wall_temperature_waterwall[t, 12] \
+259512 * b.wall_temperature_platen[t] \
-54879.5 * b.wall_temperature_roof[t] \
+4.15488e+06 * b.flowrate_coal_raw[t] \
-3.15854e+07 * b.mf_H2O_coal_raw[t] \
-2.10085e+07 * b.SR[t] \
+1.70259e+08 * b.SR_lf[t] \
-34982.2 * b.secondary_air_inlet.temperature[t] \
+1.74171e+06 * b.ratio_PA2coal[t] \
-1.05527e+08 * log(b.wall_temperature_waterwall[t, 1]) \
-9.8091e+06 * log(b.wall_temperature_waterwall[t, 4]) \
-2.12136e+06 * log(b.wall_temperature_waterwall[t, 6]) \
-1.71391e+06 * log(b.wall_temperature_waterwall[t, 7]) \
-2.30845e+06 * log(b.wall_temperature_waterwall[t, 8]) \
-2.87745e+06 * log(b.wall_temperature_waterwall[t, 9]) \
-4.14628e+06 * log(b.wall_temperature_waterwall[t, 10]) \
+2.58819e+06 * log(b.wall_temperature_waterwall[t, 11]) \
+3.70654e+07 * log(b.wall_temperature_waterwall[t, 12]) \
+1.33648e+07 * log(b.wall_temperature_platen[t]) \
+1.645e+07 * log(b.wall_temperature_roof[t]) \
-2.78402e+06 * log(b.flowrate_coal_raw[t]) \
+1.22061e+08 * log(b.SR[t]) \
-1.80973e+08 * log(b.SR_lf[t]) \
+2.24892e+07 * log(b.secondary_air_inlet.temperature[t]) \
-256.702 * b.wall_temperature_waterwall[t, 1]**2 \
+44.0874 * b.wall_temperature_waterwall[t, 12]**2 \
-127.481 * b.wall_temperature_platen[t]**2 \
+22.8917 * b.wall_temperature_roof[t]**2 \
-1180.45 * b.flowrate_coal_raw[t]**2 \
+0.0704504 * b.wall_temperature_waterwall[t, 1]**3 \
-95.2406 * b.flowrate_coal_raw[t]**3 \
-3.57179e+08 * b.mf_H2O_coal_raw[t]**3 \
-1.32576 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 8] \
+0.503933 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 10] \
-2.70951 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
-6.71086 * b.wall_temperature_waterwall[t, 1]*b.secondary_air_inlet.temperature[t] \
-2.22919 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 4] \
+0.766666 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-441.236 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
+1018.32 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
+0.631224 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_platen[t] \
+1.77501 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
+12571.3 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
+0.0318959 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 12] \
-2.82968 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_waterwall[t, 12] \
-5.14737 * b.wall_temperature_waterwall[t, 6]*b.secondary_air_inlet.temperature[t] \
+10.3483 * b.wall_temperature_waterwall[t, 7]*b.flowrate_coal_raw[t] \
+1588.54 * b.wall_temperature_waterwall[t, 7]*b.SR[t] \
-24.8692 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
+4266.37 * b.wall_temperature_waterwall[t, 8]*b.mf_H2O_coal_raw[t] \
-1.72834 * b.wall_temperature_waterwall[t, 9]*b.wall_temperature_roof[t] \
-20.1069 * b.wall_temperature_waterwall[t, 9]*b.flowrate_coal_raw[t] \
-1743.83 * b.wall_temperature_waterwall[t, 9]*b.SR[t] \
+72.025 * b.wall_temperature_waterwall[t, 9]*b.ratio_PA2coal[t] \
-21.9304 * b.wall_temperature_waterwall[t, 10]*b.flowrate_coal_raw[t] \
-604.996 * b.wall_temperature_waterwall[t, 10]*b.SR[t] \
-0.803033 * b.wall_temperature_waterwall[t, 11]*b.flowrate_coal_raw[t] \
-25055.4 * b.wall_temperature_waterwall[t, 11]*b.SR[t] \
+15039.3 * b.wall_temperature_waterwall[t, 11]*b.SR_lf[t] \
-6.70118 * b.wall_temperature_waterwall[t, 12]*b.flowrate_coal_raw[t] \
+259.828 * b.wall_temperature_waterwall[t, 12]*b.ratio_PA2coal[t] \
-882.85 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+13754.4 * b.wall_temperature_platen[t]*b.mf_H2O_coal_raw[t] \
-264793 * b.wall_temperature_platen[t]*b.SR[t] \
+4.22028 * b.wall_temperature_platen[t]*b.secondary_air_inlet.temperature[t] \
-466.574 * b.wall_temperature_platen[t]*b.ratio_PA2coal[t] \
+1.01125 * b.wall_temperature_roof[t]*b.flowrate_coal_raw[t] \
+4891.17 * b.wall_temperature_roof[t]*b.mf_H2O_coal_raw[t] \
+2.58075 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-2.74627e+06 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-600924 * b.flowrate_coal_raw[t]*b.SR[t] \
+688577 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+1399.54 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-32498.3 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+1.81724e+07 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-25011.8 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-26275 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
-2285.29 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
+6.03477 * (b.wall_temperature_waterwall[t, 11]*b.SR[t])**2 \
+0.0812934 * (b.wall_temperature_waterwall[t, 11]*b.ratio_PA2coal[t])**2 \
+0.00133992 * (b.wall_temperature_platen[t]*b.flowrate_coal_raw[t])**2 \
+131.081 * (b.wall_temperature_platen[t]*b.SR[t])**2 \
+74778.6 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
-18994.8 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
+3.50946e+07 * (b.mf_H2O_coal_raw[t]*b.SR[t])**2 \
+19.4424 * (b.SR[t]*b.secondary_air_inlet.temperature[t])**2 \
-0.0016092 * (b.wall_temperature_waterwall[t, 4]*b.SR[t])**3 \
-0.0295869 * (b.wall_temperature_platen[t]*b.SR[t])**3 \
+127.257 * (b.flowrate_coal_raw[t]*b.SR[t])**3)",
"roof": "(279.354 * b.wall_temperature_waterwall[t, 1] \
+142.292 * b.wall_temperature_waterwall[t, 2] \
-82.9421 * b.wall_temperature_waterwall[t, 3] \
+273.335 * b.wall_temperature_waterwall[t, 4] \
+892.852 * b.wall_temperature_waterwall[t, 5] \
+348.631 * b.wall_temperature_waterwall[t, 6] \
+1436.58 * b.wall_temperature_waterwall[t, 7] \
+905.29 * b.wall_temperature_waterwall[t, 8] \
+979.254 * b.wall_temperature_waterwall[t, 9] \
+1221.17 * b.wall_temperature_waterwall[t, 10] \
-688.783 * b.wall_temperature_waterwall[t, 11] \
+2284.85 * b.wall_temperature_waterwall[t, 12] \
-40634 * b.wall_temperature_platen[t] \
+34289.7 * b.wall_temperature_roof[t] \
+358502 * b.flowrate_coal_raw[t] \
+4.78726e+07 * b.mf_H2O_coal_raw[t] \
+4.59178e+07 * b.SR[t] \
+2.01021e+07 * b.SR_lf[t] \
-14947.3 * b.secondary_air_inlet.temperature[t] \
+317109 * b.ratio_PA2coal[t] \
+100628 * log(b.wall_temperature_waterwall[t, 1]) \
-259749 * log(b.wall_temperature_waterwall[t, 4]) \
-246590 * log(b.wall_temperature_waterwall[t, 6]) \
-442193 * log(b.wall_temperature_waterwall[t, 7]) \
-431568 * log(b.wall_temperature_waterwall[t, 8]) \
-441819 * log(b.wall_temperature_waterwall[t, 9]) \
-668967 * log(b.wall_temperature_waterwall[t, 10]) \
+1.31422e+06 * log(b.wall_temperature_waterwall[t, 11]) \
-1.2249e+06 * log(b.wall_temperature_waterwall[t, 12]) \
+1.01753e+07 * log(b.wall_temperature_platen[t]) \
-7.76406e+06 * log(b.wall_temperature_roof[t]) \
-168868 * log(b.flowrate_coal_raw[t]) \
-155788 * log(b.mf_H2O_coal_raw[t]) \
+3.56858e+06 * log(b.SR[t]) \
+1.09389e+07 * log(b.SR_lf[t]) \
+5.70227e+06 * log(b.secondary_air_inlet.temperature[t]) \
-4.72384e+07 * exp(b.mf_H2O_coal_raw[t]) \
+20.1487 * b.wall_temperature_platen[t]**2 \
-20.9093 * b.wall_temperature_roof[t]**2 \
+2180.83 * b.flowrate_coal_raw[t]**2 \
-9.65879e+06 * b.SR[t]**2 \
+4.36136 * b.secondary_air_inlet.temperature[t]**2 \
-33.3553 * b.flowrate_coal_raw[t]**3 \
-0.290778 * b.wall_temperature_waterwall[t, 1]*b.flowrate_coal_raw[t] \
+221.494 * b.wall_temperature_waterwall[t, 1]*b.SR[t] \
-1.07102 * b.wall_temperature_waterwall[t, 1]*b.secondary_air_inlet.temperature[t] \
+0.0884997 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
-56.5688 * b.wall_temperature_waterwall[t, 2]*b.ratio_PA2coal[t] \
+112.139 * b.wall_temperature_waterwall[t, 3]*b.SR[t] \
+0.228812 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_roof[t] \
-0.233352 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 8] \
-689.204 * b.wall_temperature_waterwall[t, 5]*b.SR_lf[t] \
+0.183533 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_platen[t] \
+2.40284 * b.wall_temperature_waterwall[t, 7]*b.flowrate_coal_raw[t] \
+324.697 * b.wall_temperature_waterwall[t, 7]*b.SR[t] \
-1168.41 * b.wall_temperature_waterwall[t, 7]*b.SR_lf[t] \
+492.766 * b.wall_temperature_waterwall[t, 8]*b.mf_H2O_coal_raw[t] \
-2.8134 * b.wall_temperature_waterwall[t, 9]*b.flowrate_coal_raw[t] \
+0.256616 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 11] \
-0.25843 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_roof[t] \
+19.2408 * b.wall_temperature_waterwall[t, 10]*b.flowrate_coal_raw[t] \
-138.355 * b.wall_temperature_waterwall[t, 10]*b.SR[t] \
-4483.2 * b.wall_temperature_waterwall[t, 11]*b.SR[t] \
+1985.73 * b.wall_temperature_waterwall[t, 11]*b.SR_lf[t] \
-3.09845 * b.wall_temperature_waterwall[t, 12]*b.flowrate_coal_raw[t] \
+60.349 * b.wall_temperature_waterwall[t, 12]*b.ratio_PA2coal[t] \
+3.7545 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+3376.5 * b.wall_temperature_platen[t]*b.SR[t] \
-81.1028 * b.wall_temperature_platen[t]*b.ratio_PA2coal[t] \
-10.9151 * b.wall_temperature_roof[t]*b.flowrate_coal_raw[t] \
+638.803 * b.wall_temperature_roof[t]*b.mf_H2O_coal_raw[t] \
+0.212785 * b.wall_temperature_roof[t]*b.secondary_air_inlet.temperature[t] \
-388386 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
-55185.6 * b.flowrate_coal_raw[t]*b.SR[t] \
+84891 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
+226.151 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-8510.32 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
+3.64716e+06 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-4313.24 * b.mf_H2O_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
-4.91759e+07 * b.SR[t]*b.SR_lf[t] \
-2591.82 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
-343.32 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
-0.0526747 * (b.wall_temperature_waterwall[t, 9]*b.SR[t])**2 \
-0.000385934 * (b.wall_temperature_waterwall[t, 10]*b.flowrate_coal_raw[t])**2 \
+1.16051 * (b.wall_temperature_waterwall[t, 11]*b.SR[t])**2 \
-0.947626 * (b.wall_temperature_platen[t]*b.SR[t])**2 \
+13089.9 * (b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t])**2 \
-3406.54 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-0.000648143 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2 \
+20.2802 * (b.flowrate_coal_raw[t]*b.ratio_PA2coal[t])**2 \
+5.86754e+06 * (b.mf_H2O_coal_raw[t]*b.SR[t])**2 \
+9.71079e+06 * (b.SR[t]*b.SR_lf[t])**2 \
+2.31621 * (b.SR[t]*b.secondary_air_inlet.temperature[t])**2 \
+22.1927 * (b.flowrate_coal_raw[t]*b.SR[t])**3)",
"flyash": "(exp(7.78102e-05 * b.wall_temperature_waterwall[t, 1] \
-7.54006e-05 * b.wall_temperature_waterwall[t, 2] \
-3.89992e-05 * b.wall_temperature_waterwall[t, 3] \
+0.000219719 * b.wall_temperature_waterwall[t, 4] \
-3.75494e-05 * b.wall_temperature_waterwall[t, 5] \
-0.000963424 * b.wall_temperature_waterwall[t, 6] \
-4.89079e-05 * b.wall_temperature_waterwall[t, 7] \
+0.000204467 * b.wall_temperature_waterwall[t, 8] \
-0.000143756 * b.wall_temperature_waterwall[t, 10] \
-0.000389332 * b.wall_temperature_waterwall[t, 11] \
-0.000338076 * b.wall_temperature_platen[t] \
+0.241386 * b.flowrate_coal_raw[t] \
+2.67141 * b.mf_H2O_coal_raw[t] \
+910.531 * b.SR[t] \
+115.082 * b.SR_lf[t] \
+0.00275081 * b.secondary_air_inlet.temperature[t] \
-0.10997 * b.ratio_PA2coal[t] \
-2.10237 * log(b.flowrate_coal_raw[t]) \
-535.077 * log(b.SR[t]) \
-36.5477 * log(b.SR_lf[t]) \
+90.074 * exp(b.SR[t]) \
-667.684 * exp(b.SR_lf[t]) \
-4.24234e-08 * b.wall_temperature_roof[t]**2 \
-0.00369243 * b.flowrate_coal_raw[t]**2 \
-317.41 * b.SR[t]**2 \
+865.673 * b.SR_lf[t]**2 \
+9.64582e-06 * b.flowrate_coal_raw[t]**3 \
-1.69795e-07 * b.wall_temperature_waterwall[t, 1]*b.wall_temperature_waterwall[t, 9] \
-2.65157e-07 * b.wall_temperature_waterwall[t, 2]*b.wall_temperature_waterwall[t, 5] \
+0.000163992 * b.wall_temperature_waterwall[t, 2]*b.SR[t] \
-2.36504e-07 * b.wall_temperature_waterwall[t, 4]*b.wall_temperature_waterwall[t, 8] \
+5.23042e-06 * b.wall_temperature_waterwall[t, 4]*b.flowrate_coal_raw[t] \
-0.000165057 * b.wall_temperature_waterwall[t, 4]*b.SR[t] \
+5.85872e-08 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_waterwall[t, 11] \
+4.41736e-06 * b.wall_temperature_waterwall[t, 5]*b.flowrate_coal_raw[t] \
+4.67193e-07 * b.wall_temperature_waterwall[t, 6]*b.wall_temperature_waterwall[t, 11] \
+7.09971e-06 * b.wall_temperature_waterwall[t, 6]*b.flowrate_coal_raw[t] \
+6.36398e-07 * b.wall_temperature_waterwall[t, 6]*b.secondary_air_inlet.temperature[t] \
-2.41267e-07 * b.wall_temperature_waterwall[t, 7]*b.wall_temperature_waterwall[t, 8] \
+6.65347e-06 * b.wall_temperature_waterwall[t, 7]*b.flowrate_coal_raw[t] \
+3.4501e-06 * b.wall_temperature_waterwall[t, 8]*b.flowrate_coal_raw[t] \
+2.60247e-06 * b.wall_temperature_waterwall[t, 9]*b.flowrate_coal_raw[t] \
+4.71651e-06 * b.wall_temperature_waterwall[t, 10]*b.flowrate_coal_raw[t] \
+1.7254e-05 * b.wall_temperature_platen[t]*b.flowrate_coal_raw[t] \
+2.48343e-06 * b.wall_temperature_roof[t]*b.flowrate_coal_raw[t] \
-0.0571714 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
+0.0921271 * b.flowrate_coal_raw[t]*b.SR[t] \
-0.233398 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
-6.86695e-05 * b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t] \
+0.000995532 * b.flowrate_coal_raw[t]*b.ratio_PA2coal[t] \
-0.58226 * b.mf_H2O_coal_raw[t]*b.SR[t] \
-0.00447073 * b.SR[t]*b.secondary_air_inlet.temperature[t] \
+0.000246125 * b.secondary_air_inlet.temperature[t]*b.ratio_PA2coal[t] \
-2.22952e-10 * (b.wall_temperature_platen[t]*b.flowrate_coal_raw[t])**2 \
+1.80036e-06 * (b.wall_temperature_platen[t]*b.mf_H2O_coal_raw[t])**2 \
-0.000659596 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
+0.00333862 * (b.flowrate_coal_raw[t]*b.SR_lf[t])**2 \
+1.22954e-09 * (b.flowrate_coal_raw[t]*b.secondary_air_inlet.temperature[t])**2))",
"NOx": "(-0.00436267 * b.wall_temperature_waterwall[t, 1] \
-0.0254073 * b.wall_temperature_waterwall[t, 2] \
+0.0510658 * b.wall_temperature_waterwall[t, 3] \
-0.0639424 * b.wall_temperature_waterwall[t, 4] \
-0.172523 * b.wall_temperature_waterwall[t, 5] \
-0.000482641 * b.wall_temperature_waterwall[t, 6] \
+0.355125 * b.wall_temperature_waterwall[t, 7] \
+0.00348034 * b.wall_temperature_waterwall[t, 8] \
-0.97655 * b.wall_temperature_waterwall[t, 9] \
+1.31514 * b.wall_temperature_waterwall[t, 10] \
+0.0262232 * b.wall_temperature_waterwall[t, 11] \
-0.169549 * b.wall_temperature_waterwall[t, 12] \
-0.000935994 * b.wall_temperature_platen[t] \
-0.187802 * b.wall_temperature_roof[t] \
-285.589 * b.flowrate_coal_raw[t] \
+3715.18 * b.mf_H2O_coal_raw[t] \
+4412.39 * b.SR[t] \
+3191.45 * b.SR_lf[t] \
-2.80808 * b.secondary_air_inlet.temperature[t] \
-29.6263 * b.ratio_PA2coal[t] \
-8.19895 * log(b.wall_temperature_waterwall[t, 7]) \
-632.752 * log(b.wall_temperature_waterwall[t, 10]) \
-154.422 * log(b.flowrate_coal_raw[t]) \
-286.045 * log(b.SR[t]) \
+2.8111 * b.flowrate_coal_raw[t]**2 \
-2.51074e-07 * b.wall_temperature_waterwall[t, 10]**3 \
+1290.32 * b.SR_lf[t]**3 \
+7.41824e-05 * b.wall_temperature_waterwall[t, 3]*b.wall_temperature_waterwall[t, 4] \
+0.00014509 * b.wall_temperature_waterwall[t, 3]*b.wall_temperature_waterwall[t, 12] \
+0.000150378 * b.wall_temperature_waterwall[t, 5]*b.wall_temperature_roof[t] \
+0.0248537 * b.wall_temperature_waterwall[t, 5]*b.ratio_PA2coal[t] \
-0.353374 * b.wall_temperature_waterwall[t, 7]*b.SR_lf[t] \
+1.00281 * b.wall_temperature_waterwall[t, 9]*b.SR_lf[t] \
-1.81866e-05 * b.wall_temperature_waterwall[t, 10]*b.wall_temperature_waterwall[t, 12] \
-0.279407 * b.wall_temperature_waterwall[t, 10]*b.mf_H2O_coal_raw[t] \
+0.000775333 * b.wall_temperature_waterwall[t, 11]*b.flowrate_coal_raw[t] \
-0.415888 * b.wall_temperature_waterwall[t, 11]*b.mf_H2O_coal_raw[t] \
+0.0836883 * b.wall_temperature_waterwall[t, 12]*b.SR_lf[t] \
+0.0307674 * b.wall_temperature_roof[t]*b.ratio_PA2coal[t] \
-16.1433 * b.flowrate_coal_raw[t]*b.mf_H2O_coal_raw[t] \
+13.5804 * b.flowrate_coal_raw[t]*b.SR[t] \
+287.31 * b.flowrate_coal_raw[t]*b.SR_lf[t] \
-3021.62 * b.mf_H2O_coal_raw[t]*b.SR_lf[t] \
-4546.15 * b.SR[t]*b.SR_lf[t] \
+2.61054 * b.SR_lf[t]*b.secondary_air_inlet.temperature[t] \
-0.000160638 * (b.wall_temperature_waterwall[t, 3]*b.SR_lf[t])**2 \
-0.161015 * (b.flowrate_coal_raw[t]*b.SR[t])**2 \
-2.63321 * (b.flowrate_coal_raw[t]*b.SR_lf[t])**2)",
}
| 68.601949
| 100
| 0.601825
| 13,948
| 91,515
| 3.690565
| 0.115716
| 0.095093
| 0.304297
| 0.392416
| 0.837031
| 0.820052
| 0.71206
| 0.601426
| 0.54165
| 0.480981
| 0
| 0.147192
| 0.239141
| 91,515
| 1,333
| 101
| 68.653413
| 0.592087
| 0.006436
| 0
| 0
| 0
| 0.148372
| 0.000165
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b84def4266e3e6f77f5a37c8713593044550a6c8
| 21,374
|
py
|
Python
|
tests/games_test.py
|
tulip-control/omega
|
0627e6d0cd15b7c42a8c53d0bb3cfa58df9c30f1
|
[
"BSD-3-Clause"
] | 24
|
2018-07-19T20:04:33.000Z
|
2021-07-18T09:48:28.000Z
|
tests/games_test.py
|
johnyf/omega
|
0627e6d0cd15b7c42a8c53d0bb3cfa58df9c30f1
|
[
"BSD-3-Clause"
] | 7
|
2016-07-12T21:45:28.000Z
|
2018-01-01T07:52:38.000Z
|
tests/games_test.py
|
tulip-control/omega
|
0627e6d0cd15b7c42a8c53d0bb3cfa58df9c30f1
|
[
"BSD-3-Clause"
] | 4
|
2018-11-06T13:55:38.000Z
|
2021-07-11T18:17:35.000Z
|
"""Tests for `omega.games.gr1`."""
import logging
import pprint
from dd import mdd
from nose.tools import assert_raises
from omega.symbolic import enumeration
from omega.symbolic import symbolic
from omega.symbolic import temporal as trl
from omega.games import gr1
log = logging.getLogger('astutils')
log.setLevel('ERROR')
log = logging.getLogger('omega')
log.setLevel('ERROR')
def test_streett_trivial_loop():
a = trl.default_streett_automaton()
a.declare_variables(x='bool')
a.varlist['sys'] = ['x']
# solve
assert len(a.win['<>[]']) == 1
assert len(a.win['[]<>']) == 1
z, yij, xijk = gr1.solve_streett_game(a)
assert z == a.bdd.true, z
# transducer
gr1.make_streett_transducer(z, yij, xijk, a)
# vars
assert '_goal' in a.vars, a.vars
vt = a.vars['_goal']['type']
assert vt == 'int', vt
dom = a.vars['_goal']['dom']
assert dom == (0, 0), dom
assert 'x' in a.vars, a.vars
# init
init = a.init['impl']
init_ = a.add_expr('_goal = 0')
assert init == init_, a.bdd.to_expr(init)
# action
action = a.action['impl']
s = "(_goal = 0) /\ (_goal' = 0)"
action_ = a.add_expr(s)
assert action == action_, a.bdd.to_expr(action)
def test_rabin_trivial_loop():
a = trl.default_rabin_automaton()
a.acceptance = 'Rabin(1)'
a.declare_variables(x='bool')
a.varlist['sys'] = ['x']
# solve
assert len(a.win['<>[]']) == 1
assert len(a.win['[]<>']) == 1
zk, yki, xkijr = gr1.solve_rabin_game(a)
assert zk[-1] == a.bdd.true, zk
# transducer
gr1.make_rabin_transducer(zk, yki, xkijr, a)
# vars
assert '_goal' in a.vars, a.vars
vt = a.vars['_goal']['type']
assert vt == 'int', vt
dom = a.vars['_goal']['dom']
assert dom == (0, 0), dom
assert '_hold' in a.vars, a.vars
vt = a.vars['_hold']['type']
assert vt == 'int', vt
dom = a.vars['_hold']['dom']
assert dom == (0, 1), dom
assert 'x' in a.vars, a.vars
# init
init = a.init['impl']
init_ = a.add_expr('(_goal = 0) /\ (_hold = 1)')
assert init == init_, a.bdd.to_expr(init)
# action
action = a.action['impl']
s = (
"(_goal = 0) /\ (_goal' = 0) /\ "
"(_hold' = 0)")
action_ = a.add_expr(s)
assert action == action_, a.bdd.to_expr(action)
def test_streett_deadend():
aut = trl.default_streett_automaton()
aut.declare_variables(x=(0, 10))
aut.varlist['sys'] = ['x']
aut.action['sys'] = aut.add_expr("(x = 0) /\ (x' = 5)")
z, _, _ = gr1.solve_streett_game(aut)
win_set = z
assert win_set == aut.bdd.false, win_set
def test_rabin_deadend():
aut = trl.default_streett_automaton()
aut.acceptance = 'Rabin(1)'
aut.declare_variables(x=(0, 101))
aut.varlist['sys'] = ['x']
aut.action['sys'] = aut.add_expr("(x = 1) /\ (x' = 96 - x)")
zk, _, _ = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.bdd.false, win_set
def test_streett_always_x():
# always x
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool')
aut.varlist['sys'] = ['x']
aut.moore = False
aut.action['sys'] = aut.add_expr("x' ")
# solve
z, yij, xijk = gr1.solve_streett_game(aut)
assert z == aut.true, z
# transducer
gr1.make_streett_transducer(z, yij, xijk, aut)
# init
init = aut.init['impl']
init_ = aut.add_expr('_goal = 0')
assert init == init_, aut.bdd.to_expr(init)
# action
action = aut.action['impl']
s = (
"(_goal = 0) /\ (_goal' = 0) /\ "
"x' ")
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
#
# always ~ x
aut.init['env'] = aut.add_expr(' ~ x')
aut.action['sys'] = aut.add_expr(' ~ x')
# solve
z, yij, xijk = gr1.solve_streett_game(aut)
assert z == aut.add_expr(' ~ x'), aut.bdd.to_expr(z)
# tranducer
gr1.make_streett_transducer(z, yij, xijk, aut)
assert action_refined(aut)
init = aut.init['impl']
init_ = aut.add_expr('(_goal = 0)')
assert init == init_, aut.bdd.to_expr(init)
action = aut.action['impl']
s = "(_goal = 0) /\ (_goal' = 0) /\ ~ x /\ ~ x'"
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
def test_rabin_always_x():
# always x
aut = trl.default_rabin_automaton()
aut.declare_variables(x='bool')
aut.varlist['sys'] = ['x']
aut.acceptance = 'Rabin(1)'
aut.action['sys'] = aut.add_expr("x' ")
# solve
zk, yki, xkijr = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.bdd.true, win_set
# transducer
gr1.make_rabin_transducer(zk, yki, xkijr, aut)
# init
init = aut.init['impl']
s = '(_goal = 0) /\ (_hold = 1)'
init_ = aut.add_expr(s)
assert init == init_, aut.bdd.to_expr(init)
# action
action = aut.action['impl']
s = (
"(_goal = 0) /\ (_goal' = 0) /\ "
"(_hold' = 0) /\ "
"x' ")
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
#
# always ~ x
aut.init['env'] = aut.add_expr(' ~ x')
aut.action['sys'] = aut.add_expr(' ~ x')
# solve
zk, yki, xkijr = gr1.solve_rabin_game(aut)
win_set = zk[-1]
win_set_ = aut.add_expr(' ~ x')
assert win_set == win_set_, aut.bdd.to_expr(win_set)
# transducer
gr1.make_rabin_transducer(zk, yki, xkijr, aut)
assert action_refined(aut)
init = aut.init['impl']
s = ' (_goal = 0) /\ (_hold = 1) '
init_ = aut.add_expr(s)
assert init == init_, aut.bdd.to_expr(init)
action = aut.action['impl']
s = (
"(_goal = 0) /\ (_goal' = 0) /\ "
"(_hold' = 0) /\ "
" ~ x /\ ~ x'")
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
def test_streett_counter():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool')
aut.varlist['sys'] = ['x']
aut.action['sys'] = aut.add_expr("x => ~ x' ")
aut.win['[]<>'] = [aut.add_expr('x')]
# solve
z, yij, xijk = gr1.solve_streett_game(aut)
assert z == aut.true, z
# transducer
gr1.make_streett_transducer(z, yij, xijk, aut)
init = aut.init['impl']
init_ = aut.add_expr('_goal = 0')
assert init == init_, aut.bdd.to_expr(init)
action = aut.action['impl']
assert action_refined(aut)
# regression
s = (
"(_goal = 0) /\ (_goal' = 0) /\ "
"(x <=> ~ x')")
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
def test_rabin_counter():
aut = trl.default_rabin_automaton()
aut.declare_variables(x='bool')
aut.varlist['sys'] = ['x']
aut.plus_one = False
aut.qinit = '\A \A'
aut.action['sys'] = aut.add_expr("x => ~ x' ")
aut.win['[]<>'] = [aut.add_expr('x')]
# solve
zk, yki, xkijr = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.bdd.true, aut.bdd.to_expr(win_set)
# transducer
gr1.make_rabin_transducer(zk, yki, xkijr, aut)
assert action_refined(aut)
init = aut.init['impl']
s = '(_goal = 0) /\ (_hold = 1)'
init_ = aut.add_expr(s)
assert init == init_, aut.bdd.to_expr(init)
action = aut.action['impl']
# regression
s = (
"(_goal = 0) /\ (_goal' = 0) /\ "
"(_hold' = 0) /\ "
"ite(_hold = 0, x <=> ~ x', x => ~ x')")
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
def test_rabin_persistence():
aut = trl.default_rabin_automaton()
aut.declare_variables(x='bool')
aut.varlist['sys'] = ['x']
aut.init['sys'] = aut.add_expr(' ~ x')
aut.win['<>[]'] = [aut.add_expr('x')]
# solve
zk, yki, xkijr = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.true, aut.bdd.to_expr(win_set)
# tranducer
gr1.make_rabin_transducer(zk, yki, xkijr, aut)
assert action_refined(aut)
init = aut.init['impl']
s = '(_goal = 0) /\ (_hold = 1) /\ ~ x'
init_ = aut.add_expr(s)
assert init == init_, aut.bdd.to_expr(init)
action = aut.action['impl']
s = (
"(_goal = 0) /\ (_goal' = 0) /\ "
"ite(_hold' = 1, ~ x /\ x', x /\ x')")
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
#
# unrealizable
aut.win['[]<>'] = [aut.add_expr(' ~ x')]
zk, _, _ = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.false, aut.bdd.to_expr(win_set)
def test_rabin_persistence_2():
aut = trl.default_rabin_automaton()
aut.declare_variables(x='bool')
aut.varlist['sys'] = ['x']
aut.init['sys'] = aut.true
aut.win['<>[]'] = [aut.add_expr('x'), aut.add_expr(' ~ x')]
# solve
zk, yki, xkijr = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.true, aut.bdd.to_expr(win_set)
# transducer
gr1.make_rabin_transducer(zk, yki, xkijr, aut)
assert action_refined(aut)
init = aut.init['impl']
s = '(_goal = 0) /\ (_hold = 2)'
init_ = aut.add_expr(s)
assert init == init_, aut.bdd.to_expr(init)
action = aut.action['impl']
# enumeration.dump_relation(action, aut)
s = (
"(_goal = 0) /\ (_goal' = 0) /\ "
"ite(_hold = 1,"
"(_hold' = 1) /\ ~ x',"
"ite(_hold = 0,"
"(_hold' = 0) /\ x',"
"(_hold = 2) /\ ("
"( (_hold' = 0) /\ x' ) \/ "
"( (_hold' = 1) /\ ~ x' )"
") ) )")
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
def test_streett_with_safety_assumption():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool')
aut.varlist['env'] = ['x']
aut.moore = False
aut.plus_one = False
aut.action['env'] = aut.add_expr('x')
aut.action['sys'] = aut.add_expr('x')
# solve
z, yij, xijk = gr1.solve_streett_game(aut)
assert z == aut.true, z
# transducer
gr1.make_streett_transducer(z, yij, xijk, aut)
init = aut.init['impl']
assert init == aut.add_expr('_goal = 0'), aut.bdd.to_expr(init)
action = aut.action['impl']
action_ = aut.add_expr("x => ((_goal = 0) /\ (_goal' = 0))")
assert action == action_, aut.bdd.to_expr(action)
#
# negate action to make unrealizable
aut.action['sys'] = aut.add_expr(' ~ x')
# solve
z, yij, xijk = gr1.solve_streett_game(aut)
assert z == aut.add_expr(' ~ x'), aut.bdd.to_expr(z)
# transducer
with assert_raises(AssertionError):
gr1.make_streett_transducer(z, yij, xijk, aut)
# Moore case
aut.moore = True
aut.plus_one = False
aut.action['env'] = aut.add_expr('x')
aut.action['sys'] = aut.add_expr('x')
# solve
z_moore, yij, xijk = gr1.solve_streett_game(aut)
assert z_moore != z, 'should differ due to plus_one'
gr1.make_streett_transducer(z_moore, yij, xijk, aut)
init = aut.init['impl']
assert init == aut.add_expr('_goal = 0'), aut.bdd.to_expr(init)
def test_rabin_with_safety_assumption():
aut = trl.default_rabin_automaton()
aut.declare_variables(x='bool')
aut.varlist['env'] = ['x']
aut.init['env'] = aut.add_expr('x')
aut.action['env'] = aut.add_expr("x' ")
aut.action['sys'] = aut.add_expr("x")
# solve
zk, yki, xkijr = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.add_expr('x'), win_set
# transducer
gr1.make_rabin_transducer(zk, yki, xkijr, aut)
assert action_refined(aut)
init = aut.init['impl']
s = '(_goal = 0) /\ (_hold = 1)'
init_ = aut.add_expr(s)
assert init == init_, aut.bdd.to_expr(init)
action = aut.action['impl']
s = "((_goal = 0) /\ (_goal' = 0) /\ (_hold' = 0) /\ x)"
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
#
# negate action to make unrealizable
aut.action['sys'] = aut.add_expr(' ~ x')
# solve
zk, yki, xkijr = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.false, aut.bdd.to_expr(win_set)
with assert_raises(AssertionError):
gr1.make_rabin_transducer(zk, yki, xkijr, aut)
def test_streett_with_liveness_assumption():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool', y=(0, 2))
aut.varlist = dict(env=['x'], sys=['y'])
aut.init['sys'] = aut.add_expr(' y \in 0..2 ')
aut.action['sys'] = aut.add_expr(
"""
/\ ( ((y = 0) /\ ~ x) => (y' = 0) )
/\ ((y = 0) => (y' < 2))
/\ ((y = 1) => (y' = 0))
/\ ((y = 2) => FALSE)
/\ y \in 0..2
""")
aut.win['<>[]'] = [aut.add_expr(' ~ x')]
aut.win['[]<>'] = [aut.add_expr('y = 1')]
# solve
z, yij, xijk = gr1.solve_streett_game(aut)
z_ = aut.add_expr('y < 2')
e = aut.bdd.to_expr(z)
e_ = aut.bdd.to_expr(z_)
assert z == z_, (e, e_)
# transducer
gr1.make_streett_transducer(z, yij, xijk, aut)
assert action_refined(aut)
init = aut.init['impl']
assert init == aut.add_expr('(y < 2) /\ (_goal = 0)'), aut.bdd.to_expr(init)
action = aut.action['impl']
s = (
"( (y = 0) => ite(x, (y' = 1), (y' = 0)) ) /\ "
"( (y = 1) => (y' = 0) ) /\ "
"( (_goal = 0) /\ (_goal' = 0) ) /\ "
"( (y /= 2) /\ (y /= 3) )")
action_ = aut.add_expr(s)
sat = list(aut.bdd.pick_iter(action))
sys_action = aut.action['sys']
sys_action = gr1._copy_bdd(sys_action, aut.bdd, aut.bdd)
u = aut.apply('=>', action, sys_action)
assert u == aut.bdd.true, u
assert action == action_, (action, action_, pprint.pprint(sat))
#
# test complement
b = trl.default_rabin_automaton()
b.acceptance = 'Rabin(1)'
b.declare_variables(x='bool', y=(0, 2))
b.varlist = dict(env=['y'], sys=['x'])
b.action['env'] = gr1._copy_bdd(aut.action['sys'], aut.bdd, b.bdd)
b.win['<>[]'] = [b.add_expr('y /= 1')]
b.win['[]<>'] = [b.add_expr('x')]
zk, yki, xkijr = gr1.solve_rabin_game(b)
rabin_win_set = zk[-1]
bdd = b.bdd
streett_win_set = gr1._copy_bdd(z, aut.bdd, bdd)
assert rabin_win_set == bdd.apply('not', streett_win_set)
with assert_raises(AssertionError):
gr1.make_rabin_transducer(zk, yki, xkijr, b)
def test_streett_2_goals():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool')
aut.varlist = dict(env=list(), sys=['x'])
aut.win['[]<>'] = [aut.add_expr('x'), aut.add_expr(' ~ x')]
# solve
z, yij, xijk = gr1.solve_streett_game(aut)
assert z == aut.bdd.true, aut.bdd.to_expr(z)
# transducer
gr1.make_streett_transducer(z, yij, xijk, aut)
assert action_refined(aut)
action = aut.action['impl']
# print_fol_bdd(action, aut.bdd, aut.vars)
# enumeration.dump_relation(action, aut)
s = (
"((x /\ (_goal = 0)) => (_goal' = 1)) /\ "
"(( ~ x /\ (_goal = 1)) => (_goal' = 0)) /\ "
"(( ~ x /\ (_goal = 0)) => (x' /\ (_goal' = 0))) /\ "
"((x /\ (_goal = 1)) => ( ~ x' /\ (_goal' = 1)))")
action_ = aut.add_expr(s)
assert action == action_, aut.bdd.to_expr(action)
def test_rabin_goal():
aut = trl.default_rabin_automaton()
aut.declare_variables(x='bool')
aut.varlist = dict(env=['x'], sys=list())
aut.win['[]<>'] = [aut.add_expr('x')]
# solve
zk, yki, xkijr = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.false, aut.bdd.to_expr(win_set)
def test_rabin_2_goals():
aut = trl.default_rabin_automaton()
aut.declare_variables(x='bool', y='bool')
aut.varlist = dict(env=['x'], sys=['y'])
aut.win['[]<>'] = [aut.add_expr('x => y')]
# solve
zk, _, _ = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.true, aut.bdd.to_expr(win_set)
#
# unrealizable
aut.win['<>[]'] = [aut.add_expr(' ~ y')]
zk, _, _ = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.false, aut.bdd.to_expr(win_set)
#
# realizable again
aut.win['<>[]'] = [aut.add_expr('y')]
zk, _, _ = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.true, aut.bdd.to_expr(win_set)
#
# unrealizable
aut.win['[]<>'] = [aut.add_expr(s) for s in ['x => y', ' ~ y']]
zk, _, _ = gr1.solve_rabin_game(aut)
win_set = zk[-1]
assert win_set == aut.false, aut.bdd.to_expr(win_set)
def test_is_realizable():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool', y=(0, 5))
aut.varlist = dict(env=['x'], sys=['y'])
aut.prime_varlists()
# \A \A realizable
aut.init['env'] = aut.add_expr('x /\ (y = 1)')
aut.init['sys'] = aut.true
aut.qinit = '\A \A'
z = aut.add_expr('x /\ (y < 2)')
assert gr1.is_realizable(z, aut)
# \A \A unrealizable
aut.init['env'] = aut.add_expr('(y < 1)')
assert not gr1.is_realizable(z, aut)
# \E \E realizable
aut.init['env'] = aut.true
aut.init['sys'] = aut.add_expr('x /\ (y < 3)')
aut.qinit = '\E \E'
z = aut.add_expr('x /\ (y < 2)')
assert gr1.is_realizable(z, aut)
# \E \E unrealizable
aut.init['env'] = aut.true
aut.init['sys'] = aut.add_expr('(y > 10)')
aut.qinit = '\E \E'
z = aut.true
assert not gr1.is_realizable(z, aut)
# \A \E realizable
aut.moore = False
aut.init['env'] = aut.true
s = (
'(x => (y = 1)) /\ '
'((~ x) => (y = 4))')
aut.init['sys'] = aut.add_expr(s)
aut.qinit = '\A \E'
z = aut.add_expr('y > 0')
assert gr1.is_realizable(z, aut)
# \A \E unrealizable
s = (
'(x => (y = 1)) /\ '
'((~ x) => (y = 10))')
aut.init['sys'] = aut.add_expr(s)
aut.qinit = '\A \E'
z = aut.true
assert not gr1.is_realizable(z, aut)
# \E \A realizable
aut.moore = True
s = 'x => (y = 1)'
aut.init['sys'] = aut.add_expr(s)
aut.qinit = '\E \A'
z = aut.add_expr('y <= 2')
assert gr1.is_realizable(z, aut)
# \E \A unrealizable
aut.init['env'] = aut.true
aut.init['sys'] = aut.add_expr(r'''
/\ (x => (y = 1))
/\ ((~ x) => (y = 3))
''')
aut.moore = True
aut.qinit = '\E \A'
z = aut.add_expr('y = 1 \/ y = 2')
assert not gr1.is_realizable(z, aut)
def test_make_init():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool')
aut.varlist.update(env=['x'], sys=['y'])
internal_init = aut.true
win = aut.true
aut.qinit = '???'
with assert_raises(ValueError):
gr1._make_init(internal_init, win, aut)
def test_streett_qinit_exist_forall():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool', y=(0, 5))
aut.varlist = dict(env=['x'], sys=['y'])
aut.moore = True
aut.qinit = '\E \A'
aut.init['env'] = aut.add_expr('x')
aut.init['sys'] = aut.add_expr('(x => (y = 4)) /\ y \in 0..5')
aut.action['sys'] = aut.add_expr('y \in 0..5')
# solve
z, yij, xijk = gr1.solve_streett_game(aut)
assert z == aut.add_expr('y \in 0..5'), aut.bdd.to_expr(z)
# transducer
gr1.make_streett_transducer(z, yij, xijk, aut)
u = aut.init['impl']
u_ = aut.add_expr('(y = 4) /\ (_goal = 0)')
assert u == u_, aut.bdd.to_expr(u)
def test_trivial_winning_set():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool')
aut.varlist = dict(env=list(), sys=['x'])
aut.win['<>[]'] = [aut.add_expr(' ~ x')]
triv, aut = gr1.trivial_winning_set(aut)
assert triv == aut.true, aut.bdd.to_expr(triv)
def test_warn_moore_mealy():
aut = trl.default_streett_automaton()
aut.declare_variables(x='bool', y=(0, 25))
aut.varlist = dict(env=['x'], sys=['y'])
# Moore OK
aut.moore = True
aut.action['env'] = aut.add_expr("x /\ x' ")
aut.action['sys'] = aut.add_expr("(y > 4) /\ (y' = 5)")
aut.build()
r = gr1._warn_moore_mealy(aut)
assert r is True, r
# Moore with env' in sys action
aut.action['env'] = aut.add_expr("x /\ x' ")
aut.action['sys'] = aut.add_expr("x' /\ (y > 4) /\ (y' = 5)")
r = gr1._warn_moore_mealy(aut)
assert r is False, r
# Mealy with env' in sys action
aut.moore = False
r = gr1._warn_moore_mealy(aut)
assert r is True, r
# Mealy with sys' in env action
aut.action['env'] = aut.add_expr("x /\ x' /\ (y' > 4)")
aut.moore = False
r = gr1._warn_moore_mealy(aut)
assert r is False, r
# Moore with sys' in env action
aut.action['sys'] = aut.add_expr("(y > 4) /\ (y' = 5)")
aut.moore = True
r = gr1._warn_moore_mealy(aut)
assert r is False, r
def action_refined(aut):
"""Return `True` if action of `'impl'` refines `'sys'`.
@type aut_a, aut_b: `temporal.Automaton`
"""
a = aut.action['sys']
b = aut.action['impl']
refined = aut.apply('=>', b, a)
return refined == aut.true, aut.bdd.to_expr(b & ~ a)
def print_fol_bdd(u, bdd, table):
"""Print a first-order formula for node `u`.
Example:
```
aut = temporal.Automaton()
aut.vars = dict(x=dict(type='int', dom=(0, 5), owner='sys'))
aut.action['sys'] = ['x = 1']
u = aut.action['sys'][0]
print_fol_bdd(u, aut.bdd, aut.vars)
```
"""
bdd.incref(u)
dvars = symbolic._prime_and_order_table(table)
m, umap = mdd.bdd_to_mdd(bdd, dvars)
u_ = -umap[abs(u)]
s = m.to_expr(u_)
print(s)
if __name__ == '__main__':
test_rabin_2_goals()
| 31.525074
| 80
| 0.567933
| 3,177
| 21,374
| 3.612528
| 0.050677
| 0.059162
| 0.079289
| 0.045047
| 0.814673
| 0.783916
| 0.748105
| 0.703407
| 0.678836
| 0.653829
| 0
| 0.015555
| 0.239029
| 21,374
| 677
| 81
| 31.57164
| 0.690071
| 0.061898
| 0
| 0.655706
| 0
| 0.005803
| 0.132046
| 0
| 0
| 0
| 0
| 0
| 0.193424
| 1
| 0.044487
| false
| 0
| 0.015474
| 0
| 0.061896
| 0.007737
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b229f4008dc0056e234c6c396da762e6994c7cd1
| 35,698
|
py
|
Python
|
test/test_infrastructure.py
|
kursawe/hesdynamics
|
e7dd743ba6fcf36bd31937ec4c2c96bd890cc606
|
[
"BSD-3-Clause"
] | null | null | null |
test/test_infrastructure.py
|
kursawe/hesdynamics
|
e7dd743ba6fcf36bd31937ec4c2c96bd890cc606
|
[
"BSD-3-Clause"
] | null | null | null |
test/test_infrastructure.py
|
kursawe/hesdynamics
|
e7dd743ba6fcf36bd31937ec4c2c96bd890cc606
|
[
"BSD-3-Clause"
] | null | null | null |
import unittest
import os
import os.path
import sys
os.environ["OMP_NUM_THREADS"] = "1"
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
font = {'size' : 10}
plt.rc('font', **font)
import numpy as np
# make sure we find the right python module
sys.path.append(os.path.join(os.path.dirname(__file__),'..','src'))
import hes5
class TestInfrastructure(unittest.TestCase):
def test_generate_single_oscillatory_trajectory(self):
#First: run the model for 100 minutes
my_trajectory = hes5.generate_deterministic_trajectory( duration = 720,
repression_threshold = 100,
mRNA_degradation_rate = 0.03,
protein_degradation_rate = 0.03,
transcription_delay = 19,
initial_mRNA = 3,
initial_protein = 100)
# integrator = 'PyDDE',
# for_negative_times = 'no_negative' )
#Second, plot the model
figuresize = (4,2.75)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1], label = 'mRNA', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2]*0.03, label = 'Hes protein', color = 'black', ls = '--')
plt.xlabel('Time')
plt.ylabel('Scaled expression')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','oscillating_trajectory.pdf'))
def test_stochastic_trajectory(self):
my_trajectory = hes5.generate_stochastic_trajectory( duration = 720,
repression_threshold = 100,
mRNA_degradation_rate = 0.03,
protein_degradation_rate = 0.03,
transcription_delay = 18.5,
initial_mRNA = 3,
initial_protein = 100 )
#Second, plot the model
figuresize = (4,2.75)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1], label = 'mRNA', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2]*0.03, label = 'Hes protein (scaled)', color = 'black', ls = '--')
plt.xlabel('Time')
plt.ylabel('Copy number')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','stochastic_trajectory.pdf'))
def test_equlibrate_stochastic_trajectory(self):
#for profiling
np.random.seed(0)
my_trajectory = hes5.generate_stochastic_trajectory( duration = 1500,
repression_threshold = 31400,
mRNA_degradation_rate = np.log(2)/30,
protein_degradation_rate = np.log(2)/90,
translation_rate = 29,
basal_transcription_rate = 11,
transcription_delay = 29,
initial_mRNA = 3,
initial_protein = 31400,
equilibration_time = 1000)
figuresize = (4,2.5)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1]*1000, label = 'mRNA*1000', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2], label = 'Hes protein', color = 'black', ls = '--')
plt.text(0.95, 0.4, 'Mean protein number: ' + str(np.mean(my_trajectory[:,2])),
verticalalignment='bottom', horizontalalignment='right',
transform=plt.gca().transAxes)
plt.xlabel('Time')
plt.ylabel('Copy number')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','hes5_stochastic_trajectory_equilibrated.pdf'))
def test_calculate_power_spectrum_of_specific_trace(self):
interval_length = 100
x_values = np.linspace(1,interval_length,1000)
function_values = 3*np.sin(2*np.pi*0.5*x_values) + 2*np.sin(2*np.pi*0.2*x_values) + 10.0
number_of_data_points = len(x_values)
trajectory = np.vstack((x_values, function_values)).transpose()
# fourier_transform = np.fft.fft(function_values)/number_of_data_points
# fourier_frequencies = np.arange(0,number_of_data_points/(2.0*interval_length), 1.0/(interval_length) )
power_spectrum,_,_ = hes5.calculate_power_spectrum_of_trajectory(trajectory)
my_figure = plt.figure()
my_figure.add_subplot(211)
plt.plot(x_values,
function_values, label = r'$3sin(2\pi 0.5x) + 2sin(2\pi 0.2x)$', color = 'black')
plt.xlabel('x')
plt.ylabel('f(x)')
plt.legend()
my_figure.add_subplot(212)
plt.plot(power_spectrum[:,0],
power_spectrum[:,1], color = 'black')
plt.xlim(0,1)
plt.xlabel('Frequency')
plt.ylabel('Occurence')
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','power_spectrum_test.pdf'))
def test_stochastic_hes_trajectory_with_langevin(self):
# same plot as before for different transcription ("more_mrna") - not yet
# our preferred hes5 values
my_trajectory = hes5.generate_langevin_trajectory( duration = 1500,
repression_threshold = 23000,
mRNA_degradation_rate = np.log(2)/30,
protein_degradation_rate = np.log(2)/90,
translation_rate = 26,
basal_transcription_rate = 9,
transcription_delay = 29,
initial_mRNA = 3,
initial_protein = 23000)
self.assertGreaterEqual(np.min(my_trajectory),0.0)
figuresize = (4,2.5)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1]*10000, label = 'mRNA*1000', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2], label = 'Hes protein', color = 'black', ls = '--')
plt.text(0.95, 0.4, 'Mean protein number: ' + str(np.mean(my_trajectory[:,2])),
verticalalignment='bottom', horizontalalignment='right',
transform=plt.gca().transAxes)
plt.xlabel('Time')
plt.ylabel('Copy number')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','hes5_langevin_trajectory.pdf'))
def test_stochastic_hes_trajectory_with_other_noise(self):
my_trajectory = hes5.generate_agnostic_noise_trajectory( duration = 1500,
repression_threshold = 23000,
mRNA_degradation_rate = np.log(2)/30,
protein_degradation_rate = np.log(2)/90,
translation_rate = 26,
basal_transcription_rate = 9,
transcription_delay = 29,
initial_mRNA = 3,
initial_protein = 23000)
self.assertGreaterEqual(np.min(my_trajectory),0.0)
figuresize = (4,2.5)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1]*10000, label = 'mRNA*1000', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2], label = 'Hes protein', color = 'black', ls = '--')
plt.text(0.95, 0.4, 'Mean protein number: ' + str(np.mean(my_trajectory[:,2])),
verticalalignment='bottom', horizontalalignment='right',
transform=plt.gca().transAxes)
plt.xlabel('Time')
plt.ylabel('Copy number')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','hes5_agnostic_trajectory.pdf'))
def test_equlibrate_langevin_trajectory(self):
import time
np.random.seed(0)
start = time.clock()
my_trajectory = hes5.generate_langevin_trajectory( duration = 1500,
repression_threshold = 31400,
mRNA_degradation_rate = np.log(2)/30,
protein_degradation_rate = np.log(2)/90,
translation_rate = 29,
basal_transcription_rate = 11,
transcription_delay = 29,
initial_mRNA = 3,
initial_protein = 31400,
equilibration_time = 1000)
end = time.clock()
# print('needed ' + str(end-start) + ' seconds')
figuresize = (4,2.5)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1]*1000, label = 'mRNA*1000', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2], label = 'Hes protein', color = 'black', ls = '--')
plt.text(0.95, 0.4, 'Mean protein number: ' + str(np.mean(my_trajectory[:,2])),
verticalalignment='bottom', horizontalalignment='right',
transform=plt.gca().transAxes)
plt.xlabel('Time')
plt.ylabel('Copy number')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','hes5_langevin_trajectory_equilibrated.pdf'))
def test_multiple_equlibrated_langevin_trajectories(self):
mRNA_trajectories, protein_trajectories = hes5.generate_multiple_langevin_trajectories( number_of_trajectories = 100,
duration = 1500,
repression_threshold = 31400,
mRNA_degradation_rate = np.log(2)/30,
protein_degradation_rate = np.log(2)/90,
translation_rate = 29,
basal_transcription_rate = 11,
transcription_delay = 29,
initial_mRNA = 3,
initial_protein = 31400,
equilibration_time = 1000)
np.save(os.path.join(os.path.dirname(__file__),
'output','protein_traces.npy'), protein_trajectories)
np.save(os.path.join(os.path.dirname(__file__),
'output','rna_traces.npy'), mRNA_trajectories)
mean_protein_trajectory = np.mean(protein_trajectories[:,1:], axis = 1)
protein_deviation = np.std(mRNA_trajectories[:,1:])
mean_mRNA_trajectory = np.mean(mRNA_trajectories[:,1:], axis = 1)
mRNA_deviation = np.std(mRNA_trajectories[:,1:])
figuresize = (4,2.75)
my_figure = plt.figure()
# want to plot: protein and mRNA for stochastic and deterministic system,
# example stochastic system
plt.plot( mRNA_trajectories[:,0],
mRNA_trajectories[:,1]*1000., label = 'mRNA example', color = 'black' )
plt.plot( protein_trajectories[:,0],
protein_trajectories[:,1], label = 'Protein example', color = 'black', ls = '--' )
plt.plot( mRNA_trajectories[:,0],
mean_mRNA_trajectory*1000, label = 'Mean mRNA*1000', color = 'blue' )
plt.plot( protein_trajectories[:,0],
mean_protein_trajectory, label = 'Mean protein*1000', color = 'blue', ls = '--' )
plt.ylabel('Copy number')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','average_hes5_langevin_behaviour.pdf'))
def test_multiple_equlibrated_agnostic_trajectories(self):
mRNA_trajectories, protein_trajectories = hes5.generate_multiple_agnostic_trajectories( number_of_trajectories = 100,
duration = 1500,
repression_threshold = 31400,
mRNA_degradation_rate = np.log(2)/30,
protein_degradation_rate = np.log(2)/90,
translation_rate = 29,
basal_transcription_rate = 11,
transcription_delay = 29,
mRNA_noise_strength = 10,
protein_noise_strength = 10,
initial_mRNA = 3,
initial_protein = 31400,
equilibration_time = 1000)
np.save(os.path.join(os.path.dirname(__file__),
'output','agnostic_protein_traces.npy'), protein_trajectories)
np.save(os.path.join(os.path.dirname(__file__),
'output','agnostic_rna_traces.npy'), mRNA_trajectories)
mean_protein_trajectory = np.mean(protein_trajectories[:,1:], axis = 1)
protein_deviation = np.std(mRNA_trajectories[:,1:])
mean_mRNA_trajectory = np.mean(mRNA_trajectories[:,1:], axis = 1)
mRNA_deviation = np.std(mRNA_trajectories[:,1:])
figuresize = (4,2.75)
my_figure = plt.figure()
# want to plot: protein and mRNA for stochastic and deterministic system,
# example stochastic system
plt.plot( mRNA_trajectories[:,0],
mRNA_trajectories[:,1]*1000., label = 'mRNA example', color = 'black' )
plt.plot( protein_trajectories[:,0],
protein_trajectories[:,1], label = 'Protein example', color = 'black', ls = '--' )
plt.plot( mRNA_trajectories[:,0],
mean_mRNA_trajectory*1000, label = 'Mean mRNA*1000', color = 'blue' )
plt.plot( protein_trajectories[:,0],
mean_protein_trajectory, label = 'Mean protein*1000', color = 'blue', ls = '--' )
plt.ylabel('Copy number')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','average_hes5_agnostic_behaviour.pdf'))
def test_make_abc_example(self):
## generate posterior samples
total_number_of_samples = 200
# total_number_of_samples = 10
prior_bounds = {'basal_transcription_rate' : (0.1,100),
'translation_rate' : (1,200),
'repression_threshold' : (0,100000),
'time_delay' : (5,40),
'hill_coefficient' : (2,6)}
# 'mRNA_degradation_rate': (np.log(2)/500, np.log(2)/5),
# 'protein_degradation_rate': (np.log(2)/500, np.log(2)/5)}
# 'mRNA_degradation_rate': (0.001, 0.04),
# 'protein_degradation_rate': (0.001, 0.04),
my_prior_samples, my_prior_results = hes5.generate_lookup_tables_for_abc( total_number_of_samples,
number_of_traces_per_sample = 200,
saving_name = 'test_sampling_results',
prior_bounds = prior_bounds,
prior_dimension = 'hill',
logarithmic = True,
simulation_timestep = 1.0,
simulation_duration = 1500*5)
self.assertEquals(my_prior_samples.shape,
(total_number_of_samples, 5))
self.assertEquals(my_prior_results.shape,
(total_number_of_samples, 12))
def test_make_logarithmic_degradation_rate_sweep(self):
number_of_parameter_points = 5
number_of_trajectories = 10
# number_of_parameter_points = 3
# number_of_trajectories = 2
# saving_path = os.path.join(os.path.dirname(__file__), 'output','sampling_results_all_parameters')
saving_path = os.path.join(os.path.dirname(__file__), 'data','test_sampling_results')
model_results = np.load(saving_path + '.npy' )
prior_samples = np.load(saving_path + '_parameters.npy')
accepted_indices = np.where(np.logical_and(model_results[:,0]>55000, #cell number
np.logical_and(model_results[:,0]<65000, #cell_number
np.logical_and(model_results[:,1]<0.15, #standard deviation
model_results[:,1]>0.05)))) #standard deviation
my_posterior_samples = prior_samples[accepted_indices]
my_sweep_results = hes5.conduct_parameter_sweep_at_parameters('protein_degradation_rate',
my_posterior_samples,
number_of_sweep_values = number_of_parameter_points,
number_of_traces_per_parameter = number_of_trajectories,
relative = False)
np.save(os.path.join(os.path.dirname(__file__), 'output','test_degradation_sweep.npy'),
my_sweep_results)
def test_make_logarithmic_relative_parameter_variation(self):
number_of_parameter_points = 5
number_of_trajectories = 10
# number_of_parameter_points = 3
# number_of_trajectories = 2
# saving_path = os.path.join(os.path.dirname(__file__), 'output','sampling_results_all_parameters')
saving_path = os.path.join(os.path.dirname(__file__), 'data','test_sampling_results')
model_results = np.load(saving_path + '.npy' )
prior_samples = np.load(saving_path + '_parameters.npy')
accepted_indices = np.where(np.logical_and(model_results[:,0]>55000, #cell number
np.logical_and(model_results[:,0]<65000, #cell_number
np.logical_and(model_results[:,1]<0.15, #standard deviation
model_results[:,1]>0.05)))) #standard deviation
my_posterior_samples = prior_samples[accepted_indices]
my_parameter_sweep_results = hes5.conduct_all_parameter_sweeps_at_parameters(my_posterior_samples,
number_of_parameter_points,
number_of_trajectories,
relative = True)
for parameter_name in my_parameter_sweep_results:
np.save(os.path.join(os.path.dirname(__file__), 'output','test_relative_sweeps_' + parameter_name + '.npy'),
my_parameter_sweep_results[parameter_name])
def test_failing_deterministic_trace(self):
full_parameter = [5.64405525e-01, 2.33857520e+01, 7.87142865e+04, 5.80000000e+01, 4.74611147e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [8.24305146e-01, 3.01059149e+01, 5.69276195e+04, 2.90000000e+00, 3.82789287e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [8.24305146e-01, 3.01059149e+01, 5.69276195e+04, 5.80000000e+01, 3.82789287e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [7.23097666e-01, 3.24539043e+01, 5.08734455e+04, 2.20000000e+00, 3.44921873e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [7.23097666e-01, 3.24539043e+01, 5.08734455e+04, 4.40000000e+01, 3.44921873e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [5.71830551e-01, 2.77724873e+01, 9.21711471e+04, 1.30000000e+00, 2.13052352e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [5.71830551e-01, 2.77724873e+01, 9.21711471e+04, 2.60000000e+01, 2.13052352e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.43532951e+00, 1.19734135e+01, 6.76807739e+04, 1.50000000e+00, 5.84590839e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.43532951e+00, 1.19734135e+01, 6.76807739e+04, 3.00000000e+01, 5.84590839e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.27096653e+00, 1.83922224e+01, 4.91150644e+04, 3.30000000e+00, 2.50855151e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.27096653e+00, 1.83922224e+01, 4.91150644e+04, 6.60000000e+01, 2.50855151e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.44017237e+00, 7.98767456e+00, 8.83943412e+04, 3.00000000e+00, 4.02035789e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.44017237e+00, 7.98767456e+00, 8.83943412e+04, 6.00000000e+01, 4.02035789e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [6.51957055e-01, 2.60307499e+01, 7.07211331e+04, 1.30000000e+00, 4.87296426e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [6.51957055e-01, 2.60307499e+01, 7.07211331e+04, 2.60000000e+01, 4.87296426e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.62125865e+00, 6.87269278e+00, 1.15488176e+05, 1.50000000e+00, 3.44316352e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.62125865e+00, 6.87269278e+00, 1.15488176e+05, 3.00000000e+01, 3.44316352e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.08771820e+00, 1.27012825e+01, 8.10682842e+04, 2.50000000e+00, 2.42679925e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [1.08771820e+00, 1.27012825e+01, 8.10682842e+04, 5.00000000e+01, 2.42679925e+00, 2.31049060e-02, 7.70163534e-03]
full_parameter = [5.22348438e-01, 2.11394860e+01, 1.19414879e+05, 7.80000000e+01, 4.47302277e+00, 2.31049060e-02, 7.70163534e-03]
my_trajectory = hes5.generate_deterministic_trajectory(1500*5+1000,
full_parameter[2],
full_parameter[4],
full_parameter[5],
full_parameter[6],
full_parameter[0],
full_parameter[1],
full_parameter[3],
10,
full_parameter[2],
for_negative_times = 'no_negative')
figuresize = (4,2.75)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1], label = 'mRNA', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2]*0.03, label = 'Hes protein', color = 'black', ls = '--')
plt.xlabel('Time')
plt.ylabel('Scaled expression')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','failing_parameter.pdf'))
def test_deterministic_bifurcation(self):
##at this parameter point the system should oscillate
protein_degradation = 0.03
mrna_degradation = 0.03
transcription_delay = 18.5
basal_transcription_rate = 1.0
translation_rate = 1.0
repression_threshold = 100.0
hill_coefficient = 5
is_oscillatory = hes5.is_parameter_point_deterministically_oscillatory( repression_threshold = repression_threshold,
hill_coefficient = hill_coefficient,
mRNA_degradation_rate = mrna_degradation,
protein_degradation_rate = protein_degradation,
basal_transcription_rate = basal_transcription_rate,
translation_rate = translation_rate,
transcription_delay = transcription_delay)
self.assert_(is_oscillatory)
## at this parameter point the system should not oscillate
protein_degradation = np.log(2)/90.0
mrna_degradation = np.log(2)/30.0
transcription_delay = 29
basal_transcription_rate = 1.0
translation_rate = 320.0
repression_threshold = 60000
hill_coefficient = 5
is_oscillatory = hes5.is_parameter_point_deterministically_oscillatory( repression_threshold = repression_threshold,
hill_coefficient = hill_coefficient,
mRNA_degradation_rate = mrna_degradation,
protein_degradation_rate = protein_degradation,
basal_transcription_rate = basal_transcription_rate,
translation_rate = translation_rate,
transcription_delay = transcription_delay)
self.assert_(not is_oscillatory)
def test_stochastic_bifurcation(self):
##at this parameter point the system should oscillate
protein_degradation = 0.03
mrna_degradation = 0.03
transcription_delay = 18.5
basal_transcription_rate = 1.0
translation_rate = 1.0
repression_threshold = 100.0
hill_coefficient = 5
is_oscillatory = hes5.is_parameter_point_stochastically_oscillatory( repression_threshold = repression_threshold,
hill_coefficient = hill_coefficient,
mRNA_degradation_rate = mrna_degradation,
protein_degradation_rate = protein_degradation,
basal_transcription_rate = basal_transcription_rate,
translation_rate = translation_rate,
transcription_delay = transcription_delay )
self.assert_(is_oscillatory)
## at this parameter point the system should not oscillate stochastically
protein_degradation = np.log(2)/90.0
mrna_degradation = np.log(2)/30.0
transcription_delay = 34
basal_transcription_rate = 0.64
translation_rate = 17.32
repression_threshold = 88288.6
hill_coefficient = 5.59
is_oscillatory = hes5.is_parameter_point_stochastically_oscillatory( repression_threshold = repression_threshold,
hill_coefficient = hill_coefficient,
mRNA_degradation_rate = mrna_degradation,
protein_degradation_rate = protein_degradation,
basal_transcription_rate = basal_transcription_rate,
translation_rate = translation_rate,
transcription_delay = transcription_delay)
self.assert_(not is_oscillatory)
def test_get_period_values_from_signal(self):
time_points = np.linspace(0,1000,100000)
signal_values = np.sin(2*np.pi/2*time_points) + 10
period_values = hes5.get_period_measurements_from_signal(time_points,signal_values)
for period_value in period_values[1:-1]:
self.assertAlmostEqual(period_value, 2.0, 3)
signal_values = np.sin(2*np.pi/1.42*time_points) + 10
period_values = hes5.get_period_measurements_from_signal(time_points,signal_values)
# print(period_values)
# in this case, for whatever weird boundary effect reason the hilbert won't give the right
# response on the boundaries, let's check the mean instead
self.assertAlmostEqual(np.mean(period_values), 1.42, 2)
def xest_generate_alternative_deterministic_trajectory(self):
basal_transcription_rate = 5.0
translation_rate = 20.0
repression_threshold = 31000.0
time_delay = 40.
hill_coefficient = 5.0
protein_degradation_rate = np.log(2)/90.0
mRNA_degradation_rate = np.log(2)/30.0
dde_gradient = [ basal_transcription_rate*1.0/(1.0+(y(1,t - time_delay)/repression_threshold)**hill_coefficient)- mRNA_degradation_rate*y(0),
translation_rate*y(0) - protein_degradation_rate*y(1)]
DDE = jitcdde(dde_gradient)
initial_condition = [10, repression_threshold]
DDE.add_past_point(-time_delay , initial_condition, np.zeros(2))
# DDE.add_past_point(-time_delay*0.001 , [10,1000*repression_threshold], np.zeros(2))
# DDE.constant_past([0,0], 0.0)
DDE.add_past_point(0.0 , initial_condition, np.zeros(2))
DDE.step_on_discontinuities()
times = np.arange(DDE.t,DDE.t+1000,1.0)
results = np.zeros((len(times),3))
time_index = 0
print(times)
for time in times:
results[time_index,0] = time
results[time_index,1:] = DDE.integrate(time)
time_index += 1
my_trajectory = results
print(my_trajectory)
figuresize = (4,2.75)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1], label = 'mRNA', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2]*0.03, label = 'Hes protein', color = 'black', ls = '--')
plt.xlabel('Time')
plt.ylabel('Scaled expression')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','test_jitcdde.pdf'))
def xest_generate_further_alternative_deterministic_trajectory(self):
basal_transcription_rate = 5.0
translation_rate = 20.0
repression_threshold = 31000.0
time_delay = 40.
hill_coefficient = 5.0
protein_degradation_rate = np.log(2)/90.0
mRNA_degradation_rate = np.log(2)/30.0
dde_gradient = [ basal_transcription_rate*1.0/(1.0+(y(1,t - time_delay)/repression_threshold)**hill_coefficient)- mRNA_degradation_rate*y(0),
translation_rate*y(0) - protein_degradation_rate*y(1)]
DDE = jitcdde(dde_gradient)
initial_condition = [10, repression_threshold]
DDE.add_past_point(-time_delay , initial_condition, np.zeros(2))
# DDE.add_past_point(-time_delay*0.001 , [10,1000*repression_threshold], np.zeros(2))
# DDE.constant_past([0,0], 0.0)
DDE.add_past_point(0.0 , initial_condition, np.zeros(2))
DDE.step_on_discontinuities()
times = np.arange(DDE.t,DDE.t+1000,1.0)
results = np.zeros((len(times),3))
time_index = 0
print(times)
for time in times:
results[time_index,0] = time
results[time_index,1:] = DDE.integrate(time)
time_index += 1
my_trajectory = results
print(my_trajectory)
figuresize = (4,2.75)
my_figure = plt.figure()
plt.plot(my_trajectory[:,0],
my_trajectory[:,1], label = 'mRNA', color = 'black')
plt.plot(my_trajectory[:,0],
my_trajectory[:,2]*0.03, label = 'Hes protein', color = 'black', ls = '--')
plt.xlabel('Time')
plt.ylabel('Scaled expression')
plt.legend()
my_figure.savefig(os.path.join(os.path.dirname(__file__),
'output','test_jitcdde.pdf'))
def xest_website_jitcdde_example(self):
omega = np.random.normal(0.89, 0.0089, 2)
kappa = 0.25
delay = 4.5
f = [
omega[0] * (-y(1) - y(2)),
omega[0] * (y(0) + 0.165 * y(1)),
omega[0] * (0.2 + y(2) * (y(0) - 10.0)),
omega[1] * (-y(4) - y(5)) + kappa * (y(0,t-delay) - y(3)),
omega[1] * (y(3) + 0.165 * y(4)),
omega[1] * (0.2 + y(5) * (y(3) - 10.0))
]
DDE = jitcdde(f)
start_state = np.random.uniform(-0.5,0.5,6)
DDE.add_past_point(-delay, start_state, np.zeros(6))
DDE.add_past_point(0.0 , start_state, np.zeros(6))
DDE.step_on_discontinuities()
times = np.arange(DDE.t,DDE.t+1000,0.1)
data = np.vstack(DDE.integrate(T) for T in times)
np.savetxt("two_roesslers.dat", data)
| 55.604361
| 149
| 0.517088
| 3,619
| 35,698
| 4.841669
| 0.110251
| 0.036297
| 0.008218
| 0.015752
| 0.792318
| 0.765381
| 0.746148
| 0.730282
| 0.729597
| 0.721493
| 0
| 0.113398
| 0.384896
| 35,698
| 641
| 150
| 55.691108
| 0.68458
| 0.065354
| 0
| 0.663405
| 0
| 0
| 0.050823
| 0.0154
| 0
| 0
| 0
| 0
| 0.019569
| 1
| 0.037182
| false
| 0
| 0.017613
| 0
| 0.056751
| 0.007828
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b287582b571940d4866f8807e2f83522ae34f067
| 27
|
py
|
Python
|
services/web/project/__init__.py
|
mythre/flask-spark-docker
|
04ffaed6aeca4f27b83218cb019dbf3667f22a43
|
[
"MIT"
] | 32
|
2018-01-21T18:10:51.000Z
|
2021-12-20T15:18:33.000Z
|
services/web/project/__init__.py
|
mythre/flask-spark-docker
|
04ffaed6aeca4f27b83218cb019dbf3667f22a43
|
[
"MIT"
] | 1
|
2019-02-14T08:43:01.000Z
|
2020-04-25T21:53:42.000Z
|
services/web/project/__init__.py
|
mythre/flask-spark-docker
|
04ffaed6aeca4f27b83218cb019dbf3667f22a43
|
[
"MIT"
] | 16
|
2018-04-25T13:37:38.000Z
|
2021-06-27T00:16:26.000Z
|
# services/web/__init__.py
| 13.5
| 26
| 0.777778
| 4
| 27
| 4.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.074074
| 27
| 1
| 27
| 27
| 0.68
| 0.888889
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b29e4197fe8d1087d352c35a4e7054b45215001e
| 3,523
|
py
|
Python
|
intro/part02-13_alphabetically_in_the_middle/test/test_alphabetically_in_the_middle.py
|
Hannah-Abi/python-pro-21
|
2ce32c4bf118054329d19afdf83c50561be1ada8
|
[
"MIT"
] | null | null | null |
intro/part02-13_alphabetically_in_the_middle/test/test_alphabetically_in_the_middle.py
|
Hannah-Abi/python-pro-21
|
2ce32c4bf118054329d19afdf83c50561be1ada8
|
[
"MIT"
] | null | null | null |
intro/part02-13_alphabetically_in_the_middle/test/test_alphabetically_in_the_middle.py
|
Hannah-Abi/python-pro-21
|
2ce32c4bf118054329d19afdf83c50561be1ada8
|
[
"MIT"
] | null | null | null |
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load_module, reload_module, get_stdout
from functools import reduce
from random import randint
exercise = 'src.alphabetically_in_the_middle'
def format_tuple(d : tuple):
return str(d).replace("'","")
@points('2.alphabetically_in_the_middle')
class AlphabeticallyInTheMiddleTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
with patch('builtins.input', side_effect =['A','B',"C"]):
cls.module = load_module(exercise, 'en')
def test_middle_first(self):
values = ["Y X Z", "B C A", "R U C", "H D N"]
for letters in values:
valuegroup = letters.split(" ")
with patch('builtins.input', side_effect = list(valuegroup)):
reload_module(self.module)
out = get_stdout()
output = out.split("\n")
self.assertTrue(len(out) > 0, "Your program does not print out anything with input {}".format(valuegroup))
correct = "The letter in the middle is " + sorted(valuegroup)[1]
self.assertTrue(len(output) == 1, "Instead of one row, your program's output is in {} rows: {} when input {}".format(len(output), output, format_tuple(valuegroup)))
self.assertTrue(output[0].find(correct) > -1, "Output\n{}\ndoes not match with the correct output\n{}\nwhen input is {}".
format(output[0], correct, format_tuple(valuegroup)))
def test_middle_second(self):
values = ["x y z", "c b a", "p d b", "e w y"]
for letters in values:
valuegroup = letters.split(" ")
with patch('builtins.input', side_effect = list(valuegroup)):
reload_module(self.module)
out = get_stdout()
output = out.split("\n")
self.assertTrue(len(out) > 0, "Your program does not print out anything with input {}".format(valuegroup))
correct = "The letter in the middle is " + sorted(valuegroup)[1]
self.assertTrue(len(output) == 1, "Instead of one row, your program's output is in {} rows: {} when input {}".format(len(output), output, format_tuple(valuegroup)))
self.assertTrue(output[0].find(correct) > -1, "Output\n{}\ndoes not match with the correct output\n{}\nwhen input is {}".
format(output[0], correct, format_tuple(valuegroup)))
def test_middle_third(self):
values = ["X Z Y", "e a c", "l a f", "b x r"]
for letters in values:
valuegroup = letters.split(" ")
with patch('builtins.input', side_effect = list(valuegroup)):
reload_module(self.module)
out = get_stdout()
output = out.split("\n")
self.assertTrue(len(out) > 0, "Your program does not print out anything with input {}".format(valuegroup))
correct = "The letter in the middle is " + sorted(valuegroup)[1]
self.assertTrue(len(output) == 1, "Instead of one row, your program's output is in {} rows: {} when input {}".format(len(output), output, format_tuple(valuegroup)))
self.assertTrue(output[0].find(correct) > -1, "Output\n{}\ndoes not match with the correct output\n{}\nwhen input is {}".
format(output[0], correct, format_tuple(valuegroup)))
if __name__ == '__main__':
unittest.main()
| 49.619718
| 180
| 0.595799
| 444
| 3,523
| 4.635135
| 0.222973
| 0.061224
| 0.049563
| 0.04276
| 0.762877
| 0.762877
| 0.747328
| 0.747328
| 0.747328
| 0.747328
| 0
| 0.007433
| 0.274482
| 3,523
| 70
| 181
| 50.328571
| 0.797731
| 0
| 0
| 0.589286
| 0
| 0
| 0.250355
| 0.017599
| 0
| 0
| 0
| 0
| 0.160714
| 1
| 0.089286
| false
| 0
| 0.107143
| 0.017857
| 0.232143
| 0.053571
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a24650333144367e73722daff7780731907a07d6
| 76
|
py
|
Python
|
s3_mysql_backup/test/conftest.py
|
fogcitymarathoner/s3_mysql_backup
|
f6e821889abae16381e9a7fa49d24a61ffb28ac2
|
[
"MIT"
] | null | null | null |
s3_mysql_backup/test/conftest.py
|
fogcitymarathoner/s3_mysql_backup
|
f6e821889abae16381e9a7fa49d24a61ffb28ac2
|
[
"MIT"
] | null | null | null |
s3_mysql_backup/test/conftest.py
|
fogcitymarathoner/s3_mysql_backup
|
f6e821889abae16381e9a7fa49d24a61ffb28ac2
|
[
"MIT"
] | null | null | null |
import sys
def pytest_configure(config):
sys._called_from_test = True
| 12.666667
| 32
| 0.763158
| 11
| 76
| 4.909091
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.171053
| 76
| 5
| 33
| 15.2
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 5
|
a25acf8221a4ea06bfc7806d3eb9c2f8329105e2
| 36
|
py
|
Python
|
PythonIntro/Semana9/__init__.py
|
DanielGMesquita/StudyPath
|
0b3d0bb1deac7eb0d1b301edca5e5ed320568f4c
|
[
"MIT"
] | null | null | null |
PythonIntro/Semana9/__init__.py
|
DanielGMesquita/StudyPath
|
0b3d0bb1deac7eb0d1b301edca5e5ed320568f4c
|
[
"MIT"
] | null | null | null |
PythonIntro/Semana9/__init__.py
|
DanielGMesquita/StudyPath
|
0b3d0bb1deac7eb0d1b301edca5e5ed320568f4c
|
[
"MIT"
] | null | null | null |
from Semana9.COHPIAH import *
main()
| 18
| 29
| 0.777778
| 5
| 36
| 5.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0.111111
| 36
| 2
| 30
| 18
| 0.84375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
a25f85c2a8dfc8cbc90b12a826c6df090e1ea822
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/pip/_internal/commands/list.py
|
GiulianaPola/select_repeats
|
17a0d053d4f874e42cf654dd142168c2ec8fbd11
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/pip/_internal/commands/list.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/pip/_internal/commands/list.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/ad/d5/66/58a0d9b51f773ff41c18ef2e92136656b68dd7107d9d499df3ac6bb0aa
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.395833
| 0
| 96
| 1
| 96
| 96
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a266ca0ccaf7d938d56957e06b0125f8deffbed1
| 56
|
py
|
Python
|
t_1000/render/__init__.py
|
chao5645/T-1000
|
99751bcfd79bd94df3667e7311e3b3af2b912505
|
[
"MIT"
] | 111
|
2019-10-30T01:12:49.000Z
|
2022-03-10T04:54:43.000Z
|
t_1000/render/__init__.py
|
charlesedwards/T-1000
|
5d88f74ddb2a0d47c3101072d6b9f6971fb2ba26
|
[
"MIT"
] | 16
|
2019-10-24T15:52:05.000Z
|
2022-02-05T17:55:02.000Z
|
t_1000/render/__init__.py
|
charlesedwards/T-1000
|
5d88f74ddb2a0d47c3101072d6b9f6971fb2ba26
|
[
"MIT"
] | 33
|
2019-11-03T14:51:23.000Z
|
2021-12-02T07:40:25.000Z
|
from t_1000.render.graph_generator import GraphGenerator
| 56
| 56
| 0.910714
| 8
| 56
| 6.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.075472
| 0.053571
| 56
| 1
| 56
| 56
| 0.849057
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a294b33191efa8b387855a8000c09b3bfdee9f6e
| 61
|
py
|
Python
|
python/ql/test/experimental/library-tests/CallGraph-implicit-init/foo/bar/a.py
|
vadi2/codeql
|
a806a4f08696d241ab295a286999251b56a6860c
|
[
"MIT"
] | 4,036
|
2020-04-29T00:09:57.000Z
|
2022-03-31T14:16:38.000Z
|
python/ql/test/experimental/library-tests/CallGraph-implicit-init/foo/bar/a.py
|
vadi2/codeql
|
a806a4f08696d241ab295a286999251b56a6860c
|
[
"MIT"
] | 2,970
|
2020-04-28T17:24:18.000Z
|
2022-03-31T22:40:46.000Z
|
python/ql/test/experimental/library-tests/CallGraph-implicit-init/foo/bar/a.py
|
ScriptBox99/github-codeql
|
2ecf0d3264db8fb4904b2056964da469372a235c
|
[
"MIT"
] | 794
|
2020-04-29T00:28:25.000Z
|
2022-03-30T08:21:46.000Z
|
# name:afunc
def afunc():
print("afunc called")
return 1
| 12.2
| 23
| 0.655738
| 9
| 61
| 4.444444
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020408
| 0.196721
| 61
| 4
| 24
| 15.25
| 0.795918
| 0.163934
| 0
| 0
| 0
| 0
| 0.244898
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0
| 0
| 0.666667
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
a29f628c048b9c6a3c36eb0f78c679d7dc8a2095
| 43
|
py
|
Python
|
tortfunc/exceptions.py
|
KLMatlock/tort
|
09f940cedd0a6ab3df619577a28528ead87468e5
|
[
"MIT"
] | null | null | null |
tortfunc/exceptions.py
|
KLMatlock/tort
|
09f940cedd0a6ab3df619577a28528ead87468e5
|
[
"MIT"
] | null | null | null |
tortfunc/exceptions.py
|
KLMatlock/tort
|
09f940cedd0a6ab3df619577a28528ead87468e5
|
[
"MIT"
] | null | null | null |
class FunctionTimeOut(Exception):
pass
| 14.333333
| 33
| 0.767442
| 4
| 43
| 8.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162791
| 43
| 2
| 34
| 21.5
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
a2e05d689fe54bc03ced356a6c182e747fdab3a6
| 524
|
py
|
Python
|
trapper/data/__init__.py
|
obss/trapper
|
40e6fc25a2d8c1ece8bf006c362a9cb163c4355c
|
[
"MIT"
] | 36
|
2021-11-01T19:29:31.000Z
|
2022-02-25T15:19:08.000Z
|
trapper/data/__init__.py
|
obss/trapper
|
40e6fc25a2d8c1ece8bf006c362a9cb163c4355c
|
[
"MIT"
] | 7
|
2021-11-01T14:33:21.000Z
|
2022-03-22T09:01:36.000Z
|
trapper/data/__init__.py
|
obss/trapper
|
40e6fc25a2d8c1ece8bf006c362a9cb163c4355c
|
[
"MIT"
] | 4
|
2021-11-30T00:34:20.000Z
|
2022-03-31T21:06:30.000Z
|
from trapper.data.data_adapters import DataAdapter, DataAdapterForQuestionAnswering
from trapper.data.data_collator import DataCollator, InputBatch, InputBatchTensor
from trapper.data.data_processors import DataProcessor, SquadDataProcessor
from trapper.data.data_processors.data_processor import IndexedInstance
from trapper.data.dataset_loader import DatasetLoader
from trapper.data.dataset_reader import DatasetReader
from trapper.data.label_mapper import LabelMapper
from trapper.data.tokenizers import TokenizerWrapper
| 58.222222
| 83
| 0.891221
| 61
| 524
| 7.52459
| 0.42623
| 0.191721
| 0.261438
| 0.165577
| 0.126362
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068702
| 524
| 8
| 84
| 65.5
| 0.940574
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0c270ecdef93eb9080393de1e212269c2dd7bd92
| 27
|
py
|
Python
|
lightnlp/tg/mt/__init__.py
|
CNLPT/lightNLP
|
c7f128422ba5b16f514bb294145cb3b562e95829
|
[
"Apache-2.0"
] | 889
|
2019-03-11T00:58:46.000Z
|
2022-03-27T07:12:06.000Z
|
lightnlp/tg/mt/__init__.py
|
CNLPT/lightNLP
|
c7f128422ba5b16f514bb294145cb3b562e95829
|
[
"Apache-2.0"
] | 14
|
2019-03-25T09:21:38.000Z
|
2020-12-28T11:41:55.000Z
|
lightnlp/tg/mt/__init__.py
|
CNLPT/lightNLP
|
c7f128422ba5b16f514bb294145cb3b562e95829
|
[
"Apache-2.0"
] | 237
|
2019-03-19T08:30:17.000Z
|
2022-03-14T03:38:30.000Z
|
# machine translation,机器翻译
| 13.5
| 26
| 0.814815
| 3
| 27
| 7.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 27
| 1
| 27
| 27
| 0.916667
| 0.888889
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0c27fdb3a7129d19475aa643942053fd224c85b3
| 94
|
py
|
Python
|
txpipe/mapping/__init__.py
|
Lhior/TXPipe
|
58fd7612326779d4c1b0e499157dddc9e3b524c0
|
[
"BSD-3-Clause"
] | 9
|
2018-03-17T02:07:52.000Z
|
2022-02-23T20:25:48.000Z
|
txpipe/mapping/__init__.py
|
Lhior/TXPipe
|
58fd7612326779d4c1b0e499157dddc9e3b524c0
|
[
"BSD-3-Clause"
] | 162
|
2018-03-06T16:18:23.000Z
|
2022-03-21T18:11:37.000Z
|
txpipe/mapping/__init__.py
|
Lhior/TXPipe
|
58fd7612326779d4c1b0e499157dddc9e3b524c0
|
[
"BSD-3-Clause"
] | 7
|
2018-07-26T11:49:46.000Z
|
2022-02-23T22:14:48.000Z
|
from .dr1 import DepthMapperDR1, BrightObjectMapper
from .basic_maps import Mapper, FlagMapper
| 47
| 51
| 0.861702
| 11
| 94
| 7.272727
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023529
| 0.095745
| 94
| 2
| 52
| 47
| 0.917647
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0c526332bdeabe3644998398c438c9144ee18b04
| 102
|
py
|
Python
|
Quadratic.py
|
ghzmdr/Algorithms
|
7c716b110a4b5424c50ea89ef8b0037f27940aa2
|
[
"Unlicense"
] | null | null | null |
Quadratic.py
|
ghzmdr/Algorithms
|
7c716b110a4b5424c50ea89ef8b0037f27940aa2
|
[
"Unlicense"
] | null | null | null |
Quadratic.py
|
ghzmdr/Algorithms
|
7c716b110a4b5424c50ea89ef8b0037f27940aa2
|
[
"Unlicense"
] | null | null | null |
def s(a, b):
res = 0
for i in xrange(1,a):
res += i**b
return res
def t(a, b):
return a**(b+1)
| 11.333333
| 22
| 0.519608
| 25
| 102
| 2.12
| 0.52
| 0.113208
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04
| 0.264706
| 102
| 9
| 23
| 11.333333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0
| 0.142857
| 0.571429
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
0c60d76faaeaff2fb64df2b16aec5661a2a7f78a
| 141
|
py
|
Python
|
process_metrics/qc_validation_result.py
|
tmooney/qc-metric-aggregator
|
12e81a41fa982c5997b0c7bd146f393d46f0eaab
|
[
"MIT"
] | 1
|
2020-03-25T15:38:27.000Z
|
2020-03-25T15:38:27.000Z
|
process_metrics/qc_validation_result.py
|
genome/qc-metric-aggregator
|
75ce5cb1aa3fd9021a9547fc17d2ef8760cbc921
|
[
"MIT"
] | null | null | null |
process_metrics/qc_validation_result.py
|
genome/qc-metric-aggregator
|
75ce5cb1aa3fd9021a9547fc17d2ef8760cbc921
|
[
"MIT"
] | null | null | null |
class QcValidationResult:
def __init__(self, value: str, passed_qc: bool):
self.value = value
self.passed_qc = passed_qc
| 28.2
| 52
| 0.673759
| 18
| 141
| 4.888889
| 0.555556
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.241135
| 141
| 4
| 53
| 35.25
| 0.82243
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.5
| 0
| 0
| 0.5
| 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
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
0c64a1eee4e0b9d1cdd54dc7c16049b4200b93c4
| 105
|
py
|
Python
|
importers/__init__.py
|
bcaldwell/ynab-importers
|
c7dc2c437cd241c76288498be4b1425c35c865a7
|
[
"MIT"
] | null | null | null |
importers/__init__.py
|
bcaldwell/ynab-importers
|
c7dc2c437cd241c76288498be4b1425c35c865a7
|
[
"MIT"
] | 5
|
2021-01-11T02:40:49.000Z
|
2021-10-12T00:58:08.000Z
|
importers/__init__.py
|
bcaldwell/ynab-importers
|
c7dc2c437cd241c76288498be4b1425c35c865a7
|
[
"MIT"
] | null | null | null |
from .brim import BrimImporter
from .splitwise import SplitwiseImporter
from .plaid import PlaidImporter
| 26.25
| 40
| 0.857143
| 12
| 105
| 7.5
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114286
| 105
| 3
| 41
| 35
| 0.967742
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a78f8be90217089da00e38427dcd13b4ca1494be
| 130
|
py
|
Python
|
keras_secure_image/__init__.py
|
krantirk/-keras-secure-image
|
b29f0af5cc7a649199aba3d59b49ab80270185a1
|
[
"MIT"
] | 17
|
2019-05-06T20:58:36.000Z
|
2021-11-22T12:15:39.000Z
|
keras_secure_image/__init__.py
|
krantirk/-keras-secure-image
|
b29f0af5cc7a649199aba3d59b49ab80270185a1
|
[
"MIT"
] | null | null | null |
keras_secure_image/__init__.py
|
krantirk/-keras-secure-image
|
b29f0af5cc7a649199aba3d59b49ab80270185a1
|
[
"MIT"
] | 8
|
2019-06-05T18:52:30.000Z
|
2021-02-19T05:22:49.000Z
|
from keras_secure_image.secure_image import encrypt_directory, decrypt_img, transform_img, transform, rot, \
perform_rotation
| 43.333333
| 108
| 0.838462
| 17
| 130
| 6
| 0.764706
| 0.215686
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107692
| 130
| 2
| 109
| 65
| 0.87931
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
a7bf02c893eaf45a32af3a9dbd147322da5ab3ec
| 124
|
py
|
Python
|
results/admin.py
|
skyshy0707/diehard
|
a6aaf47c728939606158f8d124d6edd7e12ef761
|
[
"BSL-1.0"
] | null | null | null |
results/admin.py
|
skyshy0707/diehard
|
a6aaf47c728939606158f8d124d6edd7e12ef761
|
[
"BSL-1.0"
] | null | null | null |
results/admin.py
|
skyshy0707/diehard
|
a6aaf47c728939606158f8d124d6edd7e12ef761
|
[
"BSL-1.0"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from .models import Results
admin.site.register(Results)
| 12.4
| 32
| 0.782258
| 17
| 124
| 5.705882
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153226
| 124
| 9
| 33
| 13.777778
| 0.92381
| 0.209677
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a7cc12cd2848f3e41fb9666d9b4fb89ebfbe2641
| 213
|
py
|
Python
|
Day14/Remove consecutive duplicate words.py
|
ColdTears619/My100DaysOfCode
|
aa33d721a0fa71b2e2c5ebf5b22594f40e443f68
|
[
"MIT"
] | 1
|
2021-12-25T16:18:42.000Z
|
2021-12-25T16:18:42.000Z
|
Day14/Remove consecutive duplicate words.py
|
ColdTears619/My100DaysOfCode
|
aa33d721a0fa71b2e2c5ebf5b22594f40e443f68
|
[
"MIT"
] | null | null | null |
Day14/Remove consecutive duplicate words.py
|
ColdTears619/My100DaysOfCode
|
aa33d721a0fa71b2e2c5ebf5b22594f40e443f68
|
[
"MIT"
] | null | null | null |
def remove_consecutive_duplicates(s):
words = s.split()
return " ".join(set(words))
print(remove_consecutive_duplicates('alpha beta beta gamma gamma gamma delta alpha beta beta gamma gamma gamma delta'))
| 35.5
| 119
| 0.760563
| 30
| 213
| 5.266667
| 0.5
| 0.253165
| 0.341772
| 0.227848
| 0.417722
| 0.417722
| 0.417722
| 0
| 0
| 0
| 0
| 0
| 0.14554
| 213
| 5
| 120
| 42.6
| 0.868132
| 0
| 0
| 0
| 0
| 0
| 0.375587
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0.25
| 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
| 0
| 0
| 0
|
0
| 5
|
a7ce4991e13936e0be57dcb186299ebc4d64dbe0
| 68
|
py
|
Python
|
common/validators.py
|
nmfzone/django-modern-boilerplate
|
6c752c5246b4ea14caa06792c60e9c1802a606e4
|
[
"MIT"
] | 2
|
2020-07-14T05:10:17.000Z
|
2021-04-07T00:17:11.000Z
|
common/validators.py
|
nmfzone/django-modern-boilerplate
|
6c752c5246b4ea14caa06792c60e9c1802a606e4
|
[
"MIT"
] | null | null | null |
common/validators.py
|
nmfzone/django-modern-boilerplate
|
6c752c5246b4ea14caa06792c60e9c1802a606e4
|
[
"MIT"
] | null | null | null |
# @TODO
# Reference: https://github.com/romain-li/django-validator
| 17
| 58
| 0.735294
| 9
| 68
| 5.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088235
| 68
| 3
| 59
| 22.666667
| 0.806452
| 0.911765
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0.333333
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a7dd2d4841db45da2e6ee74b213be152ecadc001
| 6,094
|
py
|
Python
|
tools/common/adapter_utils.py
|
tribhuvanesh/visual_redactions
|
93fac7b5cd9fc7e81341380408df6a8a4f8f6189
|
[
"Apache-2.0"
] | 14
|
2018-07-03T09:30:02.000Z
|
2020-12-23T05:46:11.000Z
|
tools/common/adapter_utils.py
|
tribhuvanesh/visual_redactions
|
93fac7b5cd9fc7e81341380408df6a8a4f8f6189
|
[
"Apache-2.0"
] | 2
|
2018-07-03T13:42:33.000Z
|
2018-09-15T13:17:17.000Z
|
tools/common/adapter_utils.py
|
tribhuvanesh/visual_redactions
|
93fac7b5cd9fc7e81341380408df6a8a4f8f6189
|
[
"Apache-2.0"
] | 9
|
2018-07-25T02:47:43.000Z
|
2022-02-17T13:28:49.000Z
|
#!/usr/bin/python
"""This is a short description.
Replace this with a more detailed description of what this file contains.
"""
import json
import time
import pickle
import sys
import csv
import argparse
import os
import os.path as osp
import shutil
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from scipy.misc import imread
from privacy_filters.tools.common.utils import load_attributes
__author__ = "Tribhuvanesh Orekondy"
__maintainer__ = "Tribhuvanesh Orekondy"
__email__ = "orekondy@mpi-inf.mpg.de"
__status__ = "Development"
def prev_to_new_attr_vec(attr_vec_v1, attr_id_to_idx_v1=None, attr_id_to_idx_v2=None):
if attr_id_to_idx_v1 is None:
_, attr_id_to_idx_v1 = load_attributes(v1_attributes=True)
idx_to_attr_id_v1 = {v: k for k, v in attr_id_to_idx_v1.iteritems()}
if attr_id_to_idx_v2 is None:
_, attr_id_to_idx_v2 = load_attributes()
idx_to_attr_id_v2 = {v: k for k, v in attr_id_to_idx_v2.iteritems()}
n_attr_v1 = len(idx_to_attr_id_v1)
n_attr_v2 = len(idx_to_attr_id_v2)
attr_vec_v2 = np.zeros(n_attr_v2)
attr_vec_v2[:n_attr_v1] = attr_vec_v1 # New attributes have been *appended* to the previous list
# a105_face_all = a9_face_complete + a10_face_partial
attr_vec_v2[attr_id_to_idx_v2['a105_face_all']] = max(attr_vec_v1[attr_id_to_idx_v1['a9_face_complete']],
attr_vec_v1[attr_id_to_idx_v1['a10_face_partial']])
# a106_address_current_all = a74_address_current_complete + a75_address_current_partial
attr_vec_v2[attr_id_to_idx_v2['a106_address_current_all']] = max(
attr_vec_v1[attr_id_to_idx_v1['a74_address_current_complete']],
attr_vec_v1[attr_id_to_idx_v1['a75_address_current_partial']])
# a107_address_home_all = a78_address_home_complete + a79_address_home_partial
attr_vec_v2[attr_id_to_idx_v2['a107_address_home_all']] = max(
attr_vec_v1[attr_id_to_idx_v1['a78_address_home_complete']],
attr_vec_v1[attr_id_to_idx_v1['a79_address_home_partial']])
# a108_license_plate_all = a103_license_plate_complete + a104_license_plate_partial
attr_vec_v2[attr_id_to_idx_v2['a108_license_plate_all']] = max(
attr_vec_v1[attr_id_to_idx_v1['a103_license_plate_complete']],
attr_vec_v1[attr_id_to_idx_v1['a104_license_plate_partial']])
# a109_person_body = a1_age_approx + a2_weight_approx + a3_height_approx + a4_gender + a16_race + a17_color
attr_vec_v2[attr_id_to_idx_v2['a109_person_body']] = max(
attr_vec_v1[attr_id_to_idx_v1['a1_age_approx']],
attr_vec_v1[attr_id_to_idx_v1['a2_weight_approx']],
attr_vec_v1[attr_id_to_idx_v1['a3_height_approx']],
attr_vec_v1[attr_id_to_idx_v1['a4_gender']],
attr_vec_v1[attr_id_to_idx_v1['a16_race']],
attr_vec_v1[attr_id_to_idx_v1['a17_color']])
# a110_nudity_all = a12_semi_nudity + a13_full_nudity
attr_vec_v2[attr_id_to_idx_v2['a110_nudity_all']] = max(attr_vec_v1[attr_id_to_idx_v1['a12_semi_nudity']],
attr_vec_v1[attr_id_to_idx_v1['a13_full_nudity']])
return attr_vec_v2
def prev_to_new_masks(masks_v1, attr_id_to_idx_v1=None, attr_id_to_idx_v2=None):
"""
Infer and append new masks
:param masks: a 68 x X x Y matrix
:param attr_id_to_idx_v1:
:param attr_id_to_idx_v2:
:return:
"""
if attr_id_to_idx_v1 is None:
_, attr_id_to_idx_v1 = load_attributes(v1_attributes=True)
idx_to_attr_id_v1 = {v: k for k, v in attr_id_to_idx_v1.iteritems()}
if attr_id_to_idx_v2 is None:
_, attr_id_to_idx_v2 = load_attributes()
idx_to_attr_id_v2 = {v: k for k, v in attr_id_to_idx_v2.iteritems()}
n_attr_v1 = len(idx_to_attr_id_v1)
n_attr_v2 = len(idx_to_attr_id_v2)
n_new_attr = n_attr_v2 - n_attr_v1
masks_v2 = np.concatenate((masks_v1, np.zeros((n_new_attr, masks_v1.shape[1], masks_v1.shape[2]))))
# a105_face_all = a9_face_complete + a10_face_partial
masks_v2[attr_id_to_idx_v2['a105_face_all']] = np.maximum(masks_v1[attr_id_to_idx_v1['a9_face_complete']],
masks_v1[attr_id_to_idx_v1['a10_face_partial']])
# a106_address_current_all = a74_address_current_complete + a75_address_current_partial
masks_v2[attr_id_to_idx_v2['a106_address_current_all']] = np.maximum(
masks_v1[attr_id_to_idx_v1['a74_address_current_complete']],
masks_v1[attr_id_to_idx_v1['a75_address_current_partial']])
# a107_address_home_all = a78_address_home_complete + a79_address_home_partial
masks_v2[attr_id_to_idx_v2['a107_address_home_all']] = np.maximum(
masks_v1[attr_id_to_idx_v1['a78_address_home_complete']],
masks_v1[attr_id_to_idx_v1['a79_address_home_partial']])
# a108_license_plate_all = a103_license_plate_complete + a104_license_plate_partial
masks_v2[attr_id_to_idx_v2['a108_license_plate_all']] = np.maximum(
masks_v1[attr_id_to_idx_v1['a103_license_plate_complete']],
masks_v1[attr_id_to_idx_v1['a104_license_plate_partial']])
# a109_person_body = a1_age_approx + a2_weight_approx + a3_height_approx + a4_gender + a16_race + a17_color
# np.maximum() allows comparison only between two arrays. So, iteratively cover required attributes
# and write them in-place
masks_v2[attr_id_to_idx_v2['a109_person_body']] = masks_v1[attr_id_to_idx_v1['a1_age_approx']].copy()
for old_attr_id in ['a2_weight_approx', 'a3_height_approx', 'a4_gender', 'a16_race', 'a17_color']:
np.maximum(masks_v2[attr_id_to_idx_v2['a109_person_body']], masks_v1[attr_id_to_idx_v1[old_attr_id]],
out=masks_v2[attr_id_to_idx_v2['a109_person_body']])
# a110_nudity_all = a12_semi_nudity + a13_full_nudity
masks_v2[attr_id_to_idx_v2['a110_nudity_all']] = np.maximum(masks_v1[attr_id_to_idx_v1['a12_semi_nudity']],
masks_v1[attr_id_to_idx_v1['a13_full_nudity']])
return masks_v2
| 45.477612
| 111
| 0.734657
| 1,036
| 6,094
| 3.727799
| 0.153475
| 0.108752
| 0.124288
| 0.170896
| 0.772139
| 0.762817
| 0.762817
| 0.758933
| 0.729933
| 0.596323
| 0
| 0.065525
| 0.176075
| 6,094
| 133
| 112
| 45.819549
| 0.703645
| 0.218412
| 0
| 0.202532
| 0
| 0
| 0.193206
| 0.1
| 0
| 0
| 0
| 0
| 0
| 1
| 0.025316
| false
| 0
| 0.177215
| 0
| 0.227848
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ac13de1fd0fa3bf90796ca79e02386b9ea746aa3
| 4,183
|
py
|
Python
|
test_app.py
|
gaborsomogyi/ldssa-capstone
|
342befd9113c117ed4cb10b6a76da26ae7697bb4
|
[
"MIT"
] | null | null | null |
test_app.py
|
gaborsomogyi/ldssa-capstone
|
342befd9113c117ed4cb10b6a76da26ae7697bb4
|
[
"MIT"
] | null | null | null |
test_app.py
|
gaborsomogyi/ldssa-capstone
|
342befd9113c117ed4cb10b6a76da26ae7697bb4
|
[
"MIT"
] | null | null | null |
import os
import tempfile
import numpy as np
import pytest
from app import create_app
@pytest.fixture
def app():
"""Create and configure a new app instance for each test."""
# create a temporary file to isolate the database for each test
db_fd, db_path = tempfile.mkstemp()
# create the app with common test config
app = create_app({
'TESTING': True,
'DATABASE': db_path,
})
yield app
# close and remove the temporary database
os.close(db_fd)
os.unlink(db_path)
@pytest.fixture
def client(app):
"""A test client for the app."""
return app.test_client()
def test_empty_db_contents(client):
with client as c:
rv = c.get('/list-db-contents')
print(rv.response)
assert rv.get_json() == []
def test_new_observation(client):
with client as c:
rv = c.post('/predict', json={"id": 0, "observation": {"m_or_f": "m", "person_attributes": "driving", "seat": "front_left",
"other_person_location": "N/A", "other_factor_1": "N/A", "other_factor_2": "N/A", "other_factor_3": "N/A", "age_in_years": "50"
}})
resp = rv.get_json()
# the return json only includes the probability
assert list(resp.keys()) == ['proba']
# probability is a float between 0 and 1
assert resp['proba'] >= 0 and resp['proba'] <= 1 and type(resp['proba']) == float
def test_duplicate_observation(client):
with client as c:
rv = c.post('/predict', json={"id": 0, "observation": {"m_or_f": "m", "person_attributes": "driving", "seat": "front_left",
"other_person_location": "N/A", "other_factor_1": "N/A", "other_factor_2": "N/A", "other_factor_3": "N/A", "age_in_years": "50"
}})
resp = rv.get_json()
# the return json only includes the probability
assert list(resp.keys()) == ['proba']
# probability is a float between 0 and 1
assert resp['proba'] >= 0 and resp['proba'] <= 1 and type(resp['proba']) == float
def test_na_observation(client):
with client as c:
rv = c.post('/predict', json={"id": 12, "observation": {"m_or_f": "m", "person_attributes": np.nan, "seat": "front_left",
"other_person_location": "N/A", "other_factor_1": "N/A", "other_factor_2": "N/A", "other_factor_3": np.nan, "age_in_years": np.nan
}})
resp = rv.get_json()
# the return json only includes the probability
assert list(resp.keys()) == ['proba']
# probability is a float between 0 and 1
assert resp['proba'] >= 0 and resp['proba'] <= 1 and type(resp['proba']) == float
def test_reordered_observation(client):
with client as c:
rv = c.post('/predict', json={"id": 12, "observation": {"other_factor_3": np.nan, "person_attributes": np.nan, "seat": "front_left",
"other_person_location": "N/A", "other_factor_1": "N/A", "other_factor_2": "N/A", "age_in_years": np.nan, "m_or_f": "m"
}})
resp = rv.get_json()
# the return json only includes the probability
assert list(resp.keys()) == ['proba']
# probability is a float between 0 and 1
assert resp['proba'] >= 0 and resp['proba'] <= 1 and type(resp['proba']) == float
def test_erroneous_observation(client):
with client as c:
rv = c.post('/predict', json={"id": 12, "observation": {"m_or_f": "m", "person_attributes": np.nan, "seat": "front_left",
"other_person_location": "N/A", "other_factor_1": "N/A", "other_factor_2": "N/A", "other_factor_3": np.nan, "age_in_years": 'NA'
}})
resp = rv.get_json()
# the return json only includes the probability
assert list(resp.keys()) == ['proba']
# probability is a float between 0 and 1
assert resp['proba'] >= 0 and resp['proba'] <= 1 and type(resp['proba']) == float
| 42.252525
| 150
| 0.561081
| 560
| 4,183
| 4.017857
| 0.164286
| 0.015111
| 0.043556
| 0.080889
| 0.766667
| 0.750222
| 0.750222
| 0.740444
| 0.740444
| 0.740444
| 0
| 0.015809
| 0.289266
| 4,183
| 98
| 151
| 42.683673
| 0.741002
| 0.154913
| 0
| 0.539683
| 0
| 0
| 0.248576
| 0.029897
| 0
| 0
| 0
| 0
| 0.174603
| 1
| 0.126984
| false
| 0
| 0.079365
| 0
| 0.222222
| 0.015873
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ac2a0e6e8fd3296cc3e831f9a61c1dd81d9cf458
| 184
|
py
|
Python
|
nni/tools/jupyter_extension/__init__.py
|
LikeJulia/nni
|
611ed639bb2ecd1db5a0241833c0d0a1e7812b1d
|
[
"MIT"
] | 2,305
|
2018-09-07T12:42:26.000Z
|
2019-05-06T20:14:24.000Z
|
nni/tools/jupyter_extension/__init__.py
|
LikeJulia/nni
|
611ed639bb2ecd1db5a0241833c0d0a1e7812b1d
|
[
"MIT"
] | 379
|
2018-09-10T10:19:50.000Z
|
2019-05-06T18:04:46.000Z
|
nni/tools/jupyter_extension/__init__.py
|
LikeJulia/nni
|
611ed639bb2ecd1db5a0241833c0d0a1e7812b1d
|
[
"MIT"
] | 314
|
2018-09-08T05:36:08.000Z
|
2019-05-06T08:48:51.000Z
|
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from . import proxy
load_jupyter_server_extension = proxy.setup
_load_jupyter_server_extension = proxy.setup
| 23
| 44
| 0.815217
| 24
| 184
| 5.958333
| 0.708333
| 0.153846
| 0.237762
| 0.363636
| 0.503497
| 0.503497
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 184
| 7
| 45
| 26.285714
| 0.888199
| 0.369565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ac2f9482cb809d7170fecea89c6daa8114655590
| 142
|
py
|
Python
|
tardis/admin.py
|
ptevans/django-tardis
|
0e094328f087089ce312d5bae53d9e6135633577
|
[
"MIT"
] | 1
|
2016-05-29T20:41:39.000Z
|
2016-05-29T20:41:39.000Z
|
tardis/admin.py
|
ptevans/django-tardis
|
0e094328f087089ce312d5bae53d9e6135633577
|
[
"MIT"
] | null | null | null |
tardis/admin.py
|
ptevans/django-tardis
|
0e094328f087089ce312d5bae53d9e6135633577
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from tardis import models
admin.site.register(models.Trip, admin.ModelAdmin)
| 17.75
| 50
| 0.802817
| 20
| 142
| 5.7
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126761
| 142
| 7
| 51
| 20.285714
| 0.919355
| 0.183099
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ac59b962cc206eecebbe1e74a0c696f68b74bfa7
| 57
|
py
|
Python
|
homework/4-Glow/a.py
|
Penchekrak/DeepGenerativeModels
|
7ee829682e8ed51bc637e2c6def0b9f810f384bc
|
[
"MIT"
] | null | null | null |
homework/4-Glow/a.py
|
Penchekrak/DeepGenerativeModels
|
7ee829682e8ed51bc637e2c6def0b9f810f384bc
|
[
"MIT"
] | null | null | null |
homework/4-Glow/a.py
|
Penchekrak/DeepGenerativeModels
|
7ee829682e8ed51bc637e2c6def0b9f810f384bc
|
[
"MIT"
] | null | null | null |
from b import b_func
def a_func():
b_func()
a_func()
| 11.4
| 20
| 0.666667
| 12
| 57
| 2.833333
| 0.5
| 0.294118
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.210526
| 57
| 5
| 21
| 11.4
| 0.755556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.25
| 0
| 0.5
| 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
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ac5f0a01e73935083b77f3c8aecc94f726368e12
| 129
|
py
|
Python
|
web/adminsite/__init__.py
|
ralfkret/hvz
|
842c25d58fb3c30060080efcfa8b3d183b78e2ab
|
[
"MIT"
] | 1
|
2019-07-30T14:39:43.000Z
|
2019-07-30T14:39:43.000Z
|
web/adminsite/__init__.py
|
ralfkret/hvz
|
842c25d58fb3c30060080efcfa8b3d183b78e2ab
|
[
"MIT"
] | 11
|
2019-07-31T13:40:30.000Z
|
2019-08-07T21:54:52.000Z
|
web/adminsite/__init__.py
|
ralfkret/hvz
|
842c25d58fb3c30060080efcfa8b3d183b78e2ab
|
[
"MIT"
] | null | null | null |
from flask import Blueprint
admin = Blueprint('adminsite', __name__, template_folder='adminsite_templates')
from . import views
| 25.8
| 79
| 0.806202
| 15
| 129
| 6.533333
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108527
| 129
| 5
| 80
| 25.8
| 0.852174
| 0
| 0
| 0
| 0
| 0
| 0.215385
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
|
0
| 5
|
ac7f3ad8019c85ac46e5e9b0d5692ea7cd2c339c
| 139
|
py
|
Python
|
EPro-PnP-Det/epropnp_det/core/__init__.py
|
Lakonik/EPro-PnP
|
931df847190ce10eddd1dc3e3168ce1a2f295ffa
|
[
"Apache-2.0"
] | 19
|
2022-03-21T10:22:24.000Z
|
2022-03-30T15:43:46.000Z
|
EPro-PnP-Det/epropnp_det/core/__init__.py
|
Lakonik/EPro-PnP
|
931df847190ce10eddd1dc3e3168ce1a2f295ffa
|
[
"Apache-2.0"
] | null | null | null |
EPro-PnP-Det/epropnp_det/core/__init__.py
|
Lakonik/EPro-PnP
|
931df847190ce10eddd1dc3e3168ce1a2f295ffa
|
[
"Apache-2.0"
] | 3
|
2022-03-26T08:08:24.000Z
|
2022-03-30T11:17:11.000Z
|
"""
Copyright (C) 2010-2022 Alibaba Group Holding Limited.
"""
from .bbox_3d import *
from .evaluation import *
from .visualizer import *
| 17.375
| 54
| 0.726619
| 18
| 139
| 5.555556
| 0.777778
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 0.158273
| 139
| 7
| 55
| 19.857143
| 0.777778
| 0.388489
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ac7f62f5fb635cbba452205ca1eef9c36255a28b
| 162
|
py
|
Python
|
modi/module/input_module/input_module.py
|
drecali/pymodi
|
8edf7269104efca48f65e5a118edc9fd136d6217
|
[
"MIT"
] | 1
|
2020-08-20T01:54:35.000Z
|
2020-08-20T01:54:35.000Z
|
modi/module/input_module/input_module.py
|
drecali/pymodi
|
8edf7269104efca48f65e5a118edc9fd136d6217
|
[
"MIT"
] | 33
|
2020-07-30T02:23:10.000Z
|
2020-08-05T01:58:53.000Z
|
modi/module/input_module/input_module.py
|
drecali/pymodi
|
8edf7269104efca48f65e5a118edc9fd136d6217
|
[
"MIT"
] | null | null | null |
from modi.module.module import Module
class InputModule(Module):
def __init__(self, id_, uuid, msg_send_q):
super().__init__(id_, uuid, msg_send_q)
| 23.142857
| 47
| 0.716049
| 24
| 162
| 4.25
| 0.625
| 0.117647
| 0.176471
| 0.254902
| 0.27451
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.17284
| 162
| 6
| 48
| 27
| 0.761194
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 0
| 1
| 0
|
0
| 5
|
ac84f22d5793bd57c8312ce557379c353eb8e502
| 160
|
py
|
Python
|
blog/managers.py
|
LD31D/django_blog
|
df4f336fa9d58aff87abb32c0a9f7791b8fc0eeb
|
[
"MIT"
] | null | null | null |
blog/managers.py
|
LD31D/django_blog
|
df4f336fa9d58aff87abb32c0a9f7791b8fc0eeb
|
[
"MIT"
] | 1
|
2020-12-04T06:59:00.000Z
|
2020-12-04T20:17:58.000Z
|
blog/managers.py
|
LD31D/django_blog
|
df4f336fa9d58aff87abb32c0a9f7791b8fc0eeb
|
[
"MIT"
] | null | null | null |
from django.db import models
class WasPublishedManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(status='published')
| 22.857143
| 58
| 0.775
| 20
| 160
| 6.1
| 0.85
| 0.180328
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.10625
| 160
| 7
| 59
| 22.857143
| 0.853147
| 0
| 0
| 0
| 0
| 0
| 0.055901
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
3bd205d0cae413de6d0e80c8134366fa6e6006b9
| 240
|
py
|
Python
|
tf2onnx/optimizer/__init__.py
|
duli2012/tensorflow-onnx
|
32f7264e81fa69ebc36c204c7a606e2e8be90d80
|
[
"MIT"
] | null | null | null |
tf2onnx/optimizer/__init__.py
|
duli2012/tensorflow-onnx
|
32f7264e81fa69ebc36c204c7a606e2e8be90d80
|
[
"MIT"
] | null | null | null |
tf2onnx/optimizer/__init__.py
|
duli2012/tensorflow-onnx
|
32f7264e81fa69ebc36c204c7a606e2e8be90d80
|
[
"MIT"
] | null | null | null |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__all__ = ["transpose_optimizer"]
| 26.666667
| 59
| 0.820833
| 29
| 240
| 6.137931
| 0.758621
| 0.168539
| 0.269663
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129167
| 240
| 8
| 60
| 30
| 0.851675
| 0.370833
| 0
| 0
| 0
| 0
| 0.128378
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0.25
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.