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
67454f1637a050543ddb79e284a06ac4bff99593
37
py
Python
python/packages/isce3/container/__init__.py
isce-framework/isce3
59cdd2c659a4879367db5537604b0ca93d26b372
[ "Apache-2.0" ]
64
2019-08-06T19:22:22.000Z
2022-03-20T17:11:46.000Z
python/packages/isce3/container/__init__.py
isce-framework/isce3
59cdd2c659a4879367db5537604b0ca93d26b372
[ "Apache-2.0" ]
8
2020-09-01T22:46:53.000Z
2021-11-04T00:05:28.000Z
python/packages/isce3/container/__init__.py
isce-framework/isce3
59cdd2c659a4879367db5537604b0ca93d26b372
[ "Apache-2.0" ]
29
2019-08-05T21:40:55.000Z
2022-03-23T00:17:03.000Z
from pybind_isce3.container import *
18.5
36
0.837838
5
37
6
1
0
0
0
0
0
0
0
0
0
0
0.030303
0.108108
37
1
37
37
0.878788
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
678a3fd69515ef37ac027f30c8ef300d039a11d2
5,498
py
Python
uigfTools.py
Masterain98/Paimon.moe-WishHistory-UIGF-Exporter
00a84fafba8858ed5663cb87dd8540240aa6755e
[ "MIT" ]
null
null
null
uigfTools.py
Masterain98/Paimon.moe-WishHistory-UIGF-Exporter
00a84fafba8858ed5663cb87dd8540240aa6755e
[ "MIT" ]
null
null
null
uigfTools.py
Masterain98/Paimon.moe-WishHistory-UIGF-Exporter
00a84fafba8858ed5663cb87dd8540240aa6755e
[ "MIT" ]
null
null
null
from datetime import datetime def uigfGachaTypeGenerator(row): gachaTime = datetime.strptime(row["Time"], "%Y-%m-%d %H:%M:%S") bannerName = row["Banner"] gachaType = 0 if bannerName == "Ballad in Goblets": # 温迪 gachaType = 1 if gachaTime > datetime(2020,9,28,0,0,0) and gachaTime < datetime(2020,10,18,18,0,0): gachaType = 301 elif gachaTime > datetime(2021,3,17,6,0,0) and gachaTime < datetime(2021,4,6,16,0,0): gachaType = 301 elif bannerName == "Sparkling Steps": # 可莉 gachaType = 1 if gachaTime > datetime(2020,10,20,18,0,0) and gachaTime < datetime(2020,11,10,16,0,0): gachaType = 301 elif gachaTime > datetime(2021,6,9,6,0,0) and gachaTime < datetime(2021,6,29,17,59,59): gachaType = 301 elif bannerName == "Farewell of Snezhnaya": # 公子 gachaType = 1 if gachaTime > datetime(2020,11,11,6,0,0) and gachaTime < datetime(2020,12,1,16,0,0): gachaType = 301 elif gachaTime > datetime(2021,4,6,18,0,0) and gachaTime < datetime(2021,4,27,15,0,0): gachaType = 301 elif gachaTime > datetime(2021,10,13,6,0,0) and gachaTime < datetime(2021,11,2,17,59,59): gachaType = 301 elif bannerName == "Gentry of Hermitage": # 钟离 gachaType = 1 if gachaTime > datetime(2020,12,1,18,0,0) and gachaTime < datetime(2020,12,22,15,0,0): gachaType = 301 elif gachaTime > datetime(2021,4,28,6,0,0) and gachaTime < datetime(2021,5,18,17,59,59): gachaType = 301 elif gachaTime > datetime(2022,1,25,18,0,0) and gachaTime < datetime(2022,2,15,14,59,59): gachaType = 301 elif bannerName == "Secretum Secretorum": # 阿贝多 gachaType = 1 if gachaTime > datetime(2020,12,23,6,0,0) and gachaTime < datetime(2021,1,12,16,0,0): gachaType = 301 elif gachaTime > datetime(2021,11,24,6,0,0) and gachaTime < datetime(2021,12,14,17,59,59): gachaType = 301 elif bannerName == "Adrift in the Harbor": # 甘雨 gachaType = 1 if gachaTime > datetime(2021,1,12,18,0,0) and gachaTime < datetime(2021,2,2,15,0,0): gachaType = 301 elif gachaTime > datetime(2022,1,25,18,0,0) and gachaTime < datetime(2022,2,15,14,59,59): gachaType = 400 elif bannerName == "Invitation to Mundane Life": # 魈 gachaType = 1 if gachaTime > datetime(2021,2,3,6,0,0) and gachaTime < datetime(2021,2,17,16,0,0): gachaType = 301 elif gachaTime > datetime(2022,1,5,6,0,0) and gachaTime < datetime(2022,1,25,17,59,59): gachaType = 400 elif bannerName == "Dance of Lanterns": # 刻晴 gachaType = 1 if gachaTime > datetime(2021,2,17,18,0,0) and gachaTime < datetime(2021,3,2,16,0,0): gachaType = 301 elif bannerName == "Moment of Bloom": # 胡桃 gachaType = 1 if gachaTime > datetime(2021,3,2,18,0,0) and gachaTime < datetime(2021,3,16,15,0,0): gachaType = 301 elif gachaTime > datetime(2021,11,2,18,0,0) and gachaTime < datetime(2021,11,23,14,59,59): gachaType = 301 elif bannerName == "Born of Ocean Swell": # 优菈 gachaType = 1 if gachaTime > datetime(2021,5,18,18,0,0) and gachaTime < datetime(2021,6,8,15,0,0): gachaType = 301 elif gachaTime > datetime(2021,11,24,6,0,0) and gachaTime < datetime(2021,12,14,17,59,59): gachaType = 400 elif bannerName == "Leaves in the Wind": # 万叶 gachaType = 1 if gachaTime > datetime(2021,6,29,18,0,0) and gachaTime < datetime(2021,7,20,14,59,59): gachaType = 301 elif bannerName == "The Herons Court": # 神里绫华 gachaType = 1 if gachaTime > datetime(2021,7,21,6,0,0) and gachaTime < datetime(2021,8,10,17,59,59): gachaType = 301 elif bannerName == "Tapestry of Golden Flames": # 宵宫 gachaType = 1 if gachaTime > datetime(2021,8,10,18,0,0) and gachaTime < datetime(2021,8,31,14,59,59): gachaType = 301 elif bannerName == "Reign of Serenity": # 雷电将军 gachaType = 1 if gachaTime > datetime(2021,9,1,6,0,0) and gachaTime < datetime(2021,9,21,17,59,59): gachaType = 301 elif gachaTime > datetime(2022,3,8,18,0,0) and gachaTime < datetime(2022,3,29,14,59,59): gachaType = 301 elif bannerName == "Drifting Luminescence": # 珊瑚宫心海 gachaType = 1 if gachaTime > datetime(2021,9,21,18,0,0) and gachaTime < datetime(2021,10,12,14,59,59): gachaType = 301 elif gachaTime > datetime(2022,3,8,18,0,0) and gachaTime < datetime(2022,3,29,14,59,59): gachaType = 400 elif bannerName == "Oni's Royale": # 荒泷一斗 gachaType = 1 if gachaTime > datetime(2021,12,14,18,0,0) and gachaTime < datetime(2022,1,4,17,59,59): gachaType = 301 elif bannerName == "The Transcendent One Returns": # 申鹤 gachaType = 1 if gachaTime > datetime(2022,1,5,6,0,0) and gachaTime < datetime(2022,1,25,17,59,59): gachaType = 301 elif bannerName == "Everbloom Violet": # 八重神子 gachaType = 1 if gachaTime > datetime(2022,2,16,6,0,0) and gachaTime < datetime(2022,3,8,17,59,59): gachaType = 301 return gachaType
44.33871
98
0.586941
791
5,498
4.079646
0.149178
0.331887
0.247289
0.13449
0.828014
0.809111
0.683917
0.321041
0.280446
0.219709
0
0.207002
0.283012
5,498
124
99
44.33871
0.611618
0.011641
0
0.528846
0
0
0.067947
0
0
0
0
0
0
1
0.009615
false
0
0.009615
0
0.028846
0
0
0
0
null
1
1
0
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
67974d1bc0937f906d4c441592a139fbfdb8a34e
5,872
py
Python
biblib/tests/functional_tests/test_pagination_epic.py
nemanjamart/biblib-service
7c5c57a678b7dffdafd6550cde13d8b3dd610d46
[ "MIT" ]
4
2017-02-25T19:44:42.000Z
2019-06-24T15:43:12.000Z
biblib/tests/functional_tests/test_pagination_epic.py
nemanjamart/biblib-service
7c5c57a678b7dffdafd6550cde13d8b3dd610d46
[ "MIT" ]
107
2015-05-14T17:34:08.000Z
2022-03-29T14:07:33.000Z
biblib/tests/functional_tests/test_pagination_epic.py
nemanjamart/biblib-service
7c5c57a678b7dffdafd6550cde13d8b3dd610d46
[ "MIT" ]
11
2015-05-13T19:22:38.000Z
2022-02-03T17:29:34.000Z
# encoding: utf-8 """ Functional test Pagination Epic Storyboard is defined within the comments of the program itself """ import mock import unittest from flask import url_for from biblib.tests.stubdata.stub_data import UserShop, LibraryShop from biblib.tests.base import TestCaseDatabase, \ MockSolrBigqueryService, MockEndPoint class TestPaginationEpic(TestCaseDatabase): """ Base class used to test the Pagination Epic """ def test_pagination_epic(self): """ Carries out the epic 'Pagination', where a user is paginating through pages of 20 documents on their user interface. """ # Mary creates a private library and # 1. Gives it a name. # 2. Gives it a description. # Create stub data for: # 1. the user, named Mary # 2. a library, prefilled with name, description, and bibcodes user_mary = UserShop() stub_bibcodes = { '2010MNRAS': {}, '2012MNRAS': {}, '2012MNRAS': {}, '2014MNRAS': {}, } solr_docs_page_1 = [{'bibcode': '2010MNRAS'}, {'bibcode': '2011MNRAS'}] solr_docs_page_2 = [{'bibcode': '2012MNRAS'}, {'bibcode': '2014MNRAS'}] docs_page_1 = ['2010MNRAS', '2011MNRAS'] docs_page_2 = ['2012MNRAS', '2014MNRAS'] stub_library = LibraryShop(want_bibcode=True, bibcode=stub_bibcodes) # Make the library by using the /library POST end point url = url_for('userview') response = self.client.post( url, data=stub_library.user_view_post_data_json, headers=user_mary.headers ) self.assertStatus(response, 200) # Library ID is returned from this POST request library_id = response.json['id'] # Now we check that we can retrieve the first 20 paginated documents # First set up the parameters for pagination params = { 'start': 0, 'rows': 2, } # Then send the GET request url = url_for('libraryview', library=library_id) with MockSolrBigqueryService(solr_docs=solr_docs_page_1) as BQ, \ MockEndPoint([user_mary]) as EP: response = self.client.get( url, headers=user_mary.headers, query_string=params ) self.assertStatus(response, 200) self.assertEqual(docs_page_1, response.json['documents']) # Then ask for the second page params = { 'start': 2, 'rows': 2 } url = url_for('libraryview', library=library_id) with MockSolrBigqueryService(solr_docs=solr_docs_page_2) as BQ, \ MockEndPoint([user_mary]) as EP: response = self.client.get( url, headers=user_mary.headers, query_string=params ) self.assertStatus(response, 200) self.assertEqual(docs_page_2, response.json['documents']) @mock.patch('biblib.views.library_view.LibraryView.solr_big_query') def test_pagination_epic_no_solr(self, mocked_big_query): """ Carries out the epic 'Pagination', where a user is paginating through pages of 20 documents on their user interface. In this case, we assume that Solr is not responding, but want to check that documents are still returned """ # Solr will not respond when it is contacted, but we expect it to raise # an error when there is no JSON response. To mock this, we simply do # the following: mocked_big_query.side_effect = Exception('Fake exception') # Mary creates a private library and # 1. Gives it a name. # 2. Gives it a description. # Create stub data for: # 1. the user, named Mary # 2. a library, prefilled with name, description, and bibcodes user_mary = UserShop() stub_bibcodes = { '2010MNRAS': {}, '2011MNRAS': {}, '2012MNRAS': {}, '2013MNRAS': {}, } docs_page_1 = ['2010MNRAS', '2011MNRAS'] docs_page_2 = ['2012MNRAS', '2013MNRAS'] stub_library = LibraryShop(want_bibcode=True, bibcode=stub_bibcodes) # Make the library by using the /library POST end point url = url_for('userview') response = self.client.post( url, data=stub_library.user_view_post_data_json, headers=user_mary.headers ) self.assertStatus(response, 200) # Library ID is returned from this POST request library_id = response.json['id'] # Now we check that we can retrieve the first 20 paginated documents # First set up the parameters for pagination params = { 'start': 0, 'rows': 2, } # Then send the GET request url = url_for('libraryview', library=library_id) with MockEndPoint([user_mary]) as EP: response = self.client.get( url, headers=user_mary.headers, query_string=params ) self.assertStatus(response, 200) self.assertEqual(docs_page_1, response.json['documents']) # Then ask for the second page params = { 'start': 2, 'rows': 2 } url = url_for('libraryview', library=library_id) with MockEndPoint([user_mary]) as EP: response = self.client.get( url, headers=user_mary.headers, query_string=params ) self.assertStatus(response, 200) self.assertEqual(docs_page_2, response.json['documents']) if __name__ == '__main__': unittest.main(verbosity=2)
33.175141
79
0.588386
663
5,872
5.060332
0.236802
0.028614
0.016095
0.039344
0.727273
0.727273
0.727273
0.727273
0.727273
0.700447
0
0.034214
0.323059
5,872
176
80
33.363636
0.809811
0.266689
0
0.67619
0
0
0.100048
0.012446
0
0
0
0
0.095238
1
0.019048
false
0
0.047619
0
0.07619
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
679b654711c5e6bbb7096a33e0bac1ad75477257
122
py
Python
time_time.py
Kalpavrikshika/python_modules
9f338ab006dd5653fd7f65ff253bc50e0fd61fc6
[ "Apache-2.0" ]
1
2018-07-02T03:37:03.000Z
2018-07-02T03:37:03.000Z
time_time.py
Kalpavrikshika/python_modules
9f338ab006dd5653fd7f65ff253bc50e0fd61fc6
[ "Apache-2.0" ]
null
null
null
time_time.py
Kalpavrikshika/python_modules
9f338ab006dd5653fd7f65ff253bc50e0fd61fc6
[ "Apache-2.0" ]
null
null
null
#time module returns the number of seconds since the start of the ""epoch" import time print('The time is:', time.time())
30.5
74
0.737705
21
122
4.285714
0.619048
0
0
0
0
0
0
0
0
0
0
0
0.155738
122
4
75
30.5
0.873786
0.598361
0
0
0
0
0.244898
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
67ab3637c767626cffb70e19d4c43f187dcb5a54
202
py
Python
Macros/Colours/Orange/Coral.py
rec/dmxis
540baa59df6f4ae39990e5888f90b95caa362279
[ "Artistic-2.0" ]
2
2019-05-26T15:11:18.000Z
2021-12-27T21:05:32.000Z
Macros/Colours/Orange/Coral.py
rec/DMXIS
540baa59df6f4ae39990e5888f90b95caa362279
[ "Artistic-2.0" ]
null
null
null
Macros/Colours/Orange/Coral.py
rec/DMXIS
540baa59df6f4ae39990e5888f90b95caa362279
[ "Artistic-2.0" ]
null
null
null
#=============================================================== # DMXIS Macro (c) 2010 db audioware limited #=============================================================== RgbColour(255,127,80)
33.666667
65
0.247525
11
202
4.545455
1
0
0
0
0
0
0
0
0
0
0
0.064865
0.084158
202
5
66
40.4
0.205405
0.831683
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
67e2ecc32320f01ba6315d95cd54297051e89992
73
py
Python
metahyper/__init__.py
automl/metahyper
eab16fe018cb4fe2cb31c24f3f2b096e51a3a913
[ "MIT" ]
null
null
null
metahyper/__init__.py
automl/metahyper
eab16fe018cb4fe2cb31c24f3f2b096e51a3a913
[ "MIT" ]
null
null
null
metahyper/__init__.py
automl/metahyper
eab16fe018cb4fe2cb31c24f3f2b096e51a3a913
[ "MIT" ]
null
null
null
from .api import Sampler, read, run from .utils import instance_from_map
24.333333
36
0.808219
12
73
4.75
0.75
0
0
0
0
0
0
0
0
0
0
0
0.136986
73
2
37
36.5
0.904762
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
db1aba6156190c5da0542dae2b586c44ccfefbfc
1,724
py
Python
goldsberry/draft/draft.py
motraor3/py-Goldsberry
fe238b07142cff64eda37e402bb003251af13f9b
[ "MIT" ]
268
2015-07-28T18:49:06.000Z
2022-03-06T03:08:18.000Z
goldsberry/draft/draft.py
motraor3/py-Goldsberry
fe238b07142cff64eda37e402bb003251af13f9b
[ "MIT" ]
24
2015-07-06T22:50:59.000Z
2021-07-05T05:10:26.000Z
goldsberry/draft/draft.py
motraor3/py-Goldsberry
fe238b07142cff64eda37e402bb003251af13f9b
[ "MIT" ]
85
2015-08-08T17:45:28.000Z
2021-11-10T09:35:26.000Z
from goldsberry.masterclass import NbaDataProvider from goldsberry.apiparams import * class anthro(NbaDataProvider): def __init__(self, **kwargs): url_modifier = 'draftcombineplayeranthro' NbaDataProvider.__init__(self, url_modifier=url_modifier, default_params=p_draft, **kwargs) def data(self): return self._get_table_from_data(self._data_tables, 0) class agility(NbaDataProvider): def __init__(self, **kwargs): url_modifier = 'draftcombinedrillresults' NbaDataProvider.__init__(self, url_modifier=url_modifier, default_params=p_draft, **kwargs) def data(self): return self._get_table_from_data(self._data_tables, 0) class non_stationary_shooting(NbaDataProvider): def __init__(self, **kwargs): url_modifier = 'draftcombinenonstationaryshooting' NbaDataProvider.__init__(self, url_modifier=url_modifier, default_params=p_draft, **kwargs) def data(self): return self._get_table_from_data(self._data_tables, 0) class spot_up_shooting(NbaDataProvider): def __init__(self, **kwargs): url_modifier = 'draftcombinespotshooting' NbaDataProvider.__init__(self, url_modifier=url_modifier, default_params=p_draft, **kwargs) def data(self): return self._get_table_from_data(self._data_tables, 0) class combine(NbaDataProvider): def __init__(self, **kwargs): url_modifier = 'draftcombinestats' NbaDataProvider.__init__(self, url_modifier=url_modifier, default_params=p_draft, **kwargs) def data(self): return self._get_table_from_data(self._data_tables, 0) __all__ = ['anthro', 'agility', 'non_stationary_shooting', 'spot_up_shooting', 'combine']
33.803922
99
0.734919
198
1,724
5.858586
0.186869
0.142241
0.094828
0.112069
0.742241
0.742241
0.742241
0.631034
0.543103
0.543103
0
0.003479
0.166473
1,724
51
100
33.803922
0.803758
0
0
0.588235
0
0
0.104928
0.074203
0
0
0
0
0
1
0.294118
false
0
0.058824
0.147059
0.647059
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
c00f961960f915f1d885d516d524f2d1d9c9154d
55
py
Python
pysip/__init__.py
automationator/pysip
8f394463c0b39052426f6499817ea59460c7b9a6
[ "Apache-2.0" ]
1
2020-08-20T06:24:53.000Z
2020-08-20T06:24:53.000Z
pysip/__init__.py
automationator/pysip
8f394463c0b39052426f6499817ea59460c7b9a6
[ "Apache-2.0" ]
null
null
null
pysip/__init__.py
automationator/pysip
8f394463c0b39052426f6499817ea59460c7b9a6
[ "Apache-2.0" ]
2
2019-03-05T16:33:05.000Z
2019-04-02T11:27:44.000Z
from .pysip import Client, ConflictError, RequestError
27.5
54
0.836364
6
55
7.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.109091
55
1
55
55
0.938776
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c02c93da2a5b2679ff29e721d2d50277b00f92f5
673
py
Python
generated-libraries/python/netapp/system/nvram_battery_status_enum.py
radekg/netapp-ontap-lib-get
6445ebb071ec147ea82a486fbe9f094c56c5c40d
[ "MIT" ]
2
2017-03-28T15:31:26.000Z
2018-08-16T22:15:18.000Z
generated-libraries/python/netapp/system/nvram_battery_status_enum.py
radekg/netapp-ontap-lib-get
6445ebb071ec147ea82a486fbe9f094c56c5c40d
[ "MIT" ]
null
null
null
generated-libraries/python/netapp/system/nvram_battery_status_enum.py
radekg/netapp-ontap-lib-get
6445ebb071ec147ea82a486fbe9f094c56c5c40d
[ "MIT" ]
null
null
null
class NvramBatteryStatusEnum(basestring): """ ok|partially discharged|fully discharged|not present|near eol|eol|unknown|over charged|fully charged Possible values: <ul> <li> "battery_ok" , <li> "battery_partially_discharged" , <li> "battery_fully_discharged" , <li> "battery_not_present" , <li> "battery_near_end_of_life" , <li> "battery_at_end_of_life" , <li> "battery_unknown" , <li> "battery_over_charged" , <li> "battery_fully_charged" </ul> """ @staticmethod def get_api_name(): return "nvram-battery-status-enum"
29.26087
61
0.589896
70
673
5.357143
0.457143
0.216
0.101333
0.058667
0.096
0
0
0
0
0
0
0
0.297177
673
22
62
30.590909
0.792812
0.684993
0
0
0
0
0.173611
0.173611
0
0
0
0
0
1
0.25
true
0
0
0.25
0.75
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
1
0
0
5
c06551f2b55f91dab84a5bb5c04e87b43f003ad0
96
py
Python
venv/lib/python3.8/site-packages/parso/python/parser.py
GiulianaPola/select_repeats
17a0d053d4f874e42cf654dd142168c2ec8fbd11
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/parso/python/parser.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/python/parser.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/bd/c3/eb/fdd2d9a6f9fcd721be80003bb6f335d95aa513865b6b320fc5a89b221b
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.364583
0
96
1
96
96
0.53125
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
fbf60303de233d9796d3385d8503a11498f4956a
21,477
py
Python
neutronclient/tests/unit/osc/v2/sfc/test_port_chain.py
slawqo/python-neutronclient
ee08644c5f2424a40c70010dcf0fa2ad84809bfc
[ "Apache-2.0" ]
null
null
null
neutronclient/tests/unit/osc/v2/sfc/test_port_chain.py
slawqo/python-neutronclient
ee08644c5f2424a40c70010dcf0fa2ad84809bfc
[ "Apache-2.0" ]
null
null
null
neutronclient/tests/unit/osc/v2/sfc/test_port_chain.py
slawqo/python-neutronclient
ee08644c5f2424a40c70010dcf0fa2ad84809bfc
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2017 Huawei Technologies India Pvt.Limited. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from osc_lib import exceptions from neutronclient.osc.v2.sfc import sfc_port_chain from neutronclient.tests.unit.osc.v2.sfc import fakes def _get_id(client, id_or_name, resource): return id_or_name class TestCreateSfcPortChain(fakes.TestNeutronClientOSCV2): # The new port_chain created _port_chain = fakes.FakeSfcPortChain.create_port_chain() columns = ('Chain ID', 'Chain Parameters', 'Description', 'Flow Classifiers', 'ID', 'Name', 'Port Pair Groups', 'Project') def get_data(self): return ( self._port_chain['chain_id'], self._port_chain['chain_parameters'], self._port_chain['description'], self._port_chain['flow_classifiers'], self._port_chain['id'], self._port_chain['name'], self._port_chain['port_pair_groups'], self._port_chain['project_id'], ) def setUp(self): super(TestCreateSfcPortChain, self).setUp() mock.patch( 'neutronclient.osc.v2.sfc.sfc_port_chain._get_id', new=_get_id).start() self.neutronclient.create_sfc_port_chain = mock.Mock( return_value={'port_chain': self._port_chain}) self.data = self.get_data() # Get the command object to test self.cmd = sfc_port_chain.CreateSfcPortChain(self.app, self.namespace) def test_create_port_chain_default_options(self): arglist = [ self._port_chain['name'], "--port-pair-group", self._port_chain['port_pair_groups'] ] verifylist = [ ('name', self._port_chain['name']), ('port_pair_groups', [self._port_chain['port_pair_groups']]), ('flow_classifiers', []), ('chain_parameters', None), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = (self.cmd.take_action(parsed_args)) self.neutronclient.create_sfc_port_chain.assert_called_once_with({ 'port_chain': { 'name': self._port_chain['name'], 'port_pair_groups': [self._port_chain['port_pair_groups']]} }) self.assertEqual(self.columns, columns) self.assertEqual(self.data, data) def test_create_port_chain_all_options(self): arglist = [ "--description", self._port_chain['description'], "--port-pair-group", self._port_chain['port_pair_groups'], self._port_chain['name'], "--flow-classifier", self._port_chain['flow_classifiers'], "--chain-parameters", 'correlation=mpls,symmetric=true', ] cp = {'correlation': 'mpls', 'symmetric': 'true'} verifylist = [ ('port_pair_groups', [self._port_chain['port_pair_groups']]), ('name', self._port_chain['name']), ('description', self._port_chain['description']), ('flow_classifiers', [self._port_chain['flow_classifiers']]), ('chain_parameters', [cp]) ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = (self.cmd.take_action(parsed_args)) self.neutronclient.create_sfc_port_chain.assert_called_once_with({ 'port_chain': { 'name': self._port_chain['name'], 'port_pair_groups': [self._port_chain['port_pair_groups']], 'description': self._port_chain['description'], 'flow_classifiers': [self._port_chain['flow_classifiers']], 'chain_parameters': cp } }) self.assertEqual(self.columns, columns) self.assertEqual(self.data, data) class TestDeleteSfcPortChain(fakes.TestNeutronClientOSCV2): _port_chain = fakes.FakeSfcPortChain.create_port_chains(count=1) def setUp(self): super(TestDeleteSfcPortChain, self).setUp() mock.patch( 'neutronclient.osc.v2.sfc.sfc_port_chain._get_id', new=_get_id).start() self.neutronclient.delete_sfc_port_chain = mock.Mock(return_value=None) self.cmd = sfc_port_chain.DeleteSfcPortChain(self.app, self.namespace) def test_delete_port_chain(self): client = self.app.client_manager.neutronclient mock_port_chain_delete = client.delete_sfc_port_chain arglist = [ self._port_chain[0]['id'], ] verifylist = [ ('port_chain', self._port_chain[0]['id']), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) mock_port_chain_delete.assert_called_once_with( self._port_chain[0]['id']) self.assertIsNone(result) class TestListSfcPortChain(fakes.TestNeutronClientOSCV2): _port_chains = fakes.FakeSfcPortChain.create_port_chains(count=1) columns = ('ID', 'Name', 'Port Pair Groups', 'Flow Classifiers', 'Chain Parameters', 'Chain ID') columns_long = ('ID', 'Name', 'Port Pair Groups', 'Flow Classifiers', 'Chain Parameters', 'Description', 'Chain ID', 'Project') _port_chain = _port_chains[0] data = [ _port_chain['id'], _port_chain['name'], _port_chain['port_pair_groups'], _port_chain['flow_classifiers'], _port_chain['chain_parameters'], _port_chain['chain_id'] ] data_long = [ _port_chain['id'], _port_chain['name'], _port_chain['project_id'], _port_chain['chain_id'], _port_chain['port_pair_groups'], _port_chain['flow_classifiers'], _port_chain['chain_parameters'], _port_chain['description'] ] _port_chain1 = {'port_chains': _port_chain} _port_chain_id = _port_chain['id'] def setUp(self): super(TestListSfcPortChain, self).setUp() mock.patch( 'neutronclient.osc.v2.sfc.sfc_port_chain._get_id', new=_get_id).start() self.neutronclient.list_sfc_port_chains = mock.Mock( return_value={'port_chains': self._port_chains} ) # Get the command object to test self.cmd = sfc_port_chain.ListSfcPortChain(self.app, self.namespace) def test_list_port_chains(self): arglist = [] verifylist = [] parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns = self.cmd.take_action(parsed_args)[0] pcs = self.neutronclient.list_sfc_port_chains()['port_chains'] pc = pcs[0] data = [ pc['id'], pc['name'], pc['port_pair_groups'], pc['flow_classifiers'], pc['chain_parameters'], pc['chain_id'] ] self.assertEqual(list(self.columns), columns) self.assertEqual(self.data, data) def test_list_port_chain_with_long_opion(self): arglist = ['--long'] verifylist = [('long', True)] parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns = self.cmd.take_action(parsed_args)[0] pcs = self.neutronclient.list_sfc_port_chains()['port_chains'] pc = pcs[0] data = [ pc['id'], pc['name'], pc['project_id'], pc['chain_id'], pc['port_pair_groups'], pc['flow_classifiers'], pc['chain_parameters'], pc['description'] ] self.assertEqual(list(self.columns_long), columns) self.assertEqual(self.data_long, data) class TestSetSfcPortChain(fakes.TestNeutronClientOSCV2): _port_chain = fakes.FakeSfcPortChain.create_port_chain() resource = _port_chain res = 'port_chain' _port_chain_name = _port_chain['name'] _port_chain_id = _port_chain['id'] pc_ppg = _port_chain['port_pair_groups'] pc_fc = _port_chain['flow_classifiers'] def setUp(self): super(TestSetSfcPortChain, self).setUp() mock.patch( 'neutronclient.osc.v2.sfc.sfc_port_chain._get_id', new=_get_id).start() self.mocked = self.neutronclient.update_sfc_port_chain self.cmd = sfc_port_chain.SetSfcPortChain(self.app, self.namespace) def test_set_port_chain(self): client = self.app.client_manager.neutronclient mock_port_chain_update = client.update_sfc_port_chain arglist = [ self._port_chain_name, '--name', 'name_updated', '--description', 'desc_updated', ] verifylist = [ ('port_chain', self._port_chain_name), ('name', 'name_updated'), ('description', 'desc_updated'), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) attrs = {'port_chain': {'name': 'name_updated', 'description': 'desc_updated'}} mock_port_chain_update.assert_called_once_with(self._port_chain_name, attrs) self.assertIsNone(result) def test_set_flow_classifiers(self): target = self.resource['id'] fc1 = 'flow_classifier1' fc2 = 'flow_classifier2' def _mock_flow_classifier(*args, **kwargs): if self.neutronclient.find_resource.call_count == 1: self.neutronclient.find_resource.assert_called_with( self.res, target, cmd_resource='sfc_port_chain') return {'flow_classifiers': [self.pc_fc]} if self.neutronclient.find_resource.call_count == 2: self.neutronclient.find_resource.assert_called_with( 'flow_classifier', fc1, cmd_resource='sfc_flow_classifier') return {'id': args[1]} if self.neutronclient.find_resource.call_count == 3: self.neutronclient.find_resource.assert_called_with( 'flow_classifier', fc2, cmd_resource='sfc_flow_classifier') return {'id': args[1]} self.neutronclient.find_resource.side_effect = _mock_flow_classifier arglist = [ target, '--flow-classifier', fc1, '--flow-classifier', fc2, ] verifylist = [ (self.res, target), ('flow_classifiers', [fc1, fc2]) ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) expect = {'flow_classifiers': [self.pc_fc, fc1, fc2]} self.mocked.assert_called_once_with(target, {self.res: expect}) self.assertEqual(3, self.neutronclient.find_resource.call_count) self.assertIsNone(result) def test_set_no_flow_classifier(self): client = self.app.client_manager.neutronclient mock_port_chain_update = client.update_sfc_port_chain arglist = [ self._port_chain_name, '--no-flow-classifier', ] verifylist = [ ('port_chain', self._port_chain_name), ('no_flow_classifier', True), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) attrs = {'port_chain': {'flow_classifiers': []}} mock_port_chain_update.assert_called_once_with(self._port_chain_name, attrs) self.assertIsNone(result) def test_set_port_pair_groups(self): target = self.resource['id'] existing_ppg = self.pc_ppg ppg1 = 'port_pair_group1' ppg2 = 'port_pair_group2' def _mock_flow_classifier(*args, **kwargs): if self.neutronclient.find_resource.call_count == 1: self.neutronclient.find_resource.assert_called_with( self.res, target, cmd_resource='sfc_port_chain') return {'port_pair_groups': [self.pc_ppg]} if self.neutronclient.find_resource.call_count == 2: self.neutronclient.find_resource.assert_called_with( 'port_pair_group', ppg1, cmd_resource='sfc_port_pair_group') return {'id': args[1]} if self.neutronclient.find_resource.call_count == 3: self.neutronclient.find_resource.assert_called_with( 'port_pair_group', ppg2, cmd_resource='sfc_port_pair_group') return {'id': args[1]} self.neutronclient.find_resource.side_effect = _mock_flow_classifier arglist = [ target, '--port-pair-group', ppg1, '--port-pair-group', ppg2, ] verifylist = [ (self.res, target), ('port_pair_groups', [ppg1, ppg2]) ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) expect = {'port_pair_groups': [existing_ppg, ppg1, ppg2]} self.mocked.assert_called_once_with(target, {self.res: expect}) self.assertEqual(3, self.neutronclient.find_resource.call_count) self.assertIsNone(result) def test_set_no_port_pair_group(self): target = self.resource['id'] ppg1 = 'port_pair_group1' def _mock_port_pair_group(*args, **kwargs): if self.neutronclient.find_resource.call_count == 1: self.neutronclient.find_resource.assert_called_with( 'port_pair_group', ppg1, cmd_resource='sfc_port_pair_group') return {'id': args[1]} self.neutronclient.find_resource.side_effect = _mock_port_pair_group arglist = [ target, '--no-port-pair-group', '--port-pair-group', ppg1, ] verifylist = [ (self.res, target), ('no_port_pair_group', True), ('port_pair_groups', [ppg1]) ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) expect = {'port_pair_groups': [ppg1]} self.mocked.assert_called_once_with(target, {self.res: expect}) self.assertEqual(1, self.neutronclient.find_resource.call_count) self.assertIsNone(result) def test_set_only_no_port_pair_group(self): target = self.resource['id'] arglist = [ target, '--no-port-pair-group', ] verifylist = [ (self.res, target), ('no_port_pair_group', True), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) self.assertRaises( exceptions.CommandError, self.cmd.take_action, parsed_args) class TestShowSfcPortChain(fakes.TestNeutronClientOSCV2): _pc = fakes.FakeSfcPortChain.create_port_chain() data = ( _pc['chain_id'], _pc['chain_parameters'], _pc['description'], _pc['flow_classifiers'], _pc['id'], _pc['name'], _pc['port_pair_groups'], _pc['project_id'] ) _port_chain = {'port_chain': _pc} _port_chain_id = _pc['id'] columns = ('Chain ID', 'Chain Parameters', 'Description', 'Flow Classifiers', 'ID', 'Name', 'Port Pair Groups', 'Project') def setUp(self): super(TestShowSfcPortChain, self).setUp() mock.patch( 'neutronclient.osc.v2.sfc.sfc_port_chain._get_id', new=_get_id).start() self.neutronclient.show_sfc_port_chain = mock.Mock( return_value=self._port_chain ) # Get the command object to test self.cmd = sfc_port_chain.ShowSfcPortChain(self.app, self.namespace) def test_show_port_chain(self): client = self.app.client_manager.neutronclient mock_port_chain_show = client.show_sfc_port_chain arglist = [ self._port_chain_id, ] verifylist = [ ('port_chain', self._port_chain_id), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) mock_port_chain_show.assert_called_once_with(self._port_chain_id) self.assertEqual(self.columns, columns) self.assertEqual(self.data, data) class TestUnsetSfcPortChain(fakes.TestNeutronClientOSCV2): _port_chain = fakes.FakeSfcPortChain.create_port_chain() resource = _port_chain res = 'port_chain' _port_chain_name = _port_chain['name'] _port_chain_id = _port_chain['id'] pc_ppg = _port_chain['port_pair_groups'] pc_fc = _port_chain['flow_classifiers'] def setUp(self): super(TestUnsetSfcPortChain, self).setUp() mock.patch( 'neutronclient.osc.v2.sfc.sfc_port_chain._get_id', new=_get_id).start() self.neutronclient.update_sfc_port_chain = mock.Mock( return_value=None) self.mocked = self.neutronclient.update_sfc_port_chain self.cmd = sfc_port_chain.UnsetSfcPortChain(self.app, self.namespace) def test_unset_port_pair_group(self): target = self.resource['id'] ppg1 = 'port_pair_group1' def _mock_port_pair_group(*args, **kwargs): if self.neutronclient.find_resource.call_count == 1: self.neutronclient.find_resource.assert_called_with( self.res, target, cmd_resource='sfc_port_chain') return {'port_pair_groups': [self.pc_ppg]} if self.neutronclient.find_resource.call_count == 2: self.neutronclient.find_resource.assert_called_with( 'port_pair_group', ppg1, cmd_resource='sfc_port_pair_group') return {'id': args[1]} if self.neutronclient.find_resource.call_count == 3: self.neutronclient.find_resource.assert_called_with( self.res, target, cmd_resource='sfc_port_chain') return {'id': args[1]} self.neutronclient.find_resource.side_effect = _mock_port_pair_group arglist = [ target, '--port-pair-group', ppg1, ] verifylist = [ (self.res, target), ('port_pair_groups', [ppg1]) ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) expect = {'port_pair_groups': [self.pc_ppg]} self.mocked.assert_called_once_with(target, {self.res: expect}) self.assertIsNone(result) def test_unset_flow_classifier(self): target = self.resource['id'] fc1 = 'flow_classifier1' def _mock_flow_classifier(*args, **kwargs): if self.neutronclient.find_resource.call_count == 1: self.neutronclient.find_resource.assert_called_with( self.res, target, cmd_resource='sfc_port_chain') return {'flow_classifiers': [self.pc_fc]} if self.neutronclient.find_resource.call_count == 2: self.neutronclient.find_resource.assert_called_with( 'flow_classifier', fc1, cmd_resource='sfc_flow_classifier') return {'id': args[1]} self.neutronclient.find_resource.side_effect = _mock_flow_classifier arglist = [ target, '--flow-classifier', fc1, ] verifylist = [ (self.res, target), ('flow_classifiers', [fc1]) ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) expect = {'flow_classifiers': [self.pc_fc]} self.mocked.assert_called_once_with(target, {self.res: expect}) self.assertIsNone(result) def test_unset_all_flow_classifier(self): client = self.app.client_manager.neutronclient target = self.resource['id'] mock_port_chain_update = client.update_sfc_port_chain arglist = [ target, '--all-flow-classifier', ] verifylist = [ (self.res, target), ('all_flow_classifier', True) ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) expect = {'flow_classifiers': []} mock_port_chain_update.assert_called_once_with(target, {self.res: expect}) self.assertIsNone(result)
38.215302
79
0.607208
2,371
21,477
5.153522
0.083509
0.104591
0.042557
0.075947
0.821262
0.784925
0.754153
0.706032
0.680989
0.631394
0
0.006221
0.28151
21,477
561
80
38.283422
0.785626
0.034828
0
0.607966
0
0
0.14196
0.016127
0
0
0
0
0.098532
1
0.0587
false
0
0.008386
0.004193
0.171908
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2210f27f7b817955a0b4de2d8698fbb20f566838
174
py
Python
accounts/models.py
LokeshBolisetty/Webapp-django
51fd6d3224dfd4295e7688b8fa6c88f1c11dfe9a
[ "MIT" ]
null
null
null
accounts/models.py
LokeshBolisetty/Webapp-django
51fd6d3224dfd4295e7688b8fa6c88f1c11dfe9a
[ "MIT" ]
null
null
null
accounts/models.py
LokeshBolisetty/Webapp-django
51fd6d3224dfd4295e7688b8fa6c88f1c11dfe9a
[ "MIT" ]
null
null
null
from django.db import models #This app uses the django User table itself. If that is not something required then models for accounts can be made here with required fields.
58
142
0.798851
30
174
4.633333
0.9
0
0
0
0
0
0
0
0
0
0
0
0.178161
174
3
142
58
0.972028
0.810345
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
2213b9549c3a080b06ff2412f8950bc53b6f4da8
46
py
Python
xlab/colab/start_local_runtime.py
dayfine/xlab
2c51d84906d5eba568e5b5c70225c2eccb1b9fc3
[ "MIT" ]
2
2020-05-06T04:05:30.000Z
2020-11-10T16:23:50.000Z
xlab/colab/start_local_runtime.py
dayfine/xlab
2c51d84906d5eba568e5b5c70225c2eccb1b9fc3
[ "MIT" ]
14
2020-05-06T06:37:50.000Z
2021-10-30T03:38:05.000Z
xlab/colab/start_local_runtime.py
dayfine/xlab
2c51d84906d5eba568e5b5c70225c2eccb1b9fc3
[ "MIT" ]
null
null
null
from notebook.notebookapp import main main()
11.5
37
0.804348
6
46
6.166667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.130435
46
3
38
15.333333
0.925
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
225cf7a6cd572302f762a3e45c059ba76f4a3040
74
py
Python
qposts/__init__.py
glryanon/Trusty-cogs
1d5056ad166a7e7ee5039baa31748b1995ae81f6
[ "MIT" ]
1
2020-12-28T15:58:16.000Z
2020-12-28T15:58:16.000Z
qposts/__init__.py
glryanon/Trusty-cogs
1d5056ad166a7e7ee5039baa31748b1995ae81f6
[ "MIT" ]
null
null
null
qposts/__init__.py
glryanon/Trusty-cogs
1d5056ad166a7e7ee5039baa31748b1995ae81f6
[ "MIT" ]
null
null
null
from .qposts import QPosts def setup(bot): bot.add_cog(QPosts(bot))
12.333333
28
0.702703
12
74
4.25
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.175676
74
5
29
14.8
0.836066
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
97d7f06b25d2b7f0c2341f6ef7cbca7d7317607c
2,250
py
Python
member_resources/migrations/0001_initial.py
atish3/mig-website
1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be
[ "Apache-2.0" ]
4
2017-10-02T17:44:14.000Z
2020-02-14T17:13:57.000Z
member_resources/migrations/0001_initial.py
atish3/mig-website
1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be
[ "Apache-2.0" ]
152
2015-01-04T00:08:44.000Z
2022-01-13T00:43:03.000Z
member_resources/migrations/0001_initial.py
atish3/mig-website
1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be
[ "Apache-2.0" ]
4
2015-04-16T04:27:05.000Z
2021-03-21T20:45:24.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('mig_main', '__first__'), ] operations = [ migrations.CreateModel( name='ActiveList', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('uniqname', models.CharField(max_length=8, validators=[django.core.validators.RegexValidator(regex=b'^[a-z]{3,8}$', message=b'Uniqnames must be 3-8 characters, all letters')])), ], options={ 'abstract': False, }, bases=(models.Model,), ), migrations.CreateModel( name='GradElecteeList', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('uniqname', models.CharField(max_length=8, validators=[django.core.validators.RegexValidator(regex=b'^[a-z]{3,8}$', message=b'Uniqnames must be 3-8 characters, all letters')])), ], options={ 'abstract': False, }, bases=(models.Model,), ), migrations.CreateModel( name='ProjectLeaderList', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('member_profile', models.ForeignKey(to='mig_main.MemberProfile')), ], options={ }, bases=(models.Model,), ), migrations.CreateModel( name='UndergradElecteeList', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('uniqname', models.CharField(max_length=8, validators=[django.core.validators.RegexValidator(regex=b'^[a-z]{3,8}$', message=b'Uniqnames must be 3-8 characters, all letters')])), ], options={ 'abstract': False, }, bases=(models.Model,), ), ]
38.135593
194
0.556
214
2,250
5.719626
0.299065
0.009804
0.065359
0.075163
0.744281
0.744281
0.710784
0.710784
0.710784
0.710784
0
0.010159
0.3
2,250
58
195
38.793103
0.766984
0.009333
0
0.653846
0
0
0.157162
0.009879
0
0
0
0
0
1
0
false
0
0.057692
0
0.115385
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
97f639f0f1cbbd019778537b80adc4fb6dd83c68
223
py
Python
memberships/admin.py
LeeSinLiang/course_subscription
ef9d78e09271b0002a74b20358b761fb5bb04e4e
[ "MIT" ]
1
2018-12-30T10:57:46.000Z
2018-12-30T10:57:46.000Z
memberships/admin.py
LeeSinLiang/course_subscription
ef9d78e09271b0002a74b20358b761fb5bb04e4e
[ "MIT" ]
null
null
null
memberships/admin.py
LeeSinLiang/course_subscription
ef9d78e09271b0002a74b20358b761fb5bb04e4e
[ "MIT" ]
1
2019-01-21T06:15:56.000Z
2019-01-21T06:15:56.000Z
from django.contrib import admin from .models import Membership,UserMembership,Subscription # Register your models here. admin.site.register(Membership) admin.site.register(UserMembership) admin.site.register(Subscription)
31.857143
58
0.847534
27
223
7
0.481481
0.142857
0.269841
0
0
0
0
0
0
0
0
0
0.071749
223
7
59
31.857143
0.913043
0.116592
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3f41c0e82da098a7ef144bc1385db9362f3208c8
231
py
Python
tests/test_utils.py
kanderso-nrel/pytest-notebook
40381be0963a8866d1a46994595844bbfb4e66c1
[ "BSD-3-Clause" ]
37
2019-08-10T20:09:38.000Z
2022-03-01T22:17:59.000Z
tests/test_utils.py
kanderso-nrel/pytest-notebook
40381be0963a8866d1a46994595844bbfb4e66c1
[ "BSD-3-Clause" ]
15
2019-12-09T14:34:14.000Z
2022-01-18T13:32:50.000Z
tests/test_utils.py
kanderso-nrel/pytest-notebook
40381be0963a8866d1a46994595844bbfb4e66c1
[ "BSD-3-Clause" ]
7
2020-04-14T10:57:15.000Z
2022-02-10T09:18:30.000Z
from pytest_notebook.utils import autodoc from pytest_notebook.nb_regression import NBRegressionFixture def test_autodoc(file_regression): new_class = autodoc(NBRegressionFixture) file_regression.check(new_class.__doc__)
28.875
61
0.844156
28
231
6.535714
0.571429
0.10929
0.196721
0
0
0
0
0
0
0
0
0
0.103896
231
7
62
33
0.884058
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.4
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
0
0
1
0
1
0
0
5
3f5b83ea3d2080093363da492141d3555a9aaeb4
130
py
Python
prae/envs/__init__.py
irom-lab/RL_Generalization
82add6898ee2e962a3aa5efedf80821a013eae7f
[ "MIT" ]
24
2020-06-30T11:43:38.000Z
2021-11-15T22:58:47.000Z
prae/envs/__init__.py
irom-lab/RL_Generalization
82add6898ee2e962a3aa5efedf80821a013eae7f
[ "MIT" ]
null
null
null
prae/envs/__init__.py
irom-lab/RL_Generalization
82add6898ee2e962a3aa5efedf80821a013eae7f
[ "MIT" ]
4
2020-10-15T10:54:18.000Z
2021-05-25T07:38:14.000Z
from .cartpole_wrapper import CartpoleWrapper from .room import RoomEnv from .fashion_translate import FashionMnistTranslate2dEnv
32.5
57
0.884615
14
130
8.071429
0.714286
0
0
0
0
0
0
0
0
0
0
0.008475
0.092308
130
3
58
43.333333
0.949153
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3f6e08ba05836a024b7c3a71f691cff440f3863c
58
py
Python
src/app/services/__init__.py
ferdn4ndo/candlestick-data-lake
93dab21740fcdd3807c23d9cc4b99e0420c76a02
[ "MIT" ]
null
null
null
src/app/services/__init__.py
ferdn4ndo/candlestick-data-lake
93dab21740fcdd3807c23d9cc4b99e0420c76a02
[ "MIT" ]
15
2021-03-17T22:22:30.000Z
2022-02-08T23:09:00.000Z
src/app/services/__init__.py
ferdn4ndo/candlestick-data-lake
93dab21740fcdd3807c23d9cc4b99e0420c76a02
[ "MIT" ]
null
null
null
from app.services.database_service import DatabaseService
29
57
0.896552
7
58
7.285714
1
0
0
0
0
0
0
0
0
0
0
0
0.068966
58
1
58
58
0.944444
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
58e88ffe8be9694e1ddf59e4011c973b425e6a56
42
py
Python
tests/__init__.py
davewd/project_mgmt
1575f78a4b07e38212000faf4499c5be1e9658b6
[ "MIT" ]
null
null
null
tests/__init__.py
davewd/project_mgmt
1575f78a4b07e38212000faf4499c5be1e9658b6
[ "MIT" ]
null
null
null
tests/__init__.py
davewd/project_mgmt
1575f78a4b07e38212000faf4499c5be1e9658b6
[ "MIT" ]
null
null
null
"""Unit test package for project_mgmt."""
21
41
0.714286
6
42
4.833333
1
0
0
0
0
0
0
0
0
0
0
0
0.119048
42
1
42
42
0.783784
0.833333
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
58e96083390050032f5e57c4ea863c58196acb8d
280
py
Python
hxlm/core/localization/__init__.py
EticaAI/HXL-Data-Science-file-formats
c7c5aa56c452ac1613242ee04cc9ae66f38ec24d
[ "Unlicense" ]
3
2021-01-25T20:44:10.000Z
2021-04-19T22:47:05.000Z
hxlm/core/localization/__init__.py
fititnt/HXL-Data-Science-file-formats
f4fe9866e53280767f9cb4c8c488ef9c8b9d33cd
[ "Unlicense" ]
24
2021-01-26T00:36:39.000Z
2021-11-13T23:59:56.000Z
hxlm/core/localization/__init__.py
fititnt/HXL-Data-Science-file-formats
f4fe9866e53280767f9cb4c8c488ef9c8b9d33cd
[ "Unlicense" ]
1
2021-09-05T03:43:37.000Z
2021-09-05T03:43:37.000Z
"""hxlm.core.localization contain localization (L10N) modules TODO: check these references - https://github.com/unicode-org/cldr """ from hxlm.core.localization.util import * # noqa # from hxlm.core.localization.hdp import * # noqa # import hxlm.core as HXLm
21.538462
62
0.703571
36
280
5.472222
0.611111
0.162437
0.304569
0.243655
0
0
0
0
0
0
0
0.008734
0.182143
280
12
63
23.333333
0.851528
0.739286
0
0
0
0
0
0
0
0
0
0.083333
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
1
0
0
0
0
5
4518a6599e2b8bb596b3e30342dc6cd7ca1a9a9a
117
py
Python
test/decapitalize/decapitalize.py
OmarTahoun/30-seconds-of-python-code
d94bc9bf52701018aabc5dcd89809797f9179847
[ "CC0-1.0" ]
2
2019-05-13T17:29:23.000Z
2019-09-22T01:55:13.000Z
test/decapitalize/decapitalize.py
OmarTahoun/30-seconds-of-python-code
d94bc9bf52701018aabc5dcd89809797f9179847
[ "CC0-1.0" ]
8
2020-03-24T17:47:23.000Z
2022-03-12T00:33:21.000Z
test/decapitalize/decapitalize.py
OmarTahoun/30-seconds-of-python-code
d94bc9bf52701018aabc5dcd89809797f9179847
[ "CC0-1.0" ]
2
2020-08-07T05:38:27.000Z
2021-11-09T11:54:18.000Z
def decapitalize(string, upper_rest=False): return str[:1].lower() + (str[1:].upper() if upper_rest else str[1:])
58.5
73
0.683761
19
117
4.105263
0.631579
0.153846
0
0
0
0
0
0
0
0
0
0.029126
0.119658
117
2
73
58.5
0.728155
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
18a6265240ebedc73d1c9cc91c55b22bea3d3475
52
py
Python
lambdas/sns_lambda_demo/whatever/utils.py
projectweekend/aws-sns-lambda-demo
cc4efec428f870f35f3555ef71cf39293c245aa4
[ "MIT" ]
1
2017-10-13T17:20:01.000Z
2017-10-13T17:20:01.000Z
lambdas/sns_lambda_demo/whatever/utils.py
projectweekend/aws-sns-lambda-demo
cc4efec428f870f35f3555ef71cf39293c245aa4
[ "MIT" ]
null
null
null
lambdas/sns_lambda_demo/whatever/utils.py
projectweekend/aws-sns-lambda-demo
cc4efec428f870f35f3555ef71cf39293c245aa4
[ "MIT" ]
null
null
null
def do_something(): print('did something else')
17.333333
31
0.692308
7
52
5
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.173077
52
2
32
26
0.813953
0
0
0
0
0
0.346154
0
0
0
0
0
0
1
0.5
true
0
0
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
1
0
5
e193d4df0015ffd41429d5e8b333cf6d16ac980b
106
py
Python
auth_api/admin.py
sheheryarali98/django-rest-api
557e4bed417c016e50379f840ecbd6e02477979d
[ "MIT" ]
null
null
null
auth_api/admin.py
sheheryarali98/django-rest-api
557e4bed417c016e50379f840ecbd6e02477979d
[ "MIT" ]
null
null
null
auth_api/admin.py
sheheryarali98/django-rest-api
557e4bed417c016e50379f840ecbd6e02477979d
[ "MIT" ]
null
null
null
"""Admin settings""" from django.contrib import admin from .models import User admin.site.register(User)
17.666667
32
0.773585
15
106
5.466667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.113208
106
5
33
21.2
0.87234
0.132075
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
bed799ba0f4ce7fa03344b83cb8355481cdb058f
115
py
Python
sanansaattaja/website/forms/__init__.py
Orijuke/WEB-PROJECT-O-ED
66a1e5024af46f84d8f833a4b5ebed06e575efab
[ "MIT" ]
null
null
null
sanansaattaja/website/forms/__init__.py
Orijuke/WEB-PROJECT-O-ED
66a1e5024af46f84d8f833a4b5ebed06e575efab
[ "MIT" ]
null
null
null
sanansaattaja/website/forms/__init__.py
Orijuke/WEB-PROJECT-O-ED
66a1e5024af46f84d8f833a4b5ebed06e575efab
[ "MIT" ]
null
null
null
from .login_form import LoginForm from .register_form import RegisterForm __all__ = ['LoginForm', 'RegisterForm']
23
39
0.8
13
115
6.615385
0.615385
0.232558
0
0
0
0
0
0
0
0
0
0
0.113043
115
4
40
28.75
0.843137
0
0
0
0
0
0.182609
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
bee0d381aa9c11d90a455e2da3cf8b7ffdd4dba5
7,126
py
Python
BADNet/src/SC/contract_abi.py
Decentralized-Anonymity-Network/BadNet
b70cdecb03640eb6048d5e0954435a7491500828
[ "MIT" ]
6
2021-08-03T13:41:19.000Z
2022-03-20T12:25:53.000Z
BADNet/src/SC/contract_abi.py
Decentralized-Anonymity-Network/BadNet
b70cdecb03640eb6048d5e0954435a7491500828
[ "MIT" ]
null
null
null
BADNet/src/SC/contract_abi.py
Decentralized-Anonymity-Network/BadNet
b70cdecb03640eb6048d5e0954435a7491500828
[ "MIT" ]
1
2021-08-07T15:01:09.000Z
2021-08-07T15:01:09.000Z
true = True false = False abi = [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "stateMutability": "payable", "type": "fallback" }, { "inputs": [], "name": "client_cancellation", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "client_delete_random_index", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "i", "type": "uint256" } ], "name": "client_download_MSRI", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "i", "type": "uint256" } ], "name": "client_download_encrypted_keys", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "client_generate_random_index", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "client_get_RIAlength", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "client_get_current_RIA_length", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "client_get_update_period", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes", "name": "str", "type": "bytes" } ], "name": "client_register", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "client_registration_check", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address payable", "name": "addr", "type": "address" } ], "name": "contract_transfer_to_relay", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "Addr", "type": "address" } ], "name": "getClientFlag", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "addr", "type": "address" } ], "name": "getRIA", "outputs": [ { "internalType": "uint16[]", "name": "", "type": "uint16[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "i", "type": "uint16" } ], "name": "getRelayFlag", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getclientNum", "outputs": [ { "internalType": "uint24", "name": "", "type": "uint24" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "i", "type": "uint16" } ], "name": "getinfo", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getrelayIndex", "outputs": [ { "internalType": "uint16", "name": "", "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "Addr", "type": "address" }, { "internalType": "bool", "name": "flag", "type": "bool" } ], "name": "modifyClientFlag", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint16", "name": "i", "type": "uint16" }, { "internalType": "bool", "name": "flag", "type": "bool" } ], "name": "modifyRelayFlag", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "relay_cancellation", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "i", "type": "uint256" } ], "name": "relay_download_clients_public_keys", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "relay_get_clientlist_length", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "relay_get_upload_period", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "relay_register", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "relay_registration_check", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes", "name": "info", "type": "bytes" }, { "internalType": "uint256", "name": "num", "type": "uint256" }, { "internalType": "bytes[]", "name": "keys", "type": "bytes[]" } ], "name": "relay_upload_SRI_and_keys", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "i", "type": "uint256" }, { "internalType": "uint256", "name": "num", "type": "uint256" }, { "internalType": "bytes[]", "name": "keys", "type": "bytes[]" } ], "name": "relay_upload_keys", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint8", "name": "num", "type": "uint8" } ], "name": "setRIAlength", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "period", "type": "uint256" } ], "name": "setRIAperiod", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "period", "type": "uint256" } ], "name": "setSRIperiod", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ]
15.835556
47
0.493825
518
7,126
6.702703
0.135135
0.103687
0.150346
0.138249
0.834389
0.815092
0.813076
0.772465
0.635369
0.62068
0
0.021248
0.260314
7,126
450
48
15.835556
0.63745
0
0
0.585746
0
0
0.492634
0.04504
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
bef5a249857c289ee3f35e38c83d32ad2a56816d
240
py
Python
app/main/errors.py
bluejazzCHN/python-flask-web
e4326f5bee9704f3408f851b04888bd35cc3af98
[ "MIT" ]
1
2019-11-20T03:02:32.000Z
2019-11-20T03:02:32.000Z
app/main/errors.py
bluejazzCHN/python-flask-web
e4326f5bee9704f3408f851b04888bd35cc3af98
[ "MIT" ]
null
null
null
app/main/errors.py
bluejazzCHN/python-flask-web
e4326f5bee9704f3408f851b04888bd35cc3af98
[ "MIT" ]
null
null
null
from flask import render_template from . import blue @blue.app_errorhandler def page_not_found(e): return render_template('404.html'),404 @blue.app_errorhandler def internal_server_error(e): return render_template('500.html'),500
24
42
0.7875
36
240
5
0.555556
0.233333
0.211111
0.244444
0
0
0
0
0
0
0
0.056604
0.116667
240
10
43
24
0.792453
0
0
0.25
0
0
0.06639
0
0
0
0
0
0
1
0.25
false
0
0.25
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
0
0
0
5
befad22152b97d49a08b67dc94a41cb408883e3f
91
py
Python
python_test.py
rainwangphy/AdversarialNAS
6ddefdd524cb97c161bcc3b226009e768192c5aa
[ "MIT" ]
null
null
null
python_test.py
rainwangphy/AdversarialNAS
6ddefdd524cb97c161bcc3b226009e768192c5aa
[ "MIT" ]
null
null
null
python_test.py
rainwangphy/AdversarialNAS
6ddefdd524cb97c161bcc3b226009e768192c5aa
[ "MIT" ]
null
null
null
import torch aaa = torch.rand((3, 5)) print(aaa[:5].view(-1)) print(aaa[:5].reshape(-1))
13
26
0.615385
17
91
3.294118
0.588235
0.285714
0.321429
0
0
0
0
0
0
0
0
0.074074
0.10989
91
6
27
15.166667
0.617284
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.5
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
8301232b596a9806ba9a5c198a588415bad47da8
1,857
py
Python
tests/test_checks.py
johnnoone/aioconsul
02f7a529d7dc2e49bed942111067aa5faf320e90
[ "BSD-3-Clause" ]
7
2015-03-17T18:29:14.000Z
2020-01-03T06:45:43.000Z
tests/test_checks.py
johnnoone/aioconsul
02f7a529d7dc2e49bed942111067aa5faf320e90
[ "BSD-3-Clause" ]
1
2015-06-04T03:06:46.000Z
2015-06-04T03:06:46.000Z
tests/test_checks.py
johnnoone/aioconsul
02f7a529d7dc2e49bed942111067aa5faf320e90
[ "BSD-3-Clause" ]
2
2015-06-03T16:53:11.000Z
2021-12-16T13:38:23.000Z
import pytest from datetime import timedelta @pytest.mark.asyncio async def test_endpoint(client): assert repr(client.checks) == "<ChecksEndpoint(%r)>" % str(client.address) @pytest.mark.asyncio async def test_no_checks(client): result = await client.checks.items() assert isinstance(result, dict) assert not result @pytest.mark.asyncio async def test_check_ttl(client, server): check = { "ID": "foobar", "Name": "Foobar bar check", "TTL": timedelta(seconds=2), } result = await client.checks.register(check) assert result is True result = await client.checks.items() assert isinstance(result, dict) assert "foobar" in result assert result["foobar"]["Status"] == "critical" # TODO check in catalog that is really critical result = await client.checks.passing(check) assert result is True result = await client.checks.items() assert isinstance(result, dict) assert "foobar" in result assert result["foobar"]["Status"] == "passing" # TODO check in catalog that is really passing result = await client.checks.warning(check) assert result is True result = await client.checks.items() assert isinstance(result, dict) assert "foobar" in result assert result["foobar"]["Status"] == "warning" # TODO check in catalog that is really warning result = await client.checks.critical(check) assert result is True result = await client.checks.items() assert isinstance(result, dict) assert "foobar" in result assert result["foobar"]["Status"] == "critical" # TODO check in catalog that is really critical result = await client.checks.deregister(check) assert result is True result = await client.checks.items() assert isinstance(result, dict) assert "foobar" not in result
26.528571
78
0.684437
233
1,857
5.433476
0.206009
0.113744
0.147709
0.199842
0.725118
0.725118
0.656398
0.609005
0.609005
0.609005
0
0.000684
0.21217
1,857
69
79
26.913043
0.864662
0.097469
0
0.565217
0
0
0.095153
0
0
0
0
0.014493
0.478261
1
0
false
0.043478
0.043478
0
0.043478
0
0
0
0
null
0
0
1
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
1
0
0
0
0
0
0
0
0
0
5
8328a20eb35e541acf7e9e57f0db95e9f79957ab
597
py
Python
django_downloadview/lighttpd/__init__.py
cjdreiss/django-downloadview
292ac1de978654d2cab9da07c3f7297e22a53b62
[ "BSD-3-Clause" ]
null
null
null
django_downloadview/lighttpd/__init__.py
cjdreiss/django-downloadview
292ac1de978654d2cab9da07c3f7297e22a53b62
[ "BSD-3-Clause" ]
null
null
null
django_downloadview/lighttpd/__init__.py
cjdreiss/django-downloadview
292ac1de978654d2cab9da07c3f7297e22a53b62
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """Optimizations for Lighttpd. See also `documentation of X-Sendfile for Lighttpd <http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file>`_ and :doc:`narrative documentation about Lighttpd optimizations </optimizations/lighttpd>`. """ # API shortcuts. from django_downloadview.lighttpd.decorators import x_sendfile # NoQA from django_downloadview.lighttpd.response import XSendfileResponse # NoQA from django_downloadview.lighttpd.tests import assert_x_sendfile # NoQA from django_downloadview.lighttpd.middlewares import XSendfileMiddleware # NoQA
39.8
80
0.81072
71
597
6.704225
0.521127
0.084034
0.184874
0.252101
0.252101
0.180672
0.180672
0
0
0
0
0.001852
0.095477
597
14
81
42.642857
0.87963
0.509213
0
0
0
0
0
0
0
0
0
0
0.25
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8333e37cbc4960520aa9ace734a5a5f72b1502ed
632
py
Python
medical_etls/part3/python_movies_service_api/services/RolesService.py
CALlanoR/virtual_environments
90214851d6c3760e1a4afb48017bb7f91593e29e
[ "Apache-2.0" ]
null
null
null
medical_etls/part3/python_movies_service_api/services/RolesService.py
CALlanoR/virtual_environments
90214851d6c3760e1a4afb48017bb7f91593e29e
[ "Apache-2.0" ]
1
2022-03-02T14:54:47.000Z
2022-03-02T14:54:47.000Z
java/java-gateway-users-movies/python_movies_service_api/services/RolesService.py
CALlanoR/virtual_environments
90214851d6c3760e1a4afb48017bb7f91593e29e
[ "Apache-2.0" ]
1
2017-03-16T14:58:03.000Z
2017-03-16T14:58:03.000Z
from repositories.RolesRepository import RolesRepository class RolesService(object): def __init__(self): self.roles_repository = RolesRepository() def add_rol(self, name): return self.roles_repository.add_rol(name) def get_all_roles(self, page, pagesize, name): return self.roles_repository.get_all_roles(page, pagesize, name) def get_rol_by_id(self, id): return self.roles_repository.get_rol_by_id(id) def update_rol(self, id, name): return self.roles_repository.update_rol(id, name) def delete_rol(self, id): return self.roles_repository.delete_rol(id)
31.6
72
0.721519
87
632
4.942529
0.275862
0.125581
0.265116
0.290698
0.360465
0.144186
0
0
0
0
0
0
0.188291
632
20
73
31.6
0.838207
0
0
0
0
0
0
0
0
0
0
0
0
1
0.428571
false
0
0.071429
0.357143
0.928571
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
0
0
0
1
1
0
0
5
8337fc26c1153ea7138ccd4a80d7e8726e7a5ac8
458
py
Python
icv/detector/__init__.py
dmxj/icv
0b074ec9475f2c70038d2e8b7166414fd5b93e61
[ "MIT" ]
5
2019-09-10T04:02:19.000Z
2020-07-24T07:46:08.000Z
icv/detector/__init__.py
dmxj/icv
0b074ec9475f2c70038d2e8b7166414fd5b93e61
[ "MIT" ]
null
null
null
icv/detector/__init__.py
dmxj/icv
0b074ec9475f2c70038d2e8b7166414fd5b93e61
[ "MIT" ]
1
2020-03-20T03:44:04.000Z
2020-03-20T03:44:04.000Z
# -*- coding: UTF-8 -*- from .service.client import DetectorClient try: from .tf_obj import TfObjectDetector except Exception as e: pass try: from .mb import MbDetector except Exception as e: pass try: from .mmd import MmdetDetector except Exception as e: pass try: from .pp_det import PPDetector except Exception as e: pass # __all__ = ['DetectorClient', 'TfObjectDetector', 'MbDetector', 'MmdetDetector', 'PPDetector']
18.32
95
0.70524
56
458
5.660714
0.446429
0.088328
0.214511
0.227129
0.343849
0.274448
0.274448
0
0
0
0
0.002747
0.20524
458
24
96
19.083333
0.868132
0.251092
0
0.705882
0
0
0
0
0
0
0
0
0
1
0
true
0.235294
0.294118
0
0.294118
0
0
0
0
null
0
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
0
0
1
1
0
0
0
0
0
5
835e8dcab1bf51c3231d89dbfee1918eaa429d20
22
py
Python
hello_world.py
romit07/profiles-rest-api
79b3275b60deb821641c9663f54b933605cfc935
[ "MIT" ]
null
null
null
hello_world.py
romit07/profiles-rest-api
79b3275b60deb821641c9663f54b933605cfc935
[ "MIT" ]
null
null
null
hello_world.py
romit07/profiles-rest-api
79b3275b60deb821641c9663f54b933605cfc935
[ "MIT" ]
null
null
null
print('hello romit!')
11
21
0.681818
3
22
5
1
0
0
0
0
0
0
0
0
0
0
0
0.090909
22
1
22
22
0.75
0
0
0
0
0
0.545455
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
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
5
55c33361421f6c736885168a5e66e397f891c1cf
429
py
Python
pynet/lesson8/exercise1b.py
ehlodex/Python3
126c4662d1371ec6cbc1f257bd3de5c1dcdc86a6
[ "MIT" ]
null
null
null
pynet/lesson8/exercise1b.py
ehlodex/Python3
126c4662d1371ec6cbc1f257bd3de5c1dcdc86a6
[ "MIT" ]
null
null
null
pynet/lesson8/exercise1b.py
ehlodex/Python3
126c4662d1371ec6cbc1f257bd3de5c1dcdc86a6
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 """ PyNet Lesson 8, Exercise 1b In a separate Python file named 'my_devices.py', define a dictionary named 'rtr1' with the following key-value pairs: host = rtr1.domain.com username = cisco password = cisco123 device_type = cisco_ios Import my_devices into this program, and print the rtr1 dictionary to the screen using pprint. """ import my_devices from pprint import pprint pprint(my_devices.rtr1)
22.578947
94
0.776224
68
429
4.808824
0.705882
0.110092
0.091743
0
0
0
0
0
0
0
0
0.027473
0.151515
429
18
95
23.833333
0.870879
0.81352
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0.666667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
1
0
5
55cc148c30cfd7e24dce79261787b328986d11ad
116
py
Python
deep_gw_pe_followup/__init__.py
avivajpeyi/gw_pe_judge
151d597fdd6128a278e1d4cff65d3e6776e1fa83
[ "MIT" ]
null
null
null
deep_gw_pe_followup/__init__.py
avivajpeyi/gw_pe_judge
151d597fdd6128a278e1d4cff65d3e6776e1fa83
[ "MIT" ]
null
null
null
deep_gw_pe_followup/__init__.py
avivajpeyi/gw_pe_judge
151d597fdd6128a278e1d4cff65d3e6776e1fa83
[ "MIT" ]
null
null
null
import os DIR = os.path.dirname(__file__) def get_mpl_style(): return os.path.join(DIR, "plotting.mplstyle")
14.5
49
0.715517
18
116
4.277778
0.777778
0.155844
0
0
0
0
0
0
0
0
0
0
0.146552
116
7
50
16.571429
0.777778
0
0
0
0
0
0.146552
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
55e31af822e63307fb9879d286d3082aa00e2da3
111
py
Python
src/backend/logs_file_parser/exception.py
CarlosAMolina/logs-analyzer
b381d0c7ae4c5a8b6911d2b7019baa74208192c6
[ "MIT" ]
null
null
null
src/backend/logs_file_parser/exception.py
CarlosAMolina/logs-analyzer
b381d0c7ae4c5a8b6911d2b7019baa74208192c6
[ "MIT" ]
null
null
null
src/backend/logs_file_parser/exception.py
CarlosAMolina/logs-analyzer
b381d0c7ae4c5a8b6911d2b7019baa74208192c6
[ "MIT" ]
null
null
null
class BaseValidationError(ValueError): pass class LogInFileNotParsedError(BaseValidationError): pass
15.857143
51
0.801802
8
111
11.125
0.625
0
0
0
0
0
0
0
0
0
0
0
0.144144
111
6
52
18.5
0.936842
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
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
1
0
0
0
0
0
5
55f7bb98775eb05d7643089d74b3726df10087ec
140
py
Python
webargscontrib/utils/types.py
marcellarius/webargscontrib.utils
af1794cc3fe00b72e2570562fdbfbfb416b43df4
[ "MIT" ]
null
null
null
webargscontrib/utils/types.py
marcellarius/webargscontrib.utils
af1794cc3fe00b72e2570562fdbfbfb416b43df4
[ "MIT" ]
null
null
null
webargscontrib/utils/types.py
marcellarius/webargscontrib.utils
af1794cc3fe00b72e2570562fdbfbfb416b43df4
[ "MIT" ]
null
null
null
__author__ = 'sam' from .string import lowercase def boolean(value): return lowercase(value) in {True, "true", "t", "1", "yes", "on"}
20
68
0.642857
19
140
4.526316
0.842105
0
0
0
0
0
0
0
0
0
0
0.008621
0.171429
140
6
69
23.333333
0.732759
0
0
0
0
0
0.1
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
366c860f583f9b413322487b68859058b9acd75d
233
py
Python
model-exchange/common/pytorch/__init__.py
yangjian615/OpenI-Octopus
6c7f440e5fb8e564feaa5fb72f86b23fa68b294b
[ "OML" ]
24
2018-12-15T16:33:31.000Z
2019-09-23T08:26:36.000Z
model-exchange/common/pytorch/__init__.py
yangjian615/OpenI-Octopus
6c7f440e5fb8e564feaa5fb72f86b23fa68b294b
[ "OML" ]
19
2020-02-10T09:42:08.000Z
2022-03-03T22:38:31.000Z
model-exchange/common/pytorch/__init__.py
yangjian615/OpenI-Octopus
6c7f440e5fb8e564feaa5fb72f86b23fa68b294b
[ "OML" ]
11
2019-10-12T07:37:19.000Z
2021-07-12T14:20:36.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function from common.pytorch.pytorch_parser import * from common.pytorch.pytorch_emitter import * from common.pytorch.saver import *
33.285714
44
0.858369
31
233
5.935484
0.387097
0.163043
0.26087
0.26087
0
0
0
0
0
0
0
0
0.103004
233
7
45
33.285714
0.880383
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.166667
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
368fc250bbed4ccfa3345becf7b2724279b341ca
42
py
Python
agents/quad_agent.py
wenlianglaw/Tetris-in-Python
d4f0a22c4827e7eeb44c55def3f024e0c6932ebe
[ "MIT" ]
1
2021-06-25T20:43:19.000Z
2021-06-25T20:43:19.000Z
agents/quad_agent.py
wenlianglaw/Tetris-in-Python
d4f0a22c4827e7eeb44c55def3f024e0c6932ebe
[ "MIT" ]
null
null
null
agents/quad_agent.py
wenlianglaw/Tetris-in-Python
d4f0a22c4827e7eeb44c55def3f024e0c6932ebe
[ "MIT" ]
null
null
null
# This agent aims the quad (tetris) play.
21
41
0.714286
7
42
4.285714
1
0
0
0
0
0
0
0
0
0
0
0
0.190476
42
1
42
42
0.882353
0.928571
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
3697ba913b0a3b6e3b2cabc27fb2f6ee9cc3d68a
183
py
Python
examples/maths.py
quynhanh-ngx/pytago
de976ad8d85702ae665e97978bc4a75d282c857f
[ "MIT" ]
206
2021-06-24T16:16:13.000Z
2022-03-31T07:44:17.000Z
examples/maths.py
quynhanh-ngx/pytago
de976ad8d85702ae665e97978bc4a75d282c857f
[ "MIT" ]
13
2021-06-24T17:51:36.000Z
2022-02-23T10:07:17.000Z
examples/maths.py
quynhanh-ngx/pytago
de976ad8d85702ae665e97978bc4a75d282c857f
[ "MIT" ]
14
2021-06-26T02:19:45.000Z
2022-03-30T03:02:49.000Z
import math def main(): print(math.sin(3)) print(math.cosh(3)) print(math.pi) print(math.acosh(6)) print(math.atan2(4, 7)) if __name__ == '__main__': main()
15.25
27
0.590164
28
183
3.571429
0.571429
0.45
0.2
0
0
0
0
0
0
0
0
0.042254
0.224044
183
11
28
16.636364
0.661972
0
0
0
0
0
0.043716
0
0
0
0
0
0
1
0.111111
true
0
0.111111
0
0.222222
0.555556
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
36a6ac477b43894747aea38fc73d9641c2b30139
15,343
py
Python
fn_twilio/fn_twilio/util/customize.py
rudimeyer/resilient-community-apps
7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00
[ "MIT" ]
1
2020-08-25T03:43:07.000Z
2020-08-25T03:43:07.000Z
fn_twilio/fn_twilio/util/customize.py
rudimeyer/resilient-community-apps
7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00
[ "MIT" ]
1
2019-07-08T16:57:48.000Z
2019-07-08T16:57:48.000Z
fn_twilio/fn_twilio/util/customize.py
rudimeyer/resilient-community-apps
7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Generate the Resilient customizations required for fn_twilio""" from __future__ import print_function from resilient_circuits.util import * def codegen_reload_data(): """Parameters to codegen used to generate the fn_twilio package""" reload_params = {"package": u"fn_twilio", "incident_fields": [], "action_fields": [u"twilio_sms_destination"], "function_params": [u"twilio_sms_destination", u"twilio_sms_message"], "datatables": [], "message_destinations": [u"fn_twilio"], "functions": [u"twilio_send_sms"], "phases": [], "automatic_tasks": [], "scripts": [], "workflows": [u"example_twilio_send_sms"], "actions": [u"Example: Send Twilio SMS"] } return reload_params def customization_data(client=None): """Produce any customization definitions (types, fields, message destinations, etc) that should be installed by `resilient-circuits customize` """ # This import data contains: # Action fields: # twilio_sms_destination # Function inputs: # twilio_sms_destination # twilio_sms_message # Message Destinations: # fn_twilio # Functions: # twilio_send_sms # Workflows: # example_twilio_send_sms # Rules: # Example: Send Twilio SMS yield ImportDefinition(u""" eyJ0YXNrX29yZGVyIjogW10sICJ3b3JrZmxvd3MiOiBbeyJ1dWlkIjogIjc0OGJmZTNiLWFlNWYt NDk0OC1iZWVlLTBkODkyNGJlZmNmZCIsICJkZXNjcmlwdGlvbiI6ICJFeGFtcGxlIHdvcmtmbG93 IHRvIHNlbmQgYW4gU01TIHZpYSBUd2lsaW8iLCAib2JqZWN0X3R5cGUiOiAiaW5jaWRlbnQiLCAi ZXhwb3J0X2tleSI6ICJleGFtcGxlX3R3aWxpb19zZW5kX3NtcyIsICJ3b3JrZmxvd19pZCI6IDIw LCAibGFzdF9tb2RpZmllZF9ieSI6ICJyZXNhZG1pbkBleGFtcGxlLmNvbSIsICJjb250ZW50Ijog eyJ4bWwiOiAiPD94bWwgdmVyc2lvbj1cIjEuMFwiIGVuY29kaW5nPVwiVVRGLThcIj8+PGRlZmlu aXRpb25zIHhtbG5zPVwiaHR0cDovL3d3dy5vbWcub3JnL3NwZWMvQlBNTi8yMDEwMDUyNC9NT0RF TFwiIHhtbG5zOmJwbW5kaT1cImh0dHA6Ly93d3cub21nLm9yZy9zcGVjL0JQTU4vMjAxMDA1MjQv RElcIiB4bWxuczpvbWdkYz1cImh0dHA6Ly93d3cub21nLm9yZy9zcGVjL0RELzIwMTAwNTI0L0RD XCIgeG1sbnM6b21nZGk9XCJodHRwOi8vd3d3Lm9tZy5vcmcvc3BlYy9ERC8yMDEwMDUyNC9ESVwi IHhtbG5zOnJlc2lsaWVudD1cImh0dHA6Ly9yZXNpbGllbnQuaWJtLmNvbS9icG1uXCIgeG1sbnM6 eHNkPVwiaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWFcIiB4bWxuczp4c2k9XCJodHRw Oi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZVwiIHRhcmdldE5hbWVzcGFjZT1c Imh0dHA6Ly93d3cuY2FtdW5kYS5vcmcvdGVzdFwiPjxwcm9jZXNzIGlkPVwiZXhhbXBsZV90d2ls aW9fc2VuZF9zbXNcIiBpc0V4ZWN1dGFibGU9XCJ0cnVlXCIgbmFtZT1cIkV4YW1wbGU6IFR3aWxp byBTZW5kIFNNU1wiPjxkb2N1bWVudGF0aW9uPkV4YW1wbGUgd29ya2Zsb3cgdG8gc2VuZCBhbiBT TVMgdmlhIFR3aWxpbzwvZG9jdW1lbnRhdGlvbj48c3RhcnRFdmVudCBpZD1cIlN0YXJ0RXZlbnRf MTU1YXN4bVwiPjxvdXRnb2luZz5TZXF1ZW5jZUZsb3dfMHd5cmpnMzwvb3V0Z29pbmc+PC9zdGFy dEV2ZW50PjxlbmRFdmVudCBpZD1cIkVuZEV2ZW50XzB5dXZidXRcIj48aW5jb21pbmc+U2VxdWVu Y2VGbG93XzEwOHl3bXQ8L2luY29taW5nPjwvZW5kRXZlbnQ+PHNlcnZpY2VUYXNrIGlkPVwiU2Vy dmljZVRhc2tfMWVhdXdrNVwiIG5hbWU9XCJUd2lsaW86IFNlbmQgU01TXCIgcmVzaWxpZW50OnR5 cGU9XCJmdW5jdGlvblwiPjxleHRlbnNpb25FbGVtZW50cz48cmVzaWxpZW50OmZ1bmN0aW9uIHV1 aWQ9XCI5MGMzNWRmMy0wZWM5LTQ5YWQtOTcxNS00ZjQxNzU1OTZhNDhcIj57XCJpbnB1dHNcIjp7 fSxcInBvc3RfcHJvY2Vzc2luZ19zY3JpcHRcIjpcIlxcbmZvciBlbnRyeSBpbiByZXN1bHRzW1xc XCJ0d2lsaW9fc3RhdHVzXFxcIl06XFxuICBpZihlbnRyeS5zdWNjZXNzID09IFRydWUpOlxcbiAg ICBub3RlX3RleHQgPSBcXFwiXFxcIlxcXCImbHQ7YiZndDtUd2lsaW8gU01TIE1lc3NhZ2U6Jmx0 Oy9iJmd0OyB7MH1cXG4gICAgICAgICAgICAgICZsdDsvYnImZ3Q7Jmx0O2ImZ3Q7c2VudCB0bzom bHQ7L2ImZ3Q7IHsxfVxcXCJcXFwiXFxcIi5mb3JtYXQocmVzdWx0cy5pbnB1dHMudHdpbGlvX3Nt c19tZXNzYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZW50cnkucGhvbmVfbnVtYmVyKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFxcbiAgICBpbmNpZGVudC5hZGROb3RlKGhlbHBlci5jcmVhdGVSaWNoVGV4dChub3Rl X3RleHQpKVxcbiAgZWxzZTogXFxuICAgIG5vdGVfdGV4dCA9IFxcXCJcXFwiXFxcIiZsdDtiJmd0 O1VuYWJsZSB0byBzZW5kIFR3aWxpbyBTTVMgTWVzc2FnZTombHQ7L2ImZ3Q7IHswfVxcbiAgICAg ICAgICAgICAgJmx0Oy9iciZndDsmbHQ7YiZndDsgdG86Jmx0Oy9iJmd0OyB7MX0gKHsyfSlcXFwi XFxcIlxcXCIuZm9ybWF0KHJlc3VsdHMuaW5wdXRzLnR3aWxpb19zbXNfbWVzc2FnZSxcXG4gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5LnBob25lX251bWJl ciwgZW50cnkuZXJyb3JfbWVzc2FnZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcXG4gICAgaW5jaWRlbnQuYWRkTm90ZShoZWxwZXIuY3JlYXRlUmljaFRleHQo bm90ZV90ZXh0KSlcIixcInByZV9wcm9jZXNzaW5nX3NjcmlwdFwiOlwiaW5wdXRzLnR3aWxpb19z bXNfZGVzdGluYXRpb24gPSBydWxlLnByb3BlcnRpZXMudHdpbGlvX3Ntc19kZXN0aW5hdGlvblxc bmlucHV0cy50d2lsaW9fc21zX21lc3NhZ2UgPSAnQW4gaW5jaWRlbnQgJyArIGluY2lkZW50Lm5h bWUgKyAnICgnICsgYGluY2lkZW50LmlkYCArICcpIHdpdGggJyArIGluY2lkZW50LnNldmVyaXR5 X2NvZGUgKyAnIHByaW9yaXR5IG1heSByZXF1aXJlIHlvdXIgYXR0ZW50aW9uJ1wiLFwicmVzdWx0 X25hbWVcIjpcIlwifTwvcmVzaWxpZW50OmZ1bmN0aW9uPjwvZXh0ZW5zaW9uRWxlbWVudHM+PGlu Y29taW5nPlNlcXVlbmNlRmxvd18wd3lyamczPC9pbmNvbWluZz48b3V0Z29pbmc+U2VxdWVuY2VG bG93XzEwOHl3bXQ8L291dGdvaW5nPjwvc2VydmljZVRhc2s+PHNlcXVlbmNlRmxvdyBpZD1cIlNl cXVlbmNlRmxvd18wd3lyamczXCIgc291cmNlUmVmPVwiU3RhcnRFdmVudF8xNTVhc3htXCIgdGFy Z2V0UmVmPVwiU2VydmljZVRhc2tfMWVhdXdrNVwiLz48c2VxdWVuY2VGbG93IGlkPVwiU2VxdWVu Y2VGbG93XzEwOHl3bXRcIiBzb3VyY2VSZWY9XCJTZXJ2aWNlVGFza18xZWF1d2s1XCIgdGFyZ2V0 UmVmPVwiRW5kRXZlbnRfMHl1dmJ1dFwiLz48dGV4dEFubm90YXRpb24gaWQ9XCJUZXh0QW5ub3Rh dGlvbl8xa3h4aXl0XCI+PHRleHQ+U3RhcnQgeW91ciB3b3JrZmxvdyBoZXJlPC90ZXh0PjwvdGV4 dEFubm90YXRpb24+PGFzc29jaWF0aW9uIGlkPVwiQXNzb2NpYXRpb25fMXNldWo0OFwiIHNvdXJj ZVJlZj1cIlN0YXJ0RXZlbnRfMTU1YXN4bVwiIHRhcmdldFJlZj1cIlRleHRBbm5vdGF0aW9uXzFr eHhpeXRcIi8+PC9wcm9jZXNzPjxicG1uZGk6QlBNTkRpYWdyYW0gaWQ9XCJCUE1ORGlhZ3JhbV8x XCI+PGJwbW5kaTpCUE1OUGxhbmUgYnBtbkVsZW1lbnQ9XCJ1bmRlZmluZWRcIiBpZD1cIkJQTU5Q bGFuZV8xXCI+PGJwbW5kaTpCUE1OU2hhcGUgYnBtbkVsZW1lbnQ9XCJTdGFydEV2ZW50XzE1NWFz eG1cIiBpZD1cIlN0YXJ0RXZlbnRfMTU1YXN4bV9kaVwiPjxvbWdkYzpCb3VuZHMgaGVpZ2h0PVwi MzZcIiB3aWR0aD1cIjM2XCIgeD1cIjE2MFwiIHk9XCIxODhcIi8+PGJwbW5kaTpCUE1OTGFiZWw+ PG9tZ2RjOkJvdW5kcyBoZWlnaHQ9XCIwXCIgd2lkdGg9XCI5MFwiIHg9XCIxNTVcIiB5PVwiMjIz XCIvPjwvYnBtbmRpOkJQTU5MYWJlbD48L2JwbW5kaTpCUE1OU2hhcGU+PGJwbW5kaTpCUE1OU2hh cGUgYnBtbkVsZW1lbnQ9XCJUZXh0QW5ub3RhdGlvbl8xa3h4aXl0XCIgaWQ9XCJUZXh0QW5ub3Rh dGlvbl8xa3h4aXl0X2RpXCI+PG9tZ2RjOkJvdW5kcyBoZWlnaHQ9XCIzMFwiIHdpZHRoPVwiMTAw XCIgeD1cIjk5XCIgeT1cIjI1NFwiLz48L2JwbW5kaTpCUE1OU2hhcGU+PGJwbW5kaTpCUE1ORWRn ZSBicG1uRWxlbWVudD1cIkFzc29jaWF0aW9uXzFzZXVqNDhcIiBpZD1cIkFzc29jaWF0aW9uXzFz ZXVqNDhfZGlcIj48b21nZGk6d2F5cG9pbnQgeD1cIjE2OFwiIHhzaTp0eXBlPVwib21nZGM6UG9p bnRcIiB5PVwiMjIwXCIvPjxvbWdkaTp3YXlwb2ludCB4PVwiMTUzXCIgeHNpOnR5cGU9XCJvbWdk YzpQb2ludFwiIHk9XCIyNTRcIi8+PC9icG1uZGk6QlBNTkVkZ2U+PGJwbW5kaTpCUE1OU2hhcGUg YnBtbkVsZW1lbnQ9XCJFbmRFdmVudF8weXV2YnV0XCIgaWQ9XCJFbmRFdmVudF8weXV2YnV0X2Rp XCI+PG9tZ2RjOkJvdW5kcyBoZWlnaHQ9XCIzNlwiIHdpZHRoPVwiMzZcIiB4PVwiNTk0XCIgeT1c IjE4OFwiLz48YnBtbmRpOkJQTU5MYWJlbD48b21nZGM6Qm91bmRzIGhlaWdodD1cIjEzXCIgd2lk dGg9XCIwXCIgeD1cIjYxMlwiIHk9XCIyMjdcIi8+PC9icG1uZGk6QlBNTkxhYmVsPjwvYnBtbmRp OkJQTU5TaGFwZT48YnBtbmRpOkJQTU5TaGFwZSBicG1uRWxlbWVudD1cIlNlcnZpY2VUYXNrXzFl YXV3azVcIiBpZD1cIlNlcnZpY2VUYXNrXzFlYXV3azVfZGlcIj48b21nZGM6Qm91bmRzIGhlaWdo dD1cIjgwXCIgd2lkdGg9XCIxMDBcIiB4PVwiMzMyXCIgeT1cIjE2NlwiLz48L2JwbW5kaTpCUE1O U2hhcGU+PGJwbW5kaTpCUE1ORWRnZSBicG1uRWxlbWVudD1cIlNlcXVlbmNlRmxvd18wd3lyamcz XCIgaWQ9XCJTZXF1ZW5jZUZsb3dfMHd5cmpnM19kaVwiPjxvbWdkaTp3YXlwb2ludCB4PVwiMTk2 XCIgeHNpOnR5cGU9XCJvbWdkYzpQb2ludFwiIHk9XCIyMDZcIi8+PG9tZ2RpOndheXBvaW50IHg9 XCIzMzJcIiB4c2k6dHlwZT1cIm9tZ2RjOlBvaW50XCIgeT1cIjIwNlwiLz48YnBtbmRpOkJQTU5M YWJlbD48b21nZGM6Qm91bmRzIGhlaWdodD1cIjEzXCIgd2lkdGg9XCIwXCIgeD1cIjI2NFwiIHk9 XCIxODRcIi8+PC9icG1uZGk6QlBNTkxhYmVsPjwvYnBtbmRpOkJQTU5FZGdlPjxicG1uZGk6QlBN TkVkZ2UgYnBtbkVsZW1lbnQ9XCJTZXF1ZW5jZUZsb3dfMTA4eXdtdFwiIGlkPVwiU2VxdWVuY2VG bG93XzEwOHl3bXRfZGlcIj48b21nZGk6d2F5cG9pbnQgeD1cIjQzMlwiIHhzaTp0eXBlPVwib21n ZGM6UG9pbnRcIiB5PVwiMjA2XCIvPjxvbWdkaTp3YXlwb2ludCB4PVwiNTk0XCIgeHNpOnR5cGU9 XCJvbWdkYzpQb2ludFwiIHk9XCIyMDZcIi8+PGJwbW5kaTpCUE1OTGFiZWw+PG9tZ2RjOkJvdW5k cyBoZWlnaHQ9XCIxM1wiIHdpZHRoPVwiMFwiIHg9XCI1MTNcIiB5PVwiMTg0XCIvPjwvYnBtbmRp OkJQTU5MYWJlbD48L2JwbW5kaTpCUE1ORWRnZT48L2JwbW5kaTpCUE1OUGxhbmU+PC9icG1uZGk6 QlBNTkRpYWdyYW0+PC9kZWZpbml0aW9ucz4iLCAid29ya2Zsb3dfaWQiOiAiZXhhbXBsZV90d2ls aW9fc2VuZF9zbXMiLCAidmVyc2lvbiI6IDE2fSwgImxhc3RfbW9kaWZpZWRfdGltZSI6IDE1NDY0 NDg3NDcxMzAsICJjcmVhdG9yX2lkIjogInJlc2FkbWluQGV4YW1wbGUuY29tIiwgImFjdGlvbnMi OiBbXSwgInByb2dyYW1tYXRpY19uYW1lIjogImV4YW1wbGVfdHdpbGlvX3NlbmRfc21zIiwgIm5h bWUiOiAiRXhhbXBsZTogVHdpbGlvIFNlbmQgU01TIn1dLCAiYWN0aW9ucyI6IFt7ImxvZ2ljX3R5 cGUiOiAiYWxsIiwgIm5hbWUiOiAiRXhhbXBsZTogU2VuZCBUd2lsaW8gU01TIiwgInZpZXdfaXRl bXMiOiBbeyJzaG93X2lmIjogbnVsbCwgImZpZWxkX3R5cGUiOiAiYWN0aW9uaW52b2NhdGlvbiIs ICJzaG93X2xpbmtfaGVhZGVyIjogZmFsc2UsICJlbGVtZW50IjogImZpZWxkX3V1aWQiLCAiY29u dGVudCI6ICI2YzM5MjRlYy1lOWVmLTQ5NzItYWQwOC1kYWFjNWFjNWQ5NzIiLCAic3RlcF9sYWJl bCI6IG51bGx9XSwgInR5cGUiOiAxLCAid29ya2Zsb3dzIjogWyJleGFtcGxlX3R3aWxpb19zZW5k X3NtcyJdLCAib2JqZWN0X3R5cGUiOiAiaW5jaWRlbnQiLCAidGltZW91dF9zZWNvbmRzIjogODY0 MDAsICJ1dWlkIjogImY5M2I4MmE3LTJmM2QtNGE5ZS1hOTZlLTMzMTJhMjdlNGIxNiIsICJhdXRv bWF0aW9ucyI6IFtdLCAiZXhwb3J0X2tleSI6ICJFeGFtcGxlOiBTZW5kIFR3aWxpbyBTTVMiLCAi Y29uZGl0aW9ucyI6IFtdLCAiaWQiOiAzMywgIm1lc3NhZ2VfZGVzdGluYXRpb25zIjogW119XSwg ImxheW91dHMiOiBbXSwgImV4cG9ydF9mb3JtYXRfdmVyc2lvbiI6IDIsICJpZCI6IDYsICJpbmR1 c3RyaWVzIjogbnVsbCwgInBoYXNlcyI6IFtdLCAiYWN0aW9uX29yZGVyIjogW10sICJnZW9zIjog bnVsbCwgImxvY2FsZSI6IG51bGwsICJzZXJ2ZXJfdmVyc2lvbiI6IHsibWFqb3IiOiAzMSwgInZl cnNpb24iOiAiMzEuMC40MjU0IiwgImJ1aWxkX251bWJlciI6IDQyNTQsICJtaW5vciI6IDB9LCAi dGltZWZyYW1lcyI6IG51bGwsICJ3b3Jrc3BhY2VzIjogW10sICJhdXRvbWF0aWNfdGFza3MiOiBb XSwgImZ1bmN0aW9ucyI6IFt7ImRpc3BsYXlfbmFtZSI6ICJUd2lsaW86IFNlbmQgU01TIiwgImRl c2NyaXB0aW9uIjogeyJjb250ZW50IjogIlNlbmQgYW4gU01TIG1lc3NhZ2UgdmlhIGEgVHdpbGlv IGFjY291bnQiLCAiZm9ybWF0IjogInRleHQifSwgImNyZWF0b3IiOiB7ImRpc3BsYXlfbmFtZSI6 ICJSZXMgQWRtaW4iLCAidHlwZSI6ICJ1c2VyIiwgImlkIjogMSwgIm5hbWUiOiAicmVzYWRtaW5A ZXhhbXBsZS5jb20ifSwgInZpZXdfaXRlbXMiOiBbeyJzaG93X2lmIjogbnVsbCwgImZpZWxkX3R5 cGUiOiAiX19mdW5jdGlvbiIsICJzaG93X2xpbmtfaGVhZGVyIjogZmFsc2UsICJlbGVtZW50Ijog ImZpZWxkX3V1aWQiLCAiY29udGVudCI6ICJiNzJiN2Y5YS1iMzYzLTQ4Y2EtOGM3ZS00NzlmYzMx MDAwOTciLCAic3RlcF9sYWJlbCI6IG51bGx9LCB7InNob3dfaWYiOiBudWxsLCAiZmllbGRfdHlw ZSI6ICJfX2Z1bmN0aW9uIiwgInNob3dfbGlua19oZWFkZXIiOiBmYWxzZSwgImVsZW1lbnQiOiAi ZmllbGRfdXVpZCIsICJjb250ZW50IjogImQ0MDlmY2MzLTYyMmUtNGE1MC1iNWM3LWMwZTA3Mjg3 MzM0OSIsICJzdGVwX2xhYmVsIjogbnVsbH1dLCAiZXhwb3J0X2tleSI6ICJ0d2lsaW9fc2VuZF9z bXMiLCAidXVpZCI6ICI5MGMzNWRmMy0wZWM5LTQ5YWQtOTcxNS00ZjQxNzU1OTZhNDgiLCAibGFz dF9tb2RpZmllZF9ieSI6IHsiZGlzcGxheV9uYW1lIjogIk9yY2hlc3RyYXRpb24gRW5naW5lIiwg InR5cGUiOiAidXNlciIsICJpZCI6IDMsICJuYW1lIjogImludGVncmF0aW9uc0BleGFtcGxlLmNv bSJ9LCAidmVyc2lvbiI6IDQsICJ3b3JrZmxvd3MiOiBbeyJkZXNjcmlwdGlvbiI6IG51bGwsICJv YmplY3RfdHlwZSI6ICJpbmNpZGVudCIsICJhY3Rpb25zIjogW10sICJuYW1lIjogIkV4YW1wbGU6 IFR3aWxpbyBTZW5kIFNNUyIsICJ3b3JrZmxvd19pZCI6IDIwLCAicHJvZ3JhbW1hdGljX25hbWUi OiAiZXhhbXBsZV90d2lsaW9fc2VuZF9zbXMiLCAidXVpZCI6IG51bGx9XSwgImxhc3RfbW9kaWZp ZWRfdGltZSI6IDE1NDQ0NDk0MTE4ODUsICJkZXN0aW5hdGlvbl9oYW5kbGUiOiAiZm5fdHdpbGlv IiwgImlkIjogMjIsICJuYW1lIjogInR3aWxpb19zZW5kX3NtcyJ9XSwgIm5vdGlmaWNhdGlvbnMi OiBudWxsLCAicmVndWxhdG9ycyI6IG51bGwsICJpbmNpZGVudF90eXBlcyI6IFt7ImNyZWF0ZV9k YXRlIjogMTU0NjUwOTA0MjgyNywgImRlc2NyaXB0aW9uIjogIkN1c3RvbWl6YXRpb24gUGFja2Fn ZXMgKGludGVybmFsKSIsICJleHBvcnRfa2V5IjogIkN1c3RvbWl6YXRpb24gUGFja2FnZXMgKGlu dGVybmFsKSIsICJpZCI6IDAsICJuYW1lIjogIkN1c3RvbWl6YXRpb24gUGFja2FnZXMgKGludGVy bmFsKSIsICJ1cGRhdGVfZGF0ZSI6IDE1NDY1MDkwNDI4MjcsICJ1dWlkIjogImJmZWVjMmQ0LTM3 NzAtMTFlOC1hZDM5LTRhMDAwNDA0NGFhMCIsICJlbmFibGVkIjogZmFsc2UsICJzeXN0ZW0iOiBm YWxzZSwgInBhcmVudF9pZCI6IG51bGwsICJoaWRkZW4iOiBmYWxzZX1dLCAic2NyaXB0cyI6IFtd LCAidHlwZXMiOiBbXSwgIm1lc3NhZ2VfZGVzdGluYXRpb25zIjogW3sidXVpZCI6ICI1Yjk0YjAx OC05ZDY4LTRhYTktODNiOC1mNmQyNjYzMDljMWEiLCAiZXhwb3J0X2tleSI6ICJmbl90d2lsaW8i LCAibmFtZSI6ICJmbl90d2lsaW8iLCAiZGVzdGluYXRpb25fdHlwZSI6IDAsICJwcm9ncmFtbWF0 aWNfbmFtZSI6ICJmbl90d2lsaW8iLCAiZXhwZWN0X2FjayI6IHRydWUsICJ1c2VycyI6IFsiaW50 ZWdyYXRpb25zQGV4YW1wbGUuY29tIl19XSwgImluY2lkZW50X2FydGlmYWN0X3R5cGVzIjogW10s ICJyb2xlcyI6IFtdLCAiZmllbGRzIjogW3sib3BlcmF0aW9ucyI6IFtdLCAidHlwZV9pZCI6IDAs ICJvcGVyYXRpb25fcGVybXMiOiB7fSwgInRleHQiOiAiU2ltdWxhdGlvbiIsICJibGFua19vcHRp b24iOiBmYWxzZSwgInByZWZpeCI6IG51bGwsICJjaGFuZ2VhYmxlIjogdHJ1ZSwgImlkIjogNTEs ICJyZWFkX29ubHkiOiB0cnVlLCAidXVpZCI6ICJjM2YwZTNlZC0yMWUxLTRkNTMtYWZmYi1mZTVj YTMzMDhjY2EiLCAiY2hvc2VuIjogZmFsc2UsICJpbnB1dF90eXBlIjogImJvb2xlYW4iLCAidG9v bHRpcCI6ICJXaGV0aGVyIHRoZSBpbmNpZGVudCBpcyBhIHNpbXVsYXRpb24gb3IgYSByZWd1bGFy IGluY2lkZW50LiAgVGhpcyBmaWVsZCBpcyByZWFkLW9ubHkuIiwgImludGVybmFsIjogZmFsc2Us ICJyaWNoX3RleHQiOiBmYWxzZSwgInRlbXBsYXRlcyI6IFtdLCAiZXhwb3J0X2tleSI6ICJpbmNp ZGVudC9pbmNfdHJhaW5pbmciLCAiaGlkZV9ub3RpZmljYXRpb24iOiBmYWxzZSwgIm5hbWUiOiAi aW5jX3RyYWluaW5nIiwgImRlcHJlY2F0ZWQiOiBmYWxzZSwgImRlZmF1bHRfY2hvc2VuX2J5X3Nl cnZlciI6IGZhbHNlLCAidmFsdWVzIjogW119LCB7Im9wZXJhdGlvbnMiOiBbXSwgInR5cGVfaWQi OiA2LCAib3BlcmF0aW9uX3Blcm1zIjoge30sICJ0ZXh0IjogIkRlc3RpbmF0aW9uIE51bWJlciIs ICJibGFua19vcHRpb24iOiBmYWxzZSwgInByZWZpeCI6ICJwcm9wZXJ0aWVzIiwgImNoYW5nZWFi bGUiOiB0cnVlLCAiaWQiOiAxNjUsICJyZWFkX29ubHkiOiBmYWxzZSwgInV1aWQiOiAiNmMzOTI0 ZWMtZTllZi00OTcyLWFkMDgtZGFhYzVhYzVkOTcyIiwgImNob3NlbiI6IGZhbHNlLCAiaW5wdXRf dHlwZSI6ICJ0ZXh0IiwgInRvb2x0aXAiOiAiIiwgImludGVybmFsIjogZmFsc2UsICJyaWNoX3Rl eHQiOiBmYWxzZSwgInRlbXBsYXRlcyI6IFtdLCAiZXhwb3J0X2tleSI6ICJhY3Rpb25pbnZvY2F0 aW9uL3R3aWxpb19zbXNfZGVzdGluYXRpb24iLCAiaGlkZV9ub3RpZmljYXRpb24iOiBmYWxzZSwg InBsYWNlaG9sZGVyIjogIiIsICJuYW1lIjogInR3aWxpb19zbXNfZGVzdGluYXRpb24iLCAiZGVw cmVjYXRlZCI6IGZhbHNlLCAiZGVmYXVsdF9jaG9zZW5fYnlfc2VydmVyIjogZmFsc2UsICJyZXF1 aXJlZCI6ICJhbHdheXMiLCAidmFsdWVzIjogW119LCB7Im9wZXJhdGlvbnMiOiBbXSwgInR5cGVf aWQiOiAxMSwgIm9wZXJhdGlvbl9wZXJtcyI6IHt9LCAidGV4dCI6ICJ0d2lsaW9fc21zX2Rlc3Rp bmF0aW9uIiwgImJsYW5rX29wdGlvbiI6IGZhbHNlLCAicHJlZml4IjogbnVsbCwgImNoYW5nZWFi bGUiOiB0cnVlLCAiaWQiOiAxNjQsICJyZWFkX29ubHkiOiBmYWxzZSwgInV1aWQiOiAiYjcyYjdm OWEtYjM2My00OGNhLThjN2UtNDc5ZmMzMTAwMDk3IiwgImNob3NlbiI6IGZhbHNlLCAiaW5wdXRf dHlwZSI6ICJ0ZXh0IiwgInRvb2x0aXAiOiAiVHdpbGlvIERlc3RpbmF0aW9uIE1TSVNETiIsICJp bnRlcm5hbCI6IGZhbHNlLCAicmljaF90ZXh0IjogZmFsc2UsICJ0ZW1wbGF0ZXMiOiBbXSwgImV4 cG9ydF9rZXkiOiAiX19mdW5jdGlvbi90d2lsaW9fc21zX2Rlc3RpbmF0aW9uIiwgImhpZGVfbm90 aWZpY2F0aW9uIjogZmFsc2UsICJwbGFjZWhvbGRlciI6ICIiLCAibmFtZSI6ICJ0d2lsaW9fc21z X2Rlc3RpbmF0aW9uIiwgImRlcHJlY2F0ZWQiOiBmYWxzZSwgImRlZmF1bHRfY2hvc2VuX2J5X3Nl cnZlciI6IGZhbHNlLCAicmVxdWlyZWQiOiAiYWx3YXlzIiwgInZhbHVlcyI6IFtdfSwgeyJvcGVy YXRpb25zIjogW10sICJ0eXBlX2lkIjogMTEsICJvcGVyYXRpb25fcGVybXMiOiB7fSwgInRleHQi OiAidHdpbGlvX3Ntc19tZXNzYWdlIiwgImJsYW5rX29wdGlvbiI6IGZhbHNlLCAicHJlZml4Ijog bnVsbCwgImNoYW5nZWFibGUiOiB0cnVlLCAiaWQiOiAxNjMsICJyZWFkX29ubHkiOiBmYWxzZSwg InV1aWQiOiAiZDQwOWZjYzMtNjIyZS00YTUwLWI1YzctYzBlMDcyODczMzQ5IiwgImNob3NlbiI6 IGZhbHNlLCAiaW5wdXRfdHlwZSI6ICJ0ZXh0IiwgInRvb2x0aXAiOiAiVHdpbGlvIFNNUyBDb250 ZW50IiwgImludGVybmFsIjogZmFsc2UsICJyaWNoX3RleHQiOiBmYWxzZSwgInRlbXBsYXRlcyI6 IFtdLCAiZXhwb3J0X2tleSI6ICJfX2Z1bmN0aW9uL3R3aWxpb19zbXNfbWVzc2FnZSIsICJoaWRl X25vdGlmaWNhdGlvbiI6IGZhbHNlLCAicGxhY2Vob2xkZXIiOiAiIiwgIm5hbWUiOiAidHdpbGlv X3Ntc19tZXNzYWdlIiwgImRlcHJlY2F0ZWQiOiBmYWxzZSwgImRlZmF1bHRfY2hvc2VuX2J5X3Nl cnZlciI6IGZhbHNlLCAicmVxdWlyZWQiOiAiYWx3YXlzIiwgInZhbHVlcyI6IFtdfV0sICJvdmVy cmlkZXMiOiBbXSwgImV4cG9ydF9kYXRlIjogMTU0NjUwODk5MDkzOH0= """ )
67.29386
91
0.942254
356
15,343
40.488764
0.761236
0.004995
0.00555
0.002914
0
0
0
0
0
0
0
0.119105
0.045102
15,343
228
92
67.29386
0.864719
0.037411
0
0
1
0
0.953218
0.926874
0
1
0
0
0
1
0.01
false
0
0.015
0
0.03
0.005
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
5
36af75488e138d99acb6c335340a3e305b9fd297
207
py
Python
hubspot/crm/associations/api/__init__.py
fakepop/hubspot-api-python
f04103a09f93f5c26c99991b25fa76801074f3d3
[ "Apache-2.0" ]
117
2020-04-06T08:22:53.000Z
2022-03-18T03:41:29.000Z
hubspot/crm/associations/api/__init__.py
fakepop/hubspot-api-python
f04103a09f93f5c26c99991b25fa76801074f3d3
[ "Apache-2.0" ]
62
2020-04-06T16:21:06.000Z
2022-03-17T16:50:44.000Z
hubspot/crm/associations/api/__init__.py
fakepop/hubspot-api-python
f04103a09f93f5c26c99991b25fa76801074f3d3
[ "Apache-2.0" ]
45
2020-04-06T16:13:52.000Z
2022-03-30T21:33:17.000Z
from __future__ import absolute_import # flake8: noqa # import apis into api package from hubspot.crm.associations.api.batch_api import BatchApi from hubspot.crm.associations.api.types_api import TypesApi
25.875
59
0.835749
30
207
5.533333
0.566667
0.13253
0.168675
0.313253
0.349398
0
0
0
0
0
0
0.005435
0.111111
207
7
60
29.571429
0.896739
0.198068
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
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
5
36b38bd24680244975d933cb6e9774c0e38b29f9
104
py
Python
dlkit/runtime/impls/primitives.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
2
2018-02-23T12:16:11.000Z
2020-10-08T17:54:24.000Z
dlkit/runtime/impls/primitives.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
87
2017-04-21T18:57:15.000Z
2021-12-13T19:43:57.000Z
dlkit/runtime/impls/primitives.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
1
2018-03-01T16:44:25.000Z
2018-03-01T16:44:25.000Z
from dlkit.services.primitives import * from dlkit.primordium.locale.objects import InitializableLocale
34.666667
63
0.865385
12
104
7.5
0.75
0.2
0
0
0
0
0
0
0
0
0
0
0.076923
104
2
64
52
0.9375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
36c7c4890d45e0c36001f1f1468c6e6770cb542b
47
py
Python
aws_costs_cli/OutOfOptionException.py
danilocgsilva/aws-costs-cli
d5a20119854d08c3a6e02e074e296417eea3430d
[ "MIT" ]
1
2021-12-10T14:08:50.000Z
2021-12-10T14:08:50.000Z
aws_costs_cli/OutOfOptionException.py
danilocgsilva/aws-costs-cli
d5a20119854d08c3a6e02e074e296417eea3430d
[ "MIT" ]
null
null
null
aws_costs_cli/OutOfOptionException.py
danilocgsilva/aws-costs-cli
d5a20119854d08c3a6e02e074e296417eea3430d
[ "MIT" ]
null
null
null
class OutOfOptionException(Exception): pass
23.5
38
0.808511
4
47
9.5
1
0
0
0
0
0
0
0
0
0
0
0
0.12766
47
2
39
23.5
0.926829
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
7fd17399c3d19ec1dbb4427fd3965311a830f8c5
109
py
Python
utils/__init__.py
slimsevernake/SuperCoinbot
2f1bec609aca17f6472f9a517517a9464b6811b1
[ "MIT" ]
null
null
null
utils/__init__.py
slimsevernake/SuperCoinbot
2f1bec609aca17f6472f9a517517a9464b6811b1
[ "MIT" ]
null
null
null
utils/__init__.py
slimsevernake/SuperCoinbot
2f1bec609aca17f6472f9a517517a9464b6811b1
[ "MIT" ]
null
null
null
from .other import * from .logging import * from .sqlite import * from .messages import * from .qiwi import *
21.8
23
0.733945
15
109
5.333333
0.466667
0.5
0
0
0
0
0
0
0
0
0
0
0.174312
109
5
24
21.8
0.888889
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
0
0
0
5
3d1e5acc87a67db74276b94682715d86f049bc7e
60
py
Python
midca/modules/_xp_goal/__init__.py
Heider1632/midca
ff61e1b291ae9a3aa784c75b4069f91884e26b2c
[ "MIT" ]
null
null
null
midca/modules/_xp_goal/__init__.py
Heider1632/midca
ff61e1b291ae9a3aa784c75b4069f91884e26b2c
[ "MIT" ]
null
null
null
midca/modules/_xp_goal/__init__.py
Heider1632/midca
ff61e1b291ae9a3aa784c75b4069f91884e26b2c
[ "MIT" ]
null
null
null
import settings import frame import parser import traverser
12
16
0.866667
8
60
6.5
0.625
0
0
0
0
0
0
0
0
0
0
0
0.133333
60
4
17
15
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3d2d95195e8e5605300e5a38738b0d0a42f866c6
490
py
Python
torm/field/__init__.py
cofepy/torm
a2f0f1b19eed24f9b1b6af139637c98362760d3f
[ "MIT" ]
2
2020-06-28T03:00:18.000Z
2020-07-15T16:14:39.000Z
torm/field/__init__.py
cofepy/torm
a2f0f1b19eed24f9b1b6af139637c98362760d3f
[ "MIT" ]
null
null
null
torm/field/__init__.py
cofepy/torm
a2f0f1b19eed24f9b1b6af139637c98362760d3f
[ "MIT" ]
null
null
null
from torm.field.Field import Field # 基础数据类型 from torm.field.Int import Int from torm.field.Float import Float from torm.field.Str import Str from torm.field.Bool import Bool # 语义化数据类型 from torm.field.Email import Email from torm.field.Timestamp import Timestamp # 复杂数据类型,只有mongodb支持 from torm.field.Dict import Dict from torm.field.Map import Map # 复杂列表数据类型,只有mongodb支持 from torm.field.List import List from torm.field.EmailList import EmailList from torm.field.DictList import DictList
24.5
42
0.818367
78
490
5.141026
0.25641
0.239402
0.389027
0.119701
0
0
0
0
0
0
0
0
0.120408
490
19
43
25.789474
0.930394
0.110204
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
1829b9b58276cadcbf219655ee449c99e8dfe762
13,838
py
Python
tests/sim/test_anneal.py
panaali/qubovert
d5ea46349d2a058954fb2cb06f559c0d3fb382c5
[ "Apache-2.0" ]
15
2020-07-10T20:46:50.000Z
2021-12-29T05:01:55.000Z
tests/sim/test_anneal.py
panaali/qubovert
d5ea46349d2a058954fb2cb06f559c0d3fb382c5
[ "Apache-2.0" ]
13
2020-02-07T00:10:31.000Z
2020-04-05T22:58:55.000Z
tests/sim/test_anneal.py
panaali/qubovert
d5ea46349d2a058954fb2cb06f559c0d3fb382c5
[ "Apache-2.0" ]
4
2020-05-13T06:02:38.000Z
2022-03-22T20:45:23.000Z
# Copyright 2020 Joseph T. Iosue # # 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. """ Contains tests for the functions in the ``qubovert.sim._anneal`` file. """ from qubovert.sim import ( anneal_qubo, anneal_quso, anneal_pubo, anneal_puso, AnnealResults, SCHEDULES ) from qubovert.utils import ( puso_to_pubo, quso_to_qubo, QUBOVertWarning, QUBOMatrix, QUSOMatrix, PUBOMatrix, PUSOMatrix ) from qubovert import QUBO, QUSO, PUBO, PUSO, PCBO, PCSO from numpy.testing import assert_raises, assert_warns import numpy as np def test_anneal_puso(): _anneal_puso(dict) _anneal_puso(PUSOMatrix) _anneal_puso(PUSO) _anneal_puso(PCSO) def _anneal_puso(type_): H = type_({(i, i+1, i+2): -1 for i in range(3)}) with assert_raises(ValueError): anneal_puso(H, anneal_duration=-1) with assert_raises(ValueError): anneal_puso(H, anneal_duration=-2) with assert_warns(QUBOVertWarning): anneal_puso(H, temperature_range=(1, 2), schedule=[3, 2]) with assert_warns(QUBOVertWarning): # a quadratic model warns that you shouldn't use anneal_puso anneal_puso({(0, 1): 1}) with assert_raises(ValueError): anneal_puso(H, temperature_range=(1, 2)) with assert_raises(ValueError): anneal_puso(H, schedule='something') empty_result = AnnealResults() for _ in range(4): empty_result.add_state({}, 2, True) # less than quadratic model so will warn with assert_warns(QUBOVertWarning): assert anneal_puso({(): 2}, num_anneals=4) == empty_result assert anneal_puso(H, num_anneals=0) == AnnealResults() assert anneal_puso(H, num_anneals=-1) == AnnealResults() # just make sure everything runs anneal_puso(H, schedule='linear') res = anneal_puso(H, initial_state=[1] * 5) for x in res: assert all(i in (1, -1) for i in x.state.values()) # check to see if we find the groundstate of a simple but largeish model. H = type_({(i, i+1): -1 for i in range(30)}) # quadratic model so will warn with assert_warns(QUBOVertWarning): res = anneal_puso(H, num_anneals=4, seed=0) assert res.best.state in ( dict(enumerate([1]*31)), dict(enumerate([-1]*31)) ) assert res.best.value == -30 assert len([x for x in res]) == 4 # check to see if we find the groundstate of same but out of order # quadratic so will warn with assert_warns(QUBOVertWarning): res = anneal_puso(H, num_anneals=4, in_order=False, seed=0) assert res.best.state in ( dict(enumerate([1]*31)), dict(enumerate([-1]*31)) ) assert res.best.value == -30 assert len([x for x in res]) == 4 # make sure we run branch where an explicit schedule is given and no # temperature range is supplied # quadratic so will warn with assert_warns(QUBOVertWarning): anneal_puso(H, schedule=[3, 2]) # make sure it works with fields res = anneal_puso( type_({(0, 1, 2): 1, (1,): -1, (): 2}), num_anneals=10 ) assert len(res) == 10 res.sort() for i in range(9): assert res[i].value <= res[i + 1].value # bigish ordering res = anneal_puso( type_( {(i, j, j + 1): 1 for i in range(70) for j in range(i+1, 70)} ), num_anneals=20 ) assert len(res) == 20 res.sort() for i in range(19): assert res[i].value <= res[i + 1].value def test_anneal_quso(): _anneal_quso(dict) _anneal_quso(QUSOMatrix) _anneal_quso(PUSOMatrix) _anneal_quso(QUSO) _anneal_quso(PUSO) _anneal_quso(PCSO) def _anneal_quso(type_): L = type_({(i, i+1): -1 for i in range(3)}) with assert_raises(ValueError): anneal_quso(L, anneal_duration=-1) with assert_raises(ValueError): anneal_quso(L, anneal_duration=-2) with assert_warns(QUBOVertWarning): anneal_quso(L, temperature_range=(1, 2), schedule=[3, 15]) with assert_raises(ValueError): anneal_quso(L, temperature_range=(1, 2)) with assert_raises(ValueError): anneal_quso(L, schedule='something') empty_result = AnnealResults() for _ in range(4): empty_result.add_state({}, 2, True) assert anneal_quso({(): 2}, num_anneals=4) == empty_result assert anneal_quso(L, num_anneals=0) == AnnealResults() assert anneal_quso(L, num_anneals=-1) == AnnealResults() # just make sure everything runs anneal_quso(L, schedule='linear') res = anneal_quso(L, initial_state=[1] * 5) for x in res: assert all(i in (1, -1) for i in x.state.values()) # check to see if we find the groundstate of a simple but largeish model. L = type_({(i, i+1): -1 for i in range(30)}) res = anneal_quso(L, num_anneals=4, seed=0) assert res.best.state in ( dict(enumerate([1]*31)), dict(enumerate([-1]*31)) ) assert res.best.value == -30 assert len([x for x in res]) == 4 # check to see if we find the groundstate of a sane but out of order res = anneal_quso(L, num_anneals=4, in_order=False, seed=0) assert res.best.state in ( dict(enumerate([1]*31)), dict(enumerate([-1]*31)) ) assert res.best.value == -30 assert len([x for x in res]) == 4 # make sure we run branch where an explicit schedule is given and no # temperature range is supplied anneal_quso(L, schedule=[3] * 10 + [2] * 15) # make sure it works with fields res = anneal_quso(type_({(0, 1): 1, (1,): -1, (): 2}), num_anneals=10) assert len(res) == 10 res.sort() for i in range(9): assert res[i].value <= res[i + 1].value # big ordering res = anneal_quso( type_({(i, j): 1 for i in range(70) for j in range(i+1, 70)}), num_anneals=20 ) assert len(res) == 20 res.sort() for i in range(19): assert res[i].value <= res[i + 1].value def test_anneal_pubo(): _anneal_pubo(dict) _anneal_pubo(PUBOMatrix) _anneal_pubo(PUBO) _anneal_pubo(PCBO) def _anneal_pubo(type_): P = type_(puso_to_pubo({(i, i+1, i+2): -1 for i in range(3)})) with assert_raises(ValueError): anneal_pubo(P, anneal_duration=-1) with assert_raises(ValueError): anneal_pubo(P, anneal_duration=-2) with assert_warns(QUBOVertWarning): anneal_pubo(P, temperature_range=(1, 2), schedule=[3, 2]) with assert_warns(QUBOVertWarning): # a quadratic model warns that you shouldn't use anneal_pubo anneal_pubo({(0, 1): 1}) with assert_raises(ValueError): anneal_pubo(P, temperature_range=(1, 2)) with assert_raises(ValueError): anneal_pubo(P, schedule='something') empty_result = AnnealResults() for _ in range(4): empty_result.add_state({}, 2, False) # less than quadratic so will warn with assert_warns(QUBOVertWarning): assert anneal_pubo({(): 2}, num_anneals=4) == empty_result assert anneal_pubo(P, num_anneals=0) == AnnealResults() assert anneal_pubo(P, num_anneals=-1) == AnnealResults() # just make sure everything runs anneal_pubo(P, schedule='linear') res = anneal_pubo(P, initial_state=[1] * 5) for x in res: assert all(i in (0, 1) for i in x.state.values()) # check to see if we find the groundstate of a simple but largeish model. P = type_(puso_to_pubo({(i, i+1): -1 for i in range(30)})) # quadratic so will warn with assert_warns(QUBOVertWarning): res = anneal_pubo(P, num_anneals=4, seed=0) assert res.best.state in ( dict(enumerate([0]*31)), dict(enumerate([1]*31)) ) assert res.best.value == -30 assert len([x for x in res]) == 4 # check to see if we find the groundstate of same but out of order # quadratic so will warn with assert_warns(QUBOVertWarning): res = anneal_pubo(P, num_anneals=4, in_order=False, seed=0) assert res.best.state in ( dict(enumerate([0]*31)), dict(enumerate([1]*31)) ) assert res.best.value == -30 assert len([x for x in res]) == 4 # make sure we run branch where an explicit schedule is given and no # temperature range is supplied # quadratic so will warn with assert_warns(QUBOVertWarning): anneal_pubo(P, schedule=[3] * 10 + [2] * 15) # make sure it works with fields res = anneal_pubo(type_({(0, 1, 2): 1, (1,): -1, (): 2}), num_anneals=10) assert len(res) == 10 res.sort() for i in range(9): assert res[i].value <= res[i + 1].value # bigish ordering res = anneal_pubo( type_( {(i, j, j + 1): 1 for i in range(70) for j in range(i+1, 70)} ), num_anneals=20 ) assert len(res) == 20 res.sort() for i in range(19): assert res[i].value <= res[i + 1].value def test_anneal_qubo(): _anneal_qubo(dict) _anneal_qubo(QUBOMatrix) _anneal_qubo(PUBOMatrix) _anneal_qubo(QUBO) _anneal_qubo(PUBO) _anneal_qubo(PCBO) def _anneal_qubo(type_): Q = type_(quso_to_qubo({(i, i+1): -1 for i in range(3)})) with assert_raises(ValueError): anneal_qubo(Q, anneal_duration=-1) with assert_raises(ValueError): anneal_qubo(Q, anneal_duration=-2) with assert_warns(QUBOVertWarning): anneal_qubo(Q, temperature_range=(1, 2), schedule=[3, 2]) with assert_raises(ValueError): anneal_qubo(Q, temperature_range=(1, 2)) with assert_raises(ValueError): anneal_qubo(Q, schedule='something') empty_result = AnnealResults() for _ in range(4): empty_result.add_state({}, 2, False) assert anneal_qubo({(): 2}, num_anneals=4) == empty_result assert anneal_qubo(Q, num_anneals=0) == AnnealResults() assert anneal_qubo(Q, num_anneals=-1) == AnnealResults() # just make sure everything runs anneal_qubo(Q, schedule='linear') res = anneal_qubo(Q, initial_state=[1] * 5) for x in res: assert all(i in (0, 1) for i in x.state.values()) # check to see if we find the groundstate of a simple but largeish model. Q = type_(quso_to_qubo({(i, i+1): -1 for i in range(30)})) res = anneal_qubo(Q, num_anneals=4, seed=0) assert res.best.state in ( dict(enumerate([0]*31)), dict(enumerate([1]*31)) ) assert res.best.value == -30 assert len([x for x in res]) == 4 # check to see if we find the groundstate of the same but out of order res = anneal_qubo(Q, num_anneals=4, in_order=False, seed=0) assert res.best.state in ( dict(enumerate([0]*31)), dict(enumerate([1]*31)) ) assert res.best.value == -30 assert len([x for x in res]) == 4 # make sure we run branch where an explicit schedule is given and no # temperature range is supplied anneal_qubo(Q, schedule=[3] * 10 + [2] * 15) # make sure it works with fields res = anneal_qubo(type_({(0, 1): 1, (1,): -1, (): 2}), num_anneals=10) assert len(res) == 10 res.sort() for i in range(9): assert res[i].value <= res[i + 1].value # big ordering res = anneal_qubo( type_({(i, j): 1 for i in range(70) for j in range(i+1, 70)}), num_anneals=20 ) assert len(res) == 20 res.sort() for i in range(19): assert res[i].value <= res[i + 1].value def test_anneal_quso_vs_anneal_puso(): L = {(i, j): 1 for i in range(10) for j in range(i+1, 10)} L.update({(i,): 1 for i in range(10)}) kwargs = {} for seed in range(10): kwargs['seed'] = seed for schedule in SCHEDULES: kwargs['schedule'] = schedule for in_order in range(2): kwargs['in_order'] = in_order for anneal_duration in (10, 100, 1000): kwargs['anneal_duration'] = anneal_duration for num_anneals in range(1, 7): kwargs['num_anneals'] = num_anneals for T0 in (.1, 1, 10): kwargs['temperature_range'] = T0, T0 / 2 # quadratic so anneal_puso will warn with assert_warns(QUBOVertWarning): respuso = anneal_puso(L, **kwargs) assert respuso == anneal_quso(L, **kwargs) def test_anneal_qubo_vs_anneal_pubo(): Q = {(i, j): 1 for i in range(10) for j in range(i+1, 10)} Q.update({(i,): 1 for i in range(10)}) kwargs = {} for seed in range(10): kwargs['seed'] = seed for schedule in SCHEDULES: kwargs['schedule'] = schedule for in_order in range(2): kwargs['in_order'] = in_order for anneal_duration in (10, 100, 1000): kwargs['anneal_duration'] = anneal_duration for num_anneals in range(1, 7): kwargs['num_anneals'] = num_anneals for T0 in (.1, 1, 10): kwargs['temperature_range'] = T0, T0 / 2 # quadratic so anneal_pubo will warn with assert_warns(QUBOVertWarning): respubo = anneal_pubo(Q, **kwargs) assert respubo == anneal_qubo(Q, **kwargs)
32.106729
77
0.612805
2,028
13,838
4.034024
0.092702
0.034226
0.020535
0.03227
0.801369
0.800147
0.764088
0.747219
0.688913
0.610561
0
0.038473
0.265573
13,838
430
78
32.181395
0.766506
0.16592
0
0.541667
0
0
0.016199
0
0
0
0
0
0.315972
1
0.034722
false
0
0.017361
0
0.052083
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
1834d3578826b6d9fc3d236d3f66d95d6540f2b9
241
py
Python
src/reactions/__init__.py
AnEvilBurrito/model-builder
f1a7d3a53c7d40b359a5e6521a51869f307ef48c
[ "MIT" ]
null
null
null
src/reactions/__init__.py
AnEvilBurrito/model-builder
f1a7d3a53c7d40b359a5e6521a51869f307ef48c
[ "MIT" ]
null
null
null
src/reactions/__init__.py
AnEvilBurrito/model-builder
f1a7d3a53c7d40b359a5e6521a51869f307ef48c
[ "MIT" ]
null
null
null
from .Degradation import Degradation from .MassAction import MassAction from .MichaelisMenten import MichaelisMenten from .MichaelisMentenGeneral import MichaelisMentenGeneral from .Synthesis import Synthesis from .Reactions import Reactions
40.166667
58
0.879668
24
241
8.833333
0.333333
0
0
0
0
0
0
0
0
0
0
0
0.095436
241
6
59
40.166667
0.972477
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
43fcc4ce0b8e52620c44772735281bee6f5c2745
38
py
Python
src/ZServer/medusa/thread/__init__.py
tseaver/Zope-RFA
08634f39b0f8b56403a2a9daaa6ee4479ef0c625
[ "ZPL-2.1" ]
2
2015-12-21T10:34:56.000Z
2017-09-24T11:07:58.000Z
src/ZServer/medusa/thread/__init__.py
MatthewWilkes/Zope
740f934fc9409ae0062e8f0cd6dcfd8b2df00376
[ "ZPL-2.1" ]
null
null
null
src/ZServer/medusa/thread/__init__.py
MatthewWilkes/Zope
740f934fc9409ae0062e8f0cd6dcfd8b2df00376
[ "ZPL-2.1" ]
null
null
null
# make thread to appear as a package
12.666667
36
0.736842
7
38
4
1
0
0
0
0
0
0
0
0
0
0
0
0.236842
38
2
37
19
0.965517
0.894737
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
a102e56273ad0b01413e6ae42448d6b4543f41fa
34
py
Python
_static/src/python/BasisMath/MatrixTheory/MatrixDecomposition/demo_decomposition.py
metai/aitrace
8e42001f5e3a187801764f413b6ee2f32476c6d1
[ "MIT" ]
1
2022-01-03T06:13:31.000Z
2022-01-03T06:13:31.000Z
_static/src/python/BasisMath/MatrixTheory/MatrixDecomposition/demo_decomposition.py
metai/aitrace
8e42001f5e3a187801764f413b6ee2f32476c6d1
[ "MIT" ]
null
null
null
_static/src/python/BasisMath/MatrixTheory/MatrixDecomposition/demo_decomposition.py
metai/aitrace
8e42001f5e3a187801764f413b6ee2f32476c6d1
[ "MIT" ]
1
2022-01-03T06:13:33.000Z
2022-01-03T06:13:33.000Z
import numpy as np np.linalg.triu
11.333333
18
0.794118
7
34
3.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.147059
34
3
19
11.333333
0.931034
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
a10de0cc0a7286805e9fe4d163bcfd2378041a80
15,378
py
Python
game_logic.py
lintopher0315/GoZero-MCTS
6e43614277d6f85cf19581015dbae4874f0292b6
[ "MIT" ]
1
2021-04-20T23:14:41.000Z
2021-04-20T23:14:41.000Z
game_logic.py
lintopher0315/GoZero-MCTS
6e43614277d6f85cf19581015dbae4874f0292b6
[ "MIT" ]
null
null
null
game_logic.py
lintopher0315/GoZero-MCTS
6e43614277d6f85cf19581015dbae4874f0292b6
[ "MIT" ]
null
null
null
import numpy from collections import Counter class Board: def __init__(self): self.grid = numpy.zeros((19, 19)) self.black_strings = [] self.white_strings = [] self.pos_history = [] self.move_history = [] self.passes = 0 def clear_board(self): self.grid = numpy.zeros((19, 19)) self.black_strings = [] self.white_strings = [] self.pos_history = [] self.move_history = [] self.passes = 0 def update_board(self, x, y, player): if x >= 0 and x < 19 and y >= 0 and y < 19 and (player == 1 or player == 2): self.grid[y][x] = player if player == 2: self.black_strings = self.update_strings(x, y, player) for i in range(len(self.white_strings)-1, -1, -1): if self.is_string_captured(self.white_strings[i], 3-player): self.remove_string(i, 3-player) else: self.white_strings = self.update_strings(x, y, player) for i in range(len(self.black_strings)-1, -1, -1): if self.is_string_captured(self.black_strings[i], 3-player): self.remove_string(i, 3-player) self.pos_history.append([self.black_strings.copy(), self.white_strings.copy()]) self.move_history.append([x, y]) if len(self.pos_history) > 2: self.pos_history.pop(0) self.move_history.pop(0) #print(self.has_neutral_territory()) def invalid_inter(self, x, y, player): if x >= 0 and x < 19 and y >= 0 and y < 19: return self.grid[y][x] != 0 or self.is_self_capture(x, y, player) or self.is_position_repeat(x, y, player) return True def update_strings(self, x, y, player): connected = [] if player == 2: black_copy = self.black_strings.copy() for i in range(len(self.black_strings)): for j in range(len(self.black_strings[i])): if (self.black_strings[i][j][0] == x and abs(self.black_strings[i][j][1] - y) == 1) or (self.black_strings[i][j][1] == y and abs(self.black_strings[i][j][0] - x) == 1): connected.append(i) break connected_string = [] for i in range(len(connected)-1, -1, -1): connected_string += black_copy.pop(connected[i]) connected_string += [[x, y]] black_copy.append(connected_string) return black_copy else: white_copy = self.white_strings.copy() for i in range(len(self.white_strings)): for j in range(len(self.white_strings[i])): if (self.white_strings[i][j][0] == x and abs(self.white_strings[i][j][1] - y) == 1) or (self.white_strings[i][j][1] == y and abs(self.white_strings[i][j][0] - x) == 1): connected.append(i) break connected_string = [] for i in range(len(connected)-1, -1, -1): connected_string += white_copy.pop(connected[i]) connected_string += [[x, y]] white_copy.append(connected_string) return white_copy def is_string_captured(self, string, player): stack = [] visited = [] stack.append(string[0].copy()) while len(stack) > 0: rem = stack.pop() visited.append(rem) if rem[0]+1<19 and [rem[0]+1, rem[1]] not in visited: if self.grid[rem[1]][rem[0]+1] == 0: return False elif self.grid[rem[1]][rem[0]+1] == player: stack.append([rem[0]+1, rem[1]]) if rem[1]+1<19 and [rem[0], rem[1]+1] not in visited: if self.grid[rem[1]+1][rem[0]] == 0: return False elif self.grid[rem[1]+1][rem[0]] == player: stack.append([rem[0], rem[1]+1]) if rem[0]-1>=0 and [rem[0]-1, rem[1]] not in visited: if self.grid[rem[1]][rem[0]-1] == 0: return False elif self.grid[rem[1]][rem[0]-1] == player: stack.append([rem[0]-1, rem[1]]) if rem[1]-1>=0 and [rem[0], rem[1]-1] not in visited: if self.grid[rem[1]-1][rem[0]] == 0: return False elif self.grid[rem[1]-1][rem[0]] == player: stack.append([rem[0], rem[1]-1]) return True def get_score(self): white_score = 0 black_score = 0 temp = numpy.copy(self.grid) for i in range(19): for j in range(19): if temp[i][j] == 0: side = self.get_territory_color(j, i) stack = [] visited = [] stack.append([j, i]) while len(stack) > 0: rem = stack.pop() visited.append(rem) temp[rem[1]][rem[0]] = side if rem[0]+1<19 and [rem[0]+1, rem[1]] not in visited: if temp[rem[1]][rem[0]+1] == 0: stack.append([rem[0]+1, rem[1]]) if rem[1]+1<19 and [rem[0], rem[1]+1] not in visited: if temp[rem[1]+1][rem[0]] == 0: stack.append([rem[0], rem[1]+1]) if rem[0]-1>=0 and [rem[0]-1, rem[1]] not in visited: if temp[rem[1]][rem[0]-1] == 0: stack.append([rem[0]-1, rem[1]]) if rem[1]-1>=0 and [rem[0], rem[1]-1] not in visited: if temp[rem[1]-1][rem[0]] == 0: stack.append([rem[0], rem[1]-1]) if side == 4: white_score += 1 elif side == 5: black_score += 1 elif temp[i][j] == 1 or temp[i][j] == 4: white_score += 1 elif temp[i][j] == 2 or temp[i][j] == 5: black_score += 1 return [white_score, black_score] def has_neutral_territory(self): board = self.grid.copy() for i in range(19): for j in range(19): if board[i][j] == 0: stack = [] visited = [] side = None stack.append([j, i]) while len(stack) > 0: rem = stack.pop() visited.append(rem) if rem[0]+1<19 and [rem[0]+1, rem[1]] not in visited: if board[rem[1]][rem[0]+1] == 0: stack.append([rem[0]+1, rem[1]]) board[rem[1]][rem[0]+1] = 3 elif board[rem[1]][rem[0]+1] == 1: if side is None: side = 4 elif side is not None and side != 4: return True elif board[rem[1]][rem[0]+1] == 2: if side is None: side = 5 elif side is not None and side != 5: return True if rem[1]+1<19 and [rem[0], rem[1]+1] not in visited: if board[rem[1]+1][rem[0]] == 0: stack.append([rem[0], rem[1]+1]) board[rem[1]+1][rem[0]] = 3 elif board[rem[1]+1][rem[0]] == 1: if side is None: side = 4 elif side is not None and side != 4: return True elif board[rem[1]+1][rem[0]] == 2: if side is None: side = 5 elif side is not None and side != 5: return True if rem[0]-1>=0 and [rem[0]-1, rem[1]] not in visited: if board[rem[1]][rem[0]-1] == 0: stack.append([rem[0]-1, rem[1]]) board[rem[1]][rem[0]-1] = 3 elif board[rem[1]][rem[0]-1] == 1: if side is None: side = 4 elif side is not None and side != 4: return True elif board[rem[1]][rem[0]-1] == 2: if side is None: side = 5 elif side is not None and side != 5: return True if rem[1]-1>=0 and [rem[0], rem[1]-1] not in visited: if board[rem[1]-1][rem[0]] == 0: stack.append([rem[0], rem[1]-1]) board[rem[1]-1][rem[0]] = 3 elif board[rem[1]-1][rem[0]] == 1: if side is None: side = 4 elif side is not None and side != 4: return True elif board[rem[1]-1][rem[0]] == 2: if side is None: side = 5 elif side is not None and side != 5: return True return False def get_territory_color(self, x, y): stack = [] visited = [] side = None stack.append([x, y]) while len(stack) > 0: rem = stack.pop() visited.append(rem) if rem[0]+1<19 and [rem[0]+1, rem[1]] not in visited: if self.grid[rem[1]][rem[0]+1] == 0: stack.append([rem[0]+1, rem[1]]) elif self.grid[rem[1]][rem[0]+1] == 1: if side is None: side = 4 elif side is not None and side != 4: return 3 elif self.grid[rem[1]][rem[0]+1] == 2: if side is None: side = 5 elif side is not None and side != 5: return 3 if rem[1]+1<19 and [rem[0], rem[1]+1] not in visited: if self.grid[rem[1]+1][rem[0]] == 0: stack.append([rem[0], rem[1]+1]) elif self.grid[rem[1]+1][rem[0]] == 1: if side is None: side = 4 elif side is not None and side != 4: return 3 elif self.grid[rem[1]+1][rem[0]] == 2: if side is None: side = 5 elif side is not None and side != 5: return 3 if rem[0]-1>=0 and [rem[0]-1, rem[1]] not in visited: if self.grid[rem[1]][rem[0]-1] == 0: stack.append([rem[0]-1, rem[1]]) elif self.grid[rem[1]][rem[0]-1] == 1: if side is None: side = 4 elif side is not None and side != 4: return 3 elif self.grid[rem[1]][rem[0]-1] == 2: if side is None: side = 5 elif side is not None and side != 5: return 3 if rem[1]-1>=0 and [rem[0], rem[1]-1] not in visited: if self.grid[rem[1]-1][rem[0]] == 0: stack.append([rem[0], rem[1]-1]) elif self.grid[rem[1]-1][rem[0]] == 1: if side is None: side = 4 elif side is not None and side != 4: return 3 elif self.grid[rem[1]-1][rem[0]] == 2: if side is None: side = 5 elif side is not None and side != 5: return 3 return side def remove_string(self, index, player): coords = None if player == 2: coords = self.black_strings.pop(index) else: coords = self.white_strings.pop(index) for coord in coords: self.grid[coord[1]][coord[0]] = 0 def is_self_capture(self, x, y, player): self.grid[y][x] = player if player == 2: black_copy = self.update_strings(x, y, player) for i in range(len(self.white_strings)-1, -1, -1): if self.is_string_captured(self.white_strings[i], 3-player): self.grid[y][x] = 0 return False for i in range(len(black_copy)-1, -1, -1): if self.is_string_captured(black_copy[i], player): self.grid[y][x] = 0 return True else: white_copy = self.update_strings(x, y, player) for i in range(len(self.black_strings)-1, -1, -1): if self.is_string_captured(self.black_strings[i], 3-player): self.grid[y][x] = 0 return False for i in range(len(white_copy)-1, -1, -1): if self.is_string_captured(white_copy[i], player): self.grid[y][x] = 0 return True self.grid[y][x] = 0 return False def is_position_repeat(self, x, y, player): if len(self.pos_history) > 1: self.grid[y][x] = player black_copy = self.black_strings.copy() white_copy = self.white_strings.copy() if player == 2: black_copy = self.update_strings(x, y, player) for i in range(len(white_copy)-1, -1, -1): if self.is_string_captured(white_copy[i], 3-player): white_copy.pop(i) else: white_copy = self.update_strings(x, y, player) for i in range(len(black_copy)-1, -1, -1): if self.is_string_captured(black_copy[i], 3-player): black_copy.pop(i) if sorted([point for string in black_copy for point in string]) != sorted([point for string in self.pos_history[0][0] for point in string]): self.grid[y][x] = 0 return False if sorted([point for string in white_copy for point in string]) != sorted([point for string in self.pos_history[0][1] for point in string]): self.grid[y][x] = 0 return False self.grid[y][x] = 0 return True return False
45.767857
188
0.412993
1,939
15,378
3.203198
0.041258
0.052166
0.038641
0.023185
0.835131
0.801803
0.760264
0.739816
0.689744
0.689744
0
0.057669
0.463259
15,378
335
189
45.904478
0.694815
0.002276
0
0.684543
0
0
0
0
0
0
0
0
0
1
0.037855
false
0.006309
0.006309
0
0.164038
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
a10f035f31307aa61e0507b894ece27f03835dfa
19
py
Python
tempfortest.py
Monaf84DAS/odoowaft
d1e6df5114c3bae98eada4d645a4fad1adea0c5d
[ "Apache-2.0" ]
null
null
null
tempfortest.py
Monaf84DAS/odoowaft
d1e6df5114c3bae98eada4d645a4fad1adea0c5d
[ "Apache-2.0" ]
null
null
null
tempfortest.py
Monaf84DAS/odoowaft
d1e6df5114c3bae98eada4d645a4fad1adea0c5d
[ "Apache-2.0" ]
null
null
null
#this for testing g
19
19
0.789474
4
19
3.75
1
0
0
0
0
0
0
0
0
0
0
0
0.157895
19
1
19
19
0.9375
0.947368
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
a147f102e770466c51e3823e8d96e9ac48dd105d
4,847
py
Python
coreai/src/VGG16Implement.py
nguyenquanghieu2000d/ai-mon-hoc
6026abd6157992004930f99b5fd6c9d8269c8d2d
[ "Apache-2.0" ]
2
2021-06-25T17:48:15.000Z
2021-06-25T17:55:49.000Z
src/VGG16Implement.py
nguyenquanghieu2000d/PlateDetectApp
3145394fb12fbe831a3f94f33b3278b705da86c0
[ "Apache-2.0" ]
null
null
null
src/VGG16Implement.py
nguyenquanghieu2000d/PlateDetectApp
3145394fb12fbe831a3f94f33b3278b705da86c0
[ "Apache-2.0" ]
null
null
null
from tensorflow.python.keras import backend from tensorflow.python.keras.applications import imagenet_utils from tensorflow.python.keras.utils import data_utils from tensorflow.python.keras.engine import training from tensorflow.keras import layers import tensorflow as tf from src.setting import * WEIGHTS_PATH_NO_TOP = ('https://storage.googleapis.com/tensorflow/' 'keras-applications/vgg16/' 'vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5') def Vgg16(weights='imagenet', input_shape=None): # Determine proper input shape # input_shape = imagenet_utils.obtain_input_shape( # input_shape, # default_size=224, # min_size=32, # data_format=backend.image_data_format(), # require_flatten=False, # weights=weights) # # img_input = layers.Input(shape=input_shape) # # # Block 1 # x = layers.Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv1')(img_input) # x = layers.Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv2')(x) # x = layers.MaxPooling2D((2, 2), strides=(2, 2), name='block1_pool')(x) # # # Block 2 # x = layers.Conv2D(128, (3, 3), activation='relu', padding='same', name='block2_conv1')(x) # x = layers.Conv2D(128, (3, 3), activation='relu', padding='same', name='block2_conv2')(x) # x = layers.MaxPooling2D((2, 2), strides=(2, 2), name='block2_pool')(x) # # # Block 3 # x = layers.Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv1')(x) # x = layers.Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv2')(x) # x = layers.Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv3')(x) # x = layers.MaxPooling2D((2, 2), strides=(2, 2), name='block3_pool')(x) # # # Block 4 # x = layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv1')(x) # x = layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv2')(x) # x = layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv3')(x) # x = layers.MaxPooling2D((2, 2), strides=(2, 2), name='block4_pool')(x) # # # Block 5 # x = layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv1')(x) # x = layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv2')(x) # x = layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv3')(x) # x = layers.MaxPooling2D((2, 2), strides=(2, 2), name='block5_pool')(x) # # inputs = img_input # # Create model. # model = training.Model(inputs, x, name='vgg16') model = tf.keras.models.Sequential() # Block 1 model.add(layers.Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv1', input_shape=(IMAGE_WIDTH, IMAGE_HEIGHT, 3))) model.add(layers.Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv2')) model.add(layers.MaxPooling2D((2, 2), strides=(2, 2), name='block1_pool')) # Block 2 model.add(layers.Conv2D(128, (3, 3), activation='relu', padding='same', name='block2_conv1')) model.add(layers.Conv2D(128, (3, 3), activation='relu', padding='same', name='block2_conv2')) model.add(layers.MaxPooling2D((2, 2), strides=(2, 2), name='block2_pool')) # Block 3 model.add(layers.Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv1')) model.add(layers.Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv2')) model.add(layers.Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv3')) model.add(layers.MaxPooling2D((2, 2), strides=(2, 2), name='block3_pool')) # # Block 4 model.add(layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv1')) model.add(layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv2')) model.add(layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv3')) model.add(layers.MaxPooling2D((2, 2), strides=(2, 2), name='block4_pool')) # Block 5 model.add(layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv1')) model.add(layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv2')) model.add(layers.Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv3')) model.add(layers.MaxPooling2D((2, 2), strides=(2, 2), name='block5_pool')) # Load weights. weights_path = data_utils.get_file( 'vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5', WEIGHTS_PATH_NO_TOP, cache_subdir='models', file_hash='6d6bbae143d832006294945121d1f1fc') model.load_weights(weights_path) return model
53.855556
140
0.649887
670
4,847
4.576119
0.138806
0.101761
0.101761
0.135682
0.726027
0.705479
0.705479
0.705479
0.705479
0.678735
0
0.077264
0.161543
4,847
89
141
54.460674
0.677165
0.409119
0
0
0
0
0.187322
0.055199
0
0
0
0
0
1
0.027027
false
0
0.189189
0
0.243243
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
a14d0a53367d6274fd20c5008b1f8a94ca1bc833
47
py
Python
blogapp/password.py
piyushgit1/blogsite
9204e48a5197a221be1473be5933ffd75c25ce22
[ "MIT" ]
null
null
null
blogapp/password.py
piyushgit1/blogsite
9204e48a5197a221be1473be5933ffd75c25ce22
[ "MIT" ]
5
2020-10-12T19:09:08.000Z
2021-09-22T19:37:37.000Z
blogapp/password.py
piyushgit1/blogsite
9204e48a5197a221be1473be5933ffd75c25ce22
[ "MIT" ]
4
2020-10-15T17:37:14.000Z
2020-10-18T14:33:41.000Z
import os password = os.environ['SECRET_KEY']
11.75
35
0.744681
7
47
4.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.12766
47
3
36
15.666667
0.829268
0
0
0
0
0
0.212766
0
0
0
0
0
0
1
0
false
0.5
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
5
a16820274e4e45b03d7e72232b207be625076139
310
py
Python
demos/python/sdk_wireless_camera_control/open_gopro/wifi/__init__.py
Natureshadow/OpenGoPro
05110123cfbf6584288b813f2d4896d3a091480e
[ "MIT" ]
210
2021-06-05T20:06:17.000Z
2022-03-31T18:13:17.000Z
demos/python/sdk_wireless_camera_control/open_gopro/wifi/__init__.py
Natureshadow/OpenGoPro
05110123cfbf6584288b813f2d4896d3a091480e
[ "MIT" ]
73
2021-06-01T21:22:44.000Z
2022-03-31T18:33:24.000Z
demos/python/sdk_wireless_camera_control/open_gopro/wifi/__init__.py
Natureshadow/OpenGoPro
05110123cfbf6584288b813f2d4896d3a091480e
[ "MIT" ]
70
2021-06-07T03:59:04.000Z
2022-03-26T10:51:15.000Z
# __init__.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Tue Sep 7 21:35:53 UTC 2021 """Open GoPro WiFi Interface interace and implementation""" from .controller import SsidState, WifiController from .client import WifiClient
38.75
98
0.767742
46
310
5.086957
0.826087
0.076923
0
0
0
0
0
0
0
0
0
0.063433
0.135484
310
7
99
44.285714
0.809701
0.7
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
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
5
a16f7387ec65e425e866249095239a2875b35b7b
35
py
Python
new.py
luket4/cs3240-labdemo
c59a92ae6808ec3e0de923e8a99784f8c8f18783
[ "MIT" ]
null
null
null
new.py
luket4/cs3240-labdemo
c59a92ae6808ec3e0de923e8a99784f8c8f18783
[ "MIT" ]
null
null
null
new.py
luket4/cs3240-labdemo
c59a92ae6808ec3e0de923e8a99784f8c8f18783
[ "MIT" ]
null
null
null
from helper import * greeting(bye)
11.666667
20
0.771429
5
35
5.4
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
35
2
21
17.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
a17db1fe47d11acf8ccbe5af10276daecede73ec
140
py
Python
tcellmatch/api/export.py
theislab/tcellmatch
ddd344e44147f97f35d6a4e7c3c7677981fd177e
[ "BSD-3-Clause" ]
25
2019-08-14T22:39:40.000Z
2022-03-02T15:42:35.000Z
tcellmatch/api/export.py
theislab/tcellmatch
ddd344e44147f97f35d6a4e7c3c7677981fd177e
[ "BSD-3-Clause" ]
2
2021-07-13T23:40:14.000Z
2021-12-18T10:08:37.000Z
tcellmatch/api/export.py
theislab/tcellmatch
ddd344e44147f97f35d6a4e7c3c7677981fd177e
[ "BSD-3-Clause" ]
4
2020-02-21T20:43:41.000Z
2022-03-21T14:38:58.000Z
from tcellmatch.estimators import EstimatorBase from tcellmatch.models.layers import LayerInception, LayerConv, LayerMultiheadSelfAttention
46.666667
91
0.892857
13
140
9.615385
0.769231
0.224
0
0
0
0
0
0
0
0
0
0
0.071429
140
2
92
70
0.961538
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
0
0
0
5
a1ae9ee25fb4db3f8c01674d4a7b747d16c05623
70
py
Python
core/numba_extension/types.py
uchytilc/PyCu
9ba25281611bf4dbd70d37f4eba0574f817d6928
[ "MIT" ]
null
null
null
core/numba_extension/types.py
uchytilc/PyCu
9ba25281611bf4dbd70d37f4eba0574f817d6928
[ "MIT" ]
null
null
null
core/numba_extension/types.py
uchytilc/PyCu
9ba25281611bf4dbd70d37f4eba0574f817d6928
[ "MIT" ]
null
null
null
from .vector.vectordecl import * from .interval.intervaldecl import *
23.333333
36
0.8
8
70
7
0.75
0
0
0
0
0
0
0
0
0
0
0
0.114286
70
2
37
35
0.903226
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a1bb3d668181edbb201bb1e4d471927bec459d6d
220
py
Python
core/exceptions.py
Lola224/hakkuframework
b9b87457a24df34f00ceece4928679c6d6b52f59
[ "MIT" ]
250
2016-12-29T02:43:04.000Z
2022-03-31T05:51:23.000Z
core/exceptions.py
Lola224/hakkuframework
b9b87457a24df34f00ceece4928679c6d6b52f59
[ "MIT" ]
2
2017-08-08T06:22:10.000Z
2021-05-22T01:59:43.000Z
core/exceptions.py
Lola224/hakkuframework
b9b87457a24df34f00ceece4928679c6d6b52f59
[ "MIT" ]
86
2016-12-29T06:39:34.000Z
2021-12-12T20:07:39.000Z
class UnknownCommand(Exception): pass class ModuleNotFound(Exception): pass class VariableError(Exception): pass class ModuleError: error = "" def __init__(self, error): self.error = error
15.714286
32
0.681818
22
220
6.636364
0.5
0.267123
0.369863
0
0
0
0
0
0
0
0
0
0.231818
220
14
33
15.714286
0.863905
0
0
0.3
0
0
0
0
0
0
0
0
0
1
0.1
false
0.3
0
0
0.6
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
5
b80ba0e091dd644fa43a43a029bb2039633b06da
94
py
Python
diagnose/admin.py
poudyalanil/pneumonia-detection-system
0cb65311fde5592eb11ce574bcc4581724a7c6cb
[ "MIT" ]
8
2020-10-02T02:41:12.000Z
2021-09-22T08:37:26.000Z
diagnose/admin.py
poudyalanil/pneumonia-detection-system
0cb65311fde5592eb11ce574bcc4581724a7c6cb
[ "MIT" ]
5
2020-10-14T09:42:02.000Z
2022-03-12T00:57:51.000Z
diagnose/admin.py
poudyalanil/pneumonia-detection-system
0cb65311fde5592eb11ce574bcc4581724a7c6cb
[ "MIT" ]
1
2021-05-27T07:41:04.000Z
2021-05-27T07:41:04.000Z
from django.contrib import admin from .models import Diagnose admin.site.register(Diagnose)
15.666667
32
0.819149
13
94
5.923077
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.117021
94
5
33
18.8
0.927711
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
629b9a47f3343b0c0a5fc76b9b6a0bee1d31c32e
155
py
Python
load_env_paths.py
touir1/youtube-music-sync
d929531970d64d95ce7017da24b86d6e853c5e51
[ "MIT" ]
1
2022-02-20T00:28:43.000Z
2022-02-20T00:28:43.000Z
load_env_paths.py
touir1/youtube-music-sync
d929531970d64d95ce7017da24b86d6e853c5e51
[ "MIT" ]
null
null
null
load_env_paths.py
touir1/youtube-music-sync
d929531970d64d95ce7017da24b86d6e853c5e51
[ "MIT" ]
null
null
null
import os class EnvPathLoader: @staticmethod def load_env_paths(): os.environ['PATH'] = os.environ['PATH']+";"+os.getcwd()+"/ffmpeg/bin"
19.375
77
0.632258
19
155
5.052632
0.736842
0.1875
0.270833
0.3125
0
0
0
0
0
0
0
0
0.180645
155
8
77
19.375
0.755906
0
0
0
0
0
0.128205
0
0
0
0
0
0
1
0.2
true
0
0.2
0
0.6
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
0
0
0
0
0
5
62c1a9edad84d0b321242f8da9f391cc5e7980d6
88
py
Python
tweets/admin.py
julesc00/tweetme
ed4cc3d912ef87eff711c43ebe3f13072a1eafc8
[ "MIT" ]
null
null
null
tweets/admin.py
julesc00/tweetme
ed4cc3d912ef87eff711c43ebe3f13072a1eafc8
[ "MIT" ]
2
2020-02-12T03:03:46.000Z
2020-06-05T22:13:54.000Z
twitter_timeline/twitter/admin.py
ine-rmotr-projects/wdd-w1-twitter-timeline
ad89e4218a9d8d2ecc8444c899c00dd856091b5e
[ "MIT" ]
9
2016-08-27T13:23:03.000Z
2017-08-18T15:48:11.000Z
from django.contrib import admin from .models import Tweet admin.site.register(Tweet)
14.666667
32
0.806818
13
88
5.461538
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.125
88
5
33
17.6
0.922078
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
62cb7837da09ae7eb835834fcac1d93f23c209f9
72
py
Python
symupy/runtime/logic/__init__.py
symuvia/symupy
e6604c59bb4474f594ef5c997508f0407c9b3870
[ "MIT" ]
2
2019-07-01T09:58:53.000Z
2020-06-12T12:12:46.000Z
symupy/runtime/logic/__init__.py
licit-lab/symupy
942a17ee78cd12a363a4cd7b7f8363e239ccf7fe
[ "MIT" ]
33
2021-01-18T13:59:01.000Z
2021-11-29T13:21:10.000Z
symupy/runtime/logic/__init__.py
licit-lab/symupy
942a17ee78cd12a363a4cd7b7f8363e239ccf7fe
[ "MIT" ]
7
2018-07-12T13:34:38.000Z
2019-10-02T13:37:31.000Z
""" Runtime logic ============= """ from .runtime import RuntimeDevice
10.285714
34
0.583333
6
72
7
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.138889
72
6
35
12
0.677419
0.375
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
62cbd967a688d7aaf0265ea0c54a9bca92027e98
312
py
Python
app/physics/models.py
barklan/mipt.one-docker
6a2e3e174fa8d018d12fdfa4898709a0dc207c37
[ "MIT" ]
1
2021-01-15T11:35:14.000Z
2021-01-15T11:35:14.000Z
app/physics/models.py
barklan/mipt.one-docker
6a2e3e174fa8d018d12fdfa4898709a0dc207c37
[ "MIT" ]
3
2020-12-28T07:52:30.000Z
2021-01-30T20:43:15.000Z
app/physics/models.py
barklan/mipt.one-docker
6a2e3e174fa8d018d12fdfa4898709a0dc207c37
[ "MIT" ]
null
null
null
from django.db import models # Create your models here. class Zad(models.Model): sem = models.CharField(max_length=2) zad = models.CharField(max_length=10) page = models.IntegerField() identifier = models.CharField(max_length=10, primary_key=True) def __str__(self): return self.zad
28.363636
66
0.714744
43
312
5
0.627907
0.209302
0.251163
0.334884
0.24186
0
0
0
0
0
0
0.019608
0.182692
312
11
67
28.363636
0.823529
0.076923
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
0.125
0.125
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
62ce9465977d4705046f1713b7261786f2d71fbb
10,301
py
Python
tests/printer_test.py
xdslproject/xdsl
828cd3e8153ae78cc83a7ccd7e1b1004ec711e3c
[ "Apache-2.0" ]
6
2021-12-20T17:50:09.000Z
2022-03-01T10:56:13.000Z
tests/printer_test.py
xdslproject/xdsl
828cd3e8153ae78cc83a7ccd7e1b1004ec711e3c
[ "Apache-2.0" ]
72
2021-11-28T01:19:47.000Z
2022-03-30T15:42:58.000Z
tests/printer_test.py
xdslproject/xdsl
828cd3e8153ae78cc83a7ccd7e1b1004ec711e3c
[ "Apache-2.0" ]
4
2021-12-30T08:31:23.000Z
2022-03-04T11:26:56.000Z
from __future__ import annotations from io import StringIO from xdsl.printer import Printer from xdsl.parser import Parser from xdsl.dialects.builtin import Builtin from xdsl.dialects.arith import * from xdsl.diagnostic import Diagnostic def test_forgotten_op(): """Test that the parsing of an undefined operand raises an exception.""" ctx = MLContext() arith = Arith(ctx) lit = Constant.from_int_constant(42, 32) add = Addi.get(lit, lit) add.verify() try: printer = Printer() printer.print_op(add) except KeyError: return assert False, "Exception expected" # ____ _ _ _ # | _ \(_) __ _ __ _ _ __ ___ ___| |_(_) ___ # | | | | |/ _` |/ _` | '_ \ / _ \/ __| __| |/ __| # | |_| | | (_| | (_| | | | | (_) \__ \ |_| | (__ # |____/|_|\__,_|\__, |_| |_|\___/|___/\__|_|\___| # |___/ # def test_op_message(): """Test that an operation message can be printed.""" prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" expected = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] ^^^^^^^^^^^^^^^^^^^^^^^^^^ | Test message -------------------------- %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") diagnostic = Diagnostic() diagnostic.add_message(module.ops[0], "Test message") printer = Printer(stream=file, diagnostic=diagnostic) printer.print_op(module) assert file.getvalue().strip() == expected.strip() def test_two_different_op_messages(): """Test that an operation message can be printed.""" prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" expected = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] ^^^^^^^^^^^^^^^^^^^^^^^^^^ | Test message 1 -------------------------- %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) ^^^^^^^^^^^^^^^^^^^^^^ | Test message 2 ---------------------- }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") diagnostic = Diagnostic() diagnostic.add_message(module.ops[0], "Test message 1") diagnostic.add_message(module.ops[1], "Test message 2") printer = Printer(stream=file, diagnostic=diagnostic) printer.print_op(module) assert file.getvalue().strip() == expected.strip() def test_two_same_op_messages(): """Test that an operation message can be printed.""" prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" expected = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] ^^^^^^^^^^^^^^^^^^^^^^^^^^ | Test message 1 -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ | Test message 2 -------------------------- %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") diagnostic = Diagnostic() printer = Printer(stream=file, diagnostic=diagnostic) diagnostic.add_message(module.ops[0], "Test message 1") diagnostic.add_message(module.ops[0], "Test message 2") printer.print_op(module) assert file.getvalue().strip() == expected.strip() def test_op_message_with_region(): """Test that an operation message can be printed on an operation with a region.""" prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" expected = \ """\ module() { ^^^^^^- | Test ------- %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") diagnostic = Diagnostic() printer = Printer(stream=file, diagnostic=diagnostic) diagnostic.add_message(module, "Test") printer.print_op(module) assert file.getvalue().strip() == expected.strip() def test_op_message_with_region_and_overflow(): """ Test that an operation message can be printed on an operation with a region, where the message is bigger than the operation. """ prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" expected = \ """\ module() { ^^^^^^--------- | Test message --------------- %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") diagnostic = Diagnostic() printer = Printer(stream=file, diagnostic=diagnostic) diagnostic.add_message(module, "Test message") printer.print_op(module) assert file.getvalue().strip() == expected.strip() def test_diagnostic(): """ Test that an operation message can be printed on an operation with a region, where the message is bigger than the operation. """ prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" expected = \ """\ Exception: test message module() { ^^^^^^^^------- | Test message --------------- %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = arith.addi(%0 : !i32, %0 : !i32) }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) parser = Parser(ctx, prog) module = parser.parse_op() diag = Diagnostic() diag.add_message(module, "Test") try: diag.raise_exception("test message", module) except Exception as e: assert str(e) # ____ ____ _ _ _ # / ___/ ___| / \ | \ | | __ _ _ __ ___ ___ # \___ \___ \ / _ \ | \| |/ _` | '_ ` _ \ / _ \ # ___) |__) / ___ \| |\ | (_| | | | | | | __/ # |____/____/_/ \_\_| \_|\__,_|_| |_| |_|\___| # def test_print_costum_name(): """ Test that an SSAValue, that is a name and not a number, reserves that name """ prog = \ """module() { %i : !i32 = arith.constant() ["value" = 42 : !i32] %213 : !i32 = arith.addi(%i : !i32, %i : !i32) }""" expected = \ """\ module() { %i : !i32 = arith.constant() ["value" = 42 : !i32] %0 : !i32 = arith.addi(%i : !i32, %i : !i32) }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") printer = Printer(stream=file) printer.print_op(module) assert file.getvalue().strip() == expected.strip() # ____ _ _____ _ # / ___| _ ___| |_ ___ _ __ ___ | ___|__ _ __ _ __ ___ __ _| |_ # | | | | | / __| __/ _ \| '_ ` _ \| |_ / _ \| '__| '_ ` _ \ / _` | __| # | |__| |_| \__ \ || (_) | | | | | | _| (_) | | | | | | | | (_| | |_ # \____\__,_|___/\__\___/|_| |_| |_|_| \___/|_| |_| |_| |_|\__,_|\__| # @irdl_op_definition class PlusCustomFormatOp(Operation): name = "test.add" lhs = OperandDef(IntegerType) rhs = OperandDef(IntegerType) res = ResultDef(IntegerType) @classmethod def parse(cls, result_types: List[Attribute], parser: Parser) -> PlusCustomFormatOp: lhs = parser.parse_ssa_value() parser.skip_white_space() parser.parse_char("+") rhs = parser.parse_ssa_value() return PlusCustomFormatOp.create(operands=[lhs, rhs], result_types=result_types) def print(self, printer: Printer): printer.print(" ", self.lhs, " + ", self.rhs) def test_generic_format(): """ Test that we can use generic formats in operations. """ prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = "test.add"(%0: !i32, %0: !i32) }""" expected = \ """\ module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = test.add %0 + %0 }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) ctx.register_op(PlusCustomFormatOp) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") printer = Printer(stream=file) printer.print_op(module) assert file.getvalue().strip() == expected.strip() def test_custom_format(): """ Test that we can use custom formats in operations. """ prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = test.add %0 + %0 }""" expected = \ """\ module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = test.add %0 + %0 }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) ctx.register_op(PlusCustomFormatOp) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") printer = Printer(stream=file) printer.print_op(module) assert file.getvalue().strip() == expected.strip() def test_custom_format(): """ Test that we can print using generic formats. """ prog = \ """module() { %0 : !i32 = arith.constant() ["value" = 42 : !i32] %1 : !i32 = test.add %0 + %0 }""" expected = \ """\ "module"() { %0 : !i32 = "arith.constant"() ["value" = 42 : !i32] %1 : !i32 = "test.add"(%0 : !i32, %0 : !i32) }""" ctx = MLContext() arith = Arith(ctx) builtin = Builtin(ctx) ctx.register_op(PlusCustomFormatOp) parser = Parser(ctx, prog) module = parser.parse_op() file = StringIO("") printer = Printer(stream=file, print_generic_format=True) printer.print_op(module) assert file.getvalue().strip() == expected.strip()
25.309582
86
0.538686
1,092
10,301
4.775641
0.114469
0.03605
0.061361
0.080537
0.770086
0.765292
0.760499
0.753404
0.73442
0.73442
0
0.041481
0.25813
10,301
407
87
25.309582
0.640932
0.153286
0
0.699422
0
0
0.023104
0
0
0
0
0
0.063584
1
0.075145
false
0
0.040462
0
0.156069
0.138728
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
1a05f726ffcfc2f230072d40b37d1ea9045f5b15
181
py
Python
tests/test_first_figure.py
JamesPMColeman/Data-Delight
04249be65650a1c6fa4720e74e5ace60844e3741
[ "MIT" ]
null
null
null
tests/test_first_figure.py
JamesPMColeman/Data-Delight
04249be65650a1c6fa4720e74e5ace60844e3741
[ "MIT" ]
null
null
null
tests/test_first_figure.py
JamesPMColeman/Data-Delight
04249be65650a1c6fa4720e74e5ace60844e3741
[ "MIT" ]
null
null
null
import unittest from unittest.mock import patch class TestFirstFigure(unittest.TestCase): @patch('scripts.first_figure.show') def test_call_output_file(self, mock_show): pass
20.111111
44
0.80663
25
181
5.64
0.76
0
0
0
0
0
0
0
0
0
0
0
0.104972
181
9
45
20.111111
0.87037
0
0
0
0
0
0.137363
0.137363
0
0
0
0
0
1
0.166667
false
0.166667
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
0
1
1
0
1
0
0
5
a7e7a23f880890df55afde120f4863eaa7c64026
109
py
Python
petstagram/common/admin.py
DiyanKalaydzhiev23/petstagram
657181ec2405daffe20c064509097aa0031ecb98
[ "MIT" ]
null
null
null
petstagram/common/admin.py
DiyanKalaydzhiev23/petstagram
657181ec2405daffe20c064509097aa0031ecb98
[ "MIT" ]
null
null
null
petstagram/common/admin.py
DiyanKalaydzhiev23/petstagram
657181ec2405daffe20c064509097aa0031ecb98
[ "MIT" ]
null
null
null
from django.contrib import admin from petstagram.common.models import Comment admin.site.register(Comment)
18.166667
44
0.834862
15
109
6.066667
0.733333
0
0
0
0
0
0
0
0
0
0
0
0.100917
109
5
45
21.8
0.928571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a7f356d4c87d40eb03de5551e66b5ff8c1dfa1e5
256
py
Python
recreate/common/constants.py
majo48/recreate-git
355365729793d98b4d36bf3c4bf0e174bde3ebd7
[ "MIT" ]
null
null
null
recreate/common/constants.py
majo48/recreate-git
355365729793d98b4d36bf3c4bf0e174bde3ebd7
[ "MIT" ]
null
null
null
recreate/common/constants.py
majo48/recreate-git
355365729793d98b4d36bf3c4bf0e174bde3ebd7
[ "MIT" ]
null
null
null
""" common part of the recreate app functions: mydocuments(): the fully qualified path to the MyDocuments folder """ import os def mydocuments(): """ get the path to the MyDocuments folder """ return os.path.expanduser('~/documents')
23.272727
73
0.679688
32
256
5.4375
0.625
0.068966
0.103448
0.229885
0.298851
0
0
0
0
0
0
0
0.214844
256
11
74
23.272727
0.865672
0.597656
0
0
0
0
0.134146
0
0
0
0
0
0
1
0.333333
true
0
0.333333
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
5
c55b8c09b970b8ae49b88ea02dcf30e83fa61176
306
py
Python
ramda/add_index_test.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
56
2018-08-06T08:44:58.000Z
2022-03-17T09:49:03.000Z
ramda/add_index_test.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
28
2019-06-17T11:09:52.000Z
2022-02-18T16:59:21.000Z
ramda/add_index_test.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
5
2019-09-18T09:24:38.000Z
2021-07-21T08:40:23.000Z
from ramda import * from ramda.private.asserts import * # map_indexed = add_index(map) def add_index_test(): pass # assert_equal( # map_indexed(lambda val, idx: idx + '-' + val, # ['f', 'o', 'o', 'b', 'a', 'r']), # ['0-f', '1-o', '2-o', '3-b', '4-a', '5-r'])
21.857143
55
0.480392
45
306
3.133333
0.622222
0.12766
0
0
0
0
0
0
0
0
0
0.027397
0.284314
306
13
56
23.538462
0.616438
0.614379
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
true
0.25
0.5
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
1
0
1
0
0
5
3d92204ae4fb7181167a418ef7b0eac39513c75e
203
py
Python
program/condition/__init__.py
mmsbrggr/polar
34348baf6992232e47cee7a4d56b5a96567c50b8
[ "MIT" ]
2
2021-10-06T13:29:24.000Z
2021-11-11T19:42:43.000Z
program/condition/__init__.py
mmsbrggr/polar
34348baf6992232e47cee7a4d56b5a96567c50b8
[ "MIT" ]
1
2022-01-26T15:58:28.000Z
2022-01-28T13:47:28.000Z
program/condition/__init__.py
mmsbrggr/polar
34348baf6992232e47cee7a4d56b5a96567c50b8
[ "MIT" ]
2
2021-10-01T15:08:52.000Z
2022-03-15T14:10:06.000Z
from .condition import Condition from .and_cond import And from .atom_cond import Atom from .not_cond import Not from .or_cond import Or from .true_cond import TrueCond from .false_cond import FalseCond
25.375
33
0.827586
34
203
4.764706
0.352941
0.37037
0
0
0
0
0
0
0
0
0
0
0.137931
203
7
34
29
0.925714
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
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3dd2cf8e043bbc3be2bcd1cc584cf375def5669e
43
py
Python
music.py
champfish/IOTWeather
04f483ac5486045f3dcf0a079f31a051001a6c18
[ "Unlicense" ]
null
null
null
music.py
champfish/IOTWeather
04f483ac5486045f3dcf0a079f31a051001a6c18
[ "Unlicense" ]
null
null
null
music.py
champfish/IOTWeather
04f483ac5486045f3dcf0a079f31a051001a6c18
[ "Unlicense" ]
null
null
null
import os os.system('mpg321 -q saw.mp3 &')
14.333333
32
0.674419
8
43
3.625
0.875
0
0
0
0
0
0
0
0
0
0
0.108108
0.139535
43
3
32
14.333333
0.675676
0
0
0
0
0
0.431818
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3dd365834a85e871fd3a794d0f1adc3c39596809
68
py
Python
dbmanage/__init__.py
yiannisha/dbmanage
9e1e36e2b59e7e369595f4804bef2c2a7ec0ec56
[ "Apache-2.0" ]
null
null
null
dbmanage/__init__.py
yiannisha/dbmanage
9e1e36e2b59e7e369595f4804bef2c2a7ec0ec56
[ "Apache-2.0" ]
10
2021-11-06T18:12:54.000Z
2021-12-01T18:49:29.000Z
dbmanage/__init__.py
yiannisha/dbmanage
9e1e36e2b59e7e369595f4804bef2c2a7ec0ec56
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ dbmanage Library ~~~~~~~~~~~~~~~~ """
8.5
23
0.367647
5
68
5
1
0
0
0
0
0
0
0
0
0
0
0.017857
0.176471
68
7
24
9.714286
0.428571
0.823529
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
3df3b4c6041174bc2cc63423a4965ed2e08a8f1f
479
py
Python
thinkpython_allen_downey/exercise_5_1.py
alirkaya/programming-textbook-solutions
7362dce474b8a881d654f95604e09d1d0e76aec2
[ "MIT" ]
null
null
null
thinkpython_allen_downey/exercise_5_1.py
alirkaya/programming-textbook-solutions
7362dce474b8a881d654f95604e09d1d0e76aec2
[ "MIT" ]
null
null
null
thinkpython_allen_downey/exercise_5_1.py
alirkaya/programming-textbook-solutions
7362dce474b8a881d654f95604e09d1d0e76aec2
[ "MIT" ]
null
null
null
# |---------------------| # <module> | | # |---------------------| # # |---------------------| # print_n | s--->'Hello' n--->2 | | # |---------------------| # # |---------------------| # print_n | s--->'Hello' n--->1 | | # |---------------------| def print_n(s, n): if n <= 0: return print(s) print_n(s, n-1) print_n('Hello', 2)
23.95
52
0.181628
33
479
2.484848
0.333333
0.365854
0.341463
0.292683
0.317073
0
0
0
0
0
0
0.017606
0.407098
479
19
53
25.210526
0.271127
0.709812
0
0
0
0
0.043478
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.333333
0.666667
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
9ad02e90381131edbd409e754e3888a78d2c77c2
295
py
Python
env/lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py
diego-d5000/MisValesMd
b641782bc2546776e9f55f452ec7fb48100dc482
[ "MIT" ]
null
null
null
env/lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py
diego-d5000/MisValesMd
b641782bc2546776e9f55f452ec7fb48100dc482
[ "MIT" ]
null
null
null
env/lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py
diego-d5000/MisValesMd
b641782bc2546776e9f55f452ec7fb48100dc482
[ "MIT" ]
null
null
null
from django.forms import * # NOQA from .fields import (GeometryField, GeometryCollectionField, PointField, # NOQA MultiPointField, LineStringField, MultiLineStringField, PolygonField, MultiPolygonField) from .widgets import BaseGeometryWidget, OpenLayersWidget, OSMWidget # NOQA
49.166667
81
0.79322
24
295
9.75
0.75
0
0
0
0
0
0
0
0
0
0
0
0.145763
295
5
82
59
0.928571
0.047458
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
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9aff31762ba026eda72acfb63b756002e9fa9282
186
py
Python
app/plugins/calculation/add.py
criticallycode/zima
cd38cac1c0c33b362d110ae28deba3828daa3f4a
[ "Apache-2.0" ]
null
null
null
app/plugins/calculation/add.py
criticallycode/zima
cd38cac1c0c33b362d110ae28deba3828daa3f4a
[ "Apache-2.0" ]
null
null
null
app/plugins/calculation/add.py
criticallycode/zima
cd38cac1c0c33b362d110ae28deba3828daa3f4a
[ "Apache-2.0" ]
null
null
null
from systems.plugins.index import BaseProvider class Provider(BaseProvider('calculation', 'add')): def calc(self, p): return (p.b + p.a) if self.check(p.a, p.b) else None
23.25
60
0.672043
29
186
4.310345
0.724138
0.032
0
0
0
0
0
0
0
0
0
0
0.182796
186
7
61
26.571429
0.822368
0
0
0
0
0
0.075269
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
b11fe3819e2b592c6c8db06cc0bfefda6713b505
84
py
Python
7_kyu/Binary_operations_1.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
7_kyu/Binary_operations_1.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
7_kyu/Binary_operations_1.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
def flip_bit(value: int, bit_index: int) -> int: return value ^ 1 << bit_index-1
42
48
0.666667
15
84
3.533333
0.533333
0.301887
0
0
0
0
0
0
0
0
0
0.029412
0.190476
84
2
49
42
0.75
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
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
1
0
0
0
1
0
0
0
5
b141906cfd7e97db94d982fbd0220957a9321e5b
20,646
py
Python
tests/server/query_params/test_filter.py
materialsproject/optimade
638f3fc9b203603141032a814e42bc23bec1bd87
[ "MIT" ]
31
2018-06-15T01:02:31.000Z
2021-11-30T04:46:21.000Z
tests/server/query_params/test_filter.py
materialsproject/optimade
638f3fc9b203603141032a814e42bc23bec1bd87
[ "MIT" ]
1,023
2018-11-21T18:34:14.000Z
2022-03-29T11:48:45.000Z
tests/server/query_params/test_filter.py
materialsproject/optimade
638f3fc9b203603141032a814e42bc23bec1bd87
[ "MIT" ]
31
2018-06-14T15:56:33.000Z
2022-02-16T02:54:11.000Z
"""Make sure filters are handled correctly""" import pytest from optimade.server.config import CONFIG, SupportedBackend @pytest.mark.xfail( CONFIG.database_backend == SupportedBackend.ELASTIC, reason="Elasticsearch does not support queries on custom fields without configuration.", ) def test_custom_field(check_response): request = '/structures?filter=_exmpl_chemsys="Ac"' expected_ids = ["mpf_1"] check_response(request, expected_ids) def test_id(check_response): request = '/structures?filter=id="mpf_2"' expected_ids = ["mpf_2"] check_response(request, expected_ids) def test_geq(check_response): request = "/structures?filter=nelements>=9" expected_ids = ["mpf_3819"] check_response(request, expected_ids) def test_gt(check_response): request = "/structures?filter=nelements>8" expected_ids = ["mpf_3819"] check_response(request, expected_ids) def test_rhs_comparison(check_response): request = "/structures?filter=8<nelements" expected_ids = ["mpf_3819"] check_response(request, expected_ids) def test_gt_none(check_response): request = "/structures?filter=nelements>9" expected_ids = [] check_response(request, expected_ids) def test_list_has(check_response): request = '/structures?filter=elements HAS "Ti"' expected_ids = ["mpf_3803", "mpf_3819"] check_response(request, expected_ids) def test_page_limit(check_response): request = '/structures?filter=elements HAS "Ac"&page_limit=2' expected_ids = ["mpf_1", "mpf_110"] expected_return = 6 check_response(request, expected_ids=expected_ids, expected_return=expected_return) request = '/structures?page_limit=2&filter=elements HAS "Ac"' expected_ids = ["mpf_1", "mpf_110"] expected_return = 6 check_response(request, expected_ids=expected_ids, expected_return=expected_return) def test_page_limit_max(check_error_response): request = f"/structures?page_limit={CONFIG.page_limit_max + 1}" check_error_response( request, expected_status=403, expected_title="Forbidden", expected_detail=f"Max allowed page_limit is {CONFIG.page_limit_max}, you requested {CONFIG.page_limit_max + 1}", ) def test_value_list_operator(check_error_response): request = "/structures?filter=dimension_types HAS < 1" if CONFIG.database_backend == SupportedBackend.ELASTIC: expected_detail = "Unrecognised operation HAS <." else: expected_detail = "set_op_rhs not implemented for use with OPERATOR. Given: [Token('HAS', 'HAS'), Token('OPERATOR', '<'), 1]" check_error_response( request, expected_status=501, expected_title="NotImplementedError", expected_detail=expected_detail, ) def test_has_any_operator(check_response, check_error_response): request = "/structures?filter=dimension_types HAS ANY > 1" if CONFIG.database_backend == SupportedBackend.ELASTIC: check_response(request, []) else: check_error_response( request, expected_status=501, expected_title="NotImplementedError", expected_detail="OPERATOR > inside value_list [Token('OPERATOR', '>'), 1] not implemented.", ) def test_list_has_all(check_response): request = '/structures?filter=elements HAS ALL "Ba","F","H","Mn","O","Re","Si"' expected_ids = ["mpf_3819"] check_response(request, expected_ids) request = '/structures?filter=elements HAS ALL "Re","Ti"' expected_ids = ["mpf_3819"] check_response(request, expected_ids) def test_list_has_any(check_response): request = '/structures?filter=elements HAS ANY "Re","Ti"' expected_ids = ["mpf_3819", "mpf_3803"] check_response(request, expected_ids) def test_list_length_basic(check_response): request = "/structures?filter=elements LENGTH = 9" expected_ids = ["mpf_3819"] check_response(request, expected_ids) request = "/structures?filter=elements LENGTH 9" check_response(request, expected_ids) def test_list_length_comparisons_aliased(check_response, check_error_response): """Test whether list length comparisons work on fields that have defined length aliases. """ request = "/structures?filter=elements LENGTH >= 9" expected_ids = ["mpf_3819"] check_response(request, expected_ids) request = "/structures?filter=cartesian_site_positions LENGTH > 43" expected_ids = sorted(["mpf_3803", "mpf_3819", "mpf_551"]) check_response(request, expected_ids, expected_as_is=True) request = "/structures?filter=species_at_sites LENGTH > 43" expected_ids = sorted(["mpf_551", "mpf_3803", "mpf_3819"]) check_response(request, expected_ids, expected_as_is=True) request = "/structures?filter=nsites LENGTH > 43" expected_ids = [] if CONFIG.database_backend == SupportedBackend.ELASTIC: check_error_response( request, expected_status=501, expected_title="NotImplementedError", expected_detail="LENGTH is not supported for 'nsites'", ) else: check_response(request, expected_ids) @pytest.mark.xfail( CONFIG.database_backend == SupportedBackend.ELASTIC, reason="Elasticsearch does not support length queries on fields with no defined length alias.", ) def test_list_length_comparisons_unaliased(check_response, check_error_response): """Test whether list length comparisons work on fields that have no defined length aliases. """ request = "/structures?filter=structure_features LENGTH > 0" expected_ids = [] check_response(request, expected_ids) request = "/structures?filter=structure_features LENGTH != 0" error_detail = "Operator != not implemented for LENGTH filter." check_error_response( request, expected_status=501, expected_title="NotImplementedError", expected_detail=error_detail, ) @pytest.mark.xfail( CONFIG.database_backend == SupportedBackend.ELASTIC, reason="Elasticsearch does not support HAS ONLY queries.", ) def test_list_has_only(check_response): """Test HAS ONLY query on elements.""" request = '/structures?filter=elements HAS ONLY "Ac", "Mg"' expected_ids = ["mpf_1", "mpf_23"] check_response(request, expected_ids) request = '/structures?filter=elements HAS ONLY "Ac", "Ag"' expected_ids = ["mpf_1", "mpf_200"] check_response(request, expected_ids) request = '/structures?filter=elements HAS ONLY "Ac"' expected_ids = ["mpf_1"] check_response(request, expected_ids) request = '/structures?filter=elements HAS ONLY "Ac" AND nelements IS KNOWN' expected_ids = ["mpf_1"] check_response(request, expected_ids) def test_list_correlated(check_error_response): request = '/structures?filter=elements:elements_ratios HAS "Ag":"0.2"' check_error_response( request, expected_status=501, expected_title="NotImplementedError", expected_detail="Correlated list queries are not supported.", ) # expected_ids = ["mpf_259"] # check_response(request, expected_ids) def test_timestamp_query(check_response): request = '/structures?filter=last_modified="2019-06-08T05:13:37.331Z"&page_limit=5' expected_ids = ["mpf_1", "mpf_2", "mpf_3"] expected_warnings = None if CONFIG.database_backend in ( SupportedBackend.MONGOMOCK, SupportedBackend.MONGODB, ): expected_warnings = [{"title": "TimestampNotRFCCompliant"}] check_response( request, expected_ids, expected_as_is=True, expected_warnings=expected_warnings ) request = '/structures?filter=last_modified<"2019-06-08T05:13:37.331Z"&page_limit=5' expected_ids = ["mpf_3819"] expected_warnings = None if CONFIG.database_backend in ( SupportedBackend.MONGOMOCK, SupportedBackend.MONGODB, ): expected_warnings = [{"title": "TimestampNotRFCCompliant"}] check_response( request, expected_ids, expected_as_is=True, expected_warnings=expected_warnings ) request = '/structures?filter=last_modified="2018-06-08T05:13:37.945Z"&page_limit=5' expected_ids = ["mpf_3819"] expected_warnings = None if CONFIG.database_backend in ( SupportedBackend.MONGOMOCK, SupportedBackend.MONGODB, ): expected_warnings = [{"title": "TimestampNotRFCCompliant"}] check_response( request, expected_ids, expected_as_is=True, expected_warnings=expected_warnings ) request = '/structures?filter=last_modified>"2018-06-08T05:13:37.945Z" AND last_modified<="2019-06-08T05:13:37.331Z"&page_limit=5' expected_ids = ["mpf_1", "mpf_2", "mpf_3"] expected_warnings = None if CONFIG.database_backend in ( SupportedBackend.MONGOMOCK, SupportedBackend.MONGODB, ): expected_warnings = [ {"title": "TimestampNotRFCCompliant"}, {"title": "TimestampNotRFCCompliant"}, ] check_response( request, expected_ids, expected_as_is=True, expected_warnings=expected_warnings ) def test_is_known(check_response): request = "/structures?filter=nsites IS KNOWN AND nsites>=44" expected_ids = sorted(["mpf_551", "mpf_3803", "mpf_3819"]) check_response(request, expected_ids, expected_as_is=True) request = "/structures?filter=lattice_vectors IS KNOWN AND nsites>=44" expected_ids = sorted(["mpf_551", "mpf_3803", "mpf_3819"]) check_response(request, expected_ids, expected_as_is=True) def test_aliased_is_known(check_response): request = "/structures?filter=id IS KNOWN AND nsites>=44" expected_ids = sorted(["mpf_551", "mpf_3803", "mpf_3819"]) check_response(request, expected_ids, expected_as_is=True) request = "/structures?filter=chemical_formula_reduced IS KNOWN AND nsites>=44" expected_ids = sorted(["mpf_551", "mpf_3803", "mpf_3819"]) check_response(request, expected_ids, expected_as_is=True) request = "/structures?filter=chemical_formula_descriptive IS KNOWN AND nsites>=44" expected_ids = sorted(["mpf_551", "mpf_3803", "mpf_3819"]) check_response(request, expected_ids, expected_as_is=True) def test_aliased_fields(check_response): request = '/structures?filter=chemical_formula_anonymous="A"' expected_ids = ["mpf_1", "mpf_200"] check_response(request, expected_ids, expected_as_is=True) request = '/structures?filter=chemical_formula_anonymous CONTAINS "A2BC"' expected_ids = ["mpf_110", "mpf_2", "mpf_3"] check_response(request, expected_ids, expected_as_is=True) def test_string_contains(check_response): request = '/structures?filter=chemical_formula_descriptive CONTAINS "c2Ag"' expected_ids = ["mpf_3", "mpf_2"] check_response(request, expected_ids) def test_string_start(check_response): request = '/structures?filter=chemical_formula_descriptive STARTS WITH "Ag2CClN"' expected_ids = ["mpf_259"] check_response(request, expected_ids) def test_string_end(check_response): request = '/structures?filter=chemical_formula_descriptive ENDS WITH "ClNO4S"' expected_ids = ["mpf_259"] check_response(request, expected_ids) def test_list_has_and(check_response): request = '/structures?filter=elements HAS "Ac" AND nelements=1' expected_ids = ["mpf_1"] check_response(request, expected_ids) def test_awkward_not_queries(check_response, client): """Test an awkward query from the spec examples. It should return all but 2 structures in the test data. The test is done in three parts: - first query the individual expressions that make up the OR, - then do an empty query to get all IDs - then negate the expressions and ensure that all IDs are returned except those from the first queries. """ expected_ids = ["mpf_3819"] request = ( '/structures?filter=chemical_formula_descriptive="Ba2FHMnNaO26Re2Si8Ti2" AND ' 'chemical_formula_anonymous = "A26B8C2D2E2FGHI" ' ) check_response(request, expected_ids) expected_ids = ["mpf_2"] request = ( '/structures?filter=chemical_formula_anonymous = "A2BC" AND ' 'NOT chemical_formula_descriptive = "Ac2AgPb" ' ) check_response(request, expected_ids) request = "/structures" unexpected_ids = ["mpf_3819", "mpf_2"] expected_ids = [ structure["id"] for structure in client.get(request).json()["data"] if structure["id"] not in unexpected_ids ] request = ( "/structures?filter=" "NOT ( " 'chemical_formula_descriptive = "Ba2FHMnNaO26Re2Si8Ti2" AND ' 'chemical_formula_anonymous = "A26B8C2D2E2FGHI" OR ' 'chemical_formula_anonymous = "A2BC" AND ' 'NOT chemical_formula_descriptive = "Ac2AgPb" ' ")" ) check_response(request, expected_ids, expected_as_is=True) def test_not_or_and_precedence(check_response): request = '/structures?filter=NOT elements HAS "Ac" AND nelements=1' expected_ids = ["mpf_200"] check_response(request, expected_ids) request = '/structures?filter=nelements=1 AND NOT elements HAS "Ac"' expected_ids = ["mpf_200"] check_response(request, expected_ids) request = '/structures?filter=NOT elements HAS "Ac" AND nelements=1 OR nsites=1' expected_ids = ["mpf_1", "mpf_200"] check_response(request, expected_ids) request = '/structures?filter=elements HAS "Ac" AND nelements>1 AND nsites=3' expected_ids = ["mpf_23"] check_response(request, expected_ids) def test_behaviour_not(check_response, client, check_error_response): request = '/structures?filter=NOT(elements HAS "Ag" AND nelements>1 )' expected_ids = [ "mpf_1", "mpf_23", "mpf_30", "mpf_110", "mpf_3803", "mpf_3819", "mpf_200", ] check_response(request, expected_ids) request = ( '/structures?filter=NOT(references.id HAS ALL "dummy/2019", "dijkstra1968")' ) expected_ids = ["mpf_1", "mpf_2", "mpf_3", "mpf_3819"] if CONFIG.database_backend == SupportedBackend.ELASTIC: check_error_response( request, expected_status=501, expected_title="NotImplementedError", expected_detail="Unable to filter on relationships with type 'references'", ) pytest.xfail("Elasticsearch backend does not support relationship filtering.") check_response(request, expected_ids) request = '/structures?filter=NOT(elements HAS ALL "Ag", "N")' expected_ids = [ "mpf_1", "mpf_2", "mpf_3", "mpf_23", "mpf_30", "mpf_110", "mpf_200", "mpf_220", "mpf_446", "mpf_3803", "mpf_3819", ] check_response(request, expected_ids) request = '/structures?filter=NOT(elements HAS "Ac" AND nelements>1 AND nsites=1)' expected_ids = [ structure["id"] for structure in client.get("/structures").json()["data"] ] check_response(request, expected_ids) request = '/structures?filter=NOT(elements HAS "Ac" OR nelements>1 OR nsites>1)' expected_ids = ["mpf_200"] check_response(request, expected_ids) request = "/structures?filter=NOT(nsites<4 OR nsites>20 AND NOT(nelements >5))" expected_ids = [ "mpf_2", "mpf_3", "mpf_30", "mpf_110", "mpf_220", "mpf_259", "mpf_281", "mpf_446", "mpf_551", "mpf_632", "mpf_3803", "mpf_3819", ] check_response(request, expected_ids) def test_behaviour_double_negation(check_response): request = ( '/structures?filter=NOT(NOT(chemical_formula_descriptive STARTS WITH "Ag2" ))' ) expected_ids = ["mpf_259", "mpf_272", "mpf_276", "mpf_281"] check_response(request, expected_ids) request = '/structures?filter=NOT(NOT(chemical_formula_descriptive CONTAINS "F"))' expected_ids = ["mpf_110", "mpf_3803", "mpf_3819"] check_response(request, expected_ids) request = '/structures?filter=NOT(NOT(nelements < 4 OR nsites < 10 OR elements HAS "Fe") )' expected_ids = [ "mpf_1", "mpf_2", "mpf_3", "mpf_23", "mpf_30", "mpf_110", "mpf_200", "mpf_3803", ] check_response(request, expected_ids) def test_brackets(check_response): request = '/structures?filter=elements HAS "Ac" AND nelements=1 OR nsites=1' expected_ids = ["mpf_200", "mpf_1"] check_response(request, expected_ids) request = '/structures?filter=(elements HAS "Ac" AND nelements=1) OR (elements HAS "Ac" AND nsites=1)' expected_ids = ["mpf_1"] check_response(request, expected_ids) def test_filter_on_relationships(check_response, check_error_response): request = '/structures?filter=references.id HAS "dummy/2019"' expected_ids = ["mpf_3819"] if CONFIG.database_backend == SupportedBackend.ELASTIC: check_error_response( request, expected_status=501, expected_title="NotImplementedError", expected_detail="Unable to filter on relationships with type 'references'", ) pytest.xfail("Elasticsearch backend does not support relationship filtering.") check_response(request, expected_ids) request = '/structures?filter=references.id HAS ANY "dummy/2019", "dijkstra1968"' expected_ids = ["mpf_1", "mpf_2", "mpf_3819"] check_response(request, expected_ids) request = '/structures?filter=references.id HAS ONLY "dijkstra1968"' expected_ids = ["mpf_1", "mpf_2"] check_response(request, expected_ids) request = '/structures?filter=references.id HAS ONLY "dijkstra1968", "dummy/2019"' expected_ids = ["mpf_1", "mpf_2", "mpf_3819"] check_response(request, expected_ids) request = '/structures?filter=references.doi HAS ONLY "10/123"' error_detail = 'Cannot filter relationships by field "doi", only "id" is supported.' check_error_response( request, expected_status=501, expected_title="NotImplementedError", expected_detail=error_detail, ) def test_filter_on_unknown_fields(check_response, check_error_response): request = "/structures?filter=unknown_field = 1" error_detail = "'unknown_field' is not a known or searchable quantity" check_error_response( request, expected_status=400, expected_title="Bad Request", expected_detail=error_detail, ) request = "/structures?filter=_exmpl_unknown_field = 1" error_detail = "'_exmpl_unknown_field' is not a known or searchable quantity" check_error_response( request, expected_status=400, expected_title="Bad Request", expected_detail=error_detail, ) request = "/structures?filter=_exmpl_unknown_field LENGTH 1" error_detail = "'_exmpl_unknown_field' is not a known or searchable quantity" check_error_response( request, expected_status=400, expected_title="Bad Request", expected_detail=error_detail, ) request = "/structures?filter=_exmpl1_unknown_field = 1" expected_ids = [] expected_warnings = [ { "title": "UnknownProviderProperty", "detail": "Field '_exmpl1_unknown_field' has an unrecognised prefix: this property has been treated as UNKNOWN.", } ] check_response( request, expected_ids=expected_ids, expected_warnings=expected_warnings ) request = "/structures?filter=_exmpl1_unknown_field LENGTH 1" expected_ids = [] expected_warnings = [ { "title": "UnknownProviderProperty", "detail": "Field '_exmpl1_unknown_field' has an unrecognised prefix: this property has been treated as UNKNOWN.", } ] check_response( request, expected_ids=expected_ids, expected_warnings=expected_warnings ) request = '/structures?filter=_exmpl1_unknown_field HAS "Si"' expected_ids = [] expected_warnings = [ { "title": "UnknownProviderProperty", "detail": "Field '_exmpl1_unknown_field' has an unrecognised prefix: this property has been treated as UNKNOWN.", } ] check_response( request, expected_ids=expected_ids, expected_warnings=expected_warnings ) # Should not warn as the "_optimade" prefix is registered request = "/structures?filter=_optimade_random_field = 1" expected_ids = [] check_response(request, expected_ids=expected_ids)
34.41
134
0.689867
2,448
20,646
5.525735
0.105801
0.10978
0.13011
0.134546
0.837658
0.810084
0.776521
0.718785
0.675834
0.616988
0
0.037491
0.201589
20,646
599
135
34.467446
0.783123
0.035406
0
0.579399
0
0.023605
0.35477
0.163853
0
0
0
0
0
1
0.070815
false
0
0.004292
0
0.075107
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
b144921e7626ff494984dde8ca801d4ef3058bf9
165
py
Python
src/Hyperactive/hyperactive/sub_packages/meta_learn/label_encoder/__init__.py
skn123/LDWPSO-CNN
7f05eb1defee2e968e5b3bed53f2b444b2b48fdb
[ "MIT" ]
6
2020-01-24T16:15:34.000Z
2022-03-21T13:53:32.000Z
src/Hyperactive/hyperactive/sub_packages/meta_learn/label_encoder/__init__.py
skn123/LDWPSO-CNN
7f05eb1defee2e968e5b3bed53f2b444b2b48fdb
[ "MIT" ]
1
2020-06-15T04:19:32.000Z
2020-06-15T04:19:32.000Z
src/Hyperactive/hyperactive/sub_packages/meta_learn/label_encoder/__init__.py
skn123/LDWPSO-CNN
7f05eb1defee2e968e5b3bed53f2b444b2b48fdb
[ "MIT" ]
3
2021-03-29T17:11:27.000Z
2021-05-17T13:33:10.000Z
# Author: Simon Blanke # Email: simon.blanke@yahoo.com # License: MIT License from .label_encoder_dict import label_encoder_dict __all__ = ["label_encoder_dict"]
18.333333
50
0.781818
23
165
5.173913
0.608696
0.302521
0.403361
0
0
0
0
0
0
0
0
0
0.127273
165
8
51
20.625
0.826389
0.430303
0
0
0
0
0.2
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
b1a4081567634249706d3c562de3aa51f5bae32c
57
py
Python
Tests/__init__.py
frankappolonia/SmartPrice
7b6e1116b3f388623648db43390c7cf3492e8271
[ "MIT" ]
null
null
null
Tests/__init__.py
frankappolonia/SmartPrice
7b6e1116b3f388623648db43390c7cf3492e8271
[ "MIT" ]
null
null
null
Tests/__init__.py
frankappolonia/SmartPrice
7b6e1116b3f388623648db43390c7cf3492e8271
[ "MIT" ]
null
null
null
#package for test folder from db import CustomerBuilder
14.25
30
0.824561
8
57
5.875
1
0
0
0
0
0
0
0
0
0
0
0
0.157895
57
4
30
14.25
0.979167
0.403509
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b8c884985baf9ea024b19085714bca61b4d0fbb8
101
py
Python
test/unittest_find.py
youngsm/chroma
1e183c26aaff46fb9b0425ad8eef9995ebe0be2c
[ "BSD-3-Clause" ]
7
2018-05-02T08:33:10.000Z
2021-11-15T02:03:01.000Z
test/unittest_find.py
youngsm/chroma
1e183c26aaff46fb9b0425ad8eef9995ebe0be2c
[ "BSD-3-Clause" ]
1
2020-08-19T13:43:58.000Z
2020-08-19T13:43:58.000Z
test/unittest_find.py
youngsm/chroma
1e183c26aaff46fb9b0425ad8eef9995ebe0be2c
[ "BSD-3-Clause" ]
16
2016-03-25T01:49:26.000Z
2021-09-09T15:51:34.000Z
import sys if sys.version_info < (2,7): import unittest2 as unittest else: import unittest
12.625
32
0.70297
15
101
4.666667
0.733333
0
0
0
0
0
0
0
0
0
0
0.038462
0.227723
101
7
33
14.428571
0.858974
0
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
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b8e7ce41fcebfc1c0853efacb1eb8a831c65050c
189
py
Python
kivy_garden/matplotlib/tests/test_import.py
kennethryerson/matplotlib
8ec37ddef2eb054dfac469719ffaecf433bfc8a2
[ "MIT" ]
null
null
null
kivy_garden/matplotlib/tests/test_import.py
kennethryerson/matplotlib
8ec37ddef2eb054dfac469719ffaecf433bfc8a2
[ "MIT" ]
null
null
null
kivy_garden/matplotlib/tests/test_import.py
kennethryerson/matplotlib
8ec37ddef2eb054dfac469719ffaecf433bfc8a2
[ "MIT" ]
null
null
null
import pytest def test_flower(): import matplotlib matplotlib.use('module://kivy_garden.matplotlib.backend_kivy') import matplotlib.pyplot as plt fig, ax = plt.subplots()
21
66
0.724868
24
189
5.583333
0.708333
0.238806
0
0
0
0
0
0
0
0
0
0
0.174603
189
8
67
23.625
0.858974
0
0
0
0
0
0.232804
0.232804
0
0
0
0
0
1
0.166667
true
0
0.5
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
77048864c867c6defd80f10e0a8b19f4953915ea
4,966
py
Python
tests/test_invoices.py
sparrowonedev/sparrow-api-python
162788a5e705579f2848241250da9b10d89c54f2
[ "MIT" ]
1
2018-01-23T17:37:19.000Z
2018-01-23T17:37:19.000Z
tests/test_invoices.py
sparrowonedev/sparrow-api-python
162788a5e705579f2848241250da9b10d89c54f2
[ "MIT" ]
null
null
null
tests/test_invoices.py
sparrowonedev/sparrow-api-python
162788a5e705579f2848241250da9b10d89c54f2
[ "MIT" ]
null
null
null
import unittest import sparrowone M_KEY = "CUK5YODHVAZHFBM6KESZO1J4" ACH_M_KEY = "RZOZ2AMMYF7GX2VF1L05WW1G" CUSTOMER_TOKEN = "TL2X2O9SD3HTZOU9" # TEMP class InvoicesCreateTestCase(unittest.TestCase): def setUp(self): self.sprw = sparrowone.Connection(M_KEY) def test_creating_an_invoice(self): resp = self.sprw.invoices.create(data=dict( customertoken=CUSTOMER_TOKEN, invoicedate="12/01/2017", currency="USD", invoicestatus="draft", invoicesource="DataVault", invoiceamount="10.00", invoiceitemsku_1="123", invoiceitemsku_2="456", invoiceitemdescription_1="Widget 1", invoiceitemdescription_2="Widget 2", invoiceitemprice_1="2.00", invoiceitemprice_2="4.00", invoiceitemquantity_1="1", invoiceitemquantity_2="2" )) self.assertEqual(resp["textresponse"], "invoice has been successfully created") def test_creating_active_invoice(self): resp = self.sprw.invoices.create(data=dict( customertoken=CUSTOMER_TOKEN, invoicedate="12/01/2017", currency="USD", invoicestatus="active", invoicesource="DataVault", invoiceamount="10.00", invoiceitemsku_1="123", invoiceitemsku_2="456", invoiceitemdescription_1="Widget 1", invoiceitemdescription_2="Widget 2", invoiceitemprice_1="2.00", invoiceitemprice_2="4.00", invoiceitemquantity_1="1", invoiceitemquantity_2="2" )) self.assertEqual(resp["textresponse"], "invoice has been successfully created") class InvoicesTestCase(unittest.TestCase): def setUp(self): self.sprw = sparrowone.Connection(M_KEY) resp = self.sprw.invoices.create(data=dict( customertoken=CUSTOMER_TOKEN, invoicedate="12/01/2017", currency="USD", invoicestatus="draft", invoicesource="DataVault", invoiceamount="10.00", invoiceitemsku_1="123", invoiceitemsku_2="456", invoiceitemdescription_1="Widget 1", invoiceitemdescription_2="Widget 2", invoiceitemprice_1="2.00", invoiceitemprice_2="4.00", invoiceitemquantity_1="1", invoiceitemquantity_2="2" )) self.invoice_id = resp["invoicenumber"] def test_update_invoice(self): resp = self.sprw.invoices.update(self.invoice_id, data=dict( invoicedate="12/15/2017", invoiceamount="15.00", invoicestatus="active", )) self.assertEqual(resp["textresponse"], "Invoice has been successfully updated") def test_cancel_invoice(self): resp = self.sprw.invoices.cancel(self.invoice_id, "test") self.assertEqual(resp["textresponse"], "invoice has been successfully canceled") def test_cancel_invoice_by_customer(self): resp = self.sprw.invoices.cancel(self.invoice_id, "test", by_customer=True) self.assertEqual(resp["textresponse"], "invoice has been successfully canceled") def test_paying_an_invoice_with_a_credit_card(self): self.sprw.invoices.update(self.invoice_id, data=dict( invoicestatus="active", )) card = sparrowone.CardInfo( number="4111111111111111", expiration="1019", cvv="999" ) resp = self.sprw.invoices.pay(self.invoice_id, card) self.assertEqual(resp["textresponse"], "Invoice has been successfully paid") class InvoicesACHTestCase(unittest.TestCase): def setUp(self): self.sprw = sparrowone.Connection(ACH_M_KEY) resp = self.sprw.invoices.create(data=dict( customertoken=CUSTOMER_TOKEN, invoicedate="12/01/2017", currency="USD", invoicestatus="active", invoicesource="DataVault", invoiceamount="10.00", invoiceitemsku_1="123", invoiceitemsku_2="456", invoiceitemdescription_1="Widget 1", invoiceitemdescription_2="Widget 2", invoiceitemprice_1="2.00", invoiceitemprice_2="4.00", invoiceitemquantity_1="1", invoiceitemquantity_2="2" )) self.invoice_id = resp["invoicenumber"] def test_paying_an_invoice_with_a_bank_account(self): ach_account = sparrowone.ACHInfo( bank_name="First Test Bank", routing="110000000", account="1234567890123", type="checking", subtype="personal", first_name="Alma", last_name="Armas" ) resp = self.sprw.invoices.pay(self.invoice_id, ach_account) self.assertEqual(resp["textresponse"], "Invoice has been successfully paid")
36.248175
88
0.61317
483
4,966
6.126294
0.207039
0.035147
0.054072
0.060831
0.791822
0.791822
0.784387
0.770869
0.727273
0.638053
0
0.060513
0.27789
4,966
136
89
36.514706
0.76464
0.000805
0
0.675
0
0
0.162702
0.009677
0
0
0
0
0.058333
1
0.083333
false
0
0.016667
0
0.125
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7731bb320edc7b40fd4ca71e10fc355263337ffd
265
py
Python
mdl/contracts/__init__.py
fafhrd91/mdl
daada030649305df02f65b77ebdf41cf976a870e
[ "Apache-2.0" ]
3
2016-12-28T09:31:27.000Z
2017-01-09T18:38:46.000Z
mdl/contracts/__init__.py
fafhrd91/mdl
daada030649305df02f65b77ebdf41cf976a870e
[ "Apache-2.0" ]
1
2019-05-04T18:14:24.000Z
2019-05-04T18:14:24.000Z
mdl/contracts/__init__.py
fafhrd91/mdl
daada030649305df02f65b77ebdf41cf976a870e
[ "Apache-2.0" ]
null
null
null
from contracts.interface import ContractException, MissingContract # noqa from . import patch # noqa from .contract import * # noqa from .extension import * # noqa patch.reset() __all__ = (contract.__all__) + ('ContractException', 'MissingContract') # noqa
26.5
79
0.739623
27
265
6.962963
0.444444
0.12766
0.382979
0
0
0
0
0
0
0
0
0
0.158491
265
9
80
29.444444
0.843049
0.090566
0
0
0
0
0.13617
0
0
0
0
0
0
1
0
false
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
0
0
1
0
1
0
0
5
6200a4db4a69869f13eb991dd4997bcbb096b5e2
344
py
Python
blogs/urls.py
MadanNeupane/College-Finder
018bb99f404333ca1a5515c1c7a4b134160fd1de
[ "BSD-4-Clause-UC" ]
null
null
null
blogs/urls.py
MadanNeupane/College-Finder
018bb99f404333ca1a5515c1c7a4b134160fd1de
[ "BSD-4-Clause-UC" ]
null
null
null
blogs/urls.py
MadanNeupane/College-Finder
018bb99f404333ca1a5515c1c7a4b134160fd1de
[ "BSD-4-Clause-UC" ]
null
null
null
from django.urls import path from . import views from django.contrib.auth.decorators import login_required urlpatterns = [ path('', login_required(views.blogs_page), name='blogs'), path('<slug:slug>/', login_required(views.blog_detail), name='blog_detail'), path('tag/<slug:slug>/', login_required(views.tagged), name='tagged'), ]
34.4
80
0.726744
46
344
5.282609
0.434783
0.213992
0.222222
0.17284
0.213992
0
0
0
0
0
0
0
0.110465
344
9
81
38.222222
0.794118
0
0
0
0
0
0.145349
0
0
0
0
0
0
1
0
false
0
0.375
0
0.375
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
621cf8a647dfde17eb923ec08d72c37e1d87adf0
25,950
py
Python
tests/test_parse_create_table.py
iafisher/sqliteparser
dfdf1a84675f6d0068d4aaaf634b0ba494fb686a
[ "MIT" ]
null
null
null
tests/test_parse_create_table.py
iafisher/sqliteparser
dfdf1a84675f6d0068d4aaaf634b0ba494fb686a
[ "MIT" ]
5
2021-05-01T03:48:16.000Z
2022-02-02T03:18:00.000Z
tests/test_parse_create_table.py
iafisher/sqliteparser
dfdf1a84675f6d0068d4aaaf634b0ba494fb686a
[ "MIT" ]
null
null
null
import unittest from sqliteparser import ast, parse class ParseCreateTests(unittest.TestCase): def test_parse_simple_create_table_statement(self): sql = """ CREATE TABLE people( name TEXT, age INTEGER ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition(type="TEXT") ), ast.Column( name="age", definition=ast.ColumnDefinition(type="INTEGER") ), ], ), ], ) def test_parse_simple_create_table_statement_with_no_semicolon(self): sql = """ CREATE TABLE people( name TEXT, age INTEGER ) """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition(type="TEXT") ), ast.Column( name="age", definition=ast.ColumnDefinition(type="INTEGER") ), ], ), ], ) def test_parse_create_table_statement_with_no_type_names(self): sql = """ CREATE TABLE people(name, age); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column(name="name", definition=None), ast.Column(name="age", definition=None), ], ), ], ) def test_parse_create_table_statement_with_column_constraints(self): sql = """ CREATE TABLE people( id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL, age INTEGER NOT NULL ON CONFLICT ROLLBACK ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="id", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.PrimaryKeyConstraint(), ast.NotNullConstraint(), ], ), ), ast.Column( name="name", definition=ast.ColumnDefinition( type="TEXT", constraints=[ast.NotNullConstraint()], ), ), ast.Column( name="age", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.NotNullConstraint( on_conflict=ast.OnConflict.ROLLBACK ) ], ), ), ], ), ], ) def test_parse_create_table_statement_with_simple_check_constraint(self): sql = """ CREATE TABLE people( name TEXT CHECK(name != '') ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition( type="TEXT", constraints=[ ast.CheckConstraint( ast.Infix( "!=", ast.Identifier("name"), ast.String(""), ) ) ], ), ), ], ), ], ) def test_parse_create_table_statement_with_explicit_schema_name(self): sql = """ CREATE TABLE main.people( name TEXT, age INTEGER ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name=ast.TableName("main", "people"), columns=[ ast.Column( name="name", definition=ast.ColumnDefinition(type="TEXT") ), ast.Column( name="age", definition=ast.ColumnDefinition(type="INTEGER") ), ], ), ], ) def test_parse_create_temporary_table_statement(self): sql = """ CREATE TEMPORARY TABLE people( name TEXT, age INTEGER ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition(type="TEXT") ), ast.Column( name="age", definition=ast.ColumnDefinition(type="INTEGER") ), ], temporary=True, ), ], ) def test_parse_create_table_without_rowid(self): sql = """ CREATE TABLE people( name TEXT, age INTEGER ) WITHOUT ROWID; """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition(type="TEXT") ), ast.Column( name="age", definition=ast.ColumnDefinition(type="INTEGER") ), ], without_rowid=True, ), ], ) def test_parse_create_table_if_not_exists(self): sql = """ CREATE TABLE IF NOT EXISTS people( name TEXT, age INTEGER ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition(type="TEXT") ), ast.Column( name="age", definition=ast.ColumnDefinition(type="INTEGER") ), ], if_not_exists=True, ), ], ) def test_parse_create_table_with_foreign_keys_multiple_on_delete_clauses(self): sql = """ CREATE TABLE people( job_id INTEGER, FOREIGN KEY (job_id) REFERENCES jobs ON DELETE SET NULL ON DELETE NO ACTION ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="job_id", definition=ast.ColumnDefinition(type="INTEGER"), ) ], constraints=[ ast.ForeignKeyConstraint( columns=["job_id"], foreign_table="jobs", foreign_columns=[], on_delete=ast.OnDelete.NO_ACTION, on_update=None, match=None, deferrable=None, initially_deferred=None, ), ], ) ], ) def test_parse_create_table_with_foreign_keys_deferrable_constraints(self): sql = """ CREATE TABLE people( id1 INTEGER, id2 INTEGER, id3 INTEGER, FOREIGN KEY (id1) REFERENCES table1 NOT DEFERRABLE, FOREIGN KEY (id2) REFERENCES table2 DEFERRABLE, FOREIGN KEY (id3) REFERENCES table3 DEFERRABLE INITIALLY IMMEDIATE ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="id1", definition=ast.ColumnDefinition(type="INTEGER") ), ast.Column( name="id2", definition=ast.ColumnDefinition(type="INTEGER") ), ast.Column( name="id3", definition=ast.ColumnDefinition(type="INTEGER") ), ], constraints=[ ast.ForeignKeyConstraint( columns=["id1"], foreign_table="table1", foreign_columns=[], on_delete=None, on_update=None, match=None, deferrable=False, initially_deferred=None, ), ast.ForeignKeyConstraint( columns=["id2"], foreign_table="table2", foreign_columns=[], on_delete=None, on_update=None, match=None, deferrable=True, initially_deferred=None, ), ast.ForeignKeyConstraint( columns=["id3"], foreign_table="table3", foreign_columns=[], on_delete=None, on_update=None, match=None, deferrable=True, initially_deferred=False, ), ], ) ], ) def test_parse_create_table_with_foreign_keys(self): sql = """ CREATE TABLE people( team_id INTEGER, job_id INTEGER, FOREIGN KEY (team_id) REFERENCES teams, FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE SET NULL MATCH FULL ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="team_id", definition=ast.ColumnDefinition(type="INTEGER"), ), ast.Column( name="job_id", definition=ast.ColumnDefinition(type="INTEGER"), ), ], constraints=[ ast.ForeignKeyConstraint( columns=["team_id"], foreign_table="teams", foreign_columns=[], on_delete=None, on_update=None, match=None, deferrable=None, initially_deferred=None, ), ast.ForeignKeyConstraint( columns=["job_id"], foreign_table="jobs", foreign_columns=["id"], on_delete=ast.OnDelete.SET_NULL, on_update=ast.OnUpdate.CASCADE, match=ast.ForeignKeyMatch.FULL, deferrable=True, initially_deferred=True, ), ], ) ], ) def test_parse_create_table_with_inline_foreign_key(self): sql = """ CREATE TABLE people( job_id INTEGER REFERENCES jobs(id) ON DELETE SET NULL MATCH FULL ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="job_id", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.ForeignKeyConstraint( columns=[], foreign_table="jobs", foreign_columns=["id"], on_delete=ast.OnDelete.SET_NULL, on_update=ast.OnUpdate.CASCADE, match=ast.ForeignKeyMatch.FULL, deferrable=True, initially_deferred=True, ), ], ), ), ], ) ], ) def test_parse_create_table_statement_with_collating_sequence(self): sql = """ CREATE TABLE people( name TEXT COLLATE NOCASE, age INTEGER COLLATE BINARY ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition( type="TEXT", constraints=[ ast.CollateConstraint(ast.CollatingSequence.NOCASE) ], ), ), ast.Column( name="age", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.CollateConstraint(ast.CollatingSequence.BINARY) ], ), ), ], ), ], ) def test_parse_create_table_statement_with_unique_constraint(self): sql = """ CREATE TABLE people( name TEXT UNIQUE, age INTEGER UNIQUE ON CONFLICT FAIL ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition( type="TEXT", constraints=[ast.UniqueConstraint(on_conflict=None)], ), ), ast.Column( name="age", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.UniqueConstraint( on_conflict=ast.OnConflict.FAIL ) ], ), ), ], ), ], ) def test_parse_create_table_statement_with_default_clause(self): sql = """ CREATE TABLE people( name TEXT DEFAULT '', age INTEGER DEFAULT ( 2 + 2 ), employed BOOLEAN DEFAULT TRUE, last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="name", definition=ast.ColumnDefinition( type="TEXT", default=ast.String("") ), ), ast.Column( name="age", definition=ast.ColumnDefinition( type="INTEGER", default=ast.Infix("+", ast.Integer(2), ast.Integer(2)), ), ), ast.Column( name="employed", definition=ast.ColumnDefinition( type="BOOLEAN", default=ast.Boolean(True) ), ), ast.Column( name="last_updated", definition=ast.ColumnDefinition( type="TIMESTAMP", default=ast.DefaultValue.CURRENT_TIMESTAMP, ), ), ], ), ], ) def test_parse_create_table_statement_with_primary_key_constraint(self): sql = """ CREATE TABLE people( id1 INTEGER PRIMARY KEY, id2 INTEGER PRIMARY KEY ASC, id3 INTEGER PRIMARY KEY DESC ON CONFLICT IGNORE, id4 INTEGER PRIMARY KEY DESC ON CONFLICT IGNORE AUTOINCREMENT, id5 INTEGER PRIMARY KEY ON CONFLICT IGNORE AUTOINCREMENT, id6 INTEGER PRIMARY KEY AUTOINCREMENT ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="id1", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.PrimaryKeyConstraint( ascending=None, on_conflict=None, autoincrement=False, ) ], ), ), ast.Column( name="id2", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.PrimaryKeyConstraint( ascending=True, on_conflict=None, autoincrement=False, ) ], ), ), ast.Column( name="id3", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.PrimaryKeyConstraint( ascending=False, on_conflict=ast.OnConflict.IGNORE, autoincrement=False, ) ], ), ), ast.Column( name="id4", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.PrimaryKeyConstraint( ascending=False, on_conflict=ast.OnConflict.IGNORE, autoincrement=True, ) ], ), ), ast.Column( name="id5", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.PrimaryKeyConstraint( ascending=None, on_conflict=ast.OnConflict.IGNORE, autoincrement=True, ) ], ), ), ast.Column( name="id6", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.PrimaryKeyConstraint( ascending=None, on_conflict=None, autoincrement=True, ) ], ), ), ], ), ], ) def test_parse_create_table_statement_with_generated_column_constraint(self): sql = """ CREATE TABLE people( age INTEGER GENERATED ALWAYS AS ( 2 + 2 ) STORED, ); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column( name="age", definition=ast.ColumnDefinition( type="INTEGER", constraints=[ ast.GeneratedColumnConstraint( ast.Infix("+", ast.Integer(2), ast.Integer(2)), storage=ast.GeneratedColumnStorage.STORED, ) ], ), ), ], ), ], ) def test_parse_create_table_statement_with_quoted_names(self): sql = """ CREATE TABLE "people"([name], `age`); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name="people", columns=[ ast.Column(name="name", definition=None), ast.Column(name="age", definition=None), ], ), ], ) def test_parse_created_table_statement_with_schema_name(self): sql = """ CREATE TABLE temp.people(name); """ self.assertEqual( parse(sql), [ ast.CreateTableStatement( name=ast.TableName("TEMP", "people"), columns=[ ast.Column(name="name", definition=None), ], ), ], )
35.020243
87
0.339268
1,431
25,950
6.005591
0.092243
0.045031
0.065045
0.145916
0.820689
0.786363
0.747382
0.685013
0.616593
0.575401
0
0.003556
0.58817
25,950
740
88
35.067568
0.800599
0
0
0.753582
0
0
0.140925
0
0
0
0
0
0.028653
1
0.028653
false
0
0.002865
0
0.032951
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
624d363cc1fbe41439a8186b85f0ca8e71df3135
137
py
Python
myfirstpythonpackage/__init__.py
devonthestudent/myfirstpythonpackage
5c66962974731775e1dbec37c62cd98402a97751
[ "MIT" ]
null
null
null
myfirstpythonpackage/__init__.py
devonthestudent/myfirstpythonpackage
5c66962974731775e1dbec37c62cd98402a97751
[ "MIT" ]
null
null
null
myfirstpythonpackage/__init__.py
devonthestudent/myfirstpythonpackage
5c66962974731775e1dbec37c62cd98402a97751
[ "MIT" ]
null
null
null
__author__ = 'Chenyu' from myfirstpythonpackage.object_two import Two from myfirstpythonpackage.cython_part._cython_code import fib_cpdef
45.666667
67
0.883212
17
137
6.588235
0.705882
0.428571
0
0
0
0
0
0
0
0
0
0
0.072993
137
3
67
45.666667
0.88189
0
0
0
0
0
0.043478
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
6271687630c85c30acde794c4b13bfab24d01879
96
py
Python
venv/lib/python3.8/site-packages/future/backports/xmlrpc/__init__.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/future/backports/xmlrpc/__init__.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/future/backports/xmlrpc/__init__.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/87/ad/5c/8954dd56fbbca04517bf87477ff4dce575170c7dd1281d7ef1f4214ac8
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.395833
0
96
1
96
96
0.5
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
62890f44360d334a98d9a530c3355dc5afc63b0d
181
py
Python
adet/modeling/nlos_converter/__init__.py
pjh4993/nlos_detection
03f1ecd73eb6fce3c0ddfdf14eedaa049dd87f39
[ "BSD-2-Clause" ]
null
null
null
adet/modeling/nlos_converter/__init__.py
pjh4993/nlos_detection
03f1ecd73eb6fce3c0ddfdf14eedaa049dd87f39
[ "BSD-2-Clause" ]
null
null
null
adet/modeling/nlos_converter/__init__.py
pjh4993/nlos_detection
03f1ecd73eb6fce3c0ddfdf14eedaa049dd87f39
[ "BSD-2-Clause" ]
null
null
null
from .build import build_nlos_converter, NLOS_CONVERTER_REGISTRY from .nlos_converter import conv_fc_nlos_converter __all__ = [k for k in globals().keys() if not k.startswith("_")]
45.25
64
0.80663
28
181
4.75
0.607143
0.390977
0
0
0
0
0
0
0
0
0
0
0.104972
181
4
65
45.25
0.820988
0
0
0
0
0
0.005495
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
6565c9afaae46bd72a462c95e2a5261cae71d7b1
7,488
py
Python
pyapi/catalog-api/globalapi/tests/package_views_tests.py
dockerian/py-api
777db7d5dacf3ecf29a991f50d2ac78bb5bef66a
[ "Apache-2.0" ]
null
null
null
pyapi/catalog-api/globalapi/tests/package_views_tests.py
dockerian/py-api
777db7d5dacf3ecf29a991f50d2ac78bb5bef66a
[ "Apache-2.0" ]
6
2019-12-26T16:51:55.000Z
2022-03-21T22:16:45.000Z
pyapi/catalog-api/globalapi/tests/package_views_tests.py
dockerian/pyapi
777db7d5dacf3ecf29a991f50d2ac78bb5bef66a
[ "Apache-2.0" ]
null
null
null
import mock import unittest from pyramid import httpexceptions from pyramid.testing import setUp, tearDown, DummyResource, DummyRequest from .. views import package_views from common.logger import getLogger logger = getLogger(__name__) class PackagesViewsTests(unittest.TestCase): def setUp(self): self.config = setUp() def tearDown(self): tearDown() @mock.patch('globalapi.package.get_package_list') def test_index(self, mock_getlist): mock_package_list = { 'status': 200, 'packages': [{'pkg1': 'test'}] } mock_getlist.return_value = mock_package_list request = DummyRequest() request.context = DummyResource() request.matchdict['product_id'] = 'dummy' request.params['filters'] = 'keyword' view = package_views.PackagesViews(request) response = view.index() self.assertEqual(type(response), dict) self.assertEqual(type(response['packages']), list) self.assertEqual(response['status'], 200) self.assertEqual(response, mock_package_list) @mock.patch('globalapi.package.get_package_list') def test_index_404(self, mock_getlist): mock_package_list = {'status': 404} mock_getlist.return_value = mock_package_list request = DummyRequest() request.context = DummyResource() request.matchdict['product_id'] = 'dummy' view = package_views.PackagesViews(request) response = view.index() self.assertIs(type(response), httpexceptions.HTTPNotFound) @mock.patch('globalapi.package.get_package_list') def test_index_500(self, mock_getlist): error_message = 'GET PACKAGE LIST EXCEPTION' mock_getlist.side_effect = \ httpexceptions.HTTPInternalServerError(explanation=error_message, detail=error_message) request = DummyRequest() request.context = DummyResource() request.matchdict['product_id'] = 'dummy' view = package_views.PackagesViews(request) response = view.index() self.assertEqual(response.status_code, 500) self.assertTrue(error_message in response.message) self.assertTrue(error_message in response.detail) self.assertTrue(len(response.json_body['errors']) > 0) self.assertIs(type(response), httpexceptions.HTTPInternalServerError) def test_index_no_product_id(self): request = DummyRequest() request.context = DummyResource() view = package_views.PackagesViews(request) response = view.index() self.assertTrue(response.json_body is not None) result = response.json_body self.assertTrue(result[u'errors']) def test_upload_no_product_id(self): request = DummyRequest() request.context = DummyResource() view = package_views.PackagesViews(request) response = view.upload() self.assertTrue(response.json_body is not None) result = response.json_body self.assertTrue(result[u'errors']) @mock.patch('pyramid.response.Response') @mock.patch('globalapi.package.save_package') def test_upload(self, mock_save, mock_response): fileupload = mock.MagicMock() fileupload.filename = 'filename on upload' mock_response = {'status': 201} mock_save.return_value = mock_response request = DummyRequest() request.context = DummyResource() request.matchdict['product_id'] = 'dummy' request.params = {'fileupload': fileupload} view = package_views.PackagesViews(request) response = view.upload() mock_save.assert_called_with(fileupload.filename, fileupload) self.assertTrue(mock_save.called) logger.debug(response) self.assertEqual(response.status_code, mock_response['status']) self.assertIs(type(response), httpexceptions.HTTPCreated) @mock.patch('pyramid.response.Response') @mock.patch('globalapi.package.save_package') def test_upload_500(self, mock_save, mock_response): fileupload = mock.MagicMock() fileupload.filename = 'filename on upload' error_message = "SAVE PACKAGE EXCEPTION" mock_save.side_effect = Exception(error_message) request = DummyRequest() request.context = DummyResource() request.matchdict['product_id'] = 'dummy' request.params = {'fileupload': fileupload} view = package_views.PackagesViews(request) response = view.upload() self.assertEqual(response.status_code, 500) self.assertTrue(error_message in response.message) self.assertTrue(error_message in response.detail) self.assertTrue(len(response.json_body['errors']) > 0) self.assertIs(type(response), httpexceptions.HTTPInternalServerError) class PackageViewsTests(unittest.TestCase): def setUp(self): self.config = setUp() def tearDown(self): tearDown() @mock.patch('StringIO.StringIO') @mock.patch('globalapi.package.get_package') def test_get(self, mock_get_package, mock_stringIO): request = DummyRequest() request.context = DummyResource() request.matchdict['product_id'] = 'dummy' request.matchdict['package_id'] = 'test' import StringIO mock_get_package_result = { 'status': 200, 'file_contents': mock.Mock(), 'headers': { 'content-length': 4, 'content-type': 'app', }} mock_get_package.return_value = mock_get_package_result mock_stringIO_result = mock.Mock() mock_stringIO.return_value = mock_stringIO_result mock_stringIO_result.read.return_value = 'body' view = package_views.PackageViews(request) response = view.get() self.assertEqual(response.content_length, 4) self.assertEqual(response.status_code, 200) self.assertIs(type(response), httpexceptions.HTTPOk) @mock.patch('globalapi.package.get_package') def test_get_404(self, mock_get_package): request = DummyRequest() request.context = DummyResource() request.matchdict['product_id'] = 'dummy' request.matchdict['package_id'] = 'test' mock_get_package_result = { 'status': 404, } mock_get_package.return_value = mock_get_package_result view = package_views.PackageViews(request) response = view.get() self.assertIs(type(response), httpexceptions.HTTPNotFound) @mock.patch('globalapi.package.get_package') def test_get_500(self, mock_get_package): request = DummyRequest() request.context = DummyResource() request.matchdict['product_id'] = 'dummy' request.matchdict['package_id'] = 'test' mock_get_package_result = { 'status': 404, } error_message = "GET PACKAGE EXCEPTION" mock_get_package.side_effect = Exception(error_message) view = package_views.PackageViews(request) response = view.get() self.assertEqual(response.status_code, 500) self.assertTrue(error_message in response.message) self.assertTrue(error_message in response.detail) self.assertTrue(len(response.json_body['errors']) > 0) self.assertIs(type(response), httpexceptions.HTTPInternalServerError)
38.010152
77
0.663862
777
7,488
6.19305
0.129987
0.039485
0.032003
0.068579
0.774106
0.728803
0.728803
0.71384
0.71384
0.661679
0
0.009398
0.232639
7,488
196
78
38.204082
0.828054
0
0
0.652695
0
0
0.103098
0.039931
0
0
0
0
0.191617
1
0.083832
false
0
0.041916
0
0.137725
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
6567e71ee3ecefb80ad8f60250f859aa1a35b1b8
696
py
Python
Sistema/sisprel/backend/app/app/db/base.py
JosueHernandezR/TTR
204a501da14a04310e85b43230c5e32c2009e471
[ "MIT" ]
null
null
null
Sistema/sisprel/backend/app/app/db/base.py
JosueHernandezR/TTR
204a501da14a04310e85b43230c5e32c2009e471
[ "MIT" ]
null
null
null
Sistema/sisprel/backend/app/app/db/base.py
JosueHernandezR/TTR
204a501da14a04310e85b43230c5e32c2009e471
[ "MIT" ]
null
null
null
# Import all the models, so that Base has them before being # imported by Alembic from app.db.base_class import Base # noqa from app.models.user import User # noqa from app.models.question import Question # noqa from app.models.question_option import Question_option # noqa from app.models.question_option_open import Question_option_open # noqa from app.models.survey import Survey # noqa from app.models.answer_option import Answer_Option # noqa from app.models.answer_option_open import Answer_Option_Open # noqa from app.models.results import Survey_Results # noqa from app.models.predictions import Prediction_Manual # noqa from app.models.survey_aceptacion import Survey_Aceptacion # noqa
53.538462
71
0.829023
108
696
5.185185
0.277778
0.1375
0.196429
0.303571
0.428571
0.310714
0
0
0
0
0
0
0.119253
696
13
72
53.538462
0.91354
0.189655
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
656edab47fb456ec92cbcd453d5973b51587ccfe
140
py
Python
utils/io.py
gjy3035/WSAL_released
fad6490d032eb37dfb62bc0a1eb30fc062dc27a4
[ "MIT" ]
22
2019-08-19T09:58:29.000Z
2021-11-15T09:35:17.000Z
utils/io.py
gjy3035/WSAL_released
fad6490d032eb37dfb62bc0a1eb30fc062dc27a4
[ "MIT" ]
null
null
null
utils/io.py
gjy3035/WSAL_released
fad6490d032eb37dfb62bc0a1eb30fc062dc27a4
[ "MIT" ]
4
2020-07-03T01:08:09.000Z
2021-12-02T16:02:54.000Z
import os import shutil def rmrf_mkdir(dir_name): if os.path.exists(dir_name): shutil.rmtree(dir_name) os.mkdir(dir_name)
15.555556
32
0.7
23
140
4.043478
0.521739
0.301075
0.258065
0
0
0
0
0
0
0
0
0
0.2
140
8
33
17.5
0.830357
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
6575fc2f0a5ebccf2640364e78f6c7755e903e67
1,945
py
Python
venv/Lib/site-packages/docutils/parsers/rst/include/xhtml1-special.txt.py
roshanba/mangal
f7b428811dc07214009cc33f0beb665ead402038
[ "bzip2-1.0.6", "MIT" ]
null
null
null
venv/Lib/site-packages/docutils/parsers/rst/include/xhtml1-special.txt.py
roshanba/mangal
f7b428811dc07214009cc33f0beb665ead402038
[ "bzip2-1.0.6", "MIT" ]
null
null
null
venv/Lib/site-packages/docutils/parsers/rst/include/xhtml1-special.txt.py
roshanba/mangal
f7b428811dc07214009cc33f0beb665ead402038
[ "bzip2-1.0.6", "MIT" ]
null
null
null
XX XXXX XXXX XXXX XXX XXXX XXXXXX XX XXX XXXXXX XXXXXXX XX XXXXXXX XXXX XXX XXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XX XXXXXXXXXXXXXXXXXXX XXXX XX XXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXXXX XXXXX XXXXXXXXX XXXX XX XXXXXX XXXXXXXXX XXXXXXX XX XXXXXXXX XXXXXX XXXXXXXXXX XXXXXX XX XXXXXXXX XXXXXXXXX XXXXXXX XX XXXXXX XXXXXX XX XXXXXXXX XXXXXXXXX XXXXXXX XX XXXXXX XX XXXXXX XXXXXXXXX XXXXXXX XX XX XXXXX XX XXXXXX XXXXXXXXX XXXXXXX XX XX XXXXX XX XXXXXX XXXXXXXXX XXXXXXX XX XXXX XXXX XX XXXX XXXXXXXXX XXXXXXX XX XXXXXXXXXXXX XXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXX XXXXXX XXXXXXXXX XXXX XX XXXXX XXXXXXXXX XXXXXXX XX XXXXXXXXXXXXX XXXX XX XXXXXXXX XXXXXXXXX XXXXXXX XX XXXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXX XXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXX XXXXXX XXXXXXXXX XXXX XX XXXX XXXXXXXXX XXXXXXX XX XXXXXXXXX XXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XX XXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XX XXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXXXX XXXXXXXX XX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXX XXXXXXXX XX XX XXXXXXXX XXXXXXXXX XXXXXXX XX XXX XXXXX XXXX XX XXXXXX XXXXXXXXX XXXXXXX XX XXXXXXXXX XXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXXX XXXXXXXXX XXXX XX XXXXX XXXXXXXXX XXXXXXX XX XXXXXXXXXXXXX XXXX XX XXXXXXXX XXXXXXXXX XXXXXXX XX XXXXXX XXXXXXXXXXXXXX XXXXX XXXXXXXXX XXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXXX XXXXXXXXX XXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXXXX XXXXX XXXXXXXXX XXXX XX XXXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXXXX XXXXXX X XXXX XXXXX XX XXXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXX XXXXXX X XXXX XXXXX XX XXXXXXXX XXXXXXXXX XXXXXXX XX XXXX XXXXX XX XXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXX XX XXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXXXX XXXXXX X XXXX XXXXXXXXX XX XXXXX XXXXXXXXX XXXXXXX XX XXXX XXXXX XXXXXX XX XXXXXX XXXXXXXXX XXXXXXX XX XXXX XXXXX XXXXXXXXXX
51.184211
75
0.827763
283
1,945
5.689046
0.056537
0.178882
0.346584
0.170807
0.797516
0.742857
0.662733
0.563975
0.508075
0.453416
0
0
0.172237
1,945
37
76
52.567568
1
0
0
0.805556
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
0
0
0
null
0
1
1
0
1
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
0
0
5
659434ace81acd5009f190403d40bf5d4758bc13
130
py
Python
am/scraper/tasks/schedulers/__init__.py
access-missouri/am-django-project
2457b8089900c61c73000c1d7479b7a72f6d1855
[ "BSD-2-Clause" ]
4
2018-05-01T20:31:49.000Z
2021-12-20T19:30:40.000Z
am/scraper/tasks/schedulers/__init__.py
access-missouri/am-django-project
2457b8089900c61c73000c1d7479b7a72f6d1855
[ "BSD-2-Clause" ]
22
2017-04-13T15:02:09.000Z
2021-02-02T21:48:41.000Z
am/scraper/tasks/schedulers/__init__.py
access-missouri/am-django-project
2457b8089900c61c73000c1d7479b7a72f6d1855
[ "BSD-2-Clause" ]
1
2018-07-02T20:08:43.000Z
2018-07-02T20:08:43.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Schedule AWS Lambda tasks to scrape things with Amazon SNS. """ import bill_text
21.666667
59
0.684615
20
130
4.4
1
0
0
0
0
0
0
0
0
0
0
0.009091
0.153846
130
6
60
21.666667
0.790909
0.784615
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
65a5e393b86d13914282fa2447801a97aa507ed8
35
py
Python
gemd/units/__init__.py
ventura-rivera/gemd-python
078eed39de852f830111b77306c2f35146de8ec3
[ "Apache-2.0" ]
7
2020-04-02T11:11:09.000Z
2022-02-05T23:19:51.000Z
gemd/units/__init__.py
ventura-rivera/gemd-python
078eed39de852f830111b77306c2f35146de8ec3
[ "Apache-2.0" ]
24
2020-04-22T16:55:09.000Z
2022-03-30T20:44:39.000Z
gemd/units/__init__.py
ventura-rivera/gemd-python
078eed39de852f830111b77306c2f35146de8ec3
[ "Apache-2.0" ]
3
2020-05-08T00:50:02.000Z
2020-12-19T00:48:56.000Z
# flake8: noqa from .impl import *
11.666667
19
0.685714
5
35
4.8
1
0
0
0
0
0
0
0
0
0
0
0.035714
0.2
35
2
20
17.5
0.821429
0.342857
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
65bada10151b32ee6c52299946ced530bf714f4b
668
py
Python
App_Deployment_Round_1/Webpage/Flask_Merged_Content/app/main.py
nathanduft44/crypto_wallet
9853afe14beedbad737ddc7417b21464edae881d
[ "MIT" ]
1
2021-08-12T06:12:22.000Z
2021-08-12T06:12:22.000Z
App_Deployment_Round_1/Webpage/Flask_Merged_Content/app/main.py
nathanduft44/crypto_wallet
9853afe14beedbad737ddc7417b21464edae881d
[ "MIT" ]
null
null
null
App_Deployment_Round_1/Webpage/Flask_Merged_Content/app/main.py
nathanduft44/crypto_wallet
9853afe14beedbad737ddc7417b21464edae881d
[ "MIT" ]
1
2021-08-23T03:40:40.000Z
2021-08-23T03:40:40.000Z
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/about/') def about(): return render_template('about.html') @app.route("/vis_2017") def year_2017_vis() : return render_template('year_2017_visuals.html') @app.route("/vis_2018") def year_2018_vis() : return render_template('year_2018_visuals.html') @app.route("/vis_2019") def year_2019_vis() : return render_template('year_2019_visuals.html') @app.route("/vis_2020") def year_2020_vis() : return render_template('year_2020_visuals.html') if __name__ == '__main__': app.run(debug=True)
21.548387
53
0.711078
95
668
4.589474
0.263158
0.224771
0.275229
0.137615
0.399083
0
0
0
0
0
0
0.082902
0.133234
668
31
54
21.548387
0.670121
0
0
0
0
0
0.237668
0.13154
0
0
0
0
0
1
0.272727
false
0
0.045455
0.272727
0.590909
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
02a4fb5afa3f758f84ca5d5f7896d38cdc51fb9e
11,167
py
Python
sdk/python/pulumi_aws/cloudformation/stack.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/cloudformation/stack.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/cloudformation/stack.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class Stack(pulumi.CustomResource): capabilities: pulumi.Output[list] """ A list of capabilities. Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, or `CAPABILITY_AUTO_EXPAND` """ disable_rollback: pulumi.Output[bool] """ Set to true to disable rollback of the stack if stack creation failed. Conflicts with `on_failure`. """ iam_role_arn: pulumi.Output[str] """ The ARN of an IAM role that AWS CloudFormation assumes to create the stack. If you don't specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials. """ name: pulumi.Output[str] """ Stack name. """ notification_arns: pulumi.Output[list] """ A list of SNS topic ARNs to publish stack related events. """ on_failure: pulumi.Output[str] """ Action to be taken if stack creation fails. This must be one of: `DO_NOTHING`, `ROLLBACK`, or `DELETE`. Conflicts with `disable_rollback`. """ outputs: pulumi.Output[dict] """ A map of outputs from the stack. """ parameters: pulumi.Output[dict] """ A map of Parameter structures that specify input parameters for the stack. """ policy_body: pulumi.Output[str] """ Structure containing the stack policy body. Conflicts w/ `policy_url`. """ policy_url: pulumi.Output[str] """ Location of a file containing the stack policy. Conflicts w/ `policy_body`. """ tags: pulumi.Output[dict] """ A list of tags to associate with this stack. """ template_body: pulumi.Output[str] """ Structure containing the template body (max size: 51,200 bytes). """ template_url: pulumi.Output[str] """ Location of a file containing the template body (max size: 460,800 bytes). """ timeout_in_minutes: pulumi.Output[float] """ The amount of time that can pass before the stack status becomes `CREATE_FAILED`. """ def __init__(__self__, resource_name, opts=None, capabilities=None, disable_rollback=None, iam_role_arn=None, name=None, notification_arns=None, on_failure=None, parameters=None, policy_body=None, policy_url=None, tags=None, template_body=None, template_url=None, timeout_in_minutes=None, __props__=None, __name__=None, __opts__=None): """ Provides a CloudFormation Stack resource. ## Example Usage ```python import pulumi import pulumi_aws as aws network = aws.cloudformation.Stack("network", parameters={ "VPCCidr": "10.0.0.0/16", }, template_body=\"\"\"{ "Parameters" : { "VPCCidr" : { "Type" : "String", "Default" : "10.0.0.0/16", "Description" : "Enter the CIDR block for the VPC. Default is 10.0.0.0/16." } }, "Resources" : { "myVpc": { "Type" : "AWS::EC2::VPC", "Properties" : { "CidrBlock" : { "Ref" : "VPCCidr" }, "Tags" : [ {"Key": "Name", "Value": "Primary_CF_VPC"} ] } } } } \"\"\") ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[list] capabilities: A list of capabilities. Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, or `CAPABILITY_AUTO_EXPAND` :param pulumi.Input[bool] disable_rollback: Set to true to disable rollback of the stack if stack creation failed. Conflicts with `on_failure`. :param pulumi.Input[str] iam_role_arn: The ARN of an IAM role that AWS CloudFormation assumes to create the stack. If you don't specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials. :param pulumi.Input[str] name: Stack name. :param pulumi.Input[list] notification_arns: A list of SNS topic ARNs to publish stack related events. :param pulumi.Input[str] on_failure: Action to be taken if stack creation fails. This must be one of: `DO_NOTHING`, `ROLLBACK`, or `DELETE`. Conflicts with `disable_rollback`. :param pulumi.Input[dict] parameters: A map of Parameter structures that specify input parameters for the stack. :param pulumi.Input[str] policy_body: Structure containing the stack policy body. Conflicts w/ `policy_url`. :param pulumi.Input[str] policy_url: Location of a file containing the stack policy. Conflicts w/ `policy_body`. :param pulumi.Input[dict] tags: A list of tags to associate with this stack. :param pulumi.Input[str] template_body: Structure containing the template body (max size: 51,200 bytes). :param pulumi.Input[str] template_url: Location of a file containing the template body (max size: 460,800 bytes). :param pulumi.Input[float] timeout_in_minutes: The amount of time that can pass before the stack status becomes `CREATE_FAILED`. """ if __name__ is not None: warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning) resource_name = __name__ if __opts__ is not None: warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning) opts = __opts__ if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() __props__['capabilities'] = capabilities __props__['disable_rollback'] = disable_rollback __props__['iam_role_arn'] = iam_role_arn __props__['name'] = name __props__['notification_arns'] = notification_arns __props__['on_failure'] = on_failure __props__['parameters'] = parameters __props__['policy_body'] = policy_body __props__['policy_url'] = policy_url __props__['tags'] = tags __props__['template_body'] = template_body __props__['template_url'] = template_url __props__['timeout_in_minutes'] = timeout_in_minutes __props__['outputs'] = None super(Stack, __self__).__init__( 'aws:cloudformation/stack:Stack', resource_name, __props__, opts) @staticmethod def get(resource_name, id, opts=None, capabilities=None, disable_rollback=None, iam_role_arn=None, name=None, notification_arns=None, on_failure=None, outputs=None, parameters=None, policy_body=None, policy_url=None, tags=None, template_body=None, template_url=None, timeout_in_minutes=None): """ Get an existing Stack resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param str id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[list] capabilities: A list of capabilities. Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, or `CAPABILITY_AUTO_EXPAND` :param pulumi.Input[bool] disable_rollback: Set to true to disable rollback of the stack if stack creation failed. Conflicts with `on_failure`. :param pulumi.Input[str] iam_role_arn: The ARN of an IAM role that AWS CloudFormation assumes to create the stack. If you don't specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials. :param pulumi.Input[str] name: Stack name. :param pulumi.Input[list] notification_arns: A list of SNS topic ARNs to publish stack related events. :param pulumi.Input[str] on_failure: Action to be taken if stack creation fails. This must be one of: `DO_NOTHING`, `ROLLBACK`, or `DELETE`. Conflicts with `disable_rollback`. :param pulumi.Input[dict] outputs: A map of outputs from the stack. :param pulumi.Input[dict] parameters: A map of Parameter structures that specify input parameters for the stack. :param pulumi.Input[str] policy_body: Structure containing the stack policy body. Conflicts w/ `policy_url`. :param pulumi.Input[str] policy_url: Location of a file containing the stack policy. Conflicts w/ `policy_body`. :param pulumi.Input[dict] tags: A list of tags to associate with this stack. :param pulumi.Input[str] template_body: Structure containing the template body (max size: 51,200 bytes). :param pulumi.Input[str] template_url: Location of a file containing the template body (max size: 460,800 bytes). :param pulumi.Input[float] timeout_in_minutes: The amount of time that can pass before the stack status becomes `CREATE_FAILED`. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = dict() __props__["capabilities"] = capabilities __props__["disable_rollback"] = disable_rollback __props__["iam_role_arn"] = iam_role_arn __props__["name"] = name __props__["notification_arns"] = notification_arns __props__["on_failure"] = on_failure __props__["outputs"] = outputs __props__["parameters"] = parameters __props__["policy_body"] = policy_body __props__["policy_url"] = policy_url __props__["tags"] = tags __props__["template_body"] = template_body __props__["template_url"] = template_url __props__["timeout_in_minutes"] = timeout_in_minutes return Stack(resource_name, opts=opts, __props__=__props__) def translate_output_property(self, prop): return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop def translate_input_property(self, prop): return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
49.852679
347
0.662846
1,412
11,167
4.994334
0.155099
0.045235
0.061259
0.03772
0.74844
0.730998
0.715683
0.703205
0.693562
0.688599
0
0.006685
0.249843
11,167
223
348
50.076233
0.835144
0.434226
0
0.025316
1
0
0.141364
0.007128
0
0
0
0
0
1
0.050633
false
0.012658
0.063291
0.025316
0.341772
0
0
0
0
null
0
0
0
0
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
5
02f3391bd47c269507e7d2bf9e7ed93b8c2c00f8
39
py
Python
degiroapi/__init__.py
Jorricks/python-degiro
ee155ce952ff6b6d04daf3b2f1fe94c85e757b5d
[ "MIT" ]
7
2021-09-12T21:08:22.000Z
2022-01-24T21:16:25.000Z
degiroapi/__init__.py
Jorricks/python-degiro
ee155ce952ff6b6d04daf3b2f1fe94c85e757b5d
[ "MIT" ]
null
null
null
degiroapi/__init__.py
Jorricks/python-degiro
ee155ce952ff6b6d04daf3b2f1fe94c85e757b5d
[ "MIT" ]
1
2021-09-12T21:08:25.000Z
2021-09-12T21:08:25.000Z
# This file was left empty on purpose.
19.5
38
0.74359
7
39
4.142857
1
0
0
0
0
0
0
0
0
0
0
0
0.205128
39
1
39
39
0.935484
0.923077
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
b8356f84171bf7ea2c82aa196c8a2387328bf797
59
py
Python
out/test_instant.py
FardaleM/metalang
171557c540f3e2c051ec39ea150afb740c1f615f
[ "BSD-2-Clause" ]
22
2017-04-24T10:00:45.000Z
2021-04-01T10:11:05.000Z
out/test_instant.py
FardaleM/metalang
171557c540f3e2c051ec39ea150afb740c1f615f
[ "BSD-2-Clause" ]
12
2017-03-26T18:34:21.000Z
2019-03-21T19:13:03.000Z
out/test_instant.py
FardaleM/metalang
171557c540f3e2c051ec39ea150afb740c1f615f
[ "BSD-2-Clause" ]
7
2017-10-14T13:33:33.000Z
2021-03-18T15:18:50.000Z
def foo(a, b): return a + b print("%d" % 10, end='')
9.833333
24
0.457627
11
59
2.454545
0.818182
0.148148
0
0
0
0
0
0
0
0
0
0.047619
0.288136
59
5
25
11.8
0.595238
0
0
0
0
0
0.035088
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
0.666667
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
b83e2f6c3a655a00288085921664d3dc26012b80
1,960
py
Python
elfindertest/backup/Copy of elfinder/http.py
sillsm/DjangoFiler
68892fd3bda7618cfc1b733e7ca1b778729877f2
[ "MIT" ]
1
2021-09-09T19:57:51.000Z
2021-09-09T19:57:51.000Z
elfindertest/backup/Copy of elfinder/http.py
sillsm/DjangoFiler
68892fd3bda7618cfc1b733e7ca1b778729877f2
[ "MIT" ]
null
null
null
elfindertest/backup/Copy of elfinder/http.py
sillsm/DjangoFiler
68892fd3bda7618cfc1b733e7ca1b778729877f2
[ "MIT" ]
null
null
null
from connector.elfinder.commands import COMMANDS_MAP class HttpRequestParser(object): def __init__(self, request, get=None, post=None, files=None): print '' # u'building RREEEE ====================================================================================================' self._req = request print '' # u'building YYFTaj ====================================================================================================' self.post = post or {} self.get = get or {} self.files = files or {} self.command = '' self.params = {} try: self.parse() except Exception, e: print '' # u'EXCCCCC ::: %s' % e def parse(self): self.params = dict(self.get) self.params.update(self.post) print 'HHHHH ++++ KKKK' try: self.params.update(self.files) except: pass print 'HHHHH ++++ KKKK 2' print repr(self.params) print '' # u'building Request PASRRE ====================================================================================================' self.command = self.params.get('cmd', None) if type(self.command) == type([]): self.command = self.command[0] print 'Command BNow %s'%self.command # u'>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>' if self.command in COMMANDS_MAP: self.command = COMMANDS_MAP[self.command] print '' # u'9000000000000000000000000000000000000000000000999999999999999999999999999999999999999999900000000000000' else: self.command = None print '' # u'777777777777777777777777777777777777777777777777777777777777777777777777777 ' + repr(self.params) #self.params = dict([(key, val) for key, val in self.get if key != 'cmd']) print '' # u'building AFTER COMMANDS MAP ====================================================================================================' def ok(self): if not type(self.command) == type(object): return False return True
1,960
1,960
0.497959
178
1,960
5.438202
0.331461
0.125
0.057851
0.043388
0
0
0
0
0
0
0
0.106132
0.134694
1,960
1
1,960
1,960
0.464623
0.477551
0
0.219512
0
0
0.051232
0
0
0
0
0
0
0
null
null
0.02439
0.02439
null
null
0.268293
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5