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
695247f1a8c81f5a3710bde126195c617c12ea51
104
py
Python
system/configsupport.py
conny-lin/python_lib
f31a93aab7331b5d1112db4282e5ec71c93f8869
[ "MIT" ]
null
null
null
system/configsupport.py
conny-lin/python_lib
f31a93aab7331b5d1112db4282e5ec71c93f8869
[ "MIT" ]
null
null
null
system/configsupport.py
conny-lin/python_lib
f31a93aab7331b5d1112db4282e5ec71c93f8869
[ "MIT" ]
null
null
null
# module that helps with configuration import os, glob # find config file in the nearest parent folder
20.8
47
0.788462
16
104
5.125
1
0
0
0
0
0
0
0
0
0
0
0
0.182692
104
4
48
26
0.964706
0.788462
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
69728ebd299c2e029ae6316ba696c9a56ecea28d
183
py
Python
autograd/nn/__init__.py
willeagren/autograd
7e0d7b4735c4abe209cb964e4b3e8a3e5c017a00
[ "MIT" ]
null
null
null
autograd/nn/__init__.py
willeagren/autograd
7e0d7b4735c4abe209cb964e4b3e8a3e5c017a00
[ "MIT" ]
1
2022-03-12T16:29:33.000Z
2022-03-13T13:31:04.000Z
autograd/nn/__init__.py
willeagren/autograd
7e0d7b4735c4abe209cb964e4b3e8a3e5c017a00
[ "MIT" ]
null
null
null
from .nn import Module, Sequential from .dense import Dense from .activations import ReLU, LogSoftmax, Sigmoid __all__ = [ Module, Sequential, Dense, ReLU, LogSoftmax, Sigmoid ]
22.875
56
0.759563
22
183
6.136364
0.5
0.237037
0.311111
0
0
0
0
0
0
0
0
0
0.163934
183
7
57
26.142857
0.882353
0
0
0
0
0
0
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
15c9373a92740fa49f8e22faa10819139cfb492f
88
py
Python
police_api/utils.py
rkhleics/police-api-client-python
4d428a83e4bcf9571484b624a435d47deb2f71a6
[ "MIT" ]
29
2015-04-03T01:49:44.000Z
2021-12-08T13:10:06.000Z
police_api/utils.py
rkhleics/police-api-client-python
4d428a83e4bcf9571484b624a435d47deb2f71a6
[ "MIT" ]
3
2015-08-19T11:37:14.000Z
2021-10-31T20:47:08.000Z
police_api/utils.py
rkhleics/police-api-client-python
4d428a83e4bcf9571484b624a435d47deb2f71a6
[ "MIT" ]
10
2016-01-08T09:51:02.000Z
2020-06-25T00:11:57.000Z
def encode_polygon(points): return ':'.join(['{0},{1}'.format(*p) for p in points])
29.333333
59
0.613636
14
88
3.785714
0.857143
0
0
0
0
0
0
0
0
0
0
0.026316
0.136364
88
2
60
44
0.671053
0
0
0
0
0
0.090909
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
15dfe605ea10672de257f681b34fe92fbaa257f7
58
py
Python
imgtag/tabs/__init__.py
pauljxtan/imgtag
abd0be1957c91a897572aeae3823555299feb9bc
[ "MIT" ]
null
null
null
imgtag/tabs/__init__.py
pauljxtan/imgtag
abd0be1957c91a897572aeae3823555299feb9bc
[ "MIT" ]
11
2019-11-24T18:12:23.000Z
2020-06-21T16:43:45.000Z
imgtag/tabs/__init__.py
pauljxtan/imgtag
abd0be1957c91a897572aeae3823555299feb9bc
[ "MIT" ]
null
null
null
from .file import FileTab from .gallery import GalleryTab
19.333333
31
0.827586
8
58
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.137931
58
2
32
29
0.96
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
15fe504480ff3c37dc332f977bea0a7e18ad21f4
3,227
py
Python
comet_chaser_api/database/comet_roster.py
chung-ejy/comet_chaser_api
e18a4b65d606bcf5106cff5095b1a3134901abff
[ "MIT" ]
null
null
null
comet_chaser_api/database/comet_roster.py
chung-ejy/comet_chaser_api
e18a4b65d606bcf5106cff5095b1a3134901abff
[ "MIT" ]
null
null
null
comet_chaser_api/database/comet_roster.py
chung-ejy/comet_chaser_api
e18a4b65d606bcf5106cff5095b1a3134901abff
[ "MIT" ]
null
null
null
from database.adatabase import ADatabase import pandas as pd from cryptography.fernet import Fernet import os header_key = os.getenv("ROSTERKEY") encryption_key = os.getenv("ENCRYPTIONKEY") class CometRoster(ADatabase): def __init__(self): super().__init__("comet_roster") def get_user_trade_params(self,version,user): try: db = self.client[self.name] table = db[f"{version}_trading_params"] data = table.find({"username":user},{"_id":0},show_record_id=False).sort("_id", -1).limit(10) return pd.DataFrame(list(data)) except Exception as e: print(self.name,"roster",str(e)) def get_secrets(self,user): try: db = self.client[self.name] table = db["coinbase_credentials"] data = table.find({"username":user},{"_id":0},show_record_id=False) return pd.DataFrame(list(data)) except Exception as e: print(self.name,"roster",str(e)) def update_roster(self,user,params): try: db = self.client[self.name] table = db["roster"] data = table.update_one({"username":user},{"$set":params}) return data except Exception as e: print(self.name,"roster",str(e)) def update_keys(self,user,params): try: db = self.client[self.name] table = db["coinbase_credentials"] fernet = Fernet(encryption_key.encode()) encoded_keys = {} for key in params.keys(): if "key" in key or "secret" in key or "pass" in key: encoded_keys[key] = fernet.encrypt(params[key].encode()) data = table.update_one({"username":user},{"$set":encoded_keys}) return data except Exception as e: print(self.name,"roster",str(e)) def update_subscription(self,user,params): try: db = self.client[self.name] table = db["paypal_subscriptions"] data = table.update_one({"username":user},{"$set":params}) return data except Exception as e: print(self.name,"roster",str(e)) def get_bot_status(self,user): try: db = self.client[self.name] table = db["roster"] data = table.find({"username":user},{"_id":0},show_record_id=False) return pd.DataFrame(list(data)) except Exception as e: print(self.name,"roster",str(e)) def get_subscription(self,user): try: db = self.client[self.name] table = db["paypal_subscriptions"] data = table.find({"username":user},{"_id":0},show_record_id=False) return pd.DataFrame(list(data)) except Exception as e: print(self.name,"roster",str(e)) def get_all_subscription(self): try: db = self.client[self.name] table = db["paypal_subscriptions"] data = table.find({},{"_id":0},show_record_id=False) return pd.DataFrame(list(data)) except Exception as e: print(self.name,"roster",str(e))
36.258427
105
0.564301
389
3,227
4.544987
0.200514
0.072398
0.040724
0.067873
0.721154
0.721154
0.721154
0.702489
0.702489
0.683258
0
0.003557
0.303068
3,227
89
106
36.258427
0.78257
0
0
0.666667
0
0
0.098203
0.007435
0
0
0
0
0
1
0.115385
false
0.012821
0.051282
0
0.282051
0.102564
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
c60c52b0bff65ff53a51a9b048aaadcbfa230b42
132
py
Python
demo_worker/__init__.py
selinon/demo-worker
052a4924219be006c626479156e35803ca5545af
[ "MIT" ]
null
null
null
demo_worker/__init__.py
selinon/demo-worker
052a4924219be006c626479156e35803ca5545af
[ "MIT" ]
4
2018-05-04T07:13:38.000Z
2022-03-17T19:04:18.000Z
demo_worker/__init__.py
selinon/demo-worker
052a4924219be006c626479156e35803ca5545af
[ "MIT" ]
1
2021-07-01T07:34:23.000Z
2021-07-01T07:34:23.000Z
__name__ = 'app' __version__ = '0.0.1' __author__ = 'Fridolin Pokorny' from .utils import get_config_files from .utils import init
18.857143
35
0.757576
19
132
4.526316
0.789474
0.209302
0.348837
0
0
0
0
0
0
0
0
0.026549
0.143939
132
6
36
22
0.734513
0
0
0
0
0
0.181818
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
c651e52e8d50f3b57871a53a74d5358c648574b5
2,838
py
Python
bindings/python/tests/fingerprint_test.py
kamyu104/libtorrent-1
87ec445943324a243be2b9499b74dc0983a42af9
[ "BSL-1.0", "BSD-3-Clause" ]
9
2019-11-05T16:47:12.000Z
2022-03-05T15:21:25.000Z
bindings/python/tests/fingerprint_test.py
kamyu104/libtorrent-1
87ec445943324a243be2b9499b74dc0983a42af9
[ "BSL-1.0", "BSD-3-Clause" ]
null
null
null
bindings/python/tests/fingerprint_test.py
kamyu104/libtorrent-1
87ec445943324a243be2b9499b74dc0983a42af9
[ "BSL-1.0", "BSD-3-Clause" ]
null
null
null
import unittest import libtorrent as lt class GenerateFingerprintTest(unittest.TestCase): @unittest.skip("https://github.com/arvidn/libtorrent/issues/5985") def test_generate(self) -> None: # full version self.assertEqual( lt.generate_fingerprint_bytes(b"ABCD", 1, 2, 3, 4), # type: ignore b"-AB1234-", ) # short name self.assertEqual( lt.generate_fingerprint_bytes(b"A", 1, 2, 3, 4), # type: ignore b"-A\x001234-", ) # major.minor self.assertEqual( lt.generate_fingerprint_bytes(b"ABCD", 1, 2), # type: ignore b"-AB1200-", ) # high versions self.assertEqual( lt.generate_fingerprint_bytes( # type: ignore b"ABCD", 1000, 2000, 3000, 4000 ), b"unknown", ) # version < 0 self.assertEqual( lt.generate_fingerprint_bytes(b"ABCD", -1, -1, -1, -1), # type: ignore b"-AB0000-", ) @unittest.skip("https://github.com/arvidn/libtorrent/issues/5988") def test_deprecations(self) -> None: with self.assertWarns(DeprecationWarning): lt.generate_fingerprint("ABCD", 1, 2, 3, 4) def test_generate_str(self) -> None: # full version self.assertEqual(lt.generate_fingerprint("ABCD", 1, 2, 3, 4), "-AB1234-") # short name self.assertEqual(lt.generate_fingerprint("A", 1, 2, 3, 4), "---1234-") # version < 0 self.assertEqual(lt.generate_fingerprint("ABCD", 1, 2, -1, -1), "-AB1200-") class FingerprintTest(unittest.TestCase): @unittest.skip("https://github.com/arvidn/libtorrent/issues/5967") def test_deprecations(self) -> None: with self.assertWarns(DeprecationWarning): lt.fingerprint("AB", 1, 2, 3, 4) def test_fingerprint(self) -> None: fprint = lt.fingerprint("AB", 1, 2, 3, 4) with self.assertWarns(DeprecationWarning): self.assertEqual(str(fprint), "-AB1234-") # self.assertEqual(fprint.major_version, 1) # self.assertEqual(fprint.minor_version, 2) # self.assertEqual(fprint.revision_version, 3) # self.assertEqual(fprint.tag_version, 4) # short names behave differently fprint = lt.fingerprint("A", 1, 2, 3, 4) with self.assertWarns(DeprecationWarning): self.assertEqual(str(fprint), "-A\x001234-") @unittest.skip("fingerprint.<attr> broke") def test_fingerprint_broken(self) -> None: fprint = lt.fingerprint("AB", 1, 2, 3, 4) self.assertEqual(fprint.major_version, 1) self.assertEqual(fprint.minor_version, 2) self.assertEqual(fprint.revision_version, 3) self.assertEqual(fprint.tag_version, 4)
33.785714
83
0.596899
324
2,838
5.135802
0.212963
0.16226
0.113582
0.021635
0.78726
0.786659
0.743389
0.703125
0.566707
0.49399
0
0.059615
0.26709
2,838
83
84
34.192771
0.740385
0.127555
0
0.240741
1
0
0.11803
0
0
0
0
0
0.333333
1
0.111111
false
0
0.037037
0
0.185185
0.444444
0
0
0
null
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
d661d8e86726137439759903702685cde2f5e45e
129
py
Python
users/admin.py
Ab1gor/cardsite
3da8b998d093fd2b788a28bf8bc0cf09a43023c3
[ "BSD-3-Clause" ]
1
2019-03-12T06:33:21.000Z
2019-03-12T06:33:21.000Z
users/admin.py
Ab1gor/cardsite
3da8b998d093fd2b788a28bf8bc0cf09a43023c3
[ "BSD-3-Clause" ]
4
2021-03-18T20:48:41.000Z
2022-01-13T00:49:58.000Z
users/admin.py
Ab1gor/cardsite
3da8b998d093fd2b788a28bf8bc0cf09a43023c3
[ "BSD-3-Clause" ]
null
null
null
from django.contrib import admin from .models import userdetails admin.site.register(userdetails) # Register your models here.
18.428571
32
0.813953
17
129
6.176471
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.124031
129
6
33
21.5
0.929204
0.20155
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
d6c55ba995056b7f14dde5909a96116882286fb4
988
py
Python
tests/acceptance/test_project/__init__.py
wo0dyn/raincoat
56fb9624c92bc11690975b12efc192402ca334a4
[ "MIT" ]
18
2016-10-13T10:16:49.000Z
2017-10-20T07:54:11.000Z
tests/acceptance/test_project/__init__.py
wo0dyn/raincoat
56fb9624c92bc11690975b12efc192402ca334a4
[ "MIT" ]
18
2016-10-13T11:37:47.000Z
2017-10-20T20:59:34.000Z
tests/acceptance/test_project/__init__.py
wo0dyn/raincoat
56fb9624c92bc11690975b12efc192402ca334a4
[ "MIT" ]
2
2020-06-30T12:57:56.000Z
2020-07-16T08:02:21.000Z
""" Raincoat comments that are checked in acceptance tests """ def simple_function(): # Raincoat: pypi package: raincoat==0.1.4 path: raincoat/_acceptance_test.py element: use_umbrella # noqa # Raincoat: pypi package: raincoat==0.1.4 path: raincoat/_acceptance_test.py element: Umbrella.open # noqa # Raincoat: pypi package: raincoat==0.1.4 path: raincoat/_acceptance_test.py element: Umbrella # noqa # Raincoat: pypi package: raincoat==0.1.4 path: raincoat/_acceptance_test.py # noqa # Raincoat: pypi package: raincoat==0.1.4 path: raincoat/_acceptance_test.py element: non_existant # noqa # Raincoat: pypi package: raincoat==0.1.4 path: raincoat/non_existant.py # noqa # Raincoat: django ticket: #25981 # Raincoat: django ticket: #27754 # Raincoat: pygithub repo: peopledoc/raincoat@a35df1d path: raincoat/_acceptance_test.py element: Umbrella.open # noqa pass # this file should never be executed, only parsed. raise NotImplementedError
47.047619
123
0.739879
134
988
5.335821
0.335821
0.117483
0.159441
0.226573
0.641958
0.641958
0.641958
0.641958
0.641958
0.565035
0
0.037215
0.156883
988
20
124
49.4
0.821128
0.86336
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
true
0.333333
0
0
0.333333
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
0
0
0
0
5
d6f405a3731407909fed63dbcdd88f4a420f1944
44
py
Python
meloshare/ui/app.py
ocervell/meloshare
c42aaa72af178d6e8357381b3a9c3986fffdff6a
[ "MIT" ]
null
null
null
meloshare/ui/app.py
ocervell/meloshare
c42aaa72af178d6e8357381b3a9c3986fffdff6a
[ "MIT" ]
2
2018-01-28T00:11:20.000Z
2018-01-28T00:20:14.000Z
meloshare/ui/app.py
ocervell/meloshare
c42aaa72af178d6e8357381b3a9c3986fffdff6a
[ "MIT" ]
1
2018-02-26T01:37:41.000Z
2018-02-26T01:37:41.000Z
from . import create_app app = create_app()
14.666667
24
0.75
7
44
4.428571
0.571429
0.580645
0
0
0
0
0
0
0
0
0
0
0.159091
44
2
25
22
0.837838
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
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
0
0
0
5
ba54f229b0a67a173d8328a86895a9c88aa28c27
286
py
Python
products/admin.py
cactus-computing/product-recommendation
b5d9bb27205a4fb032fd19934ecab56a5a8c6d81
[ "MIT" ]
null
null
null
products/admin.py
cactus-computing/product-recommendation
b5d9bb27205a4fb032fd19934ecab56a5a8c6d81
[ "MIT" ]
null
null
null
products/admin.py
cactus-computing/product-recommendation
b5d9bb27205a4fb032fd19934ecab56a5a8c6d81
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import ProductAttributes, OrderAttributes, CrossSellPredictions, UpSellPredictions admin.site.register(OrderAttributes) admin.site.register(ProductAttributes) admin.site.register(CrossSellPredictions) admin.site.register(UpSellPredictions)
40.857143
95
0.874126
28
286
8.928571
0.428571
0.144
0.272
0
0
0
0
0
0
0
0
0
0.052448
286
7
96
40.857143
0.922509
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
ba65cca17d4478f2c975092c47d7362d00a13f98
84
py
Python
admit/util/continuumsubtraction/spectral/algorithms/__init__.py
astroumd/admit
bbf3d79bb6e1a6f7523553ed8ede0d358d106f2c
[ "MIT" ]
4
2017-03-01T17:26:28.000Z
2022-03-03T19:23:06.000Z
admit/util/continuumsubtraction/spectral/algorithms/__init__.py
teuben/admit
1cae54d1937c9af3f719102838df716e7e6d655c
[ "MIT" ]
48
2016-10-04T01:25:33.000Z
2021-09-08T14:51:10.000Z
admit/util/continuumsubtraction/spectral/algorithms/__init__.py
teuben/admit
1cae54d1937c9af3f719102838df716e7e6d655c
[ "MIT" ]
2
2016-11-10T14:10:22.000Z
2017-03-30T18:58:05.000Z
from PolyFit import PolyFit as PolyFit from SplineFit import SplineFit as SplineFit
28
44
0.857143
12
84
6
0.416667
0
0
0
0
0
0
0
0
0
0
0
0.142857
84
2
45
42
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
ba93cfe16256c005ba5d5f8ad7195b908d78929c
223
py
Python
eta/segmenters/__init__.py
ErfanTagh/eta
3aa51006439a89cc5e2c78bbe1f98234bbc347ea
[ "Apache-2.0" ]
25
2018-07-21T02:37:34.000Z
2022-03-30T12:57:54.000Z
eta/segmenters/__init__.py
ErfanTagh/eta
3aa51006439a89cc5e2c78bbe1f98234bbc347ea
[ "Apache-2.0" ]
183
2018-06-13T18:57:00.000Z
2022-02-24T14:35:49.000Z
eta/segmenters/__init__.py
ErfanTagh/eta
3aa51006439a89cc5e2c78bbe1f98234bbc347ea
[ "Apache-2.0" ]
13
2018-09-10T18:46:58.000Z
2022-02-07T02:25:31.000Z
""" Segmenters package declaration. Copyright 2017-2021, Voxel51, Inc. voxel51.com """ # Import all segmenters into the `eta.segmenters` namespace from .tf_segmenters import TFSemanticSegmenter, TFSemanticSegmenterConfig
22.3
73
0.807175
24
223
7.458333
0.791667
0
0
0
0
0
0
0
0
0
0
0.060606
0.112108
223
9
74
24.777778
0.843434
0.618834
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
241153a470187d78e669c83f4fbb4874ebb49e6b
697
py
Python
Flow/generate_time.py
fainyang/EE_Project
0e487d139a6751ecc0ccf39a877965abd9320e9f
[ "MIT" ]
3
2018-03-13T09:31:32.000Z
2020-06-26T11:18:28.000Z
Flow/generate_time.py
fainyang/EE_Project
0e487d139a6751ecc0ccf39a877965abd9320e9f
[ "MIT" ]
null
null
null
Flow/generate_time.py
fainyang/EE_Project
0e487d139a6751ecc0ccf39a877965abd9320e9f
[ "MIT" ]
1
2019-12-06T08:31:02.000Z
2019-12-06T08:31:02.000Z
def getime(date): list1=[] for hour in range(8): for minute in range(0,56,5): if minute<10: time=str(date)+'-0'+str(hour)+':0'+str(minute)+':01' else: time=str(date)+'-0'+str(hour)+':'+str(minute)+':01' list1.append(time) for hour in range(8,24): if hour<10: for minute in range(0,60): if minute<10: time=str(date)+'-0'+str(hour)+':0'+str(minute)+':01' else: time=str(date)+'-0'+str(hour)+':'+str(minute)+':01' list1.append(time) else: for minute in range(0,60): if minute<10: time=str(date)+'-'+str(hour)+':0'+str(minute)+':01' else: time=str(date)+'-'+str(hour)+':'+str(minute)+':01' list1.append(time) return list1
24.892857
57
0.572453
116
697
3.439655
0.198276
0.070175
0.165414
0.120301
0.884712
0.766917
0.766917
0.766917
0.684211
0.684211
0
0.08042
0.17934
697
27
58
25.814815
0.617133
0
0
0.64
0
0
0.053161
0
0
0
0
0
0
1
0.04
false
0
0
0
0.08
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
243c99a43d825391fca4de21bb2094fb3cd6820f
34
py
Python
my_test.py
Athenian-ComputerScience-Fall2020/day-1-workspace-maleich
40e2787595d6a269f9d2deb40c9c1cf1dcc4bb4e
[ "Apache-2.0" ]
null
null
null
my_test.py
Athenian-ComputerScience-Fall2020/day-1-workspace-maleich
40e2787595d6a269f9d2deb40c9c1cf1dcc4bb4e
[ "Apache-2.0" ]
null
null
null
my_test.py
Athenian-ComputerScience-Fall2020/day-1-workspace-maleich
40e2787595d6a269f9d2deb40c9c1cf1dcc4bb4e
[ "Apache-2.0" ]
null
null
null
# No test code for this repository
34
34
0.794118
6
34
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.176471
34
1
34
34
0.964286
0.941176
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
03317154402de5bba10a93f556e6b41f1b99d29c
53
py
Python
tests/fixtures/exceptions/recursion.py
danieleades/cleo
76a4e64668670b4cbfe68ec3ec0ec592a3eadbbd
[ "MIT" ]
null
null
null
tests/fixtures/exceptions/recursion.py
danieleades/cleo
76a4e64668670b4cbfe68ec3ec0ec592a3eadbbd
[ "MIT" ]
null
null
null
tests/fixtures/exceptions/recursion.py
danieleades/cleo
76a4e64668670b4cbfe68ec3ec0ec592a3eadbbd
[ "MIT" ]
null
null
null
def recursion_error() -> None: recursion_error()
17.666667
30
0.698113
6
53
5.833333
0.666667
0.8
0
0
0
0
0
0
0
0
0
0
0.169811
53
2
31
26.5
0.795455
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
0
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
5
cef5233a8677dead0a10e116124db460245a35b4
200
py
Python
pudoku/SimpleStringifier.py
Hendrikto/Pudoku3
edc32066f7210fbb831002c0f6c364d939746e2d
[ "MIT" ]
null
null
null
pudoku/SimpleStringifier.py
Hendrikto/Pudoku3
edc32066f7210fbb831002c0f6c364d939746e2d
[ "MIT" ]
null
null
null
pudoku/SimpleStringifier.py
Hendrikto/Pudoku3
edc32066f7210fbb831002c0f6c364d939746e2d
[ "MIT" ]
null
null
null
# author: Hendrik Werner from .SudokuStringifier import SudokuStringifier class SimpleStringifier(SudokuStringifier): def stringify(self, sudoku): return "".join(map(str, sudoku.cells))
25
48
0.755
20
200
7.55
0.85
0
0
0
0
0
0
0
0
0
0
0
0.15
200
7
49
28.571429
0.888235
0.11
0
0
0
0
0
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
30555d6e04fb241ebe3a75f62510a59ab0ee3ca6
44
py
Python
src/superfit/datasetselector/__init__.py
awacha/superfit
a95d346c4b38f61173c7434eb7389e2cf1ccae9c
[ "BSD-3-Clause" ]
null
null
null
src/superfit/datasetselector/__init__.py
awacha/superfit
a95d346c4b38f61173c7434eb7389e2cf1ccae9c
[ "BSD-3-Clause" ]
null
null
null
src/superfit/datasetselector/__init__.py
awacha/superfit
a95d346c4b38f61173c7434eb7389e2cf1ccae9c
[ "BSD-3-Clause" ]
null
null
null
from .datasetselector import DataSetSelector
44
44
0.909091
4
44
10
0.75
0
0
0
0
0
0
0
0
0
0
0
0.068182
44
1
44
44
0.97561
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
061a581f50567ab03326a60a71bbd31e5de6e512
266
py
Python
app/services/BAC.py
izconcept/Turnt
28d25ebfbd43aa6472aa1f0eec7e73ec1b8d15d3
[ "Apache-2.0" ]
4
2018-01-29T05:51:32.000Z
2018-02-08T05:18:47.000Z
app/services/BAC.py
izconcept/Turnt
28d25ebfbd43aa6472aa1f0eec7e73ec1b8d15d3
[ "Apache-2.0" ]
3
2018-01-30T21:41:09.000Z
2018-01-31T18:20:01.000Z
app/services/BAC.py
izconcept/Turnt
28d25ebfbd43aa6472aa1f0eec7e73ec1b8d15d3
[ "Apache-2.0" ]
1
2019-03-29T19:32:28.000Z
2019-03-29T19:32:28.000Z
from datetime import datetime def calculate_bac(drinks, weight, start_time, gender): return ((sum([drink['percentage'] * drink['amount'] for drink in drinks]) * 5.14) / weight * (.73 if gender == 'male' else .66)) - (0.15 * (datetime.now() - start_time).hour)
44.333333
178
0.669173
38
266
4.605263
0.763158
0.102857
0
0
0
0
0
0
0
0
0
0.044444
0.154135
266
5
179
53.2
0.733333
0
0
0
0
0
0.075188
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
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
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
5
062c5915006e9c6b377aabd995102110bcb09527
126
py
Python
find-numbers-with-even-number-of-digits/find-numbers-with-even-number-of-digits.py
Dongfang1021/Leetcode
4ecdad3279300720e92eeac683962ebc52c98a12
[ "MIT" ]
1
2021-06-05T06:26:32.000Z
2021-06-05T06:26:32.000Z
find-numbers-with-even-number-of-digits/find-numbers-with-even-number-of-digits.py
Dongfang1021/Leetcode
4ecdad3279300720e92eeac683962ebc52c98a12
[ "MIT" ]
null
null
null
find-numbers-with-even-number-of-digits/find-numbers-with-even-number-of-digits.py
Dongfang1021/Leetcode
4ecdad3279300720e92eeac683962ebc52c98a12
[ "MIT" ]
null
null
null
class Solution: def findNumbers(self, nums: List[int]) -> int: return [len(str(num)) % 2 for num in nums].count(0)
42
59
0.626984
20
126
3.95
0.85
0
0
0
0
0
0
0
0
0
0
0.020202
0.214286
126
3
59
42
0.777778
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
068982d99e55e28d199fa7683cdef793b1e60591
44,967
py
Python
tests/test_veracode.py
echohack/lantern
7a0aa7f1862639c558c20bcff0415b9c8c1b965c
[ "Apache-2.0" ]
13
2015-04-09T14:08:30.000Z
2017-04-07T10:58:56.000Z
tests/test_veracode.py
echohack/lantern
7a0aa7f1862639c558c20bcff0415b9c8c1b965c
[ "Apache-2.0" ]
10
2016-09-02T19:56:37.000Z
2021-03-23T07:53:00.000Z
tests/test_veracode.py
echohack/lantern
7a0aa7f1862639c558c20bcff0415b9c8c1b965c
[ "Apache-2.0" ]
2
2017-05-10T10:58:24.000Z
2018-05-30T17:50:10.000Z
import os import sys sys.path.append(os.getcwd()) from lantern import * import requests import nose.tools from mock import patch # mock data. These are real xml examples that have been scrubbed for personal information that represent actual xml responses from Veracode. mock_app_builds_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<applicationbuilds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/applicationbuilds" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/applicationbuilds https://analysiscenter.veracode.com/resource/2.0/applicationbuilds.xsd" ' 'account_id="00001">' '<application app_name="TestApp" app_id="00001" industry_vertical="Software" assurance_level="High" business_criticality="High" origin="Internally Developed" ' 'modified_date="2010-09-17T11:43:22-04:00" cots="false" business_unit="Not Specified" tags="">' '<customfield name="Custom 1" value=""/>' '<customfield name="Custom 2" value=""/>' '<customfield name="Custom 3" value=""/>' '<customfield name="Custom 4" value=""/>' '<customfield name="Custom 5" value=""/>' '<build version="5.0.0.3232" build_id="12724" submitter="my submitter" platform="Windows" lifecycle_stage="External or Beta Testing" ' 'results_ready="true" policy_name="Veracode Transitional High" policy_version="1" policy_compliance_status="Did Not Pass" rules_status="Did Not Pass" ' 'grace_period_expired="false" scan_overdue="false">' '<analysis_unit analysis_type="Static" published_date="2008-11-26T14:43:43-05:00" published_date_sec="1227728623" status="Results Ready"/>' '</build></application>' '<application app_name="TestApp2" app_id="00002" industry_vertical="Technology" assurance_level="High" business_criticality="High" origin="Not Specified" ' 'modified_date="2012-11-21T09:47:57-05:00" cots="false" business_unit="Not Specified" tags="">' '<customfield name="Custom 1" value=""/>' '<customfield name="Custom 2" value=""/>' '<customfield name="Custom 3" value=""/>' '<customfield name="Custom 4" value=""/>' '<customfield name="Custom 5" value=""/>' '<build version="20121121" build_id="79970" submitter="Veracode" platform="Not Specified" lifecycle_stage="Not Specified" results_ready="true" ' 'policy_name="Veracode Transitional High" policy_version="1" policy_compliance_status="Did Not Pass" rules_status="Did Not Pass" ' 'grace_period_expired="false" scan_overdue="false">' '<analysis_unit analysis_type="Manual" published_date="2012-11-21T09:47:45-05:00" published_date_sec="1353509265" status="Results Ready"/>' '</build></application></applicationbuilds>') mock_app_info_xml = () mock_app_list_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<applist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/applist" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/applist https://analysiscenter.veracode.com/resource/2.0/applist.xsd" account_id="00001">' '<app app_id="00001" app_name="TestApp"/>' '<app app_id="00002" app_name="TestApp2"/>' '</applist>') mock_build_info_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<buildinfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/4.0/buildinfo" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/4.0/buildinfo https://analysiscenter.veracode.com/resource/4.0/buildinfo.xsd" ' 'account_id="00001" app_id="00001" build_id="00001"> ' '<build version="TestApp 7.5.0.234" build_id="00001" submitter="Continuous Quality" platform="Not Specified" ' 'lifecycle_stage="Not Specified" results_ready="true" policy_name="Veracode Transitional Medium" policy_version="1" ' 'policy_compliance_status="Pass" rules_status="Pass" grace_period_expired="false" scan_overdue="false"> ' '<analysis_unit analysis_type="Static" published_date="2013-02-14T12:39:53-05:00" published_date_sec="1360863593" ' 'status="Results Ready"/> ' '</build></buildinfo>') mock_build_info_xml_create_build = ( '<?xml version="1.0" encoding="UTF-8"?>' '<buildinfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/4.0/buildinfo" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/4.0/buildinfo https://analysiscenter.veracode.com/resource/4.0/buildinfo.xsd" ' 'account_id="00001" app_id="00001" build_id="00001"> ' '<build version="TestCreateBuild" build_id="00002" submitter="Continuous Quality" platform="Not Specified" ' 'lifecycle_stage="Not Specified" results_ready="true" policy_name="Veracode Transitional Medium" policy_version="1" ' 'policy_compliance_status="Pass" rules_status="Pass" grace_period_expired="false" scan_overdue="false"> ' '<analysis_unit analysis_type="Static" published_date="2013-02-14T12:39:53-05:00" published_date_sec="1360863593" ' 'status="Results Ready"/> ' '</build></buildinfo>') mock_build_info_xml_prescan_success = ( '<?xml version="1.0" encoding="UTF-8"?>' '<buildinfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/4.0/buildinfo" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/4.0/buildinfo https://analysiscenter.veracode.com/resource/4.0/buildinfo.xsd" ' 'account_id="00001" app_id="00001" build_id="00001"> ' '<build version="TestApp 7.5.0.234" build_id="00001" submitter="Continuous Quality" platform="Not Specified" ' 'lifecycle_stage="Not Specified" results_ready="true" policy_name="Veracode Transitional Medium" policy_version="1" ' 'policy_compliance_status="Pass" rules_status="Pass" grace_period_expired="false" scan_overdue="false"> ' '<analysis_unit analysis_type="Static" published_date="2013-02-14T12:39:53-05:00" published_date_sec="1360863593" ' 'status="Pre-Scan Success"/> ' '</build></buildinfo>') mock_build_info_xml_prescan_in_progress = ( '<?xml version="1.0" encoding="UTF-8"?>' '<buildinfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/4.0/buildinfo" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/4.0/buildinfo https://analysiscenter.veracode.com/resource/4.0/buildinfo.xsd" ' 'account_id="00001" app_id="00001" build_id="00001"> ' '<build version="TestApp 7.5.0.234" build_id="00001" submitter="Continuous Quality" platform="Not Specified" ' 'lifecycle_stage="Not Specified" results_ready="true" policy_name="Veracode Transitional Medium" policy_version="1" ' 'policy_compliance_status="Pass" rules_status="Pass" grace_period_expired="false" scan_overdue="false"> ' '<analysis_unit analysis_type="Static" published_date="2013-02-14T12:39:53-05:00" published_date_sec="1360863593" ' 'status="Pre-Scan In Progress"/> ' '</build></buildinfo>') mock_build_list_xml = ( '<buildlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/buildlist" xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/buildlist https://analysiscenter.veracode.com/resource/2.0/buildlist.xsd" account_id="00001" app_id="00001" app_name="testApp">' '<build build_id="00001" version="TestApp 7.5.0.234"/>' '<build build_id="00002" version="TestCreateBuild"/>' '</buildlist>') mock_build_list_xml_create_build = ( '<buildlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/buildlist" xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/buildlist https://analysiscenter.veracode.com/resource/2.0/buildlist.xsd" account_id="00001" app_id="00001" app_name="testApp">' '<build build_id="00001" version="TestApp 7.5.0.234"/>' '</buildlist>') mock_call_stacks_xml = () mock_error_xml = ( '<error></error>') mock_file_list = ( ["TestFile01.jsp", "TestFile02.jsp", "TestFile03.class", "TestFile04.jsp", "TestFile05.htm", "TestFile06.class", "TestFile07.jsp", "TestFile08.jspi", "TestFile09.jsp"]) mock_file_list_blacklist = ( ["TestFile03.class", "TestFile05.htm", "TestFile06.class", "TestFile08.jspi"]) mock_file_list_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<filelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/filelist" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/filelist https://analysiscenter.veracode.com/resource/2.0/filelist.xsd" ' 'account_id="00001" app_id="00001" build_id="00002">' '<file file_id="21271739" file_name="TestFile01.jsp" file_status="Uploaded"/>' '<file file_id="21243504" file_name="TestFile02.jsp" file_status="Uploaded"/>' '<file file_id="21243519" file_name="TestFile03.class" file_status="Uploaded"/>' '<file file_id="21243523" file_name="TestFile04.jsp" file_status="Uploaded"/>' '<file file_id="21243525" file_name="TestFile05.htm" file_status="Uploaded"/>' '<file file_id="21243527" file_name="TestFile06.class" file_status="Uploaded"/>' '<file file_id="21265337" file_name="TestFile07.jsp" file_status="Uploaded"/>' '<file file_id="21265341" file_name="TestFile08.jspi" file_status="Uploaded"/>' '<file file_id="21265343" file_name="TestFile09.jsp" file_status="Uploaded"/>' '</filelist>') mock_file_list_blacklist_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<filelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/filelist" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/filelist https://analysiscenter.veracode.com/resource/2.0/filelist.xsd" ' 'account_id="00001" app_id="00001" build_id="00002">' '<file file_id="21243519" file_name="TestFile03.class" file_status="Uploaded"/>' '<file file_id="21243525" file_name="TestFile05.htm" file_status="Uploaded"/>' '<file file_id="21243527" file_name="TestFile06.class" file_status="Uploaded"/>' '<file file_id="21265341" file_name="TestFile08.jspi" file_status="Uploaded"/>' '</filelist>') mock_file_list_remove_file_by_name_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<filelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/filelist" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/filelist https://analysiscenter.veracode.com/resource/2.0/filelist.xsd" ' 'account_id="00001" app_id="00001" build_id="00002">' '<file file_id="21271739" file_name="TestFile01.jsp" file_status="Uploaded"/>' '<file file_id="21243504" file_name="TestFile02.jsp" file_status="Uploaded"/>' '<file file_id="21243519" file_name="TestFile03.class" file_status="Uploaded"/>' '<file file_id="21243523" file_name="TestFile04.jsp" file_status="Uploaded"/>' '<file file_id="21243525" file_name="TestFile05.htm" file_status="Uploaded"/>' '<file file_id="21243527" file_name="TestFile06.class" file_status="Uploaded"/>' '<file file_id="21265337" file_name="TestFile07.jsp" file_status="Uploaded"/>' '<file file_id="21265341" file_name="TestFile08.jspi" file_status="Uploaded"/>' '</filelist>') mock_file_list_empty_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<filelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/filelist" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/filelist https://analysiscenter.veracode.com/resource/2.0/filelist.xsd" ' 'account_id="00001" app_id="00001" build_id="00002">' '</filelist>') mock_module_list = [{'module_id': '00000059', 'module_name': 'PrescanTest01.class'}, {'module_id': '00000060', 'module_name': 'PrescanTest02.class'}, {'module_id': '00000061', 'module_name': 'PrescanTest03.class'}] mock_module_white_list = [{'module_id': '00000060', 'module_name': 'PrescanTest02.class'}, {'module_id': '00000061', 'module_name': 'PrescanTest03.class'}] mock_policy_list_xml = () mock_prescan_results_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<prescanresults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/prescanresults" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/prescanresults https://analysiscenter.veracode.com/resource/2.0/prescanresults.xsd" ' 'account_id="00001" app_id="00001" build_id="00002">' '<module id="00000059" name="PrescanTest01.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="4KB" ' 'status="Missing Supporting Files - 1 File, Unsupported Framework - 1 File" has_fatal_errors="false">' '<issue details="Unsupported framework: Apache Axis"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest01Dependency01" details="Not Found (Optional)"/>' '</module>' '<module id="00000060" name="PrescanTest02.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="5KB" ' 'status="Missing Supporting Files - 2 Files, Unsupported Framework - 1 File" has_fatal_errors="false">' '<issue details="Unsupported framework: Apache Axis"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest02Dependency01" details="Not Found (Optional)"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest02Dependency02" details="Not Found (Optional)"/>' '</module>' '<module id="00000061" name="PrescanTest03.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="2KB" ' 'status="Missing Supporting Files - 2 Files" has_fatal_errors="false">' '<file_issue filename="com.mock.cmp.product.adhoc.PrescanTest03Dependency01" details="Not Found (Optional)"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest03Dependency02" details="Not Found (Optional)"/>' '</module></prescanresults>') mock_prescan_results_xml_all_fatal_errors = ( '<?xml version="1.0" encoding="UTF-8"?>' '<prescanresults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/prescanresults" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/prescanresults https://analysiscenter.veracode.com/resource/2.0/prescanresults.xsd" ' 'account_id="00001" app_id="00001" build_id="00002">' '<module id="00000059" name="PrescanTest01.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="4KB" ' 'status="Missing Supporting Files - 1 File, Unsupported Framework - 1 File" has_fatal_errors="true">' '<issue details="Unsupported framework: Apache Axis"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest01Dependency01" details="Not Found (Optional)"/>' '</module>' '<module id="00000060" name="PrescanTest02.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="5KB" ' 'status="Missing Supporting Files - 2 Files, Unsupported Framework - 1 File" has_fatal_errors="true">' '<issue details="Unsupported framework: Apache Axis"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest02Dependency01" details="Not Found (Optional)"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest02Dependency02" details="Not Found (Optional)"/>' '</module>' '<module id="00000061" name="PrescanTest03.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="2KB" ' 'status="Missing Supporting Files - 2 Files" has_fatal_errors="true">' '<file_issue filename="com.mock.cmp.product.adhoc.PrescanTest03Dependency01" details="Not Found (Optional)"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest03Dependency02" details="Not Found (Optional)"/>' '</module></prescanresults>') mock_prescan_results_xml_mixed = ( '<?xml version="1.0" encoding="UTF-8"?>' '<prescanresults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://analysiscenter.veracode.com/schema/2.0/prescanresults" ' 'xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/prescanresults https://analysiscenter.veracode.com/resource/2.0/prescanresults.xsd" ' 'account_id="00001" app_id="00001" build_id="00002">' '<module id="00000059" name="PrescanTest01.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="4KB" ' 'status="Missing Supporting Files - 1 File, Unsupported Framework - 1 File" has_fatal_errors="false">' '<issue details="Unsupported framework: Apache Axis"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest01Dependency01" details="Not Found (Optional)"/>' '</module>' '<module id="00000060" name="PrescanTest02.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="5KB" ' 'status="Missing Supporting Files - 2 Files, Unsupported Framework - 1 File" has_fatal_errors="true">' '<issue details="Unsupported framework: Apache Axis"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest02Dependency01" details="Not Found (Optional)"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest02Dependency02" details="Not Found (Optional)"/>' '</module>' '<module id="00000061" name="PrescanTest03.class" platform="JVM / Java J2SE 6 / JAVAC_6" size="2KB" ' 'status="Missing Supporting Files - 2 Files" has_fatal_errors="true">' '<file_issue filename="com.mock.cmp.product.adhoc.PrescanTest03Dependency01" details="Not Found (Optional)"/>' '<file_issue filename="com.mock.ws.common.v1.PrescanTest03Dependency02" details="Not Found (Optional)"/>' '</module></prescanresults>') mock_detailed_report_pdf = (b'') mock_detailed_report_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<detailedreport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.veracode.com/schema/reports/export/1.0" ' 'xsi:schemaLocation="https://www.veracode.com/schema/reports/export/1.0 https://analysiscenter.veracode.com/resource/detailedreport.xsd" ' 'report_format_version="1.1" app_name="testApp" app_id="00001" first_build_submitted_date="2012-12-20 22:24:36 UTC" ' 'version="1.0.1.0" build_id="00002" submitter="Continuous Quality" platform="Not Specified" ' 'assurance_level="3" business_criticality="3" generation_date="2013-02-20 20:01:33 UTC" veracode_level="VL3" ' 'total_flaws="4" flaws_not_mitigated="4" teams="Quality" life_cycle_stage="Not Specified" ' 'planned_deployment_date="" last_update_time="2013-02-19 23:45:37 UTC" is_latest_build="true" policy_name="Veracode Transitional Medium" ' 'policy_version="1" policy_compliance_status="Pass" policy_rules_status="Pass" grace_period_expired="false" scan_overdue="false" ' 'any_type_scan_due="2013-02-19 23:45:33 UTC" business_owner="Testing" business_unit="Not Specified" tags="App,Automation,CQ,Quality,Test">' '<static-analysis rating="A" score="98" submitted_date="2013-02-19 23:27:07 UTC" published_date="2013-02-19 23:45:33 UTC" ' 'analysis_size_bytes="330970">' '<modules>' '<module name="ActivityLogHelper.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" loc="00001" score="99" ' 'numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="2" numflawssev4="0" numflawssev5="0"/>' '<module name="AccessFilter.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" loc="0002" score="99" ' 'numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="1" numflawssev4="0" numflawssev5="0"/>' '<module name="JobRunner.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" loc="00003" score="99" ' 'numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="1" numflawssev4="0" numflawssev5="0"/>' '<module name="EntityTypeHelper.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" loc="12545" ' 'score="100" numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="0" numflawssev4="0" numflawssev5="0"/>' '<module name="IntegrationCodeSearchCriteria.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" ' 'loc="00004" score="100" numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="0" numflawssev4="0" numflawssev5="0"/>' '</modules>' '</static-analysis>' '<severity level="5"/>' '<severity level="4"/>' '<severity level="3">' '<category categoryid="21" categoryname="CRLF Injection" pcirelated="true">' '<desc>' '<para text="The acronym CRLF stands for &quot;Carriage Return, Line Feed&quot; and refers to the sequence of characters "' '"used to denote the end of a line of text. CRLF injection vulnerabilities occur when data enters an application from an untrusted "' '"source and is not properly validated before being used. For example, if an attacker is able to inject a CRLF into a log file, he "' '"could append falsified log entries, thereby misleading administrators or cover traces of the attack. If an attacker is able to inject "' '"CRLFs into an HTTP response header, he can use this ability to carry out other attacks such as cache poisoning. CRLF vulnerabilities "' '"primarily affect data integrity. "/>' '</desc>' '<recommendations>' '<para text="Apply robust input filtering for all user-supplied data, using centralized data validation routines when possible. "' '"Use output filters to sanitize all output derived from user-supplied input, replacing non-alphanumeric characters with their HTML entity equivalents."/>' '</recommendations></category></severity>' '<severity level="2"/>' '<severity level="1"/>' '<severity level="0"/>' '<flaw-status new="4" reopen="0" open="0" fixed="0" total="4" not_mitigated="4" sev-1-change="0" sev-2-change="0" sev-3-change="4" sev-4-change="0" sev-5-change="0"/>' '</detailedreport>') mock_summary_report_pdf = (b'') mock_summary_report_xml = ( '<?xml version="1.0" encoding="UTF-8"?>' '<summaryreport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.veracode.com/schema/reports/export/1.0" ' 'xsi:schemaLocation="https://www.veracode.com/schema/reports/export/1.0 https://analysiscenter.veracode.com/resource/summaryreport.xsd" ' 'report_format_version="1.1" app_name="testApp" app_id="00001" first_build_submitted_date="2012-12-20 22:24:36 UTC" ' 'version="1.0.1.0" build_id="00002" submitter="Continuous Quality" platform="Not Specified" assurance_level="3" ' 'business_criticality="3" generation_date="2013-02-20 19:24:37 UTC" veracode_level="VL3" total_flaws="4" flaws_not_mitigated="4" ' 'teams="Quality" life_cycle_stage="Not Specified" planned_deployment_date="" last_update_time="2013-02-19 23:45:37 UTC" ' 'is_latest_build="true" policy_name="Veracode Transitional Medium" policy_version="1" policy_compliance_status="Pass" ' 'policy_rules_status="Pass" grace_period_expired="false" scan_overdue="false" any_type_scan_due="2013-02-19 23:45:33 UTC" ' 'business_owner="Testing" business_unit="Not Specified" tags="App,Automation,CQ,Quality,Test">' '<static-analysis rating="A" score="98" submitted_date="2013-02-19 23:27:07 UTC" published_date="2013-02-19 23:45:33 UTC" analysis_size_bytes="0">' '<modules>' '<module name="ActivityLogHelper.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" loc="00001" score="99" ' 'numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="2" numflawssev4="0" numflawssev5="0"/>' '<module name="AccessFilter.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" loc="0002" score="99" ' 'numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="1" numflawssev4="0" numflawssev5="0"/>' '<module name="JobRunner.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" loc="00003" score="99" ' 'numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="1" numflawssev4="0" numflawssev5="0"/>' '<module name="EntityTypeHelper.class" compiler="JAVAC_6" os="Java J2SE 6" architecture="JVM" loc="12545" ' 'score="100" numflawssev0="0" numflawssev1="0" numflawssev2="0" numflawssev3="0" numflawssev4="0" numflawssev5="0"/>' '</modules>' '</static-analysis>' '<severity level="5"/><severity level="4"/><severity level="3"><category categoryname="CRLF Injection" ' 'severity="Medium" count="2"/><category categoryname="Code Quality" severity="Medium" count="1"/><category ' 'categoryname="Session Fixation" severity="Medium" count="1"/></severity><severity level="2"/><severity level="1"/>' '<severity level="0"/><flaw-status new="4" reopen="0" open="0" fixed="0" total="4" not_mitigated="4" sev-1-change="0" ' 'sev-2-change="0" sev-3-change="4" sev-4-change="0" sev-5-change="0"/></summaryreport>') mock_third_party_report_xml = () mock_third_party_report_pdf = (b'') mock_update_build_xml = () mock_vendor_list_xml = () class TestVeracode(): test_instance = None @classmethod def setup_class(cls): cls.test_instance = AbstractAPI("myTestUsername", "myTestPassword") @classmethod def teardown_class(cls): cls.test_instance = None def test_begin_prescan(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_build_info_xml mock_method.return_value = r begin_prescan_xml = self.test_instance.begin_prescan(34, 52) assert begin_prescan_xml == mock_build_info_xml def test_begin_scan(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_build_info_xml mock_method.return_value = r begin_scan_xml = self.test_instance.begin_scan(34, ["something", "something1", "something2"], False) assert begin_scan_xml == mock_build_info_xml def test_create_app(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_app_info_xml mock_method.return_value = r create_app_xml = self.test_instance.create_app( "myApp", "High", "This is an app description.", 11, "testPolicy", "testBusinessUnit", "testBusinessOwner", "testBusinessOwnerEmail@example.com", "testTeam", "testOrigin", "testIndustry", "testAppType", "testDeploymentType", "testWebApplication", "testArcherAppName", "testTags") assert create_app_xml == mock_app_info_xml def test_create_build(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_build_info_xml mock_method.return_value = r create_build_xml = self.test_instance.create_build(34, "testVersion", "testLifecycleStage", 19, "2013-22-01") assert create_build_xml == mock_build_info_xml def test_delete_app(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_app_list_xml mock_method.return_value = r delete_app_xml = self.test_instance.delete_app(34) assert delete_app_xml == mock_app_list_xml def test_delete_build(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_app_list_xml mock_method.return_value = r delete_build_xml = self.test_instance.delete_build(34) assert delete_build_xml == mock_app_list_xml def test_detailed_report_pdf(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.content = mock_detailed_report_pdf mock_method.return_value = r detailed_report_pdf = self.test_instance.detailed_report_pdf(52) assert detailed_report_pdf == mock_detailed_report_pdf def test_get_app_builds(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_app_builds_xml mock_method.return_value = r app_builds_xml = self.test_instance.get_app_builds() assert app_builds_xml == mock_app_builds_xml def test_get_app_info(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_app_info_xml mock_method.return_value = r app_info_xml = self.test_instance.get_app_info(52) assert app_info_xml == mock_app_info_xml def test_get_app_list(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_app_list_xml mock_method.return_value = r app_list_xml = self.test_instance.get_app_list() assert app_list_xml == mock_app_list_xml def test_get_build_info(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_build_info_xml mock_method.return_value = r build_info_xml = self.test_instance.get_build_info(34, 52) assert build_info_xml == mock_build_info_xml def test_get_build_list(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_app_info_xml mock_method.return_value = r build_list_xml = self.test_instance.get_build_list(52) assert build_list_xml == mock_app_info_xml def test_get_call_stacks(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_call_stacks_xml mock_method.return_value = r call_stacks_xml = self.test_instance.get_call_stacks(34, 975) assert call_stacks_xml == mock_call_stacks_xml def test_get_file_list(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_file_list_xml mock_method.return_value = r file_list_xml = self.test_instance.get_file_list(34, 52) assert file_list_xml == mock_file_list_xml def test_get_policy_list(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_policy_list_xml mock_method.return_value = r policy_list_xml = self.test_instance.get_policy_list() assert policy_list_xml == mock_policy_list_xml def test_get_prescan_results(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_prescan_results_xml mock_method.return_value = r prescan_results_xml = self.test_instance.get_prescan_results(34, 52) assert prescan_results_xml == mock_prescan_results_xml def test_get_vendor_list(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_vendor_list_xml mock_method.return_value = r vendor_list_xml = self.test_instance.get_vendor_list() assert vendor_list_xml == mock_vendor_list_xml def test_remove_file(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_file_list_xml mock_method.return_value = r remove_file_xml = self.test_instance.remove_file(34, 3420) assert remove_file_xml == mock_file_list_xml def test_third_party_report_pdf(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.content = mock_third_party_report_pdf mock_method.return_value = r third_party_report_pdf = self.test_instance.third_party_report_pdf(52) assert third_party_report_pdf == mock_third_party_report_pdf def test_summary_report_pdf(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.content = mock_summary_report_pdf mock_method.return_value = r summary_report_pdf = self.test_instance.summary_report_pdf(52) assert summary_report_pdf == mock_summary_report_pdf def test_upload_file(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_file_list_xml mock_method.return_value = r fileName = "myUploadFile.txt" with open(fileName, "w+") as f: f.write("test") upload_file_xml = self.test_instance.upload_file(34, fileName) os.remove(fileName) assert upload_file_xml == mock_file_list_xml def test_update_app(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_app_info_xml mock_method.return_value = r update_app_xml = self.test_instance.update_app( 34, "myApp", "High", "testPolicy", "testBusinessUnit", "testBusinessOwner", "testBusinessOwnerEmail@example.com", "testTeam", "testOrigin", "testIndustry", "testAppType", "testDeploymentType", "testArcherAppName", "testTags", "testCustomFieldName", "testCustomFieldValue") assert update_app_xml == mock_app_info_xml def test_update_build(self): with patch.object(requests, "request") as mock_method: r = requests.Response r.text = mock_update_build_xml mock_method.return_value = r update_build_xml = self.test_instance.update_build(34, 52, "testVersion", "testLifecycleStage", "2013-22-01") assert update_build_xml == mock_update_build_xml class TestAPI(): test_instance = None @classmethod def setup_class(cls): with patch("lantern.AbstractAPI.get_app_list") as get_app_list: get_app_list.return_value = mock_app_list_xml with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml with patch("lantern.AbstractAPI.get_build_list") as get_build_list: get_build_list.return_value = mock_build_list_xml cls.test_instance = API("myTestUsername", "myTestPassword", "TestApp", "TestApp 7.5.0.234") @classmethod def teardown_class(cls): cls.test_instance = None def test_begin_prescan(self): with patch("lantern.AbstractAPI.begin_prescan") as begin_prescan: begin_prescan.return_value = mock_build_info_xml result = self.test_instance.begin_prescan() assert result == mock_build_info_xml def test_begin_scan(self): with patch("lantern.AbstractAPI.begin_scan") as begin_scan: begin_scan.return_value = mock_build_info_xml begin_scan_xml = self.test_instance.begin_scan(mock_prescan_results_xml, ["PrescanTest01.*"]) assert begin_scan_xml == mock_build_info_xml def test_create_module_white_list(self): module_white_list = self.test_instance.create_module_white_list(mock_module_list, ["PrescanTest01.*"]) assert module_white_list == mock_module_white_list def test_compare_file_list(self): with patch("lantern.AbstractAPI.get_file_list") as get_file_list: get_file_list.return_value = mock_file_list_blacklist_xml positive_result = self.test_instance.compare_file_list(os.getcwd() + "/ext/", ["*.jsp"]) assert positive_result == [] negative_result = self.test_instance.compare_file_list(os.getcwd(), ["*.jsp"]) assert negative_result != [] def test_compare_module_list(self): module_white_list = self.test_instance.compare_module_list(mock_prescan_results_xml, ["PrescanTest01.*"]) assert module_white_list == mock_module_white_list def test_create_new_build(self): with patch("lantern.AbstractAPI.get_build_list") as get_build_list: get_build_list.return_value = mock_build_list_xml_create_build with patch("lantern.AbstractAPI.create_build") as create_build: create_build.return_value = mock_build_info_xml_create_build self.test_instance.set_build_id("TestCreateBuild") result = self.test_instance.build_id assert result == "00002" def test_use_existing_build(self): with patch("lantern.AbstractAPI.get_build_list") as get_build_list: get_build_list.return_value = mock_build_list_xml self.test_instance.set_build_id("TestCreateBuild") result = self.test_instance.build_id assert result == "00002" def test_delete_build(self): with patch("lantern.AbstractAPI.delete_build") as delete_build: delete_build.return_value = mock_app_list_xml result = self.test_instance.delete_build() assert result == mock_app_list_xml def test_detailed_report(self): with patch("lantern.AbstractAPI.detailed_report") as detailed_report: detailed_report.return_value = mock_detailed_report_xml with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml result = self.test_instance.detailed_report(4, 0.001, 0.001, 2) assert result == mock_detailed_report_xml def test_detailed_report_exceeds_retries(self): with patch("lantern.AbstractAPI.detailed_report") as detailed_report: detailed_report.return_value = mock_detailed_report_xml with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml_prescan_success with nose.tools.assert_raises(ExceededRetries): self.test_instance.detailed_report(4, 0.001, 0.001, 2) def test_get_app_builds(self): with patch("lantern.AbstractAPI.get_app_builds") as get_app_builds: get_app_builds.return_value = mock_app_builds_xml result = self.test_instance.get_app_builds() assert result == mock_app_builds_xml def test_get_build_info_status(self): result = self.test_instance.get_build_info_status(mock_build_info_xml) assert result == "Results Ready" def test_get_build_version(self): result = self.test_instance.get_build_version(mock_build_info_xml) assert result == "TestApp 7.5.0.234" def test_get_module_list(self): module_list = self.test_instance.get_module_list(mock_prescan_results_xml) assert module_list == mock_module_list def test_get_prescan_results(self): with patch("lantern.AbstractAPI.get_prescan_results") as get_prescan_results: get_prescan_results.return_value = mock_prescan_results_xml with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml_prescan_success result = self.test_instance.get_prescan_results(1, 0, 0.001, 2) assert result == mock_prescan_results_xml def test_get_prescan_results_error_status_not_ready(self): with patch("lantern.AbstractAPI.get_prescan_results") as get_prescan_results: get_prescan_results.return_value = mock_prescan_results_xml with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml_prescan_in_progress with nose.tools.assert_raises(ExceededRetries): self.test_instance.get_prescan_results(4, 0, 0.001, 2) def test_get_xml_attrib_error(self): with patch.object(API, 'get_xml_attrib') as mock: with nose.tools.assert_raises(ReceivedErrorXML): mock.side_effect = ReceivedErrorXML API.get_xml_attrib("<error>This is an error</error>") def test_poll_detailed_report(self): with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml with patch("lantern.AbstractAPI.detailed_report") as detailed_report: detailed_report.return_value = mock_detailed_report_xml result = self.test_instance.detailed_report(1, 0, 0.001, 2) assert result == mock_detailed_report_xml def test_poll_detailed_report_pdf(self): with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml with patch("lantern.AbstractAPI.detailed_report_pdf") as detailed_report_pdf: detailed_report_pdf.return_value = mock_detailed_report_pdf result = self.test_instance.detailed_report_pdf(1, 0, 0.001, 2) assert result == mock_detailed_report_pdf def test_poll_summary_report(self): with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml with patch("lantern.AbstractAPI.summary_report") as summary_report: summary_report.return_value = mock_summary_report_xml result = self.test_instance.summary_report(1, 0, 0.001, 2) assert result == mock_summary_report_xml def test_poll_summary_report_pdf(self): with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml with patch("lantern.AbstractAPI.summary_report_pdf") as summary_report_pdf: summary_report_pdf.return_value = mock_summary_report_pdf result = self.test_instance.summary_report_pdf(1, 0, 0.001, 2) assert result == mock_summary_report_pdf def test_poll_third_party_report_pdf(self): with patch("lantern.AbstractAPI.get_build_info") as get_build_info: get_build_info.return_value = mock_build_info_xml with patch("lantern.AbstractAPI.third_party_report_pdf") as third_party_report_pdf: third_party_report_pdf.return_value = mock_third_party_report_pdf result = self.test_instance.third_party_report_pdf(1, 0, 0.001, 2) assert result == mock_third_party_report_pdf def test_remove_file_by_name(self): with patch("lantern.AbstractAPI.get_file_list") as get_file_list: get_file_list.return_value = mock_file_list_xml with patch("lantern.AbstractAPI.remove_file") as remove_file: remove_file.return_value = mock_file_list_remove_file_by_name_xml file_list_remove_file_by_name_xml = self.test_instance.remove_file_by_name("TestFile09.jsp") assert file_list_remove_file_by_name_xml == mock_file_list_remove_file_by_name_xml nose.tools.assert_raises(FileNotFound, self.test_instance.remove_file_by_name, "foo.txt") def test_remove_file_retry(self): with patch("lantern.AbstractAPI.get_file_list") as get_file_list: get_file_list.return_value = mock_file_list_xml with patch("lantern.AbstractAPI.remove_file") as remove_file: remove_file.return_value = mock_file_list_empty_xml file_list_remove_file_retry_xml = self.test_instance.remove_file_retry() assert file_list_remove_file_retry_xml == mock_file_list_empty_xml def test_set_build_id_attribute_error(self): with patch.object(API, 'set_build_id') as mock: with nose.tools.assert_raises(AttributeError): mock.side_effect = AttributeError self.test_instance.set_build_id("this will cause a attribute error!") def test_upload_file_with_blacklist(self): with patch("lantern.AbstractAPI.upload_file") as upload_file: upload_file.return_value = mock_file_list_blacklist_xml with patch("lantern.AbstractAPI.get_file_list") as get_file_list: get_file_list.return_value = mock_file_list_empty_xml file_list_upload_file_xml = self.test_instance.upload_file(os.getcwd() + "/ext/", ["*.jsp"]) assert file_list_upload_file_xml == mock_file_list_blacklist_xml def test_xml_attrib_for_error_xml(self): with nose.tools.assert_raises(ReceivedErrorXML): self.test_instance.get_build_info_status(mock_error_xml)
60.684211
330
0.702515
5,898
44,967
5.090031
0.085792
0.019786
0.028247
0.046967
0.846374
0.808867
0.760634
0.715999
0.685753
0.670664
0
0.050797
0.168635
44,967
740
331
60.766216
0.752247
0.003069
0
0.536321
0
0.180835
0.534745
0.153256
0
0
0
0
0.080371
1
0.083462
false
0.017002
0.009274
0
0.098918
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
068b1dc4f0853b16ed0a53448c156339bc7c0307
38
py
Python
asgi/__init__.py
ischaojie/learn-py
b24ec70c776fbc7176bdffbbd1b9ce46e6a25916
[ "MIT" ]
null
null
null
asgi/__init__.py
ischaojie/learn-py
b24ec70c776fbc7176bdffbbd1b9ce46e6a25916
[ "MIT" ]
null
null
null
asgi/__init__.py
ischaojie/learn-py
b24ec70c776fbc7176bdffbbd1b9ce46e6a25916
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ ASGI """
6.333333
23
0.368421
4
38
3.5
1
0
0
0
0
0
0
0
0
0
0
0.034483
0.236842
38
5
24
7.6
0.448276
0.710526
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
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
06ae86b6b3c0eafb96a1e7be2cc5a7222369399e
40,649
py
Python
test/gcp_reader.py
davidraleigh/epl-imagery-reader
8edafab6797943355ec7661e7330db5200811a1d
[ "Apache-2.0" ]
null
null
null
test/gcp_reader.py
davidraleigh/epl-imagery-reader
8edafab6797943355ec7661e7330db5200811a1d
[ "Apache-2.0" ]
null
null
null
test/gcp_reader.py
davidraleigh/epl-imagery-reader
8edafab6797943355ec7661e7330db5200811a1d
[ "Apache-2.0" ]
null
null
null
import py_compile import unittest from datetime import date import numpy as np import pyproj import requests import shapely.geometry from lxml import etree from osgeo import gdal from shapely.wkt import loads from epl.native.imagery import PLATFORM_PROVIDER from epl.native.imagery.reader import MetadataService, Landsat, Storage, RasterMetadata, DataType, FunctionDetails from epl.native.imagery.metadata_helpers import LandsatQueryFilters, SpacecraftID, BandMap, Band from test.tools.test_helpers import xml_compare class TestGCPMetadataSQL(unittest.TestCase): def test_all_sat_data(self): metadata_service = MetadataService() landsat_filters = LandsatQueryFilters() landsat_filters.cloud_cover.set_value(0) d_start = date(2004, 6, 24) d_end = date(2008, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -114.31054687499999, 35.84029065139799) landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = metadata_service.search( data_filters=landsat_filters) rows = list(rows) first_item = rows[0] self.assertEqual(len(rows), 10) rows = metadata_service.search( satellite_id=SpacecraftID.UNKNOWN_SPACECRAFT, data_filters=landsat_filters) rows = list(rows) other_item = rows[0] self.assertEqual(len(rows), 10) self.assertEqual(first_item.scene_id, other_item.scene_id) def test_no_bounding_box(self): d_start = date(2003, 4, 4) d_end = date(2003, 4, 7) landsat_filters = LandsatQueryFilters() landsat_filters.wrs_path.set_value(125) landsat_filters.wrs_row.set_value(49) # sql_filters = ['wrs_row=49', 'wrs_path=125'] metadata_service = MetadataService() landsat_filters.acquired.set_range(d_start, True, d_end, True) rows = metadata_service.search( satellite_id=None, data_filters=landsat_filters) rows = list(rows) self.assertEqual(len(rows), 3) def test_metatdata_file_list(self): wkt = "POLYGON((136.2469482421875 -27.57843813308233,138.6639404296875 -27.57843813308233," \ "138.6639404296875 -29.82351878748485,136.2469482421875 -29.82351878748485,136." \ "2469482421875 -27.57843813308233))" polygon = loads(wkt) metadata_service = MetadataService() # sql_filters = ['cloud_cover=0'] d_start = date(2006, 8, 4) d_end = date(2006, 8, 5) bounding_box = polygon.bounds # sql_filters = ['wrs_row=79'] landsat_filters = LandsatQueryFilters() # landsat_filters.wrs_path.set_value(125) landsat_filters.wrs_row.set_value(79) landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = metadata_service.search( SpacecraftID.LANDSAT_5, data_filters=landsat_filters) rows = list(rows) metadata = rows[0] self.assertEqual(len(metadata.get_file_list()), 0) @unittest.skip("not sure why I put this test in or when it last passed.") def test_get_file(self): d_start = date(2015, 6, 24) d_end = date(2016, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -78.31054687499999, 44.84029065139799) landsat_filters = LandsatQueryFilters() landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) metadata_service = MetadataService() rows = metadata_service.search(SpacecraftID.LANDSAT_8, data_filters=landsat_filters, limit=1) rows = list(rows) metadata = rows[0] landsat = Landsat(metadata) self.assertIsNotNone(landsat) vrt = landsat.get_vrt([4, 3, 2]) self.assertIsNotNone(vrt) dataset = landsat.get_dataset([4, 3, 2], DataType.UINT16) self.assertIsNotNone(dataset) # 'gs://gcp-public-data-landsat/LC08/PRE/037/036/LC80370362016082LGN00' class TestGCPLandsat(unittest.TestCase): base_mount_path = '/imagery' metadata_service = None metadata_set = [] r = requests.get("https://raw.githubusercontent.com/johan/world.geo.json/master/countries/USA/NM/Taos.geo.json") taos_geom = r.json() taos_shape = shapely.geometry.shape(taos_geom['features'][0]['geometry']) def setUp(self): d_start = date(2017, 3, 12) # 2017-03-12 d_end = date(2017, 3, 19) # 2017-03-20, epl api is inclusive self.metadata_service = MetadataService() landsat_filters = LandsatQueryFilters() landsat_filters.collection_number.set_value("PRE") landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*self.taos_shape.bounds) rows = self.metadata_service.search( SpacecraftID.LANDSAT_8, limit=10, data_filters=landsat_filters) rows = list(rows) # mounted directory in docker container base_mount_path = '/imagery' for row in rows: self.metadata_set.append(row) def test_gdal_info(self): d_start = date(2015, 6, 24) d_end = date(2016, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -78.31054687499999, 44.84029065139799) landsat_filters = LandsatQueryFilters() landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search(SpacecraftID.LANDSAT_8, data_filters=landsat_filters, limit=1) rows = list(rows) metadata = rows[0] storage = Storage(metadata.bucket_name) b_mounted = storage.mount_sub_folder(metadata, "generic") self.assertTrue(b_mounted) b_deleted = storage.unmount_sub_folder(metadata, "generic") self.assertTrue(b_deleted) def test_landsat5_vrt(self): # 5th Place: Lake Eyre Landsat 5 Acquired August 5, 2006 wkt = "POLYGON((136.2469482421875 -27.57843813308233,138.6639404296875 -27.57843813308233," \ "138.6639404296875 -29.82351878748485,136.2469482421875 -29.82351878748485,136." \ "2469482421875 -27.57843813308233))" polygon = loads(wkt) # sql_filters = ['cloud_cover=0'] d_start = date(2006, 8, 4) d_end = date(2006, 8, 5) bounding_box = polygon.bounds landsat_filters = LandsatQueryFilters() landsat_filters.wrs_row.set_value(79) landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search( SpacecraftID.LANDSAT_5, data_filters=landsat_filters) rows = list(rows) self.assertEqual(len(rows), 1) # data structure that contains all fields from Google's Landsat BigQuery Database metadata = rows[0] # GDAL helper functions for generating VRT landsat = Landsat(metadata) vrt = landsat.get_vrt([3, 2, 1]) with open('testlandsat5.vrt', 'r') as myfile: data = myfile.read() expected = etree.XML(data) actual = etree.XML(vrt) result, message = xml_compare(expected, actual, {"GeoTransform": 1e-10}) self.assertTrue(result, message) def test_australia(self): # 5th Place: Lake Eyre Landsat 5 Acquired August 5, 2006 wkt = "POLYGON((136.2469482421875 -27.57843813308233,138.6639404296875 -27.57843813308233," \ "138.6639404296875 -29.82351878748485,136.2469482421875 -29.82351878748485,136." \ "2469482421875 -27.57843813308233))" polygon = loads(wkt) # sql_filters = ['cloud_cover=0'] d_start = date(2006, 8, 4) d_end = date(2006, 8, 7) bounding_box = polygon.bounds landsat_filters = LandsatQueryFilters() landsat_filters.wrs_row.set_value(79) landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search( SpacecraftID.LANDSAT_5, data_filters=landsat_filters) rows = list(rows) self.assertEqual(len(rows), 1) metadata = rows[0] landsat = Landsat(metadata) # get a numpy.ndarray from bands for specified imagery band_numbers = [3, 2, 1] scale_params = [[0.0, 65535], [0.0, 65535], [0.0, 65535]] # nda = landsat.__get_ndarray(band_numbers, metadata, scale_params) nda = landsat.fetch_imagery_array(band_numbers, scale_params) self.assertEqual((3581, 4046, 3), nda.shape) def test_unmount_destructor(self): wkt = "POLYGON((136.2469482421875 -27.57843813308233,138.6639404296875 -27.57843813308233," \ "138.6639404296875 -29.82351878748485,136.2469482421875 -29.82351878748485,136." \ "2469482421875 -27.57843813308233))" polygon = loads(wkt) # sql_filters = ['cloud_cover=0'] d_start = date(2006, 8, 4) d_end = date(2006, 8, 7) bounding_box = polygon.bounds landsat_filters = LandsatQueryFilters() landsat_filters.wrs_row.set_value(79) landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search( SpacecraftID.LANDSAT_5, data_filters=landsat_filters) rows = list(rows) metadata = rows[0] landsat = Landsat(metadata) vrt = landsat.get_vrt([4]) # storage = Storage("gcp-public-data-landsat") # del landsat # self.assertFalse(storage.is_mounted(metadata)) def test_unmount_destructor_conflict(self): wkt = "POLYGON((136.2469482421875 -27.57843813308233,138.6639404296875 -27.57843813308233," \ "138.6639404296875 -29.82351878748485,136.2469482421875 -29.82351878748485,136." \ "2469482421875 -27.57843813308233))" polygon = loads(wkt) # sql_filters = ['cloud_cover=0'] d_start = date(2006, 8, 4) d_end = date(2006, 8, 7) bounding_box = polygon.bounds # sql_filters = ['wrs_row=79'] landsat_filters = LandsatQueryFilters() landsat_filters.wrs_row.set_value(79) landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search( SpacecraftID.LANDSAT_5, data_filters=landsat_filters) rows = list(rows) metadata = rows[0] landsat = Landsat(metadata) vrt = landsat.get_vrt([4]) storage = Storage("gcp-public-data-landsat") landsat_2 = Landsat(metadata) vrt = landsat_2.get_vrt([4]) del landsat self.assertTrue(storage.is_mounted(metadata)) def test_vrt(self): d_start = date(2015, 6, 24) d_end = date(2016, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -78.31054687499999, 44.84029065139799) # sql_filters = ['scene_id="LC80400312016103LGN00"'] landsat_filters = LandsatQueryFilters() landsat_filters.scene_id.set_value("LC80400312016103LGN00") landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search(SpacecraftID.LANDSAT_8, limit=1, data_filters=landsat_filters) rows = list(rows) metadata = rows[0] landsat = Landsat(metadata) vrt = landsat.get_vrt([4, 3, 2]) with open('test_1.vrt', 'r') as myfile: data = myfile.read() expected = etree.XML(data) actual = etree.XML(vrt) result, message = xml_compare(expected, actual) self.assertTrue(result, message) dataset = gdal.Open(vrt) self.assertIsNotNone(dataset) ds_band_1 = dataset.GetRasterBand(1) self.assertIsNotNone(ds_band_1) self.assertEqual(ds_band_1.XSize, 7631) ds_band_2 = dataset.GetRasterBand(2) self.assertIsNotNone(ds_band_2) self.assertEqual(ds_band_2.YSize, 7771) ds_band_3 = dataset.GetRasterBand(3) self.assertIsNotNone(ds_band_3) self.assertEqual(ds_band_3.YSize, 7771) class TestStorage(unittest.TestCase): base_mount_path = '/imagery' def test_storage_create(self): metadata_service = MetadataService() d_start = date(2015, 6, 24) d_end = date(2016, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -78.31054687499999, 44.84029065139799) landsat_filters = LandsatQueryFilters() landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = metadata_service.search(SpacecraftID.LANDSAT_8, data_filters=landsat_filters, limit=1) rows = list(rows) metadata = rows[0] storage = Storage(metadata.bucket_name) metadata = rows[0] self.assertTrue(storage.mount_sub_folder(metadata, "generic")) self.assertTrue(storage.unmount_sub_folder(metadata, "generic")) def test_singleton(self): metadata_service = MetadataService() d_start = date(2015, 6, 24) d_end = date(2016, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -78.31054687499999, 44.84029065139799) landsat_filters = LandsatQueryFilters() landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = metadata_service.search(SpacecraftID.LANDSAT_8, data_filters=landsat_filters, limit=1) rows = list(rows) metadata = rows[0] storage_1 = Storage(metadata.bucket_name) storage_2 = Storage(metadata.bucket_name) self.assertTrue(storage_1 is storage_2) def test_delete_storage(self): metadata_service = MetadataService() d_start = date(2015, 6, 24) d_end = date(2016, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -78.31054687499999, 44.84029065139799) landsat_filters = LandsatQueryFilters() landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = metadata_service.search(SpacecraftID.LANDSAT_8, data_filters=landsat_filters, limit=1) rows = list(rows) metadata = rows[0] # storage = Storage(metadata.bucket_name) # # # self.assertTrue(storage.mount_sub_folder(metadata, "generic")) # files = [f for f in os.listdir(metadata.full_mount_path) if # os.path.isfile(os.path.join(metadata.full_mount_path, f))] # self.assertTrue(len(files) > 0) # # self.assertTrue(storage.unmount_sub_folder(metadata, "generic")) # files = [f for f in os.listdir(metadata.full_mount_path) if # os.path.isfile(os.path.join(metadata.full_mount_path, f))] # self.assertEqual(len(files), 0) # # self.assertTrue(storage.mount_sub_folder(metadata, "generic")) # files = [f for f in os.listdir(metadata.full_mount_path) if # os.path.isfile(os.path.join(metadata.full_mount_path, f))] # self.assertTrue(len(files) > 0) # self.assertTrue(storage.unmount_sub_folder(metadata, "generic")) def test_platform_provider(self): self.assertEqual("GCP", PLATFORM_PROVIDER) class TestGCPPixelFunctions(unittest.TestCase): m_metadata = None base_mount_path = '/imagery' metadata_service = MetadataService() iowa_polygon = None metadata_set = [] r = requests.get("https://raw.githubusercontent.com/johan/world.geo.json/master/countries/USA/NM/Taos.geo.json") taos_geom = r.json() taos_shape = shapely.geometry.shape(taos_geom['features'][0]['geometry']) def setUp(self): metadata_service = MetadataService() d_start = date(2015, 6, 24) d_end = date(2016, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -78.31054687499999, 44.84029065139799) # sql_filters = ['scene_id="LC80400312016103LGN00"'] landsat_filters = LandsatQueryFilters() landsat_filters.scene_id.set_value("LC80400312016103LGN00") landsat_filters.aoi.set_bounds(*bounding_box) landsat_filters.acquired.set_range(d_start, True, d_end, True) rows = metadata_service.search(SpacecraftID.LANDSAT_8, limit=1, data_filters=landsat_filters) rows = list(rows) self.m_metadata = rows[0] wkt_iowa = "POLYGON((-93.76075744628906 42.32707774458643,-93.47854614257812 42.32707774458643," \ "-93.47854614257812 42.12674735753131,-93.76075744628906 42.12674735753131," \ "-93.76075744628906 42.32707774458643))" self.iowa_polygon = loads(wkt_iowa) gdal.SetConfigOption('GDAL_VRT_ENABLE_PYTHON', "YES") d_start = date(2017, 3, 12) # 2017-03-12 d_end = date(2017, 3, 19) # 2017-03-20, epl api is inclusive landsat_filters = LandsatQueryFilters() landsat_filters.collection_number.set_value("PRE") landsat_filters.aoi.set_bounds(*self.taos_shape.bounds) landsat_filters.acquired.set_range(start=d_start, end=d_end) rows = self.metadata_service.search( SpacecraftID.LANDSAT_8, limit=10, data_filters=landsat_filters) rows = list(rows) for row in rows: self.metadata_set.append(row) def test_pixel_1(self): metadata = self.m_metadata landsat = Landsat(metadata) # , gsurl[2]) code = """import numpy as np def multiply_rounded(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, raster_ysize, buf_radius, gt, **kwargs): factor = float(kwargs['factor']) out_ar[:] = np.round_(np.clip(in_ar[0] * factor,0,255))""" function_arguments = {"factor": "1.5"} pixel_function_details = FunctionDetails(name="multiply_rounded", band_definitions=[2], data_type=DataType.FLOAT32, code=code, arguments=function_arguments) vrt = landsat.get_vrt([pixel_function_details, 3, 2]) with open('pixel_1.vrt', 'r') as myfile: data = myfile.read() expected = etree.XML(data) actual = etree.XML(vrt) result, message = xml_compare(expected, actual, {"GeoTransform": 1e-10}) self.assertTrue(result, message) def test_pixel_ndvi(self): """ http://grindgis.com/blog/vegetation-indices-arcgis NDVI = (NIR - RED) / (NIR + RED) NDVI = (5 - 4) / (5 + 4) :return: """ landsat = Landsat(self.m_metadata) # , gsurl[2]) code = """import numpy as np def ndvi_numpy(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, raster_ysize, buf_radius, gt, **kwargs): with np.errstate(divide = 'ignore', invalid = 'ignore'): output = np.divide((in_ar[1] - in_ar[0]), (in_ar[1] + in_ar[0])) output[np.isnan(output)] = 0.0 # shift range from -1.0-1.0 to 0.0-2.0 output += 1.0 # scale up from 0.0-2.0 to 0 to 255 by multiplying by 255/2 # https://stackoverflow.com/a/1735122/445372 output *= 65535/2.0 # https://stackoverflow.com/a/10622758/445372 # in place type conversion out_ar[:] = output.astype(np.int16, copy=False)""" pixel_function_details = FunctionDetails(name="ndvi_numpy", band_definitions=[4, 5], data_type=DataType.UINT16, code=code) vrt = landsat.get_vrt([pixel_function_details, 3, 2]) with open('ndvi_numpy.vrt', 'r') as myfile: data = myfile.read() expected = etree.XML(data) actual = etree.XML(vrt) result, message = xml_compare(expected, actual, {"GeoTransform": 1e-10}) self.assertTrue(result, message) gdal.SetConfigOption('GDAL_VRT_ENABLE_PYTHON', "YES") ds = gdal.Open(vrt) self.assertIsNotNone(ds) arr_ndvi = ds.GetRasterBand(1).ReadAsArray() ds = None self.assertIsNotNone(arr_ndvi) scale_params = [[0.0, 65535], [0.0, 65535], [0.0, 65535]] band_definitions = [pixel_function_details, 3, 2] nda = landsat.fetch_imagery_array(band_definitions, scale_params) self.assertIsNotNone(nda) @staticmethod def ndvi_numpy(nir, red): with np.errstate(divide='ignore', invalid='ignore'): out_ar = np.divide((nir.astype(float) - red.astype(float)), (nir.astype(float) + red.astype(float))) out_ar[np.isnan(out_ar)] = 0.0 return out_ar def test_iowa_ndarray(self): d_start = date(2016, 4, 4) d_end = date(2016, 8, 7) bounding_box = self.iowa_polygon.bounds # sql_filters = ["cloud_cover<=15"] landsat_filters = LandsatQueryFilters() landsat_filters.cloud_cover.set_range(end=15, end_inclusive=15) landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search( SpacecraftID.LANDSAT_8, data_filters=landsat_filters) rows = list(rows) metadata = rows[0] landsat = Landsat(metadata) code = """import numpy as np def ndvi_numpy(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, raster_ysize, buf_radius, gt, **kwargs): with np.errstate(divide = 'ignore', invalid = 'ignore'): out_ar[:] = np.divide((in_ar[1] - in_ar[0]), (in_ar[1] + in_ar[0])) out_ar[np.isnan(out_ar)] = 0.0 out_ar """ pixel_function_details = FunctionDetails(name="ndvi_numpy", band_definitions=[4, 5], code=code, data_type=DataType.FLOAT32) # pixel_function_details = { # "band_numbers": [4, 5], # "function_code": code, # "function_type": "ndvi_numpy", # "data_type": DataType.FLOAT32, # } band_definitions = [pixel_function_details, 4, 5] vrt = landsat.get_vrt(band_definitions) ds = gdal.Open(vrt) self.assertIsNotNone(ds) arr_4 = ds.GetRasterBand(2).ReadAsArray() arr_5 = ds.GetRasterBand(3).ReadAsArray() arr_ndvi = ds.GetRasterBand(1).ReadAsArray() del ds del landsat print(np.ndarray.max(arr_ndvi)) print(np.ndarray.min(arr_ndvi)) self.assertFalse(np.any(np.isinf(arr_ndvi))) self.assertIsNotNone(arr_ndvi) local_ndvi = self.ndvi_numpy(arr_5, arr_4) del arr_4 del arr_5 self.assertFalse(np.any(np.isinf(local_ndvi))) np.testing.assert_almost_equal(arr_ndvi, local_ndvi) def test_iowa_scaled(self): d_start = date(2016, 4, 4) d_end = date(2016, 8, 7) bounding_box = self.iowa_polygon.bounds # sql_filters = ["cloud_cover<=15"] landsat_filters = LandsatQueryFilters() landsat_filters.cloud_cover.set_range(end=15, end_inclusive=True) landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search( SpacecraftID.LANDSAT_8, data_filters=landsat_filters) rows = list(rows) metadata = rows[0] landsat = Landsat(metadata) code = """import numpy as np def ndvi_numpy(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, raster_ysize, buf_radius, gt, **kwargs): with np.errstate(divide = 'ignore', invalid = 'ignore'): factor = float(kwargs['factor']) out_ar[:] = np.divide((in_ar[1] - in_ar[0]), (in_ar[1] + in_ar[0])) out_ar[np.isnan(out_ar)] = 0.0 # shift range from -1.0-1.0 to 0.0-2.0 out_ar += 1.0 # scale up from 0.0-2.0 to 0 to 255 by multiplying by 255/2 out_ar *= factor/2.0""" # pixel_function_details = { # "function_arguments": {"factor": 255}, # "band_numbers": [4, Band.NIR], # "function_code": code, # "function_type": "ndvi_numpy", # "data_type": DataType.FLOAT32, # } pixel_function_details = FunctionDetails(name="ndvi_numpy", band_definitions=[4, Band.NIR], code=code, arguments={"factor": 255}, data_type=DataType.FLOAT32) band_definitions = [pixel_function_details, Band.RED, 5] vrt = landsat.get_vrt(band_definitions) ds = gdal.Open(vrt) self.assertIsNotNone(ds) arr_4 = ds.GetRasterBand(2).ReadAsArray() arr_5 = ds.GetRasterBand(3).ReadAsArray() arr_ndvi = ds.GetRasterBand(1).ReadAsArray() del ds del landsat print(np.ndarray.max(arr_ndvi)) # print(np.ndarray.min(arr_ndvi)) # self.assertFalse(np.any(np.isinf(arr_ndvi))) self.assertIsNotNone(arr_ndvi) local_ndvi = self.ndvi_numpy(arr_5, arr_4) del arr_4 del arr_5 local_ndvi += 1.0 local_ndvi *= float(pixel_function_details.arguments['factor']) / 2.0 self.assertFalse(np.any(np.isinf(local_ndvi))) np.floor(arr_ndvi, out=arr_ndvi) np.floor(local_ndvi, out=local_ndvi) np.testing.assert_almost_equal(arr_ndvi, local_ndvi, decimal=0) def test_malformed_funciton(self): code = """import numpy as np def ndvi_numpy(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, raster_ysize, buf_radius, gt, **kwargs): with np.errstate(divide = 'ignore', invalid = 'ignore'): factor = float(kwargs['factor']) out_ar[:] = np.divide((in_ar[1] - in_ar[0]), (in_ar[1] + in_ar[0])) out_ar[np.isnan(out_ar)] = 0.0 # shift range from -1.0-1.0 to 0.0-2.0 out_ar += 1.0 # scale up from 0.0-2.0 to 0 to 255 by multiplying by 255/2 out_ar *= factor/2.0 """ # pixel_function_details = { # "function_arguments": {"factor": 255}, # "band_numbers": [4, 5], # "function_code": code, # "function_type": "ndvi_numpy", # "data_type": DataType.FLOAT32, # } self.assertRaises(py_compile.PyCompileError, lambda: FunctionDetails(name="ndvi_numpy", code=code, band_definitions=[4, 5], data_type=DataType.FLOAT32, arguments={"factor": 255})) # def test_translate_vrt(self): # # LC80390332016208LGN00 """ gdalbuildvrt -vrtnodata 0 0 0 -separate rgb_35.vrt /imagery/gcp-public-data-landsat/LC08/PRE/033/035/LC80330352017072LGN00/LC80330352017072LGN00_B4.TIF /imagery/gcp-public-data-landsat/LC08/PRE/033/035/LC80330352017072LGN00/LC80330352017072LGN00_B3.TIF /imagery/gcp-public-data-landsat/LC08/PRE/033/035/LC80330352017072LGN00/LC80330352017072LGN00_B2.TIF gdalbuildvrt -separate rgb_34.vrt /imagery/gcp-public-data-landsat/LC08/PRE/033/034/LC80330342017072LGN00/LC80330342017072LGN00_B4.TIF /imagery/gcp-public-data-landsat/LC08/PRE/033/034/LC80330342017072LGN00/LC80330342017072LGN00_B3.TIF /imagery/gcp-public-data-landsat/LC08/PRE/033/034/LC80330342017072LGN00/LC80330342017072LGN00_B2.TIF """ # # gdal_translate -of VRT -ot Byte -scale -tr 60 60 rgb.vrt rgb_byte_scaled.vrt # # self.assertTrue(True) # sql_filters = ['scene_id="LC80330342017072LGN00"'] # metadata_service = MetadataService() # rows = metadata_service.search(SpacecraftID.LANDSAT_8, data_filters=landsat_filters) #rows = list(rows) # # # metadata = rows[0] # gsurl = urlparse(metadata.base_url) # storage = Storage(gsurl[1]) # # b_mounted = storage.mount_sub_folder(gsurl[2], self.base_mount_path) # landsat = Landsat(base_mount_path, gsurl[2]) # vrt = landsat.get_vrt(metadata, [5, 4, 3]) # # with open('gdalbuildvrt_LC80390332016208LGN00.vrt', 'r') as myfile: # data = myfile.read() # expected = etree.XML(data) # actual = etree.XML(vrt) # result, message = xml_compare(expected, actual) # self.assertTrue(result, message) def test_ndvi_taos(self): code = """import numpy as np def ndvi_numpy(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, raster_ysize, buf_radius, gt, **kwargs): with np.errstate(divide = 'ignore', invalid = 'ignore'): factor = float(kwargs['factor']) output = np.divide((in_ar[1] - in_ar[0]), (in_ar[1] + in_ar[0])) output[np.isnan(output)] = 0.0 # shift range from -1.0-1.0 to 0.0-2.0 output += 1.0 # scale up from 0.0-2.0 to 0 to 255 by multiplying by 255/2 # https://stackoverflow.com/a/1735122/445372 output *= factor/2.0 # https://stackoverflow.com/a/10622758/445372 # in place type conversion out_ar[:] = output.astype(np.int16, copy=False)""" code2 = """import numpy as np def ndvi_numpy2(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, raster_ysize, buf_radius, gt, **kwargs): with np.errstate(divide = 'ignore', invalid = 'ignore'): output = (in_ar[1] - in_ar[0]) / (in_ar[1] + in_ar[0]) output[np.isnan(output)] = 0.0 out_ar[:] = output""" landsat = Landsat(self.metadata_set) scale_params = [[0, DataType.UINT16.range_max, -1.0, 1.0]] pixel_function_details = FunctionDetails(name="ndvi_numpy", band_definitions=[Band.RED, Band.NIR], code=code, arguments={"factor": DataType.UINT16.range_max}, data_type=DataType.UINT16) gdal.SetConfigOption('GDAL_VRT_ENABLE_PYTHON', "YES") nda = landsat.fetch_imagery_array([pixel_function_details], scale_params=scale_params, polygon_boundary_wkb=self.taos_shape.wkb, output_type=DataType.FLOAT32) self.assertIsNotNone(nda) self.assertGreaterEqual(1.0, nda.max()) self.assertLessEqual(-1.0, nda.min()) pixel_function_details = FunctionDetails(name="ndvi_numpy2", band_definitions=[Band.RED, Band.NIR], code=code2, data_type=DataType.FLOAT32) nda2 = landsat.fetch_imagery_array([pixel_function_details], polygon_boundary_wkb=self.taos_shape.wkb, output_type=DataType.FLOAT32) self.assertIsNotNone(nda2) self.assertGreaterEqual(1.0, nda2.max()) self.assertLessEqual(-1.0, nda2.min()) def test_fail_1_to_1(self): code = """import numpy as np def ndvi_numpy(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, raster_ysize, buf_radius, gt, **kwargs): out_ar[:] = in_ar[0]""" landsat = Landsat(self.metadata_set) scale_params = [[0, 40000], [0, 40000], [0, 40000]] pixel_function_details = FunctionDetails(name="ndvi_numpy", band_definitions=[Band.RED], code=code, arguments={"factor": DataType.UINT16.range_max}, data_type=DataType.UINT16) gdal.SetConfigOption('GDAL_VRT_ENABLE_PYTHON', "YES") nda = landsat.fetch_imagery_array([pixel_function_details, Band.GREEN, Band.BLUE], scale_params=scale_params, polygon_boundary_wkb=self.taos_shape.wkb, output_type=DataType.BYTE) nda2 = landsat.fetch_imagery_array([Band.RED, Band.GREEN, Band.BLUE], scale_params=scale_params, polygon_boundary_wkb=self.taos_shape.wkb, output_type=DataType.BYTE) self.assertIsNotNone(nda) np.testing.assert_almost_equal(nda, nda2) np.testing.assert_equal(nda, nda2) @unittest.skip("failing for some reason. unknown.") def test_native_vs_custom(self): landsat = Landsat(self.metadata_set) gdal.SetConfigOption('GDAL_VRT_ENABLE_PYTHON', "YES") pixel_native = FunctionDetails(name="sqrt", band_definitions=[Band.RED], data_type=DataType.UINT16, transfer_type=DataType.FLOAT32) nda = landsat.fetch_imagery_array([pixel_native], polygon_boundary_wkb=self.taos_shape.wkb, output_type=DataType.FLOAT32) self.assertIsNotNone(nda) # TODO add own sqrt function here class TestRasterMetadata(unittest.TestCase): base_mount_path = '/imagery' metadata_service = None def setUp(self): self.metadata_service = MetadataService() def test_add_metadata_error(self): d_start = date(2015, 6, 24) d_end = date(2016, 6, 24) bounding_box = (-115.927734375, 34.52466147177172, -78.31054687499999, 44.84029065139799) landsat_filters = LandsatQueryFilters() landsat_filters.data_type.set_value("L1T") landsat_filters.acquired.set_range(d_start, True, d_end, True) landsat_filters.aoi.set_bounds(*bounding_box) rows = self.metadata_service.search(SpacecraftID.LANDSAT_8, limit=2, data_filters=landsat_filters) rows = list(rows) metadata_1 = rows[0] metadata_2 = rows[1] bands = [Band.RED, Band.BLUE, Band.GREEN] band_map = BandMap(SpacecraftID.LANDSAT_8) raster_metadata = RasterMetadata() storage = Storage() storage.mount_sub_folder(metadata_1) storage.mount_sub_folder(metadata_2) second = False for band in bands: band_number = band_map.get_number(band) if second: self.assertRaises(Exception, lambda: raster_metadata.add_metadata(band_number, metadata_2)) raster_metadata.add_metadata(band_number, metadata_1) second = True # @unittest.skip("changed how bounds are queried") def test_bounds(self): metadata_service = MetadataService() landsat_filters = LandsatQueryFilters() landsat_filters.scene_id.set_value("LC80330342017072LGN00") landsat_filters.collection_number.set_value("PRE") rows = metadata_service.search( SpacecraftID.LANDSAT_8, data_filters=landsat_filters) rows = list(rows) self.assertEqual(len(rows), 1) metadata = rows[0] bands = [Band.RED, Band.BLUE, Band.GREEN] band_map = BandMap(SpacecraftID.LANDSAT_8) raster_metadata = RasterMetadata() storage = Storage() storage.mount_sub_folder(metadata) for band in bands: band_number = band_map.get_number(band) raster_metadata.add_metadata(band_number, metadata) boundary = raster_metadata.bounds self.assertIsNotNone(boundary) r = requests.get("https://raw.githubusercontent.com/johan/world.geo.json/master/countries/USA/NM/Taos.geo.json") taos_geom = r.json() taos_shape = shapely.geometry.shape(taos_geom['features'][0]['geometry']) clipped_raster = raster_metadata.calculate_clipped(taos_shape.bounds, pyproj.Proj(init='epsg:4326')) self.assertIsNotNone(clipped_raster.bounds) big_box = shapely.geometry.box(*boundary) small_box = shapely.geometry.box(*clipped_raster.bounds) self.assertTrue(big_box.contains(small_box)) def test_metadata_extent(self): r = requests.get("https://raw.githubusercontent.com/johan/world.geo.json/master/countries/USA/NM/Taos.geo.json") taos_geom = r.json() print(taos_geom) taos_shape = shapely.geometry.shape(taos_geom['features'][0]['geometry']) metadata_service = MetadataService() # sql_filters = ['scene_id="LC80330342017072LGN00"', 'collection_number="PRE"'] landsat_filters = LandsatQueryFilters() landsat_filters.scene_id.set_value("LC80330342017072LGN00") landsat_filters.collection_number.set_value("PRE") rows = metadata_service.search( SpacecraftID.LANDSAT_8, data_filters=landsat_filters) rows = list(rows) self.assertEqual(len(rows), 1) metadata = rows[0] # GDAL helper functions for generating VRT landsat = Landsat(metadata) # get a numpy.ndarray from bands for specified imagery band_numbers = [Band.RED, Band.GREEN, Band.BLUE] scale_params = [[0.0, 65535], [0.0, 65535], [0.0, 65535]] vrt = landsat.get_vrt(band_numbers, envelope_boundary=taos_shape.bounds) with open('clipped_LC80330342017072LGN00.vrt', 'r') as myfile: data = myfile.read() expected = etree.XML(data) actual = etree.XML(vrt) result, message = xml_compare(expected, actual, {"GeoTransform": 1e-10, "xOff": 1e-10, "yOff": 1e-10}) self.assertTrue(result, message) dataset = gdal.Open(vrt) geo_transform = dataset.GetGeoTransform() # self.assertEqual(geo_transform, raster_metadata.get_geotransform(taos_shape.bounds)) # self.assertNotEqual(geo_transform, raster_metadata.get_geotransform()) """ gdal command for creating test data--/Users/davidraleigh/code/echopark/gcp-landsat-reader/test/clipped_LC80330342017072LGN00.vrt gdalbuildvrt -te 404696.67322238116 4028985.0 482408.22401454527 4094313.7809402538 -separate rgb_clipped.vrt /imagery/gcp-public-data-landsat/LC08/PRE/033/034/LC80330342017072LGN00/LC80330342017072LGN00_B4.TIF /imagery/gcp-public-data-landsat/LC08/PRE/033/034/LC80330342017072LGN00/LC80330342017072LGN00_B3.TIF /imagery/gcp-public-data-landsat/LC08/PRE/033/034/LC80330342017072LGN00/LC80330342017072LGN00_B2.TIF gdal command for creating test data-- gdal_translate -ot Byte -tr 60 60 -of VRT -scale 0 65535 0 255 /opt/src/gcp-imagery-reader/rgb_clipped.vrt /opt/src/gcp-imagery-reader/rgb_clipped_translated.vrt """ # TODO test band values for SrcRect # TODO test vs. something that autatically clips by extent and exports to vrt # TODO test by getting extent of vrt, projecting back to wgs 84 and making sure it is contained by taos_geom
42.2108
420
0.614898
4,756
40,649
5.045627
0.095038
0.058924
0.020128
0.023961
0.798516
0.77168
0.742885
0.711964
0.693128
0.668542
0
0.105512
0.277916
40,649
962
421
42.254678
0.712047
0.10475
0
0.712166
0
0.032641
0.166907
0.037049
0
0
0
0.002079
0.087537
1
0.043027
false
0.001484
0.032641
0
0.109792
0.005935
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
230dc5ad2d1f4d4b4c41f7779da212f3ee62b769
169
py
Python
stackstate_checks_dev/stackstate_checks/dev/tooling/__main__.py
CTAC-unixsupport/stackstate-agent-integrations
9ac167e182e69d035a09bedec9bbceb135e2727b
[ "BSD-3-Clause" ]
2
2020-03-10T13:21:37.000Z
2021-04-01T07:52:16.000Z
stackstate_checks_dev/stackstate_checks/dev/tooling/__main__.py
DennisLoos/stackstate-agent-integrations
8a8cc1607a8f1b8560e450d15cefa0d8d1227674
[ "BSD-3-Clause" ]
33
2020-02-05T16:18:32.000Z
2022-03-21T14:08:04.000Z
stackstate_checks_dev/stackstate_checks/dev/tooling/__main__.py
DennisLoos/stackstate-agent-integrations
8a8cc1607a8f1b8560e450d15cefa0d8d1227674
[ "BSD-3-Clause" ]
7
2020-03-10T13:21:39.000Z
2021-03-11T07:16:44.000Z
# (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import sys from .cli import checksdev sys.exit(checksdev())
18.777778
59
0.739645
26
169
4.807692
0.846154
0
0
0
0
0
0
0
0
0
0
0.035461
0.16568
169
8
60
21.125
0.851064
0.591716
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
2316debee737705dfd4da69ca96a4d1add85841b
23,708
py
Python
mafipy/function/black_scholes.py
i05nagai/mafipy
ea7312065b8abea4c7054203176269637ff346ca
[ "MIT" ]
6
2017-01-15T05:05:09.000Z
2020-12-29T20:03:37.000Z
mafipy/function/black_scholes.py
i05nagai/mafipy
ea7312065b8abea4c7054203176269637ff346ca
[ "MIT" ]
77
2016-12-03T12:54:42.000Z
2018-06-15T14:44:14.000Z
mafipy/function/black_scholes.py
i05nagai/mafipy
ea7312065b8abea4c7054203176269637ff346ca
[ "MIT" ]
3
2016-12-17T11:09:38.000Z
2017-11-05T09:15:02.000Z
from __future__ import division, print_function, absolute_import import math import numpy as np import scipy.special import mafipy.function # ---------------------------------------------------------------------------- # Black scholes european call/put # ---------------------------------------------------------------------------- def _is_d1_or_d2_infinity(underlying, strike, vol): """is_d1_or_d2_infinity :param float underlying: :param float strike: :param float vol: :return: check whether :math:`d_{1}` and :math:`d_{2}` is infinity or not. :rtype: bool """ return (np.isclose(underlying, 0.0) or strike < 0.0 or vol < 0.0) def func_d1(underlying, strike, rate, maturity, vol): """func_d1 calculate :math:`d_{1}` in black scholes formula. See :py:func:`black_scholes_call_formula`. :param float underlying: underlying/strike must be non-negative. :param float strike: underlying/strike must be non-negative. :param float rate: :param float maturity: must be non-negative. :param float vol: must be non-negative. :return: :math:`d_{1}`. :rtype: float """ assert(underlying / strike >= 0.0) assert(maturity >= 0.0) assert(vol >= 0.0) numerator = ( math.log(underlying / strike) + (rate + vol * vol * 0.5) * maturity) denominator = vol * math.sqrt(maturity) return numerator / denominator def func_d2(underlying, strike, rate, maturity, vol): """func_d2 calculate :math:`d_{2}` in black scholes formula. See :py:func:`black_scholes_call_formula`. :param float underlying: underlying/strike must be non-negative. :param float strike: underlying/strike must be non-negative. :param float rate: :param float maturity: must be non-negative. :param float vol: must be non-negative. :return: :math:`d_{2}`. :rtype: float. """ assert(underlying / strike >= 0.0) assert(maturity >= 0.0) assert(vol >= 0.0) numerator = ( math.log(underlying / strike) + (rate - vol * vol * 0.5) * maturity) denominator = vol * math.sqrt(maturity) return numerator / denominator def d_fprime_by_strike(underlying, strike, rate, maturity, vol): """d_fprime_by_strike derivative of :math:`d_{1}` with respect to :math:`K` where :math:`K` is strike. See :py:func:`func_d1`. .. math:: \\frac{\partial }{\partial K} d_{1}(K) = \\frac{K}{\sigma S \sqrt{T}}. Obviously, derivative of :math:`d_{1}` and :math:`d_{2}` is same. That is .. math:: \\frac{\partial }{\partial K} d_{1}(K) = \\frac{\partial }{\partial K} d_{2}(K). :param float underlying: :param float strike: :param float rate: :param float maturity: must be non-negative. :param float vol: :return: value of derivative. :rtype: float """ assert(maturity > 0.0) return - 1.0 / (math.sqrt(maturity) * vol * strike) def d_fhess_by_strike(underlying, strike, rate, maturity, vol): """d_fhess_by_strike second derivative of :math:`d_{i}\ (i = 1, 2)` with respect to :math:`K`, where :math:`K` is strike. .. math:: \\frac{\partial^{2}}{\partial K^{2}} d_{1}(K) = \\frac{1}{S \sigma \sqrt{T} }, where :math:`S` is underlying, :math:`\sigma` is vol, :math:`T` is maturity. :param float underlying: :param float strike: :param float rate: :param float maturity: :param float vol: :return: value of second derivative of :math:`d_{1}` or :math:`d_{2}`. :rtype: float """ assert(maturity > 0.0) return 1.0 / (math.sqrt(maturity) * vol * strike * strike) def black_scholes_call_formula(underlying, strike, rate, maturity, vol): """black_scholes_call_formula calculate well known black scholes formula for call option. .. math:: c(S, K, r, T, \sigma) := S N(d_{1}) - K e^{-rT} N(d_{2}), where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is vol, :math:`N(\cdot)` is standard normal distribution, and :math:`d_{1}` and :math:`d_{2}` are defined as follows: .. math:: \\begin{eqnarray} d_{1} & = & \\frac{\ln(S/K) + (r + \sigma^{2}/2)T}{\sigma \sqrt{T}}, \\ d_{2} & = & \\frac{\ln(S/K) + (r - \sigma^{2}/2)T} {\sigma \sqrt{T}}, \end{eqnarray} :param float underlying: value of underlying. :param float strike: strike of call option. :param float rate: risk free rate. :param float maturity: year fraction to maturity. :param float vol: volatility. :return: call value. :rtype: float """ d1 = func_d1(underlying, strike, rate, maturity, vol) d2 = func_d2(underlying, strike, rate, maturity, vol) return (underlying * scipy.special.ndtr(d1) - strike * math.exp(-rate * maturity) * scipy.special.ndtr(d2)) def black_scholes_put_formula(underlying, strike, rate, maturity, vol): """black_scholes_put_formula calculate well known black scholes formula for put option. Here value of put option is calculated by put-call parity. .. math:: \\begin{array}{cccl} & e^{-rT}(S - K) & = & c(S, K, r, T, \sigma) - p(S, K, r, T, \sigma) \\\\ \iff & p(S, K, r, T, \sigma) & = & c(S, K, r, T, \sigma) - e^{-rT}(S - K) \end{array} where :math:`c(\cdot)` denotes value of call option, :math:`p(\cdot)` denotes value of put option, :math:`S` is value of underlying at today, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is vol. :math:`c(\cdot)` is calculated by :py:func:`black_scholes_call_formula`. :param float underlying: value of underlying. :param float strike: strike of put option. :param float rate: risk free rate. :param float maturity: year fraction to maturity. :param float vol: volatility. :return: put value. :rtype: float """ call_value = black_scholes_call_formula( underlying, strike, rate, maturity, vol) discount = math.exp(-rate * maturity) return call_value - (underlying - strike * discount) def black_scholes_call_value( underlying, strike, rate, maturity, vol, today=0.0): """black_scholes_call_value calculate call value in the case of today is not zero. (`maturity` - `today`) is treated as time to expiry. See :py:func:`black_scholes_call_formula`. * case :math:`S > 0, K < 0` * return :math:`S - e^{-rT} K` * case :math:`S < 0, K > 0` * return 0 * case :math:`S < 0, K < 0` * return :math:`S - e^{-rT}K + E[(-(S - K))^{+}]` * case :math:`T \le 0` * return 0 :param float underlying: :param float strike: :param float rate: :param float maturity: :param float vol: volatility. This must be positive. :param float today: :return: call value. :rtype: float """ assert(vol >= 0.0) time = maturity - today # option is expired if time < 0.0 or np.isclose(time, 0.0): return 0.0 elif np.isclose(underlying, 0.0): return math.exp(-rate * time) * max(-strike, 0.0) elif np.isclose(strike, 0.0) and underlying > 0.0: return math.exp(-rate * today) * underlying elif np.isclose(strike, 0.0) and underlying < 0.0: return 0.0 # never below strike elif strike < 0.0 and underlying > 0.0: return underlying - math.exp(-rate * time) * strike # never beyond strike elif strike > 0.0 and underlying < 0.0: return 0.0 elif underlying < 0.0: # max(S - K, 0) = (S - K) + max(-(S - K), 0) value = black_scholes_call_formula( -underlying, -strike, rate, time, vol) return (underlying - strike) + value return black_scholes_call_formula( underlying, strike, rate, time, vol) def black_scholes_put_value( underlying, strike, rate, maturity, vol, today=0.0): """black_scholes_put_value evaluates value of put option using put-call parity so that this function calls :py:func:`black_scholes_call_value`. See :py:func:`black_scholes_put_formula`. :param float underlying: :param float strike: :param float rate: :param float maturity: :param float vol: :param float today: :return: put value. :rtype: float """ time = maturity - today # option is expired if time < 0.0 or np.isclose(time, 0.0): return 0.0 elif np.isclose(strike, 0.0) and underlying > 0.0: return 0.0 elif np.isclose(strike, 0.0) and underlying < 0.0: return underlying * math.exp(-rate * today) call_value = black_scholes_call_value( underlying, strike, rate, maturity, vol, today) discount = math.exp(-rate * time) return call_value - (underlying - strike * discount) def black_scholes_call_value_fprime_by_strike( underlying, strike, rate, maturity, vol): """black_scholes_call_value_fprime_by_strike First derivative of value of call option with respect to strike under black scholes model. See :py:func:`black_scholes_call_formula`. .. math:: \\frac{\partial }{\partial K} c(K; S, r, T, \sigma) = - e^{-rT} \Phi(d_{1}(K)) where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is vol, :math:`d_{1}, d_{2}` is defined in :py:func:`black_scholes_call_formula`, :math:`\Phi(\cdot)` is c.d.f. of standard normal distribution, :math:`\phi(\cdot)` is p.d.f. of standard normal distribution. :param float underlying: :param float strike: :param float rate: :param float maturity: must be non-negative. :param float vol: volatility. must be non-negative. :return: value of derivative. :rtype: float """ norm = scipy.stats.norm assert(maturity > 0.0) d2 = func_d2(underlying, strike, rate, maturity, vol) discount = math.exp(-rate * maturity) return -discount * norm.cdf(d2) def black_scholes_call_value_fhess_by_strike( underlying, strike, rate, maturity, vol): """black_scholes_call_value_fhess_by_strike Second derivative of value of call option with respect to strike under black scholes model. See :py:func:`black_scholes_call_formula` and :py:func:`black_scholes_call_value_fprime_by_strike`. .. math:: \\begin{array}{ccl} \\frac{\partial^{2}}{\partial K^{2}} c(0, S; T, K) & = & -e^{-rT} \phi(d_{2}(K)) d^{\prime}(K) \end{array} where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is vol, :math:`d_{1}, d_{2}` is defined in :py:func:`black_scholes_call_formula`, :math:`\Phi(\cdot)` is c.d.f. of standard normal distribution, :math:`\phi(\cdot)` is p.d.f. of standard normal distribution. :param float underlying: :param float strike: :param float rate: :param float maturity: non-negative. :param float vol: volatility. non-negative. :return: value of second derivative. :rtype: float. """ norm = scipy.stats.norm # option is expired if maturity < 0.0 or np.isclose(maturity, 0.0): return 0.0 # never below strike elif strike <= 0.0 and underlying > 0.0: return 0.0 # never beyond strike elif strike > 0.0 and underlying < 0.0: return 0.0 elif underlying < 0.0 and strike < 0.0: underlying = -underlying strike = -strike discount = math.exp(-rate * maturity) d2 = func_d2(underlying, strike, rate, maturity, vol) d_fprime = d_fprime_by_strike(underlying, strike, rate, maturity, vol) d2_density = norm.pdf(d2) return -discount * d2_density * d_fprime def black_scholes_call_value_third_by_strike( underlying, strike, rate, maturity, vol): """black_scholes_call_value_third_by_strike Third derivative of value of call option with respect to strike under black scholes model. See :py:func:`black_scholes_call_formula` and :py:func:`black_scholes_call_value_fprime_by_strike`, and :py:func:`black_scholes_call_value_fhess_by_strike`. .. math:: \\begin{array}{ccl} \\frac{\partial^{3}}{\partial K^{3}} c(0, S; T, K) & = & -e^{-rT} \left( \phi^{\prime}(d_{2}(K))(d^{\prime}(K))^{2} + \phi(d_{2}(K))d^{\prime\prime}(K) \\right) \end{array} where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is vol, :math:`d_{1}, d_{2}` is defined in :py:func:`black_scholes_call_formula`, :math:`\Phi(\cdot)` is c.d.f. of standard normal distribution, :math:`\phi(\cdot)` is p.d.f. of standard normal distribution. :param float underlying: :param float strike: :param float rate: :param float maturity: non-negative. :param float vol: volatility. non-negative. :return: value of third derivative. :rtype: float. """ norm = scipy.stats.norm assert(vol > 0.0) # option is expired if maturity < 0.0 or np.isclose(maturity, 0.0): return 0.0 discount = math.exp(-rate * maturity) d2 = func_d2(underlying, strike, rate, maturity, vol) d_fprime = d_fprime_by_strike(underlying, strike, rate, maturity, vol) d_fhess = d_fhess_by_strike(underlying, strike, rate, maturity, vol) d2_density = norm.pdf(d2) d2_density_fprime = mafipy.function.norm_pdf_fprime(d2) term1 = d2_density_fprime * d_fprime * d_fprime term2 = d2_density * d_fhess return -discount * (term1 + term2) # ---------------------------------------------------------------------------- # Black scholes greeks # ---------------------------------------------------------------------------- def black_scholes_call_delta(underlying, strike, rate, maturity, vol): """black_scholes_call_delta calculates black scholes delta. .. math:: \\frac{\partial}{\partial S} c(S, K, r, T, \sigma) = \Phi(d_{1}(S)) where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is volatility, :math:`\Phi` is standard normal c.d.f, :math:`d_{1}` is defined in :py:func:`func_d1`. :param float underlying: :param float strike: :param float rate: :param float maturity: if maturity <= 0, this function returns 0. :param float vol: volatility. This must be positive. :return: value of delta. :rtype: float. """ assert(vol >= 0.0) if maturity <= 0.0: return 0.0 d1 = func_d1(underlying, strike, rate, maturity, vol) return scipy.stats.norm.cdf(d1) def black_scholes_call_gamma(underlying, strike, rate, maturity, vol): """black_scholes_call_gamma calculates black scholes gamma. .. math:: \\frac{\partial^{2}}{\partial S^{2}} c(S, K, r, T, \sigma) = -\phi(d_{1}(S, K, r, T, \sigma)) \\frac{1}{S^{2}\sigma\sqrt{T}} where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is volatility, :math:`\Phi` is standard normal c.d.f, :math:`d_{1}` is defined in :py:func:`func_d1`. See :py:func:`black_scholes_call_value`. :param float underlying: :param float strike: :param float rate: :param float maturity: if maturity is not positive, this function returns 0.0. :param float vol: volatility. This must be positive. :return: value of gamma. :rtype: float. """ assert(vol >= 0.0) if maturity <= 0.0: return 0.0 d1 = func_d1(underlying, strike, rate, maturity, vol) denominator = underlying * vol * math.sqrt(maturity) return scipy.stats.norm.pdf(d1) / denominator def black_scholes_call_vega(underlying, strike, rate, maturity, vol): """black_scholes_call_vega calculates black scholes vega. .. math:: \\frac{\partial}{\partial \sigma} c(S, K, r, T, \sigma) = \sqrt{T}S\phi(d_{1}(S, K, r, T, \sigma)) where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is volatility, :math:`\phi` is standard normal p.d.f, :math:`d_{1}` is defined in :py:func:`func_d1`. See :py:func:`black_scholes_call_value`. :param float underlying: :param float strike: :param float rate: :param float maturity: if maturity <= 0.0, this function returns 0. :param float vol: volatility. This must be positive. :return: value of vega. :rtype: float. """ assert(vol >= 0.0) if maturity <= 0.0: return 0.0 d1 = func_d1(underlying, strike, rate, maturity, vol) return math.sqrt(maturity) * underlying * scipy.stats.norm.pdf(d1) def black_scholes_call_volga(underlying, strike, rate, maturity, vol): """black_scholes_call_volg calculates black scholes volga. .. math:: \\frac{\partial^{2}}{\partial \sigma^{2}} c(S, K, r, T, \sigma) S \phi^{\prime}(d_{1}(\sigma)) \\frac{ (\\frac{1}{2} \sigma^{2} - r)T }{ \sigma^{2} } where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is volatility, :math:`\phi` is standard normal p.d.f, :math:`d_{1}` is defined in :py:func:`func_d1`. See :py:func:`black_scholes_call_value`. :param float underlying: :param float strike: :param float rate: :param float maturity: must be non-negative. :param float vol: volatility. This must be positive. :return: value of volga. :rtype: float. """ assert(vol >= 0.0) if maturity < 0.0: return 0.0 d1 = func_d1(underlying, strike, rate, maturity, vol) pdf_fprime = mafipy.function.norm_pdf_fprime(d1) ln_moneyness = math.log(underlying / strike) numerator = -ln_moneyness + (0.5 * vol * vol - rate) * maturity factor = numerator / (vol * vol) return underlying * pdf_fprime * factor def black_scholes_call_theta(underlying, strike, rate, maturity, vol, today): """black_scholes_call_theta calculates black scholes theta. .. math:: \\frac{\partial}{\partial t} c(t, S, K, r, T, \sigma) = - S * \phi(d_{1}) \left( \\frac{\sigma}{2\sqrt{T - t}} \\right) - r e^{-r(T - t)} K \Phi(d_{2}) where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is volatility, :math:`\phi` is standard normal p.d.f, :math:`d_{1}` is defined in :py:func:`func_d1`. See :py:func:`black_scholes_call_value`. :param float underlying: :param float strike: :param float rate: :param float maturity: must be non-negative. :param float vol: volatility. This must be positive. :return: value of theta. :rtype: float. """ assert(maturity >= 0.0) assert(vol >= 0.0) norm = scipy.stats.norm time = maturity - today d1 = func_d1(underlying, strike, rate, time, vol) d2 = func_d2(underlying, strike, rate, time, vol) term1 = underlying * norm.pdf(d1) * (vol / (2.0 * math.sqrt(time))) term2 = rate * math.exp(-rate * time) * strike * norm.cdf(d2) return - term1 - term2 def black_scholes_call_rho(underlying, strike, rate, maturity, vol, today): """black_scholes_call_rho calculates black scholes rho. .. math:: \\frac{\partial}{\partial t} c(t, S, K, r, T, \sigma) = (T - t) e^{-r (T - t)} K \Phi(d_{2}) where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is volatility, :math:`\phi` is standard normal p.d.f, :math:`d_{2}` is defined in :py:func:`func_d2`. See :py:func:`black_scholes_call_value`. :param float underlying: :param float strike: :param float rate: :param float maturity: must be non-negative. :param float vol: volatility. This must be positive. :return: value of rho. :rtype: float. """ assert(maturity >= 0.0) assert(vol >= 0.0) norm = scipy.stats.norm time = maturity - today d2 = func_d2(underlying, strike, rate, time, vol) return time * math.exp(-rate * time) * strike * norm.cdf(d2) def black_scholes_call_vega_fprime_by_strike( underlying, strike, rate, maturity, vol): """black_scholes_call_vega_fprime_by_strike calculates derivative of black scholes vega with respect to strike. This is required for :py:func:`sabr_pdf`. .. math:: \\frac{\partial}{\partial K} \mathrm{Vega}{\mathrm{BSCall}}(S, K, r, T, \sigma) = S\phi^{\prime}(d_{1}(S, K, r, T, \sigma)) \\frac{1}{\sigma K} where :math:`S` is underlying, :math:`K` is strike, :math:`r` is rate, :math:`T` is maturity, :math:`\sigma` is volatility, :math:`\phi` is standard normal p.d.f, :math:`d_{1}` is defined in :py:func:`func_d1`. See :py:func:`black_scholes_call_value`. :param float underlying: :param float strike: :param float rate: :param float maturity: if maturity <= 0.0, this function returns 0. :param float vol: volatility. This must be positive. :return: derivative of vega with respect to strike. :rtype: float. """ assert(vol >= 0.0) if maturity <= 0.0: return 0.0 d1 = func_d1(underlying, strike, rate, maturity, vol) density_fprime = mafipy.function.norm_pdf_fprime(d1) return -underlying * density_fprime / (vol * strike) # ---------------------------------------------------------------------------- # Black scholes distributions # ---------------------------------------------------------------------------- def black_scholes_cdf(underlying, strike, rate, maturity, vol): """black_scholes_cdf calculates value of c.d.f. of black scholes model. :param float underlying: :param float strike: :param float rate: :param float maturity: :param float vol: must be positive. :return: value of p.d.f. of black scholes model. :rtype: float. """ assert(vol > 0.0) return (1.0 + black_scholes_call_value_fprime_by_strike( underlying, strike, rate, maturity, vol) * math.exp(rate * maturity)) def black_scholes_pdf(underlying, strike, rate, maturity, vol): """black_scholes_pdf calculates value of p.d.f. of black scholes model. :param float underlying: :param float strike: :param float rate: :param float maturity: :param float vol: must be positive. :return: value of p.d.f. of black scholes model. :rtype: float. """ assert(vol > 0.0) return (black_scholes_call_value_fhess_by_strike( underlying, strike, rate, maturity, vol) * math.exp(rate * maturity))
29.858942
78
0.591277
3,229
23,708
4.23227
0.053887
0.076833
0.058539
0.075809
0.831919
0.78816
0.767306
0.718645
0.660032
0.618469
0
0.018649
0.255863
23,708
793
79
29.896595
0.75598
0.57934
0
0.576531
0
0
0
0
0
0
0
0
0.112245
1
0.107143
false
0
0.02551
0
0.336735
0.005102
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
2317314f7c09f8f3a1a8f02519fe5fbfb22682c4
581
py
Python
impls/Implements.py
SyouEthernet/AutoExecutor
deeeea389a70aa5519a0b957df8dd7f345ef0645
[ "Apache-2.0" ]
null
null
null
impls/Implements.py
SyouEthernet/AutoExecutor
deeeea389a70aa5519a0b957df8dd7f345ef0645
[ "Apache-2.0" ]
null
null
null
impls/Implements.py
SyouEthernet/AutoExecutor
deeeea389a70aa5519a0b957df8dd7f345ef0645
[ "Apache-2.0" ]
null
null
null
from exceptionHanlder import Handler as Handler from executor import Executor as Executor # 此文件中完成具体操作逻辑 class ExecutorImpl(Executor.Executor): def preExecute(self): # ... return True def onExecute(self): # ... return True def onFinished(self): # ... return True class ExceptionHandler(Handler.ErrorHandler): def handlePreExecuteFail(self): # ... return True def handleExecuteError(self): # ... return True def handleFinishedError(self): # ... return True
20.034483
47
0.604131
51
581
6.882353
0.411765
0.17094
0.239316
0.193732
0
0
0
0
0
0
0
0
0.30809
581
29
48
20.034483
0.873134
0.061962
0
0.375
0
0
0
0
0
0
0
0
0
1
0.375
false
0
0.125
0.375
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
1
0
0
0
1
1
0
0
5
23258e850145fc4676542c04fbb47c3437f8f9a1
41
py
Python
tests/test.py
Philinphiladelphia/uwu
531843b8663d3342ccaf0089bfe8734d95fdecb9
[ "MIT" ]
null
null
null
tests/test.py
Philinphiladelphia/uwu
531843b8663d3342ccaf0089bfe8734d95fdecb9
[ "MIT" ]
null
null
null
tests/test.py
Philinphiladelphia/uwu
531843b8663d3342ccaf0089bfe8734d95fdecb9
[ "MIT" ]
null
null
null
import uwuizer uwuizer.owoize("hello")
13.666667
23
0.756098
5
41
6.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.121951
41
3
23
13.666667
0.861111
0
0
0
0
0
0.125
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
232f2b72dfba6d9b2b8744d869f7d4c68f0c1121
294
py
Python
survae/flows/__init__.py
robert-giaquinto/survae_flows
4d7dc638f77c48ad3c8393b967c33ac9dbad60fe
[ "MIT" ]
2
2021-03-06T19:37:39.000Z
2022-01-09T11:19:45.000Z
survae/flows/__init__.py
robert-giaquinto/survae_flows
4d7dc638f77c48ad3c8393b967c33ac9dbad60fe
[ "MIT" ]
null
null
null
survae/flows/__init__.py
robert-giaquinto/survae_flows
4d7dc638f77c48ad3c8393b967c33ac9dbad60fe
[ "MIT" ]
null
null
null
from .flow import Flow from .inverse_flow import InverseFlow from .cond_flow import ConditionalFlow from .cond_inverse_flow import ConditionalInverseFlow from .compressive_flow import CompressiveFlow from .boosted_flow import BoostedFlow from .cond_boosted_flow import ConditionalBoostedFlow
29.4
53
0.87415
36
294
6.916667
0.361111
0.281125
0.136546
0
0
0
0
0
0
0
0
0
0.102041
294
9
54
32.666667
0.943182
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
2349dc34566363d9569b016599a47588b0bca93d
72
py
Python
BZOJ/BZOJ1876.py
HeRaNO/OI-ICPC-Codes
4a4639cd3e347b472520065ca6ab8caadde6906d
[ "MIT" ]
18
2019-01-01T13:16:59.000Z
2022-02-28T04:51:50.000Z
BZOJ/BZOJ1876.py
HeRaNO/OI-ICPC-Codes
4a4639cd3e347b472520065ca6ab8caadde6906d
[ "MIT" ]
null
null
null
BZOJ/BZOJ1876.py
HeRaNO/OI-ICPC-Codes
4a4639cd3e347b472520065ca6ab8caadde6906d
[ "MIT" ]
5
2019-09-13T08:48:17.000Z
2022-02-19T06:59:03.000Z
a,b=input(),input() c=a%b while c!=0L: a=b b=c c=a%b print b
10.285714
19
0.5
19
72
1.894737
0.368421
0.222222
0.166667
0
0
0
0
0
0
0
0
0.019231
0.277778
72
7
20
10.285714
0.673077
0
0
0.285714
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.142857
1
0
1
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
1
0
0
0
0
0
0
0
0
5
2382369da638fba9be17f80ecde5950c84ddefe4
154
py
Python
tests/test_project/app_correct/models.py
christianbundy/django-migration-linter
3f0531f349c4c237a5ff1afd594956a58103dc5d
[ "Apache-2.0" ]
357
2017-04-05T20:50:31.000Z
2022-03-16T01:37:13.000Z
tests/test_project/app_correct/models.py
christianbundy/django-migration-linter
3f0531f349c4c237a5ff1afd594956a58103dc5d
[ "Apache-2.0" ]
146
2017-04-06T14:14:26.000Z
2022-03-28T18:02:53.000Z
tests/test_project/app_correct/models.py
christianbundy/django-migration-linter
3f0531f349c4c237a5ff1afd594956a58103dc5d
[ "Apache-2.0" ]
45
2017-10-31T16:25:22.000Z
2022-02-24T22:13:37.000Z
from django.db import models class A(models.Model): null_field = models.IntegerField(null=True) new_null_field = models.IntegerField(null=True)
22
51
0.75974
22
154
5.181818
0.590909
0.157895
0.263158
0.473684
0.614035
0.614035
0
0
0
0
0
0
0.142857
154
6
52
25.666667
0.863636
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
2382700a0794a70ab4ca71302094a9eda41d6538
21
py
Python
leetcode/p4.py
holmescn/practice
edd992a309d1413baf7e2b9bed31ece6cb242fde
[ "MIT" ]
null
null
null
leetcode/p4.py
holmescn/practice
edd992a309d1413baf7e2b9bed31ece6cb242fde
[ "MIT" ]
null
null
null
leetcode/p4.py
holmescn/practice
edd992a309d1413baf7e2b9bed31ece6cb242fde
[ "MIT" ]
null
null
null
def f(m, n, mb, me):
10.5
20
0.47619
6
21
1.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.238095
21
1
21
21
0.625
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
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
1
0
0
0
0
0
0
0
0
5
000dd4e8e0525cc12c0feb402dc883a8300f08ab
44
py
Python
run.py
alexchamberlain/city-api
f29c41c08dc7c130f5a66c1ca2c1a1d2b87f3755
[ "MIT" ]
3
2018-06-12T08:52:45.000Z
2019-04-18T04:54:28.000Z
run.py
alexchamberlain/city-api
f29c41c08dc7c130f5a66c1ca2c1a1d2b87f3755
[ "MIT" ]
null
null
null
run.py
alexchamberlain/city-api
f29c41c08dc7c130f5a66c1ca2c1a1d2b87f3755
[ "MIT" ]
null
null
null
from cities import app app.run(debug=True)
11
22
0.772727
8
44
4.25
0.875
0
0
0
0
0
0
0
0
0
0
0
0.136364
44
3
23
14.666667
0.894737
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
cc608549aa378f917ffa8aaa50d42d3a4a077c80
585
py
Python
data-hub-api/apps/cdms_api/tests/integration/test_env.py
uktrade/data-hub-api-old
5ecf093d88692870982a638ced45de6a82d55672
[ "MIT" ]
null
null
null
data-hub-api/apps/cdms_api/tests/integration/test_env.py
uktrade/data-hub-api-old
5ecf093d88692870982a638ced45de6a82d55672
[ "MIT" ]
18
2016-04-04T12:42:45.000Z
2016-09-01T07:21:05.000Z
data-hub-api/apps/cdms_api/tests/integration/test_env.py
uktrade/data-hub-api-old
5ecf093d88692870982a638ced45de6a82d55672
[ "MIT" ]
1
2016-06-01T15:45:21.000Z
2016-06-01T15:45:21.000Z
from django.conf import settings from django.test import TestCase from ..decorators import skipIntegration @skipIntegration class TestEnv(TestCase): def test_happy(self): """ Non-Default values for settings are loaded Vanilla MSDCRM11 needs custom configuration - if the defaults from settings are in place then tests will fail. """ self.assertNotEqual(settings.CDMS_BASE_URL, 'https://example.com') self.assertNotEqual(settings.CDMS_USERNAME, 'username') self.assertNotEqual(settings.CDMS_PASSWORD, 'password')
29.25
74
0.71453
67
585
6.164179
0.641791
0.130751
0.188862
0.217918
0
0
0
0
0
0
0
0.00432
0.208547
585
19
75
30.789474
0.887689
0.263248
0
0
0
0
0.089514
0
0
0
0
0
0.333333
1
0.111111
false
0.111111
0.333333
0
0.555556
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
0
1
1
0
1
0
0
5
aea46a66886160cabda7cd27fc945f42d2890ebf
20
py
Python
hello word.py
fmweendyy/Mi-Primer-Repositorio-3A
e71e30624160de220ac5af41d80ffff1dc8cce86
[ "MIT" ]
null
null
null
hello word.py
fmweendyy/Mi-Primer-Repositorio-3A
e71e30624160de220ac5af41d80ffff1dc8cce86
[ "MIT" ]
null
null
null
hello word.py
fmweendyy/Mi-Primer-Repositorio-3A
e71e30624160de220ac5af41d80ffff1dc8cce86
[ "MIT" ]
null
null
null
print(holamundo3a)
10
19
0.8
2
20
8
1
0
0
0
0
0
0
0
0
0
0
0.055556
0.1
20
1
20
20
0.833333
0
0
0
0
0
0
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
4e04dd3326130f71adeb70764a8787c5fda42cc4
55,772
py
Python
trendvisualizer/sector_mappings.py
GBERESEARCH/trendvisualizer
b7f3ecdb8a0a7421fa60beda32d629a813315897
[ "MIT" ]
2
2021-09-10T04:31:10.000Z
2021-11-15T11:02:11.000Z
trendvisualizer/sector_mappings.py
GBERESEARCH/trendvisualizer
b7f3ecdb8a0a7421fa60beda32d629a813315897
[ "MIT" ]
null
null
null
trendvisualizer/sector_mappings.py
GBERESEARCH/trendvisualizer
b7f3ecdb8a0a7421fa60beda32d629a813315897
[ "MIT" ]
1
2021-09-10T04:31:11.000Z
2021-09-10T04:31:11.000Z
# Commodity and Equity Sector mappings sectmap = { 'commodity_sector_mappings':{ '&6A_CCB':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'AUD'), # AUD '&6B_CCB':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'GBP'), # GBP '&6C_CCB':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'CAD'), # CAD '&6E_CCB':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'EUR'), # EUR '&6J_CCB':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'JPY'), # JPY '&6M_CCB':('Currencies', 'EM Currencies', 'EM Currencies', 'EM Currencies', 'MXN'), # MXN '&6N_CCB':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'NZD'), # NZD '&6S_CCB':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'CHF'), # CHF '&AFB_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Eastern Australia Feed Barley'), # Eastern Australia Feed Barley '&AWM_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Eastern Australia Wheat'), # Eastern Australia Wheat '&BAX_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Canadian Bankers Acceptance'), # Canadian Bankers Acceptance '&BRN_CCB':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Brent Crude Oil'), # Brent Crude Oil '&BTC_CCB':('Currencies', 'Crypto Currencies', 'Crypto Currencies', 'Crypto Currencies', 'Bitcoin'), # Bitcoin '&CC_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Cocoa'), # Cocoa '&CGB_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Canadian 10y'), # Canadian 10 Yr Govt Bond '&CL_CCB':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Crude Oil - Light Sweet'), # Crude Oil - Light Sweet '&CT_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Cotton #2'), # Cotton #2 '&DC_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Milk - Class III'), # Milk - Class III '&DX_CCB':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'Benchmark'), # US Dollar Index '&EH_CCB':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Ethanol'), # Ethanol '&EMD_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'S&P MidCap 400 E-mini'), # S&P MidCap 400 E-mini '&ES_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'S&P 500 E-mini'), # S&P 500 E-mini '&EUA_CCB':('Commodities', 'Energy', 'Energy', 'Energy', 'EUA (Carbon Emissions)'), # EUA (Carbon Emissions) '&FBTP_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-BTP Long Term'), # Euro-BTP Long Term '&FCE_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'CAC 40'), # CAC 40 '&FDAX_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'DAX'), # DAX '&FDAX9_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'DAX'), # DAX, Last in Close field '&FESX_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'EURO STOXX 50'), # EURO STOXX 50 '&FESX9_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'EURO STOXX 50'), # EURO STOXX 50, Last in Close field '&FGBL_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-Bund - 10 Yr'), # Euro-Bund - 10 Yr '&FGBM_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-Bobl - 5 Yr'), # Euro-Bobl - 5 Yr '&FGBS_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-Schatz - 2 Yr'), # Euro-Schatz - 2 Yr '&FGBX_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-Buxl - 30 Yr'), # Euro-Buxl - 30 Yr '&FOAT_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euro-OAT Continuous Contract'), # Euro-OAT Continuous Contract '&FOAT9_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euro-OAT(L) Continuous Contract'), # Euro-OAT(L) Continuous Contract '&FSMI_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Swiss Market Index'), # Swiss Market Index '&FTDX_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'TecDAX'), # TecDAX '&GAS_CCB':('Commodities', 'Energy', 'Energy', 'Energy', 'Gas Oil'), # Gas Oil '&GC_CCB':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Gold'), # Gold '&GD_CCB':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # GS&P GSCI '&GE_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Eurodollar'), # Eurodollar '&GF_CCB':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Feeder Cattle'), # Feeder Cattle '&GWM_CCB':('Commodities', 'Energy', 'Energy', 'Energy', 'UK Natural Gas'), # UK Natural Gas '&HE_CCB':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Lean Hogs'), # Lean Hogs '&HG_CCB':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Copper'), # Copper '&HO_CCB':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'NY Harbor ULSD'), # NY Harbor ULSD '&HSI_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Hang Seng Index'), # Hang Seng Index '&HTW_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'MSCI Taiwan Index'), # MSCI Taiwan Index '&KC_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Coffee C'), # Coffee C '&KE_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'KC HRW Wheat'), # KC HRW Wheat '&KOS_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'KOSPI 200'), # KOSPI 200 '&LBS_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Lumber'), # Lumber '&LCC_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'London Cocoa'), # London Cocoa '&LE_CCB':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Live Cattle'), # Live Cattle '&LES_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euro Swiss'), # Euro Swiss '&LEU_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euribor'), # Euribor '&LEU9_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euribor'), # Euribor, Official Close '&LFT_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'FTSE 100'), # FTSE 100 '&LFT9_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'FTSE 100'), # FTSE 100, Official Close '&LLG_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Long Gilt'), # Long Gilt '&LRC_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Robusta Coffee'), # Robusta Coffee '&LSS_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Short Sterling'), # Short Sterling '&LSU_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'White Sugar'), # White Sugar '&LWB_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Feed Wheat'), # Feed Wheat '&MHI_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Hang Seng Index'), # Hang Seng Index - Mini '&MWE_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Hard Red Spring Wheat'), # Hard Red Spring Wheat '&NG_CCB':('Commodities', 'Energy', 'Energy', 'Energy', 'Henry Hub Natural Gas'), # Henry Hub Natural Gas '&NIY_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Nikkei 225'), # Nikkei 225 Yen '&NKD_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Nikkei 225'), # Nikkei 225 Dollar '&NQ_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Nasdaq-100 - E-mini'), # Nasdaq-100 - E-mini '&OJ_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Frozen Concentrated Orange Juice'), # Frozen Concentrated Orange Juice '&PA_CCB':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Palladium'), # Palladium '&PL_CCB':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Platinum'), # Platinum '&RB_CCB':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'RBOB Gasoline'), # RBOB Gasoline '&RS_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Canola'), # Canola '&RTY_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Russell 2000 - E-mini'), # Russell 2000 - E-mini '&SB_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Sugar No. 11'), # Sugar No. 11 '&SCN_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'FTSE China A50 Index'), # FTSE China A50 Index '&SI_CCB':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Silver'), # Silver '&SIN_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'SGX Nifty 50 Index'), # SGX Nifty 50 Index '&SJB_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Japanese Govt Bond - Mini'), # Japanese Govt Bond - Mini '&SNK_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Nikkei 225'), # Nikkei 225 (SGX) '&SP_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'S&P 500'), # S&P 500 '&SR3_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', '3M SOFR Continuous Contract'), # 3M SOFR Continuous Contract '&SSG_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'MSCI Singapore Index'), # MSCI Singapore Index '&STW_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'MSCI Taiwan Index'), # MSCI Taiwan Index, Discontinued '&SXF_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'S&P/TSX 60 Index'), # S&P/TSX 60 Index '&TN_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Ultra 10 Year U.S. T-Note'), # Ultra 10 Year U.S. T-Note '&UB_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Ultra U.S. T-Bond'), # Ultra U.S. T-Bond '&VX_CCB':('Volatility', 'Volatility', 'Volatility', 'Volatility', 'Cboe Volatility Index'), # Cboe Volatility Index '&WBS_CCB':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'WTI Crude Oil'), # WTI Crude Oil '&YAP_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'ASX SPI 200'), # ASX SPI 200 '&YAP4_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'ASX SPI 200'), # ASX SPI 200, Day '&YAP10_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'ASX SPI 200'), # ASX SPI 200, Night '&YG_CCB':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Gold - Mini'), # Gold - Mini '&YI_CCB':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Silver - Mini'), # Silver - Mini '&YIB_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'ASX 30 Day Interbank Cash Rate'), # ASX 30 Day Interbank Cash Rate '&YIR_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'ASX 90 Day Bank Accepted Bills'), # ASX 90 Day Bank Accepted Bills '&YM_CCB':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'E-mini Dow'), # E-mini Dow '&YXT_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'ASX 10 Year Treasury Bond'), # ASX 10 Year Treasury Bond '&YYT_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'ASX 3 Year Treasury Bond'), # ASX 3 Year Treasury Bond '&ZB_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'U.S. T-Bond'), # U.S. T-Bond '&ZC_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Corn'), # Corn '&ZF_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', '5-Year US T-Note'), # 5-Year US T-Note '&ZG_CCB':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Gold'), # Gold 100oz, Discountinued '&ZI_CCB':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Silver'), # Silver 5000oz, Discontinued '&ZL_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Soybean Oil'), # Soybean Oil '&ZM_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Soybean Meal'), # Soybean Meal '&ZN_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', '10-Year US T-Note'), # 10-Year US T-Note '&ZO_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Oats'), # Oats '&ZQ_CCB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', '30 Day Federal Funds'), # 30 Day Federal Funds '&ZR_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Rough Rice'), # Rough Rice '&ZS_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Soybeans'), # Soybeans '&ZT_CCB':('Bonds','Government Bonds','Government Bonds','Government Bonds', '2-Year US T-Note'), # 2-Year US T-Note '&ZW_CCB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Chicago SRW Wheat'), # Chicago SRW Wheat '&6A':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'AUD'), # AUD '&6B':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'GBP'), # GBP '&6C':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'CAD'), # CAD '&6E':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'EUR'), # EUR '&6J':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'JPY'), # JPY '&6M':('Currencies', 'EM Currencies', 'EM Currencies', 'EM Currencies', 'MXN'), # MXN '&6N':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'NZD'), # NZD '&6S':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'CHF'), # CHF '&AFB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Eastern Australia Feed Barley'), # Eastern Australia Feed Barley '&AWM':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Eastern Australia Wheat'), # Eastern Australia Wheat '&BAX':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Canadian Bankers Acceptance'), # Canadian Bankers Acceptance '&BRN':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Brent Crude Oil'), # Brent Crude Oil '&BTC':('Currencies', 'Crypto Currencies', 'Crypto Currencies', 'Crypto Currencies', 'Bitcoin'), # Bitcoin '&CC':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Cocoa'), # Cocoa '&CGB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Canadian 10y'), # Canadian 10 Yr Govt Bond '&CL':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Crude Oil - Light Sweet'), # Crude Oil - Light Sweet '&CT':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Cotton #2'), # Cotton #2 '&DC':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Milk - Class III'), # Milk - Class III '&DX':('Currencies', 'G10 Currencies', 'G10 Currencies', 'G10 Currencies', 'Benchmark'), # US Dollar Index '&EH':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Ethanol'), # Ethanol '&EMD':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'S&P MidCap 400 E-mini'), # S&P MidCap 400 E-mini '&ES':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'S&P 500 E-mini'), # S&P 500 E-mini '&EUA':('Commodities', 'Energy', 'Energy', 'Energy', 'EUA (Carbon Emissions)'), # EUA (Carbon Emissions) '&FBTP':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-BTP Long Term'), # Euro-BTP Long Term '&FCE':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'CAC 40'), # CAC 40 '&FDAX':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'DAX'), # DAX '&FDAX9':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'DAX'), # DAX, Last in Close field '&FESX':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'EURO STOXX 50'), # EURO STOXX 50 '&FESX9':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'EURO STOXX 50'), # EURO STOXX 50, Last in Close field '&FGBL':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-Bund - 10 Yr'), # Euro-Bund - 10 Yr '&FGBM':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-Bobl - 5 Yr'), # Euro-Bobl - 5 Yr '&FGBS':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-Schatz - 2 Yr'), # Euro-Schatz - 2 Yr '&FGBX':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Euro-Buxl - 30 Yr'), # Euro-Buxl - 30 Yr '&FOAT':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euro-OAT Continuous Contract'), # Euro-OAT Continuous Contract '&FOAT9':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euro-OAT(L) Continuous Contract'), # Euro-OAT(L) Continuous Contract '&FSMI':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Swiss Market Index'), # Swiss Market Index '&FTDX':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'TecDAX'), # TecDAX '&GAS':('Commodities', 'Energy', 'Energy', 'Energy', 'Gas Oil'), # Gas Oil '&GC':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Gold'), # Gold '&GD':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # GS&P GSCI '&GE':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Eurodollar'), # Eurodollar '&GF':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Feeder Cattle'), # Feeder Cattle '&GWM':('Commodities', 'Energy', 'Energy', 'Energy', 'UK Natural Gas'), # UK Natural Gas '&HE':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Lean Hogs'), # Lean Hogs '&HG':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Copper'), # Copper '&HO':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'NY Harbor ULSD'), # NY Harbor ULSD '&HSI':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Hang Seng Index'), # Hang Seng Index '&HTW':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'MSCI Taiwan Index'), # MSCI Taiwan Index '&KC':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Coffee C'), # Coffee C '&KE':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'KC HRW Wheat'), # KC HRW Wheat '&KOS':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'KOSPI 200'), # KOSPI 200 '&LBS':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Lumber'), # Lumber '&LCC':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'London Cocoa'), # London Cocoa '&LE':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Live Cattle'), # Live Cattle '&LES':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euro Swiss'), # Euro Swiss '&LEU':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euribor'), # Euribor '&LEU9':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Euribor'), # Euribor, Official Close '&LFT':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'FTSE 100'), # FTSE 100 '&LFT9':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'FTSE 100'), # FTSE 100, Official Close '&LLG':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Long Gilt'), # Long Gilt '&LRC':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Robusta Coffee'), # Robusta Coffee '&LSS':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'Short Sterling'), # Short Sterling '&LSU':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'White Sugar'), # White Sugar '&LWB':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Feed Wheat'), # Feed Wheat '&MHI':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Hang Seng Index'), # Hang Seng Index - Mini '&MWE':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Hard Red Spring Wheat'), # Hard Red Spring Wheat '&NG':('Commodities', 'Energy', 'Energy', 'Energy', 'Henry Hub Natural Gas'), # Henry Hub Natural Gas '&NIY':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Nikkei 225'), # Nikkei 225 Yen '&NKD':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Nikkei 225'), # Nikkei 225 Dollar '&NQ':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Nasdaq-100 - E-mini'), # Nasdaq-100 - E-mini '&OJ':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Frozen Concentrated Orange Juice'), # Frozen Concentrated Orange Juice '&PA':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Palladium'), # Palladium '&PL':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Platinum'), # Platinum '&RB':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'RBOB Gasoline'), # RBOB Gasoline '&RS':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Canola'), # Canola '&RTY':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Russell 2000 - E-mini'), # Russell 2000 - E-mini '&SB':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Sugar No. 11'), # Sugar No. 11 '&SCN':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'FTSE China A50 Index'), # FTSE China A50 Index '&SI':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Silver'), # Silver '&SIN':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'SGX Nifty 50 Index'), # SGX Nifty 50 Index '&SJB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Japanese Govt Bond - Mini'), # Japanese Govt Bond - Mini '&SNK':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'Nikkei 225'), # Nikkei 225 (SGX) '&SP':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'S&P 500'), # S&P 500 '&SR3':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', '3M SOFR Continuous Contract'), # 3M SOFR Continuous Contract '&SSG':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'MSCI Singapore Index'), # MSCI Singapore Index '&STW':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'MSCI Taiwan Index'), # MSCI Taiwan Index, Discontinued '&SXF':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'S&P/TSX 60 Index'), # S&P/TSX 60 Index '&TN':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Ultra 10 Year U.S. T-Note'), # Ultra 10 Year U.S. T-Note '&UB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'Ultra U.S. T-Bond'), # Ultra U.S. T-Bond '&VX':('Volatility', 'Volatility', 'Volatility', 'Volatility', 'Cboe Volatility Index'), # Cboe Volatility Index '&WBS':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'WTI Crude Oil'), # WTI Crude Oil '&YAP':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'ASX SPI 200'), # ASX SPI 200 '&YAP4':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'ASX SPI 200'), # ASX SPI 200, Day '&YAP10':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'ASX SPI 200'), # ASX SPI 200, Night '&YG':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Gold - Mini'), # Gold - Mini '&YI':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Silver - Mini'), # Silver - Mini '&YIB':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'ASX 30 Day Interbank Cash Rate'), # ASX 30 Day Interbank Cash Rate '&YIR':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', 'ASX 90 Day Bank Accepted Bills'), # ASX 90 Day Bank Accepted Bills '&YM':('Equity Indices', 'Equity Indices','Equity Indices','Equity Indices', 'E-mini Dow'), # E-mini Dow '&YXT':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'ASX 10 Year Treasury Bond'), # ASX 10 Year Treasury Bond '&YYT':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'ASX 3 Year Treasury Bond'), # ASX 3 Year Treasury Bond '&ZB':('Bonds','Government Bonds','Government Bonds','Government Bonds', 'U.S. T-Bond'), # U.S. T-Bond '&ZC':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Corn'), # Corn '&ZF':('Bonds','Government Bonds','Government Bonds','Government Bonds', '5-Year US T-Note'), # 5-Year US T-Note '&ZG':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Gold'), # Gold 100oz, Discountinued '&ZI':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Silver'), # Silver 5000oz, Discontinued '&ZL':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Soybean Oil'), # Soybean Oil '&ZM':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Soybean Meal'), # Soybean Meal '&ZN':('Bonds','Government Bonds','Government Bonds','Government Bonds', '10-Year US T-Note'), # 10-Year US T-Note '&ZO':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Oats'), # Oats '&ZQ':('Interest Rates', 'Interest Rates', 'Interest Rates', 'Interest Rates', '30 Day Federal Funds'), # 30 Day Federal Funds '&ZR':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Rough Rice'), # Rough Rice '&ZS':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Soybeans'), # Soybeans '&ZT':('Bonds','Government Bonds','Government Bonds','Government Bonds', '2-Year US T-Note'), # 2-Year US T-Note '&ZW':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Chicago SRW Wheat'), # Chicago SRW Wheat '#GSR':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Benchmark'), # Gold/Silver Ratio '$BCOM':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # Bloomberg Commodity Index '$BCOMAG':('Commodities','Diversified Agriculture', 'Agriculture', 'Agriculture', 'Benchmark'), # Bloomberg Agriculture Sub-Index '$BCOMEN':('Commodities', 'Energy', 'Energy', 'Energy', 'Benchmark'), # Bloomberg Energy Sub-Index '$BCOMGR':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Benchmark'), # Bloomberg Grains Sub-Index '$BCOMIN':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Benchmark'), # Bloomberg Industrial Metals Sub-Index '$BCOMLI':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Benchmark'), # Bloomberg Livestock Sub-Index '$BCOMPE':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Benchmark') , # Bloomberg Petroleum Sub-Index '$BCOMPR':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Benchmark'), # Bloomberg Precious Metals Sub-Index '$BCOMSO':('Commodities','Diversified Agriculture', 'Agriculture', 'Softs', 'Benchmark'), # Bloomberg Softs Sub-Index '$BCOMTR':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # Bloomberg Commodity Total Return Index '$BCOMXE':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # Bloomberg Ex-Energy Sub-Index '$CRB':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # Refinitiv/CoreCommodity CRB Index '$FC':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Feeder Cattle'), # CME Feeder Cattle Index '$LH':('Commodities','Diversified Agriculture', 'Livestock', 'Livestock', 'Lean Hogs'), # CME Lean Hogs Index '$LMEX':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Benchmark'), # LMEX Index '$RBABCA':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # RBA Bulk Commodities Sub-Index (AUD) '$RBABCU':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # RBA Bulk Commodities Sub-Index (USD) '$RBABMA':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Benchmark'), # RBA Base Metals Sub-Index (AUD) '$RBABMU':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Benchmark'), # RBA Base Metals Sub-Index (USD) '$RBACPA':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # RBA Commodity Prices Index (AUD) '$RBACPU':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # RBA Commodity Prices Index (USD) '$RBANRCPA':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # RBA Non-Rural Commodity Prices Sub-Index (AUD) '$RBANRCPU':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # RBA Non-Rural Commodity Prices Sub-Index (USD) '$RBARCPA':('Commodities', 'Diversified Agriculture', 'Diversified Agriculture', 'Diversified Agriculture', 'Benchmark'), # RBA Rural Commodity Prices Sub-Index (AUD) '$RBARCPU':('Commodities', 'Diversified Agriculture', 'Diversified Agriculture', 'Diversified Agriculture', 'Benchmark'), # RBA Rural Commodity Prices Sub-Index (USD) '$SPGSCI':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # S&P GSCI Spot Index '$SPGSCITR':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # S&P GSCI Total Return Index '$SPGSEW':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # S&P GSCI Select Equal Weight Spot Index '$SPGSEWTR':('Commodities', 'Commodities', 'Commodities', 'Commodities', 'Benchmark'), # S&P GSCI Select Equal Weight Total Return Index '@AA':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium Alloy - LME Official Cash '@AA03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium Alloy - LME 03 Months Seller '@AAWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium Alloy - LME Warehouse Opening Stocks '@AL':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium - LME Official Cash '@AL03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium - LME 03 Months Seller '@ALAUD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium - LME Official Cash (AUD) '@ALCAD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium - LME Official Cash (CAD) '@ALWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium - LME Warehouse Opening Stocks '@BFOE':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Crude Oil'), # Brent Crude Europe FOB Spot '@C2Y':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Corn'), # Corn #2 Yellow Central Illinois Average Price Spot '@CO':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Cobalt'), # Cobalt - LME Official Cash '@CO03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Cobalt'), # Cobalt - LME 03 Months Seller '@CO15S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Cobalt'), # Cobalt - LME 15 Months Seller '@COWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Cobalt'), # Cobalt - LME Warehouse Opening Stocks '@CU':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Copper'), # Copper - LME Official Cash '@CU03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Copper'), # Copper - LME 03 Months Seller '@CUAUD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Copper'), # Copper - LME Official Cash (AUD) '@CUCAD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Copper'), # Copper - LME Official Cash (CAD) '@CUWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Copper'), # Copper - LME Warehouse Opening Stocks '@FE':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Iron Ore'), # Iron Ore CFR China 62% Fe Spot '@FEAUD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Iron Ore'), # Iron Ore CFR China 62% Fe Spot (AUD) '@FECAD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Iron Ore'), # Iron Ore CFR China 62% Fe Spot (CAD) '@GC':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Gold'), # Gold - London PM Fix '@HHNG':('Commodities', 'Energy', 'Energy', 'Energy', 'Natural Gas'), # Henry Hub Natural Gas Spot '@HO':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Heating Oil'), # Heating Oil Spot '@NA':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium Alloy (NASAAC) - LME Official Cash '@NA03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium Alloy (NASAAC) - LME 03 Months Seller '@NAWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Aluminium'), # Aluminium Alloy (NASAAC) - LME Warehouse Opening Stocks '@NI':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Nickel'), # Nickel - LME Official Cash '@NI03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Nickel'), # Nickel - LME 03 Months Seller '@NIAUD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Nickel'), # Nickel - LME Official Cash (AUD) '@NICAD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Nickel'), # Nickel - LME Official Cash (CAD) '@NIWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Nickel'), # Nickel - LME Warehouse Opening Stocks '@PA':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Palladium'), # Palladium - London PM Fix '@PAAUD':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Palladium'), # Palladium - London PM Fix (AUD) '@PACAD':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Palladium'), # Palladium - London PM Fix (CAD) '@PB':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Lead'), # Lead - LME Official Cash '@PB03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Lead'), # Lead - LME 03 Months Seller '@PBAUD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Lead'), # Lead - LME Official Cash (AUD) '@PBCAD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Lead'), # Lead - LME Official Cash (CAD) '@PBWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Lead'), # Lead - LME Warehouse Opening Stocks '@PL':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Platinum'), # Platinum - London PM Fix '@PLAUD':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Platinum'), # Platinum - London PM Fix (AUD) '@PLCAD':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Platinum'), # Platinum - London PM Fix (CAD) '@RBOB':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'RBOB Gasoline'), # RBOB Gasoline Spot '@S1Y':('Commodities','Diversified Agriculture', 'Agriculture', 'Grains', 'Soybeans'), # Soybeans #1 Yellow Central Illinois Average Price Spot '@SI':('Commodities', 'Metals', 'Precious Metals', 'Precious Metals', 'Silver'), # Silver - London Fix '@SN':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Tin'), # Tin - LME Official Cash '@SN03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Tin'), # Tin - LME 03 Months Seller '@SN15S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Tin'), # Tin - LME 15 Months Seller '@SNAUD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Tin'), # Tin - LME Official Cash (AUD) '@SNCAD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Tin'), # Tin - LME Official Cash (CAD) '@SNWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Tin'), # Tin - LME Warehouse Opening Stocks '@U3O8':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Uranium'), # Uranium Spot '@U3O8AUD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Uranium'), # Uranium Spot (AUD) '@U3O8CAD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Uranium'), # Uranium Spot (CAD) '@WTI':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Crude Oil'), # West Texas Intermediate Crude Oil Spot '@WTIAUD':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Crude Oil'), # West Texas Intermediate Crude Oil Spot (AUD) '@WTICAD':('Commodities', 'Energy', 'Petroleum', 'Petroleum', 'Crude Oil'), # West Texas Intermediate Crude Oil Spot (CAD) '@YCX':('Commodities', 'Energy', 'Energy', 'Energy', 'Thermal Coal'), # Thermal Coal Spot '@YCXAUD':('Commodities', 'Energy', 'Energy', 'Energy', 'Thermal Coal'), # Thermal Coal Spot (AUD) '@YCXCAD':('Commodities', 'Energy', 'Energy', 'Energy', 'Thermal Coal'), # Thermal Coal Spot (CAD) '@ZN':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Zinc'), # Zinc - LME Official Cash '@ZN03S':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Zinc'), # Zinc - LME 03 Months Seller '@ZNAUD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Zinc'), # Zinc - LME Official Cash (AUD) '@ZNCAD':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Zinc'), # Zinc - LME Official Cash (CAD) '@ZNWS':('Commodities', 'Metals', 'Industrial Metals', 'Industrial Metals', 'Zinc'), # Zinc - LME Warehouse Opening Stocks }, 'equity_sector_mappings':{ 'Oil & Gas Drilling':('Energy','Energy','Energy Equipment & Services'), 'Oil & Gas Equipment & Services':('Energy','Energy','Energy Equipment & Services'), 'Integrated Oil & Gas':('Energy','Energy','Oil, Gas & Consumable Fuels'), 'Oil & Gas Exploration & Production':('Energy','Energy','Oil, Gas & Consumable Fuels'), 'Oil & Gas Refining & Marketing':('Energy','Energy','Oil, Gas & Consumable Fuels'), 'Oil & Gas Storage & Transportation':('Energy','Energy','Oil, Gas & Consumable Fuels'), 'Coal & Consumable Fuels':('Energy','Energy','Oil, Gas & Consumable Fuels'), 'Commodity Chemicals':('Materials','Materials','Chemicals'), 'Diversified Chemicals':('Materials','Materials','Chemicals'), 'Fertilizers & Agricultural Chemicals':('Materials','Materials','Chemicals'), 'Industrial Gases':('Materials','Materials','Chemicals'), 'Specialty Chemicals':('Materials','Materials','Chemicals'), 'Construction Materials':('Materials','Materials','Construction Materials'), 'Metal & Glass Containers':('Materials','Materials','Containers & Packaging'), 'Paper Packaging':('Materials','Materials','Containers & Packaging'), 'Aluminum':('Materials','Materials','Metals & Mining'), 'Diversified Metals & Mining':('Materials','Materials','Metals & Mining'), 'Copper':('Materials','Materials','Metals & Mining'), 'Gold':('Materials','Materials','Metals & Mining'), 'Precious Metals & Minerals':('Materials','Materials','Metals & Mining'), 'Silver':('Materials','Materials','Metals & Mining'), 'Steel':('Materials','Materials','Metals & Mining'), 'Forest Products':('Materials','Materials','Paper & Forest Products'), 'Paper Products':('Materials','Materials','Paper & Forest Products'), 'Aerospace & Defense':('Industrials','Capital Goods','Aerospace & Defense'), 'Building Products':('Industrials','Capital Goods','Building Products'), 'Construction & Engineering':('Industrials','Capital Goods','Construction & Engineering'), 'Electrical Components & Equipment':('Industrials','Capital Goods','Electrical Equipment'), 'Heavy Electrical Equipment':('Industrials','Capital Goods','Electrical Equipment'), 'Industrial Conglomerates':('Industrials','Capital Goods','Industrial Conglomerates'), 'Construction Machinery & Heavy Trucks':('Industrials','Capital Goods','Machinery'), 'Agricultural & Farm Machinery':('Industrials','Capital Goods','Machinery'), 'Industrial Machinery':('Industrials','Capital Goods','Machinery'), 'Trading Companies & Distributors':('Industrials','Capital Goods','Trading Companies & Distributors'), 'Commercial Printing':('Industrials','Commercial & Professional Services','Commercial Services & Supplies'), 'Environmental & Facilities Services':('Industrials','Commercial & Professional Services','Commercial Services & Supplies'), 'Office Services & Supplies':('Industrials','Commercial & Professional Services','Commercial Services & Supplies'), 'Diversified Support Services':('Industrials','Commercial & Professional Services','Commercial Services & Supplies'), 'Security & Alarm Services':('Industrials','Commercial & Professional Services','Commercial Services & Supplies'), 'Human Resource & Employment Services':('Industrials','Commercial & Professional Services','Professional Services'), 'Research & Consulting Services':('Industrials','Commercial & Professional Services','Professional Services'), 'Air Freight & Logistics':('Industrials','Transportation','Air Freight & Logistics'), 'Airlines':('Industrials','Transportation','Airlines'), 'Marine':('Industrials','Transportation','Marine'), 'Railroads':('Industrials','Transportation','Road & Rail'), 'Trucking':('Industrials','Transportation','Road & Rail'), 'Airport Services':('Industrials','Transportation','Transportation Infrastructure'), 'Highways & Railtracks':('Industrials','Transportation','Transportation Infrastructure'), 'Marine Ports & Services':('Industrials','Transportation','Transportation Infrastructure'), 'Auto Parts & Equipment':('Consumer Discretionary','Automobiles & Components','Auto Components'), 'Tires & Rubber':('Consumer Discretionary','Automobiles & Components','Auto Components'), 'Automobile Manufacturers':('Consumer Discretionary','Automobiles & Components','Automobiles'), 'Motorcycle Manufacturers':('Consumer Discretionary','Automobiles & Components','Automobiles'), 'Consumer Electronics':('Consumer Discretionary','Consumer Durables & Apparel','Household Durables'), 'Home Furnishings':('Consumer Discretionary','Consumer Durables & Apparel','Household Durables'), 'Homebuilding':('Consumer Discretionary','Consumer Durables & Apparel','Household Durables'), 'Household Appliances':('Consumer Discretionary','Consumer Durables & Apparel','Household Durables'), 'Housewares & Specialties':('Consumer Discretionary','Consumer Durables & Apparel','Household Durables'), 'Leisure Products':('Consumer Discretionary','Consumer Durables & Apparel','Leisure Products'), 'Apparel, Accessories & Luxury Goods':('Consumer Discretionary','Consumer Durables & Apparel','Textiles, Apparel & Luxury Goods'), 'Footwear':('Consumer Discretionary','Consumer Durables & Apparel','Textiles, Apparel & Luxury Goods'), 'Textiles':('Consumer Discretionary','Consumer Durables & Apparel','Textiles, Apparel & Luxury Goods'), 'Casinos & Gaming':('Consumer Discretionary','Consumer Services','Hotels, Restaurants & Leisure'), 'Hotels, Resorts & Cruise Lines':('Consumer Discretionary','Consumer Services','Hotels, Restaurants & Leisure'), 'Leisure Facilities':('Consumer Discretionary','Consumer Services','Hotels, Restaurants & Leisure'), 'Restaurants':('Consumer Discretionary','Consumer Services','Hotels, Restaurants & Leisure'), 'Education Services':('Consumer Discretionary','Consumer Services','Diversified Consumer Services'), 'Specialized Consumer Services':('Consumer Discretionary','Consumer Services','Diversified Consumer Services'), 'Distributors':('Consumer Discretionary','Retailing','Distributors'), 'Internet & Direct Marketing Retail':('Consumer Discretionary','Retailing','Internet & Direct Marketing Retail'), 'Department Stores':('Consumer Discretionary','Retailing','Multiline Retail'), 'General Merchandise Stores':('Consumer Discretionary','Retailing','Multiline Retail'), 'Apparel Retail':('Consumer Discretionary','Retailing','Specialty Retail'), 'Computer & Electronics Retail':('Consumer Discretionary','Retailing','Specialty Retail'), 'Home Improvement Retail':('Consumer Discretionary','Retailing','Specialty Retail'), 'Specialty Stores':('Consumer Discretionary','Retailing','Specialty Retail'), 'Automotive Retail':('Consumer Discretionary','Retailing','Specialty Retail'), 'Homefurnishing Retail':('Consumer Discretionary','Retailing','Specialty Retail'), 'Drug Retail':('Consumer Staples','Food & Staples Retailing','Food & Staples Retailing'), 'Food Distributors':('Consumer Staples','Food & Staples Retailing','Food & Staples Retailing'), 'Food Retail':('Consumer Staples','Food & Staples Retailing','Food & Staples Retailing'), 'Hypermarkets & Super Centers':('Consumer Staples','Food & Staples Retailing','Food & Staples Retailing'), 'Brewers':('Consumer Staples','Food, Beverage & Tobacco','Beverages'), 'Distillers & Vintners':('Consumer Staples','Food, Beverage & Tobacco','Beverages'), 'Soft Drinks':('Consumer Staples','Food, Beverage & Tobacco','Beverages'), 'Agricultural Products':('Consumer Staples','Food, Beverage & Tobacco','Food Products'), 'Packaged Foods & Meats':('Consumer Staples','Food, Beverage & Tobacco','Food Products'), 'Tobacco':('Consumer Staples','Food, Beverage & Tobacco','Tobacco'), 'Household Products':('Consumer Staples','Household & Personal Products','Household Products'), 'Personal Products':('Consumer Staples','Household & Personal Products','Personal Products'), 'Health Care Equipment':('Health Care','Health Care Equipment & Services','Health Care Equipment & Supplies'), 'Health Care Supplies':('Health Care','Health Care Equipment & Services','Health Care Equipment & Supplies'), 'Health Care Distributors':('Health Care','Health Care Equipment & Services','Health Care Providers & Services'), 'Health Care Services':('Health Care','Health Care Equipment & Services','Health Care Providers & Services'), 'Health Care Facilities':('Health Care','Health Care Equipment & Services','Health Care Providers & Services'), 'Managed Health Care':('Health Care','Health Care Equipment & Services','Health Care Providers & Services'), 'Health Care Technology':('Health Care','Health Care Equipment & Services','Health Care Technology'), 'Biotechnology':('Health Care','Pharmaceuticals, Biotechnology & Life Sciences','Biotechnology'), 'Pharmaceuticals':('Health Care','Pharmaceuticals, Biotechnology & Life Sciences','Pharmaceuticals'), 'Life Sciences Tools & Services':('Health Care','Pharmaceuticals, Biotechnology & Life Sciences','Life Sciences Tools & Services'), 'Diversified Banks':('Financials','Banks','Banks'), 'Regional Banks':('Financials','Banks','Banks'), 'Thrifts & Mortgage Finance':('Financials','Banks','Thrifts & Mortgage Finance'), 'Other Diversified Financial Services':('Financials','Diversified Financials','Diversified Financial Services'), 'Multi-Sector Holdings':('Financials','Diversified Financials','Diversified Financial Services'), 'Specialized Finance':('Financials','Diversified Financials','Diversified Financial Services'), 'Consumer Finance':('Financials','Diversified Financials','Consumer Finance'), 'Asset Management & Custody Banks':('Financials','Diversified Financials','Capital Markets'), 'Investment Banking & Brokerage':('Financials','Diversified Financials','Capital Markets'), 'Diversified Capital Markets':('Financials','Diversified Financials','Capital Markets'), 'Financial Exchanges & Data':('Financials','Diversified Financials','Capital Markets'), 'Mortgage REITs':('Financials','Diversified Financials','Mortgage Real Estate Investment Trusts (REITs)'), 'Insurance Brokers':('Financials','Insurance','Insurance'), 'Life & Health Insurance':('Financials','Insurance','Insurance'), 'Multi-line Insurance':('Financials','Insurance','Insurance'), 'Property & Casualty Insurance':('Financials','Insurance','Insurance'), 'Reinsurance':('Financials','Insurance','Insurance'), 'IT Consulting & Other Services':('Information Technology','Software & Services','IT Services'), 'Data Processing & Outsourced Services':('Information Technology','Software & Services','IT Services'), 'Internet Services & Infrastructure':('Information Technology','Software & Services','IT Services'), 'Application Software':('Information Technology','Software & Services','Software'), 'Systems Software':('Information Technology','Software & Services','Software'), 'Communications Equipment':('Information Technology','Technology Hardware & Equipment','Communications Equipment'), 'Technology Hardware, Storage & Peripherals':('Information Technology','Technology Hardware & Equipment','Technology Hardware, Storage & Peripherals'), 'Electronic Equipment & Instruments':('Information Technology','Technology Hardware & Equipment','Electronic Equipment, Instruments & Components'), 'Electronic Components':('Information Technology','Technology Hardware & Equipment','Electronic Equipment, Instruments & Components'), 'Electronic Manufacturing Services':('Information Technology','Technology Hardware & Equipment','Electronic Equipment, Instruments & Components'), 'Technology Distributors':('Information Technology','Technology Hardware & Equipment','Electronic Equipment, Instruments & Components'), 'Semiconductor Equipment':('Information Technology','Semiconductors & Semiconductor Equipment','Semiconductors & Semiconductor Equipment'), 'Semiconductors':('Information Technology','Semiconductors & Semiconductor Equipment','Semiconductors & Semiconductor Equipment'), 'Alternative Carriers':('Communication Services','Communication Services','Diversified Telecommunication Services'), 'Integrated Telecommunication Services':('Communication Services','Communication Services','Diversified Telecommunication Services'), 'Wireless Telecommunication Services':('Communication Services','Communication Services','Wireless Telecommunication Services'), 'Advertising':('Communication Services','Media & Entertainment','Media'), 'Broadcasting':('Communication Services','Media & Entertainment','Media'), 'Cable & Satellite':('Communication Services','Media & Entertainment','Media'), 'Publishing':('Communication Services','Media & Entertainment','Media'), 'Movies & Entertainment':('Communication Services','Media & Entertainment','Entertainment'), 'Interactive Home Entertainment':('Communication Services','Media & Entertainment','Entertainment'), 'Interactive Media & Services':('Communication Services','Media & Entertainment','Interactive Media & Services'), 'Electric Utilities':('Utilities','Utilities','Electric Utilities'), 'Gas Utilities':('Utilities','Utilities','Gas Utilities'), 'Multi-Utilities':('Utilities','Utilities','Multi-Utilities'), 'Water Utilities':('Utilities','Utilities','Water Utilities'), 'Independent Power Producers & Energy Traders':('Utilities','Utilities','Independent Power and Renewable Electricity Producers'), 'Renewable Electricity':('Utilities','Utilities','Independent Power and Renewable Electricity Producers'), 'Diversified REITs':('Real Estate','Real Estate','Equity Real Estate Investment Trusts (REITs)'), 'Industrial REITs':('Real Estate','Real Estate','Equity Real Estate Investment Trusts (REITs)'), 'Hotel & Resort REITs':('Real Estate','Real Estate','Equity Real Estate Investment Trusts (REITs)'), 'Office REITs':('Real Estate','Real Estate','Equity Real Estate Investment Trusts (REITs)'), 'Health Care REITs':('Real Estate','Real Estate','Equity Real Estate Investment Trusts (REITs)'), 'Residential REITs':('Real Estate','Real Estate','Equity Real Estate Investment Trusts (REITs)'), 'Retail REITs':('Real Estate','Real Estate','Equity Real Estate Investment Trusts (REITs)'), 'Specialized REITs':('Real Estate','Real Estate','Equity Real Estate Investment Trusts (REITs)'), 'Diversified Real Estate Activities':('Real Estate','Real Estate','Real Estate Management & Development'), 'Real Estate Operating Companies':('Real Estate','Real Estate','Real Estate Management & Development'), 'Real Estate Development':('Real Estate','Real Estate','Real Estate Management & Development'), 'Real Estate Services':('Real Estate','Real Estate','Real Estate Management & Development'), }, }
112.670707
174
0.660887
5,713
55,772
6.430947
0.120952
0.084921
0.093087
0.127382
0.841481
0.807975
0.755144
0.699102
0.646053
0.556369
0
0.011345
0.15922
55,772
494
175
112.898785
0.772157
0.121262
0
0
0
0
0.701331
0.000966
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
4e0e25c801ebf3f2d9ead4fd258f19fb18985ea2
39
py
Python
inference/__init__.py
kamodulin/TRAILMAP
1700eca3db070b02132ac1d9db8b9a80323d02cb
[ "MIT" ]
29
2019-11-12T22:36:51.000Z
2021-12-16T00:11:44.000Z
inference/__init__.py
kamodulin/TRAILMAP
1700eca3db070b02132ac1d9db8b9a80323d02cb
[ "MIT" ]
14
2019-11-06T19:19:00.000Z
2022-01-25T21:14:13.000Z
inference/__init__.py
kamodulin/TRAILMAP
1700eca3db070b02132ac1d9db8b9a80323d02cb
[ "MIT" ]
13
2019-10-22T12:53:33.000Z
2022-03-15T20:15:52.000Z
from inference.segment_brain import *
13
37
0.820513
5
39
6.2
1
0
0
0
0
0
0
0
0
0
0
0
0.128205
39
2
38
19.5
0.911765
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
9dd4d38622ed2407d8cc7444c47602b73db1172d
45
py
Python
pyEpiabm/pyEpiabm/tests/test_property/__init__.py
Saketkr21/epiabm
3ec0dcbc78d3fd4114ed3c6bdd78ef39f0013d2f
[ "BSD-3-Clause" ]
11
2021-12-02T15:24:02.000Z
2022-03-10T14:02:13.000Z
pyEpiabm/pyEpiabm/tests/test_property/__init__.py
Saketkr21/epiabm
3ec0dcbc78d3fd4114ed3c6bdd78ef39f0013d2f
[ "BSD-3-Clause" ]
119
2021-11-24T13:56:48.000Z
2022-03-30T11:52:07.000Z
pyEpiabm/pyEpiabm/tests/test_unit/test_property/__init__.py
SABS-R3-Epidemiology/epiabm
8eb83fd2de84104f6f77929e3771095f7b033ddc
[ "BSD-3-Clause" ]
3
2022-01-13T03:05:19.000Z
2022-03-11T22:00:17.000Z
# # Tests for subpackage pyEpiabm.property #
11.25
40
0.755556
5
45
6.8
1
0
0
0
0
0
0
0
0
0
0
0
0.155556
45
3
41
15
0.894737
0.844444
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
d1b9852fb2e958e5f64404e0ede3da7fbca1d3c4
309
py
Python
units/prefixes/small.py
misspellted/enlightened
59fac50bb17a5a3236a9b4561b5ed0107825fb85
[ "Unlicense" ]
2
2021-03-03T05:57:51.000Z
2021-07-06T06:26:07.000Z
units/prefixes/small.py
misspellted/enlightened
59fac50bb17a5a3236a9b4561b5ed0107825fb85
[ "Unlicense" ]
6
2021-04-09T00:30:24.000Z
2022-03-14T16:08:37.000Z
units/prefixes/small.py
misspellted/enlightened
59fac50bb17a5a3236a9b4561b5ed0107825fb85
[ "Unlicense" ]
1
2021-03-03T06:00:46.000Z
2021-03-03T06:00:46.000Z
from units.prefixes import Prefix class Milli(Prefix): def __init__(self): Prefix.__init__(self, "m", "milli", 1e-3) class Micro(Prefix): def __init__(self): Prefix.__init__(self, "μ", "micro", 1e-6) class Nano(Prefix): def __init__(self): Prefix.__init__(self, "ns", "nano", 1e-9)
15.45
45
0.653722
44
309
4.045455
0.431818
0.269663
0.219101
0.286517
0.522472
0.522472
0.522472
0
0
0
0
0.023622
0.177994
309
19
46
16.263158
0.677165
0
0
0.3
0
0
0.058824
0
0
0
0
0
0
1
0.3
false
0
0.1
0
0.7
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
0
1
0
0
5
ae0a703df04c1a245dba88843845ded8e8589bda
711
py
Python
jdit/trainer/instances/__init__.py
dingguanglei/jdit
ef878e696c9e2fad5069f106496289d4e4cc6154
[ "Apache-2.0" ]
28
2019-06-18T15:56:53.000Z
2021-11-09T13:11:13.000Z
jdit/trainer/instances/__init__.py
dingguanglei/jdit
ef878e696c9e2fad5069f106496289d4e4cc6154
[ "Apache-2.0" ]
2
2018-10-24T01:09:56.000Z
2018-11-08T07:13:48.000Z
jdit/trainer/instances/__init__.py
dingguanglei/jdit
ef878e696c9e2fad5069f106496289d4e4cc6154
[ "Apache-2.0" ]
8
2019-01-11T01:12:15.000Z
2021-03-12T10:15:43.000Z
from .fashionClassification import FashionClassTrainer, start_fashionClassTrainer from .fashionGenerateGan import FashionGenerateGanTrainer, start_fashionGenerateGanTrainer from .cifarPix2pixGan import start_cifarPix2pixGanTrainer from .fashionClassParallelTrainer import start_fashionClassPrarallelTrainer from .fashionAutoencoder import FashionAutoEncoderTrainer, start_fashionAutoencoderTrainer __all__ = ['FashionClassTrainer', 'start_fashionClassTrainer', 'FashionGenerateGanTrainer', 'start_fashionGenerateGanTrainer', 'cifarPix2pixGan', 'start_cifarPix2pixGanTrainer', 'start_fashionClassPrarallelTrainer', 'start_fashionAutoencoderTrainer', 'FashionAutoEncoderTrainer']
71.1
99
0.853727
43
711
13.790698
0.325581
0.080944
0.145025
0
0
0
0
0
0
0
0
0.006211
0.094233
711
9
100
79
0.914596
0
0
0
1
0
0.327707
0.279887
0
0
0
0
0
1
0
false
0
0.555556
0
0.555556
0
0
0
1
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
0
0
1
0
1
0
0
5
ae27587556ffd7ff853ae00896a8b61ada032522
174
py
Python
ex.024.identificandoPalavras.py
romulorm/cev-python
b5c6844956c131a9e4e02355459c218739ebf8c5
[ "MIT" ]
null
null
null
ex.024.identificandoPalavras.py
romulorm/cev-python
b5c6844956c131a9e4e02355459c218739ebf8c5
[ "MIT" ]
null
null
null
ex.024.identificandoPalavras.py
romulorm/cev-python
b5c6844956c131a9e4e02355459c218739ebf8c5
[ "MIT" ]
null
null
null
cidade = str(input('Informe a cidade em que nasceu: ').strip()) print('O nome da cidade em que nasceu começa com a palavra Santo: {}'.format(cidade[:5].upper() == 'SANTO'))
43.5
108
0.678161
28
174
4.214286
0.714286
0.135593
0.186441
0.288136
0
0
0
0
0
0
0
0.006711
0.143678
174
3
109
58
0.785235
0
0
0
0
0
0.566474
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
ae2ab85badcfff462c032b273254622c19ecceb2
181
py
Python
migrate.py
dannluciano/django-mini-system-monitor
977feec09b7c64a03f4d6edd0cc39fab61f29f43
[ "MIT" ]
9
2021-01-31T20:51:56.000Z
2022-01-30T23:56:07.000Z
migrate.py
dannluciano/django-mini-system-monitor
977feec09b7c64a03f4d6edd0cc39fab61f29f43
[ "MIT" ]
3
2021-01-31T21:59:33.000Z
2021-09-01T19:18:33.000Z
migrate.py
dannluciano/django-mini-system-monitor
977feec09b7c64a03f4d6edd0cc39fab61f29f43
[ "MIT" ]
1
2022-03-20T04:10:54.000Z
2022-03-20T04:10:54.000Z
#!/usr/bin/env python # migrate.py from django.core.management import call_command from boot_django import boot_django boot_django() call_command("migrate", "mini_system_monitor")
22.625
47
0.812155
27
181
5.185185
0.62963
0.214286
0
0
0
0
0
0
0
0
0
0
0.088398
181
8
48
22.625
0.848485
0.171271
0
0
0
0
0.174497
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
ae2d2d99b4acba40f8a984a2f5ae910424f896ec
240
py
Python
subdir1/__init__.py
cramraj8/RamPyPackage
6f4e046e63860a5894bdbe3b4a3059a4f835a8da
[ "Apache-2.0" ]
null
null
null
subdir1/__init__.py
cramraj8/RamPyPackage
6f4e046e63860a5894bdbe3b4a3059a4f835a8da
[ "Apache-2.0" ]
null
null
null
subdir1/__init__.py
cramraj8/RamPyPackage
6f4e046e63860a5894bdbe3b4a3059a4f835a8da
[ "Apache-2.0" ]
null
null
null
from .intermediate_from_subdir1 import intermediate_from_subdir1 from .intermediate_2_from_subdir1 import intermediate_2_from_subdir1 __all__ = ( # sub-packages 'intermediate_from_subdir1', 'intermediate_2_from_subdir1', )
18.461538
68
0.808333
28
240
6.25
0.285714
0.377143
0.394286
0.411429
0
0
0
0
0
0
0
0.043478
0.1375
240
12
69
20
0.801932
0.05
0
0
0
0
0.231111
0.231111
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
ae33f67c3dd64927b4a6ce06f577c50082cc4ba0
9,393
py
Python
function/python/brightics/function/regression/test/ada_boost_regression_test.py
parkjh80/studio
6d8d8384272e5e1b2838b12e5557272a19408e89
[ "Apache-2.0" ]
202
2018-10-23T04:37:35.000Z
2022-01-27T05:51:10.000Z
function/python/brightics/function/regression/test/ada_boost_regression_test.py
data-weirdo/studio
48852c4f097f773ce3d408b59f79fda2e2d60470
[ "Apache-2.0" ]
444
2018-11-07T08:41:14.000Z
2022-03-16T06:48:57.000Z
function/python/brightics/function/regression/test/ada_boost_regression_test.py
data-weirdo/studio
48852c4f097f773ce3d408b59f79fda2e2d60470
[ "Apache-2.0" ]
99
2018-11-08T04:12:13.000Z
2022-03-30T05:36:27.000Z
""" Copyright 2019 Samsung SDS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from brightics.function.regression.ada_boost_regression import ada_boost_regression_train from brightics.function.regression.ada_boost_regression import ada_boost_regression_predict from brightics.common.datasets import load_iris import unittest import pandas as pd import numpy as np import HtmlTestRunner import os class ADABoostRegression(unittest.TestCase): def setUp(self): print("*** ADA Boost Regression UnitTest Start ***") self.testdata = load_iris() def tearDown(self): print("*** ADA Boost Regression UnitTest End ***") def test(self): ada_train = ada_boost_regression_train(self.testdata, feature_cols=['sepal_length', 'sepal_width', 'petal_length', ], label_col='petal_width', random_state=12345) ada_model = ada_train['model']['regressor'] estimator_weights = ada_model.estimator_weights_ if hasattr(ada_model, 'estimator_weights_') else None estimator_errors = ada_model.estimator_errors_ if hasattr(ada_model, 'estimator_errors_') else None feature_importances = ada_model.feature_importances_ if hasattr(ada_model, 'feature_importances_') else None np.testing.assert_array_equal([round(x, 15) for x in estimator_weights], [1.413875270282188, 0.842690804421279, 0.745744569599211, 0.849855966774747, 0.873567992253140, 0.412870149785776, 0.735336038549665, 0.948762342244301, 0.119925737139696, 1.084352707003922, 0.215508369140552, 1.261341652523880, 0.693756215973489, 0.815705197279502, 0.107744343744492, 0.892721151562112, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000]) np.testing.assert_array_equal([round(x, 15) for x in estimator_errors], [0.195623543954738, 0.300968372309124, 0.321749243945297, 0.299463072654870, 0.294512419786350, 0.398224113163979, 0.324024864473794, 0.279133793052534, 0.470054447315167, 0.252683191393177, 0.446330465454831, 0.220743020672426, 0.333198005871043, 0.306676087054173, 0.473089941916390, 0.290548596637435, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000, 1.000000000000000]) np.testing.assert_array_equal([round(x, 15) for x in feature_importances], [0.060563052789016, 0.057352925738117, 0.882084021472867]) predict = ada_boost_regression_predict(self.testdata, ada_train['model']) species = predict['out_table']['species'] prediction = predict['out_table']['prediction'] np.testing.assert_array_equal(species, ['setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'setosa', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'versicolor', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica', 'virginica']) np.testing.assert_array_equal([round(x, 15) for x in prediction], [0.271428571428571 , 0.194444444444444 , 0.205555555555556 , 0.194444444444444 , 0.271428571428571 , 0.375000000000000 , 0.233333333333333 , 0.247619047619048 , 0.194444444444444 , 0.194444444444444 , 0.275000000000000 , 0.250000000000000 , 0.194444444444444 , 0.194444444444444 , 0.300000000000000 , 0.275000000000000 , 0.275000000000000 , 0.271428571428571 , 0.400000000000000 , 0.271428571428571 , 0.357142857142857 , 0.271428571428571 , 0.271428571428571 , 0.316666666666667 , 0.250000000000000 , 0.271428571428571 , 0.271428571428571 , 0.271428571428571 , 0.247619047619048 , 0.230000000000000 , 0.230000000000000 , 0.247619047619048 , 0.257894736842105 , 0.270000000000000 , 0.194444444444444 , 0.233333333333333 , 0.300000000000000 , 0.194444444444444 , 0.194444444444444 , 0.247619047619048 , 0.271428571428571 , 0.205555555555556 , 0.205555555555556 , 0.366666666666667 , 0.366666666666667 , 0.194444444444444 , 0.316666666666667 , 0.205555555555556 , 0.275000000000000 , 0.233333333333333 , 1.494444444444444 , 1.494444444444444 , 1.933999999999999 , 1.205882352941176 , 1.460000000000000 , 1.460000000000000 , 1.494444444444444 , 1.100000000000000 , 1.494444444444444 , 1.205263157894737 , 1.100000000000000 , 1.350000000000000 , 1.205882352941176 , 1.494444444444444 , 1.242105263157894 , 1.421428571428571 , 1.494444444444444 , 1.205882352941176 , 1.460000000000000 , 1.205263157894737 , 1.620000000000000 , 1.242105263157894 , 1.626315789473684 , 1.460000000000000 , 1.357142857142857 , 1.421428571428571 , 1.823333333333333 , 1.933999999999999 , 1.494444444444444 , 1.093333333333333 , 1.160000000000000 , 1.160000000000000 , 1.205263157894737 , 1.823333333333333 , 1.494444444444444 , 1.494444444444444 , 1.494444444444444 , 1.251851851851852 , 1.280000000000000 , 1.205882352941176 , 1.251851851851852 , 1.494444444444444 , 1.205882352941176 , 1.100000000000000 , 1.242105263157894 , 1.350000000000000 , 1.280000000000000 , 1.357142857142857 , 1.100000000000000 , 1.242105263157894 , 2.197916666666667 , 1.907843137254902 , 1.998387096774192 , 1.933999999999999 , 1.998387096774192 , 1.998387096774192 , 1.494444444444444 , 1.998387096774192 , 1.933999999999999 , 2.197916666666667 , 1.998387096774192 , 1.907843137254902 , 1.998387096774192 , 1.907843137254902 , 1.985882352941177 , 1.998701298701298 , 1.998387096774192 , 2.197916666666667 , 1.985882352941177 , 1.823333333333333 , 2.012903225806451 , 1.823333333333333 , 1.998387096774192 , 1.626315789473684 , 2.197916666666667 , 2.012903225806451 , 1.592000000000000 , 1.823333333333333 , 1.985882352941177 , 1.998387096774192 , 1.998387096774192 , 2.197916666666667 , 1.985882352941177 , 1.875342465753425 , 1.825000000000001 , 1.998387096774192 , 2.127500000000000 , 1.998701298701298 , 1.620000000000000 , 1.998701298701298 , 1.998701298701298 , 1.998387096774192 , 1.907843137254902 , 2.012903225806451 , 2.197916666666667 , 1.985882352941177 , 1.823333333333333 , 1.985882352941177 , 2.127500000000000 , 1.933999999999999]) if __name__ == '__main__': filepath = os.path.dirname(os.path.abspath(__file__)) reportFoler = filepath + "/../../../../../../../reports" unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(combine_reports=True, output=reportFoler))
161.948276
3,074
0.76408
992
9,393
7.15625
0.222782
0.082829
0.121707
0.158896
0.484857
0.406959
0.388224
0.374419
0.374419
0.374419
0
0.485098
0.106995
9,393
57
3,075
164.789474
0.36123
0.058661
0
0
0
0
0.173527
0.003298
0
0
0
0
0.15625
1
0.09375
false
0
0.3125
0
0.4375
0.0625
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
ae65c059f0116aeabe64833abaad136d794c0427
83
py
Python
kutils/urls.py
gluwer/przepisymm
dc83fdc4068fb0102a87081bd519807fd66397c2
[ "BSD-3-Clause" ]
null
null
null
kutils/urls.py
gluwer/przepisymm
dc83fdc4068fb0102a87081bd519807fd66397c2
[ "BSD-3-Clause" ]
null
null
null
kutils/urls.py
gluwer/przepisymm
dc83fdc4068fb0102a87081bd519807fd66397c2
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- # index.urls def make_rules(): return [] all_views = {}
11.857143
23
0.566265
11
83
4.090909
1
0
0
0
0
0
0
0
0
0
0
0.015152
0.204819
83
7
24
11.857143
0.666667
0.385542
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
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
0
1
1
0
0
5
88897cb95ceea7a38cdd7c606ae0e58465ed89dd
26
py
Python
myNumber.py
Walker-00/ph_no_track
1604c435e22dc917543ba7f0b1a57f527e9b5e94
[ "BSL-1.0" ]
null
null
null
myNumber.py
Walker-00/ph_no_track
1604c435e22dc917543ba7f0b1a57f527e9b5e94
[ "BSL-1.0" ]
null
null
null
myNumber.py
Walker-00/ph_no_track
1604c435e22dc917543ba7f0b1a57f527e9b5e94
[ "BSL-1.0" ]
null
null
null
number = "+959252160714"
8.666667
24
0.692308
2
26
9
1
0
0
0
0
0
0
0
0
0
0
0.545455
0.153846
26
2
25
13
0.272727
0
0
0
0
0
0.52
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
ee0ff8e4a514bf1011d9aaf3cb032dad5ee1bb6e
239
py
Python
pvae/models/__init__.py
cll27/pvae
7abbb4604a1acec2332b1b4dfe21267834b505cc
[ "MIT" ]
1
2021-06-17T13:47:38.000Z
2021-06-17T13:47:38.000Z
pvae/models/__init__.py
cll27/pvae
7abbb4604a1acec2332b1b4dfe21267834b505cc
[ "MIT" ]
null
null
null
pvae/models/__init__.py
cll27/pvae
7abbb4604a1acec2332b1b4dfe21267834b505cc
[ "MIT" ]
null
null
null
from .vae_tree import Tree as VAE_tree from .vae_hyp_tree import Tree as VAE_hyp_tree from .vae_mnist import Mnist as VAE_mnist from .vae_hyp_mnist import Mnist as VAE_hyp_mnist __all__ = [VAE_tree, VAE_hyp_tree, VAE_mnist, VAE_hyp_mnist]
39.833333
60
0.832636
47
239
3.765957
0.170213
0.20339
0.169492
0.180791
0.451977
0
0
0
0
0
0
0
0.125523
239
6
60
39.833333
0.84689
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
ee8dfdfefc4733796d78124b9fb526ca6ebf53c4
418
py
Python
django/alumnos/Equipo 3/historial_medico_mujeres_priv-master/project/my_web/my_web/padecimientos/models.py
R3SWebDevelopment/CeroUnoApprenticeshipProgramPython
b00b3dce329240889401627e99b72d3d9cadb7d9
[ "MIT" ]
1
2019-11-29T21:34:42.000Z
2019-11-29T21:34:42.000Z
django/alumnos/Equipo 3/historial_medico_mujeres_priv-master/project/my_web/my_web/padecimientos/models.py
R3SWebDevelopment/CeroUnoApprenticeshipProgramPython
b00b3dce329240889401627e99b72d3d9cadb7d9
[ "MIT" ]
null
null
null
django/alumnos/Equipo 3/historial_medico_mujeres_priv-master/project/my_web/my_web/padecimientos/models.py
R3SWebDevelopment/CeroUnoApprenticeshipProgramPython
b00b3dce329240889401627e99b72d3d9cadb7d9
[ "MIT" ]
1
2019-11-30T17:51:50.000Z
2019-11-30T17:51:50.000Z
from django.db import models class Padecimiento(models.Model): nombre_padecimiento = models.CharField(max_length=200, null=False, blank=False) descripcion_padecimiento = models.TextField(null=False, blank=False, max_length=300) intensidad_padecimiento = models.IntegerField(null=False, blank=False) def __str__(self): return "Padecimiento: {nombre}".format(nombre = self.nombre_padecimiento)
41.8
88
0.770335
50
418
6.24
0.52
0.230769
0.134615
0.182692
0
0
0
0
0
0
0
0.016438
0.126794
418
9
89
46.444444
0.838356
0
0
0
0
0
0.052632
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0.142857
1
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
c98e843f842e35b3689d57b57c4a6b7fecfcf674
279
py
Python
psdl/__init__.py
ankith26/psdl
29846fe4e8054c413fc7b9f864d6def60f28da72
[ "MIT" ]
1
2021-02-06T06:52:28.000Z
2021-02-06T06:52:28.000Z
psdl/__init__.py
ankith26/psdl
29846fe4e8054c413fc7b9f864d6def60f28da72
[ "MIT" ]
null
null
null
psdl/__init__.py
ankith26/psdl
29846fe4e8054c413fc7b9f864d6def60f28da72
[ "MIT" ]
2
2021-02-06T06:52:33.000Z
2021-02-06T11:26:10.000Z
""" This file is a part of the psdl package. Copyright (C) 2021 Ankith (ankith26) Distributed under the MIT license. """ from psdl.sdl import * from psdl.version import * from psdl.video import * from psdl.clipboard import * from psdl.cpuinfo import * from psdl.events import *
21.461538
40
0.749104
43
279
4.860465
0.604651
0.229665
0.334928
0
0
0
0
0
0
0
0
0.025751
0.164875
279
12
41
23.25
0.871245
0.405018
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
c9c081368a0ad62a478c8fe0ee1bd5b28f509675
1,509
py
Python
survol/sources_types/rabbitmq/__init__.py
rchateauneu/survol
ba66d3ec453b2d9dd3a8dabc6d53f71aa9ba8c78
[ "BSD-3-Clause" ]
9
2017-10-05T23:36:23.000Z
2021-08-09T15:40:03.000Z
survol/sources_types/rabbitmq/__init__.py
rchateauneu/survol
ba66d3ec453b2d9dd3a8dabc6d53f71aa9ba8c78
[ "BSD-3-Clause" ]
21
2018-01-02T09:33:03.000Z
2018-08-27T11:09:52.000Z
survol/sources_types/rabbitmq/__init__.py
rchateauneu/survol
ba66d3ec453b2d9dd3a8dabc6d53f71aa9ba8c78
[ "BSD-3-Clause" ]
4
2018-06-23T09:05:45.000Z
2021-01-22T15:36:50.000Z
""" RabbitMQ concepts """ def Graphic_shape(): return "none" def Graphic_colorfill(): return "#FFCC66" def Graphic_colorbg(): return "#FFCC66" def Graphic_border(): return 2 def Graphic_is_rounded(): return True # managementUrl = rabbitmq.ManagementUrlPrefix(configNam) # managementUrl = rabbitmq.ManagementUrlPrefix(configNam,"users",namUser) # managementUrl = rabbitmq.ManagementUrlPrefix(configNam,"vhosts",namVHost) # managementUrl = rabbitmq.ManagementUrlPrefix(configNam,"exchanges",namVHost,namExchange) # managementUrl = rabbitmq.ManagementUrlPrefix(configNam,"queues",namVHost,namQ) # managementUrl = "http://" + configNam + "/#/queues/" + "%2F" + "/" + namQueue # managementUrl = "http://" + configNam + "/#/vhosts/" + "%2F" # managementUrl = "http://" + configNam + "/#/users/" + namUser # managementUrl = "http://" + configNam + "/#/users/" + namUser def ManagementUrlPrefix(config_nam, key="vhosts", name_key1="", name_key2=""): pre_prefix = "http://" + config_nam + "/#/" if not key: return pre_prefix if key == "users": return pre_prefix + "users/" + name_key1 # It is a virtual host name. if name_key1 == "/": effective_v_host = "%2F" else: effective_v_host = name_key1 effective_v_host = effective_v_host.lower() # RFC4343 vhost_prefix = pre_prefix + key + "/" + effective_v_host if key in ["vhosts", "connections"]: return vhost_prefix return vhost_prefix + "/" + name_key2
26.946429
90
0.667329
157
1,509
6.216561
0.324841
0.05123
0.204918
0.251025
0.122951
0
0
0
0
0
0
0.01461
0.183565
1,509
55
91
27.436364
0.777597
0.451955
0
0.08
0
0
0.084472
0
0
0
0
0
0
1
0.24
false
0
0
0.2
0.6
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
c9d34eec409d6e8348fcd8226051e9f8c16fc913
206
py
Python
profiles_api/admin.py
kalenshi/profiles-rest-api
b1840b4387cc7ee8744f0b70ceb046b674cc84b4
[ "MIT" ]
null
null
null
profiles_api/admin.py
kalenshi/profiles-rest-api
b1840b4387cc7ee8744f0b70ceb046b674cc84b4
[ "MIT" ]
null
null
null
profiles_api/admin.py
kalenshi/profiles-rest-api
b1840b4387cc7ee8744f0b70ceb046b674cc84b4
[ "MIT" ]
null
null
null
from django.contrib import admin from profiles_api.models import Book,Author,UserProfile # Register your models here. admin.site.register(UserProfile) admin.site.register(Book) admin.site.register(Author)
25.75
55
0.830097
29
206
5.862069
0.517241
0.158824
0.3
0
0
0
0
0
0
0
0
0
0.082524
206
7
56
29.428571
0.899471
0.126214
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
a022ea1fbec0bfcd5ea6b3a8c37db8fc18c19ac4
163
py
Python
graduate_main/test/root_setup.py
mxito3/graduate_pro
7fca6e0387f741b8fc887cddd7e7fd8c9953a330
[ "MIT" ]
1
2020-01-02T01:40:57.000Z
2020-01-02T01:40:57.000Z
graduate_main/test/root_setup.py
mxito3/graduate_pro
7fca6e0387f741b8fc887cddd7e7fd8c9953a330
[ "MIT" ]
1
2021-06-02T01:18:04.000Z
2021-06-02T01:18:04.000Z
graduate_main/test/root_setup.py
mxito3/graduate_pro
7fca6e0387f741b8fc887cddd7e7fd8c9953a330
[ "MIT" ]
null
null
null
import sys import os.path root_directory=os.path.abspath(os.path.join(os.path.abspath(__file__),"../../../")) print(root_directory) sys.path.append(root_directory)
32.6
83
0.766871
25
163
4.72
0.44
0.20339
0.220339
0
0
0
0
0
0
0
0
0
0.03681
163
5
84
32.6
0.751592
0
0
0
0
0
0.054878
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0.2
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
4e64bc63448a1de096d082cb2c97c554ebbe5870
46
py
Python
daceml/transformation/__init__.py
TizianoDeMatteis/daceml
d11ab15a8681ec0e0c52a68b838fb70e26ea6559
[ "BSD-3-Clause" ]
null
null
null
daceml/transformation/__init__.py
TizianoDeMatteis/daceml
d11ab15a8681ec0e0c52a68b838fb70e26ea6559
[ "BSD-3-Clause" ]
null
null
null
daceml/transformation/__init__.py
TizianoDeMatteis/daceml
d11ab15a8681ec0e0c52a68b838fb70e26ea6559
[ "BSD-3-Clause" ]
null
null
null
from .constant_folding import ConstantFolding
23
45
0.891304
5
46
8
1
0
0
0
0
0
0
0
0
0
0
0
0.086957
46
1
46
46
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
4e83dc5a790c587e62667ababccb48beb61bbff0
164
py
Python
ebl/fragmentarium/application/fragment_pager_info_schema.py
ElectronicBabylonianLiterature/dictionary
5977a57314cf57f94f75cd12520f178b1d6a6555
[ "MIT" ]
4
2020-04-12T14:24:51.000Z
2020-10-15T15:48:15.000Z
ebl/fragmentarium/application/fragment_pager_info_schema.py
ElectronicBabylonianLiterature/dictionary
5977a57314cf57f94f75cd12520f178b1d6a6555
[ "MIT" ]
200
2019-12-04T09:53:20.000Z
2022-03-30T20:11:31.000Z
ebl/fragmentarium/application/fragment_pager_info_schema.py
ElectronicBabylonianLiterature/dictionary
5977a57314cf57f94f75cd12520f178b1d6a6555
[ "MIT" ]
1
2021-09-06T16:22:39.000Z
2021-09-06T16:22:39.000Z
from marshmallow import Schema, fields class FragmentPagerInfoSchema(Schema): previous = fields.String(required=True) next = fields.String(required=True)
23.428571
43
0.77439
18
164
7.055556
0.666667
0.188976
0.314961
0.377953
0
0
0
0
0
0
0
0
0.140244
164
6
44
27.333333
0.900709
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
4e9318d8f6e3ee9cd3a3ec14f83e44b6b8c4c547
154
py
Python
project/account/admin.py
leehe228/Ecoverse
1554e4f44c8ba3cc60a0b7f2509f4d9b7a94099a
[ "CC-BY-4.0" ]
null
null
null
project/account/admin.py
leehe228/Ecoverse
1554e4f44c8ba3cc60a0b7f2509f4d9b7a94099a
[ "CC-BY-4.0" ]
null
null
null
project/account/admin.py
leehe228/Ecoverse
1554e4f44c8ba3cc60a0b7f2509f4d9b7a94099a
[ "CC-BY-4.0" ]
null
null
null
from django.contrib import admin from .models import User, Ingame # Register your models here. admin.site.register(User) admin.site.register(Ingame) #
15.4
32
0.779221
22
154
5.454545
0.545455
0.15
0.283333
0
0
0
0
0
0
0
0
0
0.12987
154
9
33
17.111111
0.895522
0.168831
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
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
4eb3ae5369bcaede734db944101db2aed1345d9c
3,958
py
Python
tests/test_frame_unmarshaling_errors.py
annuupadhyayPS/pamqp
cf7b3d2ba367ff8226b1a6a1fbf6931162de3574
[ "BSD-3-Clause" ]
38
2015-08-24T06:52:59.000Z
2022-02-06T09:48:15.000Z
tests/test_frame_unmarshaling_errors.py
annuupadhyayPS/pamqp
cf7b3d2ba367ff8226b1a6a1fbf6931162de3574
[ "BSD-3-Clause" ]
33
2015-01-05T19:28:05.000Z
2022-02-13T22:31:36.000Z
tests/test_frame_unmarshaling_errors.py
annuupadhyayPS/pamqp
cf7b3d2ba367ff8226b1a6a1fbf6931162de3574
[ "BSD-3-Clause" ]
21
2015-05-06T08:33:28.000Z
2022-02-19T19:39:33.000Z
# coding=utf-8 import struct import unittest from pamqp import constants, exceptions, frame class TestCase(unittest.TestCase): def test_invalid_protocol_header(self): with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(b'AMQP\x00\x00\t') self.assertTrue(str(err).startswith( "Could not unmarshal <class 'pamqp.header.ProtocolHeader'> " 'frame: Data did not match the ProtocolHeader format')) def test_invalid_frame_header(self): frame_data = struct.pack('>BI', 255, 0) with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(frame_data) self.assertEqual( str(err), 'Could not unmarshal Unknown frame: No frame size') def test_frame_with_no_length(self): frame_data = (b'\x01\x00\x01\x00\x00\x00\x00\x00<\x00P\x00\x00\x00\x00' b'\x00\x00\x00\x01\x00\xce') with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(frame_data) self.assertEqual( str(err), 'Could not unmarshal Unknown frame: No frame size') def test_frame_malformed_length(self): frame_data = (b'\x01\x00\x01\x00\x00\x00\x0c\x00<\x00P\x00\x00\x00\x00' b'\x00\x00\x00\xce') with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(frame_data) self.assertEqual( str(err), 'Could not unmarshal Unknown frame: Not all data received') def test_frame_malformed_end_byte(self): frame_data = (b'\x01\x00\x01\x00\x00\x00\r\x00<\x00P\x00\x00\x00\x00' b'\x00\x00\x00\x01\x00\x00') with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(frame_data) self.assertEqual( str(err), 'Could not unmarshal Unknown frame: Last byte error') def test_malformed_frame_content(self): payload = struct.pack('>HxxQ', 8192, 32768) frame_value = b''.join([struct.pack('>BHI', 5, 0, len(payload)), payload, constants.FRAME_END_CHAR]) with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(frame_value) self.assertEqual( str(err), 'Could not unmarshal Unknown frame: Unknown frame type: 5') def test_invalid_method_frame_index(self): payload = struct.pack('>L', 42949) frame_value = b''.join([struct.pack('>BHI', 1, 0, len(payload)), payload, constants.FRAME_END_CHAR]) with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(frame_value) self.assertEqual( str(err), ('Could not unmarshal Unknown frame: ' 'Unknown method index: 42949')) def test_invalid_method_frame_content(self): payload = struct.pack('>L', 0x000A0029) frame_value = b''.join([struct.pack('>BHI', 1, 0, len(payload)), payload, constants.FRAME_END_CHAR]) with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(frame_value) self.assertTrue(str(err).startswith( 'Could not unmarshal <pamqp.specification.Connection.OpenOk')) def test_invalid_content_header_frame(self): payload = struct.pack('>L', 0x000A0029) frame_value = b''.join([struct.pack('>BHI', 2, 0, len(payload)), payload, constants.FRAME_END_CHAR]) with self.assertRaises(exceptions.UnmarshalingException) as err: frame.unmarshal(frame_value) self.assertTrue(str(err).startswith( 'Could not unmarshal ContentHeader frame:'))
44.977273
79
0.614452
454
3,958
5.23348
0.185022
0.063131
0.05303
0.113636
0.785354
0.757155
0.738215
0.726431
0.70665
0.677189
0
0.054584
0.277918
3,958
87
80
45.494253
0.776767
0.003032
0
0.540541
0
0.040541
0.201572
0.06998
0
0
0.005071
0
0.243243
1
0.121622
false
0
0.040541
0
0.175676
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
4ed9cc2a600c1d17b17624862d8eafc6a548e2be
272
py
Python
goopylib/imports.py
BhavyeMathur/goopylib
f9eb1458e9218a8dd4add6693ce70b804624bf91
[ "MIT" ]
25
2020-07-09T10:57:16.000Z
2022-02-06T10:31:34.000Z
goopylib/imports.py
BhavyeMathur/goopy
f9eb1458e9218a8dd4add6693ce70b804624bf91
[ "MIT" ]
48
2020-07-02T20:08:40.000Z
2020-07-06T16:09:25.000Z
goopylib/imports.py
BhavyeMathur/goopy
f9eb1458e9218a8dd4add6693ce70b804624bf91
[ "MIT" ]
1
2020-12-01T13:45:53.000Z
2020-12-01T13:45:53.000Z
from goopylib.styles import * from goopylib.util import * from goopylib.constants import * from goopylib.colours import * from goopylib.Window import Window from goopylib.objects.imports import * from goopylib.maths.imports import * from goopylib.sound.imports import *
24.727273
38
0.808824
36
272
6.111111
0.333333
0.436364
0.490909
0.227273
0
0
0
0
0
0
0
0
0.125
272
10
39
27.2
0.92437
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
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
0
0
0
5
14f851ff92e887a0afc83031923373bfc6a58480
162
py
Python
impress/json.py
somia/impress
6ebacd0cc7c5e089364d5d37be071e4768c273b1
[ "BSD-2-Clause" ]
1
2020-09-02T04:02:17.000Z
2020-09-02T04:02:17.000Z
impress/json.py
somia/impress
6ebacd0cc7c5e089364d5d37be071e4768c273b1
[ "BSD-2-Clause" ]
null
null
null
impress/json.py
somia/impress
6ebacd0cc7c5e089364d5d37be071e4768c273b1
[ "BSD-2-Clause" ]
null
null
null
from __future__ import absolute_import import json from json import loads separators = ",", ":" def dumps(obj): return json.dumps(obj, separators=separators)
16.2
46
0.759259
21
162
5.619048
0.52381
0.135593
0
0
0
0
0
0
0
0
0
0
0.141975
162
9
47
18
0.848921
0
0
0
0
0
0.012346
0
0
0
0
0
0
1
0.166667
false
0
0.5
0.166667
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
5
09001a5c6774a7a9b4f373a9b5243603938274b1
75
py
Python
vformer/common/__init__.py
aditya-agrawal-30502/vformer
e1f4950f980238442ff1dc39a8f0791e4fbc9dac
[ "MIT" ]
90
2021-09-08T10:21:19.000Z
2022-03-26T18:11:47.000Z
vformer/common/__init__.py
aditya-agrawal-30502/vformer
e1f4950f980238442ff1dc39a8f0791e4fbc9dac
[ "MIT" ]
72
2021-09-09T06:54:50.000Z
2022-03-31T09:23:31.000Z
vformer/common/__init__.py
aditya-agrawal-30502/vformer
e1f4950f980238442ff1dc39a8f0791e4fbc9dac
[ "MIT" ]
21
2021-09-09T05:56:03.000Z
2022-03-20T08:22:09.000Z
from .base_model import BaseClassificationModel from .blocks import DWConv
25
47
0.866667
9
75
7.111111
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.106667
75
2
48
37.5
0.955224
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
0947636560364d62cfa092e946c32ba0bc3eb728
115
py
Python
src/rbls/admin.py
speedlight/rblmonitor
40e51398c7395c5b123e24eb4829529492a4343b
[ "MIT" ]
4
2017-05-04T05:14:54.000Z
2018-09-12T07:52:50.000Z
src/rbls/admin.py
speedlight/rblmonitor
40e51398c7395c5b123e24eb4829529492a4343b
[ "MIT" ]
null
null
null
src/rbls/admin.py
speedlight/rblmonitor
40e51398c7395c5b123e24eb4829529492a4343b
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Rbllist admin.site.register(Rbllist, list_display = ['name'])
28.75
53
0.791304
16
115
5.625
0.75
0
0
0
0
0
0
0
0
0
0
0
0.104348
115
4
53
28.75
0.873786
0
0
0
0
0
0.034483
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
095dbfdcd8405ba7d1f37f9a7ecd050f1c2184ca
92
py
Python
__init__.py
zags4life/read_only_collections
6e5af00115c27a53a92c796f2ab7ea10afb19d68
[ "Apache-2.0" ]
null
null
null
__init__.py
zags4life/read_only_collections
6e5af00115c27a53a92c796f2ab7ea10afb19d68
[ "Apache-2.0" ]
null
null
null
__init__.py
zags4life/read_only_collections
6e5af00115c27a53a92c796f2ab7ea10afb19d68
[ "Apache-2.0" ]
null
null
null
# __init__.py from .readonlydict import ReadOnlyDict from .readonlylist import ReadOnlyList
23
38
0.847826
10
92
7.4
0.6
0
0
0
0
0
0
0
0
0
0
0
0.108696
92
4
39
23
0.902439
0.119565
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
1182ed63ccdf29b648fbd7e2a539566932559358
36
py
Python
Day_1_Scientific_Python/numpys/_solutions/02_dataset_intro_2.py
rth/data-science-workshop-2021
4a048d9732c60b6015c324212abdb4c51041263c
[ "BSD-3-Clause" ]
null
null
null
Day_1_Scientific_Python/numpys/_solutions/02_dataset_intro_2.py
rth/data-science-workshop-2021
4a048d9732c60b6015c324212abdb4c51041263c
[ "BSD-3-Clause" ]
1
2021-05-17T08:43:36.000Z
2021-05-17T08:43:36.000Z
Day_1_Scientific_Python/numpys/_solutions/02_dataset_intro_2.py
rth/data-science-workshop-2021
4a048d9732c60b6015c324212abdb4c51041263c
[ "BSD-3-Clause" ]
1
2021-05-13T12:06:35.000Z
2021-05-13T12:06:35.000Z
b = a[2, [0, 2, 3]] print(b) type(b)
12
19
0.472222
10
36
1.7
0.7
0
0
0
0
0
0
0
0
0
0
0.137931
0.194444
36
3
20
12
0.448276
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
1186483a35df40a409a4597ea2fc8b51e009fb7a
276
py
Python
pyngsi/tests/test_iso8601.py
Orange-OpenSource/pyngsi
86bdb3218850b82d219278b831a3e96b0fb4655b
[ "Apache-2.0" ]
1
2021-11-05T16:45:04.000Z
2021-11-05T16:45:04.000Z
pyngsi/tests/test_iso8601.py
Orange-OpenSource/pyngsi
86bdb3218850b82d219278b831a3e96b0fb4655b
[ "Apache-2.0" ]
null
null
null
pyngsi/tests/test_iso8601.py
Orange-OpenSource/pyngsi
86bdb3218850b82d219278b831a3e96b0fb4655b
[ "Apache-2.0" ]
1
2021-06-22T09:14:15.000Z
2021-06-22T09:14:15.000Z
#!/usr/bin/env python3 from datetime import datetime, timezone from pyngsi.utils.iso8601 import datetime_to_iso8601 def test_datetime_to_iso8601(): dt = datetime(2021, 5, 18, 17, 45, 00, tzinfo=timezone.utc) assert datetime_to_iso8601(dt) == "2021-05-18T17:45:00Z"
27.6
63
0.75
43
276
4.651163
0.627907
0.15
0.255
0.19
0
0
0
0
0
0
0
0.1841
0.134058
276
9
64
30.666667
0.65272
0.076087
0
0
0
0
0.07874
0
0
0
0
0
0.2
1
0.2
false
0
0.4
0
0.6
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
1192921f8a7b1eab92f87703fe5f132598af6d6e
89
py
Python
bitmovin_api_sdk/account/organizations/groups/tenants/__init__.py
jaythecaesarean/bitmovin-api-sdk-python
48166511fcb9082041c552ace55a9b66cc59b794
[ "MIT" ]
11
2019-07-03T10:41:16.000Z
2022-02-25T21:48:06.000Z
bitmovin_api_sdk/account/organizations/groups/tenants/__init__.py
jaythecaesarean/bitmovin-api-sdk-python
48166511fcb9082041c552ace55a9b66cc59b794
[ "MIT" ]
8
2019-11-23T00:01:25.000Z
2021-04-29T12:30:31.000Z
bitmovin_api_sdk/account/organizations/groups/tenants/__init__.py
jaythecaesarean/bitmovin-api-sdk-python
48166511fcb9082041c552ace55a9b66cc59b794
[ "MIT" ]
13
2020-01-02T14:58:18.000Z
2022-03-26T12:10:30.000Z
from bitmovin_api_sdk.account.organizations.groups.tenants.tenants_api import TenantsApi
44.5
88
0.898876
12
89
6.416667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.044944
89
1
89
89
0.905882
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
11a28788004bae67f07c0f599f0c3b14e7e2e891
165
py
Python
core/admin.py
ktowen/python.pizza.2020-project
795b80ddf2f94cd1e51e1504df4f3e21e279fa24
[ "MIT" ]
null
null
null
core/admin.py
ktowen/python.pizza.2020-project
795b80ddf2f94cd1e51e1504df4f3e21e279fa24
[ "MIT" ]
null
null
null
core/admin.py
ktowen/python.pizza.2020-project
795b80ddf2f94cd1e51e1504df4f3e21e279fa24
[ "MIT" ]
null
null
null
from django.contrib import admin from core.models import Libro, Autor, Articulo admin.site.register(Libro) admin.site.register(Autor) admin.site.register(Articulo)
23.571429
46
0.818182
24
165
5.625
0.5
0.2
0.377778
0
0
0
0
0
0
0
0
0
0.084848
165
7
47
23.571429
0.89404
0
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
11a887b41fddc41b1cb6691bb035c937d90e6aca
2,205
py
Python
tests/conftest.py
fuzzmz/vspheretools
10890423bfbba976e3ddee61204e9eed4b73fe92
[ "MIT" ]
22
2016-05-30T15:43:44.000Z
2022-02-06T02:56:42.000Z
tests/conftest.py
fuzzmz/vspheretools
10890423bfbba976e3ddee61204e9eed4b73fe92
[ "MIT" ]
7
2016-05-19T16:01:55.000Z
2017-07-11T11:50:32.000Z
tests/conftest.py
fuzzmz/vspheretools
10890423bfbba976e3ddee61204e9eed4b73fe92
[ "MIT" ]
4
2018-10-12T09:47:13.000Z
2021-06-21T01:53:51.000Z
# -*- coding: utf-8 -*- import pysphere def pytest_sessionstart(session): class VMInstanceWrapper(object): def __init__(self, status='POWERED OFF'): self.status = status def get_status(self, *args, **kwargs): return self.status def power_on(self, *args, **kwargs): return 'TEST POWER ON' def power_off(self, *args, **kwargs): return 'TEST POWER OFF' def wait_for_tools(self, *args, **kwargs): return 'Waiting until OS started...' def get_properties(self, *args, **kwargs): return {'ip_address': '0.0.0.0', 'test': 123, 'testSub': {'subName': {'subSubName': 'qqq'}}} def get_current_snapshot_name(self, *args, **kwargs): return '' def get_snapshots(self, *args, **kwargs): return ['current snapshot', 'another snapshot'] def revert_to_snapshot(self, *args, **kwargs): return 'reverting to current snapshot...' def revert_to_named_snapshot(self, *args, **kwargs): return 'reverting to named snapshot...' def delete_named_snapshot(self, *args, **kwargs): return 'deleting named snapshot...' def create_snapshot(self, *args, **kwargs): return 'creating new snapshot...' def clone(self, *args, **kwargs): return 'cloning vm...' def login_in_guest(self, *args, **kwargs): return 'login in guest' def send_file(self, *args, **kwargs): return 'sending file...' def get_file(self, *args, **kwargs): return 'geting file...' def make_directory(self, *args, **kwargs): return 'making directory...' class VIServerWrapper(object): def connect(self, *args, **kwargs): return 'CONNECTED' def get_vm_by_name(self, *args, **kwargs): if 'FAKE' in args: raise Exception('No Name found for CloneVM test') else: return VMInstanceWrapper() def delete_vm_by_name(self, *args, **kwargs): return True, 'DELETED' pysphere.VIServer = VIServerWrapper
28.636364
104
0.5678
240
2,205
5.070833
0.341667
0.124897
0.21857
0.295809
0.266228
0.179129
0.064092
0
0
0
0
0.005198
0.302041
2,205
76
105
29.013158
0.785575
0.009524
0
0
0
0
0.175069
0
0
0
0
0
0
1
0.4375
false
0
0.020833
0.375
0.895833
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
11da0582c2df389685e16cf7708ee2c2fbab05fe
84
py
Python
__init__.py
mszsorondo/marcosz_distributions
12c7a32014e85bc2d4ade9b01bb7603d89c46300
[ "MIT" ]
null
null
null
__init__.py
mszsorondo/marcosz_distributions
12c7a32014e85bc2d4ade9b01bb7603d89c46300
[ "MIT" ]
null
null
null
__init__.py
mszsorondo/marcosz_distributions
12c7a32014e85bc2d4ade9b01bb7603d89c46300
[ "MIT" ]
null
null
null
from Gaussiandistribution import Gaussian from Binomialdistribution import Binomial
28
41
0.904762
8
84
9.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.095238
84
2
42
42
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
11e594445a0795c68b55db2252ca44078b4d05d7
3,845
py
Python
data/processing/resizer.py
IsmaelMekene/meteor-object-detector
0c385b04e63e73c0f9cee21fee361bdbbc5ef300
[ "MIT" ]
null
null
null
data/processing/resizer.py
IsmaelMekene/meteor-object-detector
0c385b04e63e73c0f9cee21fee361bdbbc5ef300
[ "MIT" ]
null
null
null
data/processing/resizer.py
IsmaelMekene/meteor-object-detector
0c385b04e63e73c0f9cee21fee361bdbbc5ef300
[ "MIT" ]
null
null
null
import numpy as np import pandas as pd import matplotlib.pyplot as plt import glob2 import PIL try: import Image except ImportError: from PIL import Image import cv2 from skimage import io, color from tensorflow import keras import tensorflow as tf tf.__version__ from keras.layers import * from tqdm import tqdm import ast import shutil def resize_image(image_path): al = plt.imread(image_path) #print('the initial shape is:',al.shape) if len(al.shape) == 2: al = cv2.merge((al,al,al)) elif al.shape[2] == 4: al = cv2.cvtColor(al, cv2.COLOR_BGRA2BGR) else: al = al w = al.shape[1] #store the width h = al.shape[0] #store the height c = al.shape[2] #store the number of channels(3 in this case) #print(c) # In case image is horizontally orientated if w > h: combine = np.zeros((w,w,c)) combino = combine for i in range(c): combino[int((w-h)/2):int(((w-h)/2)+h) ,: ,i] = al[:,:,i] resized = cv2.resize(combino, (480, 480), interpolation=cv2.INTER_NEAREST) # In case image is vertically orientated elif w < h: combine = np.zeros((h,h,c)) combino = combine for i in range(c): combino[: ,int((h-w)/2):int(((h-w)/2)+w) ,i] = al[:,:,i] resized = cv2.resize(combino, (480, 480), interpolation=cv2.INTER_NEAREST) # In case image is squared else: resized = cv2.resize(al, (480, 480), interpolation=cv2.INTER_NEAREST) al = resized #plt.imshow(al.astype(np.uint8)) # to Clip input data to the valid range for imshow with RGB data. #plt.show() #print('the final shape is:',al.shape) return al def resize_mask(ali): w = ali.shape[1] #store the width h = ali.shape[0] #store the height #c = al.shape[2] #store the number of channels(3 in this case) #print(c) al = ali.reshape((h,w)) #print('the initial shape is:',al.shape) # In case image is horizontally orientated if w > h: combine = np.zeros((w,w)) combine[int((w-h)/2):int(((w-h)/2)+h) ,:] = al[:,:] resized = cv2.resize(combine, (480, 480), interpolation=cv2.INTER_NEAREST) # In case image is vertically orientated elif w < h: combine = np.zeros((h,h)) combine[: ,int((h-w)/2):int(((h-w)/2)+w)] = al[:,:] resized = cv2.resize(combine, (480, 480), interpolation=cv2.INTER_NEAREST) # In case image is squared else: resized = cv2.resize(al, (480, 480), interpolation=cv2.INTER_NEAREST) #print('the final shape of resized is:',resized.shape) alou = np.reshape(resized, (480, 480, 1)) #plt.imshow(resized) # to Clip input data to the valid range for imshow with RGB data. #plt.show() #print('the final shape is:',alai.shape) return alou def resize_distancegeo(npy_path): al = npy_path #al = np.load(npy_path) #print('the initial shape is:',al.shape) w = al.shape[1] #store the width h = al.shape[0] #store the height c = al.shape[2] #store the number of channels(3 in this case) #print(c) # In case image is horizontally orientated if w > h: combine = np.zeros((w,w,c)) combino = combine for i in range(c): combino[int((w-h)/2):int(((w-h)/2)+h) ,: ,i] = al[:,:,i] resized = cv2.resize(combino, (480, 480), interpolation=cv2.INTER_NEAREST) # In case image is vertically orientated elif w < h: combine = np.zeros((h,h,c)) combino = combine for i in range(c): combino[: ,int((h-w)/2):int(((h-w)/2)+w) ,i] = al[:,:,i] resized = cv2.resize(combino, (480, 480), interpolation=cv2.INTER_NEAREST) # In case image is squared else: resized = cv2.resize(al, (480, 480), interpolation=cv2.INTER_NEAREST) al = resized #plt.imshow(al.astype(np.uint8)) # to Clip input data to the valid range for imshow with RGB data. #plt.show() #print('the final shape is:',al.shape) return al
23.023952
101
0.637971
626
3,845
3.883387
0.158147
0.040313
0.040724
0.048128
0.755245
0.755245
0.747018
0.735088
0.707939
0.697244
0
0.037636
0.212224
3,845
166
102
23.162651
0.764939
0.310793
0
0.54878
0
0
0
0
0
0
0
0
0
1
0.036585
false
0
0.195122
0
0.268293
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
eea9a3f0003c8cc9767d6dda37f264b12004cb02
126
py
Python
codeswiftr/home/admin.py
bogdan-veliscu/dev-portfolio-website
43eb323c67f3fd691388e79039e32479c1bc0974
[ "Apache-2.0" ]
null
null
null
codeswiftr/home/admin.py
bogdan-veliscu/dev-portfolio-website
43eb323c67f3fd691388e79039e32479c1bc0974
[ "Apache-2.0" ]
4
2021-03-30T13:40:00.000Z
2021-09-22T19:12:56.000Z
codeswiftr/home/admin.py
bogdan-veliscu/dev-portfolio-website
43eb323c67f3fd691388e79039e32479c1bc0974
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import AppLanding # Register your models here. admin.site.register(AppLanding)
21
32
0.81746
17
126
6.058824
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.119048
126
5
33
25.2
0.927928
0.206349
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
eec5455d76da71445aa46376151ca32b7d3c840d
75
py
Python
extensions/.stubs/clrclasses/System/Runtime/InteropServices/Expando/__init__.py
vicwjb/Pycad
7391cd694b7a91ad9f9964ec95833c1081bc1f84
[ "MIT" ]
1
2020-03-25T03:27:24.000Z
2020-03-25T03:27:24.000Z
extensions/.stubs/clrclasses/System/Runtime/InteropServices/Expando/__init__.py
vicwjb/Pycad
7391cd694b7a91ad9f9964ec95833c1081bc1f84
[ "MIT" ]
null
null
null
extensions/.stubs/clrclasses/System/Runtime/InteropServices/Expando/__init__.py
vicwjb/Pycad
7391cd694b7a91ad9f9964ec95833c1081bc1f84
[ "MIT" ]
null
null
null
from __clrclasses__.System.Runtime.InteropServices.Expando import IExpando
37.5
74
0.893333
8
75
7.875
1
0
0
0
0
0
0
0
0
0
0
0
0.053333
75
1
75
75
0.887324
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
eee637439bf259836d2ad4e6155806916157600f
52
py
Python
plugins/__init__.py
trishume/VintageousPlus
1dd62435138234979fe5bb413e1731119b017daf
[ "MIT" ]
6
2017-04-01T05:30:08.000Z
2017-04-05T14:17:40.000Z
plugins/__init__.py
trishume/VintageousPlus
1dd62435138234979fe5bb413e1731119b017daf
[ "MIT" ]
1
2017-04-04T06:47:13.000Z
2017-04-04T14:26:32.000Z
plugins/__init__.py
trishume/VintageousPlus
1dd62435138234979fe5bb413e1731119b017daf
[ "MIT" ]
null
null
null
from VintageousPlus.plugins.plugins import register
26
51
0.884615
6
52
7.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.076923
52
1
52
52
0.958333
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
011ea5e17e4b463463a18f2369a90b362da29def
39
py
Python
jxaas/__init__.py
jxaas/cli
e28932722c571b03658a9979f62a5c9f92def8c5
[ "Apache-2.0" ]
null
null
null
jxaas/__init__.py
jxaas/cli
e28932722c571b03658a9979f62a5c9f92def8c5
[ "Apache-2.0" ]
2
2015-01-19T23:13:46.000Z
2015-01-19T23:14:16.000Z
jxaas/__init__.py
jxaas/cli
e28932722c571b03658a9979f62a5c9f92def8c5
[ "Apache-2.0" ]
null
null
null
from main import * from simple import *
19.5
20
0.769231
6
39
5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.179487
39
2
20
19.5
0.9375
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
0131aa40b1873d0f59d3196eea601b68241072b8
78
py
Python
scripts/start_daemon.py
jsannemo/programming-battle
6db807836bcb046ceb02c9ee02ac2f7b023c6635
[ "BSD-2-Clause" ]
1
2016-05-31T00:23:29.000Z
2016-05-31T00:23:29.000Z
scripts/start_daemon.py
simonlindholm/programming-battle
2fa7d52d3db0b511d6cbef7fcf4b18966c6d97eb
[ "BSD-2-Clause" ]
null
null
null
scripts/start_daemon.py
simonlindholm/programming-battle
2fa7d52d3db0b511d6cbef7fcf4b18966c6d97eb
[ "BSD-2-Clause" ]
1
2019-07-08T04:52:04.000Z
2019-07-08T04:52:04.000Z
#!/usr/bin/env python3 from battle.main import start_backend start_backend()
15.6
37
0.794872
12
78
5
0.833333
0.4
0
0
0
0
0
0
0
0
0
0.014286
0.102564
78
4
38
19.5
0.842857
0.269231
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
01477ef4ceab8be6ced71eef3eba8a5bc9066637
67
py
Python
waveglow_inference/__init__.py
narumiruna/waveglow-inference
47dbc10ed7d7e87caff8262e5783b5c0f2d4e519
[ "BSD-3-Clause" ]
1
2020-08-06T16:18:18.000Z
2020-08-06T16:18:18.000Z
waveglow_inference/__init__.py
narumiruna/waveglow-inference
47dbc10ed7d7e87caff8262e5783b5c0f2d4e519
[ "BSD-3-Clause" ]
null
null
null
waveglow_inference/__init__.py
narumiruna/waveglow-inference
47dbc10ed7d7e87caff8262e5783b5c0f2d4e519
[ "BSD-3-Clause" ]
null
null
null
from .inference import synthesize from .layers import TacotronSTFT
22.333333
33
0.850746
8
67
7.125
0.75
0
0
0
0
0
0
0
0
0
0
0
0.119403
67
2
34
33.5
0.966102
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
6da4cf82e63b24678babb9c3abcab6b8e486c44a
2,187
py
Python
idl2py/star/vactoair.py
RapidLzj/idl2py
193051cd8d01db0d125b8975713b885ad521a992
[ "MIT" ]
null
null
null
idl2py/star/vactoair.py
RapidLzj/idl2py
193051cd8d01db0d125b8975713b885ad521a992
[ "MIT" ]
null
null
null
idl2py/star/vactoair.py
RapidLzj/idl2py
193051cd8d01db0d125b8975713b885ad521a992
[ "MIT" ]
null
null
null
""" By Dr Jie Zheng -Q, NAOC v1 2019-04-27 """ import numpy as np from..util import * def vactoair(): pass #pro vactoair,wave_vac, wave_air #;+ #; NAME: #; VACTOAIR #; PURPOSE: #; Convert vacuum wavelengths to air wavelengths #; EXPLANATION: #; Corrects for the index of refraction of air under standard conditions. #; Wavelength values below 2000 A will not be altered. Accurate to #; about 10 m/s. #; #; CALLING SEQUENCE: #; VACTOAIR, WAVE_VAC, [WAVE_AIR] #; #; INPUT/OUTPUT: #; WAVE_VAC - Vacuum Wavelength in Angstroms, scalar or vector #; If the second parameter is not supplied, then this will be #; updated on output to contain double precision air wavelengths. #; #; OPTIONAL OUTPUT: #; WAVE_AIR - Air wavelength in Angstroms, same number of elements as #; WAVE_VAC, double precision #; #; EXAMPLE: #; If the vacuum wavelength is W = 2000, then #; #; IDL> VACTOAIR, W #; #; yields an air wavelength of W = 1999.353 Angstroms #; #; METHOD: #; Formula from Ciddor 1996 Applied Optics , 35, 1566 #; #; REVISION HISTORY #; Written, D. Lindler 1982 #; Documentation W. Landsman Feb. 1989 #; Use Ciddor (1996) formula for better accuracy in the infrared #; Added optional output vector, W Landsman Mar 2011 #;- # On_error,2 # compile_opt idl2 # # if N_params() EQ 0 then begin # print,'Syntax - VACTOAIR, Wave_Vac, [Wave_Air]' # return # endif # # wave_air = double(wave_vac) # g = where(wave_vac GE 2000, Ng) ;Only modify above 2000 A # # if Ng GT 0 then begin # # sigma2 = (1d4/double(wave_vac[g]) )^2. ;Convert to wavenumber squared # #; Compute conversion factor # # fact = 1.D + 5.792105D-2/(238.0185D0 - sigma2) + $ # 1.67917D-3/( 57.362D0 - sigma2) # # #; Convert wavelengths # # wave_air[g] = wave_vac[g]/fact # if N_Params() eq 1 then wave_vac = wave_air # endif # # return # end
26.349398
82
0.572931
272
2,187
4.529412
0.551471
0.056818
0.035714
0.045455
0.053571
0
0
0
0
0
0
0.068336
0.324188
2,187
82
83
26.670732
0.765223
0.791495
0
0
0
0
0
0
0
0
0
0
0
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
6da8643b830a5d053cc64f2d9c0e194bc073beee
82
py
Python
src/elaspic2/plugins/protbert/types.py
elaspic/elaspic2
edabe98de79b720715b798d3c5d33b613f978788
[ "MIT" ]
3
2021-07-12T21:38:56.000Z
2021-11-04T01:39:40.000Z
src/elaspic2/plugins/protbert/types.py
elaspic/elaspic2
edabe98de79b720715b798d3c5d33b613f978788
[ "MIT" ]
2
2021-02-23T08:30:01.000Z
2021-06-12T12:49:56.000Z
src/elaspic2/plugins/protbert/types.py
elaspic/elaspic2
edabe98de79b720715b798d3c5d33b613f978788
[ "MIT" ]
2
2021-07-12T21:38:58.000Z
2021-11-04T01:39:43.000Z
from typing import NamedTuple class ProtBertData(NamedTuple): sequence: str
13.666667
31
0.780488
9
82
7.111111
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.170732
82
5
32
16.4
0.941176
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
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
6db393236b08485a015be81fbebbeacb3f0b2770
19
py
Python
startup.py
gwolf0719/python_ufs
08dd005c71b8e66ed07ee2a65fbc7aa09f124b93
[ "BSD-3-Clause" ]
null
null
null
startup.py
gwolf0719/python_ufs
08dd005c71b8e66ed07ee2a65fbc7aa09f124b93
[ "BSD-3-Clause" ]
15
2021-02-02T23:02:23.000Z
2021-08-09T02:21:43.000Z
startup.py
gwolf0719/python_ufs
08dd005c71b8e66ed07ee2a65fbc7aa09f124b93
[ "BSD-3-Clause" ]
1
2020-03-16T10:27:28.000Z
2020-03-16T10:27:28.000Z
from . import wsgi2
19
19
0.789474
3
19
5
1
0
0
0
0
0
0
0
0
0
0
0.0625
0.157895
19
1
19
19
0.875
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
6de60261329210d9d51d0a2e28b13d0976bf29b4
182
py
Python
algorithms/pickingNumbers.py
marismarcosta/hackerrank
3580b4fe0094e2a13f9a7efeeb0e072810be9ebf
[ "MIT" ]
null
null
null
algorithms/pickingNumbers.py
marismarcosta/hackerrank
3580b4fe0094e2a13f9a7efeeb0e072810be9ebf
[ "MIT" ]
3
2020-09-27T22:57:05.000Z
2020-09-29T23:07:44.000Z
algorithms/pickingNumbers.py
marismarcosta/hackerrank-challenges
3580b4fe0094e2a13f9a7efeeb0e072810be9ebf
[ "MIT" ]
1
2020-11-06T21:16:19.000Z
2020-11-06T21:16:19.000Z
def pickingNumbers(a): solution = 0 for num1 in a: if a.count(num1) + a.count(num1 + 1) > solution: solution = a.count(num1) + a.count(num1 + 1) return solution
22.75
52
0.60989
28
182
3.964286
0.428571
0.216216
0.36036
0.198198
0.378378
0.378378
0.378378
0
0
0
0
0.059259
0.258242
182
8
53
22.75
0.762963
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.333333
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0992cee1165362724405810c82cb40901b1a6ca6
93
py
Python
db_table_creation.py
fs714/sqlalchemy-example
397e3fe2e53f6a10ebc00d4a0dc354e45b005c91
[ "Apache-2.0" ]
null
null
null
db_table_creation.py
fs714/sqlalchemy-example
397e3fe2e53f6a10ebc00d4a0dc354e45b005c91
[ "Apache-2.0" ]
null
null
null
db_table_creation.py
fs714/sqlalchemy-example
397e3fe2e53f6a10ebc00d4a0dc354e45b005c91
[ "Apache-2.0" ]
null
null
null
from db_objects import Base from db_session import engine Base.metadata.create_all(engine)
15.5
32
0.83871
15
93
5
0.666667
0.16
0
0
0
0
0
0
0
0
0
0
0.11828
93
5
33
18.6
0.914634
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
09972a181368a40ebf716ce0d02ad3dc73dd61fe
13,381
py
Python
examples/extinction.py
zhiweijt/pyLRT
58efa005fdb32b4d4261411972f685bb18f1ebc8
[ "BSD-3-Clause" ]
7
2020-10-16T18:04:02.000Z
2022-03-23T11:35:07.000Z
examples/extinction.py
GermanZz/pyLRT
58efa005fdb32b4d4261411972f685bb18f1ebc8
[ "BSD-3-Clause" ]
2
2020-10-12T08:34:52.000Z
2021-03-31T10:15:45.000Z
examples/extinction.py
GermanZz/pyLRT
58efa005fdb32b4d4261411972f685bb18f1ebc8
[ "BSD-3-Clause" ]
9
2020-10-16T20:02:22.000Z
2022-03-23T06:31:28.000Z
from pyLRT import RadTran, get_lrt_folder from pyLRT.misc import planck_function import matplotlib.pyplot as plt import copy import numpy as np import scipy import scipy.interpolate LIBRADTRAN_FOLDER = get_lrt_folder() slrt = RadTran(LIBRADTRAN_FOLDER) slrt.options['rte_solver'] = 'disort' slrt.options['source'] = 'solar' slrt.options['wavelength'] = '200 2600' slrt.options['output_user'] = 'lambda eglo eup edn edir' slrt.options['zout'] = '0 5 TOA' slrt.options['albedo'] = '0' slrt.options['umu'] = '-1.0 1.0' slrt.options['quiet'] = '' slrt.options['sza'] = '0' tlrt = copy.deepcopy(slrt) tlrt.options['rte_solver'] = 'disort' tlrt.options['source'] = 'thermal' tlrt.options['output_user'] = 'lambda edir eup uu' tlrt.options['wavelength'] = '2500 80000' tlrt.options['mol_abs_param'] = 'reptran fine' tlrt.options['sza'] = '0' ############## # Run the RT # ############## print('Initial RT') sdata, sverb = slrt.run(verbose=True) tdata, tverb = tlrt.run(verbose=True) print('Done RT') ########################### # Setup some plot details # ########################### wvlticks = [(list(range(200, 1000, 100))+ list(range(1000, 10000, 1000))+ list(range(10000, 71000, 10000))), (['0.2']+['']*7+ ['1']+['']*8+ ['10']+['']*5+['70'])] trans_ticks = [[0, 0.25, 0.5, 0.75, 1], [0, 25, 50, 75, 100]] tclearsurf = scipy.interpolate.interp1d(np.log(tdata[::3, 0]), tdata[::3, 2]) tcleartoa = scipy.interpolate.interp1d(np.log(tdata[2::3, 0]), tdata[2::3, 2]) xtlocs = np.linspace(np.log(tdata[0, 0]), np.log(tdata[-1, 0]), 1000) vars = [['rayleigh_dtau', 'rayleigh', 'Rayleigh'], ['o3', 'o3', r'O$_3$'], ['o2', 'o2', r'O$_2$'], ['h2o', 'h2o', r'H$_2$O'], ['co2', 'co2', r'CO$_2$'], ['ch4', 'ch4', r'CH$_4$']] ########################################################## # Total Extinction, Planck function and major components # ########################################################## fig = plt.gcf() toa = 0 # Top of atmosphere index # Atmospheric transmittance swvl = sverb['gases']['wvl'][::10] swvl = np.concatenate((swvl, np.linspace(2500, 5000, 100))) plt.subplot2grid((7, 1), (0, 0), rowspan=2) # Extinction is calculated from optical depth (sum of molecular and rayleigh components) plt.fill_between(np.log(sverb['gases']['wvl'][::10]), 1-np.exp((-sverb['gases']['mol_abs'] - sverb['gases']['rayleigh_dtau'])[::10, toa:].sum(axis=-1)), color='grey') plt.plot(np.log(sverb['gases']['wvl'][::10]), 1-np.exp((-sverb['gases']['mol_abs'] - sverb['gases']['rayleigh_dtau'])[::10, toa:].sum(axis=-1)), c='k', lw=0.5) # Included rayleigh for the LW section, although the contribution is small! plt.fill_between(np.log(tverb['gases']['wvl'][::10]), 1-np.exp((-tverb['gases']['mol_abs'] - tverb['gases']['rayleigh_dtau'])[::10, toa:].sum(axis=-1)), color='grey') plt.plot(np.log(tverb['gases']['wvl'][::10]), 1-np.exp((-tverb['gases']['mol_abs'] - tverb['gases']['rayleigh_dtau'])[::10, toa:].sum(axis=-1)), c='k', lw=0.5) # Calculate some Planck functions at representative temperatures planck5800 = planck_function(5800, wavelength=swvl*1e-9) planck5800 = planck5800*swvl plt.plot(np.log(swvl), planck5800/planck5800.max(), c='b', lw=2, label='5800K') planck255 = planck_function(210, wavelength=tverb['gases']['wvl'][::10]*1e-9) planck255 = planck255*tverb['gases']['wvl'][::10] plt.plot(np.log(tverb['gases']['wvl'][::10]), planck255/planck255.max(), c='r', lw=2, label='210K') planck255 = planck_function(255, wavelength=tverb['gases']['wvl'][::10]*1e-9) planck255 = planck255*tverb['gases']['wvl'][::10] plt.plot(np.log(tverb['gases']['wvl'][::10]), planck255/planck255.max(), c='C1', lw=2, label='255K') planck255 = planck_function(310, wavelength=tverb['gases']['wvl'][::10]*1e-9) planck255 = planck255*tverb['gases']['wvl'][::10] plt.plot(np.log(tverb['gases']['wvl'][::10]), planck255/planck255.max(), c='y', lw=2, label='310K') plt.legend() plt.xticks(np.log(wvlticks[0]), ['']*len(wvlticks[1])) plt.xlim(np.log(wvlticks[0][0]), np.log(wvlticks[0][-1])) plt.yticks(*trans_ticks) plt.ylim(0, 1) plt.ylabel(r'Extinction') ax2 = plt.gca().twinx() plt.ylabel(r'$\lambda$B$_{\lambda}$ (normalised)') plt.yticks([], []) # Plot the extinction for a selection of important gases for v, var in enumerate(vars[:-1]): plt.subplot2grid((7, 1), (v+2, 0)) plt.fill_between(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases'][var[0]].sum(axis=-1))[::10], color='grey') sol, = plt.plot(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases'][var[0]].sum(axis=-1))[::10], c='k', lw=0.5) plt.fill_between(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases'][var[0]].sum(axis=-1))[::10], color='grey') plt.plot(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases'][var[0]].sum(axis=-1))[::10], c='k', lw=0.5) plt.text(np.log(30000), 0.5, var[2], verticalalignment='center') plt.xticks([], []) plt.xlim(np.log(wvlticks[0][0]), np.log(wvlticks[0][-1])) plt.yticks(trans_ticks[0], ['', '', '', '', '']) plt.ylim(0, 1) plt.xticks(np.log(wvlticks[0]), wvlticks[1]) plt.xlabel(r'Wavelength ($\mu$m)') plt.tight_layout(h_pad=0.1) fig.set_size_inches(6, 5) fig.savefig('output/as_complete.png', bbox_inches='tight') fig.clf() del(fig) ######################################### # Total extinction and Planck functions # ######################################### fig = plt.gcf() toa = 0 # Atmospheric transmittance swvl = sverb['gases']['wvl'][::10] swvl = np.concatenate((swvl, np.linspace(2500, 5000, 100))) plt.fill_between(np.log(sverb['gases']['wvl'][::10]), 1-np.exp((-sverb['gases']['mol_abs'] - sverb['gases']['rayleigh_dtau'])[::10, toa:].sum(axis=-1)), color='grey') plt.plot(np.log(sverb['gases']['wvl'][::10]), 1-np.exp((-sverb['gases']['mol_abs'] - sverb['gases']['rayleigh_dtau'])[::10, toa:].sum(axis=-1)), c='k', lw=0.5) plt.fill_between(np.log(tverb['gases']['wvl'][::10]), 1-np.exp((-tverb['gases']['mol_abs'] - tverb['gases']['rayleigh_dtau'])[::10, toa:].sum(axis=-1)), color='grey') plt.plot(np.log(tverb['gases']['wvl'][::10]), 1-np.exp((-tverb['gases']['mol_abs'] - tverb['gases']['rayleigh_dtau'])[::10, toa:].sum(axis=-1)), c='k', lw=0.5) planck5800 = planck_function(5800, wavelength=swvl*1e-9) planck5800 = planck5800*swvl plt.plot(np.log(swvl), planck5800/planck5800.max(), c='b', lw=2, label='5800K') planck255 = planck_function(210, wavelength=tverb['gases']['wvl'][::10]*1e-9) planck255 = planck255*tverb['gases']['wvl'][::10] plt.plot(np.log(tverb['gases']['wvl'][::10]), planck255/planck255.max(), c='r', lw=2, label='210K') planck255 = planck_function(255, wavelength=tverb['gases']['wvl'][::10]*1e-9) planck255 = planck255*tverb['gases']['wvl'][::10] plt.plot(np.log(tverb['gases']['wvl'][::10]), planck255/planck255.max(), c='C1', lw=2, label='255K') planck255 = planck_function(310, wavelength=tverb['gases']['wvl'][::10]*1e-9) planck255 = planck255*tverb['gases']['wvl'][::10] plt.plot(np.log(tverb['gases']['wvl'][::10]), planck255/planck255.max(), c='y', lw=2, label='310K') plt.legend() plt.xticks(np.log(wvlticks[0]), wvlticks[1]) plt.xlim(np.log(wvlticks[0][0]), np.log(wvlticks[0][-1])) plt.yticks(*trans_ticks) plt.ylim(0, 1) plt.xlabel(r'Wavelength ($\mu$m)') plt.ylabel(r'Extinction') ax2 = plt.gca().twinx() plt.ylabel(r'$\lambda$B$_{\lambda}$ (normalised)') plt.yticks([], []) plt.tight_layout(h_pad=0) fig.set_size_inches((8, 3)) fig.savefig('output/as_total.png') fig.clf() ############################# # Extinction by height plot # ############################# fig = plt.gcf() for k, toa in enumerate([-1, -5, -10]): print(k, toa) plt.subplot(3, 1, k+1) plt.fill_between(np.log(sverb['gases']['wvl'][::10]), 1-np.exp((-sverb['gases']['mol_abs'] - sverb['gases']['rayleigh_dtau'])[::10, :toa].sum(axis=-1)), color='grey') plt.plot(np.log(sverb['gases']['wvl'][::10]), 1-np.exp((-sverb['gases']['mol_abs'] - sverb['gases']['rayleigh_dtau'])[::10, :toa].sum(axis=-1)), c='k', lw=0.5) plt.fill_between(np.log(tverb['gases']['wvl'][::10]), 1-np.exp((-tverb['gases']['mol_abs'] - tverb['gases']['rayleigh_dtau'])[::10, :toa].sum(axis=-1)), color='grey') plt.plot(np.log(tverb['gases']['wvl'][::10]), 1-np.exp((-tverb['gases']['mol_abs'] - tverb['gases']['rayleigh_dtau'])[::10, :toa].sum(axis=-1)), c='k', lw=0.5) if k == 2: plt.xlabel(r'Wavelength ($\mu$m)') plt.xticks(np.log(wvlticks[0]), wvlticks[1]) else: plt.xlabel('') plt.xticks(np.log(wvlticks[0]), ['']) plt.ylabel('Extinction\n'+['TOA-Surf', 'TOA-5km', 'TOA-10km'][k]) plt.yticks(*trans_ticks) plt.xlim(np.log(wvlticks[0][0]), np.log(wvlticks[0][-1])) plt.ylim(0, 1) plt.tight_layout(h_pad=0) fig = plt.gcf() fig.set_size_inches((8, 4)) fig.savefig('output/as_total_heights.png') fig.clf() ################################# # Extinction by component plots # ################################# for var in vars: plt.fill_between(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases'][var[0]][::10, toa:].sum(axis=-1)), color='grey') plt.plot(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases'][var[0]][::10, toa:].sum(axis=-1)), c='k', lw=0.5) plt.fill_between(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases'][var[0]][::10, toa:].sum(axis=-1)), color='grey') plt.plot(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases'][var[0]][::10, toa:].sum(axis=-1)), c='k', lw=0.5) plt.xticks(np.log(wvlticks[0]), wvlticks[1]) plt.xlim(np.log(wvlticks[0][0]), np.log(wvlticks[0][-1])) plt.yticks(*trans_ticks) plt.ylim(0, 1) plt.xlabel(r'Wavelength ($\mu$m)') plt.ylabel(r'Extinction') plt.tight_layout() fig = plt.gcf() fig.set_size_inches((8, 3)) fig.savefig('output/as_{}.png'.format(var[1])) fig.clf() ############################################## # Extinction and contribution to total plots # ############################################## for var in vars: plt.subplot(211) plt.fill_between(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases']['mol_abs'].sum(axis=-1) - sverb['gases']['rayleigh_dtau'].sum(axis=-1))[::10], color='r') plt.fill_between(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases']['mol_abs'].sum(axis=-1) - tverb['gases']['rayleigh_dtau'].sum(axis=-1))[::10], color='r') plt.fill_between(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases']['mol_abs'].sum(axis=-1) - sverb['gases']['rayleigh_dtau'].sum(axis=-1) + sverb['gases'][var[0]].sum(axis=-1))[::10], color='grey') sol, = plt.plot(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases']['mol_abs'].sum(axis=-1) - sverb['gases']['rayleigh_dtau'].sum(axis=-1) + sverb['gases'][var[0]].sum(axis=-1))[::10], c='k', lw=0.5) plt.fill_between(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases']['mol_abs'].sum(axis=-1) - tverb['gases']['rayleigh_dtau'].sum(axis=-1) + tverb['gases'][var[0]].sum(axis=-1))[::10], color='grey') plt.plot(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases']['mol_abs'].sum(axis=-1) - tverb['gases']['rayleigh_dtau'].sum(axis=-1) + tverb['gases'][var[0]].sum(axis=-1))[::10], c='k', lw=0.5) plt.xticks([], []) plt.xlim(np.log(wvlticks[0][0]), np.log(wvlticks[0][-1])) plt.yticks(*trans_ticks) plt.ylim(0, 1) plt.ylabel(r'Extinction') plt.subplot(212) plt.fill_between(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases'][var[0]].sum(axis=-1))[::10], color='grey') sol, = plt.plot(np.log(sverb['gases']['wvl'][::10]), 1-np.exp(-sverb['gases'][var[0]].sum(axis=-1))[::10], c='k', lw=0.5) plt.fill_between(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases'][var[0]].sum(axis=-1))[::10], color='grey') plt.plot(np.log(tverb['gases']['wvl'][::10]), 1-np.exp(-tverb['gases'][var[0]].sum(axis=-1))[::10], c='k', lw=0.5) plt.xticks(np.log(wvlticks[0]), wvlticks[1]) plt.xlim(np.log(wvlticks[0][0]), np.log(wvlticks[0][-1])) plt.yticks(*trans_ticks) plt.ylim(0, 1) plt.xlabel(r'Wavelength ($\mu$m)') plt.ylabel(r'Extinction') plt.tight_layout() fig = plt.gcf() fig.set_size_inches((8, 3)) fig.savefig('output/as2_{}.png'.format(var[1])) fig.clf()
43.872131
104
0.545998
1,925
13,381
3.736104
0.119481
0.044494
0.069522
0.068826
0.764321
0.745829
0.720523
0.712041
0.700779
0.695912
0
0.067141
0.169644
13,381
304
105
44.016447
0.580146
0.043868
0
0.659919
0
0
0.149165
0.007576
0
0
0
0
0
1
0
false
0
0.02834
0
0.02834
0.012146
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
09aee7256e0ffd6ba0c95fe5a0ee941b1334f56d
544
py
Python
lightly/api/__init__.py
laurenmoos/lightly
2e9ae8bbf433b09c89d666eee0358935d7f9eb9d
[ "MIT" ]
null
null
null
lightly/api/__init__.py
laurenmoos/lightly
2e9ae8bbf433b09c89d666eee0358935d7f9eb9d
[ "MIT" ]
null
null
null
lightly/api/__init__.py
laurenmoos/lightly
2e9ae8bbf433b09c89d666eee0358935d7f9eb9d
[ "MIT" ]
null
null
null
""" The lightly.api module provides access to the Lightly web-app. """ # Copyright (c) 2020. Lightly AG and its affiliates. # All Rights Reserved from lightly.api import routes from lightly.api.routes.pip import get_version # noqa: F401 from lightly.api.upload import upload_images_from_folder # noqa: F401 from lightly.api.upload import upload_embeddings_from_csv # noqa: F401 from lightly.api.upload import upload_file_with_signed_url # noqa: F401 from lightly.api.download import get_samples_by_tag # noqa: F401
45.333333
72
0.762868
82
544
4.890244
0.487805
0.174564
0.209476
0.189526
0.354115
0.299252
0.299252
0.299252
0
0
0
0.042035
0.169118
544
11
73
49.454545
0.845133
0.349265
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
09bb8ab7cb4cc4f42e686a558f326ff5e037edf6
92
py
Python
data/__init__.py
Jabb0/FastFlow3D
cdc2a547268b85d0c851cf87786d80fcde4e8487
[ "MIT" ]
6
2021-10-14T03:30:32.000Z
2022-03-25T07:16:03.000Z
data/__init__.py
Jabb0/FastFlow3D
cdc2a547268b85d0c851cf87786d80fcde4e8487
[ "MIT" ]
2
2021-10-08T09:06:24.000Z
2022-03-26T10:37:22.000Z
data/__init__.py
Jabb0/FastFlow3D
cdc2a547268b85d0c851cf87786d80fcde4e8487
[ "MIT" ]
null
null
null
from .WaymoDataModule import WaymoDataModule from .RandomDataModule import RandomDataModule
30.666667
46
0.891304
8
92
10.25
0.5
0
0
0
0
0
0
0
0
0
0
0
0.086957
92
2
47
46
0.97619
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
09ce2d2ba63eabe4a38be65d852a19b43465ba85
854
py
Python
categories/migrations/0009_product_name.py
pmaigutyak/mp-shop
14ea67f71fd91a282d2070414924708214fc6464
[ "0BSD" ]
2
2018-03-14T11:32:36.000Z
2021-09-25T14:31:36.000Z
categories/migrations/0009_product_name.py
pmaigutyak/mp-shop
14ea67f71fd91a282d2070414924708214fc6464
[ "0BSD" ]
null
null
null
categories/migrations/0009_product_name.py
pmaigutyak/mp-shop
14ea67f71fd91a282d2070414924708214fc6464
[ "0BSD" ]
null
null
null
# Generated by Django 3.0.13 on 2021-05-22 09:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('categories', '0008_mptt'), ] operations = [ migrations.AddField( model_name='category', name='product_name', field=models.CharField(blank=True, max_length=255, verbose_name='Product name'), ), migrations.AddField( model_name='category', name='product_name_ru', field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Product name'), ), migrations.AddField( model_name='category', name='product_name_uk', field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Product name'), ), ]
29.448276
103
0.604215
93
854
5.387097
0.430108
0.131737
0.179641
0.161677
0.708583
0.708583
0.708583
0.708583
0.526946
0.526946
0
0.046926
0.276347
854
28
104
30.5
0.763754
0.053864
0
0.5
1
0
0.150124
0
0
0
0
0
0
1
0
false
0
0.045455
0
0.181818
0
0
0
0
null
0
0
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
09e68770951dcc190bd6b54bce6188d024649c6c
324
py
Python
pugh_torch/modules/__init__.py
BrianPugh/pugh_torch
d620a518d78ec03556c5089bfc76e4cf7bd0cd70
[ "MIT" ]
4
2020-09-15T17:30:31.000Z
2021-08-07T02:32:22.000Z
pugh_torch/modules/__init__.py
BrianPugh/pugh_torch
d620a518d78ec03556c5089bfc76e4cf7bd0cd70
[ "MIT" ]
null
null
null
pugh_torch/modules/__init__.py
BrianPugh/pugh_torch
d620a518d78ec03556c5089bfc76e4cf7bd0cd70
[ "MIT" ]
1
2020-11-02T22:46:32.000Z
2020-11-02T22:46:32.000Z
from .conv import conv3x3, conv1x1 from .activation import Activation, ActivationModule import pugh_torch.modules.init from .load_state_dict_mixin import LoadStateDictMixin import pugh_torch.modules.meta try: import pytorch_lightning except ImportError: pass else: from .lightning_module import LightningModule
24.923077
53
0.830247
40
324
6.55
0.65
0.076336
0.114504
0.167939
0
0
0
0
0
0
0
0.014184
0.12963
324
12
54
27
0.914894
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.090909
0.727273
0
0.727273
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
0
1
1
1
0
1
0
0
5
61d3240acdbd0b9a4b121abbfe74a2a5976dde41
84
py
Python
GG/__init__.py
Dmunch04/GGLogger
517d80981c23eb98353313fabe2c5149e828377a
[ "MIT" ]
1
2019-07-01T10:07:42.000Z
2019-07-01T10:07:42.000Z
GG/__init__.py
Dmunch04/GGLogger
517d80981c23eb98353313fabe2c5149e828377a
[ "MIT" ]
null
null
null
GG/__init__.py
Dmunch04/GGLogger
517d80981c23eb98353313fabe2c5149e828377a
[ "MIT" ]
null
null
null
from GG.GG import Log, Print, Check, Int, Float, String, List, Dict, Tuple, Combine
42
83
0.72619
14
84
4.357143
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.154762
84
1
84
84
0.859155
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
febc51fd1c5d4106a998863a3f53638e82868967
231
py
Python
tcpcs/state.py
matrix65537/lab
f1d9e0d7aa93083d493ccbad2439726f5c0f93c3
[ "MIT" ]
null
null
null
tcpcs/state.py
matrix65537/lab
f1d9e0d7aa93083d493ccbad2439726f5c0f93c3
[ "MIT" ]
null
null
null
tcpcs/state.py
matrix65537/lab
f1d9e0d7aa93083d493ccbad2439726f5c0f93c3
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import unicode_literals _var_dict = None def set_var_dict(var_dict): global _var_dict _var_dict = var_dict def get_var_dict(): return _var_dict
16.5
39
0.688312
35
231
4
0.571429
0.4
0.214286
0.3
0
0
0
0
0
0
0
0.005525
0.21645
231
13
40
17.769231
0.767956
0.177489
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0.142857
0.571429
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
fedf7e98d701b14393c04f9e2f23610b98fc4774
304
pyde
Python
Squares1_py.pyde
chernayMitifa/2019-fall-polytech-cs
d1aadb8f47a5252529162f3d394665c9b553fe36
[ "MIT" ]
null
null
null
Squares1_py.pyde
chernayMitifa/2019-fall-polytech-cs
d1aadb8f47a5252529162f3d394665c9b553fe36
[ "MIT" ]
null
null
null
Squares1_py.pyde
chernayMitifa/2019-fall-polytech-cs
d1aadb8f47a5252529162f3d394665c9b553fe36
[ "MIT" ]
null
null
null
def setup(): size (500,500) background (100) smooth() noLoop() strokeWeight(15) str(100) def draw (): fill (250) rect (100,100, 100,100) fill (50) rect (200,200, 50,100)
21.714286
36
0.375
29
304
3.931034
0.586207
0.157895
0.157895
0
0
0
0
0
0
0
0
0.285714
0.516447
304
13
37
23.384615
0.489796
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
true
0
0
0
0.166667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
fef30fc929582ec76b04d18f63ef5678b2ca6732
255
py
Python
generated-libraries/python/netapp/snapmirror_policy/policy_owner.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/snapmirror_policy/policy_owner.py
radekg/netapp-ontap-lib-get
6445ebb071ec147ea82a486fbe9f094c56c5c40d
[ "MIT" ]
null
null
null
generated-libraries/python/netapp/snapmirror_policy/policy_owner.py
radekg/netapp-ontap-lib-get
6445ebb071ec147ea82a486fbe9f094c56c5c40d
[ "MIT" ]
null
null
null
class PolicyOwner(basestring): """ cluster-admin|vserver-admin Possible values: <ul> <li> "cluster_admin" , <li> "vserver_admin" </ul> """ @staticmethod def get_api_name(): return "policy-owner"
17
31
0.556863
25
255
5.52
0.72
0.173913
0
0
0
0
0
0
0
0
0
0
0.309804
255
14
32
18.214286
0.784091
0.388235
0
0
0
0
0.1
0
0
0
0
0
0
1
0.25
true
0
0
0.25
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
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
3a2f266690a0229a0e37be697b6bf86a59481fdb
120
py
Python
example.py
namdevel/LK21-downloader
b566bf8994352074ffd31615de9371bbe927de6a
[ "MIT" ]
null
null
null
example.py
namdevel/LK21-downloader
b566bf8994352074ffd31615de9371bbe927de6a
[ "MIT" ]
null
null
null
example.py
namdevel/LK21-downloader
b566bf8994352074ffd31615de9371bbe927de6a
[ "MIT" ]
null
null
null
from src.LK21 import LK21Downloader movie_url = input("\nPaste LK21 Movie URL : ") LK21Downloader().generate(movie_url)
30
46
0.783333
16
120
5.75
0.625
0.26087
0
0
0
0
0
0
0
0
0
0.074766
0.108333
120
4
47
30
0.785047
0
0
0
1
0
0.206612
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
3a3ae2e8cf8900be3e8dc2f095939ddad911abe7
27
py
Python
src/control/autonomous.py
ncl-ROVers/surface-2019-20
209c06008803971d0430fd3993ef36f9a4686646
[ "MIT" ]
3
2021-01-21T07:18:30.000Z
2021-12-20T11:09:29.000Z
src/control/autonomous.py
ncl-ROVers/surface-2019-20
209c06008803971d0430fd3993ef36f9a4686646
[ "MIT" ]
null
null
null
src/control/autonomous.py
ncl-ROVers/surface-2019-20
209c06008803971d0430fd3993ef36f9a4686646
[ "MIT" ]
3
2020-11-24T11:46:23.000Z
2021-08-05T18:02:07.000Z
""" TODO: Write code ;) """
9
19
0.481481
3
27
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.185185
27
3
20
9
0.590909
0.703704
0
null
0
null
0
0
null
0
0
0.333333
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
0
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
0
0
0
0
0
5
3a54d115cd679bfa8d359818d5d4d48d76aee2bc
150
py
Python
pyexcel_io/fileformat/__init__.py
AverkinSergei/pyexcel-io
a611a69cf7c2fa75f226b7879aba61bcfdaceda1
[ "BSD-3-Clause" ]
null
null
null
pyexcel_io/fileformat/__init__.py
AverkinSergei/pyexcel-io
a611a69cf7c2fa75f226b7879aba61bcfdaceda1
[ "BSD-3-Clause" ]
null
null
null
pyexcel_io/fileformat/__init__.py
AverkinSergei/pyexcel-io
a611a69cf7c2fa75f226b7879aba61bcfdaceda1
[ "BSD-3-Clause" ]
1
2019-04-27T04:40:14.000Z
2019-04-27T04:40:14.000Z
from . import _csv as csv from . import csvz from . import tsv from . import tsvz exports = csv.exports + csvz.exports + tsv.exports + tsvz.exports
18.75
65
0.726667
23
150
4.695652
0.347826
0.37037
0
0
0
0
0
0
0
0
0
0
0.193333
150
7
66
21.428571
0.892562
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
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
28a901a1aa5a1bddf0e27c9c7d678b2b9daeb996
217
py
Python
octavvs/io/__init__.py
ctroein/octavvs
5a68ed61d01640f377bda116769b7cf783d3b668
[ "MIT" ]
7
2020-02-19T13:05:11.000Z
2021-08-28T05:23:33.000Z
octavvs/io/__init__.py
ctroein/octavvs
5a68ed61d01640f377bda116769b7cf783d3b668
[ "MIT" ]
2
2020-02-19T14:39:28.000Z
2020-03-23T15:13:38.000Z
octavvs/io/__init__.py
ctroein/octavvs
5a68ed61d01640f377bda116769b7cf783d3b668
[ "MIT" ]
2
2019-12-09T12:16:38.000Z
2021-01-11T02:58:01.000Z
from .spectraldata import SpectralData from .decompositiondata import DecompositionData from .opusreader import OpusReader from .ptirreader import PtirReader from .image import Image from .parameters import Parameters
36.166667
48
0.866359
24
217
7.833333
0.333333
0
0
0
0
0
0
0
0
0
0
0
0.105991
217
6
49
36.166667
0.969072
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
28ebb50ed7fa8931a6d5781c9163cd7472a041f1
233
py
Python
leet_code_array/mid_questions/unique_path.py
IvanFan/leetcode-python
72a12a107681cc5f09f1f88537c5b0741f0818a4
[ "MIT" ]
null
null
null
leet_code_array/mid_questions/unique_path.py
IvanFan/leetcode-python
72a12a107681cc5f09f1f88537c5b0741f0818a4
[ "MIT" ]
null
null
null
leet_code_array/mid_questions/unique_path.py
IvanFan/leetcode-python
72a12a107681cc5f09f1f88537c5b0741f0818a4
[ "MIT" ]
null
null
null
class Solution: def uniquePaths(self, m, n): """ :type m: int :type n: int :rtype: int """ return int(math.factorial(m+n-2)/ (math.factorial(m-1)* math.factorial(n-1)))
25.888889
85
0.480687
30
233
3.733333
0.5
0.348214
0.25
0
0
0
0
0
0
0
0
0.020134
0.360515
233
9
86
25.888889
0.731544
0.158798
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
e913febb2b9f78511da1911e7dd283c3e90f623f
29
py
Python
py4xs/__init__.py
NSLS-II-LIX/py4xs
cc2102bd852a7ade1c1969fb5faf2ad361550617
[ "BSD-3-Clause" ]
4
2019-10-23T21:00:35.000Z
2021-02-09T15:57:31.000Z
py4xs/__init__.py
NSLS-II-LIX/py4xs
cc2102bd852a7ade1c1969fb5faf2ad361550617
[ "BSD-3-Clause" ]
null
null
null
py4xs/__init__.py
NSLS-II-LIX/py4xs
cc2102bd852a7ade1c1969fb5faf2ad361550617
[ "BSD-3-Clause" ]
2
2018-09-27T15:16:02.000Z
2021-02-09T15:23:36.000Z
__version__ = '2021.8.10.0'
9.666667
27
0.655172
5
29
3
1
0
0
0
0
0
0
0
0
0
0
0.32
0.137931
29
2
28
14.5
0.28
0
0
0
0
0
0.392857
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
e921d1bccde350a1e6f799873f0b4e901f577f7e
6,838
py
Python
intro/part06-05_course_grading_part_2/test/test_course_grading_part_2.py
Hannah-Abi/python-pro-21
2ce32c4bf118054329d19afdf83c50561be1ada8
[ "MIT" ]
null
null
null
intro/part06-05_course_grading_part_2/test/test_course_grading_part_2.py
Hannah-Abi/python-pro-21
2ce32c4bf118054329d19afdf83c50561be1ada8
[ "MIT" ]
null
null
null
intro/part06-05_course_grading_part_2/test/test_course_grading_part_2.py
Hannah-Abi/python-pro-21
2ce32c4bf118054329d19afdf83c50561be1ada8
[ "MIT" ]
null
null
null
import unittest from unittest.mock import patch from tmc import points from tmc.utils import load, load_module, reload_module, get_stdout from functools import reduce import os import textwrap from random import choice, randint exercise = 'src.course_grading_part_2' def f(d): return '\n'.join(d) def w(x): return [f"test/{i}" for i in x] @points('6.course_gradind_part_2') class CourseGradingPart2Test(unittest.TestCase): @classmethod def setUpClass(cls): with patch('builtins.input', side_effect=['test/students1.csv', 'test/exercises1.csv', 'test/exam_points1.csv']): cls.module = load_module(exercise, 'fi') def test_1_works_with_file_1(self): words = ['students1.csv', 'exercises1.csv', 'exam_points1.csv'] with patch('builtins.input', side_effect =w(words) + [ AssertionError("Too many inputs.")]): try: reload_module(self.module) output_all = get_stdout() except: self.assertTrue(False, f"Ensure that your program works with input\n{f(words)}") exp = """pekka peloton 0 jaana javanainen 1 liisa virtanen 3""" expRows = exp.split('\n') mssage = """\nPlease note, that in this program NO CODE should be included inside if __name__ == "__main__": block """ #\n{mssage}") self.assertTrue(len(output_all)>0, f"Your program does not output anything with input\n{f(words)}\n{mssage}") output = [line.strip() for line in output_all.split("\n") if len(line) > 0] self.assertEqual(len(expRows), len(output), f"Instead of {len(expRows)} rows, your program outputs {len(output)} rows:\n{output_all}\nwith input:\n{f(words)}\nOutput should contain the following lines:\n{exp}") for i in range(len(expRows)): line = output[i] self.assertTrue(line.strip() in exp, f"Your program does not work correctly with input\n{f(words)}\nLine {line} is not what expected\nOutput should contain the following lines:\n{exp}\nThe whole output is:\n{output_all}") def test_2_works_with_file_2(self): words = ['students2.csv', 'exercises2.csv', 'exam_points2.csv'] with patch('builtins.input', side_effect =w(words) + [ AssertionError("Too many inputs.")]): try: reload_module(self.module) output_all = get_stdout() except: self.assertTrue(False, f"Ensure that your program works with input\n{f(words)}") exp = """pekka peloton 1 jaana javanainen 1 liisa virtanen 0 donald frump 1 john doe 3 angela tarkel 3 karkki eila 0 alan turing 4 ada lovelace 5""" expRows = exp.split('\n') mssage = """\nPlease note, that in this program NO CODE should be included inside if __name__ == "__main__": block """ #\n{mssage}") self.assertTrue(len(output_all)>0, f"Your program does not output anything with input\n{f(words)}\n{mssage}") output = [line.strip() for line in output_all.split("\n") if len(line) > 0] self.assertEqual(len(expRows), len(output), f"Instead of {len(expRows)} rows, your program outputs {len(output)} rows:\n{output_all}\nwith input:\n{f(words)}\nOutput should contain the following lines:\n{exp}") for i in range(len(expRows)): line = output[i] self.assertTrue(line.strip() in exp, f"Your program does not work correctly with input\n{f(words)}\nLine {line} is not what expected\nOutput should contain the following lines:\n{exp}\nThe whole output is:\n{output_all}") def test_3_works_with_file_3(self): words = ['students3.csv', 'exercises3.csv', 'exam_points3.csv'] with patch('builtins.input', side_effect =w(words) + [ AssertionError("Too many inputs.")]): try: reload_module(self.module) output_all = get_stdout() except: self.assertTrue(False, f"Ensure that your program works with input\n{f(words)}") exp = """pekka peloton 1 jaana javanainen 2 liisa virtanen 3 donald frump 0 john doe 2 angela tarkel 1 karkki eila 1 alan turing 3 ada lovelace 5""" expRows = exp.split('\n') mssage = """\nPlease note, that in this program NO CODE should be included inside if __name__ == "__main__": block """ #\n{mssage}") self.assertTrue(len(output_all)>0, f"Your program does not output anything with input\n{f(words)}\n{mssage}") output = [line.strip() for line in output_all.split("\n") if len(line) > 0] self.assertEqual(len(expRows), len(output), f"Instead of {len(expRows)} rows, your program outputs {len(output)} rows:\n{output_all}\nwith input:\n{f(words)}\nOutput should contain the following lines:\n{exp}") for i in range(len(expRows)): line = output[i] self.assertTrue(line.strip() in exp, f"Your program does not work correctly with input\n{f(words)}\nLine {line} is not what expected\nOutput should contain the following lines:\n{exp}\nThe whole output is:\n{output_all}") def test_4_works_with_file_4(self): words = ['students4.csv', 'exercises4.csv', 'exam_points4.csv'] with patch('builtins.input', side_effect =w(words) + [ AssertionError("Too many inputs.")]): try: reload_module(self.module) output_all = get_stdout() except: self.assertTrue(False, f"Ensure that your program works with input\n{f(words)}") exp = """pekka pelokas 0 mirja virtanen 1 jane doe 3 donald frump 4 john doe 5 kalle paakkola 0 eila kaisla 4 antti tuuri 0 leena lempinen 1 eero honkela 1""" expRows = exp.split('\n') mssage = """\nPlease note, that in this program NO CODE should be included inside if __name__ == "__main__": block """ #\n{mssage}") self.assertTrue(len(output_all)>0, f"Your program does not output anything with input\n{f(words)}\n{mssage}") output = [line.strip() for line in output_all.split("\n") if len(line) > 0] self.assertEqual(len(expRows), len(output), f"Instead of {len(expRows)} rows, your program outputs {len(output)} rows:\n{output_all}\nwith input:\n{f(words)}\nOutput should contain the following lines:\n{exp}") for i in range(len(expRows)): line = output[i] self.assertTrue(line.strip() in exp, f"Your program does not work correctly with input\n{f(words)}\nLine {line} is not what expected\nOutput should contain the following lines:\n{exp}\nThe whole output is:\n{output_all}") if __name__ == '__main__': unittest.main()
43.278481
237
0.634104
961
6,838
4.399584
0.168574
0.042573
0.02649
0.045412
0.776963
0.766793
0.759224
0.759224
0.759224
0.759224
0
0.012736
0.242176
6,838
157
238
43.55414
0.803165
0.007458
0
0.578125
0
0.0625
0.470215
0.069743
0
0
0
0
0.15625
1
0.054688
false
0
0.0625
0.015625
0.140625
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
3a8dc25780b378716829c7515f679cc226cfd5ee
118
py
Python
tasks_app.py
jhparkinfinyx/fabric_server
45caa1504eba4344ab5706c0d061dd325231766a
[ "MIT" ]
null
null
null
tasks_app.py
jhparkinfinyx/fabric_server
45caa1504eba4344ab5706c0d061dd325231766a
[ "MIT" ]
null
null
null
tasks_app.py
jhparkinfinyx/fabric_server
45caa1504eba4344ab5706c0d061dd325231766a
[ "MIT" ]
null
null
null
from tasks import add result = add.delay(30000, 1337) print(result.ready()) print(result.get()) print(result.ready())
19.666667
31
0.737288
18
118
4.833333
0.611111
0.37931
0.367816
0
0
0
0
0
0
0
0
0.084112
0.09322
118
6
32
19.666667
0.728972
0
0
0.4
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.6
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
3a92e3c8f88a3b34b050d5feaac449fed1cf5e57
42
py
Python
firstStep.py
liliangbin/first-step-python
3c4afe6ed54068cb4101d28a1ed4bbeb6e0d43fd
[ "MIT" ]
1
2018-04-10T16:12:39.000Z
2018-04-10T16:12:39.000Z
firstStep.py
liliangbin/first-step-python
3c4afe6ed54068cb4101d28a1ed4bbeb6e0d43fd
[ "MIT" ]
null
null
null
firstStep.py
liliangbin/first-step-python
3c4afe6ed54068cb4101d28a1ed4bbeb6e0d43fd
[ "MIT" ]
null
null
null
#!/usr/bin/env python print('nihao')
5.25
21
0.595238
6
42
4.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.190476
42
7
22
6
0.735294
0.47619
0
0
0
0
0.277778
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
c914522635f06ac630b22b5e7ec3bc4b8a9d04e7
126
py
Python
VAE_GAN/__init__.py
TheDudeFromCI/VAE-GAN
d14f65f64897a701a0a94a75b42d0e70bb1fd98a
[ "MIT" ]
null
null
null
VAE_GAN/__init__.py
TheDudeFromCI/VAE-GAN
d14f65f64897a701a0a94a75b42d0e70bb1fd98a
[ "MIT" ]
null
null
null
VAE_GAN/__init__.py
TheDudeFromCI/VAE-GAN
d14f65f64897a701a0a94a75b42d0e70bb1fd98a
[ "MIT" ]
null
null
null
from .model import Model, ModelParameters from .optimizer import optimize __all__ = ['Model', 'ModelParameters', 'optimize']
25.2
50
0.769841
13
126
7.153846
0.538462
0.430108
0
0
0
0
0
0
0
0
0
0
0.119048
126
4
51
31.5
0.837838
0
0
0
0
0
0.222222
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
c91eb1034226682ebd286dbb38af6e1bfca20d2a
80
py
Python
testFile.py
tohabyuraev/calculation-of-pneumatic-installation
dd283132665d8a3c92eb5b52f129e79e639d9fdc
[ "BSD-3-Clause" ]
null
null
null
testFile.py
tohabyuraev/calculation-of-pneumatic-installation
dd283132665d8a3c92eb5b52f129e79e639d9fdc
[ "BSD-3-Clause" ]
null
null
null
testFile.py
tohabyuraev/calculation-of-pneumatic-installation
dd283132665d8a3c92eb5b52f129e79e639d9fdc
[ "BSD-3-Clause" ]
null
null
null
print("Установлено соединение с GitHub!") print("Получилось закомитить файл...")
40
41
0.775
9
80
6.888889
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.075
80
2
42
40
0.837838
0
0
0
0
0
0.753086
0
0
0
0
0
0
1
0
true
0
0
0
0
1
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
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
c9270a4a7a7dfa505a6a228211bcd3dbfca0f99a
32
py
Python
requests_lsp/__init__.py
abitrolly/requests-lsp
65fef15af22a78e5873d5eaff10c36eee74c9394
[ "Unlicense" ]
null
null
null
requests_lsp/__init__.py
abitrolly/requests-lsp
65fef15af22a78e5873d5eaff10c36eee74c9394
[ "Unlicense" ]
null
null
null
requests_lsp/__init__.py
abitrolly/requests-lsp
65fef15af22a78e5873d5eaff10c36eee74c9394
[ "Unlicense" ]
null
null
null
from .adapter import LSPAdapter
16
31
0.84375
4
32
6.75
1
0
0
0
0
0
0
0
0
0
0
0
0.125
32
1
32
32
0.964286
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
c9856eed1250a6e4007fa6f8d5ada6e92e214394
255
py
Python
datastore/objects/util.py
datastore/datastore.objects
226960312e1f34fbdf08eef40b90ffe90baf2678
[ "MIT" ]
2
2016-07-09T04:09:36.000Z
2021-12-10T20:06:26.000Z
datastore/objects/util.py
datastore/datastore.objects
226960312e1f34fbdf08eef40b90ffe90baf2678
[ "MIT" ]
null
null
null
datastore/objects/util.py
datastore/datastore.objects
226960312e1f34fbdf08eef40b90ffe90baf2678
[ "MIT" ]
3
2015-01-23T17:03:31.000Z
2021-04-04T03:10:46.000Z
class classproperty(object): '''Implements both @property and @classmethod behavior.''' def __init__(self, getter): self.getter = getter def __get__(self, instance, owner): return self.getter(instance) if instance else self.getter(owner)
25.5
68
0.72549
31
255
5.709677
0.612903
0.225989
0
0
0
0
0
0
0
0
0
0
0.160784
255
9
69
28.333333
0.827103
0.203922
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0
0.2
0.8
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5