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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
714f70f5432875edb2d152810caf2b3805e0629c | 207 | py | Python | free_energy_clustering/__init__.py | DSilva27/InfleCS-free-energy-clustering-tutorial | 9ef8af3e4231050e071bf500d280fefb18641fda | [
"MIT"
] | 14 | 2019-11-25T12:55:05.000Z | 2021-12-14T16:37:07.000Z | free_energy_clustering/__init__.py | DSilva27/InfleCS-free-energy-clustering-tutorial | 9ef8af3e4231050e071bf500d280fefb18641fda | [
"MIT"
] | 3 | 2021-06-05T06:52:20.000Z | 2021-07-14T09:47:22.000Z | free_energy_clustering/__init__.py | DSilva27/InfleCS-free-energy-clustering-tutorial | 9ef8af3e4231050e071bf500d280fefb18641fda | [
"MIT"
] | 7 | 2020-05-12T14:54:05.000Z | 2021-11-15T14:29:11.000Z | from .GMM_free_energy import FreeEnergyClustering
from .FE_landscape_clustering import LandscapeClustering
from .stack_landscapes import LandscapeStacker
from .free_energy_pathways import FreeEnergyPathways
| 41.4 | 56 | 0.903382 | 23 | 207 | 7.826087 | 0.652174 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.077295 | 207 | 4 | 57 | 51.75 | 0.942408 | 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 |
717760520649ef11cbf28588b820717b061e0c1b | 39 | py | Python | tests/__init__.py | neerbek/taboo-core | 205146a6d7531cb10907953d1b732ac80b12e062 | [
"MIT"
] | 1 | 2020-08-05T03:46:52.000Z | 2020-08-05T03:46:52.000Z | tests/__init__.py | neerbek/taboo-core | 205146a6d7531cb10907953d1b732ac80b12e062 | [
"MIT"
] | 2 | 2020-11-27T00:01:08.000Z | 2021-02-02T22:45:04.000Z | rnn_model/__init__.py | neerbek/taboo-core | 205146a6d7531cb10907953d1b732ac80b12e062 | [
"MIT"
] | 1 | 2019-02-12T16:03:01.000Z | 2019-02-12T16:03:01.000Z | # empty file for python module loading
| 19.5 | 38 | 0.794872 | 6 | 39 | 5.166667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179487 | 39 | 1 | 39 | 39 | 0.96875 | 0.923077 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
71839ba36a96d1781d48f6880ae7579cf09de1d7 | 141 | py | Python | resumen_declaracion_iva/reports/report_xml/__init__.py | Chief0-0/Localizacion_ERP_V12 | f59e56564e29525f772b59db7fef7c7cde347336 | [
"Apache-2.0"
] | null | null | null | resumen_declaracion_iva/reports/report_xml/__init__.py | Chief0-0/Localizacion_ERP_V12 | f59e56564e29525f772b59db7fef7c7cde347336 | [
"Apache-2.0"
] | null | null | null | resumen_declaracion_iva/reports/report_xml/__init__.py | Chief0-0/Localizacion_ERP_V12 | f59e56564e29525f772b59db7fef7c7cde347336 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
from . import controllers
from . import models
| 23.5 | 68 | 0.687943 | 21 | 141 | 4.619048 | 0.857143 | 0.206186 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024793 | 0.141844 | 141 | 5 | 69 | 28.2 | 0.77686 | 0.624113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
71c2de0565a10103134bed256aeef76438f61505 | 20 | py | Python | dock/__init__.py | Plane-walker/Okeanos | 8c8365b1a3133e1b94b62401b416483db0046698 | [
"Apache-2.0"
] | 6 | 2021-12-02T07:03:25.000Z | 2022-01-05T08:17:10.000Z | dock/__init__.py | Plane-walker/Okeanus | 8c8365b1a3133e1b94b62401b416483db0046698 | [
"Apache-2.0"
] | 120 | 2021-12-02T07:38:56.000Z | 2022-03-31T05:20:52.000Z | dock/__init__.py | Plane-walker/Okeanus | 8c8365b1a3133e1b94b62401b416483db0046698 | [
"Apache-2.0"
] | null | null | null | from .dock import *
| 10 | 19 | 0.7 | 3 | 20 | 4.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 20 | 1 | 20 | 20 | 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 |
71cc53dbb896fc659b91682b205fb7ab4372bc60 | 127 | py | Python | ambari-agent/src/main/python/ambari_agent/apscheduler/__init__.py | likenamehaojie/Apache-Ambari-ZH | 5973025bd694cdbb4b49fb4c4e0d774782811ff6 | [
"Apache-2.0"
] | 1,664 | 2015-01-03T09:35:21.000Z | 2022-03-31T04:55:24.000Z | ambari-agent/src/main/python/ambari_agent/apscheduler/__init__.py | likenamehaojie/Apache-Ambari-ZH | 5973025bd694cdbb4b49fb4c4e0d774782811ff6 | [
"Apache-2.0"
] | 3,018 | 2015-02-19T20:16:10.000Z | 2021-11-13T20:47:48.000Z | ambari-agent/src/main/python/ambari_agent/apscheduler/__init__.py | likenamehaojie/Apache-Ambari-ZH | 5973025bd694cdbb4b49fb4c4e0d774782811ff6 | [
"Apache-2.0"
] | 1,673 | 2015-01-06T14:14:42.000Z | 2022-03-31T07:22:30.000Z | version_info = (2, 1, 2)
version = '.'.join(str(n) for n in version_info[:3])
release = '.'.join(str(n) for n in version_info)
| 31.75 | 52 | 0.645669 | 24 | 127 | 3.291667 | 0.458333 | 0.417722 | 0.202532 | 0.278481 | 0.632911 | 0.632911 | 0.632911 | 0.632911 | 0 | 0 | 0 | 0.037037 | 0.149606 | 127 | 3 | 53 | 42.333333 | 0.694444 | 0 | 0 | 0 | 0 | 0 | 0.015748 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 |
71deccf09306a9a9e42617907488eeea44804e06 | 240 | py | Python | accelbyte_py_sdk/api/iam/operations/o_auth2_0_extension/__init__.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/iam/operations/o_auth2_0_extension/__init__.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/iam/operations/o_auth2_0_extension/__init__.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | # pylint: disable=line-too-long
from .user_authentication_v3 import UserAuthenticationV3
from .get_country_location_v3 import GetCountryLocationV3
from .logout import Logout
from .platform_authentication_v3 import PlatformAuthenticationV3
| 34.285714 | 64 | 0.879167 | 28 | 240 | 7.285714 | 0.642857 | 0.117647 | 0.215686 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027273 | 0.083333 | 240 | 6 | 65 | 40 | 0.9 | 0.120833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
e0b3d3060a5da256e8b0bdaf5331b885b7b5c640 | 138 | py | Python | tests/server/__init__.py | hidraco/hivemind | 92649f676d498b990f56879ba73f589e2057ab91 | [
"MIT"
] | 78 | 2017-03-09T15:33:08.000Z | 2022-03-30T06:01:19.000Z | tests/server/__init__.py | hidraco/hivemind | 92649f676d498b990f56879ba73f589e2057ab91 | [
"MIT"
] | 193 | 2017-04-25T19:39:20.000Z | 2021-06-29T01:53:53.000Z | tests/server/__init__.py | hidraco/hivemind | 92649f676d498b990f56879ba73f589e2057ab91 | [
"MIT"
] | 68 | 2017-05-07T17:31:08.000Z | 2021-08-23T01:17:00.000Z | """Hive server and API tests."""
from hive.conf import Conf
from hive.db.adapter import Db
Db.set_shared_instance(Conf.init_test().db())
| 23 | 45 | 0.753623 | 24 | 138 | 4.208333 | 0.625 | 0.158416 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108696 | 138 | 5 | 46 | 27.6 | 0.821138 | 0.188406 | 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 |
e0d3fe90c7a7ab680b3e47d8449b81dc6bef8d1a | 367 | py | Python | flow/multiagent_envs/__init__.py | alt113/flow | 28224d05acd4b03cdb78105d142619e4a01d3d5f | [
"MIT"
] | null | null | null | flow/multiagent_envs/__init__.py | alt113/flow | 28224d05acd4b03cdb78105d142619e4a01d3d5f | [
"MIT"
] | 1 | 2021-12-13T20:03:01.000Z | 2021-12-13T20:03:01.000Z | flow/multiagent_envs/__init__.py | alt113/flow | 28224d05acd4b03cdb78105d142619e4a01d3d5f | [
"MIT"
] | null | null | null | """Empty init file to ensure documentation for multi-agent envs is created."""
from flow.multiagent_envs.multiagent_env import MultiEnv
from flow.multiagent_envs.loop.wave_attenuation import \
MultiWaveAttenuationPOEnv
from flow.multiagent_envs.loop.loop_accel import MultiAgentAccelEnv
__all__ = ['MultiEnv', 'MultiAgentAccelEnv', 'MultiWaveAttenuationPOEnv']
| 40.777778 | 78 | 0.828338 | 42 | 367 | 7 | 0.595238 | 0.081633 | 0.183673 | 0.22449 | 0.176871 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095368 | 367 | 8 | 79 | 45.875 | 0.885542 | 0.196185 | 0 | 0 | 0 | 0 | 0.176471 | 0.086505 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 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 |
460ae1e36f94346b27057496d28345177744c956 | 61 | py | Python | src/main.py | mueke/esp-upy | f989a0bc57380247a2b0795247187f663767108a | [
"Unlicense"
] | null | null | null | src/main.py | mueke/esp-upy | f989a0bc57380247a2b0795247187f663767108a | [
"Unlicense"
] | null | null | null | src/main.py | mueke/esp-upy | f989a0bc57380247a2b0795247187f663767108a | [
"Unlicense"
] | null | null | null | from config import *
import wifi
#import relais
#import mqtt
| 12.2 | 20 | 0.786885 | 9 | 61 | 5.333333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.163934 | 61 | 4 | 21 | 15.25 | 0.941176 | 0.393443 | 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 |
46148d348b5935385998894edc27252d50088774 | 165 | py | Python | auger_cli/api/instance_types.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | 1 | 2019-04-17T12:40:58.000Z | 2019-04-17T12:40:58.000Z | auger_cli/api/instance_types.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | 25 | 2019-03-06T08:20:04.000Z | 2019-07-07T06:00:20.000Z | auger_cli/api/instance_types.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | null | null | null | from auger_cli.utils import request_list
display_attributes = ['id', 'description']
def list(client):
return request_list(client, 'instance_types', params={})
| 23.571429 | 60 | 0.751515 | 21 | 165 | 5.666667 | 0.809524 | 0.184874 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 165 | 6 | 61 | 27.5 | 0.82069 | 0 | 0 | 0 | 0 | 0 | 0.163636 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
e8184857c3a5928f68c4fd3e63d1ffdc85b330aa | 208 | py | Python | lib/git.py | PhilippeAssis/webdevtools | 90ea5276b4af398134c82d297645d6e06266a6f0 | [
"Apache-2.0"
] | null | null | null | lib/git.py | PhilippeAssis/webdevtools | 90ea5276b4af398134c82d297645d6e06266a6f0 | [
"Apache-2.0"
] | null | null | null | lib/git.py | PhilippeAssis/webdevtools | 90ea5276b4af398134c82d297645d6e06266a6f0 | [
"Apache-2.0"
] | null | null | null | import os
class Git:
def __init__(self, remote, path = ""):
self.remote = remote
self.path = path
def clone(self):
os.system("git clone %s %s" % (self.remote, self.path))
| 16 | 63 | 0.5625 | 28 | 208 | 4.035714 | 0.428571 | 0.265487 | 0.247788 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.298077 | 208 | 12 | 64 | 17.333333 | 0.773973 | 0 | 0 | 0 | 0 | 0 | 0.073171 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
e8316ea15bb20705f0b089ab6ec5183f26de260d | 21,015 | py | Python | tests/test_oop_phrasebook_views.py | wayfair/eggsnspam | 9df1a17fc2141a73ee35e0f84ce594e473dae0d3 | [
"BSD-2-Clause"
] | 6 | 2017-03-17T14:15:58.000Z | 2018-05-31T04:27:12.000Z | tests/test_oop_phrasebook_views.py | wayfair-archive/eggsnspam | 9df1a17fc2141a73ee35e0f84ce594e473dae0d3 | [
"BSD-2-Clause"
] | null | null | null | tests/test_oop_phrasebook_views.py | wayfair-archive/eggsnspam | 9df1a17fc2141a73ee35e0f84ce594e473dae0d3 | [
"BSD-2-Clause"
] | 4 | 2017-03-22T23:42:22.000Z | 2018-09-29T23:47:33.000Z | import json
import mock
from . import BaseTestCase
from .mixins import HealthViewTestCaseMixin
class HealthViewTestCase(HealthViewTestCaseMixin, BaseTestCase):
"""Testcase for healthcheck endpoint"""
base_url_path = '/oop_phrasebook'
class BreakfastTestCase(BaseTestCase):
@mock.patch('eggsnspam.oop_phrasebook.daos.BreakfastDao.list_all')
def test_list_breakfasts(self, m_list_all):
"""It lists all the breakfasts in the database"""
m_list_all.return_value = []
# expect no breakfasts to return an empty json object
response = self.client.get("/oop_phrasebook/breakfast/",
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertIn("breakfasts", response_data)
self.assertTrue(m_list_all.called)
self.assertEqual(len(response_data["breakfasts"]), 0)
# mock 3 breakfasts
m_results = [
{'id': 1, 'name': 'Eggs'},
{'id': 2, 'name': 'Fruit Cup'},
{'id': 3, 'name': 'Pancakes'},
]
m_list_all.return_value = m_results
breakfast_ids = [x['id'] for x in m_results]
# exepect 3 breakfast objects to be returned
response = self.client.get("/oop_phrasebook/breakfast/",
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertEqual(len(response_data['breakfasts']), len(m_results))
for breakfast in response_data['breakfasts']:
self.assertIn(breakfast['id'], breakfast_ids)
@mock.patch('eggsnspam.oop_phrasebook.daos.BreakfastDao.get_by_id')
def test_get_breakfast(self, m_get_by_id):
"""It lists all the breakfasts in the database"""
# expect to get a 404 response if no breakfast found for ID
m_get_by_id.return_value = None
response = self.client.get("/oop_phrasebook/breakfast/-1",
content_type='application/json')
self.assertEqual(response.status_code, 404)
# expect to get a json object representation of a breakfast to be returned
mocked_breakfast_data = {'id': 1, 'name': 'Eggs'}
m_get_by_id.return_value = mocked_breakfast_data
response = self.client.get("/oop_phrasebook/breakfast/{}".format(mocked_breakfast_data['id']),
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertEqual(response_data['id'], mocked_breakfast_data['id'])
self.assertEqual(response_data['name'], mocked_breakfast_data['name'])
class IngredientTestCase(BaseTestCase):
@mock.patch('eggsnspam.oop_phrasebook.daos.IngredientDao.list_all')
def test_list_ingredients(self, m_list_all):
"""It lists all the ingredients in the database"""
m_list_all.return_value = []
# expect no ingredients to return an empty json object
response = self.client.get("/oop_phrasebook/ingredient/",
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertIn("ingredients", response_data)
self.assertTrue(m_list_all.called)
self.assertEqual(len(response_data["ingredients"]), 0)
# mock 3 ingredients
m_results = [
{'id': 1, 'name': 'Eggs'},
{'id': 2, 'name': 'Fruit Cup'},
{'id': 3, 'name': 'Pancakes'},
]
m_list_all.return_value = m_results
ingredient_ids = [x['id'] for x in m_results]
# exepect 3 ingredient objects to be returned
response = self.client.get("/oop_phrasebook/ingredient/",
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertEqual(len(response_data['ingredients']), len(m_results))
for ingredient in response_data['ingredients']:
self.assertIn(ingredient['id'], ingredient_ids)
@mock.patch('eggsnspam.oop_phrasebook.daos.IngredientDao.get_by_id')
def test_get_ingredient(self, m_get_by_id):
"""It lists all the ingredients in the database"""
# expect to get a 404 response if no ingredient found for ID
m_get_by_id.return_value = None
response = self.client.get("/oop_phrasebook/ingredient/-1",
content_type='application/json')
self.assertEqual(response.status_code, 404)
# expect to get a json object representation of a ingredient to be returned
mocked_ingredient_data = {'id': 1, 'name': 'Eggs'}
m_get_by_id.return_value = mocked_ingredient_data
response = self.client.get("/oop_phrasebook/ingredient/{}".format(mocked_ingredient_data['id']),
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertEqual(response_data['id'], mocked_ingredient_data['id'])
self.assertEqual(response_data['name'], mocked_ingredient_data['name'])
class UserTestCase(BaseTestCase):
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.list_all')
def test_list_users(self, m_list_all):
"""It lists all the users in the database"""
m_list_all.return_value = []
# expect no users to return an empty json object
response = self.client.get("/oop_phrasebook/user/",
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertIn("users", response_data)
self.assertTrue(m_list_all.called)
self.assertEqual(len(response_data["users"]), 0)
# mock 3 users
m_results = [
{'id': 1, 'first_name': 'Adam', 'last_name': 'Anderson'},
{'id': 2, 'first_name': 'Betty', 'last_name': 'Blevins'},
{'id': 3, 'first_name': 'Carl', 'last_name': 'Cadigan'},
]
m_list_all.return_value = m_results
user_ids = [x['id'] for x in m_results]
# exepect 3 user objects to be returned
response = self.client.get("/oop_phrasebook/user/",
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertEqual(len(response_data['users']), len(m_results))
for user in response_data['users']:
self.assertIn(user['id'], user_ids)
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.create')
def test_create_user(self, m_create):
"""It creates a user record in the database"""
m_create.return_value = 1
# expect a 400 error if invalid data is provided
response = self.client.post("/oop_phrasebook/user/",
content_type='application/json')
self.assertEqual(response.status_code, 400)
request_data = {
"first_name": "Harrison",
"last_name": "Ford"
}
# expect a 201 response if we created an object
response = self.client.post("/oop_phrasebook/user/",
data=json.dumps(request_data),
content_type='application/json')
self.assertEqual(response.status_code, 201)
# expect the json reprisentation of the user to be returned
response_data = json.loads(response.data)
self.assertEqual(response_data['id'], 1)
self.assertEqual(response_data['first_name'], request_data['first_name'])
self.assertEqual(response_data['last_name'], request_data['last_name'])
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.get_by_id')
def test_get_user(self, m_get_by_id):
"""It lists all the users in the database"""
# expect to get a 404 response if no user found for ID
m_get_by_id.return_value = None
response = self.client.get("/oop_phrasebook/user/-1",
content_type='application/json')
self.assertEqual(response.status_code, 404)
# expect to get a json object representation of a user to be returned
mocked_user_data = {'id': 1, 'first_name': 'Adam', 'last_name': 'Anderson'}
m_get_by_id.return_value = mocked_user_data
response = self.client.get("/oop_phrasebook/user/{}".format(mocked_user_data['id']),
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertEqual(response_data['id'], mocked_user_data['id'])
self.assertEqual(response_data['first_name'], mocked_user_data['first_name'])
self.assertEqual(response_data['last_name'], mocked_user_data['last_name'])
@mock.patch('eggsnspam.oop_phrasebook.daos.BreakfastIngredientDao.list_all')
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.get_by_id_join_preferences')
def test_breakfast_recommendations(self, m_get_by_id_join_preferences, m_list_all):
"""It returns the recommended breakfasts for a user"""
# Expect a 404 resposne code if the user does not exist
m_list_all.return_value = [
{u'breakfast_id': 1, u'ingredient_id': 1, u'coefficient': 0.8},
{u'breakfast_id': 1, u'ingredient_id': 2, u'coefficient': 0.8},
{u'breakfast_id': 1, u'ingredient_id': 3, u'coefficient': 0.2},
{u'breakfast_id': 2, u'ingredient_id': 1, u'coefficient': 0.0},
{u'breakfast_id': 2, u'ingredient_id': 2, u'coefficient': 0.2},
{u'breakfast_id': 2, u'ingredient_id': 3, u'coefficient': 0.9},
{u'breakfast_id': 3, u'ingredient_id': 1, u'coefficient': 0.9},
{u'breakfast_id': 3, u'ingredient_id': 2, u'coefficient': 0.5},
{u'breakfast_id': 3, u'ingredient_id': 3, u'coefficient': 0.1}
]
m_get_by_id_join_preferences.return_value = None
response = self.client.get("/oop_phrasebook/user/0/breakfast_recommendations",
content_type='application/json')
self.assertEqual(response.status_code, 404)
# Expect recommendations to be returned for a user with preferences
m_get_by_id_join_preferences.return_value = {
'id': 1,
'first_name': 'Adam',
'last_name': 'Anderson',
'preferences': {
0: 0.8,
1: 0.4,
2: 0.6,
}
}
response = self.client.get("/oop_phrasebook/user/1/breakfast_recommendations",
content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertIn('breakfast_recs', response_data)
self.assertEqual(len(response_data['breakfast_recs']), 3)
self.assertTrue('breakfast_id' in response_data['breakfast_recs'][0])
self.assertTrue('score' in response_data['breakfast_recs'][0])
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.get_by_id')
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.update')
def test_update_user(self, m_update, m_get_by_id):
"""It updates a user in the database"""
request_data = {
"first_name": "Beta",
"last_name": "Baboon"
}
# expect to get a 404 response if no user found for ID
m_get_by_id.return_value = None
response = self.client.put("/oop_phrasebook/user/-1",
content_type='application/json')
self.assertEqual(response.status_code, 404)
# expect a json representation of the updated user to be returned
m_get_by_id.return_value = {'id': 1, 'first_name': 'Adam', 'last_name': 'Anderson'}
m_update.return_value = 1
response = self.client.put("/oop_phrasebook/user/1",
content_type='application/json',
data=json.dumps(request_data))
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertEqual(response_data['first_name'], request_data['first_name'])
self.assertEqual(response_data['last_name'], request_data['last_name'])
self.assertEqual(m_update.call_args[1]['first_name'], request_data['first_name'])
self.assertEqual(m_update.call_args[1]['last_name'], request_data['last_name'])
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.get_by_id')
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.delete')
def test_delete_user(self, m_delete, m_get_by_id):
"""It creates a user record in the database"""
# expect a 404 error if no record matches the ID
m_get_by_id.return_value = None
response = self.client.delete("/oop_phrasebook/user/-1")
self.assertEqual(response.status_code, 404)
# expect an object to be deleted if it is found
m_get_by_id.return_value = {'id': 1, 'first_name': 'Adam', 'last_name': 'Anderson'}
m_delete.return_value = True
response = self.client.delete("/oop_phrasebook/user/1")
self.assertEqual(response.status_code, 204)
# expect an failed database call to return an error
m_get_by_id.return_value = {'id': 1, 'first_name': 'Adam', 'last_name': 'Anderson'}
m_delete.return_value = False
response = self.client.delete("/oop_phrasebook/user/1")
self.assertEqual(response.status_code, 500)
class UserPreferencesTestCase(BaseTestCase):
list_url_template = "/oop_phrasebook/user/{user_id}/preference/"
detail_url_template = "/oop_phrasebook/user/{user_id}/preference/{ingredient_id}"
def setUp(self):
super(UserPreferencesTestCase, self).setUp()
# create a user for each test
self.user_id = 1
self.list_url = self.list_url_template.format(user_id=self.user_id)
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.get_by_id')
@mock.patch('eggsnspam.oop_phrasebook.daos.UserPreferenceDao.list_all_for_user')
def test_list_user_preferences(self, m_list_all_for_user, m_get_by_id):
"""It lists all the user preferences in the database"""
m_list_all_for_user.return_value = []
# expect 404 if user does not exist
m_get_by_id.return_value = None
response = self.client.get(self.list_url_template.format(user_id=0), content_type='application/json')
self.assertEqual(response.status_code, 404)
# expect no user preferences to return an empty json object
m_get_by_id.return_value = {'id': 1, 'first_name': 'Adam', 'last_name': 'Anderson'}
response = self.client.get(self.list_url, content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertIn("user_preferences", response_data)
self.assertEqual(len(response_data["user_preferences"]), 0)
# create 3 user preferences
prefs = [
{'id': 1, 'user_id': 1, 'ingredient_id': 4, 'coefficient': 0.8},
{'id': 2, 'user_id': 1, 'ingredient_id': 5, 'coefficient': 0.7},
{'id': 3, 'user_id': 1, 'ingredient_id': 6, 'coefficient': 0.9}
]
m_list_all_for_user.return_value = prefs
# exepect 3 objects to be returned
response = self.client.get(self.list_url, content_type='application/json')
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertIn("user_preferences", response_data)
self.assertEqual(len(response_data["user_preferences"]), 3)
@mock.patch('eggsnspam.oop_phrasebook.daos.UserPreferenceDao.create')
@mock.patch('eggsnspam.oop_phrasebook.daos.UserDao.get_by_id')
def test_create_user_preference(self, m_get_by_id, m_create):
"""It creates a user preference record in the database"""
m_create.return_value = 1
# expect 404 if user does not exist
m_get_by_id.return_value = None
response = self.client.post(self.list_url_template.format(user_id=0), content_type='application/json')
self.assertEqual(response.status_code, 404)
# expect a 400 error if invalid data is provided
m_get_by_id.return_value = {'id': 1, 'first_name': 'Adam', 'last_name': 'Anderson'}
response = self.client.post(self.list_url, content_type='application/json')
self.assertEqual(response.status_code, 400)
# new object payload
request_data = {'ingredient_id': 4, 'coefficient': 0.8}
# expect a 201 response if we created an object
response = self.client.post(self.list_url,
data=json.dumps(request_data),
content_type='application/json')
self.assertEqual(response.status_code, 201)
# expect the json reprisentation of the user to be returned
response_data = json.loads(response.data)
self.assertEqual(response_data['user_id'], self.user_id)
self.assertEqual(response_data['ingredient_id'], request_data['ingredient_id'])
self.assertEqual(response_data['coefficient'], request_data['coefficient'])
@mock.patch('eggsnspam.oop_phrasebook.daos.UserPreferenceDao.get_by_user_ingredient')
def test_get_user_preference(self, m_get_by_user_ingredient):
"""It lists all the users in the database"""
# expect 404 if user's ingredient preference does not exist
m_get_by_user_ingredient.return_value = None
response = self.client.get(self.detail_url_template.format(user_id=1, ingredient_id=-1),
content_type='application/json')
self.assertEqual(response.status_code, 404)
# expect to get a json object representation of a user preference
m_get_by_user_ingredient.return_value = {'id': 1, 'user_id': 1, 'ingredient_id': 4, 'coefficient': 0.8}
response = self.client.get(self.detail_url_template.format(user_id=1, ingredient_id=4),
content_type='application/json')
self.assertEqual(response.status_code, 200)
@mock.patch('eggsnspam.oop_phrasebook.daos.UserPreferenceDao.update')
@mock.patch('eggsnspam.oop_phrasebook.daos.UserPreferenceDao.get_by_user_ingredient')
def test_update_user_preference(self, m_get_by_user_ingredient, m_update):
"""It updates a user preference in the database"""
# expect 404 if user does not exist
m_get_by_user_ingredient.return_value = None
response = self.client.put(self.detail_url_template.format(user_id=0, ingredient_id=0),
content_type='application/json')
self.assertEqual(response.status_code, 404)
request_data = {
"coefficient": .9
}
# expect a json representation of the updated user to be returned
m_get_by_user_ingredient.return_value = {'id': 1, 'user_id': 1, 'ingredient_id': 4, 'coefficient': 0.8}
m_update.return_value = True
response = self.client.put(self.detail_url_template.format(user_id=1, ingredient_id=4),
content_type='application/json',
data=json.dumps(request_data))
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.data)
self.assertEqual(response_data['coefficient'], request_data['coefficient'])
@mock.patch('eggsnspam.oop_phrasebook.daos.UserPreferenceDao.delete')
@mock.patch('eggsnspam.oop_phrasebook.daos.UserPreferenceDao.get_by_user_ingredient')
def test_delete_user_preference(self, m_get_by_user_ingredient, m_delete):
"""It deletes a user record in the database"""
# expect a 404 error if invalid data is provided
m_get_by_user_ingredient.return_value = None
response = self.client.delete("/oop_phrasebook/user/0/preference/0")
self.assertEqual(response.status_code, 404)
# expect an object to be deleted if it is found
m_get_by_user_ingredient.return_value = {'id': 1, 'user_id': 1, 'ingredient_id': 4, 'coefficient': 0.8}
m_delete.return_value = True
response = self.client.delete(self.detail_url_template.format(user_id=1,
ingredient_id=4))
self.assertEqual(response.status_code, 204)
| 47.761364 | 111 | 0.647014 | 2,650 | 21,015 | 4.889434 | 0.064151 | 0.062978 | 0.08698 | 0.07386 | 0.835996 | 0.817936 | 0.788531 | 0.713051 | 0.666204 | 0.63101 | 0 | 0.018037 | 0.240209 | 21,015 | 439 | 112 | 47.870159 | 0.793449 | 0.12472 | 0 | 0.481848 | 0 | 0 | 0.214032 | 0.10261 | 0 | 0 | 0 | 0 | 0.244224 | 1 | 0.052805 | false | 0 | 0.013201 | 0 | 0.092409 | 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 |
1c0be359224bab2163c8a652329873818e1a7d96 | 42 | py | Python | tests/__init__.py | shashank-m/decepticonlp | 40c101cbd96814c3389d0c1205570edefc9152b0 | [
"MIT"
] | 14 | 2020-05-04T22:25:48.000Z | 2021-03-06T03:22:27.000Z | tests/__init__.py | blackrosedragon2/decepticonlp | 8cb7762153d942555dbff3709d6dbfd12efc7dd3 | [
"MIT"
] | 74 | 2020-05-08T20:47:13.000Z | 2022-02-10T01:43:37.000Z | tests/__init__.py | blackrosedragon2/decepticonlp | 8cb7762153d942555dbff3709d6dbfd12efc7dd3 | [
"MIT"
] | 18 | 2020-05-04T22:46:24.000Z | 2020-07-05T15:29:35.000Z | """Unit test package for decepticonlp."""
| 21 | 41 | 0.714286 | 5 | 42 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119048 | 42 | 1 | 42 | 42 | 0.810811 | 0.833333 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
1c544f464009fa98108855ee4a10af5aa6326431 | 1,296 | py | Python | orchestrator/core/orc_server/es_mirror/field.py | patconnole/openc2-oif-orchestrator | 98ec868e5fd964516c2c8267e5b0d8d72b9e3658 | [
"Apache-2.0"
] | 2 | 2019-07-02T14:06:24.000Z | 2021-07-07T09:45:54.000Z | orchestrator/core/orc_server/es_mirror/field.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | 22 | 2020-03-24T16:58:17.000Z | 2022-02-27T15:36:57.000Z | orchestrator/core/orc_server/es_mirror/field.py | oasis-open/openc2-oif | 9227d38cb53204b45641ac55aefd6a13d2aad563 | [
"Apache-2.0"
] | 10 | 2019-04-26T12:22:22.000Z | 2021-08-05T09:16:05.000Z | import uuid
from elasticsearch_dsl.field import (
Boolean,
Binary,
Byte,
Completion,
CustomField,
Date,
DateRange,
Double,
DoubleRange,
Field,
Float,
FloatRange,
GeoPoint,
GeoShape,
HalfFloat,
Integer,
IntegerRange,
Ip,
IpRange,
Join,
Keyword,
Long,
LongRange,
Murmur3,
Nested,
Object,
Percolator,
RangeField,
RankFeature,
ScaledFloat,
Short,
Text,
TokenCount
)
class UUID(Text):
name = 'uuid'
_coerce = True
def _deserialize(self, data):
return str(data)
def _serialize(self, data):
if data is None:
return None
return uuid.UUID(data) if isinstance(data, str) else data
__all__ = [
'Boolean',
'Binary',
'Byte',
'Completion',
'CustomField',
'Date',
'DateRange',
'Double',
'DoubleRange',
'Field',
'Float',
'FloatRange',
'GeoPoint',
'GeoShape',
'HalfFloat',
'Integer',
'IntegerRange',
'Ip',
'IpRange',
'Join',
'Keyword',
'Long',
'LongRange',
'Murmur3',
'Nested',
'Object',
'Percolator',
'RangeField',
'RankFeature',
'ScaledFloat',
'Short',
'Text',
'TokenCount',
'UUID'
]
| 14.561798 | 65 | 0.539352 | 109 | 1,296 | 6.33945 | 0.504587 | 0.037627 | 0.049204 | 0.078148 | 0.709117 | 0.709117 | 0.709117 | 0.709117 | 0.709117 | 0.709117 | 0 | 0.00232 | 0.334877 | 1,296 | 88 | 66 | 14.727273 | 0.799304 | 0 | 0 | 0 | 0 | 0 | 0.195216 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.024691 | false | 0 | 0.024691 | 0.012346 | 0.123457 | 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 |
1c5d8cd970f87ae5493c693fb6019e8d21afcada | 112 | py | Python | PR1000_10/PR10_PasswordCounter.py | Rigel772/Python1000-Practice-Activities | 0972f32d31bc2139d8c9954c46744d9ad7732346 | [
"MIT"
] | 30 | 2017-09-22T15:25:14.000Z | 2021-11-03T20:33:24.000Z | PR1000_10/PR10_PasswordCounter.py | Swapnil2095/Python1000-Practice-Activities | 0972f32d31bc2139d8c9954c46744d9ad7732346 | [
"MIT"
] | null | null | null | PR1000_10/PR10_PasswordCounter.py | Swapnil2095/Python1000-Practice-Activities | 0972f32d31bc2139d8c9954c46744d9ad7732346 | [
"MIT"
] | 21 | 2018-01-08T12:21:16.000Z | 2021-01-21T03:57:48.000Z | """
File: PR10_PasswordCounter.py
Requirements: PT10_PasswordCounter.pdf
"""
# TODO: Your solution goes here!
| 16 | 38 | 0.758929 | 13 | 112 | 6.384615 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040816 | 0.125 | 112 | 6 | 39 | 18.666667 | 0.806122 | 0.892857 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.166667 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
1c66556ce77715e97ee8c6f070d820a8e7d4df92 | 97 | py | Python | tgext/admin/__init__.py | TurboGears/tgext.admin | b11d3fb1d3ebba3c6db8f3985ab14df7a1412c81 | [
"MIT"
] | 3 | 2015-04-01T19:39:10.000Z | 2020-04-03T00:49:53.000Z | tgext/admin/__init__.py | TurboGears/tgext.admin | b11d3fb1d3ebba3c6db8f3985ab14df7a1412c81 | [
"MIT"
] | 6 | 2015-03-07T09:48:07.000Z | 2021-02-12T09:47:54.000Z | tgext/admin/__init__.py | TurboGears/tgext.admin | b11d3fb1d3ebba3c6db8f3985ab14df7a1412c81 | [
"MIT"
] | 3 | 2017-05-25T15:30:21.000Z | 2021-02-11T15:49:47.000Z | from .controller import AdminController
from .config import AdminConfig, CrudRestControllerConfig | 48.5 | 57 | 0.886598 | 9 | 97 | 9.555556 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.082474 | 97 | 2 | 57 | 48.5 | 0.966292 | 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 |
1c77a86cc84d08f4b6d49938a9767738d8015b8b | 10,668 | py | Python | tests/test_store.py | postmates/triton-python | 542b36782c915de604c286c1e0b50fae66a78eff | [
"ISC"
] | 1 | 2016-01-06T17:58:37.000Z | 2016-01-06T17:58:37.000Z | tests/test_store.py | postmates/triton-python | 542b36782c915de604c286c1e0b50fae66a78eff | [
"ISC"
] | 18 | 2015-12-01T19:33:36.000Z | 2020-11-02T22:56:11.000Z | tests/test_store.py | postmates/triton-python | 542b36782c915de604c286c1e0b50fae66a78eff | [
"ISC"
] | 1 | 2017-03-06T21:15:05.000Z | 2017-03-06T21:15:05.000Z | # -*- coding: utf-8 -*-
from testify import *
import datetime
import time
import os.path
import shutil
from triton import store
from triton.encoding import unicode_to_ascii_str
class StreamArchiveWriterFilePathTest(TestCase):
@setup
def build_stream(self):
self.dt = datetime.datetime(2015, 7, 24)
self.stream = store.StreamArchiveWriter({'name': "foo"}, self.dt,
"/tmp")
@setup
def build_unicode_stream(self):
self.dt_u = datetime.datetime(2015, 7, 24)
self.unicode_stream = store.StreamArchiveWriter(
{u'name': u'føø_üñîçødé_宇宙'},
self.dt_u, u'/tmp/uni')
@setup
def build_escaped_unicode_stream(self):
self.dt_ue = datetime.datetime(2015, 7, 24)
self.escaped_unicode_stream = store.StreamArchiveWriter(
{'name': 'føø_üñîçødé_宇宙_esc'},
self.dt_ue, '/tmp/uni-esc')
def test(self):
assert self.stream.file_path.startswith(
"/tmp/20150724/foo-archive-"), self.stream.file_path
assert self.stream.file_path.endswith('.tri')
def test_unicode(self):
assert self.unicode_stream.file_path.startswith(
u'/tmp/uni/20150724/føø_üñîçødé_宇宙-archive-'), self.unicode_stream.file_path
assert self.unicode_stream.file_path.endswith(u'.tri')
#NOTE: as usual, anything put in as escaped unicode will come out as unicode!
def test_escaped_unicode(self):
assert self.escaped_unicode_stream.file_path.startswith(
u'/tmp/uni-esc/20150724/føø_üñîçødé_宇宙_esc-archive-'), self.escaped_unicode_stream.file_path
assert self.escaped_unicode_stream.file_path.endswith(u'.tri')
class StreamArchiveWriterWriteTest(TestCase):
@setup
def build_stream(self):
self.dt = datetime.datetime(2015, 7, 24)
self.stream = store.StreamArchiveWriter({'name': "foo"}, self.dt,
"/tmp")
@setup
def build_unicode_stream(self):
self.dt_u = datetime.datetime(2015, 7, 24)
self.unicode_stream = store.StreamArchiveWriter(
{u'name': u'føø_üñîçødé_宇宙'},
self.dt_u, u'/tmp/uni')
@setup
def build_escaped_unicode_stream(self):
self.dt_ue = datetime.datetime(2015, 7, 24)
self.escaped_unicode_stream = store.StreamArchiveWriter(
{'name': 'føø_üñîçødé_宇宙_escaped'},
self.dt_ue, '/tmp/uni-esc')
def test_buffer(self):
self.stream.put(ts=time.time(), value="hello")
assert_is(self.stream.writer, None)
assert self.stream.buffer.tell() > 0
def test_flush(self):
self.stream.put(ts=time.time(), value="hello")
self.stream.flush()
assert_equal(self.stream.buffer.tell(), 0)
assert self.stream.writer
assert os.path.exists(self.stream.file_path)
shutil.rmtree(os.path.dirname(self.stream.file_path))
def test_buffer_unicode(self):
self.unicode_stream.put(ts=time.time(), value=u"üñîçødé")
assert_is(self.unicode_stream.writer, None)
assert self.unicode_stream.buffer.tell() > 0
def test_flush_unicode(self):
self.unicode_stream.put(ts=time.time(), value=u"üñîçødé")
self.unicode_stream.flush()
assert_equal(self.unicode_stream.buffer.tell(), 0)
assert self.unicode_stream.writer
assert os.path.exists(unicode_to_ascii_str(self.unicode_stream.file_path))
shutil.rmtree(os.path.dirname(unicode_to_ascii_str(self.unicode_stream.file_path)))
def test_buffer_escaped_unicode(self):
self.escaped_unicode_stream.put(ts=time.time(), value="üñîçødé")
assert_is(self.escaped_unicode_stream.writer, None)
assert self.escaped_unicode_stream.buffer.tell() > 0
def test_flush_escaped_unicode(self):
self.escaped_unicode_stream.put(ts=time.time(), value="üñîçødé")
self.escaped_unicode_stream.flush()
assert_equal(self.escaped_unicode_stream.buffer.tell(), 0)
assert self.escaped_unicode_stream.writer
assert os.path.exists(unicode_to_ascii_str(self.escaped_unicode_stream.file_path))
shutil.rmtree(os.path.dirname(unicode_to_ascii_str(self.escaped_unicode_stream.file_path)))
class StreamArchiveReaderShortTest(TestCase):
@setup
def create_data(self):
writer = store.StreamArchiveWriter({'name': "foo"},
datetime.datetime.utcnow(), "/tmp")
self.file_path = writer.file_path
writer.put(ts=time.time(), value="hello")
writer.close()
@setup
def create_unicode_data(self):
unicode_writer = store.StreamArchiveWriter(
{u'name': u'føø_üñîçødé_宇宙'},
datetime.datetime.utcnow(), u'/tmp/uni')
self.unicode_file_path = unicode_writer.file_path
unicode_writer.put(ts=time.time(), value=u"hello_üñîçødé_宇宙")
unicode_writer.close()
@setup
def create_escaped_unicode_data(self):
escaped_unicode_writer = store.StreamArchiveWriter(
{'name': 'føø_üñîçødé_宇宙_escaped'},
datetime.datetime.utcnow(), '/tmp/uni-esc')
self.escaped_unicode_file_path = escaped_unicode_writer.file_path
escaped_unicode_writer.put(ts=time.time(), value="hello_üñîçødé_宇宙")
escaped_unicode_writer.close()
@setup
def build_reader(self):
self.reader = store.StreamArchiveReader(self.file_path)
@setup
def build_unicode_reader(self):
self.unicode_reader = store.StreamArchiveReader(self.unicode_file_path)
@setup
def build_escaped_unicode_reader(self):
self.escaped_unicode_reader = store.StreamArchiveReader(self.escaped_unicode_file_path)
def test(self):
recs = list(self.reader)
assert_equal(len(recs), 1)
assert_equal(recs[0]['value'], "hello")
assert recs[0]['ts']
def test_unicode(self):
u_recs = list(self.unicode_reader)
assert_equal(len(u_recs), 1)
assert_equal(u_recs[0][u'value'], u"hello_üñîçødé_宇宙")
assert u_recs[0][u'ts']
#NOTE: as usual, anything put in as escaped unicode will come out as unicode!
def test_escaped_unicode(self):
ue_recs = list(self.escaped_unicode_reader)
assert_equal(len(ue_recs), 1)
assert_equal(ue_recs[0]['value'], u"hello_üñîçødé_宇宙")
assert ue_recs[0]['ts']
@teardown
def cleanup_data(self):
shutil.rmtree(os.path.dirname(self.file_path))
shutil.rmtree(os.path.dirname(unicode_to_ascii_str(self.unicode_file_path)))
shutil.rmtree(os.path.dirname(unicode_to_ascii_str(self.escaped_unicode_file_path)))
class StreamArchiveReaderFullTest(TestCase):
@setup
def create_data(self):
writer = store.StreamArchiveWriter({'name': "foo"},
datetime.datetime.utcnow(), "/tmp")
self.file_path = writer.file_path
# We want multiple objects, in multiple snappy frames
writer.put(ts=time.time(), value="hello")
writer.put(ts=time.time(), value="hello 1")
writer.flush()
writer.put(ts=time.time(), value="hello 2")
writer.put(ts=time.time(), value="hello 3")
writer.close()
@setup
def create_unicode_data(self):
unicode_writer = store.StreamArchiveWriter({u'name': u"üñîçødé_foo_宇宙"},
datetime.datetime.utcnow(), u"/tmp/uni")
self.unicode_file_path = unicode_writer.file_path
# We want multiple objects, in multiple snappy frames
unicode_writer.put(ts=time.time(), value=u"hello üñîçodé 宇宙")
unicode_writer.put(ts=time.time(), value=u"hello 1 µø®é üñîçødé 宇宙")
unicode_writer.flush()
unicode_writer.put(ts=time.time(), value=u"hello 2 宇宙 üñîçodé")
unicode_writer.put(ts=time.time(), value=u"hello 3 宇宙 µø®é üñîçødé")
unicode_writer.close()
@setup
def create_escaped_unicode_data(self):
escaped_unicode_writer = store.StreamArchiveWriter({'name': "üñîçødé_foo_宇宙_esc"},
datetime.datetime.utcnow(), "/tmp/uni-esc")
self.escaped_unicode_file_path = escaped_unicode_writer.file_path
# We want multiple objects, in multiple snappy frames
escaped_unicode_writer.put(ts=time.time(), value="hello üñîçodé 宇宙")
escaped_unicode_writer.put(ts=time.time(), value="hello 1 µø®é üñîçødé 宇宙")
escaped_unicode_writer.flush()
escaped_unicode_writer.put(ts=time.time(), value="hello 2 宇宙 üñîçodé")
escaped_unicode_writer.put(ts=time.time(), value="hello 3 宇宙 µø®é üñîçødé")
escaped_unicode_writer.close()
@setup
def build_reader(self):
self.reader = store.StreamArchiveReader(self.file_path)
@setup
def build_unicode_reader(self):
self.unicode_reader = store.StreamArchiveReader(self.unicode_file_path)
@setup
def build_escaped_unicode_reader(self):
self.escaped_unicode_reader = store.StreamArchiveReader(self.escaped_unicode_file_path)
def test(self):
recs = list(self.reader)
assert_equal(len(recs), 4)
assert_equal(recs[0]['value'], "hello")
assert_equal(recs[3]['value'], "hello 3")
def test_unicode(self):
u_recs = list(self.unicode_reader)
assert_equal(len(u_recs), 4)
assert_equal(u_recs[0][u'value'], u"hello üñîçodé 宇宙")
assert_equal(u_recs[3][u'value'], u"hello 3 宇宙 µø®é üñîçødé")
#NOTE: as usual, anything put in as escaped unicode will come out as unicode!
def test_escaped_unicode(self):
ue_recs = list(self.escaped_unicode_reader)
assert_equal(len(ue_recs), 4)
assert_equal(ue_recs[0]['value'], u"hello üñîçodé 宇宙")
assert_equal(ue_recs[3]['value'], u"hello 3 宇宙 µø®é üñîçødé")
@teardown
def cleanup_data(self):
shutil.rmtree(os.path.dirname(self.file_path))
shutil.rmtree(os.path.dirname(unicode_to_ascii_str(self.unicode_file_path)))
shutil.rmtree(os.path.dirname(unicode_to_ascii_str(self.escaped_unicode_file_path)))
| 37.300699 | 104 | 0.634889 | 1,347 | 10,668 | 4.801782 | 0.074981 | 0.108225 | 0.072356 | 0.042208 | 0.904762 | 0.876469 | 0.825758 | 0.765615 | 0.695424 | 0.601113 | 0 | 0.012919 | 0.252625 | 10,668 | 285 | 105 | 37.431579 | 0.797567 | 0.037964 | 0 | 0.568627 | 0 | 0 | 0.083764 | 0.015602 | 0 | 0 | 0 | 0 | 0.191176 | 1 | 0.171569 | false | 0 | 0.034314 | 0 | 0.22549 | 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 |
98d82f4f1aa8f63924663cca3bdc2bb82fb52515 | 2,080 | py | Python | regression/simulator_kelly.py | pllim/astroML-workshop_AAS235 | 74b49bcaeac45c3cc231ff0e3f4db7c5e366b889 | [
"BSD-3-Clause"
] | 6 | 2020-01-06T23:16:04.000Z | 2021-07-10T06:07:17.000Z | regression/simulator_kelly.py | pllim/astroML-workshop_AAS235 | 74b49bcaeac45c3cc231ff0e3f4db7c5e366b889 | [
"BSD-3-Clause"
] | 4 | 2019-12-20T02:20:04.000Z | 2021-07-04T14:45:02.000Z | regression/simulator_kelly.py | pllim/astroML-workshop_AAS235 | 74b49bcaeac45c3cc231ff0e3f4db7c5e366b889 | [
"BSD-3-Clause"
] | 6 | 2019-11-18T22:44:12.000Z | 2021-04-02T03:40:45.000Z | import numpy as np
from scipy.stats.distributions import rv_continuous
__all__ = ['simulation', 'simulation_multidim']
class simulation_dist(rv_continuous):
def _pdf(self, x):
# eq 110
return 0.796248 * np.exp(x) / (1 + np.exp(2.75 * x))
def simulation(size=50, low=-10, high=10, alpha=1, beta=0.5,
epsilon=(0, 0.75), scalex=1, scaley=1):
"""
Data simulator from Kelly 2007
"""
eps = np.random.normal(epsilon[0], scale=epsilon[1], size=size)
dist = simulation_dist(a=low, b=high)
# I'm sorry about ksi, but it's less ambigous than having
# xi for greek and xi for vector x_i
ksi = dist.rvs(size=size)
# eq 1
eta = alpha + beta * ksi + eps
tau = np.var(ksi)
t = scalex * tau
s = scaley * epsilon[1]
# measurement errors from scaled inverse chi2 with df=5
sigma_x = 5 * t / np.random.chisquare(df=5, size=size)
sigma_y = 5 * s / np.random.chisquare(df=5, size=size)
x = np.random.normal(ksi, sigma_x)
y = np.random.normal(eta, sigma_y)
return ksi, eta, x, y, sigma_x, sigma_y, alpha, beta
def simulation_multidim(size=50, low=-10, high=10, alpha=1, beta=0.5,
epsilon=(0, 0.75), scalex=1, scaley=1, multidim=1):
"""
Data simulator from Kelly 2007 for multidimensional case
"""
eps = np.random.normal(epsilon[0], scale=epsilon[1], size=size)
dist = simulation_dist(a=low, b=high)
# I'm sorry about ksi, but it's less ambigous than having
# xi for greek and xi for vector x_i
ksi = dist.rvs(size=(multidim, size))
# eq 1
beta = np.atleast_1d(beta)
eta = alpha + np.dot(beta, ksi) + eps
tau = np.var(ksi)
t = scalex * tau
s = scaley * epsilon[1]
# measurement errors from scaled inverse chi2 with df=5
sigma_x = 5 * t / np.random.chisquare(df=5, size=(multidim, size))
sigma_y = 5 * s / np.random.chisquare(df=5, size=size)
x = np.random.normal(ksi, sigma_x)
y = np.random.normal(eta, sigma_y)
return ksi, eta, x, y, sigma_x, sigma_y, alpha, beta
| 28.108108 | 75 | 0.622115 | 341 | 2,080 | 3.715543 | 0.252199 | 0.063141 | 0.066298 | 0.059984 | 0.761642 | 0.761642 | 0.719811 | 0.719811 | 0.719811 | 0.719811 | 0 | 0.047104 | 0.244712 | 2,080 | 73 | 76 | 28.493151 | 0.759389 | 0.190385 | 0 | 0.514286 | 0 | 0 | 0.017629 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.085714 | false | 0 | 0.057143 | 0.028571 | 0.257143 | 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 |
98e6623860b70e8e6161e7fc91334471ba29a2bc | 75 | py | Python | project1/srv/model/__init__.py | mission-liao/flask_template | 59bc2572914363ec14baff7a99ba7ca06b16bed5 | [
"MIT"
] | null | null | null | project1/srv/model/__init__.py | mission-liao/flask_template | 59bc2572914363ec14baff7a99ba7ca06b16bed5 | [
"MIT"
] | null | null | null | project1/srv/model/__init__.py | mission-liao/flask_template | 59bc2572914363ec14baff7a99ba7ca06b16bed5 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .users import Users as Users
| 15 | 38 | 0.826667 | 11 | 75 | 5.181818 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16 | 75 | 4 | 39 | 18.75 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
98eaa32b54a04169057f72b752b6f6eb27283a53 | 24,998 | py | Python | src/larksuiteoapi/service/contact/v3/model.py | VXenomac/oapi-sdk-python | 156b789b3d20653802f64842c9a26229dd9252d7 | [
"Apache-2.0"
] | 50 | 2021-04-11T05:24:10.000Z | 2022-03-29T10:14:13.000Z | src/larksuiteoapi/service/contact/v3/model.py | larksuite/oapi-sdk-python | 70fda5b1ccf765938bf207dff0117c0c03a93605 | [
"Apache-2.0"
] | 20 | 2021-04-07T15:17:44.000Z | 2022-03-23T06:27:12.000Z | src/larksuiteoapi/service/contact/v3/model.py | VXenomac/oapi-sdk-python | 156b789b3d20653802f64842c9a26229dd9252d7 | [
"Apache-2.0"
] | 8 | 2021-04-25T15:02:17.000Z | 2022-03-13T15:00:59.000Z | # -*- coding: UTF-8 -*-
# Code generated by lark suite oapi sdk gen
from typing import List, Dict, Any
from ....utils.dt import to_json_decorator
from ....event.model.event import *
import attr
@to_json_decorator
@attr.s
class CustomAttrOption(object):
id = attr.ib(type=str, default=None, metadata={'json': 'id'})
value = attr.ib(type=str, default=None, metadata={'json': 'value'})
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
@to_json_decorator
@attr.s
class CustomAttrOptions(object):
default_option_id = attr.ib(type=str, default=None, metadata={'json': 'default_option_id'})
option_type = attr.ib(type=str, default=None, metadata={'json': 'option_type'})
options = attr.ib(type=List[CustomAttrOption], default=None, metadata={'json': 'options'})
@to_json_decorator
@attr.s
class CustomAttrGenericUser(object):
id = attr.ib(type=str, default=None, metadata={'json': 'id'})
type = attr.ib(type=int, default=None, metadata={'json': 'type'})
@to_json_decorator
@attr.s
class UserCustomAttrValue(object):
text = attr.ib(type=str, default=None, metadata={'json': 'text'})
url = attr.ib(type=str, default=None, metadata={'json': 'url'})
pc_url = attr.ib(type=str, default=None, metadata={'json': 'pc_url'})
option_id = attr.ib(type=str, default=None, metadata={'json': 'option_id'})
option_value = attr.ib(type=str, default=None, metadata={'json': 'option_value'})
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
picture_url = attr.ib(type=str, default=None, metadata={'json': 'picture_url'})
generic_user = attr.ib(type=CustomAttrGenericUser, default=None, metadata={'json': 'generic_user'})
@to_json_decorator
@attr.s
class UserCustomAttr(object):
type = attr.ib(type=str, default=None, metadata={'json': 'type'})
id = attr.ib(type=str, default=None, metadata={'json': 'id'})
value = attr.ib(type=UserCustomAttrValue, default=None, metadata={'json': 'value'})
@to_json_decorator
@attr.s
class UserStatus(object):
is_frozen = attr.ib(type=bool, default=None, metadata={'json': 'is_frozen'})
is_resigned = attr.ib(type=bool, default=None, metadata={'json': 'is_resigned'})
is_activated = attr.ib(type=bool, default=None, metadata={'json': 'is_activated'})
@to_json_decorator
@attr.s
class UserPosition(object):
position_code = attr.ib(type=str, default=None, metadata={'json': 'position_code'})
position_name = attr.ib(type=str, default=None, metadata={'json': 'position_name'})
department_id = attr.ib(type=str, default=None, metadata={'json': 'department_id'})
leader_user_id = attr.ib(type=str, default=None, metadata={'json': 'leader_user_id'})
leader_position_code = attr.ib(type=str, default=None, metadata={'json': 'leader_position_code'})
is_major = attr.ib(type=bool, default=None, metadata={'json': 'is_major'})
@to_json_decorator
@attr.s
class UserOrder(object):
department_id = attr.ib(type=str, default=None, metadata={'json': 'department_id'})
user_order = attr.ib(type=int, default=None, metadata={'json': 'user_order'})
department_order = attr.ib(type=int, default=None, metadata={'json': 'department_order'})
@to_json_decorator
@attr.s
class UserGroup(object):
user_group_id = attr.ib(type=str, default=None, metadata={'json': 'user_group_id'})
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
type = attr.ib(type=int, default=None, metadata={'json': 'type'})
member_count = attr.ib(type=int, default=None, metadata={'json': 'member_count'})
status = attr.ib(type=int, default=None, metadata={'json': 'status'})
@to_json_decorator
@attr.s
class NotificationOption(object):
channels = attr.ib(type=List[str], default=None, metadata={'json': 'channels'})
language = attr.ib(type=str, default=None, metadata={'json': 'language'})
@to_json_decorator
@attr.s
class I18nContent(object):
locale = attr.ib(type=str, default=None, metadata={'json': 'locale'})
value = attr.ib(type=str, default=None, metadata={'json': 'value'})
@to_json_decorator
@attr.s
class EmployeeTypeEnum(object):
__int_to_string_fields__ = attr.ib(type=List[str], default=["enum_value"])
enum_id = attr.ib(type=str, default=None, metadata={'json': 'enum_id'})
enum_value = attr.ib(type=int, default=None, metadata={'json': 'enum_value'})
content = attr.ib(type=str, default=None, metadata={'json': 'content'})
enum_type = attr.ib(type=int, default=None, metadata={'json': 'enum_type'})
enum_status = attr.ib(type=int, default=None, metadata={'json': 'enum_status'})
i18n_content = attr.ib(type=List[I18nContent], default=None, metadata={'json': 'i18n_content'})
@to_json_decorator
@attr.s
class CustomAttr(object):
id = attr.ib(type=str, default=None, metadata={'json': 'id'})
type = attr.ib(type=str, default=None, metadata={'json': 'type'})
options = attr.ib(type=CustomAttrOptions, default=None, metadata={'json': 'options'})
i18n_name = attr.ib(type=List[I18nContent], default=None, metadata={'json': 'i18n_name'})
@to_json_decorator
@attr.s
class DepartmentStatus(object):
is_deleted = attr.ib(type=bool, default=None, metadata={'json': 'is_deleted'})
@to_json_decorator
@attr.s
class OldDepartmentObject(object):
status = attr.ib(type=DepartmentStatus, default=None, metadata={'json': 'status'})
open_department_id = attr.ib(type=str, default=None, metadata={'json': 'open_department_id'})
@to_json_decorator
@attr.s
class DepartmentEvent(object):
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
parent_department_id = attr.ib(type=str, default=None, metadata={'json': 'parent_department_id'})
department_id = attr.ib(type=str, default=None, metadata={'json': 'department_id'})
open_department_id = attr.ib(type=str, default=None, metadata={'json': 'open_department_id'})
leader_user_id = attr.ib(type=str, default=None, metadata={'json': 'leader_user_id'})
chat_id = attr.ib(type=str, default=None, metadata={'json': 'chat_id'})
order = attr.ib(type=int, default=None, metadata={'json': 'order'})
status = attr.ib(type=DepartmentStatus, default=None, metadata={'json': 'status'})
@to_json_decorator
@attr.s
class DepartmentI18nName(object):
zh_cn = attr.ib(type=str, default=None, metadata={'json': 'zh_cn'})
ja_jp = attr.ib(type=str, default=None, metadata={'json': 'ja_jp'})
en_us = attr.ib(type=str, default=None, metadata={'json': 'en_us'})
@to_json_decorator
@attr.s
class Department(object):
__int_to_string_fields__ = attr.ib(type=List[str], default=["order"])
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
i18n_name = attr.ib(type=DepartmentI18nName, default=None, metadata={'json': 'i18n_name'})
parent_department_id = attr.ib(type=str, default=None, metadata={'json': 'parent_department_id'})
department_id = attr.ib(type=str, default=None, metadata={'json': 'department_id'})
open_department_id = attr.ib(type=str, default=None, metadata={'json': 'open_department_id'})
leader_user_id = attr.ib(type=str, default=None, metadata={'json': 'leader_user_id'})
chat_id = attr.ib(type=str, default=None, metadata={'json': 'chat_id'})
order = attr.ib(type=int, default=None, metadata={'json': 'order'})
unit_ids = attr.ib(type=List[str], default=None, metadata={'json': 'unit_ids'})
member_count = attr.ib(type=int, default=None, metadata={'json': 'member_count'})
status = attr.ib(type=DepartmentStatus, default=None, metadata={'json': 'status'})
create_group_chat = attr.ib(type=bool, default=None, metadata={'json': 'create_group_chat'})
@to_json_decorator
@attr.s
class AvatarInfo(object):
avatar_72 = attr.ib(type=str, default=None, metadata={'json': 'avatar_72'})
avatar_240 = attr.ib(type=str, default=None, metadata={'json': 'avatar_240'})
avatar_640 = attr.ib(type=str, default=None, metadata={'json': 'avatar_640'})
avatar_origin = attr.ib(type=str, default=None, metadata={'json': 'avatar_origin'})
@to_json_decorator
@attr.s
class User(object):
union_id = attr.ib(type=str, default=None, metadata={'json': 'union_id'})
user_id = attr.ib(type=str, default=None, metadata={'json': 'user_id'})
open_id = attr.ib(type=str, default=None, metadata={'json': 'open_id'})
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
en_name = attr.ib(type=str, default=None, metadata={'json': 'en_name'})
email = attr.ib(type=str, default=None, metadata={'json': 'email'})
mobile = attr.ib(type=str, default=None, metadata={'json': 'mobile'})
mobile_visible = attr.ib(type=bool, default=None, metadata={'json': 'mobile_visible'})
gender = attr.ib(type=int, default=None, metadata={'json': 'gender'})
avatar_key = attr.ib(type=str, default=None, metadata={'json': 'avatar_key'})
avatar = attr.ib(type=AvatarInfo, default=None, metadata={'json': 'avatar'})
status = attr.ib(type=UserStatus, default=None, metadata={'json': 'status'})
department_ids = attr.ib(type=List[str], default=None, metadata={'json': 'department_ids'})
leader_user_id = attr.ib(type=str, default=None, metadata={'json': 'leader_user_id'})
city = attr.ib(type=str, default=None, metadata={'json': 'city'})
country = attr.ib(type=str, default=None, metadata={'json': 'country'})
work_station = attr.ib(type=str, default=None, metadata={'json': 'work_station'})
join_time = attr.ib(type=int, default=None, metadata={'json': 'join_time'})
is_tenant_manager = attr.ib(type=bool, default=None, metadata={'json': 'is_tenant_manager'})
employee_no = attr.ib(type=str, default=None, metadata={'json': 'employee_no'})
employee_type = attr.ib(type=int, default=None, metadata={'json': 'employee_type'})
orders = attr.ib(type=List[UserOrder], default=None, metadata={'json': 'orders'})
custom_attrs = attr.ib(type=List[UserCustomAttr], default=None, metadata={'json': 'custom_attrs'})
enterprise_email = attr.ib(type=str, default=None, metadata={'json': 'enterprise_email'})
job_title = attr.ib(type=str, default=None, metadata={'json': 'job_title'})
need_send_notification = attr.ib(type=bool, default=None, metadata={'json': 'need_send_notification'})
notification_option = attr.ib(type=NotificationOption, default=None, metadata={'json': 'notification_option'})
is_frozen = attr.ib(type=bool, default=None, metadata={'json': 'is_frozen'})
@to_json_decorator
@attr.s
class Scope(object):
departments = attr.ib(type=List[Department], default=None, metadata={'json': 'departments'})
users = attr.ib(type=List[User], default=None, metadata={'json': 'users'})
user_groups = attr.ib(type=List[UserGroup], default=None, metadata={'json': 'user_groups'})
@to_json_decorator
@attr.s
class UserEvent(object):
open_id = attr.ib(type=str, default=None, metadata={'json': 'open_id'})
user_id = attr.ib(type=str, default=None, metadata={'json': 'user_id'})
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
en_name = attr.ib(type=str, default=None, metadata={'json': 'en_name'})
email = attr.ib(type=str, default=None, metadata={'json': 'email'})
mobile = attr.ib(type=str, default=None, metadata={'json': 'mobile'})
gender = attr.ib(type=int, default=None, metadata={'json': 'gender'})
avatar = attr.ib(type=AvatarInfo, default=None, metadata={'json': 'avatar'})
status = attr.ib(type=UserStatus, default=None, metadata={'json': 'status'})
department_ids = attr.ib(type=List[str], default=None, metadata={'json': 'department_ids'})
leader_user_id = attr.ib(type=str, default=None, metadata={'json': 'leader_user_id'})
city = attr.ib(type=str, default=None, metadata={'json': 'city'})
country = attr.ib(type=str, default=None, metadata={'json': 'country'})
work_station = attr.ib(type=str, default=None, metadata={'json': 'work_station'})
join_time = attr.ib(type=int, default=None, metadata={'json': 'join_time'})
employee_no = attr.ib(type=str, default=None, metadata={'json': 'employee_no'})
employee_type = attr.ib(type=int, default=None, metadata={'json': 'employee_type'})
orders = attr.ib(type=List[UserOrder], default=None, metadata={'json': 'orders'})
custom_attrs = attr.ib(type=List[UserCustomAttr], default=None, metadata={'json': 'custom_attrs'})
@to_json_decorator
@attr.s
class CustomAttrEvent(object):
contact_field_key = attr.ib(type=str, default=None, metadata={'json': 'contact_field_key'})
field_value_types = attr.ib(type=str, default=None, metadata={'json': 'field_value_types'})
i18n_field_names = attr.ib(type=str, default=None, metadata={'json': 'i18n_field_names'})
allow_open_query = attr.ib(type=str, default=None, metadata={'json': 'allow_open_query'})
@to_json_decorator
@attr.s
class DepartmentUnit(object):
unit_id = attr.ib(type=str, default=None, metadata={'json': 'unit_id'})
unit_type = attr.ib(type=str, default=None, metadata={'json': 'unit_type'})
unit_name = attr.ib(type=str, default=None, metadata={'json': 'unit_name'})
@to_json_decorator
@attr.s
class GroupEvent(object):
user_group_id = attr.ib(type=str, default=None, metadata={'json': 'user_group_id'})
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
@to_json_decorator
@attr.s
class DepartmentCount(object):
department_id = attr.ib(type=str, default=None, metadata={'json': 'department_id'})
direct_department_count = attr.ib(type=int, default=None, metadata={'json': 'direct_department_count'})
direct_user_count = attr.ib(type=int, default=None, metadata={'json': 'direct_user_count'})
department_count = attr.ib(type=int, default=None, metadata={'json': 'department_count'})
user_count = attr.ib(type=int, default=None, metadata={'json': 'user_count'})
@to_json_decorator
@attr.s
class DepartmentParent(object):
department_id = attr.ib(type=str, default=None, metadata={'json': 'department_id'})
parent_ids = attr.ib(type=List[str], default=None, metadata={'json': 'parent_ids'})
@to_json_decorator
@attr.s
class OldUserObject(object):
department_ids = attr.ib(type=List[str], default=None, metadata={'json': 'department_ids'})
open_id = attr.ib(type=str, default=None, metadata={'json': 'open_id'})
@to_json_decorator
@attr.s
class Group(object):
id = attr.ib(type=str, default=None, metadata={'json': 'id'})
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
description = attr.ib(type=str, default=None, metadata={'json': 'description'})
member_user_count = attr.ib(type=int, default=None, metadata={'json': 'member_user_count'})
member_department_count = attr.ib(type=int, default=None, metadata={'json': 'member_department_count'})
@to_json_decorator
@attr.s
class Memberlist(object):
member_id = attr.ib(type=str, default=None, metadata={'json': 'member_id'})
member_type = attr.ib(type=str, default=None, metadata={'json': 'member_type'})
@attr.s
class CustomAttrListResult(object):
items = attr.ib(type=List[CustomAttr], default=None, metadata={'json': 'items'})
page_token = attr.ib(type=str, default=None, metadata={'json': 'page_token'})
has_more = attr.ib(type=bool, default=None, metadata={'json': 'has_more'})
@attr.s
class DepartmentGetResult(object):
department = attr.ib(type=Department, default=None, metadata={'json': 'department'})
@attr.s
class DepartmentListResult(object):
has_more = attr.ib(type=bool, default=None, metadata={'json': 'has_more'})
page_token = attr.ib(type=str, default=None, metadata={'json': 'page_token'})
items = attr.ib(type=List[Department], default=None, metadata={'json': 'items'})
@attr.s
class DepartmentPatchResult(object):
department = attr.ib(type=Department, default=None, metadata={'json': 'department'})
@attr.s
class DepartmentCreateResult(object):
department = attr.ib(type=Department, default=None, metadata={'json': 'department'})
@attr.s
class DepartmentUpdateResult(object):
department = attr.ib(type=Department, default=None, metadata={'json': 'department'})
@attr.s
class DepartmentParentResult(object):
has_more = attr.ib(type=bool, default=None, metadata={'json': 'has_more'})
page_token = attr.ib(type=str, default=None, metadata={'json': 'page_token'})
items = attr.ib(type=List[Department], default=None, metadata={'json': 'items'})
@to_json_decorator
@attr.s
class DepartmentSearchReqBody(object):
query = attr.ib(type=str, default=None, metadata={'json': 'query'})
@attr.s
class DepartmentSearchResult(object):
items = attr.ib(type=List[Department], default=None, metadata={'json': 'items'})
page_token = attr.ib(type=str, default=None, metadata={'json': 'page_token'})
has_more = attr.ib(type=bool, default=None, metadata={'json': 'has_more'})
@attr.s
class EmployeeTypeEnumListResult(object):
items = attr.ib(type=List[EmployeeTypeEnum], default=None, metadata={'json': 'items'})
has_more = attr.ib(type=bool, default=None, metadata={'json': 'has_more'})
page_token = attr.ib(type=str, default=None, metadata={'json': 'page_token'})
@attr.s
class EmployeeTypeEnumCreateResult(object):
employee_type_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'employee_type_enum'})
@attr.s
class EmployeeTypeEnumUpdateResult(object):
employee_type_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'employee_type_enum'})
@to_json_decorator
@attr.s
class GroupCreateReqBody(object):
group_id = attr.ib(type=str, default=None, metadata={'json': 'group_id'})
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
description = attr.ib(type=str, default=None, metadata={'json': 'description'})
type = attr.ib(type=int, default=None, metadata={'json': 'type'})
@attr.s
class GroupCreateResult(object):
group_id = attr.ib(type=str, default=None, metadata={'json': 'group_id'})
@attr.s
class GroupSimplelistResult(object):
grouplist = attr.ib(type=List[Group], default=None, metadata={'json': 'grouplist'})
page_token = attr.ib(type=str, default=None, metadata={'json': 'page_token'})
has_more = attr.ib(type=bool, default=None, metadata={'json': 'has_more'})
@attr.s
class GroupGetResult(object):
group = attr.ib(type=Group, default=None, metadata={'json': 'group'})
@to_json_decorator
@attr.s
class GroupPatchReqBody(object):
name = attr.ib(type=str, default=None, metadata={'json': 'name'})
description = attr.ib(type=str, default=None, metadata={'json': 'description'})
@attr.s
class GroupMemberSimplelistResult(object):
memberlist = attr.ib(type=List[Memberlist], default=None, metadata={'json': 'memberlist'})
page_token = attr.ib(type=str, default=None, metadata={'json': 'page_token'})
has_more = attr.ib(type=bool, default=None, metadata={'json': 'has_more'})
@to_json_decorator
@attr.s
class GroupMemberAddReqBody(object):
member_type = attr.ib(type=str, default=None, metadata={'json': 'member_type'})
member_id_type = attr.ib(type=str, default=None, metadata={'json': 'member_id_type'})
member_id = attr.ib(type=str, default=None, metadata={'json': 'member_id'})
@to_json_decorator
@attr.s
class GroupMemberRemoveReqBody(object):
member_type = attr.ib(type=str, default=None, metadata={'json': 'member_type'})
member_id = attr.ib(type=str, default=None, metadata={'json': 'member_id'})
member_id_type = attr.ib(type=str, default=None, metadata={'json': 'member_id_type'})
@to_json_decorator
@attr.s
class UserDeleteReqBody(object):
department_chat_acceptor_user_id = attr.ib(type=str, default=None, metadata={'json': 'department_chat_acceptor_user_id'})
external_chat_acceptor_user_id = attr.ib(type=str, default=None, metadata={'json': 'external_chat_acceptor_user_id'})
docs_acceptor_user_id = attr.ib(type=str, default=None, metadata={'json': 'docs_acceptor_user_id'})
calendar_acceptor_user_id = attr.ib(type=str, default=None, metadata={'json': 'calendar_acceptor_user_id'})
application_acceptor_user_id = attr.ib(type=str, default=None, metadata={'json': 'application_acceptor_user_id'})
helpdesk_acceptor_user_id = attr.ib(type=str, default=None, metadata={'json': 'helpdesk_acceptor_user_id'})
@attr.s
class UserUpdateResult(object):
user = attr.ib(type=User, default=None, metadata={'json': 'user'})
@attr.s
class UserCreateResult(object):
user = attr.ib(type=User, default=None, metadata={'json': 'user'})
@attr.s
class UserPatchResult(object):
user = attr.ib(type=User, default=None, metadata={'json': 'user'})
@attr.s
class UserGetResult(object):
user = attr.ib(type=User, default=None, metadata={'json': 'user'})
@attr.s
class UserListResult(object):
has_more = attr.ib(type=bool, default=None, metadata={'json': 'has_more'})
page_token = attr.ib(type=str, default=None, metadata={'json': 'page_token'})
items = attr.ib(type=List[User], default=None, metadata={'json': 'items'})
@attr.s
class DepartmentCreatedEventData(object):
object = attr.ib(type=DepartmentEvent, default=None, metadata={'json': 'object'})
@attr.s
class DepartmentCreatedEvent(BaseEventV2):
event = attr.ib(type=DepartmentCreatedEventData, default=None)
@attr.s
class DepartmentDeletedEventData(object):
object = attr.ib(type=DepartmentEvent, default=None, metadata={'json': 'object'})
old_object = attr.ib(type=OldDepartmentObject, default=None, metadata={'json': 'old_object'})
@attr.s
class DepartmentDeletedEvent(BaseEventV2):
event = attr.ib(type=DepartmentDeletedEventData, default=None)
@attr.s
class DepartmentUpdatedEventData(object):
object = attr.ib(type=DepartmentEvent, default=None, metadata={'json': 'object'})
old_object = attr.ib(type=DepartmentEvent, default=None, metadata={'json': 'old_object'})
@attr.s
class DepartmentUpdatedEvent(BaseEventV2):
event = attr.ib(type=DepartmentUpdatedEventData, default=None)
@attr.s
class EmployeeTypeEnumActivedEventData(object):
old_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'old_enum'})
new_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'new_enum'})
@attr.s
class EmployeeTypeEnumActivedEvent(BaseEventV2):
event = attr.ib(type=EmployeeTypeEnumActivedEventData, default=None)
@attr.s
class EmployeeTypeEnumCreatedEventData(object):
new_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'new_enum'})
@attr.s
class EmployeeTypeEnumCreatedEvent(BaseEventV2):
event = attr.ib(type=EmployeeTypeEnumCreatedEventData, default=None)
@attr.s
class EmployeeTypeEnumDeactivatedEventData(object):
old_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'old_enum'})
new_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'new_enum'})
@attr.s
class EmployeeTypeEnumDeactivatedEvent(BaseEventV2):
event = attr.ib(type=EmployeeTypeEnumDeactivatedEventData, default=None)
@attr.s
class EmployeeTypeEnumDeletedEventData(object):
old_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'old_enum'})
@attr.s
class EmployeeTypeEnumDeletedEvent(BaseEventV2):
event = attr.ib(type=EmployeeTypeEnumDeletedEventData, default=None)
@attr.s
class EmployeeTypeEnumUpdatedEventData(object):
old_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'old_enum'})
new_enum = attr.ib(type=EmployeeTypeEnum, default=None, metadata={'json': 'new_enum'})
@attr.s
class EmployeeTypeEnumUpdatedEvent(BaseEventV2):
event = attr.ib(type=EmployeeTypeEnumUpdatedEventData, default=None)
@attr.s
class ScopeUpdatedEventData(object):
added = attr.ib(type=Scope, default=None, metadata={'json': 'added'})
removed = attr.ib(type=Scope, default=None, metadata={'json': 'removed'})
@attr.s
class ScopeUpdatedEvent(BaseEventV2):
event = attr.ib(type=ScopeUpdatedEventData, default=None)
@attr.s
class UserCreatedEventData(object):
object = attr.ib(type=UserEvent, default=None, metadata={'json': 'object'})
@attr.s
class UserCreatedEvent(BaseEventV2):
event = attr.ib(type=UserCreatedEventData, default=None)
@attr.s
class UserDeletedEventData(object):
object = attr.ib(type=UserEvent, default=None, metadata={'json': 'object'})
old_object = attr.ib(type=OldUserObject, default=None, metadata={'json': 'old_object'})
@attr.s
class UserDeletedEvent(BaseEventV2):
event = attr.ib(type=UserDeletedEventData, default=None)
@attr.s
class UserUpdatedEventData(object):
object = attr.ib(type=UserEvent, default=None, metadata={'json': 'object'})
old_object = attr.ib(type=UserEvent, default=None, metadata={'json': 'old_object'})
@attr.s
class UserUpdatedEvent(BaseEventV2):
event = attr.ib(type=UserUpdatedEventData, default=None)
| 37.933232 | 125 | 0.709417 | 3,346 | 24,998 | 5.161088 | 0.064555 | 0.084776 | 0.141294 | 0.306329 | 0.792403 | 0.739765 | 0.703978 | 0.689907 | 0.65771 | 0.56031 | 0 | 0.002496 | 0.118649 | 24,998 | 658 | 126 | 37.990881 | 0.781318 | 0.00252 | 0 | 0.585586 | 1 | 0 | 0.126865 | 0.009185 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.009009 | 0 | 0.738739 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
c705cc28a0b03c2ffdebd60fc0e49bc73c9037ff | 67 | py | Python | backend/backend/generics/__init__.py | ProjetoALES/ales-website | 9dc5b460f5e780a1221d0ed5071043f088082395 | [
"MIT"
] | null | null | null | backend/backend/generics/__init__.py | ProjetoALES/ales-website | 9dc5b460f5e780a1221d0ed5071043f088082395 | [
"MIT"
] | 19 | 2020-02-25T05:29:39.000Z | 2021-09-22T18:38:26.000Z | backend/backend/generics/__init__.py | ProjetoALES/ales-website | 9dc5b460f5e780a1221d0ed5071043f088082395 | [
"MIT"
] | null | null | null | from .prefetch import PrefetchRetrieveAPIView, PrefetchListAPIView
| 33.5 | 66 | 0.895522 | 5 | 67 | 12 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074627 | 67 | 1 | 67 | 67 | 0.967742 | 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 |
c70c8eab0d96ba454c43ddbaca56a5a6fc1b99da | 122 | py | Python | REST APIs/rest_framework/webapp/admin.py | mourice-oduor/Django-Full-Stack | 66d4bc7d18abd546247c766b3a789e37eb1288f8 | [
"MIT"
] | 6 | 2020-03-22T20:31:28.000Z | 2022-01-28T08:29:13.000Z | REST APIs/rest_framework/webapp/admin.py | mourice-oduor/Django-Full-Stack | 66d4bc7d18abd546247c766b3a789e37eb1288f8 | [
"MIT"
] | null | null | null | REST APIs/rest_framework/webapp/admin.py | mourice-oduor/Django-Full-Stack | 66d4bc7d18abd546247c766b3a789e37eb1288f8 | [
"MIT"
] | 2 | 2021-02-09T05:33:53.000Z | 2022-02-03T09:22:53.000Z | from django.contrib import admin
from .models import employees
# Register your models here.
admin.site.register(employees) | 30.5 | 32 | 0.827869 | 17 | 122 | 5.941176 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.106557 | 122 | 4 | 33 | 30.5 | 0.926606 | 0.213115 | 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 |
c7134993e4060dbec8f242cd8bdf481e60c6942b | 131 | py | Python | samfp/io/__init__.py | b1quint/samfp | 1cd9b85851c02dc61a2294d67a309f62083d358d | [
"BSD-3-Clause"
] | null | null | null | samfp/io/__init__.py | b1quint/samfp | 1cd9b85851c02dc61a2294d67a309f62083d358d | [
"BSD-3-Clause"
] | 19 | 2016-07-15T21:32:59.000Z | 2017-09-12T00:31:26.000Z | samfp/io/__init__.py | b1quint/samfp | 1cd9b85851c02dc61a2294d67a309f62083d358d | [
"BSD-3-Clause"
] | null | null | null |
from astropy.io import fits as pyfits
from builtins import input
from .logger import get_logger
from .safe_save import safe_save
| 18.714286 | 37 | 0.824427 | 22 | 131 | 4.772727 | 0.590909 | 0.152381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152672 | 131 | 6 | 38 | 21.833333 | 0.945946 | 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 |
c715d56e4c738aaa4cf5142f86d565008da10a74 | 164 | py | Python | tests/web_platform/CSS2/positioning/test_abspos_containing_block.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/CSS2/positioning/test_abspos_containing_block.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/CSS2/positioning/test_abspos_containing_block.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | 1 | 2020-01-16T01:56:41.000Z | 2020-01-16T01:56:41.000Z | from tests.utils import W3CTestCase
class TestAbsposContainingBlock(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'abspos-containing-block-'))
| 27.333333 | 79 | 0.804878 | 17 | 164 | 7.470588 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02 | 0.085366 | 164 | 5 | 80 | 32.8 | 0.826667 | 0 | 0 | 0 | 0 | 0 | 0.147239 | 0.147239 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
c72146fc2ea76f355731b4933de5823a4f8e94d9 | 3,917 | py | Python | tests/events/releaseObjectsTest.py | nathanielwarner/seatsio-python | e731ed0c37f2496c620b40e38527a58bf3b9a9b2 | [
"MIT"
] | 2 | 2018-03-29T18:21:01.000Z | 2022-02-08T10:49:47.000Z | tests/events/releaseObjectsTest.py | nathanielwarner/seatsio-python | e731ed0c37f2496c620b40e38527a58bf3b9a9b2 | [
"MIT"
] | 7 | 2018-09-03T12:31:52.000Z | 2022-02-01T08:25:09.000Z | tests/events/releaseObjectsTest.py | nathanielwarner/seatsio-python | e731ed0c37f2496c620b40e38527a58bf3b9a9b2 | [
"MIT"
] | 2 | 2020-12-22T09:51:07.000Z | 2021-12-13T15:37:14.000Z | from seatsio.domain import EventObjectInfo, Channel
from seatsio.events.objectProperties import ObjectProperties
from tests.seatsioClientTest import SeatsioClientTest
from tests.util.asserts import assert_that
class ReleaseObjectsTest(SeatsioClientTest):
def test(self):
chart_key = self.create_test_chart()
event = self.client.events.create(chart_key)
self.client.events.book(event.key, ["A-1", "A-2"])
res = self.client.events.release(event.key, ["A-1", "A-2"])
a1_status = self.client.events.retrieve_object_info(event.key, "A-1").status
a2_status = self.client.events.retrieve_object_info(event.key, "A-2").status
a3_status = self.client.events.retrieve_object_info(event.key, "A-3").status
assert_that(a1_status).is_equal_to(EventObjectInfo.FREE)
assert_that(a2_status).is_equal_to(EventObjectInfo.FREE)
assert_that(a3_status).is_equal_to(EventObjectInfo.FREE)
assert_that(list(res.objects)).contains_exactly_in_any_order("A-1", "A-2")
def test_withHoldToken(self):
chart_key = self.create_test_chart()
event = self.client.events.create(chart_key)
hold_token = self.client.hold_tokens.create()
self.client.events.hold(event.key, ["A-1"], hold_token.hold_token)
self.client.events.release(event.key, ["A-1"], hold_token.hold_token)
object_info = self.client.events.retrieve_object_info(event.key, "A-1")
assert_that(object_info.status).is_equal_to(EventObjectInfo.FREE)
assert_that(object_info.hold_token).is_none()
def test_withOrderId(self):
chart_key = self.create_test_chart()
event = self.client.events.create(chart_key)
self.client.events.book(event.key, ["A-1"])
self.client.events.release(event.key, ["A-1"], order_id="order1")
object_info = self.client.events.retrieve_object_info(event.key, "A-1")
assert_that(object_info.order_id).is_equal_to("order1")
def test_keepExtraData(self):
chart_key = self.create_test_chart()
event = self.client.events.create(chart_key)
extra_data = {"foo": "bar"}
self.client.events.book(event.key, [ObjectProperties("A-1", extra_data=extra_data)])
self.client.events.release(event.key, ["A-1"], keep_extra_data=True)
object_info = self.client.events.retrieve_object_info(event.key, "A-1")
assert_that(object_info.extra_data).is_equal_to(extra_data)
def test_channelKeys(self):
chart_key = self.create_test_chart()
event = self.client.events.create(chart_key)
self.client.events.update_channels(event.key, {
'channelKey1': Channel(name='channel 1', color='#00FF00', index=1)
})
self.client.events.assign_objects_to_channels(event.key, {
"channelKey1": ["A-1", "A-2"]
})
self.client.events.book(event.key, ["A-1"], channel_keys=["channelKey1"])
self.client.events.release(event.key, ["A-1"], channel_keys=["channelKey1"])
object_info = self.client.events.retrieve_object_info(event.key, "A-1")
assert_that(object_info.status).is_equal_to(EventObjectInfo.FREE)
def test_ignoreChannels(self):
chart_key = self.create_test_chart()
event = self.client.events.create(chart_key)
self.client.events.update_channels(event.key, {
'channelKey1': Channel(name='channel 1', color='#00FF00', index=1)
})
self.client.events.assign_objects_to_channels(event.key, {
"channelKey1": ["A-1", "A-2"]
})
self.client.events.book(event.key, ["A-1"], channel_keys=["channelKey1"])
self.client.events.release(event.key, ["A-1"], ignore_channels=True)
object_info = self.client.events.retrieve_object_info(event.key, "A-1")
assert_that(object_info.status).is_equal_to(EventObjectInfo.FREE)
| 43.522222 | 92 | 0.684452 | 531 | 3,917 | 4.819209 | 0.143126 | 0.121141 | 0.187573 | 0.066432 | 0.751075 | 0.751075 | 0.73857 | 0.729973 | 0.604924 | 0.604924 | 0 | 0.017054 | 0.176666 | 3,917 | 89 | 93 | 44.011236 | 0.776434 | 0 | 0 | 0.507463 | 0 | 0 | 0.053868 | 0 | 0 | 0 | 0 | 0 | 0.164179 | 1 | 0.089552 | false | 0 | 0.059701 | 0 | 0.164179 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 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 |
c72f7b6844b6cfdbcba5abb13f659467080131cc | 44 | py | Python | cached_interpolate/__init__.py | ColmTalbot/cached_spline | e297d0b4ebdf65994b56c15c203ef0de8de28cb6 | [
"MIT"
] | null | null | null | cached_interpolate/__init__.py | ColmTalbot/cached_spline | e297d0b4ebdf65994b56c15c203ef0de8de28cb6 | [
"MIT"
] | 6 | 2022-02-04T17:34:47.000Z | 2022-03-31T17:15:39.000Z | cached_interpolate/__init__.py | ColmTalbot/cached_spline | e297d0b4ebdf65994b56c15c203ef0de8de28cb6 | [
"MIT"
] | 1 | 2022-02-10T23:00:49.000Z | 2022-02-10T23:00:49.000Z | from .interpolate import CachingInterpolant
| 22 | 43 | 0.886364 | 4 | 44 | 9.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 44 | 1 | 44 | 44 | 0.975 | 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 |
c792920264eec80a90eade501f1df7fede3e2c95 | 36 | py | Python | top_itgcc/database.py | itgcc/django-backstage-supporter | 9cdee30ef517a847b0ab05e7b41e788762d2db88 | [
"MIT"
] | null | null | null | top_itgcc/database.py | itgcc/django-backstage-supporter | 9cdee30ef517a847b0ab05e7b41e788762d2db88 | [
"MIT"
] | null | null | null | top_itgcc/database.py | itgcc/django-backstage-supporter | 9cdee30ef517a847b0ab05e7b41e788762d2db88 | [
"MIT"
] | null | null | null | class SqlStatement(object):
pass | 18 | 27 | 0.75 | 4 | 36 | 6.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 36 | 2 | 28 | 18 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
c7b82f6170005f43056a48bc3f3f4a2df1e8e595 | 66 | py | Python | python/w3school/pyMongo/show_database.py | mp5maker/library | b4d2eea70ae0da9d917285569031edfb4d8ab9fc | [
"MIT"
] | null | null | null | python/w3school/pyMongo/show_database.py | mp5maker/library | b4d2eea70ae0da9d917285569031edfb4d8ab9fc | [
"MIT"
] | 23 | 2020-08-15T15:18:32.000Z | 2022-02-26T13:49:05.000Z | python/w3school/pyMongo/show_database.py | mp5maker/library | b4d2eea70ae0da9d917285569031edfb4d8ab9fc | [
"MIT"
] | null | null | null | from config.db import client
print(client.list_database_names())
| 16.5 | 35 | 0.818182 | 10 | 66 | 5.2 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 66 | 3 | 36 | 22 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 5 |
c7cc27ae735750282b8e34f36813de5b908731b9 | 194 | py | Python | znake/test/test_format.py | ZenDevelopmentEcosystem/znake | ce7c5b3abca88200ac09b553dc64f8c0a3f4255f | [
"Apache-2.0"
] | 1 | 2020-12-15T00:34:51.000Z | 2020-12-15T00:34:51.000Z | znake/test/test_format.py | ZenDevelopmentEcosystem/znake | ce7c5b3abca88200ac09b553dc64f8c0a3f4255f | [
"Apache-2.0"
] | null | null | null | znake/test/test_format.py | ZenDevelopmentEcosystem/znake | ce7c5b3abca88200ac09b553dc64f8c0a3f4255f | [
"Apache-2.0"
] | 2 | 2020-02-01T16:56:15.000Z | 2020-12-10T21:55:23.000Z | from unittest.mock import Mock
from znake.format import get_namespace
def test_get_namespace():
config = Mock()
namespace = get_namespace(config)
assert len(namespace.tasks) == 3
| 19.4 | 38 | 0.737113 | 26 | 194 | 5.346154 | 0.576923 | 0.258993 | 0.258993 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006289 | 0.180412 | 194 | 9 | 39 | 21.555556 | 0.867925 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
401c426b3d1142f05507a6832208b20e8e09fdce | 115 | py | Python | moto/iam/__init__.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | moto/iam/__init__.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | moto/iam/__init__.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | from .models import iam_backends
from ..core.models import base_decorator
mock_iam = base_decorator(iam_backends)
| 23 | 40 | 0.834783 | 17 | 115 | 5.352941 | 0.529412 | 0.263736 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104348 | 115 | 4 | 41 | 28.75 | 0.883495 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
40831efb9ad586d65859097217bc75ee2af2095f | 3,598 | py | Python | looptime/math.py | nolar/jiff | 841d8721712d3d2c3a8cc0e658fb71a3563ed23c | [
"MIT"
] | 12 | 2021-12-26T10:44:18.000Z | 2022-01-14T23:06:39.000Z | looptime/math.py | nolar/jiff | 841d8721712d3d2c3a8cc0e658fb71a3563ed23c | [
"MIT"
] | 1 | 2021-12-05T15:11:32.000Z | 2021-12-05T15:11:32.000Z | looptime/math.py | nolar/pytest-instant | 841d8721712d3d2c3a8cc0e658fb71a3563ed23c | [
"MIT"
] | null | null | null | from __future__ import annotations
import abc
class Numeric(metaclass=abc.ABCMeta):
"""A base class for objects that support direct comparison & arithmetics."""
def __init__(self, *, resolution: float = 1e-9) -> None:
super().__init__()
self.__rr: int = round(1 / resolution) # rr == resolution reciprocal
@property
@abc.abstractmethod
def _value(self) -> float:
raise NotImplementedError
#
# Type conversion:
#
def __str__(self) -> str:
return str(float(self))
def __int__(self) -> int:
return int(float(self))
def __float__(self) -> float:
return round(self._value * self.__rr) / self.__rr
#
# Comparison:
#
def __eq__(self, other: object) -> bool:
if isinstance(other, (int, float)):
return round(self._value * self.__rr) == round(other * self.__rr)
else:
return NotImplemented
def __ne__(self, other: object) -> bool:
if isinstance(other, (int, float)):
return round(self._value * self.__rr) != round(other * self.__rr)
else:
return NotImplemented
def __ge__(self, other: object) -> bool:
if isinstance(other, (int, float)):
return round(self._value * self.__rr) >= round(other * self.__rr)
else:
return NotImplemented
def __gt__(self, other: object) -> bool:
if isinstance(other, (int, float)):
return round(self._value * self.__rr) > round(other * self.__rr)
else:
return NotImplemented
def __le__(self, other: object) -> bool:
if isinstance(other, (int, float)):
return round(self._value * self.__rr) <= round(other * self.__rr)
else:
return NotImplemented
def __lt__(self, other: object) -> bool:
if isinstance(other, (int, float)):
return round(self._value * self.__rr) < round(other * self.__rr)
else:
return NotImplemented
#
# Arithmetics:
#
def __add__(self, other: object) -> float:
if isinstance(other, (int, float)):
return (round(self._value * self.__rr) + round(other * self.__rr)) / self.__rr
else:
return NotImplemented
def __sub__(self, other: object) -> float:
if isinstance(other, (int, float)):
return (round(self._value * self.__rr) - round(other * self.__rr)) / self.__rr
else:
return NotImplemented
def __mul__(self, other: object) -> float:
if isinstance(other, (int, float)):
return (round(self._value * self.__rr) * round(other * self.__rr)) / (self.__rr ** 2)
else:
return NotImplemented
def __floordiv__(self, other: object) -> float:
if isinstance(other, (int, float)):
return (round(self._value * self.__rr) // round(other * self.__rr))
else:
return NotImplemented
def __truediv__(self, other: object) -> float:
if isinstance(other, (int, float)):
return (round(self._value * self.__rr) / round(other * self.__rr))
else:
return NotImplemented
def __mod__(self, other: object) -> float:
if isinstance(other, (int, float)):
return (round(self._value * self.__rr) % round(other * self.__rr)) / (self.__rr)
else:
return NotImplemented
def __pow__(self, power: float, modulo: None = None) -> float:
return pow(round(self._value * self.__rr), power, modulo) / pow(self.__rr, power, modulo)
| 31.840708 | 97 | 0.585881 | 401 | 3,598 | 4.865337 | 0.159601 | 0.101486 | 0.100461 | 0.129165 | 0.721169 | 0.710917 | 0.710917 | 0.695028 | 0.695028 | 0.695028 | 0 | 0.001567 | 0.290717 | 3,598 | 112 | 98 | 32.125 | 0.762931 | 0.039188 | 0 | 0.461538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.025641 | 0.051282 | 0.628205 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
dc00acdb62b28b7d03b37ae2c537e4909c5a00a6 | 89 | py | Python | example/apps/test_security/models.py | jsilhan/django-security | fd56a6ca8ab7ad2b1e91a33ea4ecb40bb10cc42b | [
"MIT"
] | 9 | 2019-03-12T12:31:20.000Z | 2021-01-22T13:31:36.000Z | example/apps/test_security/models.py | jsilhan/django-security | fd56a6ca8ab7ad2b1e91a33ea4ecb40bb10cc42b | [
"MIT"
] | 28 | 2019-12-05T12:20:49.000Z | 2022-03-25T08:15:10.000Z | example/apps/test_security/models.py | jsilhan/django-security | fd56a6ca8ab7ad2b1e91a33ea4ecb40bb10cc42b | [
"MIT"
] | 5 | 2019-07-10T15:29:44.000Z | 2021-02-01T12:50:56.000Z | from django.contrib.auth.models import User
import reversion
reversion.register(User)
| 12.714286 | 43 | 0.820225 | 12 | 89 | 6.083333 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.11236 | 89 | 6 | 44 | 14.833333 | 0.924051 | 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 |
dc096316b00b7d285a6218a786e004b21f051792 | 587 | py | Python | stores/apps/subscriptions/urls.py | diassor/CollectorCity-Market-Place | 892ad220b8cf1c0fc7433f625213fe61729522b2 | [
"Apache-2.0"
] | 135 | 2015-03-19T13:28:18.000Z | 2022-03-27T06:41:42.000Z | stores/apps/subscriptions/urls.py | dfcoding/CollectorCity-Market-Place | e59acec3d600c049323397b17cae14fdcaaaec07 | [
"Apache-2.0"
] | null | null | null | stores/apps/subscriptions/urls.py | dfcoding/CollectorCity-Market-Place | e59acec3d600c049323397b17cae14fdcaaaec07 | [
"Apache-2.0"
] | 83 | 2015-01-30T01:00:15.000Z | 2022-03-08T17:25:10.000Z | from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^plans/$', 'subscriptions.views.shop_subscription_plans', name='subscription_plans'),
url(r'^overview/$', 'subscriptions.views.shop_subscription_overview', name='subscription_overview'),
url(r'^billing/$', 'subscriptions.views.shop_billing', name='billing_overview'),
url(r'^billing/update/$', 'subscriptions.views.shop_billing_update_credit_card', name='billing_update_credit_card'),
url(r'^purchases/$', 'subscriptions.views.shop_purchases', name='purchases_overview'),
) | 65.222222 | 124 | 0.729131 | 66 | 587 | 6.227273 | 0.333333 | 0.048662 | 0.26764 | 0.16545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107325 | 587 | 9 | 125 | 65.222222 | 0.784351 | 0 | 0 | 0 | 0 | 0 | 0.617347 | 0.430272 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 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 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
905fe2a1da5a5c3249b7dd3c745f87b790980fbd | 143 | py | Python | python_exercises/27Local_Library/library/catalog/views.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_exercises/27Local_Library/library/catalog/views.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_exercises/27Local_Library/library/catalog/views.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
def home(request):
return HttpResponse('<h1>Hello world!</h1>')
| 20.428571 | 48 | 0.762238 | 19 | 143 | 5.736842 | 0.736842 | 0.183486 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016129 | 0.132867 | 143 | 6 | 49 | 23.833333 | 0.862903 | 0 | 0 | 0 | 0 | 0 | 0.146853 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.5 | 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 | 1 | 1 | 0 | 0 | 0 | 5 |
906bf6b463ccbee660a15cb6f6eb7437ea34809c | 91 | py | Python | Unit 1: Python Basics/Lecture_2_Core_Elements_of_Programs/Exercise: hello_world.py | Hongbin-Ze/MITx-6.00.1 | 9443e326a9893f7cdb3b74e06025d34b3e1e9fdc | [
"MIT"
] | null | null | null | Unit 1: Python Basics/Lecture_2_Core_Elements_of_Programs/Exercise: hello_world.py | Hongbin-Ze/MITx-6.00.1 | 9443e326a9893f7cdb3b74e06025d34b3e1e9fdc | [
"MIT"
] | null | null | null | Unit 1: Python Basics/Lecture_2_Core_Elements_of_Programs/Exercise: hello_world.py | Hongbin-Ze/MITx-6.00.1 | 9443e326a9893f7cdb3b74e06025d34b3e1e9fdc | [
"MIT"
] | null | null | null | # Write a piece of Python code that prints out the string hello world
print("hello world")
| 30.333333 | 69 | 0.769231 | 16 | 91 | 4.375 | 0.875 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175824 | 91 | 2 | 70 | 45.5 | 0.933333 | 0.736264 | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
908e91c4ceb7210522b50885f99f4a2daef0c8bb | 73 | py | Python | projects/ReppointV1/ReppointV1/__init__.py | dashu233/SparseR-CNN | 2a787ac5e1ead5dcdad337a15566d83a4e9a0fca | [
"MIT"
] | null | null | null | projects/ReppointV1/ReppointV1/__init__.py | dashu233/SparseR-CNN | 2a787ac5e1ead5dcdad337a15566d83a4e9a0fca | [
"MIT"
] | null | null | null | projects/ReppointV1/ReppointV1/__init__.py | dashu233/SparseR-CNN | 2a787ac5e1ead5dcdad337a15566d83a4e9a0fca | [
"MIT"
] | null | null | null | from .config import add_reppoint_config
from .detector import ReppointV1 | 36.5 | 40 | 0.863014 | 10 | 73 | 6.1 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015385 | 0.109589 | 73 | 2 | 41 | 36.5 | 0.923077 | 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 |
90cbd3e08179d5f44276de4f2e9616957bccbd32 | 154 | py | Python | src/fhirpath/dialects/postgres.py | nazrulworld/fhirpath | 3b819870c57a0befcac18916a4d03b64c0e202ca | [
"Apache-2.0"
] | 25 | 2019-05-14T13:35:32.000Z | 2022-02-21T23:03:35.000Z | src/fhirpath/dialects/postgres.py | nazrulworld/fhirpath | 3b819870c57a0befcac18916a4d03b64c0e202ca | [
"Apache-2.0"
] | 29 | 2020-02-14T08:14:02.000Z | 2021-02-23T20:14:42.000Z | src/fhirpath/dialects/postgres.py | nazrulworld/fhirpath | 3b819870c57a0befcac18916a4d03b64c0e202ca | [
"Apache-2.0"
] | 4 | 2020-06-30T08:05:54.000Z | 2021-08-09T19:10:35.000Z | # _*_ coding: utf-8 _*_
"""RAW PostgresSQL Dialect for FHIRPath Engine"""
from .base import DialectBase
class PostgresDialect(DialectBase):
""" """
| 19.25 | 49 | 0.701299 | 16 | 154 | 6.5 | 0.9375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007752 | 0.162338 | 154 | 7 | 50 | 22 | 0.79845 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 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 |
2905d07aa46e5f2b9f3c2993551fb4d846d727c8 | 250 | py | Python | dddppp/slides/admin.py | tysonclugg/dddppp | 22f52d671ca71c2df8d6ac566a1626e5f05b3159 | [
"MIT"
] | null | null | null | dddppp/slides/admin.py | tysonclugg/dddppp | 22f52d671ca71c2df8d6ac566a1626e5f05b3159 | [
"MIT"
] | null | null | null | dddppp/slides/admin.py | tysonclugg/dddppp | 22f52d671ca71c2df8d6ac566a1626e5f05b3159 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from django.contrib import admin
from . import models
admin.site.register(models.Presentation)
admin.site.register(models.PresentationRole)
admin.site.register(models.Session)
admin.site.register(models.Slide)
| 27.777778 | 44 | 0.844 | 33 | 250 | 6.242424 | 0.424242 | 0.174757 | 0.330097 | 0.446602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.068 | 250 | 8 | 45 | 31.25 | 0.88412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.428571 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
29459195b438d6a42f16be9deae983f01573da35 | 1,913 | py | Python | nenupytf/display/plot.py | CedricDViou/nenupy-tf | cc048da782b4e3584e5406558c89eaae04425c09 | [
"MIT"
] | null | null | null | nenupytf/display/plot.py | CedricDViou/nenupy-tf | cc048da782b4e3584e5406558c89eaae04425c09 | [
"MIT"
] | 24 | 2019-11-07T13:25:39.000Z | 2020-03-27T16:51:33.000Z | nenupytf/display/plot.py | CedricDViou/nenupy-tf | cc048da782b4e3584e5406558c89eaae04425c09 | [
"MIT"
] | 2 | 2019-11-04T08:46:15.000Z | 2019-11-20T11:11:11.000Z | #! /usr/bin/python3
# -*- coding: utf-8 -*-
"""
****
plot
****
"""
__author__ = ['Alan Loh']
__copyright__ = 'Copyright 2019, nenupytf'
__credits__ = ['Alan Loh']
__maintainer__ = 'Alan Loh'
__email__ = 'alan.loh@obspm.fr'
__status__ = 'Production'
__all__ = [
'plot',
'plotdb'
]
import matplotlib.pyplot as plt
import numpy as np
def plot(specdata, savefile=None, **kwargs):
"""
"""
if 'vmin' not in kwargs.keys():
kwargs['vmin'] = np.percentile(specdata.amp, 5)
if 'vmax' not in kwargs.keys():
kwargs['vmax'] = np.percentile(specdata.amp, 95)
if 'cmap' not in kwargs.keys():
kwargs['cmap'] = 'YlGnBu_r'
pcm = plt.pcolormesh(
(specdata.time - specdata.time[0]).sec,
specdata.freq,
specdata.amp.T,
**kwargs
)
cbar = plt.colorbar(pcm)
cbar.set_label('Stokes {} (amp)'.format(specdata.meta['stokes']))
plt.ylabel('Frequency (MHz)')
plt.xlabel('Time (sec since {})'.format(specdata.time[0].isot))
if savefile is None:
plt.show()
else:
plt.savefig(savefile)
return
def plotdb(specdata, savefile=None, **kwargs):
"""
"""
if 'vmin' not in kwargs.keys():
kwargs['vmin'] = np.percentile(specdata.db, 5)
if 'vmax' not in kwargs.keys():
kwargs['vmax'] = np.percentile(specdata.db, 95)
if 'cmap' not in kwargs.keys():
kwargs['cmap'] = 'YlGnBu_r'
pcm = plt.pcolormesh(
(specdata.time - specdata.time[0]).sec,
specdata.freq,
specdata.db.T,
**kwargs
)
cbar = plt.colorbar(pcm)
cbar.set_label('Stokes {} (dB)'.format(specdata.meta['stokes']))
plt.ylabel('Frequency (MHz)')
plt.xlabel('Time (sec since {})'.format(specdata.time[0].isot))
if savefile is None:
plt.show()
else:
plt.savefig(savefile)
return
| 21.988506 | 69 | 0.570308 | 229 | 1,913 | 4.624454 | 0.318777 | 0.028329 | 0.062323 | 0.084986 | 0.785647 | 0.785647 | 0.785647 | 0.785647 | 0.785647 | 0.785647 | 0 | 0.011299 | 0.259801 | 1,913 | 86 | 70 | 22.244186 | 0.736582 | 0.028751 | 0 | 0.571429 | 0 | 0 | 0.142227 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.035714 | false | 0 | 0.035714 | 0 | 0.107143 | 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 |
464038ba05b8882edcfdf2926dfac2b696283227 | 216 | py | Python | env/lib/python3.8/site-packages/plotly/graph_objs/splom/dimension/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/splom/dimension/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/splom/dimension/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import sys
if sys.version_info < (3, 7):
from ._axis import Axis
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._axis.Axis"])
| 24 | 82 | 0.717593 | 28 | 216 | 4.714286 | 0.642857 | 0.212121 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011173 | 0.171296 | 216 | 8 | 83 | 27 | 0.726257 | 0 | 0 | 0 | 0 | 0 | 0.050926 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
4641024257f29065f357f1429b067e7f2e681554 | 125 | py | Python | accounts/admin.py | iidamakinen/OHSIHA2018 | 76c4f2d754045cc82d57062453e7248d63e5bf4d | [
"MIT"
] | null | null | null | accounts/admin.py | iidamakinen/OHSIHA2018 | 76c4f2d754045cc82d57062453e7248d63e5bf4d | [
"MIT"
] | null | null | null | accounts/admin.py | iidamakinen/OHSIHA2018 | 76c4f2d754045cc82d57062453e7248d63e5bf4d | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Tapahtuma
admin.site.register(Tapahtuma)
# Register your models here.
| 17.857143 | 32 | 0.808 | 17 | 125 | 5.941176 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128 | 125 | 6 | 33 | 20.833333 | 0.926606 | 0.208 | 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 |
4691e1445cc825e8253ec51b85392793f7338f83 | 803 | py | Python | test/test_incidents_page_all_of.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | test/test_incidents_page_all_of.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | test/test_incidents_page_all_of.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | """
MSX SDK
MSX SDK client. # noqa: E501
The version of the OpenAPI document: 1.0.9
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import python_msx_sdk
from python_msx_sdk.model.incident import Incident
globals()['Incident'] = Incident
from python_msx_sdk.model.incidents_page_all_of import IncidentsPageAllOf
class TestIncidentsPageAllOf(unittest.TestCase):
"""IncidentsPageAllOf unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testIncidentsPageAllOf(self):
"""Test IncidentsPageAllOf"""
# FIXME: construct object with mandatory attributes with example values
# model = IncidentsPageAllOf() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()
| 21.131579 | 79 | 0.696139 | 92 | 803 | 5.891304 | 0.565217 | 0.055351 | 0.066421 | 0.059041 | 0.077491 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014308 | 0.216687 | 803 | 37 | 80 | 21.702703 | 0.847377 | 0.372354 | 0 | 0.2 | 1 | 0 | 0.034188 | 0 | 0 | 0 | 0 | 0.027027 | 0 | 1 | 0.2 | false | 0.2 | 0.333333 | 0 | 0.6 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 5 |
4693f0deecfbdbdaa5837b32c3601bea4e60837a | 129 | py | Python | backend/quiz/users/admin.py | Qwizi/Quiz-App | 4eee0320363cd268724826c08bc902dea8cc557a | [
"MIT"
] | 1 | 2019-09-20T17:41:45.000Z | 2019-09-20T17:41:45.000Z | backend/quiz/users/admin.py | Qwizi/Quiz-App | 4eee0320363cd268724826c08bc902dea8cc557a | [
"MIT"
] | null | null | null | backend/quiz/users/admin.py | Qwizi/Quiz-App | 4eee0320363cd268724826c08bc902dea8cc557a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import User, UserAnswer
admin.site.register(User)
admin.site.register(UserAnswer)
| 21.5 | 36 | 0.821705 | 18 | 129 | 5.888889 | 0.555556 | 0.169811 | 0.320755 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093023 | 129 | 5 | 37 | 25.8 | 0.905983 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 1 | 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 |
46a0f412e387ba06506304f5ed79e19b6f7178d0 | 210 | py | Python | HackerEarth/Algorithms/manna_first_name.py | ukayaj620/cp-solution | 9871c753f17b6af612d4c7a9045afe079e30de86 | [
"Apache-2.0"
] | 1 | 2021-01-30T07:48:30.000Z | 2021-01-30T07:48:30.000Z | HackerEarth/Algorithms/manna_first_name.py | FXLJA/cp-solution | 29030838a66cddc594280e3c813252877a1afc7b | [
"Apache-2.0"
] | 1 | 2021-07-12T11:31:11.000Z | 2021-07-12T11:31:11.000Z | HackerEarth/Algorithms/manna_first_name.py | FXLJA/cp-solution | 29030838a66cddc594280e3c813252877a1afc7b | [
"Apache-2.0"
] | 6 | 2020-12-20T14:31:30.000Z | 2021-07-16T04:09:35.000Z | n = int(input())
for i in range(n):
str = input()
count_suvo = str.count('SUVO')
count_suvojit = str.count('SUVOJIT')
print("SUVO = {}, SUVOJIT = {}".format(count_suvo - count_suvojit, count_suvojit)
| 23.333333 | 83 | 0.652381 | 30 | 210 | 4.4 | 0.433333 | 0.363636 | 0.212121 | 0.318182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 210 | 8 | 84 | 26.25 | 0.754286 | 0 | 0 | 0 | 0 | 0 | 0.161905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.166667 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d3c6cbfa407bdef9fda025ee8e682ec28776338a | 906 | py | Python | src/rocket/stage2/src/__init__.py | proballstar/atlas | 6e4eb36b7e43e750dbb281c2051439198c82f296 | [
"MIT"
] | null | null | null | src/rocket/stage2/src/__init__.py | proballstar/atlas | 6e4eb36b7e43e750dbb281c2051439198c82f296 | [
"MIT"
] | null | null | null | src/rocket/stage2/src/__init__.py | proballstar/atlas | 6e4eb36b7e43e750dbb281c2051439198c82f296 | [
"MIT"
] | null | null | null | # 🎖 @TODO(aaronhma): Step 1: import everything
from . import config
from . import camera
from . import service_worker
from .spec import * as spec
from .trajectory import * as tj
from .rocket_control import * as rc
from .rocket_manuevers import * as rm
from errors.src import MemoryOverload, OtherError, SensorOverload
# 🎖 @TODO(aaronhma): Step 2: Declare everything
ram = [] # Memory storage
# 🎖 @TODO(aaronhma): Step 3: Enable camera
camera.camera(mirror_status=True)
# 🎖 @TODO(aaronhma): Step 4: Setup
spec.bit_test.test()
# @TODO(aaronhma): Step 5: Calc trajectory
tj.__TODO__
# @TODO(aaronhma): Step 6: Fire rockets
rc.__TODO__
# @TODO(aaronhma): Step 7: Alpha
rc.__TODO__
# @TODO(aaronhma): Step 8: Burnout
rc.__TODO__
# @TODO(aaronhma): Step 9: Disable 2nd stage
rm.__TODO__
# @TODO(aaronhma): Step 10: Remove 2nd stage
rm.__TODO__
# 🎖 @TODO(aaronhma): Step 11: Delete 2nd stage RAM
del ram | 23.230769 | 65 | 0.732892 | 137 | 906 | 4.671533 | 0.423358 | 0.20625 | 0.275 | 0.132813 | 0.103125 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020861 | 0.153422 | 906 | 39 | 66 | 23.230769 | 0.80704 | 0.504415 | 0 | 0.277778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025641 | 0 | 0 | null | null | 0 | 0.444444 | null | null | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
31065fc7150dea499802cf679c21b2c4763f0fd4 | 136 | py | Python | nuee/__init__.py | essicolo/nuee | 83160a751ca18440e97637e19348b362215911f7 | [
"MIT"
] | null | null | null | nuee/__init__.py | essicolo/nuee | 83160a751ca18440e97637e19348b362215911f7 | [
"MIT"
] | null | null | null | nuee/__init__.py | essicolo/nuee | 83160a751ca18440e97637e19348b362215911f7 | [
"MIT"
] | 1 | 2018-04-07T01:12:33.000Z | 2018-04-07T01:12:33.000Z | from .ordination import *
from .distance import *
from .stats import *
__all__ = ['ordination', 'distance', 'stats']
__version__ = '0'
| 19.428571 | 45 | 0.698529 | 15 | 136 | 5.8 | 0.533333 | 0.229885 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008696 | 0.154412 | 136 | 6 | 46 | 22.666667 | 0.747826 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
312647784c6508190d19a0146563efc452b28e08 | 1,160 | py | Python | periods/base.py | Aleksey1707/py-periods | 2279f0962e363811ac3973001018c8cadcb46374 | [
"MIT"
] | 2 | 2021-05-24T03:51:37.000Z | 2021-05-24T03:51:40.000Z | periods/base.py | Aleksey1707/py-periods | 2279f0962e363811ac3973001018c8cadcb46374 | [
"MIT"
] | null | null | null | periods/base.py | Aleksey1707/py-periods | 2279f0962e363811ac3973001018c8cadcb46374 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from typing import TypeVar, Any, Union
PERIOD_TYPE = TypeVar('PERIOD_TYPE')
ITEM_TYPE = Union[PERIOD_TYPE, 'Period']
class Period(ABC):
begin: PERIOD_TYPE
end: PERIOD_TYPE
data: Any
protect_data: bool
@abstractmethod
def __str__(self):
pass
@abstractmethod
def __iter__(self):
pass
@abstractmethod
def __contains__(self, item: ITEM_TYPE):
pass
@abstractmethod
def __lt__(self, other: ITEM_TYPE):
pass
@abstractmethod
def __le__(self, other: ITEM_TYPE):
pass
@abstractmethod
def __eq__(self, other: ITEM_TYPE):
pass
@abstractmethod
def __ne__(self, other: ITEM_TYPE):
pass
@abstractmethod
def __gt__(self, other: ITEM_TYPE):
pass
@abstractmethod
def __ge__(self, other: ITEM_TYPE):
pass
@abstractmethod
def __len__(self):
pass
@abstractmethod
def __add__(self, other: ITEM_TYPE):
pass
@abstractmethod
def __sub__(self, other: ITEM_TYPE):
pass
@abstractmethod
def __hash__(self):
pass
| 17.575758 | 44 | 0.62931 | 128 | 1,160 | 5.171875 | 0.265625 | 0.333837 | 0.380665 | 0.353474 | 0.503021 | 0.459215 | 0.459215 | 0 | 0 | 0 | 0 | 0 | 0.292241 | 1,160 | 65 | 45 | 17.846154 | 0.806334 | 0 | 0 | 0.541667 | 0 | 0 | 0.014655 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.270833 | false | 0.270833 | 0.041667 | 0 | 0.416667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
319aef76242c6217f3617c9b677e0e48c5ed8d83 | 124 | py | Python | GUI/src/backend/__init__.py | jamesgleave/DeepDockingGUI | 4baa30af5fac44cce680b849839704b85a2505d5 | [
"MIT"
] | 10 | 2021-06-17T12:50:44.000Z | 2022-02-28T02:15:19.000Z | GUI/src/backend/__init__.py | jamesgleave/DeepDockingGUI | 4baa30af5fac44cce680b849839704b85a2505d5 | [
"MIT"
] | null | null | null | GUI/src/backend/__init__.py | jamesgleave/DeepDockingGUI | 4baa30af5fac44cce680b849839704b85a2505d5 | [
"MIT"
] | 5 | 2021-07-15T21:37:36.000Z | 2022-02-10T02:03:21.000Z | from .auto_ssh import SSH
from .cluster_commands import *
from .DataHistory import DataHistory
from .backend import Backend
| 24.8 | 36 | 0.830645 | 17 | 124 | 5.941176 | 0.470588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129032 | 124 | 4 | 37 | 31 | 0.935185 | 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 |
31a68409ca14c1c1f5737b67d268573a403d0a97 | 178 | py | Python | automol/smiles.py | kevinmooreiii/autochem | 87f50adc09c3f1170459c629697aadd74154c769 | [
"Apache-2.0"
] | null | null | null | automol/smiles.py | kevinmooreiii/autochem | 87f50adc09c3f1170459c629697aadd74154c769 | [
"Apache-2.0"
] | null | null | null | automol/smiles.py | kevinmooreiii/autochem | 87f50adc09c3f1170459c629697aadd74154c769 | [
"Apache-2.0"
] | null | null | null | """ SMILES
"""
import automol.convert.smiles
def inchi(smi):
""" SMILES => InChI
"""
# print('smi', smi)
ich = automol.convert.smiles.inchi(smi)
return ich
| 14.833333 | 43 | 0.589888 | 21 | 178 | 5 | 0.47619 | 0.266667 | 0.380952 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.235955 | 178 | 11 | 44 | 16.181818 | 0.772059 | 0.258427 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
9ee9a1e444d1bac8f921da8045af52acb3046a6c | 1,530 | py | Python | tests/unit_tests/test_nn/test_converters/test_onnx/test_GlobalAveragePool.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 5 | 2022-01-28T20:30:34.000Z | 2022-03-17T09:26:52.000Z | tests/unit_tests/test_nn/test_converters/test_onnx/test_GlobalAveragePool.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 9 | 2022-01-27T03:50:28.000Z | 2022-02-08T18:42:17.000Z | tests/unit_tests/test_nn/test_converters/test_onnx/test_GlobalAveragePool.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 2 | 2022-02-03T17:32:43.000Z | 2022-03-24T16:38:49.000Z | import numpy as np
import onnxruntime
from dnnv.nn.converters.onnx import *
from dnnv.nn.operations import *
def test_GlobalAveragePool():
x = np.random.randn(1, 3, 5, 5).astype(np.float32)
op = GlobalAveragePool(x)
onnx_model = convert(OperationGraph([op]))
results = onnxruntime.backend.run(onnx_model, [])
assert len(results) == 1
result = results[0]
y = np.mean(x, axis=tuple(range(2, np.ndim(x))), keepdims=True)
assert result.shape == y.shape
assert np.allclose(result, y)
x = np.random.randn(1, 3, 5, 5).astype(np.float32)
input_op = Input((1, 3, 5, 5), np.dtype(np.float32))
op = GlobalAveragePool(input_op)
onnx_model = convert(OperationGraph([op]))
results = onnxruntime.backend.run(onnx_model, [x])
assert len(results) == 1
result = results[0]
y = np.mean(x, axis=tuple(range(2, np.ndim(x))), keepdims=True)
assert result.shape == y.shape
assert np.allclose(result, y)
def test_GlobalAveragePool_precomputed():
x = np.array(
[
[
[
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
]
]
]
).astype(np.float32)
op = GlobalAveragePool(x)
onnx_model = convert(OperationGraph([op]))
results = onnxruntime.backend.run(onnx_model, [])
assert len(results) == 1
result = results[0]
y = np.array([[[[5]]]]).astype(np.float32)
assert result.shape == y.shape
assert np.allclose(result, y)
| 26.842105 | 67 | 0.588889 | 200 | 1,530 | 4.45 | 0.265 | 0.060674 | 0.067416 | 0.013483 | 0.725843 | 0.725843 | 0.725843 | 0.725843 | 0.725843 | 0.725843 | 0 | 0.035492 | 0.263399 | 1,530 | 56 | 68 | 27.321429 | 0.754215 | 0 | 0 | 0.522727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204545 | 1 | 0.045455 | false | 0 | 0.090909 | 0 | 0.136364 | 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 |
9eef3dbc497276a5a8e6137afb04673a1511cf72 | 140 | py | Python | dribdat/public/__init__.py | gonzalocasas/dribdat | f8c326c96e851be199eb9f61daed6c8780e3bc27 | [
"MIT"
] | 21 | 2015-10-25T23:22:04.000Z | 2019-04-01T06:42:54.000Z | dribdat/public/__init__.py | gonzalocasas/dribdat | f8c326c96e851be199eb9f61daed6c8780e3bc27 | [
"MIT"
] | 108 | 2020-02-11T10:07:53.000Z | 2021-06-19T20:30:03.000Z | dribdat/public/__init__.py | OpendataCH/dribdat | 90d95a12c782dea7d284a4c454a06481e67c1e37 | [
"MIT"
] | 12 | 2016-09-02T03:12:28.000Z | 2021-06-02T07:58:48.000Z | # -*- coding: utf-8 -*-
"""The public module, including the homepage, API and user auth."""
from . import views, project, auth, api # noqa
| 35 | 67 | 0.657143 | 20 | 140 | 4.6 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008696 | 0.178571 | 140 | 3 | 68 | 46.666667 | 0.791304 | 0.635714 | 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 |
730aa470f2a6c716817973979dbb1d7753436204 | 73 | py | Python | zergmacroplot/storage/__init__.py | frugs/allin-zergmacroplot | f6e79d863248b8d403f6ed55104ac385345c5c94 | [
"MIT"
] | null | null | null | zergmacroplot/storage/__init__.py | frugs/allin-zergmacroplot | f6e79d863248b8d403f6ed55104ac385345c5c94 | [
"MIT"
] | null | null | null | zergmacroplot/storage/__init__.py | frugs/allin-zergmacroplot | f6e79d863248b8d403f6ed55104ac385345c5c94 | [
"MIT"
] | null | null | null | from .database import Database
from .util import write_to_temporary_file
| 24.333333 | 41 | 0.863014 | 11 | 73 | 5.454545 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.109589 | 73 | 2 | 42 | 36.5 | 0.923077 | 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 |
73158c37eeaaf13d7b0f04b7dfee2da9988bb639 | 344 | py | Python | src/pytorch_metric_learning/regularizers/__init__.py | RaunakRahi/pytorch-metric-learning | 1525e5b7bd840967b344b3da5667297295042361 | [
"MIT"
] | 1 | 2020-12-22T01:11:46.000Z | 2020-12-22T01:11:46.000Z | src/pytorch_metric_learning/regularizers/__init__.py | RaunakRahi/pytorch-metric-learning | 1525e5b7bd840967b344b3da5667297295042361 | [
"MIT"
] | null | null | null | src/pytorch_metric_learning/regularizers/__init__.py | RaunakRahi/pytorch-metric-learning | 1525e5b7bd840967b344b3da5667297295042361 | [
"MIT"
] | 1 | 2021-10-24T02:38:22.000Z | 2021-10-24T02:38:22.000Z | from .base_regularizer import BaseRegularizer
from .center_invariant_regularizer import CenterInvariantRegularizer
from .regular_face_regularizer import RegularFaceRegularizer
from .lp_regularizer import LpRegularizer
from .zero_mean_regularizer import ZeroMeanRegularizer
from .sparse_centers_regularizer import SparseCentersRegularizer
| 49.142857 | 69 | 0.895349 | 34 | 344 | 8.764706 | 0.558824 | 0.342282 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.087209 | 344 | 6 | 70 | 57.333333 | 0.949045 | 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 |
7360859edcf00ec56f0be02dd4d1c7e202876c70 | 46 | py | Python | pdf_utils/__init__.py | yawnston/pdf-utils | 6d86b21e8b95e7bb3de73ebf64e6612197494859 | [
"BSD-3-Clause"
] | 6 | 2020-08-19T11:48:24.000Z | 2021-11-29T11:12:44.000Z | pdf_utils/__init__.py | yawnston/pdf-utils | 6d86b21e8b95e7bb3de73ebf64e6612197494859 | [
"BSD-3-Clause"
] | 2 | 2020-08-19T10:48:41.000Z | 2020-08-25T11:30:17.000Z | pdf_utils/__init__.py | yawnston/pdf-utils | 6d86b21e8b95e7bb3de73ebf64e6612197494859 | [
"BSD-3-Clause"
] | 4 | 2020-08-19T12:48:19.000Z | 2021-03-03T13:09:21.000Z | from pdf_utils.__version__ import __version__
| 23 | 45 | 0.891304 | 6 | 46 | 5.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 46 | 1 | 46 | 46 | 0.761905 | 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 |
7363b349e136aeb1d2afc818d657d9b2d564bdd8 | 25 | py | Python | Python/test.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 1,428 | 2018-10-03T15:15:17.000Z | 2019-03-31T18:38:36.000Z | Python/test.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 1,162 | 2018-10-03T15:05:49.000Z | 2018-10-18T14:17:52.000Z | Python/test.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 3,909 | 2018-10-03T15:07:19.000Z | 2019-03-31T18:39:08.000Z | print("hello worldxdxd")
| 12.5 | 24 | 0.76 | 3 | 25 | 6.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08 | 25 | 1 | 25 | 25 | 0.826087 | 0 | 0 | 0 | 0 | 0 | 0.6 | 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 |
7df41fe95e9f3dd6e2a0a6c58489d9910c8a8f56 | 19,646 | py | Python | plots/ch_vs_gl.py | rogerlew/qsturng-py | 411f3c52ee90c5310f31b7fdd6db2e5996d7b332 | [
"BSD-3-Clause"
] | null | null | null | plots/ch_vs_gl.py | rogerlew/qsturng-py | 411f3c52ee90c5310f31b7fdd6db2e5996d7b332 | [
"BSD-3-Clause"
] | null | null | null | plots/ch_vs_gl.py | rogerlew/qsturng-py | 411f3c52ee90c5310f31b7fdd6db2e5996d7b332 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2011 BSD, Roger Lew [see LICENSE.txt]
# This software is funded in part by NIH Grant P20 RR016454.
import numpy as np
import pylab
import mpl_toolkits.mplot3d.axes3d as p3
from qsturng import qsturng,p_keys,v_keys
##from qsturng.make_tbls import T,R
inf = float('inf')
# from Harter's table
q0999 = """\
44.69 60.42 70.77 78.43 84.49 89.46 93.67 97.30 100.5 103.3 105.9 108.2 110.4 112.3 114.2 115.9 117.4 118.9 120.3 131.0 138.3 148.0 154.7 159.7
18.28 23.32 26.65 29.13 31.11 32.74 34.12 35.33 36.39 37.34 38.20 38.98 39.69 40.35 40.97 41.54 42.07 42.58 43.05 46.68 49.16 52.51 54.81 56.53
12.18 14.98 16.84 18.23 19.34 20.26 21.04 21.73 22.33 22.87 23.36 23.81 24.21 24.59 24.94 25.27 25.58 25.87 26.14 28.24 29.68 31.65 32.98 34.00
9.714 11.67 12.96 13.93 14.71 15.35 15.91 16.39 16.82 17.18 17.53 17.85 18.13 18.41 18.66 18.89 19.10 19.31 19.51 21.01 22.03 23.45 24.41 25.15
8.427 9.960 10.97 11.72 12.32 12.82 13.25 13.63 13.96 14.26 14.53 14.78 15.00 15.21 15.41 15.59 15.78 15.94 16.09 17.28 18.10 19.22 20.00 20.58
7.648 8.930 9.768 10.40 10.90 11.32 11.67 11.99 12.27 12.52 12.74 12.95 13.14 13.32 13.48 13.64 13.78 13.92 14.05 15.06 15.74 16.69 17.35 17.85
7.129 8.250 8.977 9.522 9.958 10.32 10.63 10.90 11.15 11.36 11.56 11.74 11.91 12.06 12.20 12.34 12.46 12.58 12.69 13.57 14.17 15.01 15.59 16.02
6.761 7.768 8.419 8.906 9.295 9.619 9.896 10.14 10.35 10.55 10.72 10.89 11.03 11.17 11.30 11.42 11.53 11.64 11.74 12.52 13.07 13.82 14.34 14.74
6.487 7.411 8.006 8.449 8.804 9.099 9.352 9.573 9.769 9.946 10.11 10.25 10.39 10.51 10.63 10.74 10.84 10.94 11.03 11.75 12.25 12.94 13.42 13.79
6.275 7.135 7.687 8.098 8.426 8.699 8.933 9.137 9.319 9.482 9.630 9.766 9.891 10.01 10.12 10.22 10.31 10.40 10.49 11.15 11.61 12.25 12.70 13.03
6.106 6.917 7.435 7.820 8.127 8.382 8.601 8.792 8.962 9.115 9.253 9.380 9.497 9.606 9.707 9.802 9.891 9.975 10.05 10.68 11.11 11.71 12.12 12.44
5.969 6.740 7.231 7.595 7.885 8.126 8.332 8.513 8.673 8.817 8.948 9.068 9.178 9.280 9.376 9.465 9.549 9.629 9.704 10.29 10.70 11.27 11.66 11.96
5.855 6.593 7.062 7.409 7.685 7.914 8.110 8.282 8.434 8.571 8.695 8.809 8.914 9.011 9.102 9.187 9.267 9.342 9.414 9.972 10.36 10.90 11.28 11.57
5.760 6.470 6.920 7.252 7.517 7.736 7.924 8.088 8.234 8.364 8.483 8.592 8.692 8.785 8.872 8.953 9.030 9.102 9.170 9.703 10.08 10.59 10.95 11.23
5.678 6.365 6.799 7.119 7.374 7.585 7.765 7.923 8.063 8.189 8.303 8.407 8.504 8.593 8.676 8.754 8.828 8.897 8.962 9.475 9.832 10.33 10.68 10.94
5.608 6.274 6.695 7.004 7.250 7.454 7.629 7.781 7.916 8.037 8.147 8.248 8.341 8.427 8.507 8.583 8.653 8.720 8.783 9.277 9.623 10.10 10.44 10.69
5.546 6.195 6.604 6.905 7.143 7.341 7.510 7.657 7.788 7.905 8.012 8.109 8.199 8.283 8.361 8.433 8.502 8.566 8.627 9.106 9.440 9.904 10.23 10.48
5.492 6.126 6.524 6.817 7.049 7.241 7.405 7.549 7.676 7.790 7.893 7.988 8.075 8.156 8.232 8.302 8.369 8.431 8.491 8.955 9.279 9.729 10.04 10.29
5.444 6.065 6.454 6.740 6.966 7.153 7.313 7.453 7.576 7.687 7.788 7.880 7.965 8.044 8.118 8.186 8.251 8.312 8.370 8.821 9.136 9.575 9.881 10.12
5.297 5.877 6.238 6.502 6.711 6.884 7.031 7.159 7.272 7.374 7.467 7.551 7.629 7.701 7.768 7.831 7.890 7.946 7.999 8.411 8.699 9.100 9.380 9.595
5.156 5.698 6.033 6.277 6.469 6.628 6.763 6.880 6.984 7.077 7.161 7.239 7.310 7.375 7.437 7.494 7.548 7.598 7.646 8.021 8.283 8.646 8.901 9.096
5.022 5.527 5.838 6.063 6.240 6.385 6.509 6.616 6.710 6.795 6.872 6.942 7.007 7.066 7.122 7.174 7.223 7.268 7.312 7.651 7.887 8.214 8.442 8.618
4.893 5.365 5.653 5.860 6.022 6.155 6.268 6.365 6.451 6.528 6.598 6.661 6.720 6.773 6.824 6.870 6.914 6.956 6.995 7.299 7.510 7.802 8.005 8.161
4.771 5.211 5.476 5.667 5.815 5.937 6.039 6.128 6.206 6.275 6.338 6.395 6.448 6.496 6.541 6.583 6.623 6.660 6.695 6.966 7.153 7.410 7.589 7.726
4.654 5.063 5.309 5.484 5.619 5.730 5.823 5.903 5.973 6.036 6.092 6.144 6.191 6.234 6.274 6.312 6.347 6.380 6.411 6.651 6.816 7.041 7.196 7.314"""
# from R's qtukey
ch0999 = """\
34.71363 42.41291 46.93637 50.12041 52.56414 54.53916 56.1916 57.60896 58.8477 59.94634 60.93227 61.82566 62.64179 63.39248 64.08705 64.73302 65.33649 65.90249 66.43524 70.51358 73.2792 77.022 79.57999 81.51381
18.27676 23.70372 27.66839 30.92112 33.65335 35.96129 37.93053 39.63366 41.12687 42.45227 43.64135 44.71793 45.70032 46.60284 47.43685 48.21152 48.93432 49.61143 50.24801 55.09543 58.35526 62.73058 NaN NaN
12.18349 14.98292 16.82169 18.18959 19.27307 20.16572 20.92173 21.5754 22.14981 22.6612 23.1214 23.53926 23.92159 24.27368 24.59977 24.90327 25.18698 25.45321 25.70390 27.62455 28.92645 30.68462 31.88276 32.78646
9.713988 11.67150 12.96211 13.93128 14.70736 15.35395 15.90750 16.39097 16.81976 17.20472 17.55378 17.87292 18.16674 18.43888 18.69225 18.92921 19.15172 19.36141 19.55963 21.10438 22.17964 23.67365 24.72421 25.53721
8.42698 9.95952 10.96508 11.71909 12.32246 12.82485 13.25468 13.62981 13.96223 14.26039 14.53046 14.77711 15.00393 15.21377 15.40888 15.59114 15.76205 15.92291 16.07478 17.25041 18.05861 19.16362 19.92501 20.50327
7.647901 8.9304 9.76791 10.39527 10.89745 11.31600 11.67458 11.98801 12.26622 12.5162 12.74304 12.95058 13.14179 13.31900 13.48407 13.63853 13.78364 13.92043 14.0498 15.05894 15.76135 16.73409 17.41331 17.93461
7.129484 8.2495 8.977466 9.521926 9.957574 10.32069 10.63184 10.90390 11.14544 11.36252 11.55953 11.73979 11.90585 12.05973 12.20304 12.33711 12.46300 12.58164 12.69378 13.56563 14.16745 14.98978 15.55369 15.97957
6.761231 7.768013 8.419424 8.905763 9.294625 9.618669 9.896353 10.13919 10.35484 10.54871 10.72472 10.88582 11.03429 11.17192 11.30016 11.42018 11.53293 11.63923 11.73976 12.52344 13.06765 13.81844 14.34025 14.73922
6.486847 7.410581 8.005724 8.449237 8.803547 9.098681 9.35156 9.572706 9.76913 9.94574 10.10612 10.25295 10.38831 10.51382 10.63081 10.74032 10.84323 10.94029 11.03210 11.74889 12.24789 12.93803 13.41863 13.78641
6.274836 7.135253 7.687425 8.098164 8.425979 8.698905 8.932695 9.137127 9.318703 9.481974 9.630251 9.766021 9.891198 10.00729 10.11550 10.21682 10.31205 10.40187 10.48685 11.15058 11.61280 12.25156 12.69534 13.03390
6.106279 6.91693 7.435287 7.820189 8.12708 8.382438 8.601105 8.792278 8.962063 9.114727 9.253373 9.38033 9.49739 9.605961 9.707173 9.801944 9.89103 9.975062 10.05457 10.67588 11.10888 11.70769 12.12409 12.44205
5.969157 6.739728 7.23082 7.594861 7.884832 8.125965 8.332372 8.512783 8.672985 8.817022 8.947828 9.067606 9.17805 9.280489 9.37599 9.465418 9.549488 9.628795 9.70384 10.29053 10.69980 11.26660 11.66155 11.96376
5.855486 6.59312 7.061791 7.408654 7.684676 7.914067 8.110342 8.28185 8.434118 8.571005 8.69531 8.80913 8.914079 9.011422 9.102175 9.18716 9.267056 9.342429 9.413756 9.971576 10.36099 10.90089 11.27758 11.56615
5.75976 6.469871 6.919794 7.25228 7.516614 7.736155 7.923923 8.087949 8.233544 8.364413 8.48324 8.592038 8.692351 8.785393 8.872135 8.953365 9.029733 9.101778 9.169958 9.703287 10.07579 10.59255 10.95332 11.22976
5.678062 6.364847 6.798873 7.119157 7.373561 7.584728 7.765256 7.922908 8.062815 8.18855 8.302702 8.40721 8.503561 8.592925 8.676235 8.754251 8.827596 8.89679 8.962273 9.474561 9.832479 10.32921 10.67611 10.94196
5.607535 6.274307 6.694689 7.004493 7.250363 7.454325 7.62862 7.780781 7.915784 8.037089 8.147205 8.248007 8.340935 8.427118 8.50746 8.582693 8.653421 8.720146 8.78329 9.277316 9.622546 10.10183 10.43666 10.69332
5.546045 6.195466 6.604015 6.904725 7.143183 7.340885 7.509759 7.657142 7.787874 7.90532 8.011917 8.109487 8.199427 8.282833 8.360583 8.433385 8.501825 8.56639 8.62749 9.105518 9.439614 9.903576 10.22784 10.47649
5.491965 6.126204 6.524398 6.817144 7.049108 7.24132 7.40544 7.548628 7.675609 7.789664 7.893167 7.987894 8.075205 8.156167 8.231632 8.302292 8.368716 8.431377 8.490674 8.954573 9.278821 9.729218 10.04412 10.28569
5.444038 6.064884 6.453941 6.739658 6.965888 7.153249 7.313164 7.452642 7.576303 7.687355 7.788118 7.880325 7.965305 8.044099 8.117538 8.186297 8.25093 8.3119 8.369594 8.820925 9.136395 9.574684 9.881222 10.11645
5.296794 5.876876 6.238118 6.502418 6.711157 6.88371 7.030776 7.158903 7.272398 7.374245 7.466599 7.551068 7.628883 7.701007 7.76821 7.831112 7.890226 7.945979 7.998727 8.411155 8.699333 9.099793 9.380049 9.595255
5.156164 5.697886 6.032952 6.277078 6.469317 6.62788 6.762789 6.88016 6.984007 7.077106 7.161459 7.238555 7.309533 7.375285 7.436521 7.493815 7.547639 7.598385 7.646382 8.02126 8.282898 8.64629 8.900596 9.095928
5.021824 5.527466 5.837921 6.063066 6.239766 6.385137 6.508566 6.615768 6.71048 6.795286 6.872042 6.942129 7.006601 7.066281 7.121825 7.173763 7.222528 7.268481 7.311925 7.650645 7.886521 8.213621 8.442299 8.617877
4.893462 5.365187 5.652529 5.859844 6.021937 6.154896 6.267513 6.365126 6.451216 6.528185 6.597754 6.661203 6.719506 6.773423 6.82356 6.870402 6.91435 6.955735 6.994836 7.298894 7.509874 7.801574 8.004996 8.160953
4.770784 5.210645 5.476306 5.666901 5.815294 5.936607 6.039074 6.127678 6.205662 6.275256 6.338058 6.395251 6.447736 6.496213 6.54124 6.583265 6.622655 6.659714 6.694698 6.965778 7.152906 7.4104 7.58918 7.725833
4.653508 5.063453 5.308804 5.483754 5.619333 5.729754 5.822728 5.902906 5.973307 6.036 6.092467 6.143802 6.190836 6.234215 6.274452 6.311958 6.347071 6.38007 6.411188 6.651228 6.815814 7.040804 7.19601 7.314094"""
q = np.array([map(float, L.split()) for L in q0999.split('\n')])
ch = np.array([map(float, L.split()) for L in ch0999.split('\n')])
rs = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,30,40,60,80,100]
rs_mesh = np.array([rs for i in range(25)])
vs = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,24,30,40,60,120,inf]
vs_mesh = np.array([list(t) for t in zip(*[range(1,1+len(vs)) for i in range(len(rs))])])
ch_ne = (ch-q)/q
from pprint import pprint as pp
pp([' '.join(['%.2f'%e for e in L]) for L in ch_ne*100])
q0975 = """\
8.776 11.94 14.02 15.54 16.75 17.74 18.58 19.31 19.95 20.52 21.03 21.49 21.91 22.30 22.67 23.01 23.32 23.62 23.89 26.03 27.47 29.42 30.74 31.74
5.907 7.661 8.808 9.659 10.33 10.89 11.36 11.77 12.14 12.46 12.75 13.01 13.25 13.47 13.68 13.87 14.05 14.22 14.38 15.62 16.46 17.58 18.37 18.95
4.943 6.244 7.088 7.715 8.213 8.625 8.975 9.279 9.548 9.788 10.00 10.20 10.38 10.55 10.71 10.85 10.99 11.11 11.23 12.16 12.78 13.65 14.23 14.68
4.474 5.558 6.257 6.775 7.186 7.526 7.816 8.068 8.291 8.490 8.670 8.834 8.984 9.124 9.253 9.373 9.486 9.592 9.693 10.47 11.00 11.72 12.21 12.59
4.198 5.158 5.772 6.226 6.586 6.884 7.138 7.359 7.554 7.729 7.887 8.031 8.163 8.285 8.399 8.505 8.605 8.698 8.787 9.469 9.937 10.57 11.01 11.34
4.018 4.897 5.455 5.867 6.194 6.464 6.694 6.894 7.071 7.230 7.373 7.504 7.624 7.735 7.838 7.935 8.025 8.110 8.191 8.812 9.239 9.822 10.22 10.53
3.891 4.714 5.233 5.616 5.919 6.169 6.382 6.567 6.731 6.878 7.011 7.132 7.244 7.347 7.442 7.532 7.616 7.694 7.769 8.346 8.743 9.286 9.660 9.944
3.797 4.578 5.069 5.430 5.715 5.950 6.151 6.325 6.479 6.617 6.742 6.856 6.961 7.057 7.148 7.232 7.311 7.385 7.455 7.999 8.373 8.885 9.238 9.506
3.725 4.474 4.943 5.286 5.558 5.782 5.972 6.138 6.284 6.415 6.534 6.642 6.742 6.834 6.920 7.000 7.075 7.145 7.212 7.729 8.085 8.574 8.910 9.166
3.667 4.391 4.843 5.173 5.433 5.648 5.830 5.989 6.130 6.255 6.369 6.473 6.568 6.656 6.738 6.815 6.887 6.955 7.018 7.514 7.856 8.324 8.648 8.894
3.620 4.324 4.761 5.080 5.332 5.539 5.715 5.868 6.004 6.125 6.235 6.335 6.426 6.511 6.591 6.664 6.734 6.799 6.860 7.338 7.668 8.120 8.433 8.670
3.582 4.269 4.694 5.004 5.248 5.449 5.620 5.768 5.899 6.017 6.123 6.220 6.309 6.391 6.468 6.539 6.606 6.670 6.729 7.192 7.511 7.950 8.253 8.484
3.549 4.222 4.638 4.940 5.178 5.373 5.540 5.684 5.812 5.926 6.029 6.123 6.210 6.290 6.364 6.434 6.499 6.560 6.618 7.068 7.379 7.806 8.100 8.325
3.521 4.182 4.589 4.885 5.117 5.309 5.471 5.612 5.736 5.848 5.948 6.040 6.125 6.205 6.275 6.343 6.407 6.467 6.523 6.962 7.265 7.682 7.969 8.189
3.497 4.148 4.548 4.838 5.065 5.253 5.412 5.550 5.671 5.780 5.879 5.969 6.051 6.128 6.199 6.265 6.327 6.386 6.441 6.870 7.167 7.574 7.856 8.070
3.476 4.118 4.511 4.797 5.020 5.204 5.360 5.495 5.615 5.722 5.818 5.906 5.987 6.062 6.132 6.197 6.258 6.315 6.369 6.790 7.080 7.479 7.756 7.966
3.458 4.091 4.479 4.760 4.980 5.161 5.315 5.448 5.565 5.670 5.765 5.851 5.931 6.004 6.073 6.137 6.196 6.253 6.306 6.719 7.004 7.396 7.667 7.874
3.441 4.068 4.451 4.728 4.945 5.123 5.274 5.405 5.521 5.624 5.717 5.803 5.881 5.953 6.020 6.083 6.142 6.197 6.250 6.656 6.936 7.322 7.589 7.792
3.427 4.047 4.426 4.699 4.914 5.089 5.238 5.367 5.481 5.583 5.675 5.759 5.836 5.907 5.974 6.035 6.093 6.148 6.199 6.599 6.876 7.255 7.518 7.718
3.381 3.982 4.347 4.610 4.816 4.984 5.126 5.250 5.358 5.455 5.543 5.623 5.696 5.764 5.827 5.886 5.941 5.993 6.042 6.422 6.685 7.046 7.295 7.486
3.337 3.919 4.271 4.523 4.720 4.881 5.017 5.134 5.238 5.330 5.414 5.490 5.560 5.624 5.684 5.740 5.792 5.841 5.888 6.248 6.497 6.838 7.075 7.255
3.294 3.858 4.196 4.439 4.627 4.780 4.910 5.022 5.120 5.208 5.287 5.360 5.426 5.487 5.543 5.596 5.646 5.692 5.736 6.077 6.311 6.633 6.855 7.025
3.251 3.798 4.124 4.356 4.536 4.682 4.806 4.912 5.006 5.089 5.164 5.232 5.295 5.352 5.406 5.456 5.502 5.546 5.588 5.908 6.127 6.428 6.636 6.795
3.210 3.739 4.053 4.275 4.447 4.587 4.704 4.805 4.894 4.972 5.043 5.107 5.166 5.221 5.271 5.318 5.362 5.403 5.442 5.741 5.946 6.225 6.418 6.564
3.170 3.682 3.984 4.197 4.361 4.494 4.605 4.700 4.784 4.858 4.925 4.985 5.041 5.092 5.139 5.183 5.224 5.262 5.299 5.577 5.766 6.023 6.199 6.333"""
ch0975 = """\
8.754609 11.93654 14.01883 15.54388 16.73261 17.69882 18.50863 19.20348 19.81081 20.34954 20.83319 21.27169 21.67255 22.04156 22.38325 22.70128 22.99859 23.27764 23.54043 25.55531 26.92145 28.76449 30.01834 30.96267
5.906512 7.660809 8.807694 9.659486 10.33455 10.89171 11.36463 11.77444 12.13528 12.45707 12.74705 13.01065 13.25207 13.47457 13.68079 13.87285 14.0525 14.22119 14.38013 15.60254 16.43869 17.58255 18.37294 18.97462
4.943299 6.243653 7.088175 7.715441 8.213296 8.624981 8.975175 9.279323 9.547741 9.787656 10.00432 10.20168 10.38276 10.54992 10.70507 10.84975 10.98520 11.1125 11.23251 12.15564 12.78338 13.63102 14.20780 14.64243
4.473697 5.558021 6.256746 6.774849 7.186119 7.526468 7.816258 8.068193 8.29074 8.489827 8.669767 8.833794 8.984395 9.123523 9.252737 9.373304 9.486267 9.592491 9.692706 10.46633 10.99626 11.71843 12.21417 12.58943
4.198356 5.157934 5.771726 6.225786 6.585984 6.884078 7.137979 7.358817 7.553999 7.728701 7.886687 8.030778 8.163141 8.285478 8.39915 8.50526 8.604715 8.698271 8.786564 9.46897 9.93692 10.57455 11.01209 11.34346
4.018126 4.89697 5.455416 5.867491 6.194047 6.464206 6.694309 6.89448 7.07144 7.229879 7.373204 7.503965 7.624121 7.735211 7.838463 7.934874 8.025263 8.110315 8.190601 8.811827 9.238631 9.82158 10.22277 10.52728
3.891242 4.713745 5.233355 5.615822 5.918558 6.168871 6.382021 6.567438 6.731365 6.878155 7.010963 7.132153 7.243536 7.346536 7.442288 7.531714 7.615573 7.694493 7.769007 8.346068 8.743072 9.285954 9.6598 9.943524
3.797179 4.578204 5.069099 5.429584 5.714571 5.950053 6.150505 6.324847 6.478974 6.616991 6.741871 6.855836 6.960592 7.057474 7.147552 7.23169 7.3106 7.384873 7.455009 7.998508 8.372798 8.885096 9.23818 9.506326
3.724709 4.473959 4.942779 5.286304 5.557558 5.781535 5.972113 6.137828 6.28431 6.415473 6.534151 6.642459 6.74202 6.834104 6.919727 6.99971 7.074731 7.14535 7.212041 7.729088 8.085445 8.573622 8.910404 9.16638
3.667187 4.391335 4.842664 5.172714 5.433025 5.647814 5.830493 5.989294 6.129639 6.255295 6.368982 6.472734 6.568107 6.656321 6.738347 6.814975 6.886852 6.954516 7.01842 7.514026 7.855821 8.32439 8.647897 8.89392
3.620433 4.32426 4.761396 5.080481 5.33187 5.539153 5.715367 5.8685 6.003766 6.124936 6.234519 6.334519 6.426441 6.511461 6.59052 6.664376 6.733655 6.798876 6.860474 7.338315 7.668015 8.120267 8.432696 8.67039
3.581691 4.268736 4.694126 5.004119 5.248093 5.449127 5.61995 5.768351 5.899448 6.016789 6.122933 6.219787 6.308813 6.391153 6.467717 6.539243 6.606337 6.669502 6.72916 7.192014 7.511488 7.949915 8.252943 8.483562
3.549067 4.222023 4.637534 4.939866 5.177582 5.373332 5.539592 5.683981 5.811505 5.925628 6.028848 6.123026 6.209586 6.289641 6.364079 6.433617 6.498845 6.560253 6.618253 7.06828 7.37898 7.805525 8.100462 8.324995
3.521222 4.182183 4.589272 4.88506 5.117423 5.308649 5.470994 5.611939 5.736392 5.847746 5.948448 6.04032 6.124754 6.202838 6.27544 6.343261 6.406877 6.466767 6.523331 6.962244 7.265325 7.681532 7.969424 8.188658
3.497178 4.147807 4.54763 4.837765 5.065498 5.252804 5.411754 5.54971 5.671494 5.780442 5.878953 5.968816 6.051397 6.127762 6.198762 6.265085 6.327293 6.385856 6.441167 6.870348 7.166742 7.573863 7.855556 8.070124
3.476209 4.117844 4.511336 4.79654 5.020227 5.204105 5.360084 5.49542 5.614864 5.721698 5.818285 5.906383 5.987334 6.062187 6.131777 6.196779 6.257747 6.31514 6.369345 6.789931 7.080406 7.479469 7.755656 7.966076
3.45776 4.091498 4.479424 4.760287 4.98041 5.161265 5.314621 5.447643 5.565017 5.669982 5.764865 5.851399 5.930905 6.004416 6.072755 6.136585 6.19645 6.252805 6.306027 6.71896 7.004155 7.396015 7.667275 7.87398
3.441404 4.068152 4.451147 4.728161 4.94512 5.123289 5.274312 5.405274 5.520805 5.624103 5.717467 5.802605 5.880821 5.953135 6.020355 6.083137 6.142017 6.197442 6.249784 6.655859 6.93631 7.321691 7.58851 7.791864
3.426804 4.047322 4.425919 4.699496 4.913627 5.089393 5.238329 5.367445 5.481324 5.583127 5.675128 5.759012 5.83607 5.907307 5.973522 6.035361 6.093355 6.147942 6.199492 6.599383 6.875549 7.255065 7.51786 7.718171
3.381313 3.982475 4.347386 4.610249 4.81555 4.983801 5.126194 5.24952 5.358209 5.45531 5.543016 5.622949 5.69635 5.764185 5.82722 5.886076 5.941261 5.993196 6.042233 6.422446 6.684916 7.045614 7.295447 7.485943
3.336925 3.919289 4.270876 4.523279 4.719935 4.880808 5.016764 5.134379 5.237937 5.330382 5.413825 5.489831 5.55959 5.624031 5.683891 5.739763 5.792134 5.841408 5.887923 6.248272 6.496808 6.838217 7.074677 7.255005
3.293611 3.857719 4.196335 4.438526 4.62672 4.780351 4.909972 5.021955 5.12044 5.208271 5.287483 5.359581 5.425711 5.486765 5.543449 5.596332 5.645882 5.692483 5.73646 6.076705 6.311003 6.63252 6.855064 7.024744
3.251341 3.79772 4.123710 4.355936 4.535846 4.682371 4.805759 4.912186 5.005656 5.088916 5.163926 5.232137 5.29465 5.35232 5.405827 5.455715 5.502431 5.546346 5.587766 5.907625 6.127323 6.428201 6.636137 6.794545
3.210088 3.73925 4.052953 4.275453 4.447259 4.586812 4.70407 4.805019 4.893535 4.972266 5.043106 5.107451 5.166358 5.220651 5.270979 5.317867 5.36174 5.402952 5.441799 5.740974 5.945675 6.225059 6.417557 6.563915
3.169822 3.682268 3.984015 4.197027 4.360906 4.493624 4.604857 4.700411 4.784033 4.858286 4.924993 4.985497 5.040817 5.091743 5.138897 5.182782 5.223806 5.262307 5.298567 5.576798 5.766127 6.023168 6.199362 6.332834"""
q = np.array([map(float, L.split()) for L in q0975.split('\n')])
ch = np.array([map(float, L.split()) for L in ch0975.split('\n')])
rs = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,30,40,60,80,100]
rs_mesh = np.array([rs for i in range(25)])
vs = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,24,30,40,60,120,inf]
vs_mesh = np.array([list(t) for t in zip(*[range(1,1+len(vs)) for i in range(len(rs))])])
ch_ne = (ch-q)/q
from pprint import pprint as pp
pp([' '.join(['%.2f'%e for e in L]) for L in ch_ne*100])
##
##fig=pylab.figure()
##ax = p3.Axes3D(fig)
##ax.plot_wireframe(rs_mesh,vs_mesh,ch_ne)
##ax.set_xlabel('r')
##ax.set_ylabel('v')
##ax.set_zlabel('normalized error')
##pylab.show()
##fig.close()
| 126.748387 | 219 | 0.717449 | 5,160 | 19,646 | 2.727907 | 0.382171 | 0.003978 | 0.002558 | 0.004263 | 0.044473 | 0.043194 | 0.043194 | 0.043194 | 0.043194 | 0.043194 | 0 | 0.786226 | 0.140436 | 19,646 | 154 | 220 | 127.571429 | 0.047315 | 0.017714 | 0 | 0.110236 | 0 | 0.787402 | 0.935038 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.047244 | 0 | 0.047244 | 0.015748 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
7df60374c9a5a894d4fe6fae590b097fb1622e5b | 201 | py | Python | app/schemas/period_schema.py | helsingborg-stad/helsingborg-viva-api-adapter | 62a2385344cabb959a501f328b47e02d4363ac25 | [
"MIT"
] | 5 | 2021-04-22T12:14:13.000Z | 2022-01-20T15:58:26.000Z | app/schemas/period_schema.py | helsingborg-stad/helsingborg-viva-api-adapter | 62a2385344cabb959a501f328b47e02d4363ac25 | [
"MIT"
] | 30 | 2020-06-01T21:13:39.000Z | 2022-03-29T13:40:28.000Z | app/schemas/period_schema.py | helsingborg-stad/helsingborg-viva-api-adapter | 62a2385344cabb959a501f328b47e02d4363ac25 | [
"MIT"
] | null | null | null | from marshmallow import Schema, fields
class PeriodSchema(Schema):
start_date = fields.Number(data_key='startDate', required=True)
end_date = fields.Number(data_key='endDate', required=True)
| 28.714286 | 67 | 0.766169 | 26 | 201 | 5.769231 | 0.653846 | 0.133333 | 0.213333 | 0.266667 | 0.306667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.124378 | 201 | 6 | 68 | 33.5 | 0.852273 | 0 | 0 | 0 | 0 | 0 | 0.079602 | 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 |
b42fa381e67ef22f231e241b4de2be54f2ace3db | 47 | py | Python | python/fanout/cfg.py | zhaixinlong/rabbitmq-example | e26e3f9eb88a79de9e23cc430d8e960bf0c8bfd1 | [
"Apache-2.0"
] | 1 | 2021-01-26T16:44:56.000Z | 2021-01-26T16:44:56.000Z | python/fanout/cfg.py | zhaixinlong/rabbitmq-example | e26e3f9eb88a79de9e23cc430d8e960bf0c8bfd1 | [
"Apache-2.0"
] | null | null | null | python/fanout/cfg.py | zhaixinlong/rabbitmq-example | e26e3f9eb88a79de9e23cc430d8e960bf0c8bfd1 | [
"Apache-2.0"
] | 1 | 2021-01-26T16:45:48.000Z | 2021-01-26T16:45:48.000Z | url = 'amqp://rabbitmq:rabbitmq@localhost:5672' | 47 | 47 | 0.765957 | 6 | 47 | 6 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088889 | 0.042553 | 47 | 1 | 47 | 47 | 0.711111 | 0 | 0 | 0 | 0 | 0 | 0.8125 | 0.8125 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
b44172555f921a466f8b22133a0b0d6b64a2a6f6 | 119 | py | Python | modules/pswave/__init__.py | RealAllenDa/EEWMap | 4031c951fac97a099fb715c38a1dd77c52390a15 | [
"Apache-2.0"
] | null | null | null | modules/pswave/__init__.py | RealAllenDa/EEWMap | 4031c951fac97a099fb715c38a1dd77c52390a15 | [
"Apache-2.0"
] | 7 | 2021-11-20T06:52:50.000Z | 2022-01-13T10:01:21.000Z | modules/pswave/__init__.py | RealAllenDa/EEWMap | 4031c951fac97a099fb715c38a1dd77c52390a15 | [
"Apache-2.0"
] | null | null | null | """
EEWMap - Modules - Pswave
Used to get the S wave time for EEW.
"""
from .pswave import init_pswave, parse_pswave
| 19.833333 | 45 | 0.714286 | 19 | 119 | 4.368421 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.193277 | 119 | 5 | 46 | 23.8 | 0.864583 | 0.521008 | 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 |
b441dfd3405cc4fc53c54d8ed43a2e9ec83eb51c | 169 | py | Python | cart/context_processors.py | Tejas-Gosavi/nerds.com-an-e-commerce-web-site | 2cb30bebbe677dae8de2eae5e03cbb0dbb3da28d | [
"MIT",
"Unlicense"
] | null | null | null | cart/context_processors.py | Tejas-Gosavi/nerds.com-an-e-commerce-web-site | 2cb30bebbe677dae8de2eae5e03cbb0dbb3da28d | [
"MIT",
"Unlicense"
] | null | null | null | cart/context_processors.py | Tejas-Gosavi/nerds.com-an-e-commerce-web-site | 2cb30bebbe677dae8de2eae5e03cbb0dbb3da28d | [
"MIT",
"Unlicense"
] | 1 | 2022-03-23T15:35:03.000Z | 2022-03-23T15:35:03.000Z | from django.shortcuts import get_list_or_404, get_object_or_404, render
from .myCart import Cart
def cart(request):
return {
"cart": Cart(request),
}
| 16.9 | 71 | 0.698225 | 24 | 169 | 4.666667 | 0.625 | 0.089286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045113 | 0.213018 | 169 | 9 | 72 | 18.777778 | 0.796992 | 0 | 0 | 0 | 0 | 0 | 0.023669 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0.166667 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 5 |
b460244bd880a166319299183b30faca11da7749 | 61 | py | Python | flask_awscognito/__init__.py | m4g005/Flask-AWSCognito | d23c8ad47cebb0e0645fb78d46ca6061555de40d | [
"MIT"
] | 1 | 2020-06-07T00:43:35.000Z | 2020-06-07T00:43:35.000Z | flask_awscognito/__init__.py | m4g005/Flask-AWSCognito | d23c8ad47cebb0e0645fb78d46ca6061555de40d | [
"MIT"
] | null | null | null | flask_awscognito/__init__.py | m4g005/Flask-AWSCognito | d23c8ad47cebb0e0645fb78d46ca6061555de40d | [
"MIT"
] | null | null | null | from flask_awscognito.plugin import AWSCognitoAuthentication
| 30.5 | 60 | 0.918033 | 6 | 61 | 9.166667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065574 | 61 | 1 | 61 | 61 | 0.964912 | 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 |
b483a713d85d486555f6501d5160ef6971240fea | 302 | py | Python | juno/resources/routes/payment_routes.py | ASG09/juno-python | 45d7a58c5d226fd3ef8c33abfefa62644577e3be | [
"MIT"
] | 7 | 2021-04-16T01:55:43.000Z | 2021-11-29T22:56:51.000Z | juno/resources/routes/payment_routes.py | ASG09/juno-python | 45d7a58c5d226fd3ef8c33abfefa62644577e3be | [
"MIT"
] | 6 | 2021-02-16T14:23:26.000Z | 2022-02-13T20:39:23.000Z | juno/resources/routes/payment_routes.py | ASG09/juno-python | 45d7a58c5d226fd3ef8c33abfefa62644577e3be | [
"MIT"
] | 3 | 2021-06-24T04:17:18.000Z | 2021-11-29T22:20:32.000Z | from ..handler_request import get_resource_url
def get_base_url():
return f"{get_resource_url()}/payments"
def get_refund_payment_url(payment_id):
return f"{get_base_url()}/{payment_id}/refunds"
def get_capture_payment_url(payment_id):
return f"{get_base_url()}/{payment_id}/capture"
| 21.571429 | 51 | 0.761589 | 47 | 302 | 4.446809 | 0.361702 | 0.191388 | 0.229665 | 0.181818 | 0.430622 | 0.430622 | 0.430622 | 0.430622 | 0.430622 | 0.430622 | 0 | 0 | 0.112583 | 302 | 13 | 52 | 23.230769 | 0.779851 | 0 | 0 | 0 | 0 | 0 | 0.34106 | 0.34106 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0 | 0.142857 | 0.428571 | 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 |
b4872345c022c765979c8ca4aa7dd5a003bcf25b | 426 | py | Python | __other__/eval-examples.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | __other__/eval-examples.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | __other__/eval-examples.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z | #!/usr/bin/env python3
eval('print(open("/etc/passwd").read())')
#eval("print(open('/etc/shadow').read())") # restricted
eval('print(2*PI*r)', {'r': 2, 'PI': 3.1415})
eval('exec("import sys; print(sys.path)")')
eval('exec(\'import os; print("\\\\n".join(os.listdir()))\')')
# console ???
#eval('__import__("os").execve("/bin/sh",["?"],{})') # shell sh
eval('__import__("os").execve("/bin/bash",["?"],{})') # shell bash
| 26.625 | 66 | 0.570423 | 60 | 426 | 3.916667 | 0.5 | 0.114894 | 0.110638 | 0.13617 | 0.178723 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02046 | 0.08216 | 426 | 15 | 67 | 28.4 | 0.580563 | 0.373239 | 0 | 0 | 0 | 0 | 0.542308 | 0.3 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.2 | 0.6 | 0 | 0.6 | 0.8 | 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 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 5 |
c33670f47ad1cf326ec8dbb30faeb2a3c0d77ea6 | 197 | py | Python | bin/trigs/quasi-polytrigs-12-elongated-hexagon-2x1.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/trigs/quasi-polytrigs-12-elongated-hexagon-2x1.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/trigs/quasi-polytrigs-12-elongated-hexagon-2x1.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | 1 | 2022-01-02T16:54:14.000Z | 2022-01-02T16:54:14.000Z | #!/usr/bin/env python
# $Id$
"""542 solutions"""
import puzzler
from puzzler.puzzles.quasipolytrigs12 import QuasiPolytrigs12ElongatedHexagon2x1
puzzler.run(QuasiPolytrigs12ElongatedHexagon2x1)
| 19.7 | 80 | 0.822335 | 18 | 197 | 9 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071823 | 0.081218 | 197 | 9 | 81 | 21.888889 | 0.823204 | 0.19797 | 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 |
c33ffdd65f1c4b59dd5aa08f717dea4941b67ae5 | 465 | py | Python | day7/flask_day1/kangbazi.py | gaohj/wh1904js | a3af38f8311f79eb9f2e08a3de16dd1e02c40714 | [
"Apache-2.0"
] | null | null | null | day7/flask_day1/kangbazi.py | gaohj/wh1904js | a3af38f8311f79eb9f2e08a3de16dd1e02c40714 | [
"Apache-2.0"
] | null | null | null | day7/flask_day1/kangbazi.py | gaohj/wh1904js | a3af38f8311f79eb9f2e08a3de16dd1e02c40714 | [
"Apache-2.0"
] | null | null | null | from flask import Flask #导入类库
#创建一个实例
kangbazi = Flask(__name__)
@kangbazi.route('/')
def index():
return '<h1>hello world</h1>'
@kangbazi.route('/admin/')
def admin():
return '<h1>欢迎来到管理后台</h1>'
@kangbazi.route('/haha/')
def haha():
return '<h1>haha</h1>'
@kangbazi.route('/haha1/')
def haha1():
return '<h1>haha1</h1>'
@kangbazi.route('/haha3/')
def haha3():
return '<h1>haha3</h1>'
#启动实例
if __name__ == "__main__":
kangbazi.run()
| 15.5 | 33 | 0.621505 | 60 | 465 | 4.616667 | 0.383333 | 0.234657 | 0.216607 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040816 | 0.156989 | 465 | 29 | 34 | 16.034483 | 0.665816 | 0.030108 | 0 | 0 | 0 | 0 | 0.254464 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.263158 | false | 0 | 0.052632 | 0.263158 | 0.578947 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
5ee35c4c1f988de99f0d5078d8f97c0378dcc099 | 566 | py | Python | debugged/attachments/templatetags/attachment_items.py | bhrutledge/debugged-django | a9b0a2738ecdb9add260ec378a0a50875ffb98a5 | [
"MIT"
] | null | null | null | debugged/attachments/templatetags/attachment_items.py | bhrutledge/debugged-django | a9b0a2738ecdb9add260ec378a0a50875ffb98a5 | [
"MIT"
] | null | null | null | debugged/attachments/templatetags/attachment_items.py | bhrutledge/debugged-django | a9b0a2738ecdb9add260ec378a0a50875ffb98a5 | [
"MIT"
] | null | null | null | from django import template
register = template.Library()
@register.inclusion_tag('attachments/file_item.html')
def fileitem(attachment):
return {'file': attachment}
@register.inclusion_tag('attachments/image_item.html')
def imageitem(attachment, gallery_id=''):
return {'image': attachment, 'gallery_id': gallery_id}
@register.inclusion_tag('attachments/link_item.html')
def linkitem(attachment):
return {'link': attachment}
@register.inclusion_tag('attachments/video_item.html')
def videoitem(attachment):
return {'video': attachment}
| 28.3 | 58 | 0.754417 | 65 | 566 | 6.4 | 0.369231 | 0.163462 | 0.192308 | 0.298077 | 0.197115 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111307 | 566 | 20 | 59 | 28.3 | 0.827038 | 0 | 0 | 0 | 0 | 0 | 0.236332 | 0.186949 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.071429 | 0.285714 | 0.642857 | 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 |
6f10ef6aeaf34c702dc49fdc8592371d6c0cf6fb | 116 | py | Python | gym_industrial/envs/fatigue/__init__.py | angelolovatto/industrialbenchmark | d89fdc4bbfa3e569beb5d5c4690c23d8ecad28ed | [
"Apache-2.0"
] | 4 | 2020-05-06T17:25:15.000Z | 2021-11-29T12:30:33.000Z | gym_industrial/envs/fatigue/__init__.py | angelolovatto/gym-industrial | d89fdc4bbfa3e569beb5d5c4690c23d8ecad28ed | [
"Apache-2.0"
] | null | null | null | gym_industrial/envs/fatigue/__init__.py | angelolovatto/gym-industrial | d89fdc4bbfa3e569beb5d5c4690c23d8ecad28ed | [
"Apache-2.0"
] | null | null | null | # pylint:disable=missing-module-docstring
from .dynamics import FatigueDynamics
from .environment import FatigueEnv
| 29 | 41 | 0.853448 | 13 | 116 | 7.615385 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086207 | 116 | 3 | 42 | 38.666667 | 0.933962 | 0.336207 | 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 |
6f15de591e47c2fbe7af87dcfad1e3aa50e71046 | 111 | py | Python | billiard/tests/case.py | yacineA/billard | 3e932154a23f2575c2a4e9ee5a1902da10a2ffe8 | [
"BSD-3-Clause"
] | null | null | null | billiard/tests/case.py | yacineA/billard | 3e932154a23f2575c2a4e9ee5a1902da10a2ffe8 | [
"BSD-3-Clause"
] | null | null | null | billiard/tests/case.py | yacineA/billard | 3e932154a23f2575c2a4e9ee5a1902da10a2ffe8 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import case
import sys
sys.modules[__name__] = case
| 15.857143 | 56 | 0.828829 | 15 | 111 | 5.466667 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.126126 | 111 | 6 | 57 | 18.5 | 0.845361 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
6f175e4dd2c5db1372b817845a534e0f08539904 | 4,915 | py | Python | tests/test_pyhpeimc_plat_alarms.py | HPNetworking/HP-Intelligent-Management-Center | 4fba31827573587e03a6233c7db60f188038c8e5 | [
"Apache-2.0"
] | 13 | 2016-03-14T17:55:03.000Z | 2021-03-26T07:18:26.000Z | tests/test_pyhpeimc_plat_alarms.py | HPNetworking/HP-Intelligent-Management-Center | 4fba31827573587e03a6233c7db60f188038c8e5 | [
"Apache-2.0"
] | 7 | 2016-08-04T17:39:11.000Z | 2017-09-19T13:42:35.000Z | tests/test_pyhpeimc_plat_alarms.py | HPNetworking/HP-Intelligent-Management-Center | 4fba31827573587e03a6233c7db60f188038c8e5 | [
"Apache-2.0"
] | 17 | 2016-03-03T05:24:20.000Z | 2022-03-10T08:16:31.000Z | # -*- coding: utf-8 -*-
"""
This module is used for testing the functions within the pyhpeimc.plat.alarms module.
"""
from unittest import TestCase
from pyhpeimc.plat.alarms import *
from test_machine import auth
# TODO Remarked out failing tests
class TestGetDevAlarms(TestCase):
"""
Test Case for pyhpeimc plat alarms get_dev_alarms functions
"""
def test_get_dev_alarms_type(self):
"""
test case for get_dev_alarms type
"""
dev_alarms = get_dev_alarms(auth.creds, auth.url, devip='10.101.0.231')
self.assertIs(type(dev_alarms), list)
def test_get_dev_alarms_content(self):
dev_alarms = get_dev_alarms(auth.creds, auth.url, devip='10.101.0.231')
self.assertIn('ackStatus', dev_alarms[0])
self.assertIn('recTimeDesc', dev_alarms[0])
self.assertIn('originalTypeDesc', dev_alarms[0])
self.assertIn('ackStatusDesc', dev_alarms[0])
self.assertIn('ackTimeDesc', dev_alarms[0])
self.assertIn('ackTime', dev_alarms[0])
self.assertIn('deviceIp', dev_alarms[0])
self.assertIn('recTime', dev_alarms[0])
self.assertIn('id', dev_alarms[0])
self.assertIn('faultTimeDesc', dev_alarms[0])
self.assertIn('faultTime', dev_alarms[0])
# self.assertIn('holdInfo', dev_alarms[0])
self.assertIn('originalType', dev_alarms[0])
self.assertIn('recStatus', dev_alarms[0])
self.assertIn('alarmDesc', dev_alarms[0])
self.assertIn('alarmDetail', dev_alarms[0])
self.assertIn('alarmLevelDesc', dev_alarms[0])
self.assertIn('remark', dev_alarms[0])
self.assertIn('ackUserName', dev_alarms[0])
self.assertIn('alarmCategoryDesc', dev_alarms[0])
self.assertIn('recUserName', dev_alarms[0])
self.assertIn('alarmCategory', dev_alarms[0])
self.assertIn('parentId', dev_alarms[0])
self.assertIn('recStatusDesc', dev_alarms[0])
self.assertIn('alarmLevel', dev_alarms[0])
self.assertIn('somState', dev_alarms[0])
self.assertIn('deviceName', dev_alarms[0])
self.assertIn('paras', dev_alarms[0])
self.assertIn('OID', dev_alarms[0])
self.assertIn('deviceId', dev_alarms[0])
class TestGetRealtimeAlarm(TestCase):
def test_get_realtime_alarm_type(self):
real_time_alarm = get_realtime_alarm('admin', auth.creds, auth.url)
self.assertIs(type(real_time_alarm), list)
def test_get_realtime_alarm_content(self):
real_time_alarm = get_realtime_alarm('admin', auth.creds, auth.url)
#self.assertIs(len(real_time_alarm[0]), 7)
self.assertIn('faultTime', real_time_alarm[0])
self.assertIn('userAckUserName', real_time_alarm[0])
self.assertIn('id', real_time_alarm[0])
self.assertIn('deviceDisplay', real_time_alarm[0])
self.assertIn('faultDesc', real_time_alarm[0])
self.assertIn('userAckType', real_time_alarm[0])
# TODO Remarked out failing test
# TODO Get_all_alarms testing - Need to investigate
"""
class TestGetAllAlarm(TestCase):
def test_get_alarms_type(self):
all_alarms = get_alarms('admin', auth.creds, auth.url)
self.assertIs(type(all_alarms), list)
def test_get_alarms_content(self):
all_alarms = get_alarms('admin', auth.creds, auth.url)
#self.assertIs(len(all_alarms[0]), 29)
self.assertIn('ackStatus',all_alarms[0])
self.assertIn('parentId', all_alarms[0])
self.assertIn('recUserName', all_alarms[0])
self.assertIn('alarmCategory', all_alarms[0])
self.assertIn('deviceId', all_alarms[0])
self.assertIn('alarmCategoryDesc', all_alarms[0])
self.assertIn('originalType', all_alarms[0])
self.assertIn('ackStatusDesc', all_alarms[0])
self.assertIn('recTimeDesc', all_alarms[0])
self.assertIn('alarmDesc', all_alarms[0])
self.assertIn('deviceIp', all_alarms[0])
self.assertIn('recStatusDesc', all_alarms[0])
self.assertIn('alarmLevel', all_alarms[0])
self.assertIn('ackTime', all_alarms[0])
self.assertIn('alarmDetail', all_alarms[0])
self.assertIn('remark', all_alarms[0])
self.assertIn('ackTimeDesc', all_alarms[0])
self.assertIn('originalTypeDesc', all_alarms[0])
self.assertIn('alarmLevelDesc', all_alarms[0])
self.assertIn('recStatus', all_alarms[0])
self.assertIn('deviceName', all_alarms[0])
self.assertIn('faultTime', all_alarms[0])
self.assertIn('faultTimeDesc', all_alarms[0])
self.assertIn('somState', all_alarms[0])
self.assertIn('id', all_alarms[0])
self.assertIn('OID', all_alarms[0])
self.assertIn('paras', all_alarms[0])
self.assertIn('recTime', all_alarms[0])
self.assertIn('ackUserName', all_alarms[0])
#self.assertIn('holdInfo', all_alarms[0])
"""
| 40.958333 | 85 | 0.664496 | 619 | 4,915 | 5.072698 | 0.151858 | 0.252229 | 0.260828 | 0.350955 | 0.780892 | 0.157962 | 0.116561 | 0.116561 | 0.112102 | 0.112102 | 0 | 0.022704 | 0.193489 | 4,915 | 119 | 86 | 41.302521 | 0.769425 | 0.080773 | 0 | 0.08 | 0 | 0 | 0.1445 | 0 | 0 | 0 | 0 | 0.016807 | 0.74 | 1 | 0.08 | false | 0 | 0.06 | 0 | 0.18 | 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 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6f2351022eca0ea190842a60fea7cf80b78b7b8d | 736 | py | Python | modules/dbnd-airflow/src/dbnd_airflow/constants.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | null | null | null | modules/dbnd-airflow/src/dbnd_airflow/constants.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | null | null | null | modules/dbnd-airflow/src/dbnd_airflow/constants.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | null | null | null | from distutils.version import LooseVersion
import airflow
AIRFLOW_VERSION_BEFORE_2_2 = LooseVersion(airflow.version.version) < LooseVersion(
"2.2.0"
)
AIRFLOW_VERSION_2 = LooseVersion(airflow.version.version) >= LooseVersion("2.0.0")
AIRFLOW_VERSION_1 = LooseVersion(airflow.version.version) < LooseVersion("2.0.0")
AIRFLOW_ABOVE_13 = LooseVersion(airflow.version.version) > LooseVersion("1.10.13")
AIRFLOW_ABOVE_10 = LooseVersion(airflow.version.version) > LooseVersion("1.10.10")
AIRFLOW_ABOVE_9 = LooseVersion(airflow.version.version) > LooseVersion("1.10.9")
AIRFLOW_ABOVE_6 = LooseVersion(airflow.version.version) > LooseVersion("1.10.6")
AIRFLOW_BELOW_10 = LooseVersion(airflow.version.version) < LooseVersion("1.10.10")
| 40.888889 | 82 | 0.789402 | 97 | 736 | 5.804124 | 0.164948 | 0.273535 | 0.369449 | 0.468917 | 0.721137 | 0.721137 | 0.721137 | 0.380107 | 0.380107 | 0 | 0 | 0.064801 | 0.077446 | 736 | 17 | 83 | 43.294118 | 0.764359 | 0 | 0 | 0 | 0 | 0 | 0.065217 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6f639e2089d65f807b856b00d67ebeb64a8cf989 | 80 | py | Python | bubble-sort/__init__.py | 9andresc/dena | 9315905c7e597344fa2c33773bf875cdaf38021f | [
"MIT"
] | null | null | null | bubble-sort/__init__.py | 9andresc/dena | 9315905c7e597344fa2c33773bf875cdaf38021f | [
"MIT"
] | 18 | 2019-01-24T21:19:11.000Z | 2019-02-08T19:25:49.000Z | bubble-sort/__init__.py | 9andresc/dsna | 9315905c7e597344fa2c33773bf875cdaf38021f | [
"MIT"
] | null | null | null | from .iterative import bsi as iterative
from .recursive import bsr as recursive
| 26.666667 | 39 | 0.825 | 12 | 80 | 5.5 | 0.583333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 80 | 2 | 40 | 40 | 0.970588 | 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 |
489fb25beddddd6b3f496ea780a2bc142e4de546 | 225 | py | Python | app/users/admin.py | Lockers13/Dublink-Bus | e837140a3dec5920cd9156bf0a943faf4e337051 | [
"MIT"
] | null | null | null | app/users/admin.py | Lockers13/Dublink-Bus | e837140a3dec5920cd9156bf0a943faf4e337051 | [
"MIT"
] | 2 | 2021-06-09T18:05:57.000Z | 2021-09-22T19:33:49.000Z | app/users/admin.py | Lockers13/Dublink-Bus | e837140a3dec5920cd9156bf0a943faf4e337051 | [
"MIT"
] | 1 | 2021-02-07T11:37:46.000Z | 2021-02-07T11:37:46.000Z | from django.contrib import admin
from .models import Profile, FavStop, FavAddress, PlannedJourney
admin.site.register(Profile)
admin.site.register(FavStop)
admin.site.register(FavAddress)
admin.site.register(PlannedJourney)
| 28.125 | 64 | 0.835556 | 28 | 225 | 6.714286 | 0.428571 | 0.191489 | 0.361702 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071111 | 225 | 7 | 65 | 32.142857 | 0.899522 | 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 |
48b17735d7aadd13aef9e4d8a8d68eba35e27c70 | 70 | py | Python | pgAdmin/pkg/docker/run_pgadmin.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pkg/docker/run_pgadmin.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pkg/docker/run_pgadmin.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | import builtins
builtins.SERVER_MODE = True
from pgAdmin4 import app
| 14 | 27 | 0.828571 | 10 | 70 | 5.7 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016667 | 0.142857 | 70 | 4 | 28 | 17.5 | 0.933333 | 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 |
5b04637746214168626e196d9e78f08f96a1b076 | 69 | py | Python | datacleanertableau/datacleanertableau/__init__.py | benMiniconi/realEstateScrapper | 79bc05e61dc8c5d4c9717df12a8e0509f5d05747 | [
"MIT"
] | null | null | null | datacleanertableau/datacleanertableau/__init__.py | benMiniconi/realEstateScrapper | 79bc05e61dc8c5d4c9717df12a8e0509f5d05747 | [
"MIT"
] | null | null | null | datacleanertableau/datacleanertableau/__init__.py | benMiniconi/realEstateScrapper | 79bc05e61dc8c5d4c9717df12a8e0509f5d05747 | [
"MIT"
] | null | null | null | from .cleanupmodule import *
from .SubModules.commitscleaner import * | 34.5 | 40 | 0.826087 | 7 | 69 | 8.142857 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101449 | 69 | 2 | 40 | 34.5 | 0.919355 | 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 |
5b08b2f104f060527d3abce27aa6a71d8510fb37 | 54 | py | Python | safebox/settings/__init__.py | Marcos-Costa/safebox | 1034d4b81315e385b1d0bf6861baf1aedf810037 | [
"MIT"
] | 6 | 2018-05-10T19:49:55.000Z | 2020-07-29T03:01:32.000Z | safebox/settings/__init__.py | Marcos-Costa/safebox | 1034d4b81315e385b1d0bf6861baf1aedf810037 | [
"MIT"
] | 11 | 2018-02-17T13:18:35.000Z | 2018-05-18T21:59:49.000Z | safebox/settings/__init__.py | Marcos-Costa/safebox | 1034d4b81315e385b1d0bf6861baf1aedf810037 | [
"MIT"
] | null | null | null | from .production import *
#from .development import *
| 18 | 27 | 0.759259 | 6 | 54 | 6.833333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 54 | 2 | 28 | 27 | 0.891304 | 0.481481 | 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 |
d291062024cd6bd6fa46c0f482d82a2c5936c35c | 56 | py | Python | tf/compose/__init__.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | null | null | null | tf/compose/__init__.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | null | null | null | tf/compose/__init__.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | 1 | 2020-01-22T13:13:30.000Z | 2020-01-22T13:13:30.000Z | from .modify import modify
from .combine import combine
| 18.666667 | 28 | 0.821429 | 8 | 56 | 5.75 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 56 | 2 | 29 | 28 | 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 |
d2a078a447aeefafc222972a9868ad8acc1e7f72 | 3,393 | py | Python | cogs/Reddit.py | Artnoobbr/Rubix | f87fe5c27ab2e4b92dde326d5e83d3a5ce817de4 | [
"MIT"
] | null | null | null | cogs/Reddit.py | Artnoobbr/Rubix | f87fe5c27ab2e4b92dde326d5e83d3a5ce817de4 | [
"MIT"
] | null | null | null | cogs/Reddit.py | Artnoobbr/Rubix | f87fe5c27ab2e4b92dde326d5e83d3a5ce817de4 | [
"MIT"
] | null | null | null | import discord
from discord import message
from discord.ext import commands
from datetime import datetime
import random
import asyncpraw
reddit = asyncpraw.Reddit(
client_id="CLIENTID",
client_secret="CLIENTSECRET",
user_agent="Rubix",
)
class reddit_command(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(name='brasil')
@commands.cooldown(1, 5, commands.BucketType.guild)
async def brasil(self, context):
await context.message.delete()
msg = await context.send('Carregando meme...')
subreddit = await reddit.subreddit("MemesBrasil")
lista_subs = []
top = subreddit.top(limit = 250)
async for submission in top:
lista_subs.append(submission)
submission_aleatoria = random.choice(lista_subs)
nome = submission_aleatoria.title
link = submission_aleatoria.url
author = submission_aleatoria.author
embed = discord.Embed(title=f'{nome}', color=discord.Color.random(), timestamp=datetime.utcnow(), url=link)
embed.set_image(url=link)
embed.set_footer(text=f"Distribuido pelo r/MemesBrasil! | Autor do Post: {author}")
await context.send(embed=embed)
await msg.edit(content='Aqui está! :white_check_mark:')
@commands.command(name='meme')
@commands.cooldown(1, 5, commands.BucketType.guild)
async def meme(self, context):
await context.message.delete()
msg = await context.send('Carregando meme...')
subreddit = await reddit.subreddit("Memes")
lista_subs = []
top = subreddit.top(limit = 350)
async for submission in top:
lista_subs.append(submission)
submission_aleatoria = random.choice(lista_subs)
nome = submission_aleatoria.title
link = submission_aleatoria.url
author = submission_aleatoria.author
embed = discord.Embed(title=f'{nome}', color=discord.Color.random(), timestamp=datetime.utcnow(), url=link)
embed.set_image(url=link)
embed.set_footer(text=f"Distribuido pelo r/Memes! | Autor do Post: {author}")
await context.send(embed=embed)
await msg.edit(content='Aqui está! :white_check_mark:')
@commands.command(name='smile')
@commands.cooldown(1, 5, commands.BucketType.guild)
async def smile(self, context):
await context.message.delete()
msg = await context.send('Pegando alguma postagem...')
subreddit = await reddit.subreddit("MadeMeSmile")
lista_subs = []
top = subreddit.top(limit = 200)
async for submission in top:
lista_subs.append(submission)
submission_aleatoria = random.choice(lista_subs)
nome = submission_aleatoria.title
link = submission_aleatoria.url
author = submission_aleatoria.author
embed = discord.Embed(title=f'{nome}',color=discord.Color.random(), timestamp=datetime.utcnow(), url=link)
embed.set_image(url=link)
embed.set_footer(text=f"Distribuido pelo r/MadeMeSmile! | Autor do Post: {author}")
await context.send(embed=embed)
await msg.edit(content='Aqui está! :white_check_mark:')
def setup(client):
client.add_cog(reddit_command(client))
| 35.715789 | 116 | 0.649573 | 389 | 3,393 | 5.55527 | 0.228792 | 0.105507 | 0.044424 | 0.041647 | 0.78621 | 0.78621 | 0.745951 | 0.745951 | 0.745951 | 0.677927 | 0 | 0.005832 | 0.241969 | 3,393 | 94 | 117 | 36.095745 | 0.83437 | 0 | 0 | 0.561644 | 0 | 0 | 0.120946 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.027397 | false | 0 | 0.082192 | 0 | 0.123288 | 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 |
d2a303e99b96f89cad2694fef0e5ec373c907317 | 245 | py | Python | ois_api_client/v3_0/namespaces.py | peterkulik/ois_api_client | 51dabcc9f920f89982c4419bb058f5a88193cee0 | [
"MIT"
] | 7 | 2020-10-22T08:15:29.000Z | 2022-01-27T07:59:39.000Z | ois_api_client/v3_0/namespaces.py | peterkulik/ois_api_client | 51dabcc9f920f89982c4419bb058f5a88193cee0 | [
"MIT"
] | null | null | null | ois_api_client/v3_0/namespaces.py | peterkulik/ois_api_client | 51dabcc9f920f89982c4419bb058f5a88193cee0 | [
"MIT"
] | null | null | null | ANNUL = 'http://schemas.nav.gov.hu/OSA/3.0/annul'
API = 'http://schemas.nav.gov.hu/OSA/3.0/api'
BASE = 'http://schemas.nav.gov.hu/OSA/3.0/base'
COMMON = 'http://schemas.nav.gov.hu/NTCA/1.0/common'
DATA = 'http://schemas.nav.gov.hu/OSA/3.0/data'
| 40.833333 | 52 | 0.673469 | 50 | 245 | 3.3 | 0.3 | 0.333333 | 0.424242 | 0.515152 | 0.69697 | 0.581818 | 0.581818 | 0.581818 | 0 | 0 | 0 | 0.043478 | 0.061224 | 245 | 5 | 53 | 49 | 0.673913 | 0 | 0 | 0 | 0 | 0 | 0.787755 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d2c80184b0d46aa867ddc0fbcdcf4aabcf07cd6c | 85 | py | Python | src/design/admin.py | maumg1196/GearDesign | 35aaeaab9b0eaa187c585fe68242cfa8bd3de9a7 | [
"MIT"
] | null | null | null | src/design/admin.py | maumg1196/GearDesign | 35aaeaab9b0eaa187c585fe68242cfa8bd3de9a7 | [
"MIT"
] | null | null | null | src/design/admin.py | maumg1196/GearDesign | 35aaeaab9b0eaa187c585fe68242cfa8bd3de9a7 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Gear
admin.site.register(Gear)
| 17 | 32 | 0.811765 | 13 | 85 | 5.307692 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 85 | 4 | 33 | 21.25 | 0.92 | 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 |
d2de77b6efa50b07083319a492a77bf715b8348a | 129 | py | Python | scripts/bdf_to_hc.py | projectitis/mac | ea3d23f3352f6e193f23ffb7e3f296f4485e8501 | [
"MIT"
] | 1 | 2022-03-26T22:10:18.000Z | 2022-03-26T22:10:18.000Z | scripts/bdf_to_hc.py | projectitis/mac | ea3d23f3352f6e193f23ffb7e3f296f4485e8501 | [
"MIT"
] | 52 | 2021-05-26T08:10:45.000Z | 2022-03-30T07:23:51.000Z | scripts/bdf_to_hc.py | projectitis/mac | ea3d23f3352f6e193f23ffb7e3f296f4485e8501 | [
"MIT"
] | null | null | null | from glob import glob
from os import path
from PIL import Image
###
### Compile BDF fonts to c header files
###
import bdf_to_h
| 14.333333 | 39 | 0.736434 | 23 | 129 | 4.043478 | 0.652174 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.193798 | 129 | 8 | 40 | 16.125 | 0.894231 | 0.271318 | 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 |
8248e5a88eabd8c505bacf049bc5d57bc6c60fdf | 67 | py | Python | apps/ImageSearch/algs/LassoNN/__init__.py | AmFamMLTeam/NEXT | 2b604230395be1b98e84115c20b5f509d5f24411 | [
"Apache-2.0"
] | 2 | 2020-11-16T17:01:36.000Z | 2022-03-04T17:07:59.000Z | apps/ImageSearch/algs/LassoNN/__init__.py | AmFamMLTeam/NEXT | 2b604230395be1b98e84115c20b5f509d5f24411 | [
"Apache-2.0"
] | null | null | null | apps/ImageSearch/algs/LassoNN/__init__.py | AmFamMLTeam/NEXT | 2b604230395be1b98e84115c20b5f509d5f24411 | [
"Apache-2.0"
] | null | null | null | from apps.ImageSearch.algs.LassoNN.LassoNN import LassoNN as MyAlg
| 33.5 | 66 | 0.850746 | 10 | 67 | 5.7 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.089552 | 67 | 1 | 67 | 67 | 0.934426 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 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 |
7d5cb268e73d90b9c90cace95ed68aec0b3fa0ca | 221 | py | Python | bank_diary/classifier/single.py | hgminh95/bank-diary | 4082dd10a6ade0369fa86ae971fbdbe056b50a8a | [
"MIT"
] | 1 | 2018-05-21T08:20:36.000Z | 2018-05-21T08:20:36.000Z | bank_diary/classifier/single.py | hgminh95/bank-diary | 4082dd10a6ade0369fa86ae971fbdbe056b50a8a | [
"MIT"
] | null | null | null | bank_diary/classifier/single.py | hgminh95/bank-diary | 4082dd10a6ade0369fa86ae971fbdbe056b50a8a | [
"MIT"
] | null | null | null | class Classifier(object):
def __init__(self, category, func):
self.category = category
self.func = func
def classify(self, trans):
return self.category if self.func(trans) else 'unknown'
| 24.555556 | 63 | 0.651584 | 27 | 221 | 5.185185 | 0.518519 | 0.257143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.248869 | 221 | 8 | 64 | 27.625 | 0.843373 | 0 | 0 | 0 | 0 | 0 | 0.031674 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.166667 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 5 |
7dd4798db75e7e1eddfb3a9e298ffc3a915a52cb | 6,998 | py | Python | turngeneration/tasks.py | jbradberry/django-turn-generation | dbfec9d0addbff2d8d54597b7520e171938c9107 | [
"MIT"
] | null | null | null | turngeneration/tasks.py | jbradberry/django-turn-generation | dbfec9d0addbff2d8d54597b7520e171938c9107 | [
"MIT"
] | null | null | null | turngeneration/tasks.py | jbradberry/django-turn-generation | dbfec9d0addbff2d8d54597b7520e171938c9107 | [
"MIT"
] | 1 | 2019-12-12T19:36:15.000Z | 2019-12-12T19:36:15.000Z | from django.conf import settings
from celery import shared_task, current_app
from celery.utils.log import get_task_logger
import datetime
logger = get_task_logger(__name__)
# TODO: implement signal listeners for changes to Generator, GenerationRule, and Ready
@shared_task(bind=True)
def timed_generation(self, pk):
from . import models, plugins
try:
generator = models.Generator.objects.get(pk=pk)
realm_type = generator.content_type
realm = generator.realm
except Exception as e:
logger.exception("Failed timed_generation(pk={pk}).".format(pk=pk))
raise
logger.info(
"Beginning timed generation on {app}.{model}(pk={pk}).".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
# Lock against another task generating on the same Generator.
if not models.Generator.objects.filter(
pk=pk, generating=False).update(generating=True):
logger.warning(
"Generation already in progress on {app}.{model}(pk={pk}),"
" aborting.".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
# Any update of the generator or firing of a new task should
# be dealt with by the task holding the lock.
return
if not generator.force_generate:
logger.info(
"Force-generation is disabled on {app}.{model}(pk={pk}),"
" aborting.".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
# No need to fire off a new task, since force-generations will
# be disabled until the boolean is cleared, and then the
# overriden save method will handle it.
models.Generator.objects.filter(pk=pk).update(generating=False,
task_id='',
generation_time=None)
return
if generator.allow_pauses and generator.pauses.exists():
logger.info(
"Pauses in effect on {app}.{model}(pk={pk}), aborting.".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
# If the generator is paused, don't bother creating a new timed task.
# It'll get picked back up when the pause is cancelled.
models.Generator.objects.filter(pk=pk).update(generating=False,
task_id='',
generation_time=None)
return
generate = True
now = datetime.datetime.utcnow()
last = generator.last_generation
if last and last + generator.minimum_between_generations > now:
logger.info(
"Insufficient time since last generation on {app}.{model}(pk={pk})"
", aborting.".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
generate = False
if generate:
try:
plugin = plugins.get_plugin_for_model(realm)
plugin.force_generate(realm)
except Exception as e:
# TODO: consider doing a transaction rollback here
logger.exception(
"Generation failed on {app}.{model}(pk={pk}).".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
generate = False
else:
generator.timestamps.create()
generator.readies.all().delete()
task_id = ''
eta = generator.next_time()
if eta is not None:
task_id = timed_generation.apply_async((pk,), eta=eta).id
models.Generator.objects.filter(pk=pk).update(generating=False,
task_id=task_id,
generation_time=eta)
if generate:
logger.info(
"Ending timed generation on {app}.{model}(pk={pk}).".format(
app=realm_type.app_label, model=realm_type.model, pk=pk)
)
@shared_task(bind=True)
def ready_generation(self, pk):
from . import models, plugins
try:
generator = models.Generator.objects.get(pk=pk)
realm_type = generator.content_type
realm = generator.realm
except Exception as e:
logger.exception("Failed timed_generation(pk={pk}).".format(pk=pk))
raise
logger.info(
"Beginning auto-generation on {app}.{model}(pk={pk}).".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
# Lock against another task generating on the same Generator.
if not models.Generator.objects.filter(
pk=pk, generating=False).update(generating=True):
logger.warning(
"Generation already in progress on {app}.{model}(pk={pk}),"
" aborting.".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
# Any update of the generator or firing of a new task should
# be dealt with by the task holding the lock.
return
if not generator.autogenerate:
logger.info(
"Auto-generation not permitted on {app}.{model}(pk={pk}),"
" aborting.".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
models.Generator.objects.filter(pk=pk).update(generating=False)
return
try:
if not generator.is_ready():
logger.info(
"Not ready for auto-generation on {app}.{model}(pk={pk}),"
" aborting.".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
models.Generator.objects.filter(pk=pk).update(generating=False)
return
plugin = plugins.get_plugin_for_model(realm)
plugin.auto_generate(realm)
except Exception as e:
# TODO: consider doing a transaction rollback here
logger.exception(
"Generation failed on {app}.{model}(pk={pk}).".format(
app=realm_type.app_label, model=realm_type.model, pk=realm.pk)
)
models.Generator.objects.filter(pk=pk).update(generating=False)
return
generator.timestamps.create()
generator.readies.all().delete()
task_id, eta = '', None
if generator.force_generate:
eta = generator.next_time()
if eta is not None:
task_id = timed_generation.apply_async((pk,), eta=eta).id
current_app.control.revoke(generator.task_id)
models.Generator.objects.filter(pk=pk).update(generating=False,
task_id=task_id,
generation_time=eta)
logger.info(
"Ending auto-generation on {app}.{model}(pk={pk}).".format(
app=realm_type.app_label, model=realm_type.model, pk=pk)
)
| 37.223404 | 86 | 0.590597 | 833 | 6,998 | 4.846339 | 0.178872 | 0.029725 | 0.033441 | 0.038643 | 0.769879 | 0.759475 | 0.759475 | 0.758484 | 0.738172 | 0.738172 | 0 | 0 | 0.306516 | 6,998 | 187 | 87 | 37.42246 | 0.831857 | 0.112032 | 0 | 0.6875 | 0 | 0 | 0.131957 | 0.056461 | 0 | 0 | 0 | 0.005348 | 0 | 1 | 0.013889 | false | 0 | 0.041667 | 0 | 0.104167 | 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 |
8151f028a02e14c7bd49e64c9ac7984f041efdad | 93 | py | Python | app/schema/__init__.py | ben-hunter-hansen/matrix-api | c9e3eea937d116bc8d9c2aeb6c587e9c3d8c46c3 | [
"MIT"
] | null | null | null | app/schema/__init__.py | ben-hunter-hansen/matrix-api | c9e3eea937d116bc8d9c2aeb6c587e9c3d8c46c3 | [
"MIT"
] | null | null | null | app/schema/__init__.py | ben-hunter-hansen/matrix-api | c9e3eea937d116bc8d9c2aeb6c587e9c3d8c46c3 | [
"MIT"
] | null | null | null | from .binaryop import binaryop
from .unaryop import unaryop
from .dimension import dimension
| 23.25 | 32 | 0.83871 | 12 | 93 | 6.5 | 0.416667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129032 | 93 | 3 | 33 | 31 | 0.962963 | 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 |
817343660d497c6de82aecefc947f37707641d12 | 119 | py | Python | pytest_dynaconf.py | singingwolfboy/pytest-dynaconf | 83dd44d08785a618780598617c76ec206be9bdd7 | [
"MIT"
] | 3 | 2021-12-20T21:08:21.000Z | 2022-03-11T14:38:52.000Z | pytest_dynaconf.py | singingwolfboy/pytest-dynaconf | 83dd44d08785a618780598617c76ec206be9bdd7 | [
"MIT"
] | 1 | 2021-12-21T02:03:10.000Z | 2021-12-21T02:03:34.000Z | pytest_dynaconf.py | singingwolfboy/pytest-dynaconf | 83dd44d08785a618780598617c76ec206be9bdd7 | [
"MIT"
] | null | null | null | from dynaconf import settings
def pytest_configure(config):
settings.configure(FORCE_ENV_FOR_DYNACONF="testing")
| 19.833333 | 56 | 0.815126 | 15 | 119 | 6.2 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.109244 | 119 | 5 | 57 | 23.8 | 0.877358 | 0 | 0 | 0 | 0 | 0 | 0.058824 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
8183eea7779b9bd334f52c69e08c4812238d88e9 | 47 | py | Python | elasticfeeds/network/__init__.py | qlands/elasticfeeds | a1c41a31d56b082cb57c52768ea290abb925d812 | [
"BSD-3-Clause"
] | 15 | 2018-12-18T00:36:55.000Z | 2021-08-30T02:30:00.000Z | elasticfeeds/network/__init__.py | qlands/elasticfeeds | a1c41a31d56b082cb57c52768ea290abb925d812 | [
"BSD-3-Clause"
] | null | null | null | elasticfeeds/network/__init__.py | qlands/elasticfeeds | a1c41a31d56b082cb57c52768ea290abb925d812 | [
"BSD-3-Clause"
] | 3 | 2019-10-18T14:21:30.000Z | 2021-05-22T18:31:39.000Z | from .network import *
from .activity import *
| 15.666667 | 23 | 0.744681 | 6 | 47 | 5.833333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170213 | 47 | 2 | 24 | 23.5 | 0.897436 | 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 |
8194182b802dc1690bb2da6103665c5391bcec74 | 2,504 | py | Python | test/test_aio_chapter_list.py | simonsmh/dcdownloader | 28908919bbb687f284f7e8298fdb4c6f01600e9a | [
"MIT"
] | null | null | null | test/test_aio_chapter_list.py | simonsmh/dcdownloader | 28908919bbb687f284f7e8298fdb4c6f01600e9a | [
"MIT"
] | null | null | null | test/test_aio_chapter_list.py | simonsmh/dcdownloader | 28908919bbb687f284f7e8298fdb4c6f01600e9a | [
"MIT"
] | null | null | null | from test.bootstrap import dcdownloader
import dcdownloader.aio_chapter_list as aio_chapter_list
def test_parse_comic_chapter_list():
true_result = ('kanon & AIR', {'14话': 'https://manhua.dmzj.com/kanonair/734.shtml', '06话': 'https://manhua.dmzj.com/kanonair/726.shtml', '04话': 'https://manhua.dmzj.com/kanonair/724.shtml', '07话': 'https://manhua.dmzj.com/kanonair/727.shtml', '03话': 'https://manhua.dmzj.com/kanonair/723.shtml', '05话': 'https://manhua.dmzj.com/kanonair/725.shtml', '11话': 'https://manhua.dmzj.com/kanonair/731.shtml', '09话': 'https://manhua.dmzj.com/kanonair/729.shtml', '10话': 'https://manhua.dmzj.com/kanonair/730.shtml', '01话': 'https://manhua.dmzj.com/kanonair/721.shtml', '12话': 'https://manhua.dmzj.com/kanonair/732.shtml', '02话': 'https://manhua.dmzj.com/kanonair/722.shtml', '13话': 'https://manhua.dmzj.com/kanonair/733.shtml', '08话': 'https://manhua.dmzj.com/kanonair/728.shtml'})
ret = aio_chapter_list.parse_comic_chapter_list('https://manhua.dmzj.com/kanonair/')
assert ret == true_result
def test_fetch_all_image_list():
true_result = {'01话': ['https://images.dmzj.com/k/konanair/01/001.jpg', 'https://images.dmzj.com/k/konanair/01/002.jpg', 'https://images.dmzj.com/k/konanair/01/003.jpg', 'https://images.dmzj.com/k/konanair/01/004.jpg', 'https://images.dmzj.com/k/konanair/01/005.jpg', 'https://images.dmzj.com/k/konanair/01/006.jpg', 'https://images.dmzj.com/k/konanair/01/007.jpg', 'https://images.dmzj.com/k/konanair/01/008.jpg', 'https://images.dmzj.com/k/konanair/01/009.jpg', 'https://images.dmzj.com/k/konanair/01/010.jpg', 'https://images.dmzj.com/k/konanair/01/011.jpg', 'https://images.dmzj.com/k/konanair/01/012.jpg', 'https://images.dmzj.com/k/konanair/01/013.jpg', 'https://images.dmzj.com/k/konanair/01/014.jpg', 'https://images.dmzj.com/k/konanair/01/015.jpg', 'https://images.dmzj.com/k/konanair/01/016.jpg', 'https://images.dmzj.com/k/konanair/01/017.jpg', 'https://images.dmzj.com/k/konanair/01/018.jpg', 'https://images.dmzj.com/k/konanair/01/019.jpg', 'https://images.dmzj.com/k/konanair/01/020.jpg', 'https://images.dmzj.com/k/konanair/01/021.jpg', 'https://images.dmzj.com/k/konanair/01/022.jpg', 'https://images.dmzj.com/k/konanair/01/023.jpg', 'https://images.dmzj.com/k/konanair/01/024.jpg', 'https://images.dmzj.com/k/konanair/01/025.jpg', 'https://images.dmzj.com/k/konanair/01/026.jpg']}
ret = aio_chapter_list.fetch_all_image_list({'01话': 'https://manhua.dmzj.com/kanonair/721.shtml'})
assert ret == true_result | 156.5 | 1,301 | 0.716054 | 416 | 2,504 | 4.247596 | 0.206731 | 0.166384 | 0.220713 | 0.264856 | 0.717035 | 0.511036 | 0.511036 | 0.494624 | 0 | 0 | 0 | 0.086756 | 0.047125 | 2,504 | 16 | 1,302 | 156.5 | 0.653814 | 0 | 0 | 0.2 | 0 | 0 | 0.755289 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
81965bb55015920bb2feae9fed4e4fd877fb5d2e | 220 | py | Python | src/adguardhome/__init__.py | CBS2606/python-adguardhome | d7454ff7eb9917e67882e5c969444bf7810f0bfd | [
"MIT"
] | 54 | 2019-05-26T14:20:44.000Z | 2022-03-12T19:35:17.000Z | src/adguardhome/__init__.py | CBS2606/python-adguardhome | d7454ff7eb9917e67882e5c969444bf7810f0bfd | [
"MIT"
] | 455 | 2019-06-06T19:14:49.000Z | 2022-03-30T07:20:00.000Z | src/adguardhome/__init__.py | CBS2606/python-adguardhome | d7454ff7eb9917e67882e5c969444bf7810f0bfd | [
"MIT"
] | 21 | 2019-06-06T19:06:20.000Z | 2022-02-16T18:09:37.000Z | """Asynchronous Python client for the AdGuard Home API."""
from .adguardhome import AdGuardHome, AdGuardHomeConnectionError, AdGuardHomeError
__all__ = ["AdGuardHome", "AdGuardHomeConnectionError", "AdGuardHomeError"]
| 36.666667 | 82 | 0.809091 | 18 | 220 | 9.666667 | 0.777778 | 0.425287 | 0.609195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095455 | 220 | 5 | 83 | 44 | 0.874372 | 0.236364 | 0 | 0 | 0 | 0 | 0.32716 | 0.160494 | 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 |
c4be0666f0868760bc5f8644f325b97752e9e31e | 12,464 | py | Python | tests/commands/test_list.py | alisaifee/aredis | c5764a5a2a29c4ed25278548aa54eece94974440 | [
"MIT"
] | null | null | null | tests/commands/test_list.py | alisaifee/aredis | c5764a5a2a29c4ed25278548aa54eece94974440 | [
"MIT"
] | null | null | null | tests/commands/test_list.py | alisaifee/aredis | c5764a5a2a29c4ed25278548aa54eece94974440 | [
"MIT"
] | null | null | null | from __future__ import annotations
import asyncio
import pytest
from coredis import PureToken
from tests.conftest import targets
@targets(
"redis_basic",
"redis_basic_raw",
"redis_basic_resp3",
"redis_basic_raw_resp3",
"redis_cluster",
"keydb",
)
@pytest.mark.asyncio()
class TestList:
async def test_large_list(self, client, _s):
ints = [int(i) for i in range(10000)]
assert await client.lpush("a{foo}", ints)
assert len(set(await client.lrange("a{foo}", 0, -1))) == 10000
async def test_blpop(self, client, _s):
await client.rpush("a{foo}", ["1", "2"])
await client.rpush("b{foo}", ["3", "4"])
assert await client.blpop(["b{foo}", "a{foo}"], timeout=1) == [
_s("b{foo}"),
_s("3"),
]
assert await client.blpop(["b{foo}", "a{foo}"], timeout=1) == [
_s("b{foo}"),
_s("4"),
]
assert await client.blpop(["b{foo}", "a{foo}"], timeout=1) == [
_s("a{foo}"),
_s("1"),
]
assert await client.blpop(["b{foo}", "a{foo}"], timeout=1) == [
_s("a{foo}"),
_s("2"),
]
assert await client.blpop(["b{foo}", "a{foo}"], timeout=1) is None
await client.rpush("c{foo}", ["1"])
assert await client.blpop(["c{foo}"], timeout=1) == [_s("c{foo}"), _s("1")]
@pytest.mark.min_server_version("7.0.0")
async def test_lmpop(self, client, _s):
await client.rpush("a{foo}", [1, 2, 3])
await client.rpush("b{foo}", [4, 5, 6])
result = await client.lmpop(["a{foo}", "b{foo}"], PureToken.LEFT)
assert result[0] == _s("a{foo}")
assert result[1] == [_s("1")]
result = await client.lmpop(["a{foo}", "b{foo}"], PureToken.LEFT, count=2)
assert result[0] == _s("a{foo}")
assert result[1] == [_s("2"), _s("3")]
result = await client.lmpop(["a{foo}", "b{foo}"], PureToken.RIGHT)
assert result[0] == _s("b{foo}")
assert result[1] == [_s("6")]
async def test_brpop(self, client, _s):
await client.rpush("a{foo}", ["1", "2"])
await client.rpush("b{foo}", ["3", "4"])
assert await client.brpop(["b{foo}", "a{foo}"], timeout=1) == [
_s("b{foo}"),
_s("4"),
]
assert await client.brpop(["b{foo}", "a{foo}"], timeout=1) == [
_s("b{foo}"),
_s("3"),
]
assert await client.brpop(["b{foo}", "a{foo}"], timeout=1) == [
_s("a{foo}"),
_s("2"),
]
assert await client.brpop(["b{foo}", "a{foo}"], timeout=1) == [
_s("a{foo}"),
_s("1"),
]
assert await client.brpop(["b{foo}", "a{foo}"], timeout=1) is None
await client.rpush("c{foo}", ["1"])
assert await client.brpop(["c{foo}"], timeout=1) == [_s("c{foo}"), _s("1")]
async def test_brpoplpush(self, client, _s):
await client.rpush("a", ["1", "2"])
await client.rpush("b", ["3", "4"])
assert await client.brpoplpush("a", "b", timeout=1) == _s("2")
assert await client.brpoplpush("a", "b", timeout=1) == _s("1")
assert await client.brpoplpush("a", "b", timeout=1) is None
assert await client.lrange("a", 0, -1) == []
assert await client.lrange("b", 0, -1) == [_s("1"), _s("2"), _s("3"), _s("4")]
async def test_brpoplpush_empty_string(self, client, _s):
await client.rpush("a", [""])
assert await client.brpoplpush("a", "b", timeout=1) == _s("")
async def test_lindex(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.lindex("a", 0) == _s("1")
assert await client.lindex("a", 1) == _s("2")
assert await client.lindex("a", 2) == _s("3")
assert await client.lindex("a", 10) is None
async def test_linsert(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.linsert("a", PureToken.AFTER, "2", "2.5") == 4
assert await client.lrange("a", 0, -1) == [_s("1"), _s("2"), _s("2.5"), _s("3")]
assert await client.linsert("a", PureToken.BEFORE, "2", "1.5") == 5
assert await client.lrange("a", 0, -1) == [
_s("1"),
_s("1.5"),
_s("2"),
_s("2.5"),
_s("3"),
]
async def test_llen(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.llen("a") == 3
async def test_lpop(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.lpop("a") == _s("1")
assert await client.lpop("a") == _s("2")
assert await client.lpop("a") == _s("3")
assert await client.lpop("a") is None
@pytest.mark.min_server_version("6.2.0")
async def test_lpop_count(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.lpop("a", 3) == [_s("1"), _s("2"), _s("3")]
async def test_lpush(self, client, _s):
assert await client.lpush("a", ["1"]) == 1
assert await client.lpush("a", ["2"]) == 2
assert await client.lpush("a", ["3", "4"]) == 4
assert await client.lrange("a", 0, -1) == [_s("4"), _s("3"), _s("2"), _s("1")]
async def test_lpushx(self, client, _s):
assert await client.lpushx("a", ["1"]) == 0
assert await client.lrange("a", 0, -1) == []
await client.rpush("a", ["1", "2", "3"])
assert await client.lpushx("a", ["4"]) == 4
assert await client.lrange("a", 0, -1) == [_s("4"), _s("1"), _s("2"), _s("3")]
async def test_lrange(self, client, _s):
await client.rpush("a", ["1", "2", "3", "4", "5"])
assert await client.lrange("a", 0, 2) == [_s("1"), _s("2"), _s("3")]
assert await client.lrange("a", 2, 10) == [_s("3"), _s("4"), _s("5")]
assert await client.lrange("a", 0, -1) == [
_s("1"),
_s("2"),
_s("3"),
_s("4"),
_s("5"),
]
async def test_lrem(self, client, _s):
await client.rpush("a", ["1", "1", "1", "1"])
assert await client.lrem("a", 1, "1") == 1
assert await client.lrange("a", 0, -1) == [_s("1"), _s("1"), _s("1")]
assert await client.lrem("a", 3, "1") == 3
assert await client.lrange("a", 0, -1) == []
async def test_lset(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.lrange("a", 0, -1) == [_s("1"), _s("2"), _s("3")]
assert await client.lset("a", 1, "4")
assert await client.lrange("a", 0, 2) == [_s("1"), _s("4"), _s("3")]
async def test_ltrim(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.ltrim("a", 0, 1)
assert await client.lrange("a", 0, -1) == [_s("1"), _s("2")]
async def test_rpop(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.rpop("a") == _s("3")
assert await client.rpop("a") == _s("2")
assert await client.rpop("a") == _s("1")
assert await client.rpop("a") is None
@pytest.mark.min_server_version("6.2.0")
async def test_rpop_count(self, client, _s):
await client.rpush("a", ["1", "2", "3"])
assert await client.rpop("a", 3) == [_s("3"), _s("2"), _s("1")]
async def test_rpoplpush(self, client, _s):
await client.rpush("a", ["a1", "a2", "a3"])
await client.rpush("b", ["b1", "b2", "b3"])
assert await client.rpoplpush("a", "b") == _s("a3")
assert await client.lrange("a", 0, -1) == [_s("a1"), _s("a2")]
assert await client.lrange("b", 0, -1) == [
_s("a3"),
_s("b1"),
_s("b2"),
_s("b3"),
]
async def test_rpush(self, client, _s):
assert await client.rpush("a", ["1"]) == 1
assert await client.rpush("a", ["2"]) == 2
assert await client.rpush("a", ["3", "4"]) == 4
assert await client.lrange("a", 0, -1) == [_s("1"), _s("2"), _s("3"), _s("4")]
async def test_rpushx(self, client, _s):
assert await client.rpushx("a", ["b"]) == 0
assert await client.lrange("a", 0, -1) == []
await client.rpush("a", ["1", "2", "3"])
assert await client.rpushx("a", ["4"]) == 4
assert await client.lrange("a", 0, -1) == [_s("1"), _s("2"), _s("3"), _s("4")]
@pytest.mark.min_server_version("6.0.6")
async def test_lpos(self, client, _s):
assert await client.rpush("a", ["a", "b", "c", "1", "2", "3", "c", "c"]) == 8
assert await client.lpos("a", "a") == 0
assert await client.lpos("a", "c") == 2
assert await client.lpos("a", "c", rank=1) == 2
assert await client.lpos("a", "c", rank=2) == 6
assert await client.lpos("a", "c", rank=4) is None
assert await client.lpos("a", "c", rank=-1) == 7
assert await client.lpos("a", "c", rank=-2) == 6
assert await client.lpos("a", "c", count=0) == [2, 6, 7]
assert await client.lpos("a", "c", count=1) == [2]
assert await client.lpos("a", "c", count=2) == [2, 6]
assert await client.lpos("a", "c", count=100) == [2, 6, 7]
assert await client.lpos("a", "c", count=0, rank=2) == [6, 7]
assert await client.lpos("a", "c", count=2, rank=-1) == [7, 6]
assert await client.lpos("axxx", "c", count=0, rank=2) == []
assert await client.lpos("axxx", "c") is None
assert await client.lpos("a", "x", count=2) == []
assert await client.lpos("a", "x") is None
assert await client.lpos("a", "a", count=0, maxlen=1) == [0]
assert await client.lpos("a", "c", count=0, maxlen=1) == []
assert await client.lpos("a", "c", count=0, maxlen=3) == [2]
assert await client.lpos("a", "c", count=0, maxlen=3, rank=-1) == [7, 6]
assert await client.lpos("a", "c", count=0, maxlen=7, rank=2) == [6]
@pytest.mark.min_server_version("6.2.0")
async def test_lmove(self, client, _s):
await client.rpush("a{foo}", ["one", "two", "three", "four"])
assert await client.lmove("a{foo}", "b{foo}", PureToken.LEFT, PureToken.RIGHT)
assert await client.lmove("a{foo}", "b{foo}", PureToken.RIGHT, PureToken.LEFT)
@pytest.mark.min_server_version("7.0.0")
@pytest.mark.nocluster
async def test_blmpop(self, client, _s):
await client.rpush("a{foo}", [1, 2, 3])
await client.rpush("b{foo}", [4, 5, 6])
result = await client.blmpop(["a{foo}", "b{foo}"], 1, PureToken.LEFT)
assert result[0] == _s("a{foo}")
assert result[1] == [_s("1")]
result = await client.blmpop(["a{foo}", "b{foo}"], 1, PureToken.LEFT, count=2)
assert result[0] == _s("a{foo}")
assert result[1] == [_s("2"), _s("3")]
result = await client.blmpop(["a{foo}", "b{foo}"], 1, PureToken.RIGHT)
assert result[0] == _s("b{foo}")
assert result[1] == [_s("6")]
async def _delayadd():
await asyncio.sleep(0.1)
return await client.rpush("a{foo}", ["42"])
result = await asyncio.gather(
client.blmpop(["a{foo}"], 1, PureToken.LEFT), _delayadd()
)
assert result[0][1] == [_s("42")]
@pytest.mark.min_server_version("6.2.0")
async def test_blmove(self, client, _s):
await client.rpush("a{foo}", ["one", "two", "three", "four"])
assert await client.blmove(
"a{foo}", "b{foo}", PureToken.LEFT, PureToken.RIGHT, timeout=5
)
assert await client.blmove(
"a{foo}", "b{foo}", PureToken.RIGHT, PureToken.LEFT, timeout=1
)
async def test_binary_lists(self, client, _s):
mapping = {
"foo bar": ["1", "2", "3"],
"foo\r\nbar\r\n": ["4", "5", "6"],
"foo\tbar\x07": ["7", "8", "9"],
}
# fill in lists
for key, value in mapping.items():
await client.rpush(key, value)
# check that KEYS returns all the keys as they are
assert sorted(await client.keys("*")) == [
_s(k) for k in sorted(list(iter(mapping.keys())))
]
# check that it is possible to get list content by key name
for key, value in mapping.items():
assert await client.lrange(key, 0, -1) == [_s(v) for v in value]
| 40.599349 | 88 | 0.507461 | 1,792 | 12,464 | 3.416853 | 0.080357 | 0.246121 | 0.269312 | 0.074963 | 0.800425 | 0.766944 | 0.673689 | 0.63041 | 0.549567 | 0.462518 | 0 | 0.044649 | 0.266849 | 12,464 | 306 | 89 | 40.732026 | 0.62541 | 0.009628 | 0 | 0.323077 | 0 | 0 | 0.078849 | 0.001702 | 0 | 0 | 0 | 0 | 0.430769 | 1 | 0 | false | 0 | 0.019231 | 0 | 0.026923 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
c4c20707ce5696dbc52c87f58d7151c93707cbe1 | 789 | py | Python | pereval/filters.py | r2r2/FSTR | 024cd61f46f781f02850b3ea85fe10863159e5dc | [
"BSD-3-Clause"
] | null | null | null | pereval/filters.py | r2r2/FSTR | 024cd61f46f781f02850b3ea85fe10863159e5dc | [
"BSD-3-Clause"
] | null | null | null | pereval/filters.py | r2r2/FSTR | 024cd61f46f781f02850b3ea85fe10863159e5dc | [
"BSD-3-Clause"
] | null | null | null | from django_filters import rest_framework as filters
from pereval.models import Added
class CharFilterInFilter(filters.BaseInFilter, filters.CharFilter):
pass
class UserProfileFilter(filters.FilterSet):
"""Фильтрации по данным пользователя (ФИО, телефон, почта)"""
name = CharFilterInFilter(field_name='user__name', lookup_expr='in', label='Имя')
fam = CharFilterInFilter(field_name='user__fam', lookup_expr='in', label='Фамилия')
otc = CharFilterInFilter(field_name='user__otc', lookup_expr='in', label='Отчество')
phone = CharFilterInFilter(field_name='user__phone', lookup_expr='in', label='Телефон')
email = CharFilterInFilter(field_name='user__email', lookup_expr='in', label='email')
class Meta:
model = Added
fields = ('user',)
| 37.571429 | 91 | 0.735108 | 92 | 789 | 6.065217 | 0.445652 | 0.206093 | 0.241935 | 0.277778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139417 | 789 | 20 | 92 | 39.45 | 0.821797 | 0.069708 | 0 | 0 | 0 | 0 | 0.129121 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.076923 | 0.153846 | 0 | 0.769231 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
c4c7524b4bb3eb95ed31b23cf41b62ea4ae0dcf7 | 45 | py | Python | src/dual_quaternions/__init__.py | Achllle/dual_quaternions | d5e36549ec9532719791b6c9bf15983ffaea9a2e | [
"MIT"
] | 29 | 2020-06-13T12:18:26.000Z | 2022-02-05T23:41:12.000Z | src/dual_quaternions/__init__.py | orcilano/dual_quaternions | d5e36549ec9532719791b6c9bf15983ffaea9a2e | [
"MIT"
] | 4 | 2020-05-29T19:21:55.000Z | 2021-04-08T18:58:22.000Z | src/dual_quaternions/__init__.py | orcilano/dual_quaternions | d5e36549ec9532719791b6c9bf15983ffaea9a2e | [
"MIT"
] | 3 | 2020-05-15T22:42:04.000Z | 2021-06-20T06:38:54.000Z | from .dual_quaternions import DualQuaternion
| 22.5 | 44 | 0.888889 | 5 | 45 | 7.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088889 | 45 | 1 | 45 | 45 | 0.95122 | 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 |
c4d5684743688239ca8df0bd5f36902c0e6e6c88 | 132 | py | Python | cryptounifier_python_sdk/__init__.py | ben-amara/cryptounifier_python_sdk | 3ea64f4449fd4ed5e044b6d651d5e8c57fcf5b10 | [
"MIT"
] | null | null | null | cryptounifier_python_sdk/__init__.py | ben-amara/cryptounifier_python_sdk | 3ea64f4449fd4ed5e044b6d651d5e8c57fcf5b10 | [
"MIT"
] | null | null | null | cryptounifier_python_sdk/__init__.py | ben-amara/cryptounifier_python_sdk | 3ea64f4449fd4ed5e044b6d651d5e8c57fcf5b10 | [
"MIT"
] | null | null | null |
# Package version
from .MerchantAPI import MerchantAPI
from .WalletAPI import WalletAPI
from .WalletTokenAPI import WalletTokenAPI | 22 | 42 | 0.848485 | 14 | 132 | 8 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 132 | 6 | 42 | 22 | 0.965517 | 0.113636 | 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 |
c4ebaa3377154577f1b5b962d74e82083f86c979 | 32 | py | Python | hasura/__init__.py | shahidhk/hasura-python | bbbfbf78ecae4821b581db9ab20f148b60f562a9 | [
"MIT"
] | 6 | 2017-01-19T18:38:41.000Z | 2021-08-24T14:48:38.000Z | hasura/__init__.py | shahidhk/hasura-python | bbbfbf78ecae4821b581db9ab20f148b60f562a9 | [
"MIT"
] | 1 | 2020-06-04T18:55:50.000Z | 2020-06-04T18:55:50.000Z | hasura/__init__.py | shahidhk/hasura-python | bbbfbf78ecae4821b581db9ab20f148b60f562a9 | [
"MIT"
] | 2 | 2017-08-12T21:31:39.000Z | 2020-09-19T22:47:54.000Z | from .hasura_base import Hasura
| 16 | 31 | 0.84375 | 5 | 32 | 5.2 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 32 | 1 | 32 | 32 | 0.928571 | 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 |
f217ce1b0bde25b2e70c7dc7524d4631a6d48415 | 135 | py | Python | magpie/montecarlo/__init__.py | knaidoo29/magpie | efab3c2666aab2c928ca12a631758bc1b43c149c | [
"MIT"
] | null | null | null | magpie/montecarlo/__init__.py | knaidoo29/magpie | efab3c2666aab2c928ca12a631758bc1b43c149c | [
"MIT"
] | null | null | null | magpie/montecarlo/__init__.py | knaidoo29/magpie | efab3c2666aab2c928ca12a631758bc1b43c149c | [
"MIT"
] | null | null | null |
from .box2ring import Box2Ring
from .cube2shell import Cube2Shell
from .heal2ring import Heal2Ring
from .heal2polar import Heal2Polar
| 22.5 | 34 | 0.844444 | 16 | 135 | 7.125 | 0.375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.067797 | 0.125926 | 135 | 5 | 35 | 27 | 0.898305 | 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 |
f2271774add87aa676223d9ceb1af9714abbcf6c | 507 | py | Python | tests/conftest.py | TeoZosa/simple-atm-controller | 3906591b81a53de29dc77a99f0beff86cd5857ce | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | TeoZosa/simple-atm-controller | 3906591b81a53de29dc77a99f0beff86cd5857ce | [
"Apache-2.0"
] | 192 | 2021-05-02T23:19:13.000Z | 2022-03-29T13:20:09.000Z | tests/conftest.py | TeoZosa/simple-atm-controller | 3906591b81a53de29dc77a99f0beff86cd5857ce | [
"Apache-2.0"
] | null | null | null | # Silence spurious `config` fixture false-positives
# pylint: disable=unused-argument
def pytest_emoji_passed(config):
return "✅ ", "PASSED ✅ "
def pytest_emoji_failed(config):
return "❌ ", "FAILED ❌ "
def pytest_emoji_skipped(config):
return "🙈 ", "SKIPPED 🙈 "
def pytest_emoji_error(config):
return "🚫 ", "ERROR 🚫 "
def pytest_emoji_xfailed(config):
return "❎️ ", "XFAIL ❎️ "
def pytest_emoji_xpassed(config):
return "⛔️ ", "XPASS ⛔️ "
# pylint: enable=unused-argument
| 18.107143 | 51 | 0.66075 | 68 | 507 | 4.985294 | 0.426471 | 0.159292 | 0.247788 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189349 | 507 | 27 | 52 | 18.777778 | 0.785888 | 0.220907 | 0 | 0 | 0 | 0 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0.333333 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 5 |
48240a6a5449ad07b6d4901deda523c8eb8d0d51 | 134 | py | Python | kpolyakov_parsing/src/kpolyakov_parsing/_output_dumping/html_dumping/__init__.py | SteamPeKa/scripts_for_Aecatta | f9481b2b8c1f6c8d5be1c426ba5a54f82eb4ff82 | [
"MIT"
] | null | null | null | kpolyakov_parsing/src/kpolyakov_parsing/_output_dumping/html_dumping/__init__.py | SteamPeKa/scripts_for_Aecatta | f9481b2b8c1f6c8d5be1c426ba5a54f82eb4ff82 | [
"MIT"
] | null | null | null | kpolyakov_parsing/src/kpolyakov_parsing/_output_dumping/html_dumping/__init__.py | SteamPeKa/scripts_for_Aecatta | f9481b2b8c1f6c8d5be1c426ba5a54f82eb4ff82 | [
"MIT"
] | null | null | null | # coding=utf-8
# Creation date: 10 дек. 2020
# Creation time: 12:28
# Creator: SteamPeKa
from .tree_building import dump_to_html_text
| 22.333333 | 44 | 0.768657 | 22 | 134 | 4.5 | 0.954545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095652 | 0.141791 | 134 | 5 | 45 | 26.8 | 0.765217 | 0.597015 | 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 |
484700f8c62a8e97ccea392aa7e206dc214bfe80 | 8,875 | py | Python | torchcv/models/ssd/net.py | CVHj/torchcv | 6291f3e1e4bbf6467fd6b1e79001d34a59481bb6 | [
"MIT"
] | 433 | 2017-11-30T15:46:58.000Z | 2022-01-16T08:06:11.000Z | torchcv/models/ssd/net.py | CVHj/torchcv | 6291f3e1e4bbf6467fd6b1e79001d34a59481bb6 | [
"MIT"
] | 51 | 2018-01-29T15:14:33.000Z | 2021-08-23T12:02:18.000Z | fpn-hoi/torchcv/models/ssd/net.py | TheFairBear/Box-Attention-SSD-HOI | 6101e209a709899c5645342784c8f451028ff46e | [
"MIT"
] | 92 | 2018-01-20T07:45:36.000Z | 2021-05-28T10:43:53.000Z | '''SSD model with VGG16 as feature extractor.'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class VGG16(nn.Module):
def __init__(self):
super(VGG16, self).__init__()
self.layers = self._make_layers()
def forward(self, x):
y = self.layers(x)
return y
def _make_layers(self):
'''VGG16 layers.'''
cfg = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512]
layers = []
in_channels = 3
for x in cfg:
if x == 'M':
layers += [nn.MaxPool2d(kernel_size=2, stride=2, ceil_mode=True)]
else:
layers += [nn.Conv2d(in_channels, x, kernel_size=3, padding=1),
nn.ReLU(True)]
in_channels = x
return nn.Sequential(*layers)
class L2Norm(nn.Module):
'''L2Norm layer across all channels.'''
def __init__(self, in_features, scale):
super(L2Norm, self).__init__()
self.weight = nn.Parameter(torch.Tensor(in_features))
self.reset_parameters(scale)
def reset_parameters(self, scale):
nn.init.constant(self.weight, scale)
def forward(self, x):
x = F.normalize(x, dim=1)
scale = self.weight[None,:,None,None]
return scale * x
class VGG16Extractor300(nn.Module):
def __init__(self):
super(VGG16Extractor300, self).__init__()
self.features = VGG16()
self.norm4 = L2Norm(512, 20)
self.conv5_1 = nn.Conv2d(512, 512, kernel_size=3, padding=1, dilation=1)
self.conv5_2 = nn.Conv2d(512, 512, kernel_size=3, padding=1, dilation=1)
self.conv5_3 = nn.Conv2d(512, 512, kernel_size=3, padding=1, dilation=1)
self.conv6 = nn.Conv2d(512, 1024, kernel_size=3, padding=6, dilation=6)
self.conv7 = nn.Conv2d(1024, 1024, kernel_size=1)
self.conv8_1 = nn.Conv2d(1024, 256, kernel_size=1)
self.conv8_2 = nn.Conv2d(256, 512, kernel_size=3, stride=2, padding=1)
self.conv9_1 = nn.Conv2d(512, 128, kernel_size=1)
self.conv9_2 = nn.Conv2d(128, 256, kernel_size=3, stride=2, padding=1)
self.conv10_1 = nn.Conv2d(256, 128, kernel_size=1)
self.conv10_2 = nn.Conv2d(128, 256, kernel_size=3)
self.conv11_1 = nn.Conv2d(256, 128, kernel_size=1)
self.conv11_2 = nn.Conv2d(128, 256, kernel_size=3)
def forward(self, x):
hs = []
h = self.features(x)
hs.append(self.norm4(h)) # conv4_3
h = F.max_pool2d(h, kernel_size=2, stride=2, ceil_mode=True)
h = F.relu(self.conv5_1(h))
h = F.relu(self.conv5_2(h))
h = F.relu(self.conv5_3(h))
h = F.max_pool2d(h, kernel_size=3, stride=1, padding=1, ceil_mode=True)
h = F.relu(self.conv6(h))
h = F.relu(self.conv7(h))
hs.append(h) # conv7
h = F.relu(self.conv8_1(h))
h = F.relu(self.conv8_2(h))
hs.append(h) # conv8_2
h = F.relu(self.conv9_1(h))
h = F.relu(self.conv9_2(h))
hs.append(h) # conv9_2
h = F.relu(self.conv10_1(h))
h = F.relu(self.conv10_2(h))
hs.append(h) # conv10_2
h = F.relu(self.conv11_1(h))
h = F.relu(self.conv11_2(h))
hs.append(h) # conv11_2
return hs
class SSD300(nn.Module):
steps = (8, 16, 32, 64, 100, 300)
box_sizes = (30, 60, 111, 162, 213, 264, 315) # default bounding box sizes for each feature map.
aspect_ratios = ((2,), (2,3), (2,3), (2,3), (2,), (2,))
fm_sizes = (38, 19, 10, 5, 3, 1)
def __init__(self, num_classes):
super(SSD300, self).__init__()
self.num_classes = num_classes
self.num_anchors = (4, 6, 6, 6, 4, 4)
self.in_channels = (512, 1024, 512, 256, 256, 256)
self.extractor = VGG16Extractor300()
self.loc_layers = nn.ModuleList()
self.cls_layers = nn.ModuleList()
for i in range(len(self.in_channels)):
self.loc_layers += [nn.Conv2d(self.in_channels[i], self.num_anchors[i]*4, kernel_size=3, padding=1)]
self.cls_layers += [nn.Conv2d(self.in_channels[i], self.num_anchors[i]*self.num_classes, kernel_size=3, padding=1)]
def forward(self, x):
loc_preds = []
cls_preds = []
xs = self.extractor(x)
for i, x in enumerate(xs):
loc_pred = self.loc_layers[i](x)
loc_pred = loc_pred.permute(0,2,3,1).contiguous()
loc_preds.append(loc_pred.view(loc_pred.size(0),-1,4))
cls_pred = self.cls_layers[i](x)
cls_pred = cls_pred.permute(0,2,3,1).contiguous()
cls_preds.append(cls_pred.view(cls_pred.size(0),-1,self.num_classes))
loc_preds = torch.cat(loc_preds, 1)
cls_preds = torch.cat(cls_preds, 1)
return loc_preds, cls_preds
class VGG16Extractor512(nn.Module):
def __init__(self):
super(VGG16Extractor512, self).__init__()
self.features = VGG16()
self.norm4 = L2Norm(512, 20)
self.conv5_1 = nn.Conv2d(512, 512, kernel_size=3, padding=1, dilation=1)
self.conv5_2 = nn.Conv2d(512, 512, kernel_size=3, padding=1, dilation=1)
self.conv5_3 = nn.Conv2d(512, 512, kernel_size=3, padding=1, dilation=1)
self.conv6 = nn.Conv2d(512, 1024, kernel_size=3, padding=6, dilation=6)
self.conv7 = nn.Conv2d(1024, 1024, kernel_size=1)
self.conv8_1 = nn.Conv2d(1024, 256, kernel_size=1)
self.conv8_2 = nn.Conv2d(256, 512, kernel_size=3, padding=1, stride=2)
self.conv9_1 = nn.Conv2d(512, 128, kernel_size=1)
self.conv9_2 = nn.Conv2d(128, 256, kernel_size=3, padding=1, stride=2)
self.conv10_1 = nn.Conv2d(256, 128, kernel_size=1)
self.conv10_2 = nn.Conv2d(128, 256, kernel_size=3, padding=1, stride=2)
self.conv11_1 = nn.Conv2d(256, 128, kernel_size=1)
self.conv11_2 = nn.Conv2d(128, 256, kernel_size=3, padding=1, stride=2)
self.conv12_1 = nn.Conv2d(256, 128, kernel_size=1)
self.conv12_2 = nn.Conv2d(128, 256, kernel_size=4, padding=1)
def forward(self, x):
hs = []
h = self.features(x)
hs.append(self.norm4(h)) # conv4_3
h = F.max_pool2d(h, kernel_size=2, stride=2, ceil_mode=True)
h = F.relu(self.conv5_1(h))
h = F.relu(self.conv5_2(h))
h = F.relu(self.conv5_3(h))
h = F.max_pool2d(h, kernel_size=3, padding=1, stride=1, ceil_mode=True)
h = F.relu(self.conv6(h))
h = F.relu(self.conv7(h))
hs.append(h) # conv7
h = F.relu(self.conv8_1(h))
h = F.relu(self.conv8_2(h))
hs.append(h) # conv8_2
h = F.relu(self.conv9_1(h))
h = F.relu(self.conv9_2(h))
hs.append(h) # conv9_2
h = F.relu(self.conv10_1(h))
h = F.relu(self.conv10_2(h))
hs.append(h) # conv10_2
h = F.relu(self.conv11_1(h))
h = F.relu(self.conv11_2(h))
hs.append(h) # conv11_2
h = F.relu(self.conv12_1(h))
h = F.relu(self.conv12_2(h))
hs.append(h) # conv12_2
return hs
class SSD512(nn.Module):
steps = (8, 16, 32, 64, 128, 256, 512)
box_sizes = (35.84, 76.8, 153.6, 230.4, 307.2, 384.0, 460.8, 537.6) # default bounding box sizes for each feature map.
aspect_ratios = ((2,), (2, 3), (2, 3), (2, 3), (2, 3), (2,), (2,))
fm_sizes = (64, 32, 16, 8, 4, 2, 1)
def __init__(self, num_classes):
super(SSD512, self).__init__()
self.num_classes = num_classes
self.num_anchors = (4, 6, 6, 6, 6, 4, 4)
self.in_channels = (512, 1024, 512, 256, 256, 256, 256)
self.extractor = VGG16Extractor512()
self.loc_layers = nn.ModuleList()
self.cls_layers = nn.ModuleList()
for i in range(len(self.in_channels)):
self.loc_layers += [nn.Conv2d(self.in_channels[i], self.num_anchors[i]*4, kernel_size=3, padding=1)]
self.cls_layers += [nn.Conv2d(self.in_channels[i], self.num_anchors[i]*self.num_classes, kernel_size=3, padding=1)]
def forward(self, x):
loc_preds = []
cls_preds = []
xs = self.extractor(x)
for i, x in enumerate(xs):
loc_pred = self.loc_layers[i](x)
loc_pred = loc_pred.permute(0,2,3,1).contiguous()
loc_preds.append(loc_pred.view(loc_pred.size(0),-1,4))
cls_pred = self.cls_layers[i](x)
cls_pred = cls_pred.permute(0,2,3,1).contiguous()
cls_preds.append(cls_pred.view(cls_pred.size(0),-1,self.num_classes))
loc_preds = torch.cat(loc_preds, 1)
cls_preds = torch.cat(cls_preds, 1)
return loc_preds, cls_preds
def test():
net = SSD300(21)
loc_preds, cls_preds = net(Variable(torch.randn(1,3,300,300)))
print(loc_preds.size(), cls_preds.size())
# test()
| 34.667969 | 124 | 0.590423 | 1,399 | 8,875 | 3.566119 | 0.106505 | 0.076168 | 0.033674 | 0.056123 | 0.787933 | 0.771698 | 0.750451 | 0.726599 | 0.711565 | 0.705552 | 0 | 0.116502 | 0.259155 | 8,875 | 255 | 125 | 34.803922 | 0.642281 | 0.033915 | 0 | 0.624339 | 0 | 0 | 0.000468 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.079365 | false | 0 | 0.021164 | 0 | 0.21164 | 0.005291 | 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 |
484bf9c669d0ac5845a6a1bc38ad32a1ae479842 | 2,938 | py | Python | python/okapi/proto/okapi/security/v1/__init__.py | tmarkovski/okapi | 1ce36d2a82bb0e409a5183cd116d3a9eb474fc9f | [
"Apache-2.0"
] | 9 | 2021-05-11T07:54:49.000Z | 2022-01-26T17:56:48.000Z | python/okapi/proto/okapi/security/v1/__init__.py | tmarkovski/okapi | 1ce36d2a82bb0e409a5183cd116d3a9eb474fc9f | [
"Apache-2.0"
] | 265 | 2021-05-06T12:22:13.000Z | 2022-03-31T23:59:58.000Z | python/okapi/proto/okapi/security/v1/__init__.py | tmarkovski/okapi | 1ce36d2a82bb0e409a5183cd116d3a9eb474fc9f | [
"Apache-2.0"
] | 5 | 2021-06-04T00:15:57.000Z | 2022-02-13T00:08:13.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: okapi/security/v1/security.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
@dataclass(eq=False, repr=False)
class CreateOberonKeyRequest(betterproto.Message):
"""Create an Oberon Compatible Secret Key"""
seed: bytes = betterproto.bytes_field(1)
@dataclass(eq=False, repr=False)
class CreateOberonKeyResponse(betterproto.Message):
"""Contains the oberon secret key bytes"""
sk: bytes = betterproto.bytes_field(2)
pk: bytes = betterproto.bytes_field(3)
@dataclass(eq=False, repr=False)
class CreateOberonTokenRequest(betterproto.Message):
"""Create a new oberon token"""
sk: bytes = betterproto.bytes_field(1)
data: bytes = betterproto.bytes_field(2)
blinding: List[bytes] = betterproto.bytes_field(3)
@dataclass(eq=False, repr=False)
class CreateOberonTokenResponse(betterproto.Message):
"""Contains the token with optional blinding"""
token: bytes = betterproto.bytes_field(1)
@dataclass(eq=False, repr=False)
class CreateOberonProofRequest(betterproto.Message):
"""Create a proof that holder knows the token"""
data: bytes = betterproto.bytes_field(1)
token: bytes = betterproto.bytes_field(2)
blinding: List[bytes] = betterproto.bytes_field(3)
nonce: bytes = betterproto.bytes_field(4)
@dataclass(eq=False, repr=False)
class CreateOberonProofResponse(betterproto.Message):
"""Contains the token proof"""
proof: bytes = betterproto.bytes_field(2)
@dataclass(eq=False, repr=False)
class VerifyOberonProofRequest(betterproto.Message):
"""Verify the presented proof is valid"""
proof: bytes = betterproto.bytes_field(1)
data: bytes = betterproto.bytes_field(2)
nonce: bytes = betterproto.bytes_field(3)
pk: bytes = betterproto.bytes_field(4)
@dataclass(eq=False, repr=False)
class VerifyOberonProofResponse(betterproto.Message):
"""Contains the status of the proof validation"""
valid: bool = betterproto.bool_field(1)
@dataclass(eq=False, repr=False)
class BlindOberonTokenRequest(betterproto.Message):
"""Blind an oberon token"""
token: bytes = betterproto.bytes_field(1)
blinding: List[bytes] = betterproto.bytes_field(2)
@dataclass(eq=False, repr=False)
class BlindOberonTokenResponse(betterproto.Message):
"""Contains the blinded token reply"""
token: bytes = betterproto.bytes_field(1)
@dataclass(eq=False, repr=False)
class UnBlindOberonTokenRequest(betterproto.Message):
"""UnBlind an oberon token"""
token: bytes = betterproto.bytes_field(1)
blinding: List[bytes] = betterproto.bytes_field(2)
@dataclass(eq=False, repr=False)
class UnBlindOberonTokenResponse(betterproto.Message):
"""Contains the unblinded token reply"""
token: bytes = betterproto.bytes_field(1)
| 28.25 | 58 | 0.747107 | 351 | 2,938 | 6.185185 | 0.242165 | 0.162137 | 0.212805 | 0.263473 | 0.549056 | 0.463381 | 0.449562 | 0.449562 | 0.409028 | 0.409028 | 0 | 0.009509 | 0.140912 | 2,938 | 103 | 59 | 28.524272 | 0.850634 | 0.181076 | 0 | 0.45098 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.078431 | 0 | 0.764706 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
4852a43ee63d9ff2a9b862ce3529020db2211981 | 23,911 | py | Python | plugins/Config/test.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 476 | 2015-01-04T17:42:59.000Z | 2021-08-13T07:40:54.000Z | plugins/Config/test.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 491 | 2015-01-01T04:12:23.000Z | 2021-08-12T19:24:47.000Z | plugins/Config/test.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 203 | 2015-01-02T18:29:43.000Z | 2021-08-15T12:52:22.000Z | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James McCoy
# Copyright (c) 2010-2021, The Limnoria Contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions, and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the author of this software nor the name of
# contributors to this software may be used to endorse or promote products
# derived from this software without specific prior written consent.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
###
import random
from supybot.test import *
import supybot.conf as conf
_letters = 'abcdefghijklmnopqrstuvwxyz'
def random_string():
return ''.join(random.choice(_letters) for _ in range(16))
class ConfigTestCase(ChannelPluginTestCase):
# We add utilities so there's something in supybot.plugins.
plugins = ('Config', 'User', 'Utilities', 'Web')
prefix1 = 'somethingElse!user@host1.tld'
prefix2 = 'EvensomethingElse!user@host2.tld'
prefix3 = 'Completely!Different@host3.tld__no_testcap__'
def testGet(self):
self.assertNotRegexp('config get supybot.reply', r'registry\.Group')
self.assertResponse('config supybot.protocols.irc.throttleTime', '0.0')
def testList(self):
self.assertError('config list asldfkj')
self.assertError('config list supybot.asdfkjsldf')
self.assertNotError('config list supybot')
self.assertRegexp('config list supybot.replies', ', #:errorOwner, ')
self.assertRegexp('config list supybot', r'@plugins.*@replies.*@reply')
def testListExcludes(self):
"""Checks that 'config list' excludes pseudo-children of
network-specific and channel-specific variables."""
self.assertNotError(
'config channel #zpojfejf supybot.replies.error foo')
self.assertRegexp('config list supybot.replies.error',
"There don't seem to be any values")
def testHelp(self):
self.assertError('config help alsdkfj')
self.assertError('config help supybot.alsdkfj')
self.assertNotError('config help supybot') # We tell the user to list.
self.assertNotError('config help supybot.plugins')
self.assertNotError('config help supybot.replies.success')
self.assertNotError('config help replies.success')
def testHelpDoesNotAssertionError(self):
self.assertNotRegexp('config help ' # Cont'd.
'supybot.commands.defaultPlugins.help',
'AssertionError')
def testHelpExhaustively(self):
L = conf.supybot.getValues(getChildren=True)
for (name, v) in L:
self.assertNotError('config help %s' % name)
def testSearch(self):
self.assertRegexp(
'config search chars', 'supybot.reply.whenAddressedBy.chars')
self.assertNotError('config channel reply.whenAddressedBy.chars @')
self.assertNotRegexp('config search chars', self.channel)
def testSearchHelp(self):
self.assertRegexp(
'config searchhelp "what prefix characters"',
'supybot.reply.whenAddressedBy.chars')
self.assertNotError('config channel reply.whenAddressedBy.chars @')
self.assertNotRegexp(
'config searchhelp "what prefix characters"', self.channel)
def testSearchValues(self):
self.assertResponse(
'config searchvalues @@@',
'There were no matching configuration variables.')
self.assertNotError('config channel reply.whenAddressedBy.strings @@@')
self.assertResponse(
'config searchvalues @@@',
r'supybot.reply.whenAddressedBy.strings.#test and '
r'supybot.reply.whenAddressedBy.strings.\:test.#test')
def testDefault(self):
self.assertNotError('config default '
'supybot.replies.genericNoCapability')
def testConfigErrors(self):
self.assertRegexp('config supybot.replies.', 'not a valid')
self.assertRegexp('config supybot.repl', 'not a valid')
self.assertRegexp('config supybot.reply.withNickPrefix 123',
'True or False.*, not \'123\'.')
self.assertRegexp('config supybot.replies foo', 'settable')
def testReadOnly(self):
old_plugins_dirs = conf.supybot.directories.plugins()
try:
self.assertResponse('config supybot.commands.allowShell', 'True')
self.assertNotError('config supybot.directories.plugins dir1')
self.assertNotError('config supybot.commands.allowShell True')
self.assertResponse('config supybot.commands.allowShell', 'True')
self.assertResponse('config supybot.directories.plugins', 'dir1')
self.assertNotError('config supybot.commands.allowShell False')
self.assertResponse('config supybot.commands.allowShell', 'False')
self.assertRegexp('config supybot.directories.plugins dir2',
'Error.*not writeable')
self.assertResponse('config supybot.directories.plugins', 'dir1')
self.assertRegexp('config supybot.commands.allowShell True',
'Error.*not writeable')
self.assertResponse('config supybot.commands.allowShell', 'False')
self.assertRegexp('config commands.allowShell True',
'Error.*not writeable')
self.assertResponse('config supybot.commands.allowShell', 'False')
self.assertRegexp('config COMMANDS.ALLOWSHELL True',
'Error.*not writeable')
self.assertResponse('config supybot.commands.allowShell', 'False')
finally:
conf.supybot.commands.allowShell.setValue(True)
conf.supybot.directories.plugins.setValue(old_plugins_dirs)
def testOpEditable(self):
var_name = 'testOpEditable' + random_string()
conf.registerChannelValue(conf.supybot.plugins.Config, var_name,
registry.Integer(0, 'help'))
self.assertNotError('register bar passwd', frm=self.prefix3,
private=True)
self.assertRegexp('whoami', 'bar', frm=self.prefix3)
ircdb.users.getUser('bar').addCapability(self.channel + ',op')
self.assertRegexp('config plugins.Config.%s 1' % var_name,
'^Completely: Error: ',
frm=self.prefix3)
self.assertResponse('config plugins.Config.%s' % var_name,
'Global: 0; #test @ test: 0')
self.assertNotRegexp('config channel plugins.Config.%s 1' % var_name,
'^Completely: Error: ',
frm=self.prefix3)
self.assertResponse('config plugins.Config.%s' % var_name,
'Global: 0; #test @ test: 1')
def testOpNonEditable(self):
var_name = 'testOpNonEditable' + random_string()
conf.registerChannelValue(conf.supybot.plugins.Config, var_name,
registry.Integer(0, 'help'), opSettable=False)
self.assertNotError('register bar passwd', frm=self.prefix3,
private=True)
self.assertRegexp('whoami', 'bar', frm=self.prefix3)
ircdb.users.getUser('bar').addCapability(self.channel + ',op')
self.assertRegexp('config plugins.Config.%s 1' % var_name,
'^Completely: Error: ',
frm=self.prefix3)
self.assertResponse('config plugins.Config.%s' % var_name,
'Global: 0; #test @ test: 0')
self.assertRegexp('config channel plugins.Config.%s 1' % var_name,
'^Completely: Error: ',
frm=self.prefix3)
self.assertResponse('config plugins.Config.%s' % var_name,
'Global: 0; #test @ test: 0')
self.assertNotRegexp('config channel plugins.Config.%s 1' % var_name,
'^Completely: Error: ')
self.assertResponse('config plugins.Config.%s' % var_name,
'Global: 0; #test @ test: 1')
def testChannel(self):
try:
conf.supybot.reply.whenAddressedBy.strings.get(':test').unregister(self.channel)
conf.supybot.reply.whenAddressedBy.strings.unregister(':test')
conf.supybot.reply.whenAddressedBy.strings.unregister(self.channel)
except:
pass
self.assertResponse('config reply.whenAddressedBy.strings ^',
'The operation succeeded.')
self.assertResponse('config channel reply.whenAddressedBy.strings @',
'The operation succeeded.')
self.assertResponse('config channel reply.whenAddressedBy.strings', '@')
self.assertNotError('config channel reply.whenAddressedBy.strings $')
self.assertResponse('config channel #testchan1 reply.whenAddressedBy.strings', '^')
self.assertResponse('config channel #testchan2 reply.whenAddressedBy.strings', '^')
self.assertNotError('config channel #testchan1,#testchan2 reply.whenAddressedBy.strings .')
self.assertResponse('config channel reply.whenAddressedBy.strings', '$')
self.assertResponse('config channel #testchan1 reply.whenAddressedBy.strings', '.')
self.assertResponse('config channel #testchan2 reply.whenAddressedBy.strings', '.')
def testNetwork(self):
getTestIrc('testnet1')
getTestIrc('testnet2')
self.assertResponse('config reply.whenAddressedBy.strings ^',
'The operation succeeded.')
self.assertResponse('config network reply.whenAddressedBy.strings @',
'The operation succeeded.')
self.assertResponse('config network reply.whenAddressedBy.strings', '@')
self.assertNotError('config network reply.whenAddressedBy.strings $')
self.assertResponse('config network testnet1 reply.whenAddressedBy.strings', '^')
self.assertResponse('config network testnet2 reply.whenAddressedBy.strings', '^')
self.assertResponse('config network reply.whenAddressedBy.strings', '$')
self.assertResponse('config network testnet1 reply.whenAddressedBy.strings', '^')
self.assertResponse('config network testnet2 reply.whenAddressedBy.strings', '^')
self.assertNotError('config network testnet1 reply.whenAddressedBy.strings =')
self.assertResponse('config network testnet1 reply.whenAddressedBy.strings', '=')
self.assertResponse('config network testnet2 reply.whenAddressedBy.strings', '^')
def testChannelNetwork(self):
irc = self.irc
irc1 = getTestIrc('testnet1')
irc2 = getTestIrc('testnet2')
irc3 = getTestIrc('testnet3')
conf.supybot.reply.whenAddressedBy.strings.get('#test')._wasSet = False
# 1. Set global
self.assertResponse('config reply.whenAddressedBy.strings ^',
'The operation succeeded.')
# 2. Set for current net + #testchan1
self.assertResponse('config channel #testchan1 reply.whenAddressedBy.strings @',
'The operation succeeded.')
# Exact match for #2:
self.assertResponse('config channel #testchan1 reply.whenAddressedBy.strings', '@')
# 3: Set for #testchan1 for all nets:
self.assertNotError('config channel * #testchan1 reply.whenAddressedBy.strings $')
# Still exact match for #2:
self.assertResponse('config channel #testchan1 reply.whenAddressedBy.strings', '@')
# Inherit from *:
self.assertResponse('config channel testnet1 #testchan1 reply.whenAddressedBy.strings', '$')
self.assertResponse('config channel testnet2 #testchan1 reply.whenAddressedBy.strings', '$')
# 4: Set for testnet1 for #testchan1 and #testchan2:
self.assertNotError('config channel testnet1 #testchan1,#testchan2 reply.whenAddressedBy.strings .')
# 5: Set for testnet2 for #testchan1:
self.assertNotError('config channel testnet2 #testchan1 reply.whenAddressedBy.strings :')
# Inherit from global value (nothing was set of current net or current
# chan):
(old_channel, self.channel) = (self.channel, '#iejofjfozifk')
try:
self.assertResponse('config channel reply.whenAddressedBy.strings', '^')
finally:
self.channel = old_channel
# Still exact match for #2:
self.assertResponse('config channel #testchan1 reply.whenAddressedBy.strings', '@')
self.assertResponse('config channel %s #testchan1 reply.whenAddressedBy.strings' % irc.network, '@')
# Exact match for #4:
self.assertResponse('config channel testnet1 #testchan1 reply.whenAddressedBy.strings', '.')
self.assertResponse('config channel testnet1 #testchan2 reply.whenAddressedBy.strings', '.')
# Inherit from #5, which set for #testchan1 on all nets
self.assertResponse('config channel testnet3 #testchan1 reply.whenAddressedBy.strings', ':')
def testChannelInheritance(self):
try:
conf.supybot.reply.whenAddressedBy.strings.get(':test').unregister(self.channel)
conf.supybot.reply.whenAddressedBy.strings.unregister(':test')
conf.supybot.reply.whenAddressedBy.strings.unregister(self.channel)
except:
pass
self.assertResponse('config reply.whenAddressedBy.strings ^',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: ^; #test @ test: ^')
self.assertResponse('config channel reply.whenAddressedBy.strings', '^')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertFalse(
conf.supybot.reply.whenAddressedBy.strings.get(self.channel)._wasSet)
# Parent changes, child follows
self.assertResponse('config reply.whenAddressedBy.strings @',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: @; #test @ test: @')
self.assertResponse('config channel reply.whenAddressedBy.strings', '@')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertFalse(
conf.supybot.reply.whenAddressedBy.strings.get(self.channel)._wasSet)
# Child changes, parent keeps its value
self.assertResponse('config channel reply.whenAddressedBy.strings $',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: @; #test @ test: $')
self.assertResponse('config channel reply.whenAddressedBy.strings', '$')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings.get(self.channel)._wasSet)
# Parent changes, child keeps its value
self.assertResponse('config reply.whenAddressedBy.strings .',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: .; #test @ test: $')
self.assertResponse('config channel reply.whenAddressedBy.strings', '$')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings.get(self.channel)._wasSet)
def testResetChannel(self):
try:
conf.supybot.reply.whenAddressedBy.strings.get(':test').unregister(self.channel)
conf.supybot.reply.whenAddressedBy.strings.unregister(':test')
conf.supybot.reply.whenAddressedBy.strings.unregister(self.channel)
except:
pass
self.assertResponse('config reply.whenAddressedBy.strings ^',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: ^; #test @ test: ^')
self.assertResponse('config channel reply.whenAddressedBy.strings', '^')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertFalse(
conf.supybot.reply.whenAddressedBy.strings.get(self.channel)._wasSet)
# Child changes, parent keeps its value
self.assertResponse('config channel reply.whenAddressedBy.strings $',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: ^; #test @ test: $')
self.assertResponse('config channel reply.whenAddressedBy.strings', '$')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings.get(self.channel)._wasSet)
# Reset child
self.assertResponse('config reset channel reply.whenAddressedBy.strings',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: ^; #test @ test: ^')
self.assertResponse('config channel reply.whenAddressedBy.strings', '^')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertFalse(
conf.supybot.reply.whenAddressedBy.strings.get(self.channel)._wasSet)
# Parent changes, child follows
self.assertResponse('config reply.whenAddressedBy.strings .',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: .; #test @ test: .')
self.assertResponse('config channel reply.whenAddressedBy.strings', '.')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertFalse(
conf.supybot.reply.whenAddressedBy.strings.get(self.channel)._wasSet)
def testResetNetwork(self):
try:
conf.supybot.reply.whenAddressedBy.strings.unregister(':test')
except:
pass
self.assertResponse('config reply.whenAddressedBy.strings ^',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: ^; #test @ test: ^')
self.assertResponse('config network reply.whenAddressedBy.strings', '^')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertFalse(
conf.supybot.reply.whenAddressedBy.strings.get(':test')._wasSet)
# Child changes, parent keeps its value
self.assertResponse('config network reply.whenAddressedBy.strings $',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: ^; #test @ test: $')
self.assertResponse('config network reply.whenAddressedBy.strings', '$')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings.get(':test')._wasSet)
# Reset child
self.assertResponse('config reset network reply.whenAddressedBy.strings',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: ^; #test @ test: ^')
self.assertResponse('config network reply.whenAddressedBy.strings', '^')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertFalse(
conf.supybot.reply.whenAddressedBy.strings.get(':test')._wasSet)
# Parent changes, child follows
self.assertResponse('config reply.whenAddressedBy.strings .',
'The operation succeeded.')
self.assertResponse('config reply.whenAddressedBy.strings',
'Global: .; #test @ test: .')
self.assertResponse('config network reply.whenAddressedBy.strings', '.')
self.assertTrue(
conf.supybot.reply.whenAddressedBy.strings._wasSet)
self.assertFalse(
conf.supybot.reply.whenAddressedBy.strings.get(':test')._wasSet)
def testResetRegexpChannel(self):
"""Specifically tests resetting a Regexp value, as they have an extra
internal state that needs to be reset; see the comment in plugin.py"""
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp',
'Global: ; #test @ test: '
)
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp m/foo/',
'The operation succeeded.'
)
self.assertResponse(
'config channel plugins.Web.nonSnarfingRegexp m/bar/',
'The operation succeeded.'
)
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp',
'Global: m/foo/; #test @ test: m/bar/'
)
self.assertResponse(
'config reset channel plugins.Web.nonSnarfingRegexp',
'The operation succeeded.'
)
self.assertResponse('config plugins.Web.nonSnarfingRegexp',
'Global: m/foo/; #test @ test: m/foo/'
)
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp ""',
'The operation succeeded.'
)
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp',
'Global: ; #test @ test: '
)
def testResetRegexpNetwork(self):
"""Specifically tests resetting a Regexp value, as they have an extra
internal state that needs to be reset; see the comment in plugin.py"""
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp',
'Global: ; #test @ test: '
)
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp m/foo/',
'The operation succeeded.'
)
self.assertResponse(
'config network plugins.Web.nonSnarfingRegexp m/bar/',
'The operation succeeded.'
)
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp',
'Global: m/foo/; #test @ test: m/bar/'
)
self.assertResponse(
'config reset network plugins.Web.nonSnarfingRegexp',
'The operation succeeded.'
)
self.assertResponse('config plugins.Web.nonSnarfingRegexp',
'Global: m/foo/; #test @ test: m/foo/'
)
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp ""',
'The operation succeeded.'
)
self.assertResponse(
'config plugins.Web.nonSnarfingRegexp',
'Global: ; #test @ test: '
)
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
| 46.429126 | 108 | 0.652252 | 2,326 | 23,911 | 6.680997 | 0.150473 | 0.148005 | 0.192857 | 0.080952 | 0.75251 | 0.718597 | 0.701351 | 0.669884 | 0.651995 | 0.642535 | 0 | 0.007082 | 0.238259 | 23,911 | 514 | 109 | 46.519455 | 0.846107 | 0.117143 | 0 | 0.616967 | 0 | 0 | 0.388352 | 0.170199 | 0 | 0 | 0 | 0 | 0.449871 | 1 | 0.059126 | false | 0.015424 | 0.007712 | 0.002571 | 0.082262 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
6fabf24425581590bc43dc956869c59848377940 | 33 | py | Python | Assignment 2/Q4.py | korak1111/ECE457A | d8c14cfacdd88c0b15524adf5655021eb604d141 | [
"MIT"
] | null | null | null | Assignment 2/Q4.py | korak1111/ECE457A | d8c14cfacdd88c0b15524adf5655021eb604d141 | [
"MIT"
] | null | null | null | Assignment 2/Q4.py | korak1111/ECE457A | d8c14cfacdd88c0b15524adf5655021eb604d141 | [
"MIT"
] | null | null | null | import matplotlib
import numpy
| 6.6 | 17 | 0.818182 | 4 | 33 | 6.75 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 33 | 4 | 18 | 8.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.