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
5d9d805947d8a51696ef7b80512550936228f6f6
990
py
Python
Zile.fpoo/arquivos python/zexercicios normais/peixaria.py
viniciuszile/python-codes
b5c9e18d9976329ee6c952670de2b516ffeaca23
[ "MIT" ]
4
2021-10-29T23:48:37.000Z
2022-02-21T18:21:29.000Z
Zile.fpoo/arquivos python/zexercicios normais/peixaria.py
viniciuszile/python-codes
b5c9e18d9976329ee6c952670de2b516ffeaca23
[ "MIT" ]
null
null
null
Zile.fpoo/arquivos python/zexercicios normais/peixaria.py
viniciuszile/python-codes
b5c9e18d9976329ee6c952670de2b516ffeaca23
[ "MIT" ]
null
null
null
print ("-"*90) print ("para continuar informe um numero positivio") print ("para sair informe um numero negativo") x = int (input(":")) print ("-"*90) while (x > 0): exesso = 50 peso = float (input("escreva quantos KG de peixes voce trouxe :")) if (peso > 50): exesso = (peso - exesso) multa = exesso * 40 print ("o total de KG em exesso é :",exesso) print ("A multa que devera ser paga é:",multa) print ("-"*90) print ("para continuar informe um numero positivio") print ("para sair informe um numero negativo") x = int (input("-")) print ("-"*90) elif (peso <= 50): print ("o total de KG em exesso é :",exesso) print ("Nao havera multa ") print ("-"*90) print ("para continuar informe um numero positivio") print ("para sair informe um numero negativo") x = int (input(":")) print ("-"*90)
31.935484
71
0.530303
121
990
4.338843
0.338843
0.08
0.171429
0.091429
0.729524
0.729524
0.729524
0.729524
0.729524
0.729524
0
0.031866
0.334343
990
31
72
31.935484
0.764795
0
0
0.615385
0
0
0.401665
0
0
0
0
0
0
1
0
false
0
0
0
0
0.615385
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
6
f8f3d1e735b646d173455ff9ac40f5bf5b634dcb
7,437
py
Python
tests/flow/test_path.py
ushachar/RedisGraph
b14b7a5afd1d5ab8c964a9c3da5e322a2b7d694d
[ "Ruby", "ISC", "MIT" ]
null
null
null
tests/flow/test_path.py
ushachar/RedisGraph
b14b7a5afd1d5ab8c964a9c3da5e322a2b7d694d
[ "Ruby", "ISC", "MIT" ]
null
null
null
tests/flow/test_path.py
ushachar/RedisGraph
b14b7a5afd1d5ab8c964a9c3da5e322a2b7d694d
[ "Ruby", "ISC", "MIT" ]
null
null
null
import os import sys from redisgraph import Graph, Node, Edge, Path from collections import Counter sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from base import FlowTestsBase sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../') from demo import QueryInfo GRAPH_ID = "G" redis_graph = None class testPath(FlowTestsBase): def __init__(self): super(testPath, self).__init__() global redis_graph redis_con = self.env.getConnection() redis_graph = Graph(GRAPH_ID, redis_con) def path_to_string(self, path): str_path = ", ".join([str(obj) for obj in path]) return str_path def setUp(self): self.env.flush() def test_simple_path(self): node0 = Node(node_id=0, label="L1") node1 = Node(node_id=1, label="L1") node2 = Node(node_id=2, label="L1") edge01 = Edge(node0, "R1", node1, edge_id=0, properties={'value': 1}) edge12 = Edge(node1, "R1", node2, edge_id=1, properties={'value': 2}) redis_graph.add_node(node0) redis_graph.add_node(node1) redis_graph.add_node(node2) redis_graph.add_edge(edge01) redis_graph.add_edge(edge12) redis_graph.flush() path01 = Path.new_empty_path().add_node(node0).add_edge(edge01).add_node(node1) path12 = Path.new_empty_path().add_node(node1).add_edge(edge12).add_node(node2) expected_results = [[path01], [path12]] query = "MATCH p=(:L1)-[:R1]->(:L1) RETURN p" query_info = QueryInfo(query = query, description="Tests simple paths", expected_result = expected_results) self._assert_resultset_and_expected_mutually_included(redis_graph.query(query), query_info) def test_variable_length_path(self): node0 = Node(node_id=0, label="L1") node1 = Node(node_id=1, label="L1") node2 = Node(node_id=2, label="L1") edge01 = Edge(node0, "R1", node1, edge_id=0, properties={'value': 1}) edge12 = Edge(node1, "R1", node2, edge_id=1, properties={'value': 2}) redis_graph.add_node(node0) redis_graph.add_node(node1) redis_graph.add_node(node2) redis_graph.add_edge(edge01) redis_graph.add_edge(edge12) redis_graph.flush() path01 = Path.new_empty_path().add_node(node0).add_edge(edge01).add_node(node1) path12 = Path.new_empty_path().add_node(node1).add_edge(edge12).add_node(node2) path02 = Path.new_empty_path().add_node(node0).add_edge(edge01).add_node(node1).add_edge(edge12).add_node(node2) expected_results=[[path01], [path12], [path02]] query = "MATCH p=(:L1)-[:R1*]->(:L1) RETURN p" query_info = QueryInfo(query = query, description="Tests variable length paths", expected_result = expected_results) self._assert_resultset_and_expected_mutually_included(redis_graph.query(query), query_info) def test_bi_directional_path(self): node0 = Node(node_id=0, label="L1") node1 = Node(node_id=1, label="L1") node2 = Node(node_id=2, label="L1") edge01 = Edge(node0, "R1", node1, edge_id=0, properties={'value': 1}) edge12 = Edge(node1, "R1", node2, edge_id=1, properties={'value': 2}) redis_graph.add_node(node0) redis_graph.add_node(node1) redis_graph.add_node(node2) redis_graph.add_edge(edge01) redis_graph.add_edge(edge12) redis_graph.flush() # Reverse direction edges which are not part of the graph. Read only values. edge10 = Edge(1, "R1", 0, edge_id = 0 , properties={'value':1}) edge21 = Edge(2, "R1", 1, edge_id = 1 , properties={'value':2}) path010 = Path.new_empty_path().add_node(node0).add_edge(edge01).add_node(node1).add_edge(edge10).add_node(node0) path0121 = Path.new_empty_path().add_node(node0).add_edge(edge01).add_node(node1).add_edge(edge12) \ .add_node(node2).add_edge(edge21).add_node(node1) path01210 = Path.new_empty_path().add_node(node0).add_edge(edge01).add_node(node1).add_edge(edge12) \ .add_node(node2).add_edge(edge21).add_node(node1).add_edge(edge10).add_node(node0) path121 = Path.new_empty_path().add_node(node1).add_edge(edge12).add_node(node2).add_edge(edge21).add_node(node1) path1210 = Path.new_empty_path().add_node(node1).add_edge(edge12).add_node(node2).add_edge(edge21) \ .add_node(node1).add_edge(edge10).add_node(node0) expected_results=[[path010], [path0121], [path01210], [path121], [path1210]] query = "MATCH p=(:L1)-[:R1*]->(:L1)<-[:R1*]-() RETURN p" query_info = QueryInfo(query = query, description="Tests bi directional variable length paths", \ expected_result = expected_results) self._assert_resultset_and_expected_mutually_included(redis_graph.query(query), query_info) def test_bi_directional_path_functions(self): node0 = Node(node_id=0, label="L1") node1 = Node(node_id=1, label="L1") node2 = Node(node_id=2, label="L1") edge01 = Edge(node0, "R1", node1, edge_id=0, properties={'value': 1}) edge12 = Edge(node1, "R1", node2, edge_id=1, properties={'value': 2}) redis_graph.add_node(node0) redis_graph.add_node(node1) redis_graph.add_node(node2) redis_graph.add_edge(edge01) redis_graph.add_edge(edge12) redis_graph.flush() # Reverse direction edges which are not part of the graph. Read only values. edge10 = Edge(1, "R1", 0, edge_id = 0 , properties={'value':1}) edge21 = Edge(2, "R1", 1, edge_id = 1 , properties={'value':2}) expected_results=[[[node0, node1, node0], [edge01, edge10], 2], [[node0, node1, node2, node1], [edge01, edge12, edge21], 3], [[node0, node1, node2, node1, node0], [edge01, edge12, edge21, edge10], 4], [[node1, node2, node1], [edge12, edge21], 2], [[node1, node2, node1, node0], [edge12, edge21, edge10], 3]] query = "MATCH p=(:L1)-[:R1*]->(:L1)<-[:R1*]-() RETURN nodes(p), relationships(p), length(p)" query_info = QueryInfo(query = query, description="Tests path functions over bi directional variable length paths", \ expected_result = expected_results) self._assert_resultset_and_expected_mutually_included(redis_graph.query(query), query_info) def test_zero_length_path(self): node0 = Node(node_id=0, label="L1") node1 = Node(node_id=1, label="L2") edge01 = Edge(node0, "R1", node1, edge_id=0, properties={'value': 1}) redis_graph.add_node(node0) redis_graph.add_node(node1) redis_graph.add_edge(edge01) redis_graph.flush() path01 = Path.new_empty_path().add_node(node0).add_edge(edge01).add_node(node1) expected_results=[[path01]] query = "MATCH p=(:L1)-[*0..]->()-[]->(:L2) RETURN p" query_info = QueryInfo(query = query, description="Tests path with zero length variable length paths", \ expected_result = expected_results) self._assert_resultset_and_expected_mutually_included(redis_graph.query(query), query_info)
45.907407
125
0.634261
990
7,437
4.507071
0.112121
0.072165
0.06701
0.053339
0.808158
0.799641
0.799641
0.7974
0.787539
0.748767
0
0.064303
0.226301
7,437
161
126
46.192547
0.711157
0.020035
0
0.54918
0
0.008197
0.078655
0.015511
0
0
0
0
0.040984
1
0.065574
false
0
0.04918
0
0.131148
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
5d30ecce492e72b53e0b97a7569a5adb88356c4b
179
py
Python
model/disaster_images.py
catskillsresearch/xview2-catskills
5671cff323c8121c0ae251e360e454a1e8568f58
[ "BSD-3-Clause" ]
null
null
null
model/disaster_images.py
catskillsresearch/xview2-catskills
5671cff323c8121c0ae251e360e454a1e8568f58
[ "BSD-3-Clause" ]
null
null
null
model/disaster_images.py
catskillsresearch/xview2-catskills
5671cff323c8121c0ae251e360e454a1e8568f58
[ "BSD-3-Clause" ]
null
null
null
import glob def disaster_images(): return glob.glob('/home/catskills/Desktop/dataxv2/xBD/*/images/*_post_*.png') if __name__=="__main__": print(disaster_images()[0:10])
22.375
81
0.715084
24
179
4.833333
0.791667
0.241379
0
0
0
0
0
0
0
0
0
0.025
0.106145
179
7
82
25.571429
0.7
0
0
0
0
0
0.363128
0.318436
0
0
0
0
0
1
0.2
true
0
0.2
0.2
0.6
0.2
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
1
1
0
0
6
5d58591a9464b1f852f56a7916889b74d9591dee
15,781
py
Python
pyscf/pbc/scf/test/test_addons.py
fdmalone/pyscf
021b17ac721e292b277d2b740e2ff8ab38bb6a4a
[ "Apache-2.0" ]
null
null
null
pyscf/pbc/scf/test/test_addons.py
fdmalone/pyscf
021b17ac721e292b277d2b740e2ff8ab38bb6a4a
[ "Apache-2.0" ]
null
null
null
pyscf/pbc/scf/test/test_addons.py
fdmalone/pyscf
021b17ac721e292b277d2b740e2ff8ab38bb6a4a
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Author: Qiming Sun <osirpt.sun@gmail.com> # import unittest import numpy import pyscf.pbc.gto as pbcgto import pyscf.pbc.scf as pscf cell = pbcgto.Cell() cell.atom = ''' He 0 0 1 He 1 0 1 ''' cell.basis = [[0, [1., 1.]], [0, [0.5, 1]]] cell.a = numpy.eye(3) * 3 cell.mesh = [10] * 3 cell.verbose = 5 cell.output = '/dev/null' cell.build() nao = cell.nao_nr() kpts = cell.make_kpts([2,1,1]) kmf_ro = pscf.KROHF(cell, kpts=kpts).run() kmf_r = pscf.KRHF(cell, kpts=kpts).convert_from_(kmf_ro) kmf_u = pscf.addons.convert_to_uhf(kmf_r) kmf_g = pscf.addons.convert_to_ghf(kmf_r) def tearDownModule(): global cell, kmf_ro, kmf_r, kmf_u, kmf_g cell.stdout.close() del cell, kmf_ro, kmf_r, kmf_u, kmf_g class KnowValues(unittest.TestCase): def test_krhf_smearing(self): mf = pscf.KRHF(cell, cell.make_kpts([2,1,1])) nkpts = len(mf.kpts) pscf.addons.smearing_(mf, 0.1, 'fermi') mo_energy_kpts = numpy.array([numpy.arange(nao)*.2+numpy.cos(i+.5)*.1 for i in range(nkpts)]) occ = mf.get_occ(mo_energy_kpts) self.assertAlmostEqual(mf.entropy, 6.1656394960533021/2, 9) mf.smearing_method = 'gauss' occ = mf.get_occ(mo_energy_kpts) self.assertAlmostEqual(mf.entropy, 0.94924016074521311/2, 9) mf.kernel() self.assertAlmostEqual(mf.entropy, 0, 15) def test_kuhf_smearing(self): mf = pscf.KUHF(cell, cell.make_kpts([2,1,1])) nkpts = len(mf.kpts) pscf.addons.smearing_(mf, 0.1, 'fermi') mo_energy_kpts = numpy.array([numpy.arange(nao)*.2+numpy.cos(i+.5)*.1 for i in range(nkpts)]) mo_energy_kpts = numpy.array([mo_energy_kpts, mo_energy_kpts+numpy.cos(mo_energy_kpts)*.02]) occ = mf.get_occ(mo_energy_kpts) self.assertAlmostEqual(mf.entropy, 6.1803390081500869/2, 9) mf.smearing_method = 'gauss' occ = mf.get_occ(mo_energy_kpts) self.assertAlmostEqual(mf.entropy, 0.9554526863670467/2, 9) def test_rhf_smearing(self): mf = pscf.RHF(cell) pscf.addons.smearing_(mf, 0.1, 'fermi') mo_energy = numpy.arange(nao)*.2+numpy.cos(.5)*.1 mf.get_occ(mo_energy) self.assertAlmostEqual(mf.entropy, 3.0922723199786408, 9) mf.smearing_method = 'gauss' occ = mf.get_occ(mo_energy) self.assertAlmostEqual(mf.entropy, 0.4152467504725415, 9) mf.kernel() self.assertAlmostEqual(mf.entropy, 0, 15) def test_uhf_smearing(self): mf = pscf.UHF(cell) pscf.addons.smearing_(mf, 0.1, 'fermi') mo_energy = numpy.arange(nao)*.2+numpy.cos(.5)*.1 mo_energy = numpy.array([mo_energy, mo_energy+numpy.cos(mo_energy)*.02]) mf.get_occ(mo_energy) self.assertAlmostEqual(mf.entropy, 3.1007387905421022, 9) mf.smearing_method = 'gauss' occ = mf.get_occ(mo_energy) self.assertAlmostEqual(mf.entropy, 0.42189309944541731, 9) def test_project_mo_nr2nr(self): nao = cell.nao_nr() kpts = cell.make_kpts([3,1,1]) nkpts = 3 c = numpy.random.random((3,nao,nao)) + numpy.random.random((3,nao,nao)) * 1j c1 = pscf.addons.project_mo_nr2nr(cell, c[0], cell) self.assertAlmostEqual(abs(c[0]-c1).max(), 0, 12) c1 = numpy.array(pscf.addons.project_mo_nr2nr(cell, c, cell, kpts=kpts)) self.assertAlmostEqual(abs(c-c1).max(), 0, 12) def test_convert_to_scf(self): from pyscf.pbc import dft from pyscf.pbc import df from pyscf.soscf import newton_ah cell1 = cell.copy() cell1.verbose = 0 pscf.addons.convert_to_rhf(dft.RKS(cell1)) pscf.addons.convert_to_uhf(dft.RKS(cell1)) #pscf.addons.convert_to_ghf(dft.RKS(cell1)) pscf.addons.convert_to_rhf(dft.UKS(cell1)) pscf.addons.convert_to_uhf(dft.UKS(cell1)) #pscf.addons.convert_to_ghf(dft.UKS(cell1)) #pscf.addons.convert_to_rhf(dft.GKS(cell1)) #pscf.addons.convert_to_uhf(dft.GKS(cell1)) #pscf.addons.convert_to_ghf(dft.GKS(cell1)) pscf.addons.convert_to_rhf(pscf.RHF(cell1).density_fit()) pscf.addons.convert_to_uhf(pscf.RHF(cell1).density_fit()) pscf.addons.convert_to_ghf(pscf.RHF(cell1).density_fit()) pscf.addons.convert_to_rhf(pscf.ROHF(cell1).density_fit()) pscf.addons.convert_to_uhf(pscf.ROHF(cell1).density_fit()) pscf.addons.convert_to_ghf(pscf.ROHF(cell1).density_fit()) pscf.addons.convert_to_rhf(pscf.UHF(cell1).density_fit()) pscf.addons.convert_to_uhf(pscf.UHF(cell1).density_fit()) pscf.addons.convert_to_ghf(pscf.UHF(cell1).density_fit()) #pscf.addons.convert_to_rhf(pscf.GHF(cell1).density_fit()) #pscf.addons.convert_to_uhf(pscf.GHF(cell1).density_fit()) pscf.addons.convert_to_ghf(pscf.GHF(cell1).density_fit()) pscf.addons.convert_to_rhf(pscf.RHF(cell1).x2c().density_fit()) pscf.addons.convert_to_uhf(pscf.RHF(cell1).x2c().density_fit()) pscf.addons.convert_to_ghf(pscf.RHF(cell1).x2c().density_fit()) pscf.addons.convert_to_rhf(pscf.ROHF(cell1).x2c().density_fit()) pscf.addons.convert_to_uhf(pscf.ROHF(cell1).x2c().density_fit()) pscf.addons.convert_to_ghf(pscf.ROHF(cell1).x2c().density_fit()) pscf.addons.convert_to_rhf(pscf.UHF(cell1).x2c().density_fit()) pscf.addons.convert_to_uhf(pscf.UHF(cell1).x2c().density_fit()) pscf.addons.convert_to_ghf(pscf.UHF(cell1).x2c().density_fit()) #pscf.addons.convert_to_rhf(pscf.GHF(cell1).x2c().density_fit()) #pscf.addons.convert_to_uhf(pscf.GHF(cell1).x2c().density_fit()) pscf.addons.convert_to_ghf(pscf.GHF(cell1).x2c().density_fit()) self.assertTrue (isinstance(pscf.addons.convert_to_rhf(pscf.RHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertFalse(isinstance(pscf.addons.convert_to_uhf(pscf.RHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertFalse(isinstance(pscf.addons.convert_to_ghf(pscf.RHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertFalse(isinstance(pscf.addons.convert_to_rhf(pscf.UHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(pscf.addons.convert_to_uhf(pscf.UHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertFalse(isinstance(pscf.addons.convert_to_ghf(pscf.UHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) #self.assertFalse(isinstance(pscf.addons.convert_to_rhf(pscf.GHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) #self.assertFalse(isinstance(pscf.addons.convert_to_uhf(pscf.GHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(pscf.addons.convert_to_ghf(pscf.GHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) mf1 = pscf.rhf.RHF(cell1) cell2 = cell1.copy() cell2.spin = 2 self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell1)), pscf.hf.RHF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell2)), pscf.hf.RHF)) self.assertFalse(isinstance(mf1.convert_from_(pscf.UHF(cell2)), pscf.rohf.ROHF)) self.assertFalse(isinstance(mf1.convert_from_(pscf.UHF(cell1).newton()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell2).density_fit()).with_df, df.df.GDF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell2).mix_density_fit()).with_df, df.mdf.MDF)) self.assertFalse(isinstance(mf1.convert_from_(pscf.ROHF(cell2)), pscf.rohf.ROHF)) self.assertRaises(AssertionError, mf1.convert_from_, kmf_u) mf1 = pscf.rohf.ROHF(cell1) self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell1)), pscf.rohf.ROHF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell2)), pscf.rohf.ROHF)) self.assertFalse(isinstance(mf1.convert_from_(pscf.UHF(cell1).newton()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell2).density_fit()).with_df, df.df.GDF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell2).mix_density_fit()).with_df, df.mdf.MDF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.RHF(cell1)), pscf.rohf.ROHF)) self.assertRaises(AssertionError, mf1.convert_from_, kmf_u) mf1 = pscf.uhf.UHF(cell1) self.assertTrue (isinstance(mf1.convert_from_(pscf.RHF(cell1)), pscf.uhf.UHF)) self.assertFalse(isinstance(mf1.convert_from_(pscf.RHF(cell1).newton()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.RHF(cell1).density_fit()).with_df, df.df.GDF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.RHF(cell1).mix_density_fit()).with_df, df.mdf.MDF)) self.assertRaises(AssertionError, mf1.convert_from_, kmf_u) mf1 = pscf.ghf.GHF(cell1) self.assertTrue (isinstance(mf1.convert_from_(pscf.RHF(cell1)), pscf.ghf.GHF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.UHF(cell1)), pscf.ghf.GHF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.ROHF(cell1)), pscf.ghf.GHF)) self.assertRaises(AssertionError, mf1.convert_from_, kmf_u) def test_convert_to_kscf(self): from pyscf.pbc import df from pyscf.soscf import newton_ah cell1 = cell.copy() cell1.verbose = 0 pscf.addons.convert_to_rhf(pscf.KRHF(cell1)) pscf.addons.convert_to_uhf(pscf.KRHF(cell1)) pscf.addons.convert_to_ghf(pscf.KRHF(cell1)) pscf.addons.convert_to_rhf(pscf.KROHF(cell1)) pscf.addons.convert_to_uhf(pscf.KROHF(cell1)) pscf.addons.convert_to_ghf(pscf.KROHF(cell1)) pscf.addons.convert_to_rhf(pscf.KUHF(cell1)) pscf.addons.convert_to_uhf(pscf.KUHF(cell1)) pscf.addons.convert_to_ghf(pscf.KUHF(cell1)) #pscf.addons.convert_to_rhf(pscf.KGHF(cell1)) #pscf.addons.convert_to_uhf(pscf.KGHF(cell1)) pscf.addons.convert_to_ghf(pscf.KGHF(cell1)) self.assertTrue (isinstance(pscf.addons.convert_to_rhf(pscf.KRHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertFalse(isinstance(pscf.addons.convert_to_uhf(pscf.KRHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertFalse(isinstance(pscf.addons.convert_to_ghf(pscf.KRHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertFalse(isinstance(pscf.addons.convert_to_rhf(pscf.KUHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(pscf.addons.convert_to_uhf(pscf.KUHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) self.assertFalse(isinstance(pscf.addons.convert_to_ghf(pscf.KUHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) #self.assertFalse(isinstance(pscf.addons.convert_to_rhf(pscf.KGHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) #self.assertFalse(isinstance(pscf.addons.convert_to_uhf(pscf.KGHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) #self.assertTrue (isinstance(pscf.addons.convert_to_ghf(pscf.KGHF(cell1).newton().density_fit().x2c()), newton_ah._CIAH_SOSCF)) mf1 = pscf.khf.KRHF(cell1) cell2 = cell1.copy() cell2.spin = 2 self.assertTrue (isinstance(mf1.convert_from_(kmf_u), pscf.khf.KRHF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.KUHF(cell2)), pscf.khf.KRHF)) self.assertFalse(isinstance(mf1.convert_from_(pscf.KUHF(cell2)), pscf.krohf.KROHF)) self.assertFalse(isinstance(mf1.convert_from_(kmf_u.newton()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.KUHF(cell2).density_fit()).with_df, df.df.GDF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.KUHF(cell2).mix_density_fit()).with_df, df.mdf.MDF)) self.assertFalse(isinstance(mf1.convert_from_(pscf.KROHF(cell2)), pscf.krohf.KROHF)) self.assertRaises(AssertionError, mf1.convert_from_, pscf.UHF(cell1)) mf1 = pscf.krohf.KROHF(cell1) self.assertTrue (isinstance(mf1.convert_from_(kmf_u), pscf.krohf.KROHF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.KUHF(cell2)), pscf.krohf.KROHF)) self.assertFalse(isinstance(mf1.convert_from_(kmf_u.newton()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.KUHF(cell2).density_fit()).with_df, df.df.GDF)) self.assertTrue (isinstance(mf1.convert_from_(pscf.KUHF(cell2).mix_density_fit()).with_df, df.mdf.MDF)) self.assertTrue (isinstance(mf1.convert_from_(kmf_r), pscf.krohf.KROHF)) self.assertRaises(AssertionError, mf1.convert_from_, pscf.UHF(cell1)) self.assertTrue(isinstance(pscf.addons.convert_to_rhf(pscf.KROHF(cell2)), pscf.krohf.KROHF)) #self.assertTrue(isinstance(pscf.addons.convert_to_rhf(pscf.KROHF(cell2).newton()), pscf.krohf.KROHF)) mf1 = pscf.kuhf.KUHF(cell1) self.assertTrue (isinstance(mf1.convert_from_(kmf_r), pscf.kuhf.KUHF)) self.assertFalse(isinstance(mf1.convert_from_(kmf_r.newton()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(mf1.convert_from_(kmf_r.density_fit()).with_df, df.df.GDF)) self.assertTrue (isinstance(mf1.convert_from_(kmf_ro.mix_density_fit()).with_df, df.mdf.MDF)) self.assertRaises(AssertionError, mf1.convert_from_, pscf.UHF(cell1)) def test_convert_to_kghf(self): from pyscf.pbc import df from pyscf.soscf import newton_ah mf1 = pscf.kghf.KGHF(cell) self.assertTrue (isinstance(mf1.convert_from_(kmf_r), pscf.kghf.KGHF)) self.assertTrue (isinstance(mf1.convert_from_(kmf_u), pscf.kghf.KGHF)) self.assertTrue (isinstance(mf1.convert_from_(kmf_ro), pscf.kghf.KGHF)) self.assertRaises(AssertionError, mf1.convert_from_, pscf.UHF(cell)) self.assertTrue (isinstance(mf1.convert_from_(kmf_u), pscf.kghf.KGHF)) self.assertFalse(isinstance(mf1.convert_from_(kmf_u.newton()), newton_ah._CIAH_SOSCF)) self.assertTrue (isinstance(mf1.convert_from_(kmf_u.density_fit()).with_df, df.df.GDF)) self.assertTrue (isinstance(mf1.convert_from_(kmf_u.mix_density_fit()).with_df, df.mdf.MDF)) def test_canonical_occ(self): mf1 = pscf.kuhf.KUHF(cell) mo_energy_kpts = [numpy.array([[0, 2, 3, 4],[0, 0, 1, 2]])] * 2 occ_ref = numpy.array([[[1, 0, 0, 0], [1, 1, 1, 0]]]*2) occ = mf1.get_occ(mo_energy_kpts) self.assertAlmostEqual(abs(occ - occ_ref).max(), 0, 14) mf1 = pscf.addons.canonical_occ_(mf1) occ_ref = numpy.array([[[1, 1, 0, 0], [1, 1, 0, 0]]]*2) occ = mf1.get_occ(mo_energy_kpts) self.assertAlmostEqual(abs(occ - occ_ref).max(), 0, 14) if __name__ == '__main__': print("Full Tests for pbc.scf.addons") unittest.main()
54.044521
135
0.691338
2,295
15,781
4.522876
0.090632
0.071291
0.10973
0.12264
0.83815
0.820424
0.812428
0.757707
0.705973
0.676493
0
0.036757
0.160446
15,781
291
136
54.230241
0.746698
0.121285
0
0.316742
0
0
0.007591
0
0
0
0
0
0.361991
1
0.045249
false
0
0.049774
0
0.099548
0.004525
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
5d752c5df9aa88278625c5db960b23a78be0dfef
137
py
Python
ebus/na.py
andr2000/ebus
578f95338e7fd434f02322d0537c0a47b4336423
[ "Apache-2.0" ]
null
null
null
ebus/na.py
andr2000/ebus
578f95338e7fd434f02322d0537c0a47b4336423
[ "Apache-2.0" ]
null
null
null
ebus/na.py
andr2000/ebus
578f95338e7fd434f02322d0537c0a47b4336423
[ "Apache-2.0" ]
null
null
null
class NotAvailable: def __str__(self): return "NA" def __repr__(self): return repr_(self) NA = NotAvailable()
13.7
26
0.605839
15
137
4.933333
0.533333
0.27027
0
0
0
0
0
0
0
0
0
0
0.291971
137
9
27
15.222222
0.762887
0
0
0
0
0
0.014599
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
0.833333
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
0
0
1
1
0
0
6
53a179cbb49c7ea1612f667e1a6f54b8b6ec7b7d
87
py
Python
g_mlp_pytorch/__init__.py
cpmolnar/gMLP-Disaster-Tweets
7b13651c2260bc112d706a99466c069fb9348205
[ "MIT" ]
346
2021-05-18T02:40:27.000Z
2022-03-31T03:07:54.000Z
g_mlp_pytorch/__init__.py
gheyret/g-mlp-pytorch
78fff27e0a0d223932a47d7f10bf33d349a4d2d3
[ "MIT" ]
6
2021-05-19T04:26:22.000Z
2021-11-22T03:27:49.000Z
g_mlp_pytorch/__init__.py
gheyret/g-mlp-pytorch
78fff27e0a0d223932a47d7f10bf33d349a4d2d3
[ "MIT" ]
49
2021-05-18T05:45:04.000Z
2022-03-24T08:54:14.000Z
from g_mlp_pytorch.g_mlp_pytorch import gMLP, gMLPVision, gMLPBlock, SpatialGatingUnit
43.5
86
0.873563
12
87
6
0.75
0.111111
0.305556
0
0
0
0
0
0
0
0
0
0.08046
87
1
87
87
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
53c46373af35cb93c75378f639143108f0ea712a
102
py
Python
{{cookiecutter.package_name}}/tests/test_{{cookiecutter.project_slug}}.py
felix-d/cookiecutter-py3.5-minimal
4d3fb187d0b965af3c54750b5c60c58574beee88
[ "MIT" ]
null
null
null
{{cookiecutter.package_name}}/tests/test_{{cookiecutter.project_slug}}.py
felix-d/cookiecutter-py3.5-minimal
4d3fb187d0b965af3c54750b5c60c58574beee88
[ "MIT" ]
null
null
null
{{cookiecutter.package_name}}/tests/test_{{cookiecutter.project_slug}}.py
felix-d/cookiecutter-py3.5-minimal
4d3fb187d0b965af3c54750b5c60c58574beee88
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals def test_example(): assert True
14.571429
39
0.696078
13
102
5
1
0
0
0
0
0
0
0
0
0
0
0.012048
0.186275
102
6
40
17
0.771084
0.205882
0
0
0
0
0
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
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
6
53cff2e890c2202b8e5adceaf29cd2c2de626b77
23
py
Python
src/metrics/__init__.py
wvitzthum/DL_super_resolution
59b2e68bad02579693d48f33ae64d524f08af5ff
[ "MIT" ]
1
2021-08-05T19:44:29.000Z
2021-08-05T19:44:29.000Z
src/metrics/__init__.py
wvitzthum/DL_super_resolution
59b2e68bad02579693d48f33ae64d524f08af5ff
[ "MIT" ]
null
null
null
src/metrics/__init__.py
wvitzthum/DL_super_resolution
59b2e68bad02579693d48f33ae64d524f08af5ff
[ "MIT" ]
null
null
null
from .psnr import psnr
11.5
22
0.782609
4
23
4.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.173913
23
1
23
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
1
0
0
6
54f9e287f9e9e14d596e96b772f0895df69c27e7
15,397
py
Python
tests/model/api/test_http_api_generator.py
BearerPipelineTest/serverless-application-model
2be47dfdf1140b1e84a24bab392cfd634dfe9d1f
[ "Apache-2.0", "MIT" ]
null
null
null
tests/model/api/test_http_api_generator.py
BearerPipelineTest/serverless-application-model
2be47dfdf1140b1e84a24bab392cfd634dfe9d1f
[ "Apache-2.0", "MIT" ]
null
null
null
tests/model/api/test_http_api_generator.py
BearerPipelineTest/serverless-application-model
2be47dfdf1140b1e84a24bab392cfd634dfe9d1f
[ "Apache-2.0", "MIT" ]
null
null
null
from unittest import TestCase from unittest.mock import patch import pytest from functools import reduce from samtranslator.model import InvalidResourceException from samtranslator.model.api.http_api_generator import HttpApiGenerator from samtranslator.open_api.open_api import OpenApiEditor class TestHttpApiGenerator(TestCase): kwargs = { "logical_id": "HttpApiId", "stage_variables": None, "depends_on": None, "definition_body": None, "definition_uri": None, "stage_name": None, "tags": None, "auth": None, "access_log_settings": None, "resource_attributes": None, "passthrough_resource_attributes": None, } authorizers = { "Authorizers": { "OAuth2": { "AuthorizationScopes": ["scope"], "JwtConfiguration": {"config": "value"}, "IdentitySource": "https://example.com", } } } def test_auth_no_def_body(self): self.kwargs["auth"] = {"Authorizers": "configuration"} self.kwargs["definition_body"] = None with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_auth_wrong_properties(self): self.kwargs["auth"] = {"Invalid": "auth"} self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_auth_invalid_def_body(self): self.kwargs["auth"] = {"Authorizers": "auth"} self.kwargs["definition_body"] = {"Invalid": "open_api"} with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_auth_invalid_auth_dict(self): self.kwargs["auth"] = {"Authorizers": "auth"} self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_auth_invalid_auth_strategy(self): self.kwargs["auth"] = {"Authorizers": {"Auth1": "invalid"}} self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_auth_missing_default_auth(self): self.kwargs["auth"] = self.authorizers self.kwargs["auth"]["DefaultAuthorizer"] = "DNE" self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_auth_intrinsic_default_auth(self): self.kwargs["auth"] = self.authorizers self.kwargs["auth"]["DefaultAuthorizer"] = {"Ref": "SomeValue"} self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_auth_iam_enabled(self): self.kwargs["auth"] = { "EnableIamAuthorizer": True, } self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() self.assertEqual( http_api.Body["components"]["securitySchemes"], { "AWS_IAM": { "type": "apiKey", "name": "Authorization", "in": "header", "x-amazon-apigateway-authtype": "awsSigv4", } }, ) def test_enabling_auth_iam_does_not_clobber_conflicting_custom_authorizer(self): self.kwargs["auth"] = { "EnableIamAuthorizer": True, "Authorizers": { "AWS_IAM": { "AuthorizationScopes": ["scope"], "JwtConfiguration": {"config": "value"}, "IdentitySource": "https://example.com", } }, } self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() self.kwargs["definition_uri"] = None http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() self.assertEqual( http_api.Body["components"]["securitySchemes"], { "AWS_IAM": { "type": "oauth2", "x-amazon-apigateway-authorizer": { "jwtConfiguration": {"config": "value"}, "identitySource": "https://example.com", "type": "jwt", }, } }, ) def test_auth_iam_enabled_with_default(self): self.kwargs["auth"] = { "DefaultAuthorizer": "AWS_IAM", "EnableIamAuthorizer": True, } self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() self.assertEqual( http_api.Body["components"]["securitySchemes"], { "AWS_IAM": { "type": "apiKey", "name": "Authorization", "in": "header", "x-amazon-apigateway-authtype": "awsSigv4", } }, ) def test_auth_missing_iam_enablement(self): self.kwargs["auth"] = { "DefaultAuthorizer": "AWS_IAM", "EnableIamAuthorizer": False, } self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() with pytest.raises(InvalidResourceException) as e: HttpApiGenerator(**self.kwargs)._construct_http_api() self.assertEqual( e.value.message, "Resource with id [HttpApiId] is invalid. " + "Unable to set DefaultAuthorizer because 'AWS_IAM' was not defined in 'Authorizers'.", ) def test_auth_iam_disabled(self): self.kwargs["auth"] = { "EnableIamAuthorizer": False, } self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() self.assertNotIn("components", http_api.Body) def test_auth_iam_not_enabled_with_unsupported_values(self): unsupported_values = [1, "", [], {}, {"Ref": "MyVar"}, "True", None] for val in unsupported_values: self.kwargs["auth"] = { "EnableIamAuthorizer": val, } self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() self.assertNotIn("components", http_api.Body, "EnableIamAuthorizer value: %s" % val) def test_auth_novalue_default_does_not_raise(self): self.kwargs["auth"] = self.authorizers self.kwargs["auth"]["DefaultAuthorizer"] = {"Ref": "AWS::NoValue"} self.kwargs["definition_body"] = OpenApiEditor.gen_skeleton() HttpApiGenerator(**self.kwargs)._construct_http_api() def test_def_uri_invalid_dict(self): self.kwargs["auth"] = None self.kwargs["definition_body"] = None self.kwargs["definition_uri"] = {"Invalid": "key"} with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_def_uri_invalid_uri(self): self.kwargs["auth"] = None self.kwargs["definition_body"] = None self.kwargs["definition_uri"] = "invalid_uri" with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() def test_no_def_body_or_uri(self): self.kwargs["auth"] = None self.kwargs["definition_body"] = None self.kwargs["definition_uri"] = None with pytest.raises(InvalidResourceException): HttpApiGenerator(**self.kwargs)._construct_http_api() class TestCustomDomains(TestCase): kwargs = { "logical_id": "HttpApiId", "stage_variables": None, "depends_on": None, "definition_body": None, "definition_uri": "s3://bucket/key", "stage_name": None, "tags": None, "auth": None, "access_log_settings": None, "resource_attributes": None, "passthrough_resource_attributes": None, "domain": None, } def test_no_domain(self): self.kwargs["domain"] = None http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() domain, basepath, route = HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertIsNone(domain) self.assertIsNone(basepath) self.assertIsNone(route) def test_no_domain_name(self): self.kwargs["domain"] = {"CertificateArn": "someurl"} http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() with pytest.raises(InvalidResourceException) as e: HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertEqual( e.value.message, "Resource with id [HttpApiId] is invalid. " + "Custom Domains only works if both DomainName and CertificateArn are provided.", ) def test_no_cert_arn(self): self.kwargs["domain"] = {"DomainName": "example.com"} http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() with pytest.raises(InvalidResourceException) as e: HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertEqual( e.value.message, "Resource with id [HttpApiId] is invalid. " + "Custom Domains only works if both DomainName and CertificateArn are provided.", ) def test_basic_domain_default_endpoint(self): self.kwargs["domain"] = {"DomainName": "example.com", "CertificateArn": "some-url"} http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() domain, basepath, route = HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertIsNotNone(domain, None) self.assertIsNotNone(basepath, None) self.assertEqual(len(basepath), 1) self.assertIsNone(route, None) self.assertEqual(domain.DomainNameConfigurations[0].get("EndpointType"), "REGIONAL") def test_basic_domain_regional_endpoint(self): self.kwargs["domain"] = { "DomainName": "example.com", "CertificateArn": "some-url", "EndpointConfiguration": "REGIONAL", } http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() domain, basepath, route = HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertIsNotNone(domain, None) self.assertIsNotNone(basepath, None) self.assertEqual(len(basepath), 1) self.assertIsNone(route, None) self.assertEqual(domain.DomainNameConfigurations[0].get("EndpointType"), "REGIONAL") def test_basic_domain_edge_endpoint(self): self.kwargs["domain"] = { "DomainName": "example.com", "CertificateArn": "some-url", "EndpointConfiguration": "EDGE", } http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() with pytest.raises(InvalidResourceException) as e: HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertEqual( e.value.message, "Resource with id [HttpApiId] is invalid. EndpointConfiguration for Custom Domains must be one of ['REGIONAL'].", ) def test_bad_endpoint(self): self.kwargs["domain"] = { "DomainName": "example.com", "CertificateArn": "some-url", "EndpointConfiguration": "INVALID", } http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() with pytest.raises(InvalidResourceException) as e: HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertEqual( e.value.message, "Resource with id [HttpApiId] is invalid. " + "EndpointConfiguration for Custom Domains must be one of ['REGIONAL'].", ) def test_basic_route53(self): self.kwargs["domain"] = { "DomainName": "example.com", "CertificateArn": "some-url", "Route53": {"HostedZoneId": "xyz"}, } http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() domain, basepath, route = HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertIsNotNone(domain, None) self.assertIsNotNone(basepath, None) self.assertEqual(len(basepath), 1) self.assertIsNotNone(route, None) self.assertEqual(domain.DomainNameConfigurations[0].get("EndpointType"), "REGIONAL") def test_basepaths(self): self.kwargs["domain"] = { "DomainName": "example.com", "CertificateArn": "some-url", "BasePath": ["one", "two", "three"], "Route53": {"HostedZoneId": "xyz"}, } http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() domain, basepath, route = HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertIsNotNone(domain, None) self.assertIsNotNone(basepath, None) self.assertEqual(len(basepath), 3) self.assertIsNotNone(route, None) self.assertEqual(domain.DomainNameConfigurations[0].get("EndpointType"), "REGIONAL") def test_invalid_basepaths(self): self.kwargs["domain"] = { "DomainName": "example.com", "CertificateArn": "some-url", "BasePath": ["inv*alid"], "Route53": {"HostedZoneId": "xyz"}, } http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() with pytest.raises(InvalidResourceException) as e: HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertEqual( e.value.message, "Resource with id [HttpApiId] is invalid. " + "Invalid Basepath name provided." ) def test_basepaths(self): self.kwargs["domain"] = { "DomainName": "example.com", "CertificateArn": "some-url", "BasePath": ["one-1", "two_2", "three", "/", "/api", "api/v1", "api/v1/", "/api/v1/"], "Route53": {"HostedZoneId": "xyz", "HostedZoneName": "abc", "IpV6": True}, } http_api = HttpApiGenerator(**self.kwargs)._construct_http_api() domain, basepath, route = HttpApiGenerator(**self.kwargs)._construct_api_domain(http_api) self.assertIsNotNone(domain, None) self.assertIsNotNone(basepath, None) self.assertEqual(len(basepath), 8) self.assertIsNotNone(route, None) self.assertEqual(route.HostedZoneName, None) self.assertEqual(route.HostedZoneId, "xyz") self.assertEqual(len(route.RecordSets), 2) self.assertEqual( list(map(lambda base: base.ApiMappingKey, basepath)), ["one-1", "two_2", "three", "", "api", "api/v1", "api/v1", "api/v1"], )
42.068306
125
0.614211
1,456
15,397
6.271291
0.12706
0.099661
0.11105
0.149491
0.844157
0.829263
0.818092
0.792356
0.783375
0.75972
0
0.003323
0.257193
15,397
365
126
42.183562
0.795051
0
0
0.626506
0
0
0.208222
0.016432
0
0
0
0
0.126506
1
0.084337
false
0.006024
0.021084
0
0.120482
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
54fa2868450a39cf3499cbb89ea43e7d9ee6b6ee
6,980
py
Python
tests/test_stock_management.py
venkat402/saleor
d1b5e43483981a4add5a2946b6b4ff1f376c9341
[ "CC-BY-4.0" ]
4
2021-04-09T01:07:00.000Z
2022-02-15T10:51:39.000Z
tests/test_stock_management.py
gurupratap-matharu/saleor
c9d147dba24ddef1def889852c229027bab767df
[ "CC-BY-4.0" ]
null
null
null
tests/test_stock_management.py
gurupratap-matharu/saleor
c9d147dba24ddef1def889852c229027bab767df
[ "CC-BY-4.0" ]
1
2019-09-15T02:19:10.000Z
2019-09-15T02:19:10.000Z
import pytest from saleor.core.exceptions import InsufficientStock from saleor.warehouse.management import ( allocate_stock, deallocate_stock, decrease_stock, increase_stock, ) from saleor.warehouse.models import Allocation COUNTRY_CODE = "US" def test_allocate_stock(order_line, stock): stock.quantity = 100 stock.save(update_fields=["quantity"]) allocate_stock(order_line, COUNTRY_CODE, 50) stock.refresh_from_db() assert stock.quantity == 100 allocation = Allocation.objects.get(order_line=order_line, stock=stock) assert allocation.quantity_allocated == 50 def test_allocate_stock_many_stocks(order_line, variant_with_many_stocks): variant = variant_with_many_stocks stocks = variant.stocks.all() allocate_stock(order_line, COUNTRY_CODE, 5) allocations = Allocation.objects.filter(order_line=order_line, stock__in=stocks) assert allocations[0].quantity_allocated == 4 assert allocations[1].quantity_allocated == 1 def test_allocate_stock_many_stocks_partially_allocated( order_line, order_line_with_allocation_in_many_stocks ): allocated_line = order_line_with_allocation_in_many_stocks variant = allocated_line.variant stocks = variant.stocks.all() allocate_stock(order_line, COUNTRY_CODE, 4) allocations = Allocation.objects.filter(order_line=order_line, stock__in=stocks) assert allocations[0].quantity_allocated == 2 assert allocations[1].quantity_allocated == 2 def test_allocate_stock_partially_allocated_insufficient_stocks( order_line, order_line_with_allocation_in_many_stocks ): allocated_line = order_line_with_allocation_in_many_stocks variant = allocated_line.variant stocks = variant.stocks.all() with pytest.raises(InsufficientStock): allocate_stock(order_line, COUNTRY_CODE, 6) assert not Allocation.objects.filter( order_line=order_line, stock__in=stocks ).exists() def test_allocate_stock_insufficient_stocks(order_line, variant_with_many_stocks): variant = variant_with_many_stocks stocks = variant.stocks.all() with pytest.raises(InsufficientStock): allocate_stock(order_line, COUNTRY_CODE, 10) assert not Allocation.objects.filter( order_line=order_line, stock__in=stocks ).exists() def test_deallocate_stock(allocation): stock = allocation.stock stock.quantity = 100 stock.save(update_fields=["quantity"]) allocation.quantity_allocated = 80 allocation.save(update_fields=["quantity_allocated"]) deallocate_stock(allocation.order_line, 80) stock.refresh_from_db() assert stock.quantity == 100 allocation.refresh_from_db() assert allocation.quantity_allocated == 0 def test_deallocate_stock_partially(allocation): stock = allocation.stock stock.quantity = 100 stock.save(update_fields=["quantity"]) allocation.quantity_allocated = 80 allocation.save(update_fields=["quantity_allocated"]) deallocate_stock(allocation.order_line, 50) stock.refresh_from_db() assert stock.quantity == 100 allocation.refresh_from_db() assert allocation.quantity_allocated == 30 def test_deallocate_stock_many_allocations(order_line_with_allocation_in_many_stocks,): order_line = order_line_with_allocation_in_many_stocks deallocate_stock(order_line, 3) allocations = order_line.allocations.all() assert allocations[0].quantity_allocated == 0 assert allocations[1].quantity_allocated == 0 def test_deallocate_stock_many_allocations_partially( order_line_with_allocation_in_many_stocks, ): order_line = order_line_with_allocation_in_many_stocks deallocate_stock(order_line, 1) allocations = order_line.allocations.all() assert allocations[0].quantity_allocated == 1 assert allocations[1].quantity_allocated == 1 def test_increase_stock_without_allocate(allocation): stock = allocation.stock stock.quantity = 100 stock.save(update_fields=["quantity"]) allocation.quantity_allocated = 80 allocation.save(update_fields=["quantity_allocated"]) increase_stock(allocation.order_line, stock.warehouse, 50, allocate=False) stock.refresh_from_db() assert stock.quantity == 150 allocation.refresh_from_db() assert allocation.quantity_allocated == 80 def test_increase_stock_with_allocate(allocation): stock = allocation.stock stock.quantity = 100 stock.save(update_fields=["quantity"]) allocation.quantity_allocated = 80 allocation.save(update_fields=["quantity_allocated"]) increase_stock(allocation.order_line, stock.warehouse, 50, allocate=True) stock.refresh_from_db() assert stock.quantity == 150 allocation.refresh_from_db() assert allocation.quantity_allocated == 130 def test_increase_stock_with_new_allocation(order_line, stock): assert not Allocation.objects.filter(order_line=order_line, stock=stock).exists() stock.quantity = 100 stock.save(update_fields=["quantity"]) increase_stock(order_line, stock.warehouse, 50, allocate=True) stock.refresh_from_db() assert stock.quantity == 150 allocation = Allocation.objects.get(order_line=order_line, stock=stock) assert allocation.quantity_allocated == 50 def test_decrease_stock(allocation): stock = allocation.stock stock.quantity = 100 stock.save(update_fields=["quantity"]) allocation.quantity_allocated = 80 allocation.save(update_fields=["quantity_allocated"]) decrease_stock(allocation.order_line, 50) stock.refresh_from_db() assert stock.quantity == 50 allocation.refresh_from_db() assert allocation.quantity_allocated == 30 def test_decrease_stock_partially(allocation): stock = allocation.stock stock.quantity = 100 stock.save(update_fields=["quantity"]) allocation.quantity_allocated = 80 allocation.save(update_fields=["quantity_allocated"]) decrease_stock(allocation.order_line, 80) stock.refresh_from_db() assert stock.quantity == 20 allocation.refresh_from_db() assert allocation.quantity_allocated == 0 def test_decrease_stock_many_allocations(order_line_with_allocation_in_many_stocks,): order_line = order_line_with_allocation_in_many_stocks decrease_stock(order_line, 3) allocations = order_line.allocations.all() assert allocations[0].quantity_allocated == 0 assert allocations[0].stock.quantity == 2 assert allocations[1].quantity_allocated == 0 assert allocations[1].stock.quantity == 2 def test_decrease_stock_many_allocations_partially( order_line_with_allocation_in_many_stocks, ): order_line = order_line_with_allocation_in_many_stocks decrease_stock(order_line, 2) allocations = order_line.allocations.all() assert allocations[0].quantity_allocated == 0 assert allocations[0].stock.quantity == 2 assert allocations[1].quantity_allocated == 1 assert allocations[1].stock.quantity == 3
30.614035
87
0.766332
865
6,980
5.833526
0.075145
0.099881
0.038644
0.066587
0.912604
0.897939
0.86088
0.851962
0.826001
0.816092
0
0.021882
0.148854
6,980
227
88
30.748899
0.82747
0
0
0.670807
0
0
0.024928
0
0
0
0
0
0.217391
1
0.099379
false
0
0.024845
0
0.124224
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
07338274c895d2601647cc8f82688d240e0f1b77
23,678
py
Python
pybind/slxos/v16r_1_00b/brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
null
null
null
pybind/slxos/v16r_1_00b/brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
null
null
null
pybind/slxos/v16r_1_00b/brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/__init__.py
shivharis/pybind
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
[ "Apache-2.0" ]
1
2021-11-05T22:15:42.000Z
2021-11-05T22:15:42.000Z
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from decimal import Decimal from bitarray import bitarray import __builtin__ class show_mpls_dynamic_bypass_interface_brief(PybindBase): """ This class was auto-generated by the PythonClass plugin for PYANG from YANG module brocade-mpls - based on the path /brocade_mpls_rpc/show-mpls-dynamic-bypass-interface-brief/output/mpls-dynamic-bypass-interface-brief/show-mpls-dynamic-bypass-interface-brief. Each member element of the container is represented as a class variable - with a specific YANG type. """ __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__dbyp_interface_name','__dbyp_interface_active_status','__dbyp_interface_admin_type','__dbyp_interface_admin_status','__dbyp_interface_count','__dbyp_interface_merge_point',) _yang_name = 'show-mpls-dynamic-bypass-interface-brief' _rest_name = 'show-mpls-dynamic-bypass-interface-brief' _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): path_helper_ = kwargs.pop("path_helper", None) if path_helper_ is False: self._path_helper = False elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper): self._path_helper = path_helper_ elif hasattr(self, "_parent"): path_helper_ = getattr(self._parent, "_path_helper", False) self._path_helper = path_helper_ else: self._path_helper = False extmethods = kwargs.pop("extmethods", None) if extmethods is False: self._extmethods = False elif extmethods is not None and isinstance(extmethods, dict): self._extmethods = extmethods elif hasattr(self, "_parent"): extmethods = getattr(self._parent, "_extmethods", None) self._extmethods = extmethods else: self._extmethods = False self.__dbyp_interface_admin_status = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-admin-status", rest_name="dbyp-interface-admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) self.__dbyp_interface_merge_point = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="dbyp-interface-merge-point", rest_name="dbyp-interface-merge-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint32', is_config=True) self.__dbyp_interface_count = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="dbyp-interface-count", rest_name="dbyp-interface-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint16', is_config=True) self.__dbyp_interface_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="dbyp-interface-name", rest_name="dbyp-interface-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='string', is_config=True) self.__dbyp_interface_admin_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-admin-type", rest_name="dbyp-interface-admin-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) self.__dbyp_interface_active_status = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-active-status", rest_name="dbyp-interface-active-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) load = kwargs.pop("load", None) if args: if len(args) > 1: raise TypeError("cannot create a YANG container with >1 argument") all_attr = True for e in self._pyangbind_elements: if not hasattr(args[0], e): all_attr = False break if not all_attr: raise ValueError("Supplied object did not have the correct attributes") for e in self._pyangbind_elements: nobj = getattr(args[0], e) if nobj._changed() is False: continue setmethod = getattr(self, "_set_%s" % e) if load is None: setmethod(getattr(args[0], e)) else: setmethod(getattr(args[0], e), load=load) def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: return [u'brocade_mpls_rpc', u'show-mpls-dynamic-bypass-interface-brief', u'output', u'mpls-dynamic-bypass-interface-brief', u'show-mpls-dynamic-bypass-interface-brief'] def _rest_path(self): if hasattr(self, "_parent"): if self._rest_name: return self._parent._rest_path()+[self._rest_name] else: return self._parent._rest_path() else: return [u'show-mpls-dynamic-bypass-interface-brief', u'output', u'mpls-dynamic-bypass-interface-brief', u'show-mpls-dynamic-bypass-interface-brief'] def _get_dbyp_interface_name(self): """ Getter method for dbyp_interface_name, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_name (string) YANG Description: Dynamic Bypass Interface name """ return self.__dbyp_interface_name def _set_dbyp_interface_name(self, v, load=False): """ Setter method for dbyp_interface_name, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_name (string) If this variable is read-only (config: false) in the source YANG file, then _set_dbyp_interface_name is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_dbyp_interface_name() directly. YANG Description: Dynamic Bypass Interface name """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="dbyp-interface-name", rest_name="dbyp-interface-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='string', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """dbyp_interface_name must be of a type compatible with string""", 'defined-type': "string", 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="dbyp-interface-name", rest_name="dbyp-interface-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='string', is_config=True)""", }) self.__dbyp_interface_name = t if hasattr(self, '_set'): self._set() def _unset_dbyp_interface_name(self): self.__dbyp_interface_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="dbyp-interface-name", rest_name="dbyp-interface-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='string', is_config=True) def _get_dbyp_interface_active_status(self): """ Getter method for dbyp_interface_active_status, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_active_status (uint8) YANG Description: Active status for the dynamic bypass interface """ return self.__dbyp_interface_active_status def _set_dbyp_interface_active_status(self, v, load=False): """ Setter method for dbyp_interface_active_status, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_active_status (uint8) If this variable is read-only (config: false) in the source YANG file, then _set_dbyp_interface_active_status is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_dbyp_interface_active_status() directly. YANG Description: Active status for the dynamic bypass interface """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-active-status", rest_name="dbyp-interface-active-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """dbyp_interface_active_status must be of a type compatible with uint8""", 'defined-type': "uint8", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-active-status", rest_name="dbyp-interface-active-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True)""", }) self.__dbyp_interface_active_status = t if hasattr(self, '_set'): self._set() def _unset_dbyp_interface_active_status(self): self.__dbyp_interface_active_status = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-active-status", rest_name="dbyp-interface-active-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) def _get_dbyp_interface_admin_type(self): """ Getter method for dbyp_interface_admin_type, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_admin_type (uint8) YANG Description: Admin type of the dynamic bypass interface """ return self.__dbyp_interface_admin_type def _set_dbyp_interface_admin_type(self, v, load=False): """ Setter method for dbyp_interface_admin_type, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_admin_type (uint8) If this variable is read-only (config: false) in the source YANG file, then _set_dbyp_interface_admin_type is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_dbyp_interface_admin_type() directly. YANG Description: Admin type of the dynamic bypass interface """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-admin-type", rest_name="dbyp-interface-admin-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """dbyp_interface_admin_type must be of a type compatible with uint8""", 'defined-type': "uint8", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-admin-type", rest_name="dbyp-interface-admin-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True)""", }) self.__dbyp_interface_admin_type = t if hasattr(self, '_set'): self._set() def _unset_dbyp_interface_admin_type(self): self.__dbyp_interface_admin_type = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-admin-type", rest_name="dbyp-interface-admin-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) def _get_dbyp_interface_admin_status(self): """ Getter method for dbyp_interface_admin_status, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_admin_status (uint8) YANG Description: Admin status of the dynamic bypass interface """ return self.__dbyp_interface_admin_status def _set_dbyp_interface_admin_status(self, v, load=False): """ Setter method for dbyp_interface_admin_status, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_admin_status (uint8) If this variable is read-only (config: false) in the source YANG file, then _set_dbyp_interface_admin_status is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_dbyp_interface_admin_status() directly. YANG Description: Admin status of the dynamic bypass interface """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-admin-status", rest_name="dbyp-interface-admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """dbyp_interface_admin_status must be of a type compatible with uint8""", 'defined-type': "uint8", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-admin-status", rest_name="dbyp-interface-admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True)""", }) self.__dbyp_interface_admin_status = t if hasattr(self, '_set'): self._set() def _unset_dbyp_interface_admin_status(self): self.__dbyp_interface_admin_status = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="dbyp-interface-admin-status", rest_name="dbyp-interface-admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint8', is_config=True) def _get_dbyp_interface_count(self): """ Getter method for dbyp_interface_count, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_count (uint16) YANG Description: Dynamic bypass count of the interface """ return self.__dbyp_interface_count def _set_dbyp_interface_count(self, v, load=False): """ Setter method for dbyp_interface_count, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_count (uint16) If this variable is read-only (config: false) in the source YANG file, then _set_dbyp_interface_count is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_dbyp_interface_count() directly. YANG Description: Dynamic bypass count of the interface """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="dbyp-interface-count", rest_name="dbyp-interface-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint16', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """dbyp_interface_count must be of a type compatible with uint16""", 'defined-type': "uint16", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="dbyp-interface-count", rest_name="dbyp-interface-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint16', is_config=True)""", }) self.__dbyp_interface_count = t if hasattr(self, '_set'): self._set() def _unset_dbyp_interface_count(self): self.__dbyp_interface_count = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="dbyp-interface-count", rest_name="dbyp-interface-count", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint16', is_config=True) def _get_dbyp_interface_merge_point(self): """ Getter method for dbyp_interface_merge_point, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_merge_point (uint32) YANG Description: Dynamic Bypass merge point count of the interface """ return self.__dbyp_interface_merge_point def _set_dbyp_interface_merge_point(self, v, load=False): """ Setter method for dbyp_interface_merge_point, mapped from YANG variable /brocade_mpls_rpc/show_mpls_dynamic_bypass_interface_brief/output/mpls_dynamic_bypass_interface_brief/show_mpls_dynamic_bypass_interface_brief/dbyp_interface_merge_point (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_dbyp_interface_merge_point is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_dbyp_interface_merge_point() directly. YANG Description: Dynamic Bypass merge point count of the interface """ if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="dbyp-interface-merge-point", rest_name="dbyp-interface-merge-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint32', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """dbyp_interface_merge_point must be of a type compatible with uint32""", 'defined-type': "uint32", 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="dbyp-interface-merge-point", rest_name="dbyp-interface-merge-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint32', is_config=True)""", }) self.__dbyp_interface_merge_point = t if hasattr(self, '_set'): self._set() def _unset_dbyp_interface_merge_point(self): self.__dbyp_interface_merge_point = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="dbyp-interface-merge-point", rest_name="dbyp-interface-merge-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='uint32', is_config=True) dbyp_interface_name = __builtin__.property(_get_dbyp_interface_name, _set_dbyp_interface_name) dbyp_interface_active_status = __builtin__.property(_get_dbyp_interface_active_status, _set_dbyp_interface_active_status) dbyp_interface_admin_type = __builtin__.property(_get_dbyp_interface_admin_type, _set_dbyp_interface_admin_type) dbyp_interface_admin_status = __builtin__.property(_get_dbyp_interface_admin_status, _set_dbyp_interface_admin_status) dbyp_interface_count = __builtin__.property(_get_dbyp_interface_count, _set_dbyp_interface_count) dbyp_interface_merge_point = __builtin__.property(_get_dbyp_interface_merge_point, _set_dbyp_interface_merge_point) _pyangbind_elements = {'dbyp_interface_name': dbyp_interface_name, 'dbyp_interface_active_status': dbyp_interface_active_status, 'dbyp_interface_admin_type': dbyp_interface_admin_type, 'dbyp_interface_admin_status': dbyp_interface_admin_status, 'dbyp_interface_count': dbyp_interface_count, 'dbyp_interface_merge_point': dbyp_interface_merge_point, }
73.534161
458
0.772743
3,239
23,678
5.299784
0.05619
0.127228
0.07177
0.072702
0.896831
0.855936
0.835081
0.810381
0.795759
0.774554
0
0.009835
0.115424
23,678
321
459
73.76324
0.80974
0.237013
0
0.441489
0
0.031915
0.334857
0.210767
0
0
0
0
0
1
0.111702
false
0.026596
0.042553
0
0.276596
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
075c693849ebf51127fac44417a9e38d7919722a
120
py
Python
tests/_site/import_error_app/catalogue/app.py
akiyoko/oscar_sandbox
b384f1c0b5f297fd4b84509a575f6766a48630a5
[ "BSD-3-Clause" ]
68
2016-11-06T05:07:57.000Z
2021-12-17T09:17:38.000Z
tests/_site/import_error_app/catalogue/app.py
akiyoko/oscar_sandbox
b384f1c0b5f297fd4b84509a575f6766a48630a5
[ "BSD-3-Clause" ]
10
2020-05-11T20:33:31.000Z
2022-03-12T00:24:28.000Z
tests/_site/import_error_app/catalogue/app.py
akiyoko/oscar_sandbox
b384f1c0b5f297fd4b84509a575f6766a48630a5
[ "BSD-3-Clause" ]
28
2016-12-04T07:12:50.000Z
2021-02-06T21:13:15.000Z
# On purpose raise ImportError from django import NonExistingApp class CatalogueApplication(NonExistingApp): pass
17.142857
43
0.816667
12
120
8.166667
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.15
120
6
44
20
0.960784
0.233333
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
6
4ac9f5fc6065c16c0765fb5963941200da346f53
29
py
Python
__init__.py
constantinpape/glasbey
edc0caac52af2594eb108aaa23a49b2e5dcf730b
[ "MIT" ]
95
2015-12-01T09:49:20.000Z
2022-03-30T11:12:06.000Z
__init__.py
constantinpape/glasbey
edc0caac52af2594eb108aaa23a49b2e5dcf730b
[ "MIT" ]
13
2020-07-07T03:59:02.000Z
2022-03-30T04:28:06.000Z
__init__.py
constantinpape/glasbey
edc0caac52af2594eb108aaa23a49b2e5dcf730b
[ "MIT" ]
19
2016-05-16T14:44:08.000Z
2022-03-01T18:05:09.000Z
from .glasbey import Glasbey
14.5
28
0.827586
4
29
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.137931
29
1
29
29
0.96
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
ab1eaa116a0e92fb6d74b20e26803655e06d232a
312
py
Python
src/validationlib/validation.py
rocoelho85/fiap
e24f7c56b55914f5fbc7895c9a20e0e166fc0225
[ "MIT" ]
null
null
null
src/validationlib/validation.py
rocoelho85/fiap
e24f7c56b55914f5fbc7895c9a20e0e166fc0225
[ "MIT" ]
null
null
null
src/validationlib/validation.py
rocoelho85/fiap
e24f7c56b55914f5fbc7895c9a20e0e166fc0225
[ "MIT" ]
null
null
null
def greaterThenZero(value): return True if value > 0 else False def greaterOrEqualThenZero(value): return True if value >= 0 else False def validInt(value): return True if type(value) is int else False def validFloat(value): return True if (type(value) is float or type(value) is int) else False
26
74
0.733974
49
312
4.673469
0.346939
0.19214
0.262009
0.296943
0.703057
0.703057
0.550218
0.305677
0.305677
0
0
0.007937
0.192308
312
11
75
28.363636
0.900794
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
0
0
0
null
0
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
ab336cbdcbe3e2ce84bf02d5a06cb5d4cfdf0fd4
361
py
Python
oni/twisted_event_dispatcher/__init__.py
cscutcher/twisted_event_dispatcher
9abfbb5af325daf2cc6000d5120e2628604afb5b
[ "Unlicense" ]
null
null
null
oni/twisted_event_dispatcher/__init__.py
cscutcher/twisted_event_dispatcher
9abfbb5af325daf2cc6000d5120e2628604afb5b
[ "Unlicense" ]
1
2015-03-24T14:32:30.000Z
2015-03-24T14:32:30.000Z
oni/twisted_event_dispatcher/__init__.py
cscutcher/twisted_event_dispatcher
9abfbb5af325daf2cc6000d5120e2628604afb5b
[ "Unlicense" ]
null
null
null
# -*- coding: utf-8 -*- ''' Establish external interface of twisted_event_dispatcher ''' # flake8 doesn't like imports below without use # flake8: noqa from oni.twisted_event_dispatcher._dispatcher import EventDispatcher from oni.twisted_event_dispatcher.interfaces import IEventDispatcher from oni.twisted_event_dispatcher.interfaces import IBackgroundUtility
36.1
70
0.833795
44
361
6.636364
0.590909
0.164384
0.30137
0.195205
0.407534
0.308219
0.308219
0
0
0
0
0.009202
0.096953
361
9
71
40.111111
0.886503
0.382271
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
db46ba8f62b2ae8c35612f0c6dd35474ff95c5e2
22
py
Python
upbank/__init__.py
alyssadev/upbankpy
eef13851587ddadc76f2865fbd8bea131570c8b2
[ "MIT" ]
3
2020-08-02T23:35:36.000Z
2022-01-03T23:51:05.000Z
upbank/__init__.py
alyssadev/upbankpy
eef13851587ddadc76f2865fbd8bea131570c8b2
[ "MIT" ]
null
null
null
upbank/__init__.py
alyssadev/upbankpy
eef13851587ddadc76f2865fbd8bea131570c8b2
[ "MIT" ]
null
null
null
from .upbank import *
11
21
0.727273
3
22
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.181818
22
1
22
22
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
db5a7d9f05dd3c4826b8f1c8f794b8364edebefd
7,708
py
Python
stories/migrations/0001_initial.py
Emrahgs/Food-stories
b3465ca25024e2370cd5ce42af83c1b92a8982d4
[ "MIT" ]
1
2021-08-19T19:20:11.000Z
2021-08-19T19:20:11.000Z
stories/migrations/0001_initial.py
Emrahgs/Food-stories
b3465ca25024e2370cd5ce42af83c1b92a8982d4
[ "MIT" ]
null
null
null
stories/migrations/0001_initial.py
Emrahgs/Food-stories
b3465ca25024e2370cd5ce42af83c1b92a8982d4
[ "MIT" ]
null
null
null
# Generated by Django 3.1.7 on 2021-03-18 09:07 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Category', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=127, verbose_name='Basliq')), ('image', models.ImageField(upload_to='recipe_images', verbose_name='Sekil')), ('order', models.PositiveIntegerField(default=1, verbose_name='Order')), ('is_published', models.BooleanField(default=True, verbose_name='Is Published')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ], options={ 'verbose_name': 'Category', 'verbose_name_plural': 'Categories', 'ordering': ('order', '-created_at'), }, ), migrations.CreateModel( name='Contact', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=127, verbose_name='Tam adi')), ('email', models.EmailField(max_length=63, verbose_name='E-poct')), ('subject', models.CharField(max_length=255, verbose_name='Movzu')), ('message', models.TextField(help_text='Bu qutuya mesajinizi daxil edin', verbose_name='Mesaj')), ('order', models.PositiveIntegerField(default=1, verbose_name='Order')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ], options={ 'ordering': ('-created_at',), }, ), migrations.CreateModel( name='Subscriber', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('email', models.EmailField(max_length=63, verbose_name='E-poct')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ], ), migrations.CreateModel( name='Tag', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=50, verbose_name='Title')), ('order', models.PositiveIntegerField(default=1, verbose_name='Order')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('is_published', models.BooleanField(verbose_name='Is_published')), ], options={ 'verbose_name': 'Tag', 'verbose_name_plural': 'Tags', 'ordering': ('created_at',), }, ), migrations.CreateModel( name='Story', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=127, verbose_name='Basliq')), ('description', models.TextField(verbose_name='Mezmun')), ('image', models.ImageField(upload_to='recipe_images', verbose_name='Sekil')), ('slug', models.SlugField(unique=True, verbose_name='Slug')), ('is_published', models.BooleanField(verbose_name='Is_published')), ('order', models.PositiveIntegerField(default=1, verbose_name='Order')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stories', to=settings.AUTH_USER_MODEL, verbose_name='author')), ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stories', to='stories.category', verbose_name='Category')), ('tags', models.ManyToManyField(blank=True, db_index=True, to='stories.Tag', verbose_name='Tags')), ], options={ 'ordering': ('-created_at',), }, ), migrations.CreateModel( name='Recipe', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=127, verbose_name='Basliq')), ('slug', models.SlugField(unique=True, verbose_name='Slug')), ('short_description', models.CharField(max_length=255, verbose_name='Qisa Mezmun')), ('image', models.ImageField(upload_to='recipe_images', verbose_name='Sekil')), ('description', models.TextField(verbose_name='Mezmun')), ('is_published', models.BooleanField(verbose_name='Is_published')), ('order', models.PositiveIntegerField(default=1, verbose_name='Order')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipes', to=settings.AUTH_USER_MODEL, verbose_name='author')), ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipes', to='stories.category', verbose_name='Category')), ('tags', models.ManyToManyField(blank=True, db_index=True, to='stories.Tag', verbose_name='Tags')), ], options={ 'ordering': ('-created_at',), }, ), migrations.CreateModel( name='Comment', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('context', models.TextField(verbose_name='Reyiniz')), ('email', models.EmailField(max_length=254, verbose_name='Emailiniz')), ('website', models.CharField(max_length=127, verbose_name='Website')), ('message', models.TextField(help_text='Bu qutuya mesajinizi daxil edin', verbose_name='Mesaj')), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment', to=settings.AUTH_USER_MODEL, verbose_name='Author')), ('parent_comment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sub_comments', to='stories.comment', verbose_name='Parent Comment')), ('recipe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment', to='stories.recipe', verbose_name='Recipe')), ('story', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment', to='stories.story', verbose_name='Story')), ], ), ]
57.954887
204
0.598469
777
7,708
5.727156
0.160875
0.126067
0.066067
0.078652
0.822921
0.808539
0.781124
0.737528
0.685393
0.674607
0
0.008678
0.252465
7,708
132
205
58.393939
0.763624
0.005838
0
0.648
1
0
0.156638
0
0
0
0
0
0
1
0
false
0
0.024
0
0.056
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
dbb35a6de200a49de36181b3ceb8c703426eafb3
103
py
Python
hooks/hook-regex.py
Lily418/fs2020-atc-voice-recognition
22555ceb8044502af1322a7baddabbdf99a79a5a
[ "MIT" ]
null
null
null
hooks/hook-regex.py
Lily418/fs2020-atc-voice-recognition
22555ceb8044502af1322a7baddabbdf99a79a5a
[ "MIT" ]
3
2021-09-12T15:18:12.000Z
2021-09-13T16:00:16.000Z
hooks/hook-regex.py
Lily418/fs2020-atc-voice-recognition
22555ceb8044502af1322a7baddabbdf99a79a5a
[ "MIT" ]
null
null
null
from PyInstaller.utils.hooks import collect_all datas, binaries, hiddenimports = collect_all('regex')
25.75
53
0.815534
13
103
6.307692
0.846154
0.243902
0
0
0
0
0
0
0
0
0
0
0.097087
103
3
54
34.333333
0.88172
0
0
0
0
0
0.048544
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
dbba1f2dd7bc381a3d54c4b3bc271d6b3877043b
7,267
py
Python
imexam/tests/test_util.py
patkel/imexam
31820b4f11e3be14e428d3c1336d3b277105f3dd
[ "BSD-3-Clause" ]
null
null
null
imexam/tests/test_util.py
patkel/imexam
31820b4f11e3be14e428d3c1336d3b277105f3dd
[ "BSD-3-Clause" ]
null
null
null
imexam/tests/test_util.py
patkel/imexam
31820b4f11e3be14e428d3c1336d3b277105f3dd
[ "BSD-3-Clause" ]
null
null
null
"""Licensed under a 3-clause BSD style license - see LICENSE.rst. Make sure that the functions in util are behaving as expected """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from numpy.testing import assert_equal from astropy.io import fits from imexam import util import ntpath # testing data test_data_zeros = np.zeros((100, 100), dtype=float) def test_invalid_simple_fits(): """Test for an invalid simple FITS hdu with no data in the primary HDU.""" simple_fits_hdu = fits.PrimaryHDU() valid_file, nextend, first_image = util.check_valid(simple_fits_hdu) assert_equal(valid_file, False) assert_equal(nextend, 0) assert_equal(first_image, None) def test_invalid_MEF_table(): """Test an MEF FITS hdu that only has table data.""" # create some binary table data data = np.arange(0, 1, 0.01) * np.random.rand(100) col = np.arange(100) + 1 d1 = fits.Column(name="data", format='d', array=data) c1 = fits.Column(name="item", format='d', array=col) cols = fits.ColDefs([c1, d1]) tbhdu = fits.BinTableHDU.from_columns(cols, name='TAB1') mef_fits_hdu = fits.HDUList() extension = fits.PrimaryHDU() mef_fits_hdu.append(tbhdu) mef_file, nextend, first_image = util.check_valid(mef_fits_hdu) assert_equal(mef_file, True) assert_equal(nextend, 1) assert_equal(first_image, None) def test_image_and_table_extensions(): """Validate an MEF with an image in the first and a table in the second extension.""" data = np.arange(0, 1, 0.01) * np.random.rand(100) col = np.arange(100) + 1 d1 = fits.Column(name="data", format='d', array=data) c1 = fits.Column(name="item", format='d', array=col) cols = fits.ColDefs([c1, d1]) tbhdu = fits.BinTableHDU.from_columns(cols, name='TAB1') mef_fits_hdu = fits.HDUList() mef_fits_hdu.append(fits.PrimaryHDU()) extension = fits.PrimaryHDU() mef_fits_hdu.append(tbhdu) mef_fits_hdu.append(fits.ImageHDU(test_data_zeros, header=extension.header, name='SCI1')) mef_file, nextend, first_image = util.check_valid(mef_fits_hdu) assert_equal(mef_file, True) assert_equal(nextend, 2) assert_equal(first_image, 2) def test_drizzled_image(): """Validate a drizzle style output, with an image in the primary HDU and a table in the first.""" data = np.arange(0, 1, 0.01) * np.random.rand(100) col = np.arange(100) + 1 d1 = fits.Column(name="data", format='d', array=data) c1 = fits.Column(name="item", format='d', array=col) cols = fits.ColDefs([c1, d1]) tbhdu = fits.BinTableHDU.from_columns(cols, name='TAB1') mef_fits_hdu = fits.HDUList() extension = fits.PrimaryHDU() mef_fits_hdu.append(fits.ImageHDU(test_data_zeros, header=extension.header)) mef_fits_hdu.data = test_data_zeros mef_fits_hdu.append(tbhdu) mef_file, nextend, first_image = util.check_valid(mef_fits_hdu) assert_equal(mef_file, True) assert_equal(nextend, 1) assert_equal(first_image, 0) def test_mef_2_image_extensions(): """Check the file to see if it is a multi-extension FITS file or a simple fits image where the data and header are stored in the primary hdr. testa valid MEF file with 2 image extensions and the first image in the first extension not the primary HDU """ mef_fits_hdu = fits.HDUList() mef_fits_hdu.append(fits.PrimaryHDU()) extension = fits.PrimaryHDU() extension.header['EXTVER'] = 1 mef_fits_hdu.append(fits.ImageHDU(test_data_zeros, header=extension.header, name='SCI1')) extension.header['EXTVER'] = 2 mef_fits_hdu.append(fits.ImageHDU(test_data_zeros, header=extension.header, name='SCI2')) mef_file, nextend, first_image = util.check_valid(mef_fits_hdu) assert_equal(mef_file, True) assert_equal(nextend, 2) assert_equal(first_image, 1) def test_simple_image_in_primary(): """Check the file to see if it is a multi-extension FITS file or a simple fits image where the data and header are stored in the primary hdr. This will try and find an image data unit in the primary HDU """ simple_fits_hdu = fits.PrimaryHDU() simple_fits_hdu.data = test_data_zeros mef_file, nextend, first_image = util.check_valid(simple_fits_hdu) assert_equal(mef_file, False) assert_equal(nextend, 0) assert_equal(first_image, 0) def test_hst_filename(): """Verify basename of a standard hst filename.""" hst_name = "hstimagex_cal.fits" shortname, extname, extver = util.verify_filename(filename=hst_name) short_compare = ntpath.basename(shortname) assert_equal(hst_name, short_compare) assert_equal(extname, None) assert_equal(extver, None) def test_ext_ver_filename(): """Verify basename of a filename given with ext and ver.""" hst_name_ext_ver = "hstimagex_cal.fits[sci,1]" rootname = "hstimagex_cal.fits" shortname, extname, extver = util.verify_filename(filename=hst_name_ext_ver) short_compare = ntpath.basename(shortname) assert_equal(rootname, short_compare) assert_equal(extname, "sci") assert_equal(extver, 1) def test_name_ver_filename(): """Verify basename of a filename given name and ver.""" hst_name_ver = "hstimagex_cal.fits[1]" rootname = "hstimagex_cal.fits" shortname, extname, extver = util.verify_filename(filename=hst_name_ver) short_compare = ntpath.basename(shortname) assert_equal(rootname, short_compare) assert_equal(extname, None) assert_equal(extver, 1) def test_extver(): """Verify that specifying an extver gets recorded correctly. extver is the extension number explicitly""" hst_name = "hstimagex_cal.fits" shortname, extname, extver = util.verify_filename(filename=hst_name, extver=1) short_compare = ntpath.basename(shortname) assert_equal(hst_name, short_compare) assert_equal(extname, None) assert_equal(extver, 1) def test_extname(): """Verify that specifying an extname gets recorded correctly.""" hst_name = "hstimagex_cal.fits" shortname, extname, extver = util.verify_filename(filename=hst_name, extname='sci') short_compare = ntpath.basename(shortname) assert_equal(hst_name, short_compare) assert_equal(extname, 'sci') assert_equal(extver, None) def test_name_ver(): """Verify that specifying both name and ver gets recorded correctly.""" hst_name = "hstimagex_cal.fits" shortname, extname, extver = util.verify_filename(filename=hst_name, extname='sci', extver=1) short_compare = ntpath.basename(shortname) assert_equal(hst_name, short_compare) assert_equal(extname, 'sci') assert_equal(extver, 1)
33.8
80
0.668089
989
7,267
4.689585
0.150657
0.087753
0.040966
0.031048
0.764985
0.746658
0.739759
0.721216
0.702889
0.68025
0
0.014893
0.233109
7,267
214
81
33.957944
0.817334
0.176276
0
0.701493
0
0
0.040102
0.00785
0
0
0
0
0.276119
1
0.089552
false
0
0.044776
0
0.134328
0.007463
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
918b8c03274cee00c22ac36b187b630522a2525b
10,103
py
Python
tests/test_list.py
arounkles/markflow
fb13a5ed5f2df958e068b869e8dbdcd2d93b1552
[ "Apache-2.0" ]
null
null
null
tests/test_list.py
arounkles/markflow
fb13a5ed5f2df958e068b869e8dbdcd2d93b1552
[ "Apache-2.0" ]
null
null
null
tests/test_list.py
arounkles/markflow
fb13a5ed5f2df958e068b869e8dbdcd2d93b1552
[ "Apache-2.0" ]
null
null
null
import textwrap from markflow.formatters.list import MarkdownList, split_code import pytest from .util import create_section, render class TestSplitCode: def test_nosplit(self) -> None: input_ = """\ test test""" expected = [input_] assert split_code(input_) == expected def test_split(self) -> None: input_ = textwrap.dedent( """\ plaintext ``` code code ``` plaintext""" ) expected = ["plaintext", "```\ncode\ncode\n```", "plaintext"] assert split_code(input_) == expected class TestMarkdownList: def test_basic(self) -> None: input_ = textwrap.dedent( """\ * I am a list that is pretty badly formatted * There are all sorts of problems that don't make this look very nice, like bullets that break across lines and missing spaces. * Which also is a problem when working with nested lists since they could be missing leading spaces and make things look extra confusing.""" ) expected = textwrap.dedent( """\ * I am a list that is pretty badly formatted * There are all sorts of problems that don't make this look very nice, like bullets that break across lines and missing spaces. * Which also is a problem when working with nested lists since they could be missing leading spaces and make things look extra confusing.""" ) lst = create_section(MarkdownList, input_) assert lst.reformatted(width=50) == expected lst = create_section(MarkdownList, expected) assert lst.reformatted(width=50) == expected assert render(expected) == render(input_) def test_make_bullets_same(self) -> None: input_ = textwrap.dedent( """\ * Test + Test - Test""" ) expected = textwrap.dedent( """\ * Test * Test * Test""" ) lst = create_section(MarkdownList, input_) assert lst.reformatted() == expected lst = create_section(MarkdownList, expected) assert lst.reformatted() == expected # Since we correct lists that have mismatched indicators, we update the strings # to have consistent bullets. # Note: Here, this doesn't actually test much. We keep it here for test # consistency. input_ = input_.replace("-", "*").replace("+", "*") expected = expected.replace("-", "*").replace("+", "*") assert render(expected) == render(input_) def test_correct_numbering(self) -> None: input_ = textwrap.dedent( """\ 1. Test 1. Test 4. Test""" ) expected = textwrap.dedent( """\ 1. Test 2. Test 3. Test""" ) lst = create_section(MarkdownList, input_) assert lst.reformatted() == expected lst = create_section(MarkdownList, expected) assert lst.reformatted() == expected assert render(expected) == render(input_) def test_nested_unordered(self) -> None: input_ = textwrap.dedent( """\ * This is a really long line that with terrible spacing - This is also a really long line with terrible spacing * This one's ok though - So is this one""" ) expected = textwrap.dedent( """\ * This is a really long line that with terrible spacing - This is also a really long line with terrible spacing - This one's ok though * So is this one""" ) lst = create_section(MarkdownList, input_) assert lst.reformatted(width=50) == expected lst = create_section(MarkdownList, expected) assert lst.reformatted(width=50) == expected # Since we correct lists that have mismatched indicators, we update the strings # to have consistent bullets. input_ = input_.replace("-", "*") expected = expected.replace("-", "*") assert render(expected) == render(input_) def test_nested_ordered(self) -> None: input_ = textwrap.dedent( """\ 1. This is a really long line that with terrible spacing 1. This is also a really long line with terrible spacing 1. This one's ok though 1. This one isn't great 1. So is this one""" ) expected = textwrap.dedent( """\ 1. This is a really long line that with terrible spacing 1. This is also a really long line with terrible spacing 2. This one's ok though 3. This one isn't great 2. So is this one""" ) lst = create_section(MarkdownList, input_) assert lst.reformatted(width=50) == expected lst = create_section(MarkdownList, expected) assert lst.reformatted(width=50) == expected input_ = input_.replace("-", "*") expected = expected.replace("-", "*") assert render(expected) == render(input_) def test_weird_indenting(self) -> None: input_ = textwrap.dedent( """\ * This is a really long line that with terrible spacing * Let's make sure this doesn't stay here * This is also a really long line with terrible spacing - Let's make sure this does stay here - This one's ok though, minus the symbol - So is this one""" ) expected = textwrap.dedent( """\ * This is a really long line that with terrible spacing * Let's make sure this doesn't stay here * This is also a really long line with terrible spacing - Let's make sure this does stay here * This one's ok though, minus the symbol * So is this one""" ) lst = create_section(MarkdownList, input_) assert lst.reformatted(width=50) == expected lst = create_section(MarkdownList, expected) assert lst.reformatted(width=50) == expected # Since we correct lists that have mismatched indicators, we update the strings # to have consistent bullets. input_ = input_.replace("-", "*") expected = expected.replace("-", "*") assert render(expected) == render(input_) def test_links(self) -> None: input_ = textwrap.dedent( """\ * [URL](http://example.com/very/nested/directory) * [URL](http://example.com)""" ) expected = textwrap.dedent( """\ * [URL]( http://example.com/very/nested/directory) * [URL](http://example.com)""" ) lst = create_section(MarkdownList, input_) assert lst.reformatted(width=30) == expected lst = create_section(MarkdownList, expected) assert lst.reformatted(width=30) == expected assert render(expected) == render(input_) def test_indented(self) -> None: input_ = " * Entry 1\n* Entry 2" expected = " * Entry 1\n * Entry 2" lst = create_section(MarkdownList, input_) assert lst.reformatted() == expected lst = create_section(MarkdownList, expected) assert lst.reformatted() == expected assert render(expected) == render(input_) def test_indented_numerics(self) -> None: input_ = " 1. Test\n 2. Test\n 10. Test" expected = " 1. Test\n 2. Test\n 3. Test" lst = create_section(MarkdownList, input_) assert lst.reformatted() == expected lst = create_section(MarkdownList, expected) assert lst.reformatted() == expected assert render(expected) == render(input_) def test_ordered_list_with_nine_entries(self) -> None: """Ensure we don't add extra indents on 10^n-1 length lists""" input_ = ( "1. a\n" "2. b\n" "3. c\n" "4. d\n" "5. e\n" "6. f\n" "7. g\n" "8. h\n" "9. i" ) expected = input_ lst = create_section(MarkdownList, input_) assert lst.reformatted() == expected lst = create_section(MarkdownList, expected) assert lst.reformatted() == expected assert render(expected) == render(input_) @pytest.mark.xfail( reason="TODO: Indentation isn't properly detected with ordered lists." ) def test_nested_ordered_bad_indent(self) -> None: input_ = textwrap.dedent( """\ 1. This is a really long line that with terrible spacing 1. This is also a really long line with terrible spacing 1. This one's ok though 1. This one isn't great 1. So is this one""" ) expected = textwrap.dedent( """\ 1. This is a really long line that with terrible spacing 2. This is also a really long line with terrible spacing 3. This one's ok though 4. This one isn't great 5. So is this one""" ) lst = create_section(MarkdownList, input_) assert lst.reformatted(width=50) == expected lst = create_section(MarkdownList, expected) assert lst.reformatted(width=50) == expected input_ = input_.replace("-", "*") expected = expected.replace("-", "*") assert render(expected) == render(input_)
35.699647
88
0.544195
1,096
10,103
4.923358
0.15146
0.055411
0.065234
0.114159
0.848592
0.800037
0.789659
0.789659
0.772053
0.749815
0
0.011332
0.362368
10,103
282
89
35.826241
0.826296
0.045927
0
0.569444
0
0
0.052416
0
0
0
0
0
0.243056
1
0.090278
false
0
0.027778
0
0.131944
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
919504d52e3c100497ecf11560a97940ed1d7dbe
2,931
py
Python
scripts/download_all_kilt_data.py
samuelbroscheit/KILT
b391de2f53bd338e83bea869cbe72f65b2c907ff
[ "MIT" ]
674
2020-09-07T08:15:17.000Z
2022-03-25T01:17:40.000Z
scripts/download_all_kilt_data.py
soumik2012/KILT
403489c0b73375ff14c055b6357ce525a548b592
[ "MIT" ]
34
2020-09-08T16:44:08.000Z
2022-03-27T09:55:00.000Z
scripts/download_all_kilt_data.py
soumik2012/KILT
403489c0b73375ff14c055b6357ce525a548b592
[ "MIT" ]
72
2020-09-07T18:21:18.000Z
2022-03-18T08:19:53.000Z
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import requests from tqdm.auto import tqdm urls = [ "http://dl.fbaipublicfiles.com/KILT/fever-train-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/fever-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/fever-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/nq-train-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/nq-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/nq-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/hotpotqa-train-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/hotpotqa-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/hotpotqa-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/triviaqa-train_id-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/triviaqa-dev_id-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/triviaqa-test_id_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/eli5-train-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/eli5-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/eli5-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/trex-train-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/trex-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/trex-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/structured_zeroshot-train-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/structured_zeroshot-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/structured_zeroshot-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/aidayago2-train-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/aidayago2-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/aidayago2-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/wned-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/wned-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/cweb-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/cweb-test_without_answers-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/wow-train-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/wow-dev-kilt.jsonl", "http://dl.fbaipublicfiles.com/KILT/wow-test_without_answers-kilt.jsonl", ] for url in urls: base = url.split("/")[-1] filename = f"data/{base}" r = requests.get(url, stream=True) # Total size in bytes. total_size = int(r.headers.get("content-length", 0)) block_size = 1024 # 1 Kibibyte t = tqdm(total=total_size, unit="iB", unit_scale=True, desc=base) with open(filename, "wb") as f: for data in r.iter_content(block_size): t.update(len(data)) f.write(data) t.close()
49.677966
93
0.722961
417
2,931
5
0.220624
0.089209
0.31223
0.356835
0.774101
0.761151
0.745324
0.745324
0.368345
0.23741
0
0.004983
0.10986
2,931
58
94
50.534483
0.794174
0.074036
0
0
0
0
0.73762
0
0
0
0
0
0
1
0
false
0
0.042553
0
0.042553
0
0
0
0
null
0
1
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
91987d6621f91a4d4bc145cf5a020097d54e2f92
210
py
Python
servers/python/coweb/updater/__init__.py
opencoweb/coweb
7b3a87ee9eda735a859447d404ee16edde1c5671
[ "AFL-2.1" ]
83
2015-01-05T19:02:57.000Z
2021-11-19T02:48:09.000Z
servers/python/coweb/updater/__init__.py
xuelingxiao/coweb
7b3a87ee9eda735a859447d404ee16edde1c5671
[ "AFL-2.1" ]
3
2015-12-16T13:49:33.000Z
2019-06-17T13:38:50.000Z
servers/python/coweb/updater/__init__.py
xuelingxiao/coweb
7b3a87ee9eda735a859447d404ee16edde1c5671
[ "AFL-2.1" ]
14
2015-04-29T22:36:53.000Z
2021-11-18T03:24:29.000Z
''' Updater Type Matcher extension point Copyright (c) The Dojo Foundation 2011. All Rights Reserved. Copyright (c) IBM Corporation 2008, 2011. All Rights Reserved. ''' from .base import UpdaterTypeMatcherBase
30
62
0.785714
27
210
6.111111
0.777778
0.121212
0.157576
0.254545
0
0
0
0
0
0
0
0.066298
0.138095
210
6
63
35
0.845304
0.761905
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
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
91c273733b10360c089a1763c21770d94a25f144
178
py
Python
examples/auracog_suggestions/__init__.py
Telefonica/clipspy
87d1d63604a209e2271efd3d3b8df0943836a504
[ "BSD-3-Clause" ]
null
null
null
examples/auracog_suggestions/__init__.py
Telefonica/clipspy
87d1d63604a209e2271efd3d3b8df0943836a504
[ "BSD-3-Clause" ]
null
null
null
examples/auracog_suggestions/__init__.py
Telefonica/clipspy
87d1d63604a209e2271efd3d3b8df0943836a504
[ "BSD-3-Clause" ]
null
null
null
from .rules_based_suggestions import RulesBasedIntentSuggestions from .context import TestJsonContextAdapter, ContextManagerContextAdapter, MappingContextAdapter, ContextAdapter
59.333333
112
0.910112
13
178
12.307692
0.846154
0
0
0
0
0
0
0
0
0
0
0
0.061798
178
2
113
89
0.958084
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
91d9ba9e54dcf33e42e466cc7473f98c7c23c044
96
py
Python
venv/lib/python3.8/site-packages/parso/tree.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/parso/tree.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/parso/tree.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/57/6d/dc/9a475209bb327ee87308c0e33037f9c57737f8f7fbc4815c2e0f01c27f
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.4375
0
96
1
96
96
0.458333
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
6
91df750631ca8701c6648525e4308db6ee4185c6
77
py
Python
src/imageprocessing/extend_data/__init__.py
shevdan/OCR_DataBases
8e7c26d45725938447ea890725cbda0b73340d3e
[ "MIT" ]
2
2021-05-17T17:33:43.000Z
2021-05-17T17:34:40.000Z
src/imageprocessing/extend_data/__init__.py
shevdan/OCR_DataBases
8e7c26d45725938447ea890725cbda0b73340d3e
[ "MIT" ]
1
2021-04-28T09:34:35.000Z
2021-04-28T09:41:47.000Z
src/imageprocessing/extend_data/__init__.py
shevdan/TextRecognition
8e7c26d45725938447ea890725cbda0b73340d3e
[ "MIT" ]
null
null
null
from . import convert_csv from . import data_adt from . import image_augment
25.666667
27
0.805195
12
77
4.916667
0.666667
0.508475
0
0
0
0
0
0
0
0
0
0
0.155844
77
3
27
25.666667
0.907692
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
7261ec11b9aafeb70162967a40077f8e7d289e68
4,560
py
Python
test/kernels/test_polynomial_kernel.py
Mehdishishehbor/gpytorch
432e537b3f6679ea4ab3acf33b14626b7e161c92
[ "MIT" ]
null
null
null
test/kernels/test_polynomial_kernel.py
Mehdishishehbor/gpytorch
432e537b3f6679ea4ab3acf33b14626b7e161c92
[ "MIT" ]
null
null
null
test/kernels/test_polynomial_kernel.py
Mehdishishehbor/gpytorch
432e537b3f6679ea4ab3acf33b14626b7e161c92
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import unittest import torch from Lgpytorch.kernels import PolynomialKernel from Lgpytorch.priors import NormalPrior from Lgpytorch.test.base_kernel_test_case import BaseKernelTestCase class TestPolynomialKernel(unittest.TestCase, BaseKernelTestCase): def create_kernel_no_ard(self, **kwargs): return PolynomialKernel(power=2, **kwargs) def test_computes_quadratic_kernel(self): a = torch.tensor([[4, 1], [2, 2], [8, 0]], dtype=torch.float) b = torch.tensor([[0, 0], [2, 1], [1, 0]], dtype=torch.float) kernel = PolynomialKernel(power=2) kernel.eval() actual = torch.zeros(3, 3) for i in range(3): for j in range(3): actual[i, j] = (a[i].matmul(b[j]) + kernel.offset).pow(kernel.power) res = kernel(a, b).evaluate() self.assertLess(torch.norm(res - actual), 1e-5) # diag res = kernel(a, b).diag() actual = actual.diag() self.assertLess(torch.norm(res - actual), 1e-5) # batch_dims actual = torch.zeros(2, 3, 3) for i in range(2): actual[i] = kernel(a[:, i].unsqueeze(-1), b[:, i].unsqueeze(-1)).evaluate() res = kernel(a, b, last_dim_is_batch=True).evaluate() self.assertLess(torch.norm(res - actual), 1e-5) # batch_dims + diag res = kernel(a, b, last_dim_is_batch=True).diag() actual = torch.cat([actual[i].diag().unsqueeze(0) for i in range(actual.size(0))]) self.assertLess(torch.norm(res - actual), 1e-5) def test_computes_cubic_kernel(self): a = torch.tensor([[4, 1], [2, 2], [8, 0]], dtype=torch.float) b = torch.tensor([[0, 0], [2, 1], [1, 0]], dtype=torch.float) kernel = PolynomialKernel(power=3) kernel.eval() actual = torch.zeros(3, 3) for i in range(3): for j in range(3): actual[i, j] = (a[i].matmul(b[j]) + kernel.offset).pow(kernel.power) res = kernel(a, b).evaluate() self.assertLess(torch.norm(res - actual), 1e-5) # diag res = kernel(a, b).diag() actual = actual.diag() self.assertLess(torch.norm(res - actual), 1e-5) # batch_dims actual = torch.zeros(2, 3, 3) for i in range(2): actual[i] = kernel(a[:, i].unsqueeze(-1), b[:, i].unsqueeze(-1)).evaluate() res = kernel(a, b, last_dim_is_batch=True).evaluate() self.assertLess(torch.norm(res - actual), 1e-5) # batch_dims + diag res = kernel(a, b, last_dim_is_batch=True).diag() actual = torch.cat([actual[i].diag().unsqueeze(0) for i in range(actual.size(0))]) self.assertLess(torch.norm(res - actual), 1e-5) def test_quadratic_kernel_batch(self): a = torch.tensor([[4, 2, 8], [1, 2, 3]], dtype=torch.float).view(2, 3, 1) b = torch.tensor([[0, 2, 1], [-1, 2, 0]], dtype=torch.float).view(2, 3, 1) kernel = PolynomialKernel(power=2, batch_shape=torch.Size([2])).initialize(offset=torch.rand(2, 1)) kernel.eval() actual = torch.zeros(2, 3, 3) for k in range(2): for i in range(3): for j in range(3): actual[k, i, j] = (a[k, i].matmul(b[k, j]) + kernel.offset[k]).pow(kernel.power) res = kernel(a, b).evaluate() self.assertLess(torch.norm(res - actual), 1e-5) def test_cubic_kernel_batch(self): a = torch.tensor([[4, 2, 8], [1, 2, 3]], dtype=torch.float).view(2, 3, 1) b = torch.tensor([[0, 2, 1], [-1, 2, 0]], dtype=torch.float).view(2, 3, 1) kernel = PolynomialKernel(power=3, batch_shape=torch.Size([2])).initialize(offset=torch.rand(2, 1)) kernel.eval() actual = torch.zeros(2, 3, 3) for k in range(2): for i in range(3): for j in range(3): actual[k, i, j] = (a[k, i].matmul(b[k, j]) + kernel.offset[k]).pow(kernel.power) res = kernel(a, b).evaluate() self.assertLess(torch.norm(res - actual), 1e-5) def create_kernel_with_prior(self, offset_prior): return self.create_kernel_no_ard(offset_prior=offset_prior) def test_prior_type(self): """ Raising TypeError if prior type is other than gpytorch.priors.Prior """ self.create_kernel_with_prior(None) self.create_kernel_with_prior(NormalPrior(0, 1)) self.assertRaises(TypeError, self.create_kernel_with_prior, 1) if __name__ == "__main__": unittest.main()
37.073171
107
0.582018
664
4,560
3.900602
0.13253
0.037838
0.03861
0.042471
0.774903
0.745946
0.745946
0.745946
0.745946
0.745946
0
0.038598
0.255702
4,560
122
108
37.377049
0.724514
0.03443
0
0.714286
0
0
0.001829
0
0
0
0
0
0.130952
1
0.083333
false
0
0.059524
0.02381
0.178571
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
7288f5e981c21f6ba3e186c09e797e17068a1de6
147
py
Python
tests/test_generate_data.py
zscore/lifetimes
ad5d08f67283433ab647e33ed71255d9255bf731
[ "MIT" ]
4
2018-04-16T15:46:58.000Z
2021-02-17T00:17:54.000Z
tests/test_generate_data.py
zscore/lifetimes
ad5d08f67283433ab647e33ed71255d9255bf731
[ "MIT" ]
1
2021-09-08T11:04:27.000Z
2021-09-08T11:04:27.000Z
tests/test_generate_data.py
zscore/lifetimes
ad5d08f67283433ab647e33ed71255d9255bf731
[ "MIT" ]
2
2019-12-17T03:23:47.000Z
2021-09-08T09:32:44.000Z
import pytest import pandas as pd import numpy as np import scipy.stats as stats from lifetimes.generate_data import beta_geometric_nbd_model
14.7
60
0.829932
24
147
4.916667
0.708333
0
0
0
0
0
0
0
0
0
0
0
0.156463
147
9
61
16.333333
0.951613
0
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
72cc7fd4343e4ee851e2ce5d97cfb997ed5da3ee
96
py
Python
venv/lib/python3.8/site-packages/numpy/typing/tests/data/pass/ufuncs.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/numpy/typing/tests/data/pass/ufuncs.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/numpy/typing/tests/data/pass/ufuncs.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/c4/6b/8a/baa3deb544d2e22a396031da922e676d846efb00b6f52194df6b735488
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.416667
0
96
1
96
96
0.479167
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
6
f449244af72b928131a12c0fce9ca1c2a84a4592
150
py
Python
credentials.py
Koncealed/python-eth-texter
0000947c86a3dc7778caea751290d54d3223f4ba
[ "MIT" ]
null
null
null
credentials.py
Koncealed/python-eth-texter
0000947c86a3dc7778caea751290d54d3223f4ba
[ "MIT" ]
null
null
null
credentials.py
Koncealed/python-eth-texter
0000947c86a3dc7778caea751290d54d3223f4ba
[ "MIT" ]
null
null
null
account_sid = "ACd10eb49b2bd0d718494da26646090e25" auth_token = "e620df6c67af5f7fd8742b71cabf8f49" my_cell = "+17186124059" my_twilio = "+12014313585"
37.5
50
0.833333
12
150
10.083333
0.916667
0
0
0
0
0
0
0
0
0
0
0.438849
0.073333
150
4
51
37.5
0.431655
0
0
0
0
0
0.596026
0.437086
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
1
0
0
1
0
0
1
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
f449a011e95dfb45eb5b6e25ff5aa0aeb2880719
29
py
Python
JanggiGame/SocketServer/channels/__init__.py
MohamedAl-Hussein/janggi-game
0664a408563b824c0b665d755ff9b232b6f24644
[ "MIT" ]
1
2018-07-07T11:56:44.000Z
2018-07-07T11:56:44.000Z
JanggiGame/SocketServer/channels/__init__.py
MohamedAl-Hussein/janggi-game
0664a408563b824c0b665d755ff9b232b6f24644
[ "MIT" ]
null
null
null
JanggiGame/SocketServer/channels/__init__.py
MohamedAl-Hussein/janggi-game
0664a408563b824c0b665d755ff9b232b6f24644
[ "MIT" ]
null
null
null
from .channel import Channel
14.5
28
0.827586
4
29
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.137931
29
1
29
29
0.96
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
be8275e57af6832180eaa42b9d4bfed85479a20f
5,024
py
Python
tests/Integration/GridSearch/test_base.py
nielsuit227/AutoML
51e2076d52d76dc84a190293b5bb59da2833df89
[ "MIT" ]
2
2021-06-16T22:09:01.000Z
2021-09-06T20:26:42.000Z
tests/Integration/GridSearch/test_base.py
nielsuit227/AutoML
51e2076d52d76dc84a190293b5bb59da2833df89
[ "MIT" ]
1
2021-06-04T08:22:02.000Z
2021-06-04T08:22:02.000Z
tests/Integration/GridSearch/test_base.py
nielsuit227/AutoML
51e2076d52d76dc84a190293b5bb59da2833df89
[ "MIT" ]
1
2021-09-15T08:34:20.000Z
2021-09-15T08:34:20.000Z
import unittest import pandas as pd from sklearn.model_selection import KFold from sklearn.model_selection import StratifiedKFold from sklearn.datasets import make_classification from sklearn.datasets import make_regression from Amplo.GridSearch import BaseGridSearch from Amplo.AutoML import Modeller class TestBaseGridSearch(unittest.TestCase): @classmethod def setUpClass(cls) -> None: x, y = make_classification() cls.cx = pd.DataFrame(x) cls.cy = pd.Series(y) x, y = make_regression() cls.rx = pd.DataFrame(x) cls.ry = pd.Series(y) def test_small_regression(self): models = Modeller(mode='regression', objective='r2', samples=100).return_models() for model in models: grid_search = BaseGridSearch(model, cv=KFold(n_splits=3), verbose=0, timeout=10, candidates=2, scoring='r2') results = grid_search.fit(self.rx, self.ry) # Tests assert isinstance(results, pd.DataFrame), 'Not a DF {}'.format(type(model).__name__) assert all([x in results.keys() for x in ['worst_case', 'mean_objective', 'std_objective', 'params', 'mean_time', 'std_time']]), 'Keys missing {}'.format(type(model) .__name__) assert len(results) > 0, 'Empty results {}'.format(type(model).__name__) def test_big_regression(self): models = Modeller(mode='regression', objective='r2', samples=50000).return_models() for model in models: grid_search = BaseGridSearch(model, cv=KFold(n_splits=3), verbose=0, timeout=10, candidates=2, scoring='r2') results = grid_search.fit(self.rx, self.ry) # Tests assert isinstance(results, pd.DataFrame), 'Not a DF {}'.format(type(model).__name__) assert all([x in results.keys() for x in ['worst_case', 'mean_objective', 'std_objective', 'params', 'mean_time', 'std_time']]), 'Keys missing {}'.format(type(model) .__name__) assert len(results) > 0, 'Empty results {}'.format(type(model).__name__) def test_small_classification(self): models = Modeller(mode='classification', objective='accuracy', samples=100).return_models() for model in models: grid_search = BaseGridSearch(model, cv=StratifiedKFold(n_splits=3), verbose=0, timeout=10, candidates=2, scoring='accuracy') results = grid_search.fit(self.cx, self.cy) # Tests assert isinstance(results, pd.DataFrame), 'Not a DF {}'.format(type(model).__name__) assert all([x in results.keys() for x in ['worst_case', 'mean_objective', 'std_objective', 'params', 'mean_time', 'std_time']]), 'Keys missing {}'.format(type(model) .__name__) assert len(results) > 0, 'Empty results {}'.format(type(model).__name__) def test_big_classification(self): models = Modeller(mode='classification', objective='accuracy', samples=50000).return_models() for model in models: grid_search = BaseGridSearch(model, cv=StratifiedKFold(n_splits=3), verbose=0, timeout=10, candidates=2, scoring='accuracy') results = grid_search.fit(self.cx, self.cy) # Tests assert isinstance(results, pd.DataFrame), 'Not a DF {}'.format(type(model).__name__) assert all([x in results.keys() for x in ['worst_case', 'mean_objective', 'std_objective', 'params', 'mean_time', 'std_time']]), 'Keys missing {}'.format(type(model) .__name__) assert len(results) > 0, 'Empty results {}'.format(type(model).__name__)
54.021505
118
0.468949
449
5,024
5.028953
0.191537
0.053144
0.079717
0.100974
0.855182
0.802037
0.802037
0.802037
0.802037
0.695748
0
0.015471
0.433917
5,024
92
119
54.608696
0.778481
0.004578
0
0.675325
0
0
0.099279
0
0
0
0
0
0.155844
1
0.064935
false
0
0.103896
0
0.181818
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
beb3bd3a7019f771c3be89a5156fa432a891c431
67
py
Python
adclassifier/lemmatization.py
BoudhayanBanerjee/political-ad-classifier
e7b7bd76eadd4bde536862449e71370903d22114
[ "MIT" ]
2
2017-06-20T19:18:20.000Z
2017-06-30T19:01:44.000Z
adclassifier/lemmatization.py
BoudhayanBanerjee/political-ad-classifier
e7b7bd76eadd4bde536862449e71370903d22114
[ "MIT" ]
null
null
null
adclassifier/lemmatization.py
BoudhayanBanerjee/political-ad-classifier
e7b7bd76eadd4bde536862449e71370903d22114
[ "MIT" ]
null
null
null
from nltk.stem import WordNetLemmatizer # TODO # implement wordnet
16.75
39
0.820896
8
67
6.875
1
0
0
0
0
0
0
0
0
0
0
0
0.134328
67
4
40
16.75
0.948276
0.328358
0
0
0
0
0
0
0
0
0
0.25
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
1
0
0
0
1
0
1
0
1
0
0
6
fe3bd70c938de1276714b06aaad95cefbc3251dd
229
py
Python
astroquery/sdss/__init__.py
jdnc/astroquery
a89dcc5f4132bc2e9d72da1aa583dbc9e7e8216f
[ "BSD-3-Clause" ]
1
2019-12-17T00:43:56.000Z
2019-12-17T00:43:56.000Z
astroquery/sdss/__init__.py
jdnc/astroquery
a89dcc5f4132bc2e9d72da1aa583dbc9e7e8216f
[ "BSD-3-Clause" ]
null
null
null
astroquery/sdss/__init__.py
jdnc/astroquery
a89dcc5f4132bc2e9d72da1aa583dbc9e7e8216f
[ "BSD-3-Clause" ]
null
null
null
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ SDSS Spectra/Image/SpectralTemplate Archive Query Tool ----------------------------------- :Author: Jordan Mirocha (mirochaj@gmail.com) """ from .core import *
25.444444
63
0.637555
27
229
5.407407
0.962963
0
0
0
0
0
0
0
0
0
0
0.004975
0.122271
229
8
64
28.625
0.721393
0.868996
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
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
fe6faa6561dc2b2931ad6239a91df14192c38a68
15,761
py
Python
app/test/test_listenbot.py
VikashKothary/market-information-service
0ea241acc5a02fd7ecc5e499f130da2c518275b7
[ "MIT" ]
null
null
null
app/test/test_listenbot.py
VikashKothary/market-information-service
0ea241acc5a02fd7ecc5e499f130da2c518275b7
[ "MIT" ]
null
null
null
app/test/test_listenbot.py
VikashKothary/market-information-service
0ea241acc5a02fd7ecc5e499f130da2c518275b7
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 """ test_listenbot.py - Tests for listenbot.py """ from flask_testing import TestCase from app import _create_app, _create_db, app from listenbot import listenbot from chatbot import chatbot from models import User, Product class TestListenbot(TestCase): def create_app(self): #app = _create_app(environment='testing') app.register_blueprint(listenbot) app.register_blueprint(chatbot) return app def setUp(self): self.app = self.create_app() with self.app.app_context(): self.db = _create_db(self.app) self.client = self.app.test_client() self.client.testing = True with self.client.session_transaction() as sess: sess['user_id'] = 'testing' def tearDown(self): with self.app.app_context(): self.db.session.remove() testing_user = self.db.session.query(User).filter(User.user_id == 'testing') if testing_user: testing_user.delete() self.db.session.commit() self.db.drop_all() def test_new_user(self): # Yes to on board speech = dict(SpeechResult='yes') response = self.client.post('/new_user', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/on_board</Redirect></Response>' self.assertTrue(expected in response.data) # No to on board speech = dict(SpeechResult='no') response = self.client.post('/new_user', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/learn</Redirect></Response>' self.assertTrue(expected in response.data) # Other response = self.client.post('/new_user') self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/new_user" hints="boolean" input="speech" /><Redirect method="GET">/new_user</Redirect></Response>' self.assertTrue(expected in response.data) response = self.client.get('/new_user') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) def test_save_data(self): new_user = User.query.get('testing') self.assertEqual(new_user, None) # No to save data speech = dict(SpeechResult='no') response = self.client.post('/save_data', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/assumption</Redirect></Response>' self.assertTrue(expected in response.data) # Doesn't create user new_user = User.query.get('testing') self.assertEqual(new_user, None) # Yes to save data speech = dict(SpeechResult='yes') response = self.client.post('/save_data', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/learn/name</Redirect></Response>' self.assertTrue(expected in response.data) # Creates user in database new_user = User.query.get('testing') self.assertEqual(new_user.user_id, 'testing') # Other response = self.client.post('/save_data') self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/save_data" hints="boolean" input="speech" /><Redirect method="GET">/save_data</Redirect></Response>' self.assertTrue(expected in response.data) response = self.client.get('/save_data') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) # User.query.filter_by(user_id='testing').delete() # self.db.save() def test_name(self): new_user = User(id='testing') self.db.save(new_user) self.assertEqual(new_user.name, '') # Yes to save data speech = dict(SpeechResult='vikash') response = self.client.post('/name', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">Is your name vikash?</Say><Gather action="/confirm/name" hints="boolean" input="speech" /><Redirect method="GET">/confirm/name</Redirect></Response>' self.assertTrue(expected in response.data) # Saves user name new_user = User.query.get('testing') self.assertEqual(new_user.name, 'vikash') # Other response = self.client.post('/name') self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/name" input="speech" /><Redirect method="GET">/name</Redirect></Response>' self.assertTrue(expected in response.data) response = self.client.get('/name') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) def test_location(self): new_user = User(id='testing', name='vikash') self.db.save(new_user) self.assertEqual(new_user.location, '') # Yes to save data speech = dict(SpeechResult='kenya') response = self.client.post('/location', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">Are you from kenya?</Say><Gather action="/confirm/location" hints="boolean" input="speech" /><Redirect method="GET">/confirm/location</Redirect></Response>' self.assertTrue(expected in response.data) # Saves user location new_user = User.query.get('testing') self.assertEqual(new_user.location, 'kenya') response = self.client.get('/location') expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/location" input="speech" /><Redirect method="GET">/location</Redirect></Response>' self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) response = self.client.post('/location') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) def test_currency(self): new_user = User('testing', 'vikash', 'kenya') self.db.save(new_user) self.assertEqual(new_user.currency, '') # Yes to save data speech = dict(SpeechResult='shilling') response = self.client.post('/currency', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">Is your currency shilling?</Say><Gather action="/confirm/currency" hints="boolean" input="speech" /><Redirect method="GET">/confirm/currency</Redirect></Response>' self.assertTrue(expected in response.data) # Saves user location new_user = User.query.get('testing') self.assertEqual(new_user.currency, 'shilling') response = self.client.get('/currency') expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/currency" input="speech" /><Redirect method="GET">/currency</Redirect></Response>' self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) response = self.client.post('/currency') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) def test_confirm_name(self): new_user = User(id='testing', name='vikash') self.db.save(new_user) # Correct name speech = dict(SpeechResult='yes') response = self.client.post('/confirm/name', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/learn/location</Redirect></Response>' self.assertTrue(expected in response.data) # Name is stored keeps_name = User.query.get(new_user.user_id) self.assertEqual(keeps_name.name, new_user.name) # Incorrect name speech = dict(SpeechResult='no') response = self.client.post('/confirm/name', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/learn/name</Redirect></Response>' self.assertTrue(expected in response.data) # Name is deleted deletes_name = User.query.get(new_user.user_id) self.assertEqual(deletes_name.name, '') # Other response = self.client.post('/confirm/name') self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/confirm/name" input="speech" /><Redirect method="GET">/confirm/name</Redirect></Response>' self.assertTrue(expected in response.data) response = self.client.get('/confirm/name') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) def test_confirm_location(self): new_user = User(id='testing', name='vikash', location='kenya') self.db.save(new_user) # Correct name speech = dict(SpeechResult='yes') response = self.client.post('/confirm/location', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/learn/currency</Redirect></Response>' self.assertTrue(expected in response.data) # Name is stored keeps_name = User.query.get(new_user.user_id) self.assertEqual(keeps_name.location, new_user.location) # Incorrect name speech = dict(SpeechResult='no') response = self.client.post('/confirm/location', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/learn/location</Redirect></Response>' self.assertTrue(expected in response.data) # Name is deleted deletes_name = User.query.get(new_user.user_id) self.assertEqual(deletes_name.location, '') # Other response = self.client.post('/confirm/location') expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/confirm/location" input="speech" /><Redirect method="GET">/confirm/location</Redirect></Response>' self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) response = self.client.get('/confirm/location') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) def test_confirm_currency(self): new_user = User(id='testing', name='vikash', location='kenya', currency='shilling') self.db.save(new_user) # Correct name speech = dict(SpeechResult='yes') response = self.client.post('/confirm/currency', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/assumption</Redirect></Response>' self.assertTrue(expected in response.data) # Name is stored keeps_name = User.query.get(new_user.user_id) self.assertEqual(keeps_name.currency, new_user.currency) # Incorrect name speech = dict(SpeechResult='no') response = self.client.post('/confirm/currency', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/learn/currency</Redirect></Response>' self.assertTrue(expected in response.data) # Name is deleted deletes_name = User.query.get(new_user.user_id) self.assertEqual(deletes_name.currency, '') response = self.client.post('/confirm/currency') self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/confirm/currency" input="speech" /><Redirect method="GET">/confirm/currency</Redirect></Response>' self.assertTrue(expected in response.data) response = self.client.get('/confirm/currency') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) def test_query(self): known_user = User(id='testing', name='vikash', location='kenya', currency='shillings') result_product = Product(name='Mango', quantity=1, unit=Product.KG, price=200.00, location='Kenya', currency='GBP') self.db.save(known_user) self.db.save(result_product) # Product Id and Yes # speech = dict(SpeechResult='yes') # response = self.client.post('/query/{}'.format(result_product.product_id), data=speech) # self.assertEqual(response.status_code, 200) # expected = b'<Response><Redirect method="GET">/result/100</Redirect></Response>' # self.assertTrue(expected in response.data) # Product Id and No # speech = dict(SpeechResult='no') # response = self.client.post('/query/{}'.format(result_product.product_id), data=speech) # self.assertEqual(response.status_code, 200) # expected = b'<Response><Redirect method="GET">/assumption</Redirect></Response>' # self.assertTrue(expected in response.data) speech = dict(SpeechResult='How much does it cost for 1 kg of mango') response = self.client.post('/query', data=speech) self.assertEqual(response.status_code, 200) expected = b'' print(response.data) self.assertTrue(expected in response.data) response = self.client.post('/query') self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/query" input="speech" /><Redirect method="GET">/query</Redirect></Response>' self.assertTrue(expected in response.data) response = self.client.get('/query') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) def test_done(self): # Wants another query speech = dict(SpeechResult='yes') response = self.client.post('/done', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/assumption</Redirect></Response>' self.assertTrue(expected in response.data) # Wants to end the call speech = dict(SpeechResult='no') response = self.client.post('/done', data=speech) self.assertEqual(response.status_code, 200) expected = b'<Response><Redirect method="GET">/end_call</Redirect></Response>' self.assertTrue(expected in response.data) response = self.client.post('/done') self.assertEqual(response.status_code, 200) expected = b'<Response><Say language="en" voice="alice">I don\'t understand. Can you say that again?</Say><Gather action="/done" input="speech" /><Redirect method="GET">/done</Redirect></Response>' self.assertTrue(expected in response.data) response = self.client.get('/done') self.assertEqual(response.status_code, 200) self.assertTrue(expected in response.data) if __name__ == '__main__': import unittest unittest.main()
46.492625
231
0.656811
1,909
15,761
5.336826
0.075432
0.076561
0.067138
0.108166
0.863369
0.828426
0.80055
0.770907
0.727719
0.710836
0
0.009991
0.206205
15,761
338
232
46.630178
0.804332
0.079246
0
0.551282
0
0.029915
0.192143
0.055817
0
0
0
0
0.371795
1
0.055556
false
0
0.025641
0
0.089744
0.012821
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
fe79f9eeb566e8de50a96071c797b542f66d2cbf
185
py
Python
app/main.py
grostaco/CoreHDF
f3acf7792e99994a7c1f0a3be797ae873b04a0b6
[ "MIT" ]
1
2021-03-25T06:00:15.000Z
2021-03-25T06:00:15.000Z
app/main.py
grostaco/CoreHDF
f3acf7792e99994a7c1f0a3be797ae873b04a0b6
[ "MIT" ]
3
2021-03-22T07:58:25.000Z
2021-03-23T11:06:55.000Z
app/main.py
grostaco/CoreHDF
f3acf7792e99994a7c1f0a3be797ae873b04a0b6
[ "MIT" ]
2
2021-03-22T07:54:06.000Z
2021-03-23T09:09:57.000Z
from fastapi import FastAPI from .routers import users, token, query app = FastAPI() app.include_router(users.router) app.include_router(token.router) app.include_router(query.router)
23.125
40
0.810811
27
185
5.444444
0.37037
0.204082
0.326531
0.29932
0
0
0
0
0
0
0
0
0.091892
185
8
41
23.125
0.875
0
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
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
6
fe9f5cd268240662d0d7a6753e58a7fbedecad4e
121
py
Python
webdriver/tests/conftest.py
meyerweb/wpt
f04261533819893c71289614c03434c06856c13e
[ "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
webdriver/tests/conftest.py
meyerweb/wpt
f04261533819893c71289614c03434c06856c13e
[ "BSD-3-Clause" ]
7,642
2018-05-28T09:38:03.000Z
2022-03-31T20:55:48.000Z
webdriver/tests/conftest.py
meyerweb/wpt
f04261533819893c71289614c03434c06856c13e
[ "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
pytest_plugins = ( "tests.support.fixtures", "tests.support.fixtures_bidi", "tests.support.fixtures_http", )
20.166667
34
0.694215
13
121
6.230769
0.538462
0.444444
0.740741
0
0
0
0
0
0
0
0
0
0.157025
121
5
35
24.2
0.794118
0
0
0
0
0
0.628099
0.628099
0
0
0
0
0
1
0
false
0
0
0
0
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
22eb3cbd4a1b380a8e2b5e30bfe1896222eba35d
36
py
Python
je_editor/ui/ui_event/__init__.py
JE-Chen/je_editor
2f18dedb6f0eb27c38668dc53f520739c8d5c6c6
[ "MIT" ]
1
2021-12-10T14:57:15.000Z
2021-12-10T14:57:15.000Z
je_editor/ui/ui_event/__init__.py
JE-Chen/je_editor
2f18dedb6f0eb27c38668dc53f520739c8d5c6c6
[ "MIT" ]
null
null
null
je_editor/ui/ui_event/__init__.py
JE-Chen/je_editor
2f18dedb6f0eb27c38668dc53f520739c8d5c6c6
[ "MIT" ]
null
null
null
from je_editor.ui.ui_event import *
18
35
0.805556
7
36
3.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.111111
36
1
36
36
0.84375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
fe01189b5fae2dac74abeb17110d04071deb3c53
93
py
Python
src/libs/__init__.py
Aofusa/minecraft-discord-bot
e2d93273c5d1acefbe2e47a4b31d557bdad0bc2d
[ "Apache-2.0" ]
null
null
null
src/libs/__init__.py
Aofusa/minecraft-discord-bot
e2d93273c5d1acefbe2e47a4b31d557bdad0bc2d
[ "Apache-2.0" ]
1
2020-05-23T03:10:10.000Z
2020-05-23T03:10:10.000Z
src/libs/__init__.py
Aofusa/minecraft-discord-bot
e2d93273c5d1acefbe2e47a4b31d557bdad0bc2d
[ "Apache-2.0" ]
null
null
null
from .utils import * from .components import * from .standup import * from .shutdown import *
23.25
25
0.752688
12
93
5.833333
0.5
0.428571
0
0
0
0
0
0
0
0
0
0
0.16129
93
4
26
23.25
0.897436
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
a3c38d433aa3cb636772101e157fadc2990e2b28
2,154
py
Python
data_roadmap/bash_prepare_sample_all.py
Hongyang449/Ocelot
73932383e6d3863fd9fa4aada12488550ce98b45
[ "MIT" ]
5
2021-10-05T22:05:01.000Z
2022-01-14T02:11:07.000Z
data_roadmap/bash_prepare_sample_all.py
Hongyang449/Ocelot
73932383e6d3863fd9fa4aada12488550ce98b45
[ "MIT" ]
null
null
null
data_roadmap/bash_prepare_sample_all.py
Hongyang449/Ocelot
73932383e6d3863fd9fa4aada12488550ce98b45
[ "MIT" ]
null
null
null
import os import time tier0=['H3K4me1','H3K4me3','H3K36me3','H3K27me3','H3K9me3'] tier1=['H3K27ac','H3K9ac','DNase'] tier2=['H3K4me2','H2A.Z','H3K79me2','H4K20me1'] tier3=['H2AK5ac','H2BK120ac','H2BK5ac','H3K18ac','H3K23ac',\ 'H3K4ac','H3K79me1','H4K8ac','H2BK12ac','H3K14ac',\ 'H4K91ac','H2BK15ac','H3K9me1','H2BK20ac','H3K56ac',\ 'H4K5ac','H3K23me2','H2AK9ac','H3T11ph','H4K12ac'] tier4=['methyl','RNA-seq'] # for training the_seed=0 path0='./bigwig_all/' for the_assay in tier0+tier1+tier2+tier3+tier4[:1]: for i in range(1,130): the_cell='E%03d' % i the_id = the_cell + '_' + the_assay the_file=path0 + the_id + '.bigwig' if os.path.isfile(the_file): print('prepare sample: ' + the_file) os.system('time python prepare_sample_all.py -i ' + the_id + ' -s ' + str(the_seed) + ' &') time.sleep(60) else: print('empty entry: ' + the_file) # one-hot DNA sequence os.system('time python prepare_sample_dna.py -i A -s ' + str(the_seed) + ' &') os.system('time python prepare_sample_dna.py -i C -s ' + str(the_seed) + ' &') os.system('time python prepare_sample_dna.py -i G -s ' + str(the_seed) + ' &') os.system('time python prepare_sample_dna.py -i T -s ' + str(the_seed) + ' &') # for validation the_seed=1 path0='./bigwig_all/' for the_assay in tier0+tier1+tier2+tier3+tier4[:1]: for i in range(1,130): the_cell='E%03d' % i the_id = the_cell + '_' + the_assay the_file=path0 + the_id + '.bigwig' if os.path.isfile(the_file): print('prepare sample: ' + the_file) os.system('time python prepare_sample_all.py -i ' + the_id + ' -s ' + str(the_seed) + ' &') time.sleep(60) else: print('empty entry: ' + the_file) # one-hot DNA sequence os.system('time python prepare_sample_dna.py -i A -s ' + str(the_seed) + ' &') os.system('time python prepare_sample_dna.py -i C -s ' + str(the_seed) + ' &') os.system('time python prepare_sample_dna.py -i G -s ' + str(the_seed) + ' &') os.system('time python prepare_sample_dna.py -i T -s ' + str(the_seed) + ' &')
36.508475
103
0.614206
317
2,154
3.990536
0.277603
0.066403
0.094862
0.142292
0.746245
0.746245
0.746245
0.746245
0.746245
0.746245
0
0.075758
0.203343
2,154
58
104
37.137931
0.661422
0.032033
0
0.727273
0
0
0.379211
0.101059
0
0
0
0
0
1
0
false
0
0.045455
0
0.045455
0.090909
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
a3cfd1a4138c73a09bf5536525017feefc05ab40
37
py
Python
client-portal/apis/therapist/__init__.py
oakbani/ksdp-portal
8f44b3cb0081a7f31b9c8121883dd51945a05520
[ "MIT" ]
null
null
null
client-portal/apis/therapist/__init__.py
oakbani/ksdp-portal
8f44b3cb0081a7f31b9c8121883dd51945a05520
[ "MIT" ]
null
null
null
client-portal/apis/therapist/__init__.py
oakbani/ksdp-portal
8f44b3cb0081a7f31b9c8121883dd51945a05520
[ "MIT" ]
1
2021-09-19T10:58:17.000Z
2021-09-19T10:58:17.000Z
from .therapist import therapist_api
18.5
36
0.864865
5
37
6.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.108108
37
1
37
37
0.939394
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
a3f489080d6fe7f8758bdcc80a48591afdaaae19
38
py
Python
w2020/w12/w12_14/test_study_id_obtain.py
abrance/mine
d4067bf6fb158ebaea3eb7a516ae372dcb8cf419
[ "MIT" ]
null
null
null
w2020/w12/w12_14/test_study_id_obtain.py
abrance/mine
d4067bf6fb158ebaea3eb7a516ae372dcb8cf419
[ "MIT" ]
null
null
null
w2020/w12/w12_14/test_study_id_obtain.py
abrance/mine
d4067bf6fb158ebaea3eb7a516ae372dcb8cf419
[ "MIT" ]
null
null
null
def test_study_id_obtain(): pass
9.5
27
0.710526
6
38
4
1
0
0
0
0
0
0
0
0
0
0
0
0.210526
38
3
28
12.666667
0.8
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
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
1
1
1
0
0
0
0
0
6
4325113b825a9cefed4ac49604e1edf44683e2b8
27
py
Python
wrapspawner/__init__.py
KrisztianPora/wrapspawner
66518cb62f831035763bf02d394d5120a6682ac0
[ "BSD-3-Clause" ]
50
2016-09-23T15:57:56.000Z
2022-03-04T22:27:12.000Z
wrapspawner/__init__.py
KrisztianPora/wrapspawner
66518cb62f831035763bf02d394d5120a6682ac0
[ "BSD-3-Clause" ]
46
2016-09-21T21:52:28.000Z
2022-03-04T23:36:26.000Z
wrapspawner/__init__.py
KrisztianPora/wrapspawner
66518cb62f831035763bf02d394d5120a6682ac0
[ "BSD-3-Clause" ]
54
2016-10-25T18:53:56.000Z
2022-03-11T22:48:41.000Z
from .wrapspawner import *
13.5
26
0.777778
3
27
7
1
0
0
0
0
0
0
0
0
0
0
0
0.148148
27
1
27
27
0.913043
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
4330fa36b0846f55827247c5da6df5fb763e05f3
123
py
Python
{{cookiecutter.company_name}}-cli/test/conftest.py
farooq-teqniqly/cli-cookiecutter
e9a8262d5f11d6bfc313e906fad4e683950e52c3
[ "MIT" ]
5
2021-12-14T08:32:39.000Z
2022-03-17T11:02:25.000Z
tests/conftest.py
iamgodot/py-tldr
9bd4be89d1806770c2a8060d76bbad6b51da6b9d
[ "MIT" ]
null
null
null
tests/conftest.py
iamgodot/py-tldr
9bd4be89d1806770c2a8060d76bbad6b51da6b9d
[ "MIT" ]
null
null
null
import pytest from click.testing import CliRunner @pytest.fixture(scope="function") def runner(): return CliRunner()
15.375
35
0.756098
15
123
6.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.138211
123
7
36
17.571429
0.877358
0
0
0
0
0
0.065041
0
0
0
0
0
0
1
0.2
true
0
0.4
0.2
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
1
1
0
0
6
4a3bfd9e44fe6141dfe2bc77bb10cb0010779e1c
8,421
py
Python
scattering.py
yano404/A5tools
a318b6d529b8de0f780d0682b7e0051989f9587a
[ "MIT" ]
null
null
null
scattering.py
yano404/A5tools
a318b6d529b8de0f780d0682b7e0051989f9587a
[ "MIT" ]
null
null
null
scattering.py
yano404/A5tools
a318b6d529b8de0f780d0682b7e0051989f9587a
[ "MIT" ]
null
null
null
""" functions to find theoretical value of differential cross-section """ import numpy as np import uncertainties from uncertainties import umath import uncertainties.unumpy as unp from .constants import * from . import cm2lab from . import lab2cm def rutherford(theta, T, Zi, Zt, which="inc"): """ Rutherford Scattering in the center-of-mass system Arguments --------- theta : scattering angle in the center-of-mass system T : kinetic energy of incident particle in the center-of-mass system Zi : atomic number of incident particle; charge in units of e Zt : atomic number of target particle; charge in units of e which : if which="inc", calc dσ/dΩ(θ) of incident particle. if which="tar", calc dσ/dΩ(θ) of target particle. if which="sum", calc dσ/dΩ(θ) of incident particle + dσ/dΩ(θ) of target particle. Return ------ dσ/dΩ(θ) in the center-of-mass system [mb/str] """ # dσ/dΩ[mb/str] # 10.0 : fm^2 --> mb if which == "inc": # incident particle if isinstance(theta, uncertainties.core.AffineScalarFunc): return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 * umath.pow(umath.sin(theta / 2.0), -4.0) elif isinstance(theta, np.ndarray) and isinstance(theta[0], uncertainties.core.AffineScalarFunc): return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 * unp.pow(unp.sin(theta / 2.0), -4.0) else: return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 * np.power(np.sin(theta / 2.0), -4.0) elif which == "tar": # target particle if isinstance(theta, uncertainties.core.AffineScalarFunc): return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 * umath.pow(umath.cos(theta / 2.0), -4.0) elif isinstance(theta, np.ndarray) and isinstance(theta[0], uncertainties.core.AffineScalarFunc): return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 * unp.pow(unp.cos(theta / 2.0), -4.0) else: return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 * np.power(np.cos(theta / 2.0), -4.0) elif which == "sum": # incident particle + target particle if isinstance(theta, uncertainties.core.AffineScalarFunc): return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 \ * (umath.pow(umath.sin(theta / 2.0), -4.0) + umath.pow(umath.cos(theta / 2.0), -4.0)) elif isinstance(theta, np.ndarray) and isinstance(theta[0], uncertainties.core.AffineScalarFunc): return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 \ * (unp.pow(unp.sin(theta / 2.0), -4.0) + unp.power(unp.cos(theta / 2.0), -4.0)) else: return 10.0 * (Zi * Zt * E2 / (4.0 * T))**2.0 \ * (np.power(np.sin(theta / 2.0), -4.0) + np.power(np.cos(theta / 2.0), -4.0)) else: raise ValueError( f"Unrecognized which option:{which}. which must be inc/tar/sum.") def rutherford_lab(theta, T, Zi, Ai, Zt, At, which="inc"): """ Rutherford Scattering in the lab system Arguments --------- theta : scattering angle in the lab system T : kinetic energy of incident particle in the lab system Zi : atomic number of incident particle; charge in units of e Ai : mass number of incident particle Zt : atomic number of target particle; charge in units of e At : mass number of target particle which : if which="inc", calc dσ/dΩ(θ) of incident particle. if which="tar", calc dσ/dΩ(θ) of target particle. if which="sum", calc dσ/dΩ(θ) of incident particle + dσ/dΩ(θ) of target particle. Return ------ dσ/dΩ(θ) in the center-of-mass system [mb/str] """ # kinetic energy in the center-of-mass system Tcm = lab2cm.kinetic_energy(T, Ai, At) if which == "inc": # incident particle n = At / Ai # theta_lab to theta_cm theta_cm = lab2cm.theta(theta, n) # dΩcm/dΩlab dOcm_dOlab = cm2lab.dOmega(theta_cm, n) # dσ/dΩ(θ) in the lab system [mb/str] # dΩcm/dΩlab * dσ/dΩcm return dOcm_dOlab * rutherford(theta_cm, Tcm, Zi, Zt, which="inc") elif which == "tar": # target particle n = 1.0 # theta_lab to theta_cm theta_cm = lab2cm.theta(theta, n) # dΩcm/dΩlab dOcm_dOlab = cm2lab.dOmega(theta_cm, n) # dσ/dΩ(θ) in the lab system [mb/str] # dΩcm/dΩlab * dσ/dΩcm return dOcm_dOlab * rutherford(theta_cm, Tcm, Zi, Zt, which="tar") elif which == "sum": # incident particle + target particle ni = At / Ai nt = 1.0 # theta_lab to theta_cm theta_cmi = lab2cm.theta(theta, ni) theta_cmt = lab2cm.theta(theta, nt) # dΩcm/dΩlab dOcm_dOlabi = cm2lab.dOmega(theta_cmi, ni) dOcm_dOlabt = cm2lab.dOmega(theta_cmt, nt) # dσ/dΩ(θ) in the lab system [mb/str] # dΩcm/dΩlab * dσ/dΩcm dsi = dOcm_dOlabi * rutherford(theta_cmi, Tcm, Zi, Zt, which="inc") dst = dOcm_dOlabt * rutherford(theta_cmt, Tcm, Zi, Zt, which="tar") return dsi + dst else: raise ValueError( f"Unrecognized which option:{which}. which must be inc/tar/sum.") def mott(theta, T, Z, A, S): """ Mott Scattering in the center-of-mass system Arguments --------- theta : scattering angle in the center-of-mass system T : kinetic energy of incident particle in the center-of-mass system Z : atomic number; charge in units of e A : mass number S : spin Return ------ dσ/dΩ(θ) in the center-of-mass system [mb/str] """ # rest energy mc2 = A * AMU # total energy of incident/target particle in the center-of-mass system Ecm = (T + 2.0 * mc2) / 2.0 # gamma (= gamma_cm in this situattion) gamma = Ecm / mc2 # beta (= beta_cm in this situattion) beta = np.sqrt(1.0 - 1.0 / gamma**2.0) # relative beta in the center-of-mass system brel = 2.0 * beta / (1.0 + beta**2.0) # dσ/dΩ[mb/str] # 10.0 : fm^2 --> mb if isinstance(theta, uncertainties.core.AffineScalarFunc): return 10.0 * (Z**2 * E2 / (4.0 * T))**2.0 * ( umath.pow(umath.sin(theta / 2.0), -4.0) + umath.pow(umath.cos(theta / 2.0), -4.0) + (-1.0)**(2.0 * S) * 2.0 / (2.0 * S + 1.0) * umath.pow(umath.sin(theta / 2.0), -2.0) * umath.pow(umath.cos(theta / 2.0), -2.0) * umath.cos(Z**2.0 * E2 / (HBARC * brel) * umath.log(umath.pow(umath.tan(theta / 2.0), 2.0)) ) ) elif isinstance(theta, np.ndarray) and isinstance(theta[0], uncertainties.core.AffineScalarFunc): return 10.0 * (Z**2 * E2 / (4.0 * T))**2.0 * ( unp.pow(unp.sin(theta / 2.0), -4.0) + unp.pow(unp.cos(theta / 2.0), -4.0) + (-1.0)**(2.0 * S) * 2.0 / (2.0 * S + 1.0) * unp.pow(unp.sin(theta / 2.0), -2.0) * unp.pow(unp.cos(theta / 2.0), -2.0) * unp.cos(Z**2.0 * E2 / (HBARC * brel) * unp.log(unp.pow(unp.tan(theta / 2.0), 2.0)) ) ) else: return 10.0 * (Z**2 * E2 / (4.0 * T))**2.0 * ( np.power(np.sin(theta / 2.0), -4.0) + np.power(np.cos(theta / 2.0), -4.0) + (-1.0)**(2.0 * S) * 2.0 / (2.0 * S + 1.0) * np.power(np.sin(theta / 2.0), -2.0) * np.power(np.cos(theta / 2.0), -2.0) * np.cos(Z**2.0 * E2 / (HBARC * brel) * np.log(np.power(np.tan(theta / 2.0), 2.0)) ) ) def mott_lab(theta, T, Z, A, S): """ Mott Scattering in the lab system Arguments --------- theta : scattering angle in the lab system T : kinetic energy of incident particle in the lab system Z : atomic number; charge in units of e A : mass number S : spin Return ------ dσ/dΩ(θ) in the lab system [mb/str] """ # At/Ai = A/A = 1.0 n = 1.0 # theta_lab to theta_cm theta_cm = lab2cm.theta(theta, n) # kinetic energy in the center-of-mass system Tcm = lab2cm.kinetic_energy(T, A, A) # dΩcm/dΩlab dOcm_dOlab = cm2lab.dOmega(theta_cm, n) # dσ/dΩ(θ) in the lab system [mb/str] # dΩcm/dΩlab * dσ/dΩcm return dOcm_dOlab * mott(theta_cm, Tcm, Z, A, S)
38.452055
105
0.548866
1,293
8,421
3.54447
0.093581
0.028366
0.041239
0.03142
0.828497
0.804277
0.780275
0.745145
0.726598
0.699978
0
0.05073
0.300083
8,421
218
106
38.62844
0.726841
0.332265
0
0.390476
0
0
0.029599
0
0
0
0
0
0
1
0.038095
false
0
0.066667
0
0.257143
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
4a6147a45c42e12a26ac99ca5a846f149d0662fb
2,111
py
Python
epytope/Data/pssms/tepitopepan/mat/DRB1_0716_9.py
christopher-mohr/epytope
8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd
[ "BSD-3-Clause" ]
7
2021-02-01T18:11:28.000Z
2022-01-31T19:14:07.000Z
epytope/Data/pssms/tepitopepan/mat/DRB1_0716_9.py
christopher-mohr/epytope
8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd
[ "BSD-3-Clause" ]
22
2021-01-02T15:25:23.000Z
2022-03-14T11:32:53.000Z
epytope/Data/pssms/tepitopepan/mat/DRB1_0716_9.py
christopher-mohr/epytope
8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd
[ "BSD-3-Clause" ]
4
2021-05-28T08:50:38.000Z
2022-03-14T11:45:32.000Z
DRB1_0716_9 = {0: {'A': -999.0, 'E': -999.0, 'D': -999.0, 'G': -999.0, 'F': -0.004754, 'I': -0.99525, 'H': -999.0, 'K': -999.0, 'M': -0.99525, 'L': -0.99525, 'N': -999.0, 'Q': -999.0, 'P': -999.0, 'S': -999.0, 'R': -999.0, 'T': -999.0, 'W': -0.004754, 'V': -0.99525, 'Y': -0.004754}, 1: {'A': 0.0, 'E': 0.1, 'D': -1.3, 'G': 0.5, 'F': 0.8, 'I': 1.1, 'H': 0.8, 'K': 1.1, 'M': 1.1, 'L': 1.0, 'N': 0.8, 'Q': 1.2, 'P': -0.5, 'S': -0.3, 'R': 2.2, 'T': 0.0, 'W': -0.1, 'V': 2.1, 'Y': 0.9}, 2: {'A': 0.0, 'E': -1.2, 'D': -1.3, 'G': 0.2, 'F': 0.8, 'I': 1.5, 'H': 0.2, 'K': 0.0, 'M': 1.4, 'L': 1.0, 'N': 0.5, 'Q': 0.0, 'P': 0.3, 'S': 0.2, 'R': 0.7, 'T': 0.0, 'W': 0.0, 'V': 0.5, 'Y': 0.8}, 3: {'A': 0.0, 'E': -1.4, 'D': -1.6001, 'G': -1.1002, 'F': 0.19972, 'I': 1.1001, 'H': 0.09944, 'K': -1.3001, 'M': -0.3992, 'L': -0.79944, 'N': -1.1002, 'Q': -1.4997, 'P': -1.2001, 'S': 1.4992, 'R': -1.1002, 'T': 1.3995, 'W': -1.1001, 'V': 0.90005, 'Y': -0.89987}, 4: {'A': 0.0, 'E': 0.0, 'D': 0.0, 'G': 0.0, 'F': 0.0, 'I': 0.0, 'H': 0.0, 'K': 0.0, 'M': 0.0, 'L': 0.0, 'N': 0.0, 'Q': 0.0, 'P': 0.0, 'S': 0.0, 'R': 0.0, 'T': 0.0, 'W': 0.0, 'V': 0.0, 'Y': 0.0}, 5: {'A': 0.0, 'E': -2.4996, 'D': -2.4998, 'G': -0.59982, 'F': -0.80139, 'I': -0.50109, 'H': -0.80115, 'K': -1.1006, 'M': -0.80103, 'L': -0.90071, 'N': -0.60033, 'Q': -1.1005, 'P': -0.49933, 'S': 0.5987, 'R': -1.1004, 'T': -0.080654, 'W': -0.90147, 'V': 0.09895, 'Y': -1.0009}, 6: {'A': 0.0, 'E': 0.86672, 'D': -1.3112, 'G': -0.011139, 'F': 2.069, 'I': 2.3665, 'H': 0.88412, 'K': 0.48763, 'M': 1.7789, 'L': 2.1749, 'N': 1.3742, 'Q': 1.0784, 'P': -0.20788, 'S': 0.38292, 'R': 0.69107, 'T': 0.87113, 'W': 1.3762, 'V': 1.5723, 'Y': 1.6726}, 7: {'A': 0.0, 'E': 0.0, 'D': 0.0, 'G': 0.0, 'F': 0.0, 'I': 0.0, 'H': 0.0, 'K': 0.0, 'M': 0.0, 'L': 0.0, 'N': 0.0, 'Q': 0.0, 'P': 0.0, 'S': 0.0, 'R': 0.0, 'T': 0.0, 'W': 0.0, 'V': 0.0, 'Y': 0.0}, 8: {'A': 0.0, 'E': -0.30004, 'D': -1.2, 'G': -0.6, 'F': 2.0999, 'I': 3.3999, 'H': -0.20002, 'K': -1.1, 'M': 2.0, 'L': 3.3999, 'N': -0.50002, 'Q': -0.90002, 'P': -0.60001, 'S': -0.3, 'R': -0.8, 'T': 0.39999, 'W': 0.79995, 'V': 2.0, 'Y': 1.1}}
2,111
2,111
0.383231
525
2,111
1.537143
0.177143
0.121437
0.02974
0.039653
0.231722
0.151177
0.151177
0.151177
0.141264
0.141264
0
0.359864
0.166746
2,111
1
2,111
2,111
0.09892
0
0
0
0
0
0.080966
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
4a78d2e36a7f7aff5f16e9c3e96b007791241774
168
py
Python
Code Examples/Feb12Conditionals.py
bensk/cs11
58658bc308be61167324a7f051b03497440f7e7f
[ "MIT" ]
null
null
null
Code Examples/Feb12Conditionals.py
bensk/cs11
58658bc308be61167324a7f051b03497440f7e7f
[ "MIT" ]
null
null
null
Code Examples/Feb12Conditionals.py
bensk/cs11
58658bc308be61167324a7f051b03497440f7e7f
[ "MIT" ]
null
null
null
# Which string prints? if 5<2: print "I am right" else: print "I am wrong" # Which string prints? if 5>2: print "I am wrong" else: print "I am right"
12.923077
22
0.607143
30
168
3.4
0.4
0.235294
0.313725
0.372549
0.568627
0.568627
0.568627
0.568627
0.568627
0
0
0.033333
0.285714
168
12
23
14
0.816667
0.244048
0
0.75
0
0
0.325203
0
0
0
0
0
0
0
null
null
0
0
null
null
0.5
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
6
4a9461f20ffda6e12bd15f2ef9cc64000f8a68f1
134
py
Python
h/api/__init__.py
gergely-ujvari/h
e77fc33dbabdb7e399ff78b584eb2050c71eddab
[ "MIT" ]
null
null
null
h/api/__init__.py
gergely-ujvari/h
e77fc33dbabdb7e399ff78b584eb2050c71eddab
[ "MIT" ]
null
null
null
h/api/__init__.py
gergely-ujvari/h
e77fc33dbabdb7e399ff78b584eb2050c71eddab
[ "MIT" ]
null
null
null
def includeme(config): """Include the annotator-store API.""" config.include('h.api.store') config.include('h.api.token')
26.8
42
0.664179
18
134
4.944444
0.555556
0.438202
0.314607
0.382022
0
0
0
0
0
0
0
0
0.149254
134
4
43
33.5
0.780702
0.238806
0
0
0
0
0.229167
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
6
4a94b443bb248cc95e3874edd3ae74bf2492e052
22,940
bzl
Python
prometheus/internal/defaults.bzl
5h4d0w4rt/bazel_prometheus
69553b8837b7cdde79a5327d33fd757c0d1fbd9d
[ "MIT" ]
null
null
null
prometheus/internal/defaults.bzl
5h4d0w4rt/bazel_prometheus
69553b8837b7cdde79a5327d33fd757c0d1fbd9d
[ "MIT" ]
null
null
null
prometheus/internal/defaults.bzl
5h4d0w4rt/bazel_prometheus
69553b8837b7cdde79a5327d33fd757c0d1fbd9d
[ "MIT" ]
null
null
null
load( "@io_bazel_rules_prometheus//prometheus/internal:providers.bzl", "AlertmanagerBinaryInfo", "PrometheusBinaryInfo", "PrometheusPackageInfo", "PrometheusPlatformInfo", "PrometheusPlatformsInfo", ) _DEFAULT_LIST_OF_PLATFORMS = ( "darwin-amd64", "darwin-arm64", "dragonfly-amd64", "freebsd-386", "freebsd-amd64", "freebsd-arm64", "freebsd-armv6", "freebsd-armv7", "illumos-amd64", "linux-386", "linux-amd64", "linux-arm64", "linux-armv5", "linux-armv6", "linux-armv7", "linux-mips", "linux-mips64", "linux-mips64le", "linux-mipsle", "linux-ppc64", "linux-ppc64le", "linux-s390x", "netbsd-386", "netbsd-amd64", "netbsd-arm64", "netbsd-armv6", "netbsd-armv7", "openbsd-386", "openbsd-amd64", "openbsd-arm64", "openbsd-armv7", "windows-386", "windows-amd64", ) OsConstraintsInfo = struct( darwin = "@platforms//os:osx", freebsd = "@platforms//os:freebsd", dragonfly = "@platforms//os:freebsd", linux = "@platforms//os:linux", windows = "@platforms//os:windows", netbsd = "@platforms//os:freebsd", openbsd = "@platforms//os:openbsd", illumos = "@platforms//os:openbsd", ) CpuConstraintsInfo = struct( amd64 = "@platforms//cpu:x86_64", arm = "@platforms//cpu:arm", arm64 = "@platforms//cpu:arm64", armv5 = "@platforms//cpu:arm", armv6 = "@platforms//cpu:arm", armv7 = "@platforms//cpu:armv7", mips64 = "@platforms//cpu:mips64", mips64le = "@platforms//cpu:mips64", ppc64 = "@platforms//cpu:x86_32", ppc64le = "@platforms//cpu:ppc", s390x = "@platforms//cpu:s390x", mips = "@platforms//cpu:x86_32", mipsle = "@platforms//cpu:x86_32", # because you can't pass integer as keyword in python **{"386": "@platforms//cpu:x86_32"} ) DEFAULT_PLATFORMS = PrometheusPlatformsInfo( available_platforms = _DEFAULT_LIST_OF_PLATFORMS, platforms = struct(**{ platform: PrometheusPlatformInfo( os = platform.partition("-")[0], cpu = platform.partition("-")[-1], cpu_constraints = [ getattr(CpuConstraintsInfo, platform.partition("-")[-1]), ], os_constraints = [ getattr(OsConstraintsInfo, platform.partition("-")[0]), ], ) for platform in _DEFAULT_LIST_OF_PLATFORMS }), ) _DEFAULT_PROMETHEUS_VERSION = "2.30.3" _DEFAULT_AVAILABLE_PROMETHEUS_BINARIES = { ("2.28.1", "darwin-amd64"): "3941b102a06ebae9bcfa52d07b84825543f529c1e308f2bd66c6ad55cd4d25a4", ("2.28.1", "darwin-arm64"): "1c39922ef27835cf1c68658a20cdfd0323f61ed1efe9424cc1643020bd990a1e", ("2.28.1", "dragonfly-amd64"): "cd9d87f861909cfc358324163ecedf030665d89f071b0a973072722bee2fa762", ("2.28.1", "freebsd-386"): "746477a3723438d91c123a2dbfb4a4690b6cc2883b7747af43ab70b5abd3067e", ("2.28.1", "freebsd-amd64"): "632843a2ff187f955b2c3d3b905375eb461561834a3a3a03faffd74ba56a332b", ("2.28.1", "freebsd-arm64"): "e953a02dfa60dc0035645eed24f8c9103dca2c43e204fd5b905f32926588763c", ("2.28.1", "freebsd-armv6"): "dca05a532e94d2eae847a9db40fe1bfe3542905a0795936b17ac00dac95d371c", ("2.28.1", "freebsd-armv7"): "a8bc3a565e57719aefd5eea9ce6666fec329858bcda0f7ebc71532f58cb8f122", ("2.28.1", "illumos-amd64"): "52381975a967db432fadfcf869e6345aa1a34bbe8892cdebcc00771f3856a11d", ("2.28.1", "linux-386"): "df70438c909f3bd7d26ae2b38dc6f1782bfa54cd4b99d4f01a1f39171426c60c", ("2.28.1", "linux-amd64"): "91dd91e13f30fe520e01175ca1027dd09a458d4421a584ba557ba88b38803f27", ("2.28.1", "linux-arm64"): "298e5e32cc2d106f4d886548a535e787871650095fe87b1e8b29f83cbcbddbd1", ("2.28.1", "linux-armv5"): "a249704d67d6271894a932fd5c6e91f543549b41acbf8b90acb170de357c0396", ("2.28.1", "linux-armv6"): "25456957df9bcfdd54a04cef58689a5cc5ce51ddefc661f59a42e656b5b158f2", ("2.28.1", "linux-armv7"): "0ee31e4ee719680143887911dc15e9108ac595fe4345cb1bb959aad5f0281b1a", ("2.28.1", "linux-mips"): "8039a41bf80c003a04e927dd1ea974b6f25837a1871ee0a5533269acda1b4e57", ("2.28.1", "linux-mips64"): "16f64bc7c9138964a6ce14da2bbe3a6ec19d01c4c6b24d7977d22d5d0c2a6d4e", ("2.28.1", "linux-mips64le"): "87845a55567555c39058bd8b7f0377e08ee008b59c8cca1ccd84d2b8770d3ff2", ("2.28.1", "linux-mipsle"): "8b36ea48fa4e263fe9f4060ec6105ac3285613c047fad04d5b9c0229b1c83493", ("2.28.1", "linux-ppc64"): "b4187b1becc445b17fde05443f737033af3210ae57d1b7921e09350438173454", ("2.28.1", "linux-ppc64le"): "1a9c06b997a6698f8b4d1e71df11078eb5dfcd8348bfff8660f3061f26be013f", ("2.28.1", "linux-s390x"): "dd75c1cdf01ce7bfde341a7db1cc1b76a16008aaed7522fba08a073270c2b1fa", ("2.28.1", "netbsd-386"): "ba7d5adedc068ef0752e385f6b20a82e2479f0cc9eaef4121ef362953df8ad97", ("2.28.1", "netbsd-amd64"): "0f57c6f98b103745e3a80d589e8da5b967f6fea473b6ad5685fb5bc84dec5439", ("2.28.1", "netbsd-arm64"): "86b50ddff15e316b24553ad236a712feded8a6eba2df6bb0df96255d53acf507", ("2.28.1", "netbsd-armv6"): "07bc88f662a5e206b736305fb486fde88895b37a6edcd31a7e0bab46005a97eb", ("2.28.1", "netbsd-armv7"): "3f3c677333db8599117fbdf62e773506859553331a66a62eb956ae31410be917", ("2.28.1", "openbsd-386"): "47a458b300209b5971a342ecd4efc06c06eb55d63dc3b4e12529cc2d81af7a61", ("2.28.1", "openbsd-amd64"): "d7d62a3851069087deebacc3ef0e7f6c58f7c4bbaeb2f02848622a06665703ce", ("2.28.1", "openbsd-arm64"): "23e506d00de16fd9904dd38ed9085f64bc3dee2419674785901b89b59b3a0b05", ("2.28.1", "openbsd-armv7"): "79bb4b7ec88a9d85654ea334f352a826c046732a6729cb7616921e654aceae61", ("2.28.1", "windows-386"): "b8277b3a58faf22ec5d385fbc888b64ab934911d36eea57fe4fe5cce5b2461f3", ("2.28.1", "windows-amd64"): "c81cf1e677247263bdbd7158efb8b00afbd1bc7ae155eb86af5cfe90abdb2969", ("2.29.2", "darwin-amd64"): "810a94974be44f92d6c3ba1b7604513ef0a2c1a159bd10afc50da25370813302", ("2.29.2", "darwin-arm64"): "fc42d62c6b2cb486a14767465c46d72e436ae795be620d01813f20772a264324", ("2.29.2", "dragonfly-amd64"): "bb2f52e6d1bd4035679b51b3e1cd02b067cccb867fd596f667f6bd62fcb4bee3", ("2.29.2", "freebsd-386"): "fc273ea7e3d8e6ff3f5806ccd2be9c6d07ae615d0ccb43c3272d07f4b2603355", ("2.29.2", "freebsd-amd64"): "6a7adf4add15233972b61486f4366036c1f0539d553782fbc3ffbdb15d55a1de", ("2.29.2", "freebsd-arm64"): "aa9031cfa0ec88d895e9003a6d2ce8d041bc24b24fb054b865b2d1c8bc791f6e", ("2.29.2", "freebsd-armv6"): "9882dbd7f7adf6521e5b90408c1a9fede4ad09b3fee01dea6faf9ca5350de2e4", ("2.29.2", "freebsd-armv7"): "32468c0800baef58807f7b151c7572fee876bbe296302e20ea08a0333055cffe", ("2.29.2", "illumos-amd64"): "b171568308d8aa73d6438886fe1de197ac3f0bae2874e09a833941d96b65435a", ("2.29.2", "linux-386"): "7a19cb2e1d70d60857029ff793de375b1d04ffd270d59d82d5dbaa0ff199acf2", ("2.29.2", "linux-amd64"): "51500b603a69cf1ea764b59a7456fe0c4164c4574714aca2a2b6b3d4da893348", ("2.29.2", "linux-arm64"): "c2f1ff7338479ef87d3a94b5ddbf5e431e7de6e326bb23c98616dc2ca395c9a6", ("2.29.2", "linux-armv5"): "af8692e4f1afc47f28399e187baac347bb6af3caabd5ead27978a9200239a9bf", ("2.29.2", "linux-armv6"): "3d45075491a149b013a760b22b99ef32fbceec6d7969bb2e5557c2d7af4f15fd", ("2.29.2", "linux-armv7"): "c4e108c997f9afa0a87b6f075e430c7ff2016adb8bf62a97f927f1840fb70ebd", ("2.29.2", "linux-mips"): "b5258663c7c3d92ad5117c989b474df61de29f760233a60adf06cb60dd548842", ("2.29.2", "linux-mips64"): "3fc4917fb8ff0371473ca987270c66fc89a450b513af4ff932a24fe34b3cb387", ("2.29.2", "linux-mips64le"): "87afa73e0e5d3f772eabe874ac0fab29b493654dc7845e69a4c447331bba6cf3", ("2.29.2", "linux-mipsle"): "a81c80c1c16ece9f2409ae866ffd7eae180fba732708d4709203271b68eaf5eb", ("2.29.2", "linux-ppc64"): "22b133b111626fbbe2c22e0ecf2803b2786ed8d5325a3005e8938c6f8374b39f", ("2.29.2", "linux-ppc64le"): "51c977e15dca823dd79da52d0af7182648a7ff5c4c77932540d7905931d073a6", ("2.29.2", "linux-s390x"): "39e5fab1821f11f8a89793013f0392a5da9824f0d19870406422ace510e0f640", ("2.29.2", "netbsd-386"): "645e143784172c518965721cf067faa4498861d136c8a5e8834627d1fdf401b6", ("2.29.2", "netbsd-amd64"): "374e37d12b7a791265416693e4ce058400995c0b746e9c23eba672b0f008bfc1", ("2.29.2", "netbsd-arm64"): "334854973a8f7ed65eccaed82e337ecb63fcb94fe9d00d19de66f52bb015e2fc", ("2.29.2", "netbsd-armv6"): "3d2c5c42ca372a317136f96758d8ad635fc60d174c7e6958be4ed9201d0b6199", ("2.29.2", "netbsd-armv7"): "2d5a86ba651b752bafb9c9e2a625d54e7c28805615a66fb4972c5e657b667947", ("2.29.2", "openbsd-386"): "971320e25ec0056a0f1bac83b9313c150ab708513fa52085265a9399cf98b5c1", ("2.29.2", "openbsd-amd64"): "294260afe9c59afe8dbed062aba1a0863009a9f67b8fac4937d9fc0b18de10a2", ("2.29.2", "openbsd-arm64"): "2914cf1bfcbf4d70838345cc8f333a44fcd99b07189b6a34e9c0c6719b25a695", ("2.29.2", "openbsd-armv7"): "bfc5c375b34c07e847b1ce4b8934079156efbfb0cf0699fa89d3dfa9ddd65b30", ("2.29.2", "windows-386"): "ed557402f6165b1d85d1281af3d156337ef4fb5677a099d897228e08170bc951", ("2.29.2", "windows-amd64"): "924b52ad4f12f8e3b74a8e151c30bc5b7fbb866934c9dfba013509e3f2b38a62", ("2.30.3", "darwin-amd64"): "8d7e0cda867553a01373fd93f24d718d10f74e0bb43c43f7902bc2216894a281", ("2.30.3", "darwin-arm64"): "dc52f5042d2606f848847014222b06a7ab243c062c39120e4bacdd058eedf289", ("2.30.3", "dragonfly-amd64"): "2acb977702e8f37605fefbd9eff3c7cbaa9e88e4d674362f90d5f728391bd2a5", ("2.30.3", "freebsd-386"): "c6cbb68f9d9898e42d01e88827df4b5549e0e661f882e2fd1062db0b196d6a68", ("2.30.3", "freebsd-amd64"): "b241d60c79da4504b6c082bd09a47c1164a15552e66bc981e319fdf9f3757e7c", ("2.30.3", "freebsd-arm64"): "627688eec5060486fa5d070bc95de0cd005bfa6206d8d657693f54b699971878", ("2.30.3", "freebsd-armv6"): "afc76f8e6e6c8cd3964886db10463256988dacb0c533700346495d52035d2edf", ("2.30.3", "freebsd-armv7"): "ad0b56c76b342ac1bb02648b13efcc28296d4ca79900ecbbd00bb42972d0a9b9", ("2.30.3", "illumos-amd64"): "9d8e4905da66ba4750a2d6e7c06ecf0f46053b5a0c6c6a95677490978b27effc", ("2.30.3", "linux-386"): "7a194951fb51bc0f4f5a15d370ba8c60f62d3f6a5e02e0ccc75238e459bfc3a8", ("2.30.3", "linux-amd64"): "1ccd386d05f73a98b69aa5e0ed31fffac95cd9dadf7df1540daf2f182c5287e2", ("2.30.3", "linux-arm64"): "0bf66e0ab8fcad44ee5041d7909a955017f4587868ee96b76c44c02f500d843e", ("2.30.3", "linux-armv5"): "3492153b60c973d0bccd90ea6ff131da7683dbec46565eb5af6901cfddf77b27", ("2.30.3", "linux-armv6"): "89d4757507b3d233f1b516c48f362287972eed171b82572f437677c56e915534", ("2.30.3", "linux-armv7"): "cb2d8eb3a22d6dbe69449f7d6604f2fa80fa70df4c35dfb412354188047941e7", ("2.30.3", "linux-mips"): "13d5acca1fe121b6e4c1f75d5169aeac2da08067f7c1ee3ed39d781946e476a9", ("2.30.3", "linux-mips64"): "8e8150e40ab1f67114dcd6091a5a0bbe4ecbe87f2a7aa239e086ec37a985fd33", ("2.30.3", "linux-mips64le"): "f8dc62e8938b6226cc6fc7fd82c8d0c65b0f275b2e103266323b2146aec480c8", ("2.30.3", "linux-mipsle"): "4122cf9642f099fb5b25ab89fac58e67b3b661c5c61de5377b17d62d032c1b04", ("2.30.3", "linux-ppc64"): "57fce3a76f492ecddfcefa0745eadea776eac417ad1d8c0b25073ef672a7f1d1", ("2.30.3", "linux-ppc64le"): "002ee190b11a904554e5c00bd1713679894bdcce32067b0de5fae87d4a31dc2c", ("2.30.3", "linux-s390x"): "c6a3feaacf85474126b30577a8d85fa075a41497e03c48f7a5486a50fb02ebcd", ("2.30.3", "netbsd-386"): "5747b0f539fff5db22a58b532f5be6f450e3da88795f642a0d16f1c40d6dc4e1", ("2.30.3", "netbsd-amd64"): "393cd29411094785059f66309359791abd4605d22d6e76197d5e54003168e13c", ("2.30.3", "netbsd-arm64"): "d9dad97f671c825ab071fa4eee9aecd5971ec5fb963eeadcb614e3100e9d9658", ("2.30.3", "netbsd-armv6"): "3040ece61cbb92a60fb32246fa19dc001398bba4cb2324688cbe071a23f5c9c1", ("2.30.3", "netbsd-armv7"): "8bb1c2d03a46294fd1bc4c47b7fdc3be8b7c5bcc589a3472c7776c4adb944e52", ("2.30.3", "openbsd-386"): "cd00cb6cc74527162c51bf5f830bc4e800dec88a4b03dbf84f78051e6349f66f", ("2.30.3", "openbsd-amd64"): "98609477fd38c3c45bb326f284615f15db05931a013238d308bee9530663697e", ("2.30.3", "openbsd-arm64"): "85b01bd03872866852132d325738b59f20bc658c9e33496224e60bcd544d0fee", ("2.30.3", "openbsd-armv7"): "d288f631b0db0a80e62dbf8ac1b5262fe85b3751be66c2d46f32463e0a9cb387", ("2.30.3", "windows-386"): "90250bd300063ea1e041e82efee579e103b1e435f120bd252e4f597bd0e2f7a8", ("2.30.3", "windows-amd64"): "365f8884b92e037f41f59f583b31c5e83fd3b6dbe821e91d3644a701f1001e96", } _DEFAULT_ALERTMANAGER_VERSION = "0.23.0" _DEFAULT_AVAILABLE_ALERTMANAGER_BINARIES = { ("0.21.0", "darwin-amd64"): "b508eb6f5d1b957abbee92f9c37deb99a3da3311572bed34357ac8acbb75e510", ("0.21.0", "dragonfly-amd64"): "8531f3b02d788df4fabe333dc75a558cd92c51c4c8280d5a27dbaa0efb390f66", ("0.21.0", "freebsd-386"): "bd554804e0240b1cba8d3f9f1bb5cfde6f1c815ec3b77e83e617808ca0983420", ("0.21.0", "freebsd-amd64"): "1fe3f1fcdebb055d464d24865743f996843166bb7c8f3cea114887f5bb283b2d", ("0.21.0", "freebsd-armv6"): "3cc30810003e21d06f1f5534a284bacf077d04bc8f86e4b82f6b189d45d248df", ("0.21.0", "freebsd-armv7"): "dec886a05913e210a8b0f109e713b6f394d2afddb5395da045a8823d2d7f9c83", ("0.21.0", "linux-386"): "cfa6090466b530ea7501fcded4a186516cac22c149cda1f50dd125177badff9d", ("0.21.0", "linux-amd64"): "9ccd863937436fd6bfe650e22521a7f2e6a727540988eef515dde208f9aef232", ("0.21.0", "linux-arm64"): "1107870a95d51e125881f44aebbc56469e79f5068bd96f9eddff38e7a5ebf423", ("0.21.0", "linux-armv5"): "1778ac52bbbb99a9914b3fb9b0f39c35046cf9a2540568f80ea03efc603b00be", ("0.21.0", "linux-armv6"): "03282900bf3ddce77f236872f4c8e2cf91f7b8b9b7e80eec845841930723a900", ("0.21.0", "linux-armv7"): "d7b41a15d90fedf3456969b158ddaea591d7d22d195cc653738af550706302b6", ("0.21.0", "linux-mips64"): "caad406dc86ad36b0f282a409757895d66206da47aae721f344ebad3bf257f7a", ("0.21.0", "linux-mips64le"): "060f0af52a471bdc2fd017f2752d945ddd47a030d5c94fe3c37d1fb74693906c", ("0.21.0", "linux-ppc64"): "adc949faa23a8a34cc5fe5fa64f62777cb35d0055df303804f767b77c662ad3f", ("0.21.0", "linux-ppc64le"): "afc649eb16299f1957034ff14450fe18507de6d43f7b36383373c678974a09ed", ("0.21.0", "linux-s390x"): "5a71fae41f8a2abf6b34825f16a7ea625fede6d2e9679111147d15aa8446ab38", ("0.21.0", "netbsd-386"): "e1db656dd4b6b4f9cb16505591ce10b76ca3106582786dd7ea71560a6e4e7a53", ("0.21.0", "netbsd-amd64"): "aa29c15a464ddfdb40dff77e81634a6c81150e8b601ff11c82f05c5b2b4876d4", ("0.21.0", "netbsd-armv6"): "26d68e39479beb3c040bf6ef995d5c58d0b3523688219d84ce10eb9620622611", ("0.21.0", "netbsd-armv7"): "d25f311f76df28fa82c01c527fabaa646b24a48120938d57b3116382f4b8cf65", ("0.21.0", "openbsd-386"): "6bdb03cd3c36a27b523f411e7370606c84214e53a75b740a2f1e07c77ed7c52a", ("0.21.0", "openbsd-amd64"): "ffd4fde08ff1236d37eabb10a6d1896404f06ebf8c5fd4c15c322b67a628f6a5", ("0.21.0", "windows-386"): "16797370f99db1d10aec642c4f266eb7d051bfaa874d17caf3041141a64cd26f", ("0.21.0", "windows-amd64"): "12c9a77d904bd7982e7ceacfbe9106e725e31536913c491e7b2703f9ddff4aa2", ("0.22.2", "darwin-amd64"): "2629b6a598e3d16726cfbaec1debdcaf62dcf60ed2b52b2b18bb794e3a5b2e63", ("0.22.2", "darwin-arm64"): "76c4b15189ccd9501ac7a3e30cc02447a08f78c8087bed2da17d29334a0c2927", ("0.22.2", "dragonfly-amd64"): "c75625695d3afacdb89eff34001f5c0f85d8607502dd4eaeec1c0b8fe5e5218e", ("0.22.2", "freebsd-386"): "dccd8a844bb03200d8e7fe42293c083f96fe5d4402b33f39b87133cf2bacea77", ("0.22.2", "freebsd-amd64"): "0a7541595c713091dd1bba800281e6e3abe69073dbd1906019c1e285215f7d6a", ("0.22.2", "freebsd-arm64"): "149e62254a03b607c860ba8655d9321085c36222a58f97a688f58801fbdd05d9", ("0.22.2", "freebsd-armv6"): "7383eb8c630ffa46953cf8599888a8cbff0ca1bcb5f3ef6aa0cb6b03471c50f2", ("0.22.2", "freebsd-armv7"): "081f79abf5a953db2b5153ac21df9b39627aad43c54daee1e887b08e9a911895", ("0.22.2", "illumos-amd64"): "2522272c404580c5a59634f75315ddb85780a9b2e14894a583093d6d8caf9ecd", ("0.22.2", "linux-386"): "d4248d2bb47bbd891de9f092f129a65246ef4cb32538c97824b9fec34b867d40", ("0.22.2", "linux-amd64"): "9c3b1cce9c74f5cecb07ec4a636111ca52696c0a088dbaecf338594d6e55cd1a", ("0.22.2", "linux-arm64"): "2592ba596b59a69db397987fc2ee1c4a91dddb63b92bada692270203d183e5f1", ("0.22.2", "linux-armv5"): "c48a20f14ca4ae6ced976752a115f0687ecd734a873f0393afd6f7ab6159bdbe", ("0.22.2", "linux-armv6"): "8d31f59b52f69a77f869bd124e87a5fc9434a9f4fce5325a980d35acd269f71c", ("0.22.2", "linux-armv7"): "514e0629fed4594d14e9c1f3466fecb7e38f692a7b63772d7b6826bdbe071665", ("0.22.2", "linux-mips"): "11e235fe01dbc5adbfaf355503ac0babbae7b2a00276a2770b8f4a01e9c55915", ("0.22.2", "linux-mips64"): "94101a86f2eb99e0b7c98b8154a17b8f1d443911c5e52cd51604ba92e59098d3", ("0.22.2", "linux-mips64le"): "c6c06e6468e09297e72af9896bbdb879aebf122a7118f9104243aadc976af350", ("0.22.2", "linux-mipsle"): "3df3c3064cc3e88f8bfc7c05b55e717acc21ea8d24517a58be96ef2cb44cb845", ("0.22.2", "linux-ppc64"): "dd03dc898aeaadeb29192f56be2da5bf785cc0075a0c4e94892f31c8363de7d5", ("0.22.2", "linux-ppc64le"): "0e8c79b4e80a4535ce4e9fae7913884429f55d1725852a43a2964d3b0847b9c8", ("0.22.2", "linux-s390x"): "38505aca84989ea3c8089f7d5e0663c826b977ce38dca1003e8b0bf14828d1ce", ("0.22.2", "netbsd-386"): "218311641781781871ea2a5699732c771ed76a6f281bd67b3f8a024afa06efa6", ("0.22.2", "netbsd-amd64"): "2bfab1d64bff8578e1edc1efde5c692ce03f07c75e0768c785e53066366fdb4a", ("0.22.2", "netbsd-arm64"): "94049615dc7a92f959579d4175852385049d2a6ebbe38d6e9bd9d97287c39189", ("0.22.2", "netbsd-armv6"): "ab2ca08e6b16100fe52f8c83d53fe33c70e8302488f4389c23b1c70e07e842c7", ("0.22.2", "netbsd-armv7"): "88faa3ea904c4be57fc537dc2b7dc492ab7f17817f3d7ebcd7221a7d171036c4", ("0.22.2", "openbsd-386"): "b13b00d77248b3b39324ce5ed03ee9a628bb24345d33be3a78b3e0a7c736f4b0", ("0.22.2", "openbsd-amd64"): "b40fae31909ada235e213e03a638f25028a8655feaca907a6c7688309a6bb688", ("0.22.2", "openbsd-arm64"): "747e05d7d4e1a73cb343db42485753616bbf82605f57cc85735ed5022b67b36e", ("0.22.2", "openbsd-armv7"): "7fd037a22b39f9f0f3f4b671059d0ad8881d326d7a5f50d152146799a37c6ebe", ("0.22.2", "windows-386"): "78e45056b359c78b3e67b443e127d6c25a8fc6b7776c64aea82ad6f386cf98bf", ("0.22.2", "windows-amd64"): "98b8b66ff8818c64452a54041c1d388af2f0be124dc3bac801ce095744e6e66b", ("0.23.0", "darwin-amd64"): "f8d668f88f8934202aaf646a93a116ac38532144bdaad291319518704a01f2ca", ("0.23.0", "darwin-arm64"): "01d47f98b46d92dac2a7ae8f45668e8491f835c57f8c3cab39a3cb6ec8d16ca1", ("0.23.0", "dragonfly-amd64"): "d50d3c6f2d524157d1447e7e793c1567f0b7e5c5bd3a8664dcf35f8811e74132", ("0.23.0", "freebsd-386"): "b25c51b19e4295159e81c3a94e91f34b6750ad8bb54971263a9296695f267e3a", ("0.23.0", "freebsd-amd64"): "59c73c66dc5e103f96d2d54920baf9168d754636e96876b5f4b713effabc8c1c", ("0.23.0", "freebsd-arm64"): "875dec9177aa9e1185924773fa478f27368fc7b71b42628dca8db6a5351a99c0", ("0.23.0", "freebsd-armv6"): "fd07d75d4823437527fe91736b6fe63aae2e7624a6b1bb84d05a83fc4b6739d0", ("0.23.0", "freebsd-armv7"): "0673354936807c12d5f7dd13837524f7d23b177a31af8e8bb5235eb5325c1e7f", ("0.23.0", "illumos-amd64"): "93d91f2ff06c4de271b8b3180e6673fd2fe2569dce0da335e860a261a700717b", ("0.23.0", "linux-386"): "097abb8b7b676bf1543d9020120f56beedb3935ab2f71a03e4537e17350d3be3", ("0.23.0", "linux-amd64"): "77793c4d9bb92be98f7525f8bc50cb8adb8c5de2e944d5500e90ab13918771fc", ("0.23.0", "linux-arm64"): "afa44f350797032ceb714598900cfdddbf81d6ef03d2ecbfc0221cc2cb28a6b9", ("0.23.0", "linux-armv5"): "11bfd273a0e115f662fc31cb8c818f8857dd5857c3045ad104aa15766ad4fb65", ("0.23.0", "linux-armv6"): "9837426d31084aec1e9f55bbce8defc05417e3af2098255a5eebab096dc246cd", ("0.23.0", "linux-armv7"): "489c377a04b6097f07fdcc4b532a9643e520739b268be5350c4ffa999956d5c9", ("0.23.0", "linux-mips"): "7a0d2690d69df8cb1500568d02d9ad8a990b8e13bb8e3ef383ef09c5fe6fc5d6", ("0.23.0", "linux-mips64"): "c3711cd95cde42dfe19c4c6186026555fedc39980449a118cbbb894b6173a1fb", ("0.23.0", "linux-mips64le"): "460ebf9f92bac4b0fad1bf554ad9d60dcea65ff80b7d5326fb36e8d15a3b254a", ("0.23.0", "linux-mipsle"): "ee2ab5f329e728d57f2f8ae59ad4c10351800c20b69058daa42857d63771c2d0", ("0.23.0", "linux-ppc64"): "f79cf779b758d1cda4cf6b9e6708497e1c67e0e619efefadba66d57a7b937f6c", ("0.23.0", "linux-ppc64le"): "c047283a61bb99234e8050347c5f1333c6805eb3e5806e73a0e80f6249967831", ("0.23.0", "linux-s390x"): "45a9ea7549f8d4242703d9bd66d03c62530e67097010303d3a002a79de7a01aa", ("0.23.0", "netbsd-386"): "e43d565eda9132c385b9e06883ce67fc8bc09053e70d5b8e54967d2c384f5778", ("0.23.0", "netbsd-amd64"): "6c4983b500fe18d71174e817a31828bda89710ad8a9f1329ed2ff6da08826a48", ("0.23.0", "netbsd-arm64"): "15e0b87bfe5bb53d2240af855f66a5d895eec6c324dc0764e8799045543b770d", ("0.23.0", "netbsd-armv6"): "814bbb0f1c425d05ce60122726e8a16f2d18ae89255c37622bac1abdb3fe1c11", ("0.23.0", "netbsd-armv7"): "9a8fa1ba2c181797013494d74dcb4bbb4aa568a00467cb270f3e393dd8a09c9a", ("0.23.0", "openbsd-386"): "ef82fbeb03243eae8c6fede858d8118dad28a4c1f0504451361e02eac2808cdf", ("0.23.0", "openbsd-amd64"): "9ed30892abc21fe7b32dd29c11b3ddb0262f0f8e6f80c9265139c92611b95290", ("0.23.0", "openbsd-arm64"): "f47ad57dceecae7a40ede243b99f8b56bde5b930ec98d95c14c95d5e398f8fa9", ("0.23.0", "openbsd-armv7"): "4afc7974f078bc882cfcead000ffc52ccac9609caec5798d90d4a35eb7a10a8b", ("0.23.0", "windows-386"): "b1dd8405de144f4d2e2ae067138fb720fb9eb9fa6234c8de14dfc6c5cb8df155", ("0.23.0", "windows-amd64"): "7832aac30f849de0a1a60d961dec083e97933a73dc26673ffaef4809719fcd3c", } _DEFAULT_PROMETHEUS_BINARY_INFO = PrometheusBinaryInfo( version = _DEFAULT_PROMETHEUS_VERSION, available_binaries = _DEFAULT_AVAILABLE_PROMETHEUS_BINARIES, ) _DEFAULT_ALERTMANAGER_BINARY_INFO = AlertmanagerBinaryInfo( version = _DEFAULT_ALERTMANAGER_VERSION, available_binaries = _DEFAULT_AVAILABLE_ALERTMANAGER_BINARIES, ) DEFAULT_PROMETHEUS_PACKAGE_INFO = PrometheusPackageInfo( platforms_info = DEFAULT_PLATFORMS, prometheus_binary_info = _DEFAULT_PROMETHEUS_BINARY_INFO, alertmanager_binary_info = _DEFAULT_ALERTMANAGER_BINARY_INFO, ) # generally useful code # def _validate_prometheus_package_info(prometheus_package_info): # if not ( # prometheus_package_info.prometheus_binary_info.version in # [key[0] for key in prometheus_package_info.prometheus_binary_info.available_binaries] # ): # fail( # "No %s version in supported prometheus versions" % prometheus_package_info.prometheus_binary_info.version, # ) # if not ( # prometheus_package_info.alertmanager_binary_info.version in # [key[0] for key in prometheus_package_info.alertmanager_binary_info.available_binaries] # ): # fail( # "No %s in supported alertmanager versions" % prometheus_package_info.alertmanager_binary_info.version, # )
71.021672
120
0.768352
1,532
22,940
11.432768
0.185379
0.005824
0.007765
0.00668
0.025464
0.020325
0.019069
0.005938
0.005938
0.005938
0
0.426264
0.093112
22,940
322
121
71.242236
0.415641
0.034133
0
0.006803
0
0
0.750305
0.571751
0
1
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
6
4a9d7258cedaa54b3a99a8a0b4c14e694b127a61
156
py
Python
pureskillgg_makenew_pyskill/todo_test.py
pureskillgg/makenew-pyskill
3045f0639506fcaefd3191dada76277598bbb1eb
[ "MIT" ]
6
2019-04-30T16:44:20.000Z
2021-12-25T23:23:41.000Z
pureskillgg_makenew_pyskill/todo_test.py
pureskillgg/makenew-pyskill
3045f0639506fcaefd3191dada76277598bbb1eb
[ "MIT" ]
15
2020-03-28T20:29:38.000Z
2021-09-11T07:19:46.000Z
makenew_pypackage/todo_test.py
makenew/pypackage
3b29c8a9a1a7442f1d6742ae8ec1eb2b92033039
[ "MIT" ]
3
2019-11-21T08:29:14.000Z
2021-01-10T17:22:41.000Z
# pylint: disable=missing-docstring # pylint: disable=unused-import import pytest from .todo import todo def test_todo(): assert todo(True) is True
14.181818
35
0.74359
22
156
5.227273
0.636364
0.226087
0
0
0
0
0
0
0
0
0
0
0.166667
156
10
36
15.6
0.884615
0.403846
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
true
0
0.5
0
0.75
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
1
0
1
0
1
0
0
6
4aa1c7d3e45d567c68e550747b7057af2e5888db
3,351
py
Python
cvnets/models/classification/config/resnet.py
apple/ml-cvnets
84d992f413e52c0468f86d23196efd9dad885e6f
[ "AML" ]
209
2021-10-30T08:32:10.000Z
2022-03-31T16:18:03.000Z
cvnets/models/classification/config/resnet.py
apple/ml-cvnets
84d992f413e52c0468f86d23196efd9dad885e6f
[ "AML" ]
12
2021-12-04T10:47:11.000Z
2022-03-31T15:39:40.000Z
cvnets/models/classification/config/resnet.py
apple/ml-cvnets
84d992f413e52c0468f86d23196efd9dad885e6f
[ "AML" ]
50
2021-11-01T08:15:02.000Z
2022-03-29T08:17:34.000Z
# # For licensing see accompanying LICENSE file. # Copyright (C) 2022 Apple Inc. All Rights Reserved. # from typing import Dict from utils import logger def get_configuration(opts) -> Dict: depth = getattr(opts, "model.classification.resnet.depth", 50) resnet_config = dict() if depth == 18: resnet_config["layer2"] = { "num_blocks": 2, "mid_channels": 64, "block_type": "basic", "stride": 1, } resnet_config["layer3"] = { "num_blocks": 2, "mid_channels": 128, "block_type": "basic", "stride": 2, } resnet_config["layer4"] = { "num_blocks": 2, "mid_channels": 256, "block_type": "basic", "stride": 2, } resnet_config["layer5"] = { "num_blocks": 2, "mid_channels": 512, "block_type": "basic", "stride": 2, } elif depth == 34: resnet_config["layer2"] = { "num_blocks": 3, "mid_channels": 64, "block_type": "basic", "stride": 1, } resnet_config["layer3"] = { "num_blocks": 4, "mid_channels": 128, "block_type": "basic", "stride": 2, } resnet_config["layer4"] = { "num_blocks": 6, "mid_channels": 256, "block_type": "basic", "stride": 2, } resnet_config["layer5"] = { "num_blocks": 3, "mid_channels": 512, "block_type": "basic", "stride": 2, } elif depth == 50: resnet_config["layer2"] = { "num_blocks": 3, "mid_channels": 64, "block_type": "bottleneck", "stride": 1, } resnet_config["layer3"] = { "num_blocks": 4, "mid_channels": 128, "block_type": "bottleneck", "stride": 2, } resnet_config["layer4"] = { "num_blocks": 6, "mid_channels": 256, "block_type": "bottleneck", "stride": 2, } resnet_config["layer5"] = { "num_blocks": 3, "mid_channels": 512, "block_type": "bottleneck", "stride": 2, } elif depth == 101: resnet_config["layer2"] = { "num_blocks": 3, "mid_channels": 64, "block_type": "bottleneck", "stride": 1, } resnet_config["layer3"] = { "num_blocks": 4, "mid_channels": 128, "block_type": "bottleneck", "stride": 2, } resnet_config["layer4"] = { "num_blocks": 23, "mid_channels": 256, "block_type": "bottleneck", "stride": 2, } resnet_config["layer5"] = { "num_blocks": 3, "mid_channels": 512, "block_type": "bottleneck", "stride": 2, } else: logger.error( "ResNet models are supported with depths of 18, 34, 50 and 101. Please specify depth using " "--model.classification.resnet.depth flag. Got: {}".format(depth) ) return resnet_config
27.694215
104
0.452402
304
3,351
4.766447
0.246711
0.149068
0.077295
0.110421
0.732229
0.710835
0.710835
0.710835
0.710835
0.710835
0
0.059151
0.409728
3,351
120
105
27.925
0.673407
0.02835
0
0.711712
0
0
0.306367
0.020917
0
0
0
0
0
1
0.009009
false
0
0.018018
0
0.036036
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
4ac6aa0c064d6e9151cebd584ec27921fd340495
236
py
Python
tests/__init__.py
lmbringas/NeuralMap
0a8787e79f3985bb188b1b041e3ec7e558c4a742
[ "MIT" ]
4
2020-10-02T11:46:48.000Z
2021-05-14T18:20:41.000Z
tests/__init__.py
lmbringas/NeuralMap
0a8787e79f3985bb188b1b041e3ec7e558c4a742
[ "MIT" ]
1
2021-06-21T18:46:39.000Z
2021-06-21T18:46:39.000Z
tests/__init__.py
lmbringas/NeuralMap
0a8787e79f3985bb188b1b041e3ec7e558c4a742
[ "MIT" ]
1
2021-06-13T19:58:19.000Z
2021-06-13T19:58:19.000Z
""" Test suite for NeuralMap. Modules ------- test_neural_map: Basic tests for main class test_decay_functions: Tests decay functions tests_neighbourhood_functions: Tests neighbourhood functions """
18.153846
37
0.677966
25
236
6.16
0.56
0.272727
0.246753
0.467532
0
0
0
0
0
0
0
0
0.25
236
13
38
18.153846
0.870057
0.961864
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
6
435c1f4e82aaef91c8fb8fe19b226482cf691213
9,715
py
Python
reference/sketchbook/metatoo/bootstrap.py
JaDogg/__py_playground
416f88db10e03f5380bcb5cfcad0bca50ffa657c
[ "MIT" ]
1
2015-10-28T00:00:16.000Z
2015-10-28T00:00:16.000Z
reference/sketchbook/metatoo/bootstrap.py
JaDogg/__py_playground
416f88db10e03f5380bcb5cfcad0bca50ffa657c
[ "MIT" ]
null
null
null
reference/sketchbook/metatoo/bootstrap.py
JaDogg/__py_playground
416f88db10e03f5380bcb5cfcad0bca50ffa657c
[ "MIT" ]
null
null
null
""" Bootstrap the metatoo compiler by compiling the metatoo grammar using a hand-translation of itself into peglet. """ import sys from peglet import Parser, join meta_grammar = r""" main = main_start _ rules !. rules = rule rules | rule = id /=/ _ alts [.] _ rule_do alts = seq_start seq alts2 alts2 = [|] _ alts | seq = token seq | seq_end token = [{] qchars [}] _ join tok_qchars | [/] xchars [/] _ join tok_xchars | id tok_id | [:] id tok_primitive qchars = qchar qchars | qchar = ([^}]) xchars = xchar xchars | xchar = /(\\.|[^\/])/ id = ([a-zA-Z_]\w*) _ _ = \s* """ def main_start(): return ("# This file was generated by metatoo; you probably shouldn't edit it.\n" "import metalib, re\n" "def parse(text):\n" " pos, vals = parse_main(text, 0, ())\n" " if pos != len(text): raise Exception('Failed', pos)\n" " return ''.join(vals)\n") def rule_do(name, *body): return ("def parse_%s(text, start_pos, start_vals):\n" "%s" " return None, None\n" % (name, ''.join(body))) def seq_start(): return (" while True:\n" " pos, vals = start_pos, start_vals\n") def seq_end(): return (" return pos, vals\n") def tok_qchars(*chars): return (" vals += (%r,)\n" % ''.join(chars)) def tok_xchars(*chars): return (" m = re.match(%r, text[pos:])\n" " if not m: break\n" " pos, vals = pos + m.end(), vals + m.groups()\n" % ''.join(chars)) def tok_id(name): return (" pos, vals = parse_%s(text, pos, vals)\n" " if pos is None: break\n" % name) def tok_primitive(name): return (" vals = metalib.%s(vals)\n" % name) meta = Parser(meta_grammar, **globals()) with open('metatoo.metatoo') as f: sys.stdout.write(''.join(meta(f.read()))) #. # This file was generated by metatoo; you probably shouldn't edit it. #. import metalib, re #. def parse(text): #. pos, vals = parse_main(text, 0, ()) #. if pos != len(text): raise Exception('Failed', pos) #. return ''.join(vals) #. def parse_main(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. vals += ("# This file was generated by metatoo; you probably shouldn't edit it.",) #. vals = metalib.nl(vals) #. vals += ('import metalib, re',) #. vals = metalib.nl(vals) #. vals += ('def parse(text):',) #. vals = metalib.nl(vals) #. vals += (' pos, vals = parse_main(text, 0, ())',) #. vals = metalib.nl(vals) #. vals += (" if pos != len(text): raise Exception('Failed', pos)",) #. vals = metalib.nl(vals) #. vals += (" return ''.join(vals)",) #. vals = metalib.nl(vals) #. pos, vals = parse__(text, pos, vals) #. if pos is None: break #. pos, vals = parse_rules(text, pos, vals) #. if pos is None: break #. return pos, vals #. return None, None #. def parse_rules(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. pos, vals = parse_rule(text, pos, vals) #. if pos is None: break #. pos, vals = parse_rules(text, pos, vals) #. if pos is None: break #. return pos, vals #. while True: #. pos, vals = start_pos, start_vals #. return pos, vals #. return None, None #. def parse_rule(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. pos, vals = parse_id(text, pos, vals) #. if pos is None: break #. m = re.match('=', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse__(text, pos, vals) #. if pos is None: break #. vals += ('def parse_',) #. vals = metalib.swap(vals) #. vals += ('(text, start_pos, start_vals):',) #. vals = metalib.nl(vals) #. pos, vals = parse_alts(text, pos, vals) #. if pos is None: break #. m = re.match('\\.', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse__(text, pos, vals) #. if pos is None: break #. vals += (' return None, None',) #. vals = metalib.nl(vals) #. return pos, vals #. return None, None #. def parse_alts(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. vals += (' while True:',) #. vals = metalib.nl(vals) #. vals += (' pos, vals = start_pos, start_vals',) #. vals = metalib.nl(vals) #. pos, vals = parse_seq(text, pos, vals) #. if pos is None: break #. pos, vals = parse_alts2(text, pos, vals) #. if pos is None: break #. return pos, vals #. return None, None #. def parse_alts2(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. m = re.match('\\|', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse__(text, pos, vals) #. if pos is None: break #. pos, vals = parse_alts(text, pos, vals) #. if pos is None: break #. return pos, vals #. while True: #. pos, vals = start_pos, start_vals #. return pos, vals #. return None, None #. def parse_seq(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. pos, vals = parse_token(text, pos, vals) #. if pos is None: break #. pos, vals = parse_seq(text, pos, vals) #. if pos is None: break #. return pos, vals #. while True: #. pos, vals = start_pos, start_vals #. vals += (' return pos, vals',) #. vals = metalib.nl(vals) #. return pos, vals #. return None, None #. def parse_token(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. m = re.match('{', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse_qchars(text, pos, vals) #. if pos is None: break #. m = re.match('}', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse__(text, pos, vals) #. if pos is None: break #. vals += (' vals += (',) #. vals = metalib.swap(vals) #. vals = metalib.quote(vals) #. vals += (',)',) #. vals = metalib.nl(vals) #. return pos, vals #. while True: #. pos, vals = start_pos, start_vals #. m = re.match('\\/', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse_xchars(text, pos, vals) #. if pos is None: break #. m = re.match('\\/', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse__(text, pos, vals) #. if pos is None: break #. vals += (' m = re.match(',) #. vals = metalib.swap(vals) #. vals = metalib.quote(vals) #. vals += (', text[pos:])',) #. vals = metalib.nl(vals) #. vals += (' if not m: break',) #. vals = metalib.nl(vals) #. vals += (' pos, vals = pos + m.end(), vals + m.groups()',) #. vals = metalib.nl(vals) #. return pos, vals #. while True: #. pos, vals = start_pos, start_vals #. pos, vals = parse_id(text, pos, vals) #. if pos is None: break #. vals += (' pos, vals = parse_',) #. vals = metalib.swap(vals) #. vals += ('(text, pos, vals)',) #. vals = metalib.nl(vals) #. vals += (' if pos is None: break',) #. vals = metalib.nl(vals) #. return pos, vals #. while True: #. pos, vals = start_pos, start_vals #. m = re.match(':', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse_id(text, pos, vals) #. if pos is None: break #. vals += (' vals = metalib.',) #. vals = metalib.swap(vals) #. vals += ('(vals)',) #. vals = metalib.nl(vals) #. return pos, vals #. return None, None #. def parse_qchars(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. m = re.match('([^}])', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse_qchars(text, pos, vals) #. if pos is None: break #. vals = metalib.cat(vals) #. return pos, vals #. while True: #. pos, vals = start_pos, start_vals #. vals += ('',) #. return pos, vals #. return None, None #. def parse_xchars(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. m = re.match('(\\\\.|[^\\/])', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse_xchars(text, pos, vals) #. if pos is None: break #. vals = metalib.cat(vals) #. return pos, vals #. while True: #. pos, vals = start_pos, start_vals #. vals += ('',) #. return pos, vals #. return None, None #. def parse_id(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. m = re.match('([a-zA-Z_]\\w*)', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. pos, vals = parse__(text, pos, vals) #. if pos is None: break #. return pos, vals #. return None, None #. def parse__(text, start_pos, start_vals): #. while True: #. pos, vals = start_pos, start_vals #. m = re.match('\\s*', text[pos:]) #. if not m: break #. pos, vals = pos + m.end(), vals + m.groups() #. return pos, vals #. return None, None
32.932203
89
0.535255
1,320
9,715
3.829545
0.069697
0.153709
0.087438
0.114342
0.806924
0.779031
0.747181
0.711771
0.672997
0.655193
0
0.001001
0.280391
9,715
294
90
33.044218
0.722071
0.750798
0
0.064516
0
0
0.548564
0
0
0
0
0
0
1
0.129032
false
0
0.048387
0.129032
0.306452
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
1
0
0
0
6
435da6fe69bcaf98d6c4f9bfae675a11271386e9
96
py
Python
venv/lib/python3.8/site-packages/jedi/inference/value/namespace.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/jedi/inference/value/namespace.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/jedi/inference/value/namespace.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/02/de/cf/10caee22d2245749029f54597ea81219bbc645f188d9b6ee82065e944d
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.4375
0
96
1
96
96
0.458333
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
6
4388020bc537520366a8855075030df4c61f78ad
186
py
Python
music/admin.py
chetanya-shrimali/music-website-django
475a68487b6d8311b75acb8d500b3b3d48e7e373
[ "MIT" ]
1
2017-10-07T08:31:37.000Z
2017-10-07T08:31:37.000Z
music/admin.py
chetanya-shrimali/music-webiste-django
475a68487b6d8311b75acb8d500b3b3d48e7e373
[ "MIT" ]
2
2017-10-13T05:34:27.000Z
2017-10-13T22:40:46.000Z
music/admin.py
chetanya-shrimali/music-webiste-django
475a68487b6d8311b75acb8d500b3b3d48e7e373
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from .models import Record, Song admin.site.register(Record) admin.site.register(Song)
20.666667
39
0.774194
26
186
5.346154
0.615385
0.129496
0.244604
0
0
0
0
0
0
0
0
0.006098
0.11828
186
8
40
23.25
0.841463
0.112903
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.6
0
0.6
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
43c4178e7ba41a174802705fab49c500b707efa1
19
py
Python
vgc/DinosaursVsAirplanes/__init__.py
reedessick/video-game-camp
09a324279c5ea9de87080f122fe27e1ef83d5373
[ "MIT" ]
null
null
null
vgc/DinosaursVsAirplanes/__init__.py
reedessick/video-game-camp
09a324279c5ea9de87080f122fe27e1ef83d5373
[ "MIT" ]
null
null
null
vgc/DinosaursVsAirplanes/__init__.py
reedessick/video-game-camp
09a324279c5ea9de87080f122fe27e1ef83d5373
[ "MIT" ]
null
null
null
from . import game
9.5
18
0.736842
3
19
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.210526
19
1
19
19
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
43c4dba56e838339f6274349bcc1ceecb1ad118e
8,205
py
Python
madminer/plotting/morphing.py
rbarrue/madminer
e1d17b2d6be48cc5686b5cbe5d01f62f6cd2450c
[ "MIT" ]
46
2019-06-29T14:56:00.000Z
2021-08-02T06:05:41.000Z
madminer/plotting/morphing.py
Sinclert/madminer
6556f164725baab6b79e5ffa2a64913a0ac50f7a
[ "MIT" ]
52
2019-06-18T18:42:58.000Z
2021-10-04T14:56:39.000Z
madminer/plotting/morphing.py
Sinclert/madminer
6556f164725baab6b79e5ffa2a64913a0ac50f7a
[ "MIT" ]
20
2019-06-17T15:29:49.000Z
2021-09-22T18:14:35.000Z
import logging import matplotlib import numpy as np from matplotlib import pyplot as plt logger = logging.getLogger(__name__) def plot_1d_morphing_basis(morpher, xlabel=r"$\theta$", xrange=(-1.0, 1.0), resolution=100): """ Visualizes a morphing basis and morphing errors for problems with a two-dimensional parameter space. Parameters ---------- morpher : PhysicsMorpher PhysicsMorpher instance with defined basis. xlabel : str, optional Label for the x axis. Default value: r'$\theta$'. xrange : tuple of float, optional Range `(min, max)` for the x axis. Default value: (-1., 1.). resolution : int, optional Number of points per axis for the rendering of the squared morphing weights. Default value: 100. Returns ------- figure : Figure Plot as Matplotlib Figure instance. """ basis = morpher.basis assert basis is not None, "No basis defined" assert basis.shape[1] == 1, "Only 1d problems can be plotted with this function" theta_test = np.linspace(xrange[0], xrange[1], resolution).reshape((-1, 1)) squared_weights = [] for theta in theta_test: wi = morpher.calculate_morphing_weights(theta, None) squared_weights.append(np.sum(wi * wi) ** 0.5) fig = plt.figure(figsize=(5, 5)) ax = plt.gca() ax.plot(theta_test.flatten(), squared_weights) plt.scatter(basis[:, 0], [0.0 for _ in basis[:, 0]], s=50.0, c="black") plt.xlabel(xlabel) plt.ylabel(r"$\sqrt{\sum w_i^2}$") plt.xlim(xrange[0], xrange[1]) plt.ylim(0.0, None) plt.tight_layout() return fig def plot_2d_morphing_basis( morpher, xlabel=r"$\theta_0$", ylabel=r"$\theta_1$", xrange=(-1.0, 1.0), yrange=(-1.0, 1.0), crange=(1.0, 100.0), resolution=100, ): """ Visualizes a morphing basis and morphing errors for problems with a two-dimensional parameter space. Parameters ---------- morpher : PhysicsMorpher PhysicsMorpher instance with defined basis. xlabel : str, optional Label for the x axis. Default value: r'$\theta_0$'. ylabel : str, optional Label for the y axis. Default value: r'$\theta_1$'. xrange : tuple of float, optional Range `(min, max)` for the x axis. Default value: (-1., 1.). yrange : tuple of float, optional Range `(min, max)` for the y axis. Default value: (-1., 1.). crange : tuple of float, optional Range `(min, max)` for the color map. Default value: (1., 100.). resolution : int, optional Number of points per axis for the rendering of the squared morphing weights. Default value: 100. Returns ------- figure : Figure Plot as Matplotlib Figure instance. """ basis = morpher.basis assert basis is not None, "No basis defined" assert basis.shape[1] == 2, "Only 2d problems can be plotted with this function" xi, yi = (np.linspace(xrange[0], xrange[1], resolution), np.linspace(yrange[0], yrange[1], resolution)) xx, yy = np.meshgrid(xi, yi) xx, yy = xx.reshape((-1, 1)), yy.reshape((-1, 1)) theta_test = np.hstack([xx, yy]) squared_weights = [] for theta in theta_test: wi = morpher.calculate_morphing_weights(theta, None) squared_weights.append(np.sum(wi * wi) ** 0.5) squared_weights = np.array(squared_weights).reshape((resolution, resolution)) fig = plt.figure(figsize=(6.5, 5)) ax = plt.gca() pcm = ax.pcolormesh( xi, yi, squared_weights, norm=matplotlib.colors.LogNorm(vmin=crange[0], vmax=crange[1]), cmap="viridis_r" ) cbar = fig.colorbar(pcm, ax=ax, extend="both") plt.scatter(basis[:, 0], basis[:, 1], s=50.0, c="black") plt.xlabel(xlabel) plt.ylabel(ylabel) cbar.set_label(r"$\sqrt{\sum w_i^2}$") plt.xlim(xrange[0], xrange[1]) plt.ylim(yrange[0], yrange[1]) plt.tight_layout() return fig def plot_nd_morphing_basis_scatter(morpher, crange=(1.0, 100.0), n_test_thetas=1000): """ Visualizes a morphing basis and morphing errors with scatter plots between each pair of operators. Parameters ---------- morpher : PhysicsMorpher PhysicsMorpher instance with defined basis. crange : tuple of float, optional Range `(min, max)` for the color map. Default value: (1. 100.). n_test_thetas : int, optional Number of random points evaluated. Default value: 1000. Returns ------- figure : Figure Plot as Matplotlib Figure instance. """ basis = morpher.basis assert basis is not None, "No basis defined" n_parameters = basis.shape[1] # Get squared weights thetas, squared_weights = morpher.evaluate_morphing(n_test_thetas=n_test_thetas, return_weights_and_thetas=True) # Plot fig = plt.figure(figsize=((n_parameters - 1) * 5.0, (n_parameters - 1) * 4.0)) for iy in range(1, n_parameters): for ix in range(0, iy): i_panel = 1 + (iy - 1) * (n_parameters - 1) + ix ax = plt.subplot(n_parameters - 1, n_parameters - 1, i_panel) sc = plt.scatter( thetas[:, ix], thetas[:, iy], c=squared_weights, s=20.0, norm=matplotlib.colors.LogNorm(vmin=crange[0], vmax=crange[1]), cmap="viridis_r", ) cbar = fig.colorbar(sc, ax=ax, extend="both") plt.scatter(basis[:, ix], basis[:, iy], s=100.0, lw=1.0, edgecolor="black", c="white") plt.xlabel(r"$\theta_" + str(ix) + "$") plt.ylabel(r"$\theta_" + str(iy) + "$") cbar.set_label(r"$\sqrt{\sum w_i^2}$") plt.tight_layout() return fig def plot_nd_morphing_basis_slices(morpher, crange=(1.0, 100.0), resolution=50): """ Visualizes a morphing basis and morphing errors with two-dimensional slices through parameter space. Parameters ---------- morpher : PhysicsMorpher PhysicsMorpher instance with defined basis. crange : tuple of float, optional Range `(min, max)` for the color map. resolution : int, optional Number of points per panel and axis for the rendering of the squared morphing weights. Default value: 50. Returns ------- figure : Figure Plot as Matplotlib Figure instance. """ basis = morpher.basis assert basis is not None, "No basis defined" n_parameters = basis.shape[1] # Plot fig = plt.figure(figsize=((n_parameters - 1) * 5.0, (n_parameters - 1) * 4.0)) for iy in range(1, n_parameters): for ix in range(0, iy): i_panel = 1 + (iy - 1) * (n_parameters - 1) + ix ax = plt.subplot(n_parameters - 1, n_parameters - 1, i_panel) # Grid xrange = morpher.parameter_range[ix] yrange = morpher.parameter_range[iy] xi = np.linspace(xrange[0], xrange[1], resolution) yi = np.linspace(yrange[0], yrange[1], resolution) xx, yy = np.meshgrid(xi, yi) xx, yy = xx.flatten(), yy.flatten() theta_test = np.zeros((resolution ** 2, n_parameters)) theta_test[:, ix] = xx theta_test[:, iy] = yy # Get squared weights squared_weights = [] for theta in theta_test: wi = morpher.calculate_morphing_weights(theta, None) squared_weights.append(np.sum(wi * wi) ** 0.5) squared_weights = np.array(squared_weights).reshape((resolution, resolution)) pcm = ax.pcolormesh( xi, yi, squared_weights, norm=matplotlib.colors.LogNorm(vmin=crange[0], vmax=crange[1]), cmap="viridis_r", ) cbar = fig.colorbar(pcm, ax=ax, extend="both") plt.scatter(basis[:, ix], basis[:, iy], s=100.0, lw=1.0, edgecolor="black", c="white") plt.xlabel(r"$\theta_" + str(ix) + "$") plt.ylabel(r"$\theta_" + str(iy) + "$") cbar.set_label(r"$\sqrt{\sum w_i^2}$") plt.tight_layout() return fig
30.054945
116
0.599391
1,098
8,205
4.384335
0.14663
0.049439
0.024927
0.024927
0.822185
0.809098
0.775239
0.724969
0.706273
0.698587
0
0.030142
0.268129
8,205
272
117
30.165441
0.771524
0.299939
0
0.553719
0
0
0.068303
0
0
0
0
0
0.049587
1
0.033058
false
0
0.033058
0
0.099174
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
78e84a3a923eaf156fe09b709af1233ccb4ae967
23,115
py
Python
Final_Project/source code/TicTacToeGUI.py
taoyichen/CS110-Assignments-Python
f2e4e485c820b835981e2e4b8bd0a26cc31cfe73
[ "MIT" ]
null
null
null
Final_Project/source code/TicTacToeGUI.py
taoyichen/CS110-Assignments-Python
f2e4e485c820b835981e2e4b8bd0a26cc31cfe73
[ "MIT" ]
null
null
null
Final_Project/source code/TicTacToeGUI.py
taoyichen/CS110-Assignments-Python
f2e4e485c820b835981e2e4b8bd0a26cc31cfe73
[ "MIT" ]
1
2020-06-06T08:21:18.000Z
2020-06-06T08:21:18.000Z
#Author: Yichen Tao from tkinter import * from tkinter import messagebox from tkinter import simpledialog from tictactoe import * class TicTacToeGUI: def __init__(self): self.__game_new = TicTacToe() self.__game_new.set_name_cross_player("No name1") self.__game_new.set_name_oval_player("No name2") self.__root_window = Tk() #self.set_init_gamer() self.__set_up_GUI() self.set_init_gamer() #self.__game_new = TicTacToe() #self.__game_new.set_name_cross_player("Need attention") self.__root_window.mainloop() def __set_up_GUI(self): #self.__set_init_gamer() #self.set_init_gamer() self.__top_name_frame = Frame(self.__root_window) self.__middle_name_frame = Frame(self.__root_window) self.__bottom_name_frame = Frame(self.__root_window) self.__bottom_playing_frame = Frame(self.__root_window) self.__bottom_game_board_frame = Frame(self.__root_window) #self.__game_new.set_name_cross_player("Need attention") self.__cross_player_name_var = StringVar() self.__cross_player_name_var.set(self.__game_new.get_name_cross_player()) self.__oval_player_name_var = StringVar() self.__oval_player_name_var.set(self.__game_new.get_name_oval_player()) self.__initiative_name_var = StringVar() self.__initiative_name_var.set("No name1") self.__playing_player_name_var = StringVar() self.__playing_player_name_var.set("No name1") self.__cross_player_label = Label(self.__top_name_frame,text = "Cross : ") self.__cross_player_name_label = Label(self.__top_name_frame,textvariable = self.__cross_player_name_var) self.__cross_name_set_button = Button(self.__top_name_frame,text = "SET NAME") self.__cross_name_set_button['command'] = self.set_name_cross self.__oval_player_label = Label(self.__middle_name_frame,text = "Oval : ") self.__oval_player_name_label = Label(self.__middle_name_frame,textvariable = self.__oval_player_name_var) self.__oval_name_set_button = Button(self.__middle_name_frame,text = "SET NAME") self.__oval_name_set_button['command'] = self.set_name_oval self.__initiative_player_label = Label(self.__bottom_name_frame,text = "Initiative : ") self.__initiative_player_name_label = Label(self.__bottom_name_frame,textvariable = self.__initiative_name_var) self.__initiative_name_set_button = Button(self.__bottom_name_frame,text = "SET INITIATIVE") self.__initiative_name_set_button['command'] = self.set_init_gamer self.__playing_player_label = Label(self.__bottom_playing_frame,text = "PLAYING : ") self.__playing_player_name_label = Label(self.__bottom_playing_frame,textvariable = self.__playing_player_name_var) canvas_width = 40 canvas_height = 40 canvas_bg_1 = "#%02x%02x%02x"%(0,43,54) canvas_bg_2 ="#%02x%02x%02x"%(42,161,152) self.__top_left = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__top_left['bg'] = canvas_bg_1 self.__top_left.bind("<Button-1>", self.set_top_left) ## test = self.__top_left.create_oval(33, 33, 10, 10,width = 5,outline = "red") ## self.__top_left.delete(test) self.__top_middle = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__top_middle['bg'] = canvas_bg_2 self.__top_middle.bind("<Button-1>", self.set_top_middle) #self.__top_middle.create_line(5,5,38,38,width = 5,fill = 'red') #self.__top_middle.create_line(5,38,38,5,width = 5,fill = 'red') self.__top_right = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__top_right['bg'] = canvas_bg_1 self.__top_right.bind("<Button-1>", self.set_top_right) self.__middle_left = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__middle_left['bg'] = canvas_bg_2 self.__middle_left.bind("<Button-1>", self.set_middle_left) self.__middle_middle = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__middle_middle['bg'] = canvas_bg_1 self.__middle_middle.bind("<Button-1>", self.set_middle_middle) self.__middle_right = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__middle_right['bg'] = canvas_bg_2 self.__middle_right.bind("<Button-1>", self.set_middle_right) self.__bottom_left = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__bottom_left['bg'] = canvas_bg_1 self.__bottom_left.bind("<Button-1>", self.set_bottom_left) self.__bottom_middle = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__bottom_middle['bg'] = canvas_bg_2 self.__bottom_middle.bind("<Button-1>", self.set_bottom_middle) self.__bottom_right = Canvas(self.__bottom_game_board_frame, width=canvas_width, height=canvas_height) self.__bottom_right['bg'] = canvas_bg_1 self.__bottom_right.bind("<Button-1>", self.set_bottom_right) self.__cross_player_label.grid(row = 2,column = 0) self.__cross_player_name_label.grid(row = 2,column = 1) self.__cross_name_set_button.grid(row = 2, column = 2) self.__oval_player_label.grid(row = 2,column = 0) self.__oval_player_name_label.grid(row = 2,column = 1) self.__oval_name_set_button.grid(row = 2, column = 2) self.__initiative_player_label.grid(row = 2,column = 0) self.__initiative_player_name_label.grid(row = 2,column = 1) self.__initiative_name_set_button.grid(row = 2, column = 2) self.__playing_player_label.grid(row = 2,column = 0) self.__playing_player_name_label.grid(row = 2,column = 1) self.__top_left.grid(row = 0, column =0) self.__top_middle.grid(row = 0, column =1) self.__top_right.grid(row = 0, column =2) self.__middle_left.grid(row = 1, column =0) self.__middle_middle.grid(row = 1, column =1) self.__middle_right.grid(row = 1, column =2) self.__bottom_left.grid(row = 2, column =0) self.__bottom_middle.grid(row = 2, column =1) self.__bottom_right.grid(row = 2, column =2) self.__top_name_frame.pack() self.__middle_name_frame.pack() self.__bottom_name_frame.pack() self.__bottom_playing_frame.pack() self.__bottom_game_board_frame.pack() def set_top_left(self,event): #print("KKKKKKKKKK") #print() board_now = self.__game_new.get_game_board() if not board_now[0]: #print("Empty") if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") top_left_line1 = self.__top_left.create_line(5,5,38,38,width = 5,fill = 'red') top_left_line2 = self.__top_left.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: top_left_oval = self.__top_left.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(0) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: #print("step1") if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): print("step2") self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: #print("step3") self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_top_middle(self,event): board_now = self.__game_new.get_game_board() if not board_now[1]: #print("KKKKKKKKKK") #print() if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") top_middle_line1 = self.__top_middle.create_line(5,5,38,38,width = 5,fill = 'red') top_middle_line2 = self.__top_middle.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: top_middle_oval = self.__top_middle.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(1) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_top_right(self,event): board_now = self.__game_new.get_game_board() if not board_now[2]: #print("KKKKKKKKKK") #print() if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") top_right_line1 = self.__top_right.create_line(5,5,38,38,width = 5,fill = 'red') top_right_line2 = self.__top_right.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: top_right_oval = self.__top_right.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(2) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_middle_left(self,event): board_now = self.__game_new.get_game_board() if not board_now[3]: #print("KKKKKKKKKK") #print() if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") middle_left_line1 = self.__middle_left.create_line(5,5,38,38,width = 5,fill = 'red') middle_left_line2 = self.__middle_left.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: middle_left_oval = self.__middle_left.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(3) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_middle_middle(self,event): board_now = self.__game_new.get_game_board() if not board_now[4]: #print("KKKKKKKKKK") #print() if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") middle_middle_line1 = self.__middle_middle.create_line(5,5,38,38,width = 5,fill = 'red') middle_middle_line2 = self.__middle_middle.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: middle_middle_oval = self.__middle_middle.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(4) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_middle_right(self,event): board_now = self.__game_new.get_game_board() if not board_now[5]: #print("KKKKKKKKKK") #print() if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") middle_right_line1 = self.__middle_right.create_line(5,5,38,38,width = 5,fill = 'red') middle_right_line2 = self.__middle_right.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: middle_right_oval = self.__middle_right.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(5) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_bottom_left(self,event): board_now = self.__game_new.get_game_board() if not board_now[6]: #print("KKKKKKKKKK") #print() if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") bottom_left_line1 = self.__bottom_left.create_line(5,5,38,38,width = 5,fill = 'red') bottom_left_line2 = self.__bottom_left.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: bottom_left_oval = self.__bottom_left.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(6) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_bottom_middle(self,event): board_now = self.__game_new.get_game_board() if not board_now[7]: #print("KKKKKKKKKK") #print() if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") bottom_middle_line1 = self.__bottom_middle.create_line(5,5,38,38,width = 5,fill = 'red') bottom_middle_line2 = self.__bottom_middle.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: bottom_middle_oval = self.__bottom_middle.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(7) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_bottom_right(self,event): board_now = self.__game_new.get_game_board() if not board_now[8]: #print("KKKKKKKKKK") #print() if self.__playing_player_name_var.get() == self.__game_new.get_name_cross_player(): #print("OOOOOO") bottom_right_line1 = self.__bottom_right.create_line(5,5,38,38,width = 5,fill = 'red') bottom_right_line2 = self.__bottom_right.create_line(5,38,38,5,width = 5,fill = 'red') #print("PPPPPPPPPPPPPPP") else: bottom_right_oval = self.__bottom_right.create_oval(33, 33, 10, 10,width = 5,outline = "red") self.__game_new.play_game(8) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) results = self.__game_new.check_game_status() if results[0]: if results[1] == self.__game_new.CROSS: messagebox.showinfo("Congratulations",self.__game_new.get_name_cross_player()+" is the winner!") else: messagebox.showinfo("Congratulations",self.__game_new.get_name_oval_player()+" is the winner!") self.reset() #print(str(self.__game_new)) elif self.check_if_tie(board_now): messagebox.showinfo("Congratulations","Game is over, no one is the winner") self.reset() def set_init_gamer(self): self.__game_new.set_initiative_player() self.__initiative_name_var.set(self.__game_new.get_initiative_player()) player = self.__game_new.get_inner_count() if player == 0: self.__playing_player_name_var.set(self.__game_new.get_initiative_player()) else: if self.__game_new.get_initiative_player() == self.__game_new.get_name_cross_player(): self.__playing_player_name_var.set(self.__game_new.get_name_oval_player()) else: self.__playing_player_name_var.set(self.__game_new.get_name_cross_player()) def check_if_tie(self,game_board): count = 0 for item in game_board: if item: count+=1 if count == 9: answer = True else: answer = False return answer def set_name_cross(self): cross_name = simpledialog.askstring("Enter name","Enter name of people using cross.",parent = self.__root_window) if not (cross_name == self.__game_new.get_name_oval_player()): self.__game_new.set_name_cross_player(cross_name) self.__cross_player_name_var.set(self.__game_new.get_name_cross_player()) else: messagebox.showerror("Error","Do not input same names.") def reset(self): self.__game_new.reset() self.__top_left.delete(ALL) self.__top_middle.delete(ALL) self.__top_right.delete(ALL) self.__middle_left.delete(ALL) self.__middle_middle.delete(ALL) self.__middle_right.delete(ALL) self.__bottom_left.delete(ALL) self.__bottom_middle.delete(ALL) self.__bottom_right.delete(ALL) def set_name_oval(self): oval_name = simpledialog.askstring("Enter name","Enter name of people using oval.",parent = self.__root_window) if not (oval_name == self.__game_new.get_name_cross_player()): self.__game_new.set_name_oval_player(oval_name) self.__oval_player_name_var.set(self.__game_new.get_name_oval_player()) else: messagebox.showerror("Error","Do not input same names.") if __name__ == "__main__": TicTacToeGUI()
47.077393
119
0.704175
3,315
23,115
4.369834
0.041931
0.082839
0.113144
0.099544
0.873464
0.830802
0.750863
0.736711
0.717796
0.69902
0
0.020615
0.175254
23,115
490
120
47.173469
0.739247
0.057538
0
0.529563
0
0
0.067805
0
0
0
0
0
0
1
0.041131
false
0
0.010283
0
0.056555
0.002571
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
60292f6b88d6d00e5b5f042250a22a1db21fc964
186
py
Python
Django_UCSD/Registration/admin.py
yotohoshi/UCSDweb_design
eb6e9b61b78b33456c083bb3cb910b00fd527665
[ "MIT" ]
null
null
null
Django_UCSD/Registration/admin.py
yotohoshi/UCSDweb_design
eb6e9b61b78b33456c083bb3cb910b00fd527665
[ "MIT" ]
null
null
null
Django_UCSD/Registration/admin.py
yotohoshi/UCSDweb_design
eb6e9b61b78b33456c083bb3cb910b00fd527665
[ "MIT" ]
null
null
null
from django.contrib import admin from Registration.models import AccountManager, Account # Register your models here. # admin.site.register(AccountManager) admin.site.register(Account)
26.571429
55
0.827957
23
186
6.695652
0.565217
0.116883
0.220779
0
0
0
0
0
0
0
0
0
0.096774
186
6
56
31
0.916667
0.333333
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
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
60467701e46d7d52630c8400d74ef1675ca9dcba
78
py
Python
py_tdlib/constructors/notification_group_type_mentions.py
Mr-TelegramBot/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
24
2018-10-05T13:04:30.000Z
2020-05-12T08:45:34.000Z
py_tdlib/constructors/notification_group_type_mentions.py
MrMahdi313/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
3
2019-06-26T07:20:20.000Z
2021-05-24T13:06:56.000Z
py_tdlib/constructors/notification_group_type_mentions.py
MrMahdi313/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
5
2018-10-05T14:29:28.000Z
2020-08-11T15:04:10.000Z
from ..factory import Type class notificationGroupTypeMentions(Type): pass
13
42
0.807692
8
78
7.875
0.875
0
0
0
0
0
0
0
0
0
0
0
0.128205
78
5
43
15.6
0.926471
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
6
60700c2b40027a0fadb18aa778a09335a19debe6
138
py
Python
src/reactivestate/__init__.py
k-groenbroek/reactivestate
c228085dc2ca014c4aae4216e655f9cfa1d59fc5
[ "MIT" ]
null
null
null
src/reactivestate/__init__.py
k-groenbroek/reactivestate
c228085dc2ca014c4aae4216e655f9cfa1d59fc5
[ "MIT" ]
null
null
null
src/reactivestate/__init__.py
k-groenbroek/reactivestate
c228085dc2ca014c4aae4216e655f9cfa1d59fc5
[ "MIT" ]
null
null
null
from .api.observable import observable from .api.computed import computed from .api.observe import observe from .api.action import action
27.6
38
0.826087
20
138
5.7
0.35
0.245614
0
0
0
0
0
0
0
0
0
0
0.115942
138
4
39
34.5
0.934426
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
60790ee51eb5360c605853759324156dc486761f
15
py
Python
lab1/es3/main.py
haraldmeister/Programming_for_IoT_applications
04ec13689caee1fca28bf4fb6a261c318ebd374d
[ "Apache-2.0" ]
null
null
null
lab1/es3/main.py
haraldmeister/Programming_for_IoT_applications
04ec13689caee1fca28bf4fb6a261c318ebd374d
[ "Apache-2.0" ]
null
null
null
lab1/es3/main.py
haraldmeister/Programming_for_IoT_applications
04ec13689caee1fca28bf4fb6a261c318ebd374d
[ "Apache-2.0" ]
null
null
null
import json
5
12
0.666667
2
15
5
1
0
0
0
0
0
0
0
0
0
0
0
0.333333
15
2
13
7.5
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
60b99ebe839d6c97ddf58cab3cdaffe8ef4eb6b2
140
py
Python
success/views.py
gtoffoli/commons-success
fcd2b5fe9ebdc592841e6fe0e07a1d80c7284295
[ "Apache-2.0" ]
null
null
null
success/views.py
gtoffoli/commons-success
fcd2b5fe9ebdc592841e6fe0e07a1d80c7284295
[ "Apache-2.0" ]
null
null
null
success/views.py
gtoffoli/commons-success
fcd2b5fe9ebdc592841e6fe0e07a1d80c7284295
[ "Apache-2.0" ]
null
null
null
from django.http import HttpResponse, HttpResponseRedirect def home(request): return HttpResponseRedirect('/project/success-erasmus/')
28
60
0.807143
14
140
8.071429
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.1
140
4
61
35
0.896825
0
0
0
0
0
0.178571
0.178571
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
6
60bad5cdcdf6fa5b5cabd96d20730737067804bd
4,611
py
Python
core/semantic_test.py
zilON/hayaku
18feb81a6801513f6fbddb5eb537d8a15d64bd67
[ "MIT" ]
null
null
null
core/semantic_test.py
zilON/hayaku
18feb81a6801513f6fbddb5eb537d8a15d64bd67
[ "MIT" ]
null
null
null
core/semantic_test.py
zilON/hayaku
18feb81a6801513f6fbddb5eb537d8a15d64bd67
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import unittest from probe import hayaku_extract class SematicAbbrTests(unittest.TestCase): def test_0(self): self.assertEqual(hayaku_extract('fs'), 'font-size') def test_1(self): self.assertEqual(hayaku_extract('fst'), 'font-style') def test_2(self): self.assertEqual(hayaku_extract('w1'), 'width: 1px') def test_3(self): self.assertEqual(hayaku_extract('w1p'), 'width: 1px') def test_4(self): self.assertEqual(hayaku_extract('w1px'), 'width: 1px') def test_5(self): self.assertEqual(hayaku_extract('w1.1'), 'width: 1.1em') def test_6(self): self.assertEqual(hayaku_extract('w.1'), 'width: .1em') def test_7(self): self.assertEqual(hayaku_extract('w1.0'), 'width: 1em') def test_8(self): self.assertEqual(hayaku_extract('w1.'), 'width: 1em') def test_9(self): self.assertEqual(hayaku_extract('w1e'), 'width: 1em') def test_10(self): self.assertEqual(hayaku_extract('m-1'), 'margin: -1px') def test_11(self): self.assertEqual(hayaku_extract('m-.1'), 'margin: -.1em') def test_12(self): self.assertEqual(hayaku_extract('m0'), 'margin: 0') def test_13(self): self.assertEqual(hayaku_extract('m0.0'), 'margin: 0') def test_14(self): self.assertEqual(hayaku_extract('m-0.0'), 'margin: 0') def test_15(self): self.assertEqual(hayaku_extract('h1.100'), 'height: 1.1em') def test_16(self): self.assertEqual(hayaku_extract('p1m'), 'padding: 1mm') def test_17(self): self.assertEqual(hayaku_extract('p1%'), 'padding: 1%') def test_18(self): self.assertEqual(hayaku_extract('p.23pe'), 'padding: .23%') def test_19(self): self.assertEqual(hayaku_extract('p2.p'), 'padding: 2px') def test_20(self): self.assertEqual(hayaku_extract('p2.3p'), 'padding: 2.3px') def test_21(self): self.assertEqual(hayaku_extract('p3x'), 'padding: 3ex') def test_22(self): self.assertEqual(hayaku_extract('p3w'), 'padding: 3vw') def test_23(self): self.assertEqual(hayaku_extract('p3h'), 'padding: 3vh') def test_24(self): self.assertEqual(hayaku_extract('p3c'), 'padding: 3ch') def test_25(self): self.assertEqual(hayaku_extract('p3r'), 'padding: 3rem') def test_26(self): self.assertEqual(hayaku_extract('p3i'), 'padding: 3in') def test_27(self): self.assertEqual(hayaku_extract('p3t'), 'padding: 3pt') def test_28(self): self.assertEqual(hayaku_extract('b2'), 'bottom: 2px') def test_29(self): self.assertEqual(hayaku_extract('bd2'), 'border: 2px') def test_30(self): self.assertEqual(hayaku_extract('bw'), 'border-width: 2px') def test_31(self): self.assertEqual(hayaku_extract('blw'), 'border-left-width: 2px') def test_32(self): self.assertEqual(hayaku_extract('bdF'), 'border: #FFF') def test_33(self): self.assertEqual(hayaku_extract('bdF'), 'border: #FFF') def test_34(self): self.assertEqual(hayaku_extract('bd#0'), 'border: #000') def test_35(self): self.assertEqual(hayaku_extract('baF'), 'background: #FFF') def test_36(self): self.assertEqual(hayaku_extract('ba#f'), 'background: #FFF') def test_37(self): self.assertEqual(hayaku_extract('ba3'), 'background: #333') def test_38(self): self.assertEqual(hayaku_extract('ba3p'), 'background: 3px') def test_39(self): self.assertEqual(hayaku_extract('c00'), 'color: #000') def test_40(self): self.assertEqual(hayaku_extract('c02'), 'color: #000') def test_41(self): self.assertEqual(hayaku_extract('z1'), 'zoom: 1') def test_42(self): self.assertEqual(hayaku_extract('zi1'), 'z-index: 1') def test_43(self): self.assertEqual(hayaku_extract('zi-4'), 'z-index: -4') def test_44(self): self.assertEqual(hayaku_extract('fs4'), 'font-size: 4px') def test_issue_83_1(self): self.assertEqual(hayaku_extract('co'), 'color') def test_issue_83_2(self): self.assertEqual(hayaku_extract('con'), 'content') def test_issue_83_3(self): self.assertEqual(hayaku_extract('conn'), 'content: normal;') def test_issue_76_1(self): self.assertEqual(hayaku_extract('text-decoration'), 'text-decoration') def test_issue_76_2(self): self.assertEqual(hayaku_extract('border'), 'border') if __name__ == '__main__': unittest.main()
29
78
0.635437
601
4,611
4.677205
0.241265
0.235859
0.337958
0.444682
0.611526
0.259338
0.092494
0.064746
0.036286
0.036286
0
0.052803
0.199089
4,611
158
79
29.183544
0.708367
0.004554
0
0.019048
0
0
0.168701
0
0
0
0
0
0.47619
1
0.47619
false
0
0.019048
0
0.504762
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
0
0
0
0
1
0
0
6
880f42db95f8ec0bc3b663981c73826157fefa94
2,625
py
Python
Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_phone_numbers.py
Irrelevances/Recognizers-Text
630ce12bb47e201f663d72c31c680f6d40171962
[ "MIT" ]
null
null
null
Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_phone_numbers.py
Irrelevances/Recognizers-Text
630ce12bb47e201f663d72c31c680f6d40171962
[ "MIT" ]
null
null
null
Python/libraries/recognizers-sequence/recognizers_sequence/resources/base_phone_numbers.py
Irrelevances/Recognizers-Text
630ce12bb47e201f663d72c31c680f6d40171962
[ "MIT" ]
null
null
null
# ------------------------------------------------------------------------------ # <auto-generated> # This code was generated by a tool. # Changes to this file may cause incorrect behavior and will be lost if # the code is regenerated. # </auto-generated> # ------------------------------------------------------------------------------ # pylint: disable=line-too-long class BasePhoneNumbers: NumberReplaceToken = '@builtin.phonenumber' GeneralPhoneNumberRegex = f'(\\b(((\\d[\\s]?){{7,15}}\\d))(?!-)\\b)|(\\(\\d{{5}}\\)\\s?\\d{{5,6}})|\\+\\d{{2}}\\(\\d\\)\\d{{10}}' BRPhoneNumberRegex = f'(((\\B\\(\\s?))\\d{{2,3}}(\\s?\\))|(\\b\\d{{2,3}}))\\s?\\d{{4,5}}-?\\d{{3,5}}(?!-)\\b' UKPhoneNumberRegex = f'(((\\b(00)|\\B\\+)\\s?)?(\\b\\d{{2}}\\s?)?((\\s?\\(0\\)[-\\s]?|\\b|(?<=(\\b^#)\\d{{2}}))\\d{{2,5}}|\\(0\\d{{3,4}}\\))[/-]?\\s?(\\d{{5,8}}|\\d{{3,4}}[-\\s]?\\d{{3,4}})(?!-)\\b)' DEPhoneNumberRegex = f'((\\+\\d{{2}}\\s?((\\(0\\))?\\d\\s?)?|\\b)(\\d{{2,4}}\\s?[-/]?[\\s\\d]{{7,10}}\\d)(?!-)\\b)' USPhoneNumberRegex = f'((((\\B\\+)|\\b)1(\\s|-)?)|\\b)?(\\d{{3}}\\)[-\\s]?|\\(\\d{{3}}\\)[-\\s]?|\\b\\d{{3}}\\s?[-\\.]?\\s?)\\d{{3}}\\s?[-\\.]?\\s?\\d{{4}}(\\s?(x|X|ext)\\s?\\d{{3,5}})?(?!(-\\s?\\d))\\b' CNPhoneNumberRegex = f'((\\b00\\s?)?\\+?86\\s?-?\\s?)?(((\\b|(?<=86))\\d{{2,5}}\\s?-?\\s?|\\(\\d{{2,5}}\\)\\s?)\\d{{4}}\\s?-?\\s?\\d{{4}}(\\s?-?\\s?\\d{{4}})?|(\\b|(?<=86))\\d{{3}}\\s?-?\\s?\\d{{4}}\\s?-?\\s?\\d{{4}})(?!-)\\b' DKPhoneNumberRegex = f'((\\(\\s?(\\+\\s?|00)45\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|\\b00)45\\s?)|\\b)(\\s?\\(0\\)\\s?)?((\\d{{8}})|(\\d{{4}}\\s?-?\\s?\\d{{4,6}})|((\\d{{2}}[\\s-]){{3}}\\d{{2}})|(\\d{{2}}\\s?-?\\s?\\d{{3}}\\s?-?\\s?\\d{{3}}))(?!-)\\b' ITPhoneNumberRegex = f'((\\(\\s?(\\+\\s?|00)39\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|\\b00)39\\s?)|\\b)((0[\\d\\s-]{{4,12}}\\d)|(3[\\d\\s-]{{7,12}}\\d))(?!-)\\b' NLPhoneNumberRegex = f'((((\\(\\s?(\\+\\s?|00)31\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|\\b00)31\\s?))?(((\\b|(?<=31))0?\\d{{1,3}}|\\(\\s?0?\\d{{1,3}}\\s?\\)|\\(0\\)[-\\s]?\\d{{1,3}})\\s?-?[\\d\\s]{{5,11}}\\d))|\\b\\d{{10,12}})(?!-)\\b' SpecialPhoneNumberRegex = f'\\b(\\d{{3,4}}[/-]\\d{{1,4}}[/-]\\d{{3,4}})\\b' TypicalDeductionRegexList = ['^\\d{3}-\\d{2}-\\d{4}$', '^\\d{5}-\\d{4}$'] PhoneNumberMaskRegex = f'([0-9A-E]{{2}}(\\s[0-9A-E]{{2}}){{7}})' CountryCodeRegex = f'^(\\(\\s?(\\+\\s?|00)\\d{{1,3}}\\s?\\)|(\\+\\s?|00)\\d{{1,3}})' AreaCodeIndicatorRegex = f'\\(' FormatIndicatorRegex = f'(\\s|-|/|\\.)+' SpecialBoundaryMarkers = ['-', ' '] BoundaryMarkers = ['-', '.', '/', '+', '#', '*'] # pylint: enable=line-too-long
87.5
248
0.351238
382
2,625
2.413613
0.204188
0.056399
0.045553
0.02603
0.12039
0.079176
0.042299
0.019523
0.019523
0
0
0.062834
0.072381
2,625
29
249
90.517241
0.315811
0.149714
0
0
1
0.631579
0.725473
0.69847
0
0
0
0
0
1
0
false
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
6
7180d498d9ab482d82ca2bff31f2f58b020bc1bb
347
py
Python
tests/plots/test_dependence.py
santanaangel/shap
1c1c4a45440f3475b8544251f9d9e5b43977cd0e
[ "MIT" ]
13
2019-07-04T11:40:24.000Z
2021-09-10T09:54:36.000Z
tests/plots/test_dependence.py
santanaangel/shap
1c1c4a45440f3475b8544251f9d9e5b43977cd0e
[ "MIT" ]
3
2022-02-13T19:32:27.000Z
2022-02-27T09:45:10.000Z
tests/plots/test_dependence.py
santanaangel/shap
1c1c4a45440f3475b8544251f9d9e5b43977cd0e
[ "MIT" ]
10
2019-09-09T13:56:49.000Z
2021-10-01T20:08:35.000Z
import matplotlib import numpy as np matplotlib.use('Agg') import shap def test_random_dependence(): shap.dependence_plot(0, np.random.randn(20, 5), np.random.randn(20, 5), show=False) def test_random_dependence_no_interaction(): shap.dependence_plot(0, np.random.randn(20, 5), np.random.randn(20, 5), show=False, interaction_index=None)
34.7
111
0.763689
56
347
4.571429
0.410714
0.125
0.203125
0.234375
0.46875
0.46875
0.46875
0.46875
0.46875
0.46875
0
0.044872
0.100865
347
10
111
34.7
0.775641
0
0
0
0
0
0.008621
0
0
0
0
0
0
1
0.25
true
0
0.375
0
0.625
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
6
71ceba7eae281bb4aa1a2acce189dcbfcb6a7674
16,016
py
Python
tests/test_pyPodcastParser.py
iheartradio/pyPodcastParser
23545d487299ce1c5059f34f73dc87f72eb0172b
[ "MIT" ]
null
null
null
tests/test_pyPodcastParser.py
iheartradio/pyPodcastParser
23545d487299ce1c5059f34f73dc87f72eb0172b
[ "MIT" ]
1
2020-07-15T15:19:01.000Z
2020-07-15T15:19:01.000Z
tests/test_pyPodcastParser.py
iheartradio/pyPodcastParser
23545d487299ce1c5059f34f73dc87f72eb0172b
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import datetime import os import unittest from pypodcastparser import Podcast # py.test test_pypodcastparser.py ####### # coverage run --source pypodcastparser -m py.test ####### # py.test --cov=pypodcastparser tests/ ####### # py.test -v --capture=sys tests/test_pypodcastparser.py class TestTest(unittest.TestCase): def test_loading_sample_data(self): self.assertEqual(True, True) class TestValidRSSCheck(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'itunes_block_podcast.rss') basic_podcast_file = open(basic_podcast_path, "rb") self.basic_podcast = basic_podcast_file.read() self.podcast = Podcast.Podcast(self.basic_podcast) class TestInvalidRSSCheck(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'missing_info_podcast.rss') basic_podcast_file = open(basic_podcast_path, "rb") self.basic_podcast = basic_podcast_file.read() self.podcast = Podcast.Podcast(self.basic_podcast) class TestBasicFeedItemBlocked(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'itunes_block_podcast.rss') basic_podcast_file = open(basic_podcast_path, "rb") self.basic_podcast = basic_podcast_file.read() self.podcast = Podcast.Podcast(self.basic_podcast) def test_item_itunes_block(self): self.assertEqual(self.podcast.itunes_block, True) def test_item_itunes_explicit(self): self.assertEqual(self.podcast.items[0].itunes_explicit, "yes") self.assertEqual(self.podcast.items[1].itunes_explicit, "highly offensive") class TestBasicFeedItems(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'basic_podcast.rss') basic_podcast_file = open(basic_podcast_path, "rb") self.basic_podcast = basic_podcast_file.read() self.podcast = Podcast.Podcast(self.basic_podcast) def test_item_count(self): number_of_items = len(self.podcast.items) self.assertEqual(number_of_items, 2) def test_item_description(self): self.assertEqual(self.podcast.items[0].description, "basic item description") self.assertEqual(self.podcast.items[1].description, "another basic item description") def test_item_author(self): self.assertEqual(self.podcast.items[0].author, "lawyer@boyer.net") self.assertEqual(self.podcast.items[1].author, "lawyer@boyer.net (Lawyer Boyer)") def test_item_itunes_author(self): self.assertEqual(self.podcast.items[0].itunes_author_name, "basic item itunes author") self.assertEqual(self.podcast.items[1].itunes_author_name, "another basic item itunes author") def test_item_itunes_block(self): self.assertEqual(self.podcast.itunes_block, False) def test_item_itunes_duration(self): self.assertEqual(self.podcast.items[0].itunes_duration, "1:05") self.assertEqual(self.podcast.items[1].itunes_duration, "1:11:05") def test_item_itunes_explicit(self): self.assertEqual(self.podcast.items[0].itunes_explicit, "no") self.assertEqual(self.podcast.items[1].itunes_explicit, "clean") def test_item_itunes_order(self): self.assertEqual(self.podcast.items[0].itunes_order, "2") self.assertEqual(self.podcast.items[1].itunes_order, "1") def test_item_itunes_subtitle(self): self.assertEqual(self.podcast.items[0].itunes_subtitle, "The Subtitle") self.assertEqual(self.podcast.items[1].itunes_subtitle, "Another Subtitle") def test_item_itunes_summary(self): self.assertEqual(self.podcast.items[0].itunes_summary, "The Summary") self.assertEqual(self.podcast.items[1].itunes_summary, "Another Summary") def test_item_enclosure_url(self): self.assertEqual(self.podcast.items[0].enclosure_url, 'https://github.com/iheartradio/pyPodcastParser.mp3') def test_item_enclosure_type(self): self.assertEqual(self.podcast.items[0].enclosure_type, 'audio/mpeg') def test_item_enclosure_length(self): self.assertEqual(self.podcast.items[0].enclosure_length, 123456) def test_item_guid(self): self.assertEqual(self.podcast.items[0].guid, 'basic item guid') self.assertEqual(self.podcast.items[1].guid, 'another basic item guid') def test_item_published_date(self): self.assertTrue(isinstance(self.podcast.items[1].date_time, datetime.date)) def test_item_title(self): self.assertEqual(self.podcast.items[0].title, "basic item title") self.assertEqual(self.podcast.items[1].title, "another basic item title") class TestBasicFeed(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'basic_podcast.rss') basic_podcast_file = open(basic_podcast_path, "rb") self.basic_podcast = basic_podcast_file.read() self.podcast = Podcast.Podcast(self.basic_podcast) def test_loding_of_basic_podcast(self): self.assertIsNotNone(self.basic_podcast) def test_dict(self): feed_dict = self.podcast.to_dict() self.assertTrue(type(feed_dict) is dict) def test_copyright(self): self.assertEqual(self.podcast.copyright, "basic copyright") def test_description(self): self.assertEqual(self.podcast.description, "basic description") def test_image(self): self.assertEqual(self.podcast.image_url, "https://test/giffy.jpg") def test_itunes_author_name(self): self.assertEqual(self.podcast.itunes_author_name, "basic itunes author") def test_itunes_block(self): self.assertEqual(self.podcast.itunes_block, False) def test_itunes_categories(self): self.assertTrue("News" in self.podcast.itunes_categories) self.assertTrue("Business News" in self.podcast.itunes_categories) self.assertTrue("Health" in self.podcast.itunes_categories) def test_itunes_explicit(self): self.assertEqual(self.podcast.itunes_explicit, "clean") def test_itunes_complete(self): self.assertEqual(self.podcast.itunes_complete, "yes") def test_itunes_image(self): self.assertEqual(self.podcast.itunes_image, "https://github.com/iheartradio/pyPodcastParser.jpg") def test_itunes_categories_length(self): number_of_categories = len(self.podcast.itunes_categories) self.assertEqual(number_of_categories, 3) def test_itunes_keywords(self): self.assertTrue("Python" in self.podcast.itunes_keywords) self.assertTrue("Testing" in self.podcast.itunes_keywords) def test_itunes_keyword_length(self): number_of_keywords = len(self.podcast.itunes_keywords) self.assertEqual(number_of_keywords, 2) def test_itunes_new_feed_url(self): self.assertEqual(self.podcast.itunes_new_feed_url, "http://newlocation.com/example.rss") def test_language(self): self.assertEqual(self.podcast.language, "basic language") def test_last_build_date(self): self.assertEqual(self.podcast.last_build_date, "Mon, 24 Mar 2008 23:30:07 GMT") def test_link(self): self.assertEqual(self.podcast.link, "https://github.com/iheartradio/pyPodcastParser") def test_published_date(self): self.assertEqual(self.podcast.published_date, "Mon, 24 Mar 2008 23:30:07 GMT") def test_owner_name(self): self.assertEqual(self.podcast.owner_name, "basic itunes owner name") def test_owner_email(self): self.assertEqual(self.podcast.owner_email, "basic itunes owner email") def test_subtitle(self): self.assertEqual(self.podcast.subtitle, "basic itunes subtitle") def test_summary(self): self.assertEqual(self.podcast.summary, "basic itunes summary") def test_summary(self): self.assertEqual(self.podcast.summary, "basic itunes summary") def test_title(self): self.assertEqual(self.podcast.title, "basic title") def test_time_published(self): self.assertTrue(isinstance(self.podcast.date_time, datetime.date)) class TestKeywordVariability(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'keyword_variability.rss') keyword_variability_file = open(basic_podcast_path, "rb") self.podcast = Podcast.Podcast(keyword_variability_file.read()) def test_keywords(self): self.assertEqual(sorted(self.podcast.itunes_keywords), ['Python', 'Testing']) class TestKeywordAbsence(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'no_keywords.rss') no_keywords = open(basic_podcast_path, "rb") self.podcast = Podcast.Podcast(no_keywords.read()) def test_keywords(self): self.assertEqual(self.podcast.itunes_keywords, []) class TestUnicodeFeed(unittest.TestCase): def setUp(self): self.unicodeish_text = u"ℐℑℒℓ℔✕✖✗✘⨒⨓ㄏㄐ㐆㐇㐈㐉蘿螺ﻛﻜﻝﻞ𝀏𝀐𝀑𝀒𝀓ǫǬǭǮǯǰΑΒΓΔΕΖΗΘɥɦɧखगڙښڛ" test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'unicode_podcast.rss') basic_podcast_file = open(basic_podcast_path, "rb") self.basic_podcast = basic_podcast_file.read() self.podcast = Podcast.Podcast(self.basic_podcast) def test_loding_of_basic_podcast(self): self.assertIsNotNone(self.basic_podcast) def test_copyright(self): self.assertEqual(self.podcast.copyright, self.unicodeish_text) def test_description(self): self.assertEqual(self.podcast.description, self.unicodeish_text) def test_itunes_author_name(self): self.assertEqual(self.podcast.itunes_author_name, self.unicodeish_text) def test_itunes_block(self): self.assertEqual(self.podcast.itunes_block, False) def test_itunes_categories(self): self.assertTrue(self.unicodeish_text in self.podcast.itunes_categories) self.assertTrue(self.unicodeish_text in self.podcast.itunes_categories) def test_itunes_image(self): self.assertEqual(self.podcast.itunes_image, self.unicodeish_text) def test_itunes_categories_length(self): number_of_categories = len(self.podcast.itunes_categories) self.assertEqual(number_of_categories, 2) def test_itunes_keyword_length(self): number_of_keywords = len(self.podcast.itunes_keywords) self.assertEqual(number_of_keywords, 1) def test_itunes_new_feed_url(self): self.assertEqual(self.podcast.itunes_new_feed_url, self.unicodeish_text) def test_language(self): self.assertEqual(self.podcast.language, self.unicodeish_text) def test_last_build_date(self): self.assertEqual(self.podcast.last_build_date, self.unicodeish_text) def test_link(self): self.assertEqual(self.podcast.link, self.unicodeish_text) def test_owner_name(self): self.assertEqual(self.podcast.owner_name, self.unicodeish_text) def test_owner_email(self): self.assertEqual(self.podcast.owner_email, self.unicodeish_text) def test_subtitle(self): self.assertEqual(self.podcast.subtitle, self.unicodeish_text) def test_summary(self): self.assertEqual(self.podcast.summary, self.unicodeish_text) def test_summary(self): self.assertEqual(self.podcast.summary, self.unicodeish_text) def test_title(self): self.assertEqual(self.podcast.title, self.unicodeish_text) class TestMissingInfoFeed(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join(test_feeds_dir, 'missing_info_podcast.rss') basic_podcast_file = open(basic_podcast_path, "rb") self.basic_podcast = basic_podcast_file.read() self.podcast = Podcast.Podcast(self.basic_podcast) def test_loding_of_basic_podcast(self): self.assertIsNotNone(self.basic_podcast) def test_copyright(self): self.assertEqual(self.podcast.copyright, None) def test_description(self): self.assertEqual(self.podcast.description, None) def test_image(self): self.assertEqual(self.podcast.image_url, None) def test_itunes_author_name(self): self.assertEqual(self.podcast.itunes_author_name, None) def test_itunes_block(self): self.assertEqual(self.podcast.itunes_block, False) def test_itunes_categories(self): self.assertFalse("News" in self.podcast.itunes_categories) self.assertFalse("Health" in self.podcast.itunes_categories) def test_itunes_explicit(self): self.assertEqual(self.podcast.itunes_explicit, None) def test_itunes_complete(self): self.assertEqual(self.podcast.itunes_complete, None) def test_itunes_image(self): self.assertEqual(self.podcast.itunes_image, None) def test_itunes_categories_length(self): number_of_categories = len(self.podcast.itunes_categories) self.assertEqual(number_of_categories, 0) def test_itunes_keyword_length(self): number_of_keywords = len(self.podcast.itunes_keywords) self.assertEqual(number_of_keywords, 0) def test_itunes_new_feed_url(self): self.assertEqual(self.podcast.itunes_new_feed_url, None) def test_language(self): self.assertEqual(self.podcast.language, None) def test_last_build_date(self): self.assertEqual(self.podcast.last_build_date, None) def test_link(self): self.assertEqual(self.podcast.link, None) def test_published_date(self): self.assertEqual(self.podcast.published_date, None) def test_owner_name(self): self.assertEqual(self.podcast.owner_name, None) def test_owner_email(self): self.assertEqual(self.podcast.owner_email, None) def test_subtitle(self): self.assertEqual(self.podcast.subtitle, None) def test_summary(self): self.assertEqual(self.podcast.summary, None) def test_summary(self): self.assertEqual(self.podcast.summary, None) def test_title(self): self.assertEqual(self.podcast.title, None) def test_time_published(self): self.assertIsNone(self.podcast.date_time) class TestItunesBlockFeed(unittest.TestCase): def setUp(self): test_dir = os.path.dirname(__file__) test_feeds_dir = os.path.join(test_dir, 'test_feeds') basic_podcast_path = os.path.join( test_feeds_dir, 'itunes_block_podcast.rss') basic_podcast_file = open(basic_podcast_path, "rb") self.basic_podcast = basic_podcast_file.read() self.podcast = Podcast.Podcast(self.basic_podcast) def test_itunes_block(self): self.assertEqual(self.podcast.itunes_block, True) def test_itunes_explicit(self): self.assertEqual(self.podcast.itunes_explicit, "yes") if __name__ == '__main__': unittest.main()
36.988453
115
0.714036
2,058
16,016
5.292031
0.078231
0.115141
0.144798
0.198145
0.815995
0.787256
0.750987
0.712882
0.659719
0.577817
0
0.0057
0.178384
16,016
432
116
37.074074
0.821035
0.012238
0
0.533333
0
0
0.078516
0.012221
0
0
0
0
0.36
1
0.34
false
0
0.013333
0
0.39
0
0
0
0
null
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
6
e085c00cd7dd3bcf2030ad2845a511202300013d
43
py
Python
python_solutions/sum whole number.py
ersincebi/hackerrank
9475c8e88e9071544c10a939fe7307c8e62fe3a0
[ "MIT" ]
null
null
null
python_solutions/sum whole number.py
ersincebi/hackerrank
9475c8e88e9071544c10a939fe7307c8e62fe3a0
[ "MIT" ]
null
null
null
python_solutions/sum whole number.py
ersincebi/hackerrank
9475c8e88e9071544c10a939fe7307c8e62fe3a0
[ "MIT" ]
null
null
null
n = 123456 print(sum(map(int,str(12345))))
14.333333
31
0.674419
8
43
3.625
1
0
0
0
0
0
0
0
0
0
0
0.282051
0.093023
43
3
31
14.333333
0.461538
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
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
1
0
6
e09e8e6f92e85e3a94d6b3d1e2b9995680f40aeb
105
py
Python
rl_botics/common/__init__,py.py
Suman7495/rl-botics
79423ead1fea8ab08eab74c5dc3ae51c4c96a0ac
[ "MIT" ]
18
2019-05-05T09:10:59.000Z
2021-09-20T05:47:22.000Z
rl_botics/common/__init__,py.py
Suman7495/rl-botics
79423ead1fea8ab08eab74c5dc3ae51c4c96a0ac
[ "MIT" ]
null
null
null
rl_botics/common/__init__,py.py
Suman7495/rl-botics
79423ead1fea8ab08eab74c5dc3ae51c4c96a0ac
[ "MIT" ]
6
2020-01-21T13:51:02.000Z
2021-01-16T09:09:34.000Z
from .approximators import * from .data_collection import * from .logger import * from .policies import *
26.25
30
0.780952
13
105
6.230769
0.538462
0.37037
0
0
0
0
0
0
0
0
0
0
0.142857
105
4
31
26.25
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
e0c18d5a8c686c3ac1c55bc3e7b4cd6e4790dba3
14,059
py
Python
tests/providers/google/marketing_platform/hooks/test_display_video.py
wegamekinglc/incubator-airflow
fc174635b0729253a86e8c877d6d8551a815a2cb
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
7
2018-11-19T12:05:13.000Z
2020-01-17T08:30:38.000Z
tests/providers/google/marketing_platform/hooks/test_display_video.py
wegamekinglc/incubator-airflow
fc174635b0729253a86e8c877d6d8551a815a2cb
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
4
2021-06-28T20:57:42.000Z
2022-02-26T02:11:11.000Z
tests/providers/google/marketing_platform/hooks/test_display_video.py
wegamekinglc/incubator-airflow
fc174635b0729253a86e8c877d6d8551a815a2cb
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
1
2021-03-03T01:44:08.000Z
2021-03-03T01:44:08.000Z
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. from unittest import TestCase, mock from airflow.providers.google.marketing_platform.hooks.display_video import GoogleDisplayVideo360Hook from tests.providers.google.cloud.utils.base_gcp_mock import mock_base_gcp_hook_default_project_id API_VERSION = "v1" GCP_CONN_ID = "google_cloud_default" class TestGoogleDisplayVideo360Hook(TestCase): def setUp(self): with mock.patch( "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.__init__", new=mock_base_gcp_hook_default_project_id, ): self.hook = GoogleDisplayVideo360Hook(gcp_conn_id=GCP_CONN_ID) @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook._authorize" ) @mock.patch("airflow.providers.google.marketing_platform.hooks.display_video.build") def test_gen_conn(self, mock_build, mock_authorize): result = self.hook.get_conn() mock_build.assert_called_once_with( "doubleclickbidmanager", API_VERSION, http=mock_authorize.return_value, cache_discovery=False, ) assert mock_build.return_value == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook._authorize" ) @mock.patch("airflow.providers.google.marketing_platform.hooks.display_video.build") def test_get_conn_to_display_video(self, mock_build, mock_authorize): result = self.hook.get_conn_to_display_video() mock_build.assert_called_once_with( "displayvideo", API_VERSION, http=mock_authorize.return_value, cache_discovery=False, ) assert mock_build.return_value == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_create_query(self, get_conn_mock): body = {"body": "test"} return_value = "TEST" get_conn_mock.return_value.queries.return_value.createquery.return_value.execute.return_value = ( return_value ) result = self.hook.create_query(query=body) get_conn_mock.return_value.queries.return_value.createquery.assert_called_once_with(body=body) assert return_value == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_delete_query(self, get_conn_mock): query_id = "QUERY_ID" return_value = "TEST" get_conn_mock.return_value.queries.return_value.deletequery.return_value.execute.return_value = ( return_value ) self.hook.delete_query(query_id=query_id) get_conn_mock.return_value.queries.return_value.deletequery.assert_called_once_with(queryId=query_id) @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_get_query(self, get_conn_mock): query_id = "QUERY_ID" return_value = "TEST" get_conn_mock.return_value.queries.return_value.getquery.return_value.execute.return_value = ( return_value ) result = self.hook.get_query(query_id=query_id) get_conn_mock.return_value.queries.return_value.getquery.assert_called_once_with(queryId=query_id) assert return_value == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_list_queries(self, get_conn_mock): queries = ["test"] return_value = {"queries": queries} get_conn_mock.return_value.queries.return_value.listqueries.return_value.execute.return_value = ( return_value ) result = self.hook.list_queries() get_conn_mock.return_value.queries.return_value.listqueries.assert_called_once_with() assert queries == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_run_query(self, get_conn_mock): query_id = "QUERY_ID" params = {"params": "test"} self.hook.run_query(query_id=query_id, params=params) get_conn_mock.return_value.queries.return_value.runquery.assert_called_once_with( queryId=query_id, body=params ) @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_download_line_items_should_be_called_once(self, get_conn_mock): request_body = { "filterType": "filter_type", "filterIds": [], "format": "format", "fileSpec": "file_spec", } self.hook.download_line_items(request_body=request_body) get_conn_mock.return_value.lineitems.return_value.downloadlineitems.assert_called_once() @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_download_line_items_should_be_called_with_params(self, get_conn_mock): request_body = { "filterType": "filter_type", "filterIds": [], "format": "format", "fileSpec": "file_spec", } self.hook.download_line_items(request_body=request_body) get_conn_mock.return_value.lineitems.return_value.downloadlineitems.assert_called_once_with( body=request_body ) @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_download_line_items_should_return_equal_values(self, get_conn_mock): line_item = ["holy_hand_grenade"] response = {"lineItems": line_item} request_body = { "filterType": "filter_type", "filterIds": [], "format": "format", "fileSpec": "file_spec", } # fmt: off get_conn_mock.return_value.lineitems.return_value \ .downloadlineitems.return_value.execute.return_value = response # fmt: on result = self.hook.download_line_items(request_body) assert line_item == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_upload_line_items_should_be_called_once(self, get_conn_mock): line_items = ["this", "is", "super", "awesome", "test"] self.hook.upload_line_items(line_items) get_conn_mock.return_value.lineitems.return_value.uploadlineitems.assert_called_once() @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_upload_line_items_should_be_called_with_params(self, get_conn_mock): line_items = "I spent too much time on this" request_body = { "lineItems": line_items, "dryRun": False, "format": "CSV", } self.hook.upload_line_items(line_items) get_conn_mock.return_value.lineitems.return_value.uploadlineitems.assert_called_once_with( body=request_body ) @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn" ) def test_upload_line_items_should_return_equal_values(self, get_conn_mock): line_items = {"lineItems": "string", "format": "string", "dryRun": False} return_value = "TEST" # fmt: off get_conn_mock.return_value.lineitems.return_value \ .uploadlineitems.return_value.execute.return_value = return_value # fmt: on result = self.hook.upload_line_items(line_items) assert return_value == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn_to_display_video" ) def test_create_sdf_download_tasks_called_with_params(self, get_conn_to_display_video): body_request = { "version": "version", "partnerId": "partner_id", "advertiserId": "advertiser_id", "parentEntityFilter": "parent_entity_filter", "idFilter": "id_filter", "inventorySourceFilter": "inventory_source_filter", } self.hook.create_sdf_download_operation(body_request=body_request) get_conn_to_display_video.return_value.sdfdownloadtasks.return_value.create.assert_called_once_with( body=body_request ) @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn_to_display_video" ) def test_create_sdf_download_tasks_called_once(self, get_conn_to_display_video): body_request = { "version": "version", "partnerId": "partner_id", "advertiserId": "advertiser_id", "parentEntityFilter": "parent_entity_filter", "idFilter": "id_filter", "inventorySourceFilter": "inventory_source_filter", } self.hook.create_sdf_download_operation(body_request=body_request) get_conn_to_display_video.return_value.sdfdownloadtasks.return_value.create.assert_called_once() @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn_to_display_video" ) def test_create_sdf_download_tasks_return_equal_values(self, get_conn_to_display_video): response = ["name"] body_request = { "version": "version", "partnerId": "partner_id", "advertiserId": "advertiser_id", "parentEntityFilter": "parent_entity_filter", "idFilter": "id_filter", "inventorySourceFilter": "inventory_source_filter", } # fmt: off get_conn_to_display_video.return_value. \ sdfdownloadtasks.return_value. \ create.return_value \ .execute.return_value = response # fmt: on result = self.hook.create_sdf_download_operation(body_request=body_request) assert response == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn_to_display_video" ) def test_get_sdf_download_tasks_called_with_params(self, get_conn_to_display_video): operation_name = "operation_name" self.hook.get_sdf_download_operation(operation_name=operation_name) # fmt: off get_conn_to_display_video.return_value. \ sdfdownloadtasks.return_value. \ operations.return_value. \ get.assert_called_once_with(name=operation_name) # fmt: on @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn_to_display_video" ) def test_get_sdf_download_tasks_called_once(self, get_conn_to_display_video): operation_name = "name" self.hook.get_sdf_download_operation(operation_name=operation_name) # fmt: off get_conn_to_display_video.return_value. \ sdfdownloadtasks.return_value. \ operations.return_value. \ get.assert_called_once() # fmt: on @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn_to_display_video" ) def get_sdf_download_tasks_return_equal_values(self, get_conn_to_display_video): operation_name = "operation" response = "reposonse" get_conn_to_display_video.return_value.sdfdownloadtasks.return_value.operations.return_value.get = ( response ) result = self.hook.get_sdf_download_operation(operation_name=operation_name) assert operation_name == result @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn_to_display_video" ) def test_download_media_called_once(self, get_conn_to_display_video): resource_name = "resource_name" self.hook.download_media(resource_name=resource_name) get_conn_to_display_video.return_value.media.return_value.download_media.assert_called_once() @mock.patch( "airflow.providers.google.marketing_platform.hooks." "display_video.GoogleDisplayVideo360Hook.get_conn_to_display_video" ) def test_download_media_called_once_with_params(self, get_conn_to_display_video): resource_name = "resource_name" self.hook.download_media(resource_name=resource_name) get_conn_to_display_video.return_value.media.return_value.download_media.assert_called_once_with( resource_name=resource_name )
37.793011
109
0.694715
1,600
14,059
5.711875
0.121875
0.096291
0.032498
0.045519
0.838166
0.827005
0.809169
0.776124
0.763103
0.740125
0
0.007004
0.218081
14,059
371
110
37.894879
0.824343
0.059535
0
0.526316
0
0
0.256253
0.194179
0
0
0
0
0.091228
1
0.077193
false
0
0.010526
0
0.091228
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
1cd7b951f9f10be7ea5ecb729e824a292d06cc6b
101
py
Python
features/steps/data/src/fails_pyright.py
ldamewood/ly-python-tools
4c6e17357ddd0ce68dae539f4527ab3a40e58698
[ "MIT" ]
null
null
null
features/steps/data/src/fails_pyright.py
ldamewood/ly-python-tools
4c6e17357ddd0ce68dae539f4527ab3a40e58698
[ "MIT" ]
null
null
null
features/steps/data/src/fails_pyright.py
ldamewood/ly-python-tools
4c6e17357ddd0ce68dae539f4527ab3a40e58698
[ "MIT" ]
null
null
null
# pylint: disable=all # flake8: noqa def plus_one(x: int) -> int: return x + 1 plus_one("one")
12.625
28
0.623762
17
101
3.588235
0.705882
0.229508
0
0
0
0
0
0
0
0
0
0.025316
0.217822
101
7
29
14.428571
0.746835
0.316832
0
0
0
0
0.045455
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
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
1
0
0
0
1
1
0
0
6
e804eaf6ae03bac25998d7f8e9471cf3263e74e2
24
py
Python
mdfmodels/__init__.py
alexji/mdfmodels
4a1e7298d3f68e5bd0ef8372a6c201014eae0831
[ "MIT" ]
1
2021-01-05T19:19:23.000Z
2021-01-05T19:19:23.000Z
mdfmodels/__init__.py
alexji/mdfmodels
4a1e7298d3f68e5bd0ef8372a6c201014eae0831
[ "MIT" ]
null
null
null
mdfmodels/__init__.py
alexji/mdfmodels
4a1e7298d3f68e5bd0ef8372a6c201014eae0831
[ "MIT" ]
null
null
null
from mdfmodels import *
12
23
0.791667
3
24
6.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
24
1
24
24
0.95
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
e80b5dd74b8b6439ecc2f55c5a5505f803543e8f
969
py
Python
numpy_operation/merge.py
lyw615/code_accumulation
5b2a5c039a725def37e19f226906ed1087880118
[ "MIT" ]
3
2021-11-09T07:15:00.000Z
2021-12-11T06:30:47.000Z
numpy_operation/merge.py
lyw615/code_accumulation
5b2a5c039a725def37e19f226906ed1087880118
[ "MIT" ]
null
null
null
numpy_operation/merge.py
lyw615/code_accumulation
5b2a5c039a725def37e19f226906ed1087880118
[ "MIT" ]
null
null
null
import numpy as np def concatenate(): """ 数组的拼接,合并 np.append 虽然可读性好,灵活,但是内存占用大 np.concatenate则不会占内存大 Returns: """ """ >>> a array([0, 1, 2], [3, 4, 5], [6, 7, 8]) >>> b = a*2 >>> b array([ 0, 2, 4], [ 6, 8, 10], [12, 14, 16]) 水平组合,axis是1 ,需注意 >>> np.concatenate((a,b),axis=1) array([ 0, 1, 2, 0, 2, 4], [ 3, 4, 5, 6, 8, 10], [ 6, 7, 8, 12, 14, 16]) 垂直组合,axis是0 >>> np.concatenate((a,b),axis=0) array([ 0, 1, 2], [ 3, 4, 5], [ 6, 7, 8], [ 0, 2, 4], [ 6, 8, 10], [12, 14, 16]) 深度组合:沿着纵轴方向组合 >>> np.dstack((a,b)) array([[ 0, 0], [ 1, 2], [ 2, 4], [ 3, 6], [ 4, 8], [ 5, 10], [ 6, 12], [ 7, 14], [ 8, 16]]) """
18.634615
36
0.298246
121
969
2.38843
0.322314
0.103806
0.041522
0.083045
0.318339
0.186851
0.186851
0.186851
0.186851
0.096886
0
0.192547
0.501548
969
52
37
18.634615
0.405797
0.069143
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
0.5
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
6
1c4ef7c2a95417ca4d80e14f4b09d173daf099b7
36
py
Python
alexber/reqsync/__init__.py
alex-ber/PythonPackageSyncTool
07b970dd7cb752cb7dfebc9baa06ad0210dfe9c1
[ "BSD-2-Clause" ]
null
null
null
alexber/reqsync/__init__.py
alex-ber/PythonPackageSyncTool
07b970dd7cb752cb7dfebc9baa06ad0210dfe9c1
[ "BSD-2-Clause" ]
2
2019-10-22T06:37:48.000Z
2019-10-23T10:09:42.000Z
alexber/reqsync/__init__.py
alex-ber/PythonPackageSyncTool
07b970dd7cb752cb7dfebc9baa06ad0210dfe9c1
[ "BSD-2-Clause" ]
null
null
null
from alexber.reqsync.app import conf
36
36
0.861111
6
36
5.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.083333
36
1
36
36
0.939394
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
1c5906d9e23b4f83542ee5ff49b7d71a72d03c23
11,122
py
Python
test/test_opsgenie.py
djmgit/flask-opsgenie
1cdacbdfbd191c28950f5c07712882a265c987e5
[ "MIT" ]
null
null
null
test/test_opsgenie.py
djmgit/flask-opsgenie
1cdacbdfbd191c28950f5c07712882a265c987e5
[ "MIT" ]
9
2022-01-11T14:42:03.000Z
2022-03-30T06:45:28.000Z
test/test_opsgenie.py
djmgit/flask-opsgenie
1cdacbdfbd191c28950f5c07712882a265c987e5
[ "MIT" ]
null
null
null
from logging import exception import unittest from flask import Flask from unittest import mock from flask_opsgenie import opsgenie from flask_opsgenie.entities import OpsgenieAlertParams, AlertType from flask_opsgenie.opsgenie import make_opsgenie_api_request, raise_manual_alert from flask_opsgenie.opsgenie import (raise_opsgenie_status_alert, raise_opsgenie_latency_alert, raise_opsgenie_exception_alert, raise_opsgenie_alert) class TestOpsgenie(unittest.TestCase): def setUp(self): self.opsgenie_alert_params = OpsgenieAlertParams( opsgenie_token=mock.ANY, alert_tags=mock.ANY, alert_details={"service_id":"fake_service", "host": "test-host"}, alert_alias=None, alert_status_alias=None, alert_latency_alias=None, alert_exception_alias=None, alert_priority="P4", alert_responder=mock.ANY, opsgenie_api_base="https://dummy-opsgenie.com" ) @mock.patch('flask_opsgenie.opsgenie.requests.post') @mock.patch('flask_opsgenie.opsgenie.requests.get') def test_make_opsgenie_api_request(self, mock_get, mock_post): _ = make_opsgenie_api_request(http_verb="get", url=mock.ANY, payload=mock.ANY, opsgenie_token=mock.ANY) self.assertEqual(mock_get.call_count, 1) _ = make_opsgenie_api_request(http_verb="post", url=mock.ANY, payload=mock.ANY, opsgenie_token=mock.ANY) self.assertEqual(mock_post.call_count, 1) @mock.patch('flask_opsgenie.opsgenie.make_opsgenie_api_request') def test_raise_opsgenie_status_alert(self, mock_opsgenie_api_request): app = Flask(__name__) with app.test_client() as client: rv = client.get('/test/og_params') _ = raise_opsgenie_status_alert(alert_status_code=500, alert_status_class=None, opsgenie_alert_params=self.opsgenie_alert_params, response_status_code=500, extra_props={'test-key': 'test-value'}) self.assertEqual(self.opsgenie_alert_params.alert_details['endpoint'], '/test/og_params') self.assertEqual(self.opsgenie_alert_params.alert_details['method'], "GET") self.assertEqual(self.opsgenie_alert_params.alert_details['url'], 'http://localhost/test/og_params') self.assertEqual(self.opsgenie_alert_params.alert_details['status_code'], 500) self.assertEqual(self.opsgenie_alert_params.alert_details.get('status_class'), None) self.assertEqual(self.opsgenie_alert_params.alert_details.get('test-key'), 'test-value') self.assertEqual(self.opsgenie_alert_params.alert_status_alias, 'fake_service-/test/og_params-500') self.assertEqual(mock_opsgenie_api_request.call_count, 1) mock_opsgenie_api_request.assert_called_with( http_verb="post", url=f'{self.opsgenie_alert_params.opsgenie_api_base}/v2/alerts', payload=mock.ANY, opsgenie_token=self.opsgenie_alert_params.opsgenie_token ) @mock.patch('flask_opsgenie.opsgenie.make_opsgenie_api_request') def test_raise_opsgenie_latency_alert(self, mock_opsgenie_api_request): app = Flask(__name__) with app.test_client() as client: rv = client.get('/test/og_params') _ = raise_opsgenie_latency_alert(elapsed_time=2000, alert_status_code=500, opsgenie_alert_params=self.opsgenie_alert_params, extra_props={'test-key': 'test-value'}) self.assertEqual(self.opsgenie_alert_params.alert_details['endpoint'], '/test/og_params') self.assertEqual(self.opsgenie_alert_params.alert_details['method'], "GET") self.assertEqual(self.opsgenie_alert_params.alert_details['url'], 'http://localhost/test/og_params') self.assertEqual(self.opsgenie_alert_params.alert_details['status_code'], 500) self.assertEqual(self.opsgenie_alert_params.alert_details.get('status_class'), None) self.assertEqual(self.opsgenie_alert_params.alert_details.get('test-key'), 'test-value') self.assertEqual(self.opsgenie_alert_params.alert_latency_alias, 'fake_service-response-latency-alert') self.assertEqual(mock_opsgenie_api_request.call_count, 1) mock_opsgenie_api_request.assert_called_with( http_verb="post", url=f'{self.opsgenie_alert_params.opsgenie_api_base}/v2/alerts', payload=mock.ANY, opsgenie_token=self.opsgenie_alert_params.opsgenie_token ) @mock.patch('flask_opsgenie.opsgenie.make_opsgenie_api_request') @mock.patch('flask_opsgenie.opsgenie.traceback') @mock.patch('flask_opsgenie.opsgenie.Exception') def test_raise_opsgenie_exception_alert(self, mock_exception, mock_traceback, mock_opsgenie_api_request): mock_exception.__traceback__ = "" mock_traceback.format_exception.return_value = "" dummy_exception_class = "MagicMock" app = Flask(__name__) with app.test_client() as client: rv = client.get('/test/og_params') _ = raise_opsgenie_exception_alert(exception=mock_exception, opsgenie_alert_params=self.opsgenie_alert_params, extra_props={'test-key': 'test-value'}) self.assertEqual(self.opsgenie_alert_params.alert_details['endpoint'], '/test/og_params') self.assertEqual(self.opsgenie_alert_params.alert_details['method'], "GET") self.assertEqual(self.opsgenie_alert_params.alert_details['url'], 'http://localhost/test/og_params') self.assertEqual(self.opsgenie_alert_params.alert_details['exception'], str(mock_exception)) self.assertEqual(self.opsgenie_alert_params.alert_details.get('test-key'), 'test-value') self.assertEqual(self.opsgenie_alert_params.alert_exception_alias, f'fake_service-/test/og_params-{dummy_exception_class}') self.assertEqual(mock_opsgenie_api_request.call_count, 1) mock_opsgenie_api_request.assert_called_with( http_verb="post", url=f'{self.opsgenie_alert_params.opsgenie_api_base}/v2/alerts', payload=mock.ANY, opsgenie_token=self.opsgenie_alert_params.opsgenie_token ) @mock.patch('flask_opsgenie.opsgenie.make_opsgenie_api_request') @mock.patch('flask_opsgenie.opsgenie.traceback') @mock.patch('flask_opsgenie.opsgenie.Exception') def test_raise_manual_alert(self, mock_exception, mock_traceback, mock_opsgenie_api_request): mock_exception.__traceback__ = "" mock_traceback.format_exception.return_value = "" test_func_name = "test_func_name" dummy_exception_class = "MagicMock" app = Flask(__name__) with app.test_client() as client: rv = client.get('/test/og_params') _ = raise_manual_alert(exception=mock_exception, func_name=test_func_name, opsgenie_alert_params=self.opsgenie_alert_params, extra_props={'test-key': 'test-value'}) self.assertEqual(self.opsgenie_alert_params.alert_details['exception'], str(mock_exception)) self.assertEqual(self.opsgenie_alert_params.alert_details['Traceback'], "") self.assertEqual(self.opsgenie_alert_params.alert_details.get('test-key'), 'test-value') self.assertEqual(self.opsgenie_alert_params.alert_alias, f'fake_service-{test_func_name}-{dummy_exception_class}') self.assertEqual(mock_opsgenie_api_request.call_count, 1) mock_opsgenie_api_request.assert_called_with( http_verb="post", url=f'{self.opsgenie_alert_params.opsgenie_api_base}/v2/alerts', payload=mock.ANY, opsgenie_token=self.opsgenie_alert_params.opsgenie_token ) @mock.patch('flask_opsgenie.opsgenie.raise_opsgenie_status_alert') @mock.patch('flask_opsgenie.opsgenie.raise_opsgenie_latency_alert') @mock.patch('flask_opsgenie.opsgenie.raise_opsgenie_exception_alert') @mock.patch('flask_opsgenie.opsgenie.raise_manual_alert') def test_raise_opsgenie_alert(self, mock_raise_manual_alert, mock_opsgenie_exception_alert, mock_opsgenie_latency_alert, mock_opsgenie_status_alert): test_exception = mock.ANY test_status_code = 500 test_status_class = "5XX" test_elapsed_time = 2000 test_manual_exception = "test_exception" test_func_name = "test_func_name" _ = raise_opsgenie_alert(alert_type=AlertType.STATUS_ALERT, alert_status_code=test_status_code, elapsed_time = None, opsgenie_alert_params=self.opsgenie_alert_params, response_status_code=test_status_code) self.assertEqual(mock_opsgenie_status_alert.call_count, 1) mock_opsgenie_status_alert.assert_called_with( alert_status_code=test_status_code, opsgenie_alert_params=self.opsgenie_alert_params, response_status_code=test_status_code, extra_props=mock.ANY ) _ = raise_opsgenie_alert(alert_type=AlertType.STATUS_ALERT, alert_status_class=test_status_class, elapsed_time = None, opsgenie_alert_params=self.opsgenie_alert_params, response_status_code=test_status_code) self.assertEqual(mock_opsgenie_status_alert.call_count, 2) mock_opsgenie_status_alert.assert_called_with( alert_status_class=test_status_class, opsgenie_alert_params=self.opsgenie_alert_params, response_status_code=test_status_code, extra_props=mock.ANY ) _ = raise_opsgenie_alert(alert_type=AlertType.LATENCY_ALERT, alert_status_code=test_status_code, elapsed_time=test_elapsed_time, opsgenie_alert_params=self.opsgenie_alert_params) self.assertEqual(mock_opsgenie_latency_alert.call_count, 1) mock_opsgenie_latency_alert.assert_called_with( elapsed_time=test_elapsed_time, alert_status_code=test_status_code, opsgenie_alert_params=self.opsgenie_alert_params, extra_props=mock.ANY ) _ = raise_opsgenie_alert(alert_type=AlertType.EXCEPTION, exception=test_exception, opsgenie_alert_params=self.opsgenie_alert_params) self.assertEqual(mock_opsgenie_exception_alert.call_count, 1) mock_opsgenie_exception_alert.assert_called_with( exception=test_exception, opsgenie_alert_params=self.opsgenie_alert_params, extra_props=mock.ANY ) _ = raise_opsgenie_alert(alert_type=AlertType.MANUAL, exception=test_manual_exception, func_name=test_func_name, opsgenie_alert_params=self.opsgenie_alert_params) self.assertEqual(mock_raise_manual_alert.call_count, 1) mock_raise_manual_alert.assert_called_with( exception=test_manual_exception, opsgenie_alert_params=self.opsgenie_alert_params, func_name=test_func_name, extra_props=mock.ANY )
58.230366
207
0.715878
1,348
11,122
5.462908
0.066766
0.120043
0.157387
0.146795
0.818034
0.78585
0.738865
0.731668
0.711706
0.691065
0
0.005129
0.19358
11,122
190
208
58.536842
0.815922
0
0
0.520468
0
0
0.145657
0.089552
0
0
0
0
0.25731
1
0.040936
false
0
0.046784
0
0.093567
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
1c783050ba0a1c5f34e41ddafb90444ccff1c0ba
251
py
Python
shps/admin.py
acdh-oeaw/histogis
cbe90e17a7e4f26849c7b97f453833e094d445b2
[ "MIT" ]
10
2018-12-08T09:34:33.000Z
2022-02-16T02:47:53.000Z
shps/admin.py
acdh-oeaw/histogis
cbe90e17a7e4f26849c7b97f453833e094d445b2
[ "MIT" ]
31
2018-08-28T15:40:12.000Z
2022-02-15T13:03:44.000Z
shps/admin.py
acdh-oeaw/histogis
cbe90e17a7e4f26849c7b97f453833e094d445b2
[ "MIT" ]
null
null
null
from django.contrib.gis import admin from leaflet.admin import LeafletGeoAdmin from .models import * admin.site.register(Source, LeafletGeoAdmin) admin.site.register(TempSpatial, LeafletGeoAdmin) admin.site.register(TempStatialRel, LeafletGeoAdmin)
27.888889
52
0.840637
29
251
7.275862
0.482759
0.127962
0.241706
0.303318
0
0
0
0
0
0
0
0
0.079681
251
8
53
31.375
0.91342
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
1c95ddf0e8487935c3a6042de58d79eab29dbb34
80
py
Python
nid_validator/egyptian_validator/tests/__init__.py
mohamedmansor/Egyptian-national-ID-validator
59ce1f69c916611fb2565c028301353ce5ebd91f
[ "MIT" ]
null
null
null
nid_validator/egyptian_validator/tests/__init__.py
mohamedmansor/Egyptian-national-ID-validator
59ce1f69c916611fb2565c028301353ce5ebd91f
[ "MIT" ]
25
2021-01-05T03:48:11.000Z
2021-09-22T19:38:49.000Z
nid_validator/egyptian_validator/tests/__init__.py
mohamedmansor/Egyptian-national-ID-validator
59ce1f69c916611fb2565c028301353ce5ebd91f
[ "MIT" ]
null
null
null
from .integration_test import NIDTestAPI from .unit_test import TestNIDValidator
40
40
0.8875
10
80
6.9
0.7
0.289855
0
0
0
0
0
0
0
0
0
0
0.0875
80
2
41
40
0.945205
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
c7066015b2c7c9fe6a4d29640d1d2869dc9952fe
310
py
Python
functions/artificial_generation/__init__.py
hsokooti/RegNet
28a8b6132677bb58e9fc811c0dd15d78913c7e86
[ "Apache-2.0" ]
187
2018-01-08T11:37:12.000Z
2022-03-03T06:26:43.000Z
functions/artificial_generation/__init__.py
hsokooti/RegNet
28a8b6132677bb58e9fc811c0dd15d78913c7e86
[ "Apache-2.0" ]
15
2018-01-27T07:12:41.000Z
2021-08-22T12:37:30.000Z
functions/artificial_generation/__init__.py
hsokooti/RegNet
28a8b6132677bb58e9fc811c0dd15d78913c7e86
[ "Apache-2.0" ]
60
2018-01-09T13:00:32.000Z
2021-06-15T03:02:36.000Z
from . import dvf_generation from . import generate_read from . import intensity_augmentation from .generate_read import get_dvf_and_deformed_images from .generate_read import check_all_images_exist from .generate_read_seq import get_dvf_and_deformed_images_seq __version__ = "0.3.0" __author__ = "hsokooti"
28.181818
62
0.851613
46
310
5.152174
0.456522
0.202532
0.202532
0.185654
0.244726
0.244726
0
0
0
0
0
0.010791
0.103226
310
10
63
31
0.841727
0
0
0
1
0
0.041935
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
6
c71cb49e266ab04bb99c48f6d72fe03f236790a8
306
py
Python
fem/utilities/tables2/basic/__init__.py
mjredmond/FEMApp
dd8cc53acf80d0a1bb83ce9c89bcfd51e85c6be8
[ "MIT" ]
1
2019-08-03T21:40:26.000Z
2019-08-03T21:40:26.000Z
fem/utilities/tables2/basic/__init__.py
mjredmond/FEMApp
dd8cc53acf80d0a1bb83ce9c89bcfd51e85c6be8
[ "MIT" ]
null
null
null
fem/utilities/tables2/basic/__init__.py
mjredmond/FEMApp
dd8cc53acf80d0a1bb83ce9c89bcfd51e85c6be8
[ "MIT" ]
null
null
null
from ._basic_table_view import BasicTableView from ._basic_table_data import BasicTableData from ._basic_table_model import BasicTableModel from ._basic_table_data_list import BasicTableDataList from ._basic_table_widget import BasicTableWidget from ._basic_multi_table_widget import BasicMultiTableWidget
43.714286
60
0.901961
38
306
6.736842
0.421053
0.210938
0.273438
0.140625
0
0
0
0
0
0
0
0
0.078431
306
6
61
51
0.907801
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
c7358947bb15d6b53e1e71ff03bb770ca575185f
308
py
Python
python 2/koans/another_local_module.py
SEL-Columbia/python_koans
afb69f5d885d5ff73c8e98f7a611852d4471c070
[ "MIT" ]
4
2015-02-04T13:25:21.000Z
2017-08-02T17:04:02.000Z
python 2/koans/another_local_module.py
namsral/python_koans
976da9b5dcc8e9ff29db1da1fd8ab099c59a6690
[ "MIT" ]
null
null
null
python 2/koans/another_local_module.py
namsral/python_koans
976da9b5dcc8e9ff29db1da1fd8ab099c59a6690
[ "MIT" ]
10
2015-03-03T03:15:14.000Z
2020-03-24T11:09:34.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- class Goose(object): @property def name(self): return "Mr Stabby" class Hamster(object): @property def name(self): return "Phil" class _SecretSquirrel(object): @property def name(self): return "Mr Anonymous"
18.117647
30
0.594156
36
308
5.055556
0.583333
0.230769
0.28022
0.346154
0.532967
0.532967
0.362637
0
0
0
0
0.004464
0.272727
308
17
31
18.117647
0.808036
0.136364
0
0.5
0
0
0.09434
0
0
0
0
0
0
1
0.25
false
0
0
0.25
0.75
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
c751b719e685b855ae04d51f7d5f8338e2b9d376
52
py
Python
challenge_0/python/zooks97/src/helloWorld.py
rchicoli/2017-challenges
44f0b672e5dea34de1dde131b6df837d462f8e29
[ "Apache-2.0" ]
271
2017-01-01T22:58:36.000Z
2021-11-28T23:05:29.000Z
challenge_0/python/zooks97/src/helloWorld.py
AakashOfficial/2017Challenges
a8f556f1d5b43c099a0394384c8bc2d826f9d287
[ "Apache-2.0" ]
283
2017-01-01T23:26:05.000Z
2018-03-23T00:48:55.000Z
challenge_0/python/zooks97/src/helloWorld.py
AakashOfficial/2017Challenges
a8f556f1d5b43c099a0394384c8bc2d826f9d287
[ "Apache-2.0" ]
311
2017-01-01T22:59:23.000Z
2021-09-23T00:29:12.000Z
print("Hello, World!") #print hello world statement
26
51
0.75
7
52
5.571429
0.571429
0.512821
0.769231
0
0
0
0
0
0
0
0
0
0.115385
52
1
52
52
0.847826
0.519231
0
0
0
0
0.541667
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
6
c758b0e86a5becbd0ea8d5ae21f1df03ca4381cb
574
py
Python
deep_deformation/objects/skinning.py
vincentbonnetcg/DeepDeformation
cb3590586d1b2040d0096291c87fd789ecf0dfeb
[ "MIT" ]
5
2021-09-21T17:31:59.000Z
2022-01-28T07:02:32.000Z
deep_deformation/objects/skinning.py
vincentbonnetcg/DeepDeformation
cb3590586d1b2040d0096291c87fd789ecf0dfeb
[ "MIT" ]
null
null
null
deep_deformation/objects/skinning.py
vincentbonnetcg/DeepDeformation
cb3590586d1b2040d0096291c87fd789ecf0dfeb
[ "MIT" ]
1
2021-12-04T16:25:09.000Z
2021-12-04T16:25:09.000Z
""" @author: Vincent Bonnet @description : Skinning algorithms. Implement the Linear Blend Skinning (LBS) """ from deep_deformation.objects.skeleton_data import SkeletonData from deep_deformation.objects.skinning_data import SkinningData from deep_deformation.objects.clip_data import ClipData class Skinning: def __init__(self, skeleton_data : SkeletonData, skinning_data : SkinningData): self.skeleton_data = skeleton_data self.skinning_data = skinning_data def get_vertices_from_clip(self, clip_data : ClipData): # TODO pass
27.333333
83
0.766551
68
574
6.176471
0.441176
0.114286
0.135714
0.185714
0
0
0
0
0
0
0
0
0.16899
574
20
84
28.7
0.880503
0.186411
0
0
0
0
0
0
0
0
0
0.05
0
1
0.222222
false
0.111111
0.333333
0
0.666667
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
1
1
0
1
0
0
6
c7cf4a54d0b9c5ad64161e8c18a0dcc9ea70f610
45
py
Python
tree/parser/__init__.py
hiroara/tree-python
269c796cd8fbbedd9591faf573e21f167959c093
[ "MIT" ]
null
null
null
tree/parser/__init__.py
hiroara/tree-python
269c796cd8fbbedd9591faf573e21f167959c093
[ "MIT" ]
null
null
null
tree/parser/__init__.py
hiroara/tree-python
269c796cd8fbbedd9591faf573e21f167959c093
[ "MIT" ]
null
null
null
from .json_parser import parse as parse_json
22.5
44
0.844444
8
45
4.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.133333
45
1
45
45
0.923077
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
c7d1f906482106950fff78f04de77e77f95057c6
19,611
py
Python
tests/test_layers.py
p768lwy3/torecsys
2251366268b4fbe6f8c3ab1628fa72a0db043dcd
[ "MIT" ]
92
2019-08-15T11:03:50.000Z
2022-03-12T01:21:05.000Z
tests/test_layers.py
p768lwy3/torecsys
2251366268b4fbe6f8c3ab1628fa72a0db043dcd
[ "MIT" ]
3
2020-03-11T08:57:50.000Z
2021-01-06T01:39:47.000Z
tests/test_layers.py
p768lwy3/torecsys
2251366268b4fbe6f8c3ab1628fa72a0db043dcd
[ "MIT" ]
16
2019-10-12T11:28:53.000Z
2022-03-28T14:04:12.000Z
import unittest from math import comb import torch import torch.nn as nn from parameterized import parameterized from torch.nn import functional from torchinfo import summary from torecsys.layers import * device = 'cuda:0' if torch.cuda.is_available() else 'cpu' class AttentionalFactorizationMachineLayerTestCase(unittest.TestCase): @parameterized.expand([ (4, 2, 8, 1,), (16, 4, 16, 2,), (32, 4, 8, 4,), ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int, attn_size: int): # Initialize layer layer = AttentionalFactorizationMachineLayer( embed_size=embed_size, num_fields=num_fields, attn_size=attn_size, dropout_p=0.1 ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) # Forward outputs, attn_scores = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, embed_size)) self.assertEqual(attn_scores.size(), (batch_size, comb(num_fields, 2), 1)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') print(f'Attn Scores Size: {attn_scores.size()}, Attn Scores Dimensions: {attn_scores.names}') class BiasEncodingLayerTestCase(unittest.TestCase): @parameterized.expand([ (4, 32, 32, 256,), (16, 16, 32, 64,), (32, 8, 32, 128,), ]) def test_forward(self, batch_size: int, max_length: int, embed_size: int, max_num_session: int): layer = BiasEncodingLayer( embed_size=embed_size, max_num_session=max_num_session, max_length=max_length ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp_session_embed = torch.rand(batch_size, max_length, embed_size) inp_session_embed.names = ('B', 'L', 'E',) inp_position = torch.randint(0, max_length, (batch_size,), device=device, dtype=torch.long) inp_position.names = ('B',) # Forward outputs = layer.forward((inp_session_embed, inp_position)) self.assertEqual(outputs.size(), (batch_size, max_length, embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class BilinearNetworkLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128, 4), (16, 6, 64, 3), (32, 12, 8, 16) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int, num_layers: int): layer = BilinearNetworkLayer( inputs_size=embed_size, num_layers=num_layers ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, num_fields, embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class BilinearInteractionLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): layer = BilinearInteractionLayer( embed_size=embed_size, num_fields=num_fields, bilinear_type='all', bias=True ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, comb(num_fields, 2), embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class ComposeExcitationNetworkLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): layer = ComposeExcitationNetworkLayer( num_fields=num_fields, reduction=1, activation=nn.ReLU6() ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer field_aware_embed_inp = torch.rand(batch_size, num_fields ** 2, embed_size) field_aware_embed_inp.names = ('B', 'N', 'E',) inp_size = field_aware_embed_inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(field_aware_embed_inp) self.assertEqual(outputs.size(), (batch_size, num_fields ** 2, embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class CompressInteractionNetworkLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128, 4), (16, 6, 64, 8), (32, 12, 8, 16) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int, output_size: int): layer = CompressInteractionNetworkLayer( embed_size=embed_size, num_fields=num_fields, output_size=output_size, layer_sizes=[32, 64, 32], is_direct=False, use_bias=True, use_batchnorm=True, activation=nn.ReLU6() ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, output_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class CrossNetworkLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): layer = CrossNetworkLayer( inputs_size=embed_size, num_layers=4 ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, num_fields, embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class DynamicRoutingLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128, 4), (16, 6, 64, 8), (32, 12, 8, 16) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int, output_size: int): layer = DynamicRoutingLayer( embed_size=embed_size, routed_size=output_size, max_num_caps=16, num_iter=2 ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, layer.num_caps, output_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class FactorizationMachineLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): layer = FactorizationMachineLayer(dropout_p=0.9) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class FieldAwareFactorizationMachineLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): layer = FieldAwareFactorizationMachineLayer( num_fields=num_fields, dropout_p=0.9 ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields ** 2, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, comb(num_fields, 2), embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class InnerProductNetworkLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): layer = InnerProductNetworkLayer(num_fields=num_fields) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, comb(num_fields, 2))) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class MixtureOfExpertsLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): num_experts = 4 expert_output_size = 16 layer = MixtureOfExpertsLayer( inputs_size=embed_size * num_fields, output_size=expert_output_size * num_experts, num_experts=num_experts, expert_func=MultilayerPerceptionLayer, expert_inputs_size=embed_size * num_fields, expert_output_size=expert_output_size, expert_layer_sizes=[128, 64, 64] ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, 1, num_experts * expert_output_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class MultilayerPerceptionLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): output_size = 16 layer_sizes = [32, 32, 16] dropout_p = [0.9, 0.9, 0.9] layer = MultilayerPerceptionLayer( inputs_size=embed_size, output_size=output_size, layer_sizes=layer_sizes, dropout_p=dropout_p ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, num_fields, output_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class OuterProductNetworkLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): layer = OuterProductNetworkLayer( embed_size=embed_size, num_fields=num_fields, kernel_type='mat' ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, comb(num_fields, 2))) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class PositionEmbeddingLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, seq_length: int, embed_size: int): layer = PositionEmbeddingLayer(max_num_position=seq_length) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, seq_length, embed_size) inp.names = ('B', 'L', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, seq_length, embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class PositionBiasAwareLearningFrameworkLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, seq_length: int, embed_size: int): layer = PositionBiasAwareLearningFrameworkLayer( input_size=embed_size, max_num_position=seq_length ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp_0 = torch.rand(batch_size, embed_size) inp_0.names = ('B', 'E',) # inp_0_size = inp_0.size() inp_1 = torch.randint(0, seq_length, (batch_size,), device=device, dtype=torch.long) inp_1.names = ('B',) # inp_1_size = inp_1.size() # summary(layer, input_size=[inp_0_size, inp_1_size], device=device, dtypes=[torch.float, torch.long]) # Forward outputs = layer.forward((inp_0, inp_1,)) self.assertEqual(outputs.size(), (batch_size, embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class WideLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 4, 128), (16, 6, 64), (32, 12, 8) ]) def test_forward(self, batch_size: int, num_fields: int, embed_size: int): output_size = 16 dropout_p = 0.9 layer = WideLayer( inputs_size=embed_size, output_size=output_size, dropout_p=dropout_p ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, num_fields, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, num_fields, output_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class GeneralizedMatrixFactorizationLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 128), (16, 64), (32, 8) ]) def test_forward(self, batch_size: int, embed_size: int): layer = GeneralizedMatrixFactorizationLayer() layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, 2, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, 1)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') class StarSpaceLayerTestCase(unittest.TestCase): @parameterized.expand([ (8, 128), (16, 64), (32, 8) ]) def test_forward(self, batch_size: int, embed_size: int): layer = StarSpaceLayer( similarity=functional.cosine_similarity ) layer = layer.to(device) print(f'Input Size: {layer.inputs_size};\nOutput Size: {layer.outputs_size}') # Generate inputs for the layer inp = torch.rand(batch_size, 2, embed_size) inp.names = ('B', 'N', 'E',) inp_size = inp.size() summary(layer, input_size=[inp_size], device=device, dtypes=[torch.float]) # Forward outputs = layer.forward(inp) self.assertEqual(outputs.size(), (batch_size, embed_size)) print(f'Output Size: {outputs.size()}, Output Dimensions: {outputs.names}') if __name__ == '__main__': unittest.main()
35.656364
110
0.617409
2,374
19,611
4.917439
0.062763
0.052424
0.02921
0.056964
0.807692
0.777625
0.749957
0.743533
0.724516
0.713723
0
0.025447
0.252562
19,611
549
111
35.721311
0.770978
0.045434
0
0.673219
0
0
0.142903
0.029609
0
0
0
0
0.04914
1
0.046683
false
0
0.019656
0
0.113022
0.095823
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
1bfc731129e38d921c235b5310d9774c62888586
45
py
Python
roles/test/library/bar.py
sivel/ansible-role-plugins
76b3df6a4f6fd8b66074ac1db6d33cdc784c95db
[ "Apache-2.0" ]
null
null
null
roles/test/library/bar.py
sivel/ansible-role-plugins
76b3df6a4f6fd8b66074ac1db6d33cdc784c95db
[ "Apache-2.0" ]
null
null
null
roles/test/library/bar.py
sivel/ansible-role-plugins
76b3df6a4f6fd8b66074ac1db6d33cdc784c95db
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python print '{"action": "BAR"}'
11.25
25
0.577778
6
45
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
45
3
26
15
0.65
0.355556
0
0
0
0
0.607143
0
0
0
0
0
0
0
null
null
0
0
null
null
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
6
400585acb0d721f729023260df7d2337da4bc5e8
90
py
Python
Notebooks/tools/hypertriangle.py
sssleverlily/hyperNetworkZ
cc9c4828bf91d6bf8dbc4e73277c131ce45b2cf5
[ "MIT" ]
null
null
null
Notebooks/tools/hypertriangle.py
sssleverlily/hyperNetworkZ
cc9c4828bf91d6bf8dbc4e73277c131ce45b2cf5
[ "MIT" ]
null
null
null
Notebooks/tools/hypertriangle.py
sssleverlily/hyperNetworkZ
cc9c4828bf91d6bf8dbc4e73277c131ce45b2cf5
[ "MIT" ]
null
null
null
import hypernetx as hnx ''' 找到超三角形 ''' def hypertriangle(hg : hnx.Hypergraph): return
12.857143
39
0.7
11
90
5.727273
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.177778
90
7
40
12.857143
0.851351
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
6
40218142dd9f5932982fd90829268afc7f1fbb2d
265
py
Python
participant/managers.py
Arpit8081/Phishtray_Edited_Version
9f3342e6fd2620b7f01ad91ce5b36fa8ea111bc8
[ "MIT" ]
2
2020-03-31T12:38:10.000Z
2022-01-21T22:21:06.000Z
participant/managers.py
Arpit8081/Phishtray_Edited_Version
9f3342e6fd2620b7f01ad91ce5b36fa8ea111bc8
[ "MIT" ]
252
2018-05-24T14:55:24.000Z
2022-02-26T13:02:10.000Z
participant/managers.py
Arpit8081/Phishtray_Edited_Version
9f3342e6fd2620b7f01ad91ce5b36fa8ea111bc8
[ "MIT" ]
11
2018-06-23T14:54:42.000Z
2021-02-19T11:33:44.000Z
from django.db.models import Manager from .queryset import ParticipantQuerySet, OrganizationQuerySet class ParticipantManager(Manager.from_queryset(ParticipantQuerySet)): pass class OrganizationManager(Manager.from_queryset(OrganizationQuerySet)): pass
24.090909
71
0.837736
25
265
8.8
0.52
0.15
0.259091
0
0
0
0
0
0
0
0
0
0.101887
265
10
72
26.5
0.92437
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
6
4031e881708f5f6dc64b92fb98e77d0e12800a7b
17,202
py
Python
tests/integration/assignments/test_viewset.py
Intevation/OpenSlides
4495985d4c752d9e56d1011a4396a7cb444070a6
[ "MIT" ]
null
null
null
tests/integration/assignments/test_viewset.py
Intevation/OpenSlides
4495985d4c752d9e56d1011a4396a7cb444070a6
[ "MIT" ]
null
null
null
tests/integration/assignments/test_viewset.py
Intevation/OpenSlides
4495985d4c752d9e56d1011a4396a7cb444070a6
[ "MIT" ]
null
null
null
import pytest from django.contrib.auth import get_user_model from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient from openslides.assignments.models import Assignment from openslides.core.models import Tag from openslides.mediafiles.models import Mediafile from openslides.utils.autoupdate import inform_changed_data from openslides.utils.test import TestCase from ..helpers import count_queries @pytest.mark.django_db(transaction=False) def test_assignment_db_queries(): """ Tests that only the following db queries are done: * 1 requests to get the list of all assignments, * 1 request to get all related users, * 1 request to get the agenda item, * 1 request to get the polls, * 1 request to get the tags, * 1 request to get the attachments and * 10 request to fetch each related user again. TODO: The last requests are a bug. """ for index in range(10): Assignment.objects.create(title=f"assignment{index}", open_posts=1) assert count_queries(Assignment.get_elements) == 16 class CreateAssignment(TestCase): """ Tests basic creation of assignments. """ def setUp(self): self.client = APIClient() self.client.login(username="admin", password="admin") def test_simple(self): response = self.client.post( reverse("assignment-list"), {"title": "test_title_ef3jpF)M329f30m)f82", "open_posts": 1}, ) self.assertEqual(response.status_code, status.HTTP_201_CREATED) assignment = Assignment.objects.get() self.assertEqual(assignment.title, "test_title_ef3jpF)M329f30m)f82") def test_with_tags_and_mediafiles(self): Tag.objects.create(name="test_tag") Mediafile.objects.create( title="test_file", mediafile=SimpleUploadedFile("title.txt", b"content") ) response = self.client.post( reverse("assignment-list"), { "title": "test_title_ef3jpF)M329f30m)f82", "open_posts": 1, "tags_id": [1], "attachments_id": [1], }, ) self.assertEqual(response.status_code, status.HTTP_201_CREATED) assignment = Assignment.objects.get() self.assertEqual(assignment.title, "test_title_ef3jpF)M329f30m)f82") self.assertTrue(assignment.tags.exists()) self.assertTrue(assignment.attachments.exists()) class CanidatureSelf(TestCase): """ Tests self candidation view. """ def setUp(self): self.client.login(username="admin", password="admin") self.assignment = Assignment.objects.create( title="test_assignment_oikaengeijieh3ughiX7", open_posts=1 ) def test_nominate_self(self): response = self.client.post( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 200) self.assertTrue( Assignment.objects.get(pk=self.assignment.pk) .candidates.filter(username="admin") .exists() ) def test_nominate_self_twice(self): self.assignment.set_candidate(get_user_model().objects.get(username="admin")) response = self.client.post( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 200) self.assertTrue( Assignment.objects.get(pk=self.assignment.pk) .candidates.filter(username="admin") .exists() ) def test_nominate_self_when_finished(self): self.assignment.set_phase(Assignment.PHASE_FINISHED) self.assignment.save() response = self.client.post( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 400) def test_nominate_self_during_voting(self): self.assignment.set_phase(Assignment.PHASE_VOTING) self.assignment.save() response = self.client.post( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 200) self.assertTrue( Assignment.objects.get(pk=self.assignment.pk).candidates.exists() ) def test_nominate_self_during_voting_non_admin(self): self.assignment.set_phase(Assignment.PHASE_VOTING) self.assignment.save() admin = get_user_model().objects.get(username="admin") group_admin = admin.groups.get(name="Admin") group_delegates = type(group_admin).objects.get(name="Delegates") admin.groups.add(group_delegates) admin.groups.remove(group_admin) inform_changed_data(admin) response = self.client.post( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 403) def test_withdraw_self(self): self.assignment.set_candidate(get_user_model().objects.get(username="admin")) response = self.client.delete( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 200) self.assertFalse( Assignment.objects.get(pk=self.assignment.pk) .candidates.filter(username="admin") .exists() ) def test_withdraw_self_twice(self): response = self.client.delete( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 400) def test_withdraw_self_when_finished(self): self.assignment.set_candidate(get_user_model().objects.get(username="admin")) self.assignment.set_phase(Assignment.PHASE_FINISHED) self.assignment.save() response = self.client.delete( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 400) def test_withdraw_self_during_voting(self): self.assignment.set_candidate(get_user_model().objects.get(username="admin")) self.assignment.set_phase(Assignment.PHASE_VOTING) self.assignment.save() response = self.client.delete( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 200) self.assertFalse( Assignment.objects.get(pk=self.assignment.pk).candidates.exists() ) def test_withdraw_self_during_voting_non_admin(self): self.assignment.set_candidate(get_user_model().objects.get(username="admin")) self.assignment.set_phase(Assignment.PHASE_VOTING) self.assignment.save() admin = get_user_model().objects.get(username="admin") group_admin = admin.groups.get(name="Admin") group_delegates = type(group_admin).objects.get(name="Delegates") admin.groups.add(group_delegates) admin.groups.remove(group_admin) inform_changed_data(admin) response = self.client.delete( reverse("assignment-candidature-self", args=[self.assignment.pk]) ) self.assertEqual(response.status_code, 403) class CandidatureOther(TestCase): def setUp(self): self.client = APIClient() self.client.login(username="admin", password="admin") self.assignment = Assignment.objects.create( title="test_assignment_leiD6tiojigh1vei1ait", open_posts=1 ) self.user = get_user_model().objects.create_user( username="test_user_eeheekai4Phue6cahtho", password="test_password_ThahXazeiV8veipeePh6", ) def test_invalid_data_empty_dict(self): response = self.client.post( reverse("assignment-candidature-other", args=[self.assignment.pk]), {} ) self.assertEqual(response.status_code, 400) def test_invalid_data_string_instead_of_integer(self): response = self.client.post( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": "string_instead_of_integer"}, ) self.assertEqual(response.status_code, 400) def test_invalid_data_user_does_not_exist(self): # ID of a user that does not exist. # Be careful: Here we do not test that the user does not exist. inexistent_user_pk = self.user.pk + 1000 response = self.client.post( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": inexistent_user_pk}, ) self.assertEqual(response.status_code, 400) def test_nominate_other(self): response = self.client.post( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 200) self.assertTrue( Assignment.objects.get(pk=self.assignment.pk) .candidates.filter(username="test_user_eeheekai4Phue6cahtho") .exists() ) def test_nominate_other_twice(self): self.assignment.set_candidate( get_user_model().objects.get(username="test_user_eeheekai4Phue6cahtho") ) response = self.client.post( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 400) def test_nominate_other_when_finished(self): self.assignment.set_phase(Assignment.PHASE_FINISHED) self.assignment.save() response = self.client.post( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 400) def test_nominate_other_during_voting(self): self.assignment.set_phase(Assignment.PHASE_VOTING) self.assignment.save() response = self.client.post( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 200) self.assertTrue( Assignment.objects.get(pk=self.assignment.pk) .candidates.filter(username="test_user_eeheekai4Phue6cahtho") .exists() ) def test_nominate_other_during_voting_non_admin(self): self.assignment.set_phase(Assignment.PHASE_VOTING) self.assignment.save() admin = get_user_model().objects.get(username="admin") group_admin = admin.groups.get(name="Admin") group_delegates = type(group_admin).objects.get(name="Delegates") admin.groups.add(group_delegates) admin.groups.remove(group_admin) inform_changed_data(admin) response = self.client.post( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 403) def test_delete_other(self): self.assignment.set_candidate(self.user) response = self.client.delete( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 200) self.assertFalse( Assignment.objects.get(pk=self.assignment.pk) .candidates.filter(username="test_user_eeheekai4Phue6cahtho") .exists() ) def test_delete_other_twice(self): response = self.client.delete( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 400) def test_delete_other_when_finished(self): self.assignment.set_candidate(self.user) self.assignment.set_phase(Assignment.PHASE_FINISHED) self.assignment.save() response = self.client.delete( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 400) def test_delete_other_during_voting(self): self.assignment.set_candidate(self.user) self.assignment.set_phase(Assignment.PHASE_VOTING) self.assignment.save() response = self.client.delete( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 200) self.assertFalse( Assignment.objects.get(pk=self.assignment.pk) .candidates.filter(username="test_user_eeheekai4Phue6cahtho") .exists() ) def test_delete_other_during_voting_non_admin(self): self.assignment.set_candidate(self.user) self.assignment.set_phase(Assignment.PHASE_VOTING) self.assignment.save() admin = get_user_model().objects.get(username="admin") group_admin = admin.groups.get(name="Admin") group_delegates = type(group_admin).objects.get(name="Delegates") admin.groups.add(group_delegates) admin.groups.remove(group_admin) inform_changed_data(admin) response = self.client.delete( reverse("assignment-candidature-other", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 403) class MarkElectedOtherUser(TestCase): """ Tests marking an elected user. We use an extra user here to show that admin can not only mark himself but also other users. """ def setUp(self): self.client = APIClient() self.client.login(username="admin", password="admin") self.assignment = Assignment.objects.create( title="test_assignment_Ierohsh8rahshofiejai", open_posts=1 ) self.user = get_user_model().objects.create_user( username="test_user_Oonei3rahji5jugh1eev", password="test_password_aiphahb5Nah0cie4iP7o", ) def test_mark_elected(self): self.assignment.set_candidate( get_user_model().objects.get(username="test_user_Oonei3rahji5jugh1eev") ) response = self.client.post( reverse("assignment-mark-elected", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 200) self.assertTrue( Assignment.objects.get(pk=self.assignment.pk) .elected.filter(username="test_user_Oonei3rahji5jugh1eev") .exists() ) def test_mark_unelected(self): user = get_user_model().objects.get(username="test_user_Oonei3rahji5jugh1eev") self.assignment.set_elected(user) response = self.client.delete( reverse("assignment-mark-elected", args=[self.assignment.pk]), {"user": self.user.pk}, ) self.assertEqual(response.status_code, 200) self.assertFalse( Assignment.objects.get(pk=self.assignment.pk) .elected.filter(username="test_user_Oonei3rahji5jugh1eev") .exists() ) class UpdateAssignmentPoll(TestCase): """ Tests updating polls of assignments. """ def setUp(self): self.client = APIClient() self.client.login(username="admin", password="admin") self.assignment = Assignment.objects.create( title="test_assignment_ohneivoh9caiB8Yiungo", open_posts=1 ) self.assignment.set_candidate(get_user_model().objects.get(username="admin")) self.poll = self.assignment.create_poll() def test_invalid_votesvalid_value(self): response = self.client.put( reverse("assignmentpoll-detail", args=[self.poll.pk]), {"assignment_id": self.assignment.pk, "votesvalid": "-3"}, ) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_invalid_votesinvalid_value(self): response = self.client.put( reverse("assignmentpoll-detail", args=[self.poll.pk]), {"assignment_id": self.assignment.pk, "votesinvalid": "-3"}, ) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_invalid_votescast_value(self): response = self.client.put( reverse("assignmentpoll-detail", args=[self.poll.pk]), {"assignment_id": self.assignment.pk, "votescast": "-3"}, ) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_empty_value_for_votesvalid(self): response = self.client.put( reverse("assignmentpoll-detail", args=[self.poll.pk]), {"assignment_id": self.assignment.pk, "votesvalid": ""}, ) self.assertEqual(response.status_code, status.HTTP_200_OK)
35.688797
86
0.65161
1,895
17,202
5.738259
0.103958
0.105573
0.058856
0.082674
0.817638
0.805499
0.801269
0.786095
0.784808
0.770278
0
0.014734
0.234566
17,202
481
87
35.762994
0.811119
0.039472
0
0.621918
0
0
0.116271
0.088422
0
0
0
0.002079
0.128767
1
0.10137
false
0.019178
0.032877
0
0.147945
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
40552e5e0d0820a48c216dacc532f36806239985
39
py
Python
Python/py_module_discover/discover_dir/proto/__init__.py
egustafson/sandbox
9804e966347b33558b0497a04edb1a591d2d7773
[ "Apache-2.0" ]
2
2019-09-27T21:25:26.000Z
2019-12-29T11:26:54.000Z
Python/py_module_discover/discover_dir/proto/__init__.py
egustafson/sandbox
9804e966347b33558b0497a04edb1a591d2d7773
[ "Apache-2.0" ]
7
2020-08-11T17:32:14.000Z
2020-08-11T17:32:39.000Z
Python/py_module_discover/discover_dir/proto/__init__.py
egustafson/sandbox
9804e966347b33558b0497a04edb1a591d2d7773
[ "Apache-2.0" ]
2
2016-07-18T10:55:50.000Z
2020-08-19T01:46:08.000Z
print("Package 'proto' initialized.")
13
37
0.717949
4
39
7
1
0
0
0
0
0
0
0
0
0
0
0
0.102564
39
2
38
19.5
0.8
0
0
0
0
0
0.736842
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
6
405ab5a123a1bd0d379c951d661fe03172b52cbf
119
py
Python
Lib/site-packages/Numeric/MA/__init__.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
Lib/site-packages/Numeric/MA/__init__.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
Lib/site-packages/Numeric/MA/__init__.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
from MA_version import version as __version__ from MA_version import version_info as __version_info__ from MA import *
29.75
55
0.857143
19
119
4.736842
0.315789
0.2
0.288889
0.422222
0.577778
0
0
0
0
0
0
0
0.134454
119
3
56
39.666667
0.873786
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
dc0872be2d5b205d5b09dc4e70d445e32b745ac5
42
py
Python
turf/explode/__init__.py
malroc/pyturf
c89b6ea7094bd5ca26cf589d9dcd15bd819d82e9
[ "MIT" ]
11
2020-08-26T11:04:55.000Z
2022-01-26T14:53:10.000Z
turf/explode/__init__.py
malroc/pyturf
c89b6ea7094bd5ca26cf589d9dcd15bd819d82e9
[ "MIT" ]
36
2020-04-09T16:49:05.000Z
2020-06-01T14:39:37.000Z
turf/explode/__init__.py
malroc/pyturf
c89b6ea7094bd5ca26cf589d9dcd15bd819d82e9
[ "MIT" ]
5
2020-07-30T23:37:35.000Z
2021-08-24T08:10:28.000Z
from turf.explode._explode import explode
21
41
0.857143
6
42
5.833333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.095238
42
1
42
42
0.921053
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
dc17c51bdd1274df96bc9bc061dfc49c77bbb4c1
25
py
Python
web_gantt8/__init__.py
agenterpgmbh/misc-addons
27e36d119b1e73089a2ebfcd8d4cfc706c8f1f41
[ "MIT" ]
null
null
null
web_gantt8/__init__.py
agenterpgmbh/misc-addons
27e36d119b1e73089a2ebfcd8d4cfc706c8f1f41
[ "MIT" ]
1
2020-05-03T04:27:29.000Z
2020-05-03T04:27:29.000Z
web_gantt8/__init__.py
eneldoserrata/misc-addons
6f3b94d8a71d603d9ad449f96edfc66385e78080
[ "MIT" ]
2
2020-05-09T02:08:59.000Z
2022-03-21T06:37:15.000Z
from . import web_gantt8
12.5
24
0.8
4
25
4.75
1
0
0
0
0
0
0
0
0
0
0
0.047619
0.16
25
1
25
25
0.857143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
904bfe4bf19fa67455441aadd2c6ba73355b631e
137
py
Python
mindhome_alpha/erpnext/patches/v12_0/remove_patient_medical_record_page.py
Mindhome/field_service
3aea428815147903eb9af1d0c1b4b9fc7faed057
[ "MIT" ]
1
2021-04-29T14:55:29.000Z
2021-04-29T14:55:29.000Z
mindhome_alpha/erpnext/patches/v12_0/remove_patient_medical_record_page.py
Mindhome/field_service
3aea428815147903eb9af1d0c1b4b9fc7faed057
[ "MIT" ]
null
null
null
mindhome_alpha/erpnext/patches/v12_0/remove_patient_medical_record_page.py
Mindhome/field_service
3aea428815147903eb9af1d0c1b4b9fc7faed057
[ "MIT" ]
1
2021-04-29T14:39:01.000Z
2021-04-29T14:39:01.000Z
# Copyright (c) 2019 from __future__ import unicode_literals import frappe def execute(): frappe.delete_doc("Page", "medical_record")
17.125
44
0.773723
18
137
5.5
0.888889
0
0
0
0
0
0
0
0
0
0
0.033333
0.124088
137
7
45
19.571429
0.791667
0.131387
0
0
0
0
0.153846
0
0
0
0
0
0
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
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
6
90872415b53f69d5188412b891feb4c4cf641e84
134
py
Python
nimare/annotate/__init__.py
JulioAPeraza/NiMARE
e8814c23b33c64a73de907bf56de852b13a9d56a
[ "MIT" ]
112
2018-04-15T15:54:26.000Z
2022-03-09T04:48:17.000Z
nimare/annotate/__init__.py
JulioAPeraza/NiMARE
e8814c23b33c64a73de907bf56de852b13a9d56a
[ "MIT" ]
558
2018-01-19T17:26:42.000Z
2022-03-31T16:42:50.000Z
nimare/annotate/__init__.py
JulioAPeraza/NiMARE
e8814c23b33c64a73de907bf56de852b13a9d56a
[ "MIT" ]
41
2018-01-17T21:16:52.000Z
2021-12-21T22:23:52.000Z
"""Automated annotation tools.""" from . import cogat, gclda, lda, text, utils __all__ = ["cogat", "gclda", "lda", "text", "utils"]
22.333333
52
0.634328
16
134
5.0625
0.6875
0.246914
0.320988
0.419753
0.54321
0
0
0
0
0
0
0
0.149254
134
5
53
26.8
0.710526
0.201493
0
0
0
0
0.217822
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
6
908763675c0f406b8b2d3d6c25f616fd6f6fe7fd
40
py
Python
transition_sampling/colvar/__init__.py
UWPRG/transition-sampling
6602bd87a66b70fb74711685f0ecfcb2d7bcbfe9
[ "MIT" ]
2
2020-12-04T01:54:44.000Z
2021-03-09T18:44:15.000Z
transition_sampling/colvar/__init__.py
UWPRG/transition-sampling
6602bd87a66b70fb74711685f0ecfcb2d7bcbfe9
[ "MIT" ]
10
2020-11-26T18:32:43.000Z
2021-03-14T00:09:24.000Z
transition_sampling/colvar/__init__.py
UWPRG/transition-sampling
6602bd87a66b70fb74711685f0ecfcb2d7bcbfe9
[ "MIT" ]
null
null
null
from .plumed_driver import PlumedDriver
20
39
0.875
5
40
6.8
1
0
0
0
0
0
0
0
0
0
0
0
0.1
40
1
40
40
0.944444
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
90b11eccf71a69811faacbd15ae85fc9a54a2d0e
137
py
Python
pyot/utils/tft/routing.py
paaksing/Pyot
0af13ff453ff3065427b93fadae0b92935b791c8
[ "MIT" ]
60
2020-08-29T02:04:31.000Z
2022-03-20T14:51:24.000Z
pyot/utils/tft/routing.py
paaksing/Pyot
0af13ff453ff3065427b93fadae0b92935b791c8
[ "MIT" ]
2
2021-04-08T03:06:01.000Z
2022-02-04T15:27:16.000Z
pyot/utils/tft/routing.py
paaksing/Pyot
0af13ff453ff3065427b93fadae0b92935b791c8
[ "MIT" ]
15
2020-11-30T23:31:11.000Z
2022-02-11T13:31:13.000Z
from pyot.models.tft import base def platform_to_region(platform: str) -> str: return base.PyotRouting._platform2regions[platform]
22.833333
55
0.788321
18
137
5.833333
0.777778
0
0
0
0
0
0
0
0
0
0
0.008333
0.124088
137
5
56
27.4
0.866667
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
6
90bf0ad913f7238896befb623127f4b26415acdf
125
py
Python
gnnbench/models/__init__.py
cvignac/gnn_statistics
2115b54397ed25412f1bc4d8c93e0acdab348e34
[ "MIT" ]
3
2020-04-03T07:23:35.000Z
2021-05-26T06:25:28.000Z
gnnbench/models/__init__.py
cvignac/gnn_statistics
2115b54397ed25412f1bc4d8c93e0acdab348e34
[ "MIT" ]
1
2022-02-09T23:36:48.000Z
2022-02-09T23:36:48.000Z
gnnbench/models/__init__.py
cvignac/gnn_statistics
2115b54397ed25412f1bc4d8c93e0acdab348e34
[ "MIT" ]
null
null
null
from .base_model import * from . import gcn from . import sgc from . import appnp from . import sgcmlp from . import appnpmlp
20.833333
25
0.76
19
125
4.947368
0.473684
0.531915
0
0
0
0
0
0
0
0
0
0
0.184
125
6
26
20.833333
0.921569
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
90c7d0674cf8e811739ef848d6552edca065329d
5,079
py
Python
tests/views/test_content.py
adamghill/coltrane
73eb85f2468f10068691600a2a56f6a9b2717b5c
[ "MIT" ]
28
2022-01-03T05:23:19.000Z
2022-02-25T18:17:08.000Z
tests/views/test_content.py
adamghill/coltrane
73eb85f2468f10068691600a2a56f6a9b2717b5c
[ "MIT" ]
27
2022-01-04T04:01:46.000Z
2022-02-26T23:24:54.000Z
tests/views/test_content.py
adamghill/coltrane
73eb85f2468f10068691600a2a56f6a9b2717b5c
[ "MIT" ]
null
null
null
from pathlib import Path from unittest.mock import call, patch def test_404(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() response = client.get("/") assert response.status_code == 404 def test_404_directory_parent_traversal(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() response = client.get("/../") assert response.status_code == 404 def test_404_directory_home_traversal(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() response = client.get("/../") assert response.status_code == 404 def test_index_with_slash(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() (tmp_path / "content" / "index.md").write_text("# index") response = client.get("/") assert response.status_code == 200 actual = response.content.decode() assert '<h1 id="index">index</h1>' in actual def test_index_without_slash(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() (tmp_path / "content" / "index.md").write_text("# index") response = client.get("") assert response.status_code == 200 actual = response.content.decode() assert '<h1 id="index">index</h1>' in actual def test_directory_index_with_slash(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() (tmp_path / "content/dir").mkdir() (tmp_path / "content/dir/index.md").write_text("# dir") response = client.get("/dir/") assert response.status_code == 200 actual = response.content.decode() assert '<h1 id="dir">dir</h1>' in actual def test_directory_index_without_slash(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() (tmp_path / "content/dir").mkdir() (tmp_path / "content/dir/index.md").write_text("# dir") response = client.get("/dir") assert response.status_code == 200 actual = response.content.decode() assert '<h1 id="dir">dir</h1>' in actual def test_url_slug(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() (tmp_path / "content" / "test-this.md").write_text("# test this") response = client.get("/test-this") assert response.status_code == 200 actual = response.content.decode() assert '\n<h1 id="test-this">test this</h1>\n\n' in actual def test_url_slug_with_data(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path (tmp_path / "content").mkdir() (tmp_path / "content" / "test-this-data.md").write_text("test data {{ data.test }}") (tmp_path / "data.json").write_text('{"test":1}') response = client.get("/test-this-data") assert response.status_code == 200 actual = response.content.decode() assert "\n<p>test data 1</p>\n\n" in actual def test_url_slug_cache_headers(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path settings.COLTRANE = {"VIEW_CACHE": {"SECONDS": 15}} (tmp_path / "content").mkdir() (tmp_path / "content" / "test-this-cache.md").write_text("test cache") response = client.get("/test-this-cache") assert response.status_code == 200 assert response.headers.get("Cache-Control") == "max-age=15" assert response.headers.get("Expires") original_expires = response.headers.get("Expires") # Call view again response = client.get("/test-this-cache") assert response.status_code == 200 assert response.headers.get("Expires") == original_expires def test_url_slug_cache(client, settings, tmp_path: Path): settings.BASE_DIR = tmp_path settings.COLTRANE = {"VIEW_CACHE": {"SECONDS": 15}} (tmp_path / "content").mkdir() (tmp_path / "content" / "test-this-cache.md").write_text("test cache") context = { "template": "coltrane/content.html", "data": {}, "content": "<p>test cache</p>\n", } with patch( "coltrane.views._get_from_cache_if_enabled", return_value=("coltrane/content.html", context), ) as _get_from_cache_if_enabled: with patch( "coltrane.views._set_in_cache_if_enabled" ) as _set_in_cache_if_enabled: response = client.get("/test-this-cache") assert response.status_code == 200 assert response.headers.get("Cache-Control") == "max-age=15" assert response.headers.get("Expires") original_expires = response.headers.get("Expires") # Call view again response = client.get("/test-this-cache") assert response.status_code == 200 assert response.headers.get("Expires") == original_expires _get_from_cache_if_enabled.assert_has_calls( calls=[call("test-this-cache"), call("test-this-cache")] ) _set_in_cache_if_enabled.assert_not_called()
30.969512
88
0.657019
667
5,079
4.772114
0.110945
0.096764
0.092366
0.098021
0.870248
0.809299
0.8071
0.801445
0.786365
0.786365
0
0.016642
0.195511
5,079
163
89
31.159509
0.762359
0.006104
0
0.663636
0
0
0.18553
0.032507
0
0
0
0
0.245455
1
0.1
false
0
0.018182
0
0.118182
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
90da157888547bf68580a2f7b5d3391b795d8311
91
py
Python
Operators/ExampleQRCodeDetectOperator/__init__.py
Caius-Lu/Savior
47c22e06c38cc9b5f7007d79f791015c8b2b76aa
[ "BSD-2-Clause" ]
108
2021-03-19T03:45:48.000Z
2022-03-29T12:19:38.000Z
Operators/ExampleQRCodeDetectOperator/__init__.py
Caius-Lu/Savior
47c22e06c38cc9b5f7007d79f791015c8b2b76aa
[ "BSD-2-Clause" ]
2
2021-05-12T07:26:21.000Z
2021-07-16T12:53:52.000Z
Operators/ExampleQRCodeDetectOperator/__init__.py
Caius-Lu/Savior
47c22e06c38cc9b5f7007d79f791015c8b2b76aa
[ "BSD-2-Clause" ]
27
2021-03-19T05:50:26.000Z
2021-12-28T07:13:09.000Z
from Operators.ExampleQRCodeDetectOperator.QRCodeDetectOperator import QRCodeDetectWithSSD
45.5
90
0.934066
6
91
14.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.043956
91
1
91
91
0.977011
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
90feca94d1af63da6da955e3a82cdfcb166683b0
134
py
Python
dqo/db/clients/__init__.py
danield137/deep_query_optimzation
01a25c966338007f15d14dea1b37e388e47bcfe3
[ "MIT" ]
null
null
null
dqo/db/clients/__init__.py
danield137/deep_query_optimzation
01a25c966338007f15d14dea1b37e388e47bcfe3
[ "MIT" ]
null
null
null
dqo/db/clients/__init__.py
danield137/deep_query_optimzation
01a25c966338007f15d14dea1b37e388e47bcfe3
[ "MIT" ]
null
null
null
from dqo.db.clients.base import DatabaseClient from dqo.db.clients.fake import FakeClient from dqo.db.clients.postgres import Postgres
44.666667
46
0.850746
21
134
5.428571
0.47619
0.184211
0.236842
0.421053
0
0
0
0
0
0
0
0
0.08209
134
3
47
44.666667
0.926829
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
292d394e837bd29c36a1a7910bae1eea614c987c
104
py
Python
src/python/artisynth_envs/envs/__init__.py
amir-abdi/artisynth-rl
be99072efb46cb0e3cbc19ef444efc699343a238
[ "MIT" ]
4
2020-03-28T16:29:48.000Z
2021-09-07T12:06:24.000Z
src/python/artisynth_envs/envs/__init__.py
amir-abdi/artisynth-rl
be99072efb46cb0e3cbc19ef444efc699343a238
[ "MIT" ]
4
2020-11-10T23:52:14.000Z
2021-12-14T21:36:48.000Z
src/python/artisynth_envs/envs/__init__.py
amir-abdi/artisynth-rl
be99072efb46cb0e3cbc19ef444efc699343a238
[ "MIT" ]
2
2021-09-07T12:07:29.000Z
2021-11-07T04:47:31.000Z
from .spine_env import SpineEnv from .point2point_env import Point2PointEnv from .jaw_env import JawEnv
26
43
0.855769
15
104
5.733333
0.6
0.313953
0
0
0
0
0
0
0
0
0
0.021739
0.115385
104
3
44
34.666667
0.913043
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6