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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e2c398247d72ea7b03405868894b4f8b37d6fba7 | 104 | py | Python | openmlcontrib/__init__.py | openml/openml-python-contrib | a3480b05483bd66e0fe42347b1f93261d7373ec9 | [
"Apache-2.0"
] | 1 | 2018-09-19T09:45:25.000Z | 2018-09-19T09:45:25.000Z | openmlcontrib/__init__.py | openml/openml-python-contrib | a3480b05483bd66e0fe42347b1f93261d7373ec9 | [
"Apache-2.0"
] | 2 | 2018-10-09T23:14:32.000Z | 2019-07-12T14:57:54.000Z | openmlcontrib/__init__.py | openml/openml-python-contrib | a3480b05483bd66e0fe42347b1f93261d7373ec9 | [
"Apache-2.0"
] | null | null | null | from . import legacy
from . import meta
from . import misc
from . import setups
__version__ = "0.0.1"
| 13 | 21 | 0.711538 | 16 | 104 | 4.375 | 0.5625 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036145 | 0.201923 | 104 | 7 | 22 | 14.857143 | 0.807229 | 0 | 0 | 0 | 0 | 0 | 0.048077 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.8 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
39055e23adbec6d971eecdee390be04b856a9958 | 154 | py | Python | fommia/data/dataset/__init__.py | JeanMaximilienCadic/first-order-model | 9701537625652bf821747c6c59fcfb026ac3fe82 | [
"MIT"
] | null | null | null | fommia/data/dataset/__init__.py | JeanMaximilienCadic/first-order-model | 9701537625652bf821747c6c59fcfb026ac3fe82 | [
"MIT"
] | null | null | null | fommia/data/dataset/__init__.py | JeanMaximilienCadic/first-order-model | 9701537625652bf821747c6c59fcfb026ac3fe82 | [
"MIT"
] | null | null | null | from .functional import *
from .frame_dataset import FramesDataset
from .dataset_repeater import DatasetRepeater
from .paired_dataset import PairedDataset | 38.5 | 45 | 0.87013 | 18 | 154 | 7.277778 | 0.555556 | 0.198473 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097403 | 154 | 4 | 46 | 38.5 | 0.942446 | 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 |
392d171f80e01e6ec39ac5a6d177132b25c369c9 | 72 | py | Python | test/test_main.py | gaianote/tinder | 7998f616d07659b9237d35b6a6384ab52ad4cf99 | [
"MIT"
] | null | null | null | test/test_main.py | gaianote/tinder | 7998f616d07659b9237d35b6a6384ab52ad4cf99 | [
"MIT"
] | null | null | null | test/test_main.py | gaianote/tinder | 7998f616d07659b9237d35b6a6384ab52ad4cf99 | [
"MIT"
] | null | null | null | from tinder.app import main
def test_app():
assert main() is None
| 12 | 27 | 0.694444 | 12 | 72 | 4.083333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 72 | 5 | 28 | 14.4 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0.333333 | true | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
1a44f5a1822f03f1a833308f189ae833999e581b | 64 | py | Python | mymodule.py | vanoudh/fire | ca5a482162b5462586707aec665cd09d55e5a5cc | [
"MIT"
] | null | null | null | mymodule.py | vanoudh/fire | ca5a482162b5462586707aec665cd09d55e5a5cc | [
"MIT"
] | null | null | null | mymodule.py | vanoudh/fire | ca5a482162b5462586707aec665cd09d55e5a5cc | [
"MIT"
] | null | null | null |
def myfunction():
print('mymodule was properly installed!') | 21.333333 | 45 | 0.71875 | 7 | 64 | 6.571429 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15625 | 64 | 3 | 45 | 21.333333 | 0.851852 | 0 | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0 | 0 | 0 | 0.5 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
1a6cb2b17071cc7324fddb5fe955a8819c04fb01 | 181 | py | Python | launchkey/factories/__init__.py | lordkyzr/launchkey-python | 4a6c13c2e60c5f38c4cb749d6a887eb1ac813c0c | [
"MIT"
] | 9 | 2017-10-12T02:45:23.000Z | 2021-01-11T05:44:13.000Z | launchkey/factories/__init__.py | lordkyzr/launchkey-python | 4a6c13c2e60c5f38c4cb749d6a887eb1ac813c0c | [
"MIT"
] | 31 | 2018-09-12T00:17:10.000Z | 2022-01-31T21:35:04.000Z | launchkey/factories/__init__.py | lordkyzr/launchkey-python | 4a6c13c2e60c5f38c4cb749d6a887eb1ac813c0c | [
"MIT"
] | 11 | 2017-01-31T21:45:29.000Z | 2022-01-28T00:56:48.000Z | """Factories"""
from .directory import DirectoryFactory # noqa: F401
from .organization import OrganizationFactory # noqa: F401
from .service import ServiceFactory # noqa: F401
| 30.166667 | 59 | 0.773481 | 19 | 181 | 7.368421 | 0.578947 | 0.171429 | 0.171429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058065 | 0.143646 | 181 | 5 | 60 | 36.2 | 0.845161 | 0.237569 | 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 |
1a74d173722ca6866ce27bc465bbed8a60dbdddc | 7,513 | py | Python | test/e2e/predictor/test_multi_model_serving.py | ivan-valkov/kfserving | 6d3d744aad5a7a59174117c8319dc68f67a110f8 | [
"Apache-2.0"
] | null | null | null | test/e2e/predictor/test_multi_model_serving.py | ivan-valkov/kfserving | 6d3d744aad5a7a59174117c8319dc68f67a110f8 | [
"Apache-2.0"
] | null | null | null | test/e2e/predictor/test_multi_model_serving.py | ivan-valkov/kfserving | 6d3d744aad5a7a59174117c8319dc68f67a110f8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from kubernetes import client
from kfserving import (
constants,
KFServingClient,
V1beta1PredictorSpec,
V1alpha1TrainedModel,
V1alpha2EndpointSpec,
V1beta1InferenceService,
V1beta1InferenceServiceSpec,
V1alpha1ModelSpec,
V1alpha1TrainedModelSpec,
V1beta1SKLearnSpec,
V1beta1XGBoostSpec,
V1alpha2TritonSpec,
)
from ..common.utils import predict, get_cluster_ip
from ..common.utils import KFSERVING_TEST_NAMESPACE
KFServing = KFServingClient(config_file=os.environ.get("KUBECONFIG", "~/.kube/config"))
def test_mms_sklearn_kfserving():
# Define an inference service
predictor = V1beta1PredictorSpec(
min_replicas=1,
sklearn=V1beta1SKLearnSpec(
protocol_version="v1",
resources=client.V1ResourceRequirements(
requests={"cpu": "100m", "memory": "256Mi"},
limits={"cpu": "100m", "memory": "256Mi"},
)
)
)
service_name = "isvc-sklearn-mms"
isvc = V1beta1InferenceService(
api_version=constants.KFSERVING_V1BETA1,
kind=constants.KFSERVING_KIND,
metadata=client.V1ObjectMeta(
name=service_name,
namespace=KFSERVING_TEST_NAMESPACE
),
spec=V1beta1InferenceServiceSpec(predictor=predictor)
)
# Define trained models
model1_spec = V1alpha1ModelSpec(
storage_uri=f"gs://kfserving-samples/models/sklearn/iris",
memory='256Mi',
framework="sklearn"
)
model2_spec = V1alpha1ModelSpec(
storage_uri=f"gs://kfserving-samples/models/sklearn/iris",
memory='256Mi',
framework="sklearn"
)
model1_name = "model1-sklearn"
model2_name = "model2-sklearn"
model1 = V1alpha1TrainedModel(
api_version=constants.KFSERVING_V1ALPHA1,
kind=constants.KFSERVING_KIND_TRAINEDMODEL,
metadata=client.V1ObjectMeta(
name=model1_name,
namespace=KFSERVING_TEST_NAMESPACE
),
spec=V1alpha1TrainedModelSpec(
inference_service=service_name,
model=model1_spec
)
)
model2 = V1alpha1TrainedModel(
api_version=constants.KFSERVING_V1ALPHA1,
kind=constants.KFSERVING_KIND_TRAINEDMODEL,
metadata=client.V1ObjectMeta(
name=model2_name,
namespace=KFSERVING_TEST_NAMESPACE
),
spec=V1alpha1TrainedModelSpec(
inference_service=service_name,
model=model2_spec
)
)
# Create an instance of inference service with isvc
KFServing.create(isvc)
KFServing.wait_isvc_ready(service_name, namespace=KFSERVING_TEST_NAMESPACE)
# Create instances of trained models using model1 and model2
KFServing.create_trained_model(model1, KFSERVING_TEST_NAMESPACE)
KFServing.create_trained_model(model2, KFSERVING_TEST_NAMESPACE)
cluster_ip = get_cluster_ip()
KFServing.wait_model_ready(service_name, model1_name, isvc_namespace=KFSERVING_TEST_NAMESPACE,
isvc_version=constants.KFSERVING_V1BETA1_VERSION, cluster_ip=cluster_ip)
KFServing.wait_model_ready(service_name, model2_name, isvc_namespace=KFSERVING_TEST_NAMESPACE,
isvc_version=constants.KFSERVING_V1BETA1_VERSION, cluster_ip=cluster_ip)
# Call predict on the two models
res_model1 = predict(service_name, "./data/iris_input.json", model_name=model1_name)
res_model2 = predict(service_name, "./data/iris_input.json", model_name=model2_name)
assert res_model1["predictions"] == [1,1]
assert res_model2["predictions"] == [1,1]
# Clean up inference service
KFServing.delete(service_name, KFSERVING_TEST_NAMESPACE)
def test_mms_xgboost_kfserving():
# Define an inference service
predictor = V1beta1PredictorSpec(
min_replicas=1,
xgboost=V1beta1XGBoostSpec(
protocol_version="v1",
resources=client.V1ResourceRequirements(
requests={"cpu": "100m", "memory": "256Mi"},
limits={"cpu": "100m", "memory": "256Mi"},
)
)
)
service_name = "isvc-xgboost-mms"
isvc = V1beta1InferenceService(
api_version=constants.KFSERVING_V1BETA1,
kind=constants.KFSERVING_KIND,
metadata=client.V1ObjectMeta(
name=service_name,
namespace=KFSERVING_TEST_NAMESPACE
),
spec=V1beta1InferenceServiceSpec(predictor=predictor)
)
# Define trained models
model1_spec = V1alpha1ModelSpec(
storage_uri="gs://kfserving-samples/models/xgboost/iris",
memory='256Mi',
framework="xgboost"
)
model2_spec = V1alpha1ModelSpec(
storage_uri="gs://kfserving-samples/models/xgboost/iris",
memory='256Mi',
framework="xgboost"
)
model1_name = "model1-xgboost"
model2_name = "model2-xgboost"
model1 = V1alpha1TrainedModel(
api_version=constants.KFSERVING_V1ALPHA1,
kind=constants.KFSERVING_KIND_TRAINEDMODEL,
metadata=client.V1ObjectMeta(
name=model1_name,
namespace=KFSERVING_TEST_NAMESPACE
),
spec=V1alpha1TrainedModelSpec(
inference_service=service_name,
model=model1_spec
)
)
model2 = V1alpha1TrainedModel(
api_version=constants.KFSERVING_V1ALPHA1,
kind=constants.KFSERVING_KIND_TRAINEDMODEL,
metadata=client.V1ObjectMeta(
name=model2_name,
namespace=KFSERVING_TEST_NAMESPACE
),
spec=V1alpha1TrainedModelSpec(
inference_service=service_name,
model=model2_spec
)
)
# Create an instance of inference service with isvc
KFServing.create(isvc)
KFServing.wait_isvc_ready(service_name, namespace=KFSERVING_TEST_NAMESPACE)
# Create instances of trained models using model1 and model2
KFServing.create_trained_model(model1, KFSERVING_TEST_NAMESPACE)
KFServing.create_trained_model(model2, KFSERVING_TEST_NAMESPACE)
cluster_ip = get_cluster_ip()
KFServing.wait_model_ready(service_name, model1_name, isvc_namespace=KFSERVING_TEST_NAMESPACE,
isvc_version=constants.KFSERVING_V1BETA1_VERSION, cluster_ip=cluster_ip)
KFServing.wait_model_ready(service_name, model2_name, isvc_namespace=KFSERVING_TEST_NAMESPACE,
isvc_version=constants.KFSERVING_V1BETA1_VERSION, cluster_ip=cluster_ip)
# Call predict on the two models
res_model1 = predict(service_name, "./data/iris_input.json", model_name=model1_name)
res_model2 = predict(service_name, "./data/iris_input.json", model_name=model2_name)
assert res_model1["predictions"] == [1,1]
assert res_model2["predictions"] == [1,1]
# Clean up inference service
KFServing.delete(service_name, KFSERVING_TEST_NAMESPACE)
| 34.782407 | 104 | 0.690803 | 772 | 7,513 | 6.475389 | 0.195596 | 0.044009 | 0.083617 | 0.074415 | 0.787758 | 0.785357 | 0.785357 | 0.785357 | 0.785357 | 0.785357 | 0 | 0.033132 | 0.22867 | 7,513 | 215 | 105 | 34.944186 | 0.829508 | 0.13084 | 0 | 0.695652 | 0 | 0 | 0.082411 | 0.03936 | 0 | 0 | 0 | 0 | 0.024845 | 1 | 0.012422 | false | 0 | 0.031056 | 0 | 0.043478 | 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 |
1a903411752a87b38515a1caf9a86a344530f79f | 24 | py | Python | CodeUP/Python basic 100/6017.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | CodeUP/Python basic 100/6017.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | CodeUP/Python basic 100/6017.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | a= input()
print(a,a,a)
| 8 | 12 | 0.583333 | 6 | 24 | 2.333333 | 0.5 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 24 | 2 | 13 | 12 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 1 | 0 | null | 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 | 0 | 0 | 0 | 1 | 0 | 5 |
1ab1ebd9904b35f3e3a5604c1e99b203981b2780 | 59 | py | Python | blargh/engine/storage/pg/__init__.py | johny-b/blargh | 45bb94cad8c70b0cd5b0b4f1330682107051fb9d | [
"MIT"
] | null | null | null | blargh/engine/storage/pg/__init__.py | johny-b/blargh | 45bb94cad8c70b0cd5b0b4f1330682107051fb9d | [
"MIT"
] | 3 | 2019-07-09T08:01:36.000Z | 2020-07-08T10:18:52.000Z | blargh/engine/storage/pg/__init__.py | johny-b/blargh | 45bb94cad8c70b0cd5b0b4f1330682107051fb9d | [
"MIT"
] | null | null | null | from .pg_storage import PGStorage
from .query import Query
| 19.666667 | 33 | 0.830508 | 9 | 59 | 5.333333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135593 | 59 | 2 | 34 | 29.5 | 0.941176 | 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 |
46c2c4549775d667c0d465988e706d35994a7bbb | 1,298 | py | Python | homes_to_let/querysets.py | Xtuden-com/django-property | 6656d469a5d06c103a34c2e68b9f1754413fb3ba | [
"MIT"
] | null | null | null | homes_to_let/querysets.py | Xtuden-com/django-property | 6656d469a5d06c103a34c2e68b9f1754413fb3ba | [
"MIT"
] | null | null | null | homes_to_let/querysets.py | Xtuden-com/django-property | 6656d469a5d06c103a34c2e68b9f1754413fb3ba | [
"MIT"
] | null | null | null | from datetime import datetime
from django.contrib.gis.db import models
from homes.behaviours import Publishable
import pytz
class LettingQuerySet(models.query.QuerySet):
def published(self):
return self.filter(status=Publishable.STATUS_CHOICE_ACTIVE)
def unpublished(self):
return self.filter(status=Publishable.STATUS_CHOICE_INACTIVE)
def unexpired(self):
return self.filter(expires_at__isnull=True) | self.filter(expires_at__gt=datetime.utcnow().replace(tzinfo=pytz.utc))
def expired(self):
return self.filter(expires_at__lte=datetime.utcnow().replace(tzinfo=pytz.utc))
def available(self):
return self.filter(available_at__gt=datetime.utcnow().replace(tzinfo=pytz.utc))
def unavailable(self):
return self.filter(available_at__lte=datetime.utcnow().replace(tzinfo=pytz.utc))
def let_agreed(self):
return self.filter(let_agreed=True)
def let_not_agreed(self):
return self.filter(let_agreed=False)
def furnished(self):
return self.filter(furnished=True)
def unfurnished(self):
return self.filter(furnished=False)
def type_of_let(self, type):
return self.filter(type_of_let=type)
def house_share(self):
return self.filter(house_share=True) | 28.844444 | 124 | 0.723421 | 171 | 1,298 | 5.315789 | 0.292398 | 0.143014 | 0.211221 | 0.242024 | 0.556656 | 0.492849 | 0.367437 | 0.290429 | 0.182618 | 0 | 0 | 0 | 0.174114 | 1,298 | 45 | 125 | 28.844444 | 0.847948 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.413793 | false | 0 | 0.137931 | 0.413793 | 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 |
46d7b0fccca3c018791c4256055bb836f0e199b4 | 2,839 | py | Python | chaospy/distributions/sampler/sequences/chebyshev.py | utsekaj42/chaospy | 0fb23cbb58eb987c3ca912e2a20b83ebab0514d0 | [
"MIT"
] | 333 | 2016-10-25T12:00:48.000Z | 2022-03-30T07:50:33.000Z | chaospy/distributions/sampler/sequences/chebyshev.py | utsekaj42/chaospy | 0fb23cbb58eb987c3ca912e2a20b83ebab0514d0 | [
"MIT"
] | 327 | 2016-09-25T16:29:41.000Z | 2022-03-30T03:26:27.000Z | chaospy/distributions/sampler/sequences/chebyshev.py | utsekaj42/chaospy | 0fb23cbb58eb987c3ca912e2a20b83ebab0514d0 | [
"MIT"
] | 74 | 2016-10-17T11:14:13.000Z | 2021-12-09T10:55:59.000Z | """
Generate Chebyshev pseudo-random samples.
Example usage
-------------
Basic usage::
>>> distribution = chaospy.Uniform(0, 1)
>>> samples = distribution.sample(2, rule="chebyshev")
>>> samples.round(4)
array([0.25, 0.75])
>>> samples = distribution.sample(5, rule="chebyshev")
>>> samples.round(4)
array([0.067, 0.25 , 0.5 , 0.75 , 0.933])
Certain orders are nested::
>>> samples = distribution.sample(3, rule="chebyshev")
>>> samples.round(4)
array([0.1464, 0.5 , 0.8536])
>>> samples = distribution.sample(7, rule="chebyshev")
>>> samples.round(4)
array([0.0381, 0.1464, 0.3087, 0.5 , 0.6913, 0.8536, 0.9619])
Create nested samples directly with the dedicated function::
>>> samples = distribution.sample(2, rule="nested_chebyshev")
>>> samples.round(4)
array([0.1464, 0.5 , 0.8536])
>>> samples = distribution.sample(3, rule="nested_chebyshev")
>>> samples.round(4)
array([0.0381, 0.1464, 0.3087, 0.5 , 0.6913, 0.8536, 0.9619])
Multivariate usage::
>>> distribution = chaospy.J(chaospy.Uniform(0, 1), chaospy.Uniform(0, 1))
>>> samples = distribution.sample(2, rule="chebyshev")
>>> samples.round(4)
array([[0.25, 0.25, 0.75, 0.75],
[0.25, 0.75, 0.25, 0.75]])
"""
import numpy
import chaospy
from chaospy.quadrature import utils
def create_chebyshev_samples(order, dim=1):
"""
Generate Chebyshev pseudo-random samples.
Args:
order (int):
The number of samples to create along each axis.
dim (int):
The number of dimensions to create samples for.
Returns:
samples following Chebyshev sampling scheme mapped to the
``[0, 1]^dim`` hyper-cube and ``shape == (dim, order)``.
Examples:
>>> samples = chaospy.create_chebyshev_samples(6, 1)
>>> samples.round(4)
array([[0.0495, 0.1883, 0.3887, 0.6113, 0.8117, 0.9505]])
>>> samples = chaospy.create_chebyshev_samples(3, 2)
>>> samples.round(3)
array([[0.146, 0.146, 0.146, 0.5 , 0.5 , 0.5 , 0.854, 0.854, 0.854],
[0.146, 0.5 , 0.854, 0.146, 0.5 , 0.854, 0.146, 0.5 , 0.854]])
"""
x_data = .5*numpy.cos(numpy.arange(order, 0, -1)*numpy.pi/(order+1)) + .5
x_data = utils.combine([x_data]*dim)
return x_data.T
def create_nested_chebyshev_samples(order, dim=1):
"""
Nested Chebyshev sampling function.
Args:
order (int):
The number of samples to create along each axis.
dim (int):
The number of dimensions to create samples for.
Returns:
samples following Chebyshev sampling scheme mapped to the
``[0, 1]^dim`` hyper-cube and ``shape == (dim, 2**order-1)``.
"""
return create_chebyshev_samples(order=2**order-1, dim=dim)
| 30.202128 | 80 | 0.596689 | 403 | 2,839 | 4.16129 | 0.220844 | 0.11449 | 0.019678 | 0.085868 | 0.692904 | 0.515802 | 0.506857 | 0.483005 | 0.471079 | 0.471079 | 0 | 0.121951 | 0.23459 | 2,839 | 93 | 81 | 30.526882 | 0.649793 | 0.81895 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.333333 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
46da7b2cff19a77e1980878a6a15bebf8cdc202c | 92 | py | Python | src/lightmlrestapi/tools/__init__.py | sdpython/lightmlrestapi | 3cad548702ae4eb390488bfca3b9e2b2ccc35180 | [
"MIT"
] | null | null | null | src/lightmlrestapi/tools/__init__.py | sdpython/lightmlrestapi | 3cad548702ae4eb390488bfca3b9e2b2ccc35180 | [
"MIT"
] | 23 | 2017-12-06T14:54:24.000Z | 2021-01-01T10:01:33.000Z | src/lightmlrestapi/tools/__init__.py | sdpython/lightmlrestapi | 3cad548702ae4eb390488bfca3b9e2b2ccc35180 | [
"MIT"
] | null | null | null | """
@file
@brief Shortcuts to *tools*.
"""
from .json_helper import json_loads, json_dumps
| 13.142857 | 47 | 0.717391 | 13 | 92 | 4.846154 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141304 | 92 | 6 | 48 | 15.333333 | 0.797468 | 0.369565 | 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 |
46e0113b65e71063aa698712f4608100c9971e40 | 82 | py | Python | tools/exceptions.py | celbig/finer_package_settings | 9c49bd070df8eb5e464c85ec1d3c9b5ef29ea1e4 | [
"CC-BY-4.0"
] | null | null | null | tools/exceptions.py | celbig/finer_package_settings | 9c49bd070df8eb5e464c85ec1d3c9b5ef29ea1e4 | [
"CC-BY-4.0"
] | null | null | null | tools/exceptions.py | celbig/finer_package_settings | 9c49bd070df8eb5e464c85ec1d3c9b5ef29ea1e4 | [
"CC-BY-4.0"
] | null | null | null | class InvalidJSON(Exception):
pass
class InvalidConfig(Exception):
pass
| 11.714286 | 31 | 0.731707 | 8 | 82 | 7.5 | 0.625 | 0.433333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.195122 | 82 | 6 | 32 | 13.666667 | 0.909091 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
46e500180a1a503ffc340ed05243a7b7284c3f79 | 908 | py | Python | setup.py | fkorling/nameko-memcached | 029cd87a3504284d6cebf1c0e90c4a33e6373a2a | [
"Apache-2.0"
] | 6 | 2018-10-31T12:56:23.000Z | 2022-02-22T15:10:31.000Z | setup.py | fkorling/nameko-memcached | 029cd87a3504284d6cebf1c0e90c4a33e6373a2a | [
"Apache-2.0"
] | null | null | null | setup.py | fkorling/nameko-memcached | 029cd87a3504284d6cebf1c0e90c4a33e6373a2a | [
"Apache-2.0"
] | 1 | 2018-11-01T13:43:08.000Z | 2018-11-01T13:43:08.000Z | from setuptools import setup
setup(
name='nameko-memcached',
version='0.1.0',
url='https://github.com/frisellcpl/nameko-memcached/',
license='Apache License, Version 2.0',
author='frisellcpl',
author_email='johan@trell.se',
py_modules=['nameko_memcached'],
install_requires=[
"nameko>=2.0.0",
"python-binary-memcached",
],
description='Memcached dependency for nameko services',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
)
| 31.310345 | 61 | 0.604626 | 95 | 908 | 5.736842 | 0.494737 | 0.244037 | 0.321101 | 0.238532 | 0.099083 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030568 | 0.243392 | 908 | 28 | 62 | 32.428571 | 0.762737 | 0 | 0 | 0.076923 | 0 | 0 | 0.602423 | 0.02533 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.038462 | 0 | 0.038462 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
46f68dda4dda46906f38ccdb4c88d0dfa2e30c30 | 125 | py | Python | propose/ast/unary.py | jonhue/propose | 316bd8191bdfb612862a655fba60219a73323220 | [
"MIT"
] | 1 | 2020-12-19T16:52:22.000Z | 2020-12-19T16:52:22.000Z | propose/ast/unary.py | jonhue/propose | 316bd8191bdfb612862a655fba60219a73323220 | [
"MIT"
] | 2 | 2020-01-15T07:43:54.000Z | 2020-01-15T07:44:32.000Z | propose/ast/unary.py | jonhue/propose | 316bd8191bdfb612862a655fba60219a73323220 | [
"MIT"
] | null | null | null | from .formula import Formula
class Unary(Formula):
def __init__(self, formula: Formula):
self.formula = formula
| 20.833333 | 41 | 0.704 | 15 | 125 | 5.6 | 0.533333 | 0.261905 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208 | 125 | 5 | 42 | 25 | 0.848485 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
46fa1502bf639cb5138fdda2373c6ddf7e0cb99e | 61 | py | Python | pystocks/__init__.py | pranavaddepalli/PyStocks | 01574e7810b2e95f7217bd7521dfb85e77d3885d | [
"MIT"
] | 6 | 2020-07-01T17:52:39.000Z | 2022-03-01T13:31:13.000Z | pystocks/__init__.py | pranavaddepalli/PyStocks | 01574e7810b2e95f7217bd7521dfb85e77d3885d | [
"MIT"
] | 3 | 2020-07-19T17:20:05.000Z | 2022-01-13T22:13:58.000Z | pystocks/__init__.py | pranavaddepalli/PyStocks | 01574e7810b2e95f7217bd7521dfb85e77d3885d | [
"MIT"
] | 3 | 2020-07-11T02:44:57.000Z | 2021-03-02T21:22:27.000Z | from .Stock import Stock
from .NewsScraper import NewsScraper | 30.5 | 36 | 0.852459 | 8 | 61 | 6.5 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.114754 | 61 | 2 | 36 | 30.5 | 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 |
20353ae15d6e4f0b0d8d5212acbcd011670d90d9 | 94 | py | Python | src/ai/backend/krunner/centos/plugin.py | lablup/backend.ai-krunner-centos | 493d3b3132175a8c7c3443036270ad5acdebd549 | [
"MIT"
] | 1 | 2021-12-30T04:44:03.000Z | 2021-12-30T04:44:03.000Z | src/ai/backend/krunner/static_gnu/plugin.py | lablup/backend.ai-krunner-static-gnu | 8f1780d1b3b341c33e138bcb84472cb1090939de | [
"MIT"
] | 1 | 2020-11-20T03:49:26.000Z | 2020-11-20T03:49:26.000Z | src/ai/backend/krunner/static_gnu/plugin.py | lablup/backend.ai-krunner-static-gnu | 8f1780d1b3b341c33e138bcb84472cb1090939de | [
"MIT"
] | null | null | null | from typing import Any, Mapping
async def init(config: Mapping[str, Any]) -> None:
pass
| 15.666667 | 50 | 0.691489 | 14 | 94 | 4.642857 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.202128 | 94 | 5 | 51 | 18.8 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.333333 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 5 |
646c97db71be2d81fa494c44f737dbc848d23ad0 | 141 | py | Python | amazonian/redshift/__init__.py | idin/amazonian | 3a20c8520f139a75da41b78aa140e92d949a5260 | [
"MIT"
] | null | null | null | amazonian/redshift/__init__.py | idin/amazonian | 3a20c8520f139a75da41b78aa140e92d949a5260 | [
"MIT"
] | null | null | null | amazonian/redshift/__init__.py | idin/amazonian | 3a20c8520f139a75da41b78aa140e92d949a5260 | [
"MIT"
] | null | null | null | from .Redshift import Redshift
from .Snapshot import Snapshot
from .Schema import Schema
from .Table import Table
from .Column import Column
| 23.5 | 30 | 0.822695 | 20 | 141 | 5.8 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141844 | 141 | 5 | 31 | 28.2 | 0.958678 | 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 |
649902cb7d8b91475198b4c9b4855dfec4bcbc3e | 50,549 | py | Python | turdshovel/_stubs/System/Collections/__init__.py | daddycocoaman/turdshovel | 6f9d9b08734028fa819c590e8573ae49481dc769 | [
"MIT"
] | 39 | 2021-10-30T06:34:21.000Z | 2022-03-22T09:04:40.000Z | turdshovel/_stubs/System/Collections/__init__.py | daddycocoaman/turdshovel | 6f9d9b08734028fa819c590e8573ae49481dc769 | [
"MIT"
] | null | null | null | turdshovel/_stubs/System/Collections/__init__.py | daddycocoaman/turdshovel | 6f9d9b08734028fa819c590e8573ae49481dc769 | [
"MIT"
] | 3 | 2021-10-30T03:56:16.000Z | 2021-11-08T01:59:32.000Z | # encoding: utf-8
# module System.Collections calls itself Collections
# from mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class ArrayList(object, IList, ICollection, IEnumerable, ICloneable):
"""
ArrayList()
ArrayList(capacity: int)
ArrayList(c: ICollection)
"""
@staticmethod
def Adapter(list):
""" Adapter(list: IList) -> ArrayList """
pass
def Add(self, value):
""" Add(self: ArrayList, value: object) -> int """
pass
def AddRange(self, c):
""" AddRange(self: ArrayList, c: ICollection) """
pass
def BinarySearch(self, *__args):
"""
BinarySearch(self: ArrayList, index: int, count: int, value: object, comparer: IComparer) -> int
BinarySearch(self: ArrayList, value: object) -> int
BinarySearch(self: ArrayList, value: object, comparer: IComparer) -> int
"""
pass
def Clear(self):
""" Clear(self: ArrayList) """
pass
def Clone(self):
""" Clone(self: ArrayList) -> object """
pass
def Contains(self, item):
""" Contains(self: ArrayList, item: object) -> bool """
pass
def CopyTo(self, *__args):
""" CopyTo(self: ArrayList, array: Array)CopyTo(self: ArrayList, array: Array, arrayIndex: int)CopyTo(self: ArrayList, index: int, array: Array, arrayIndex: int, count: int) """
pass
@staticmethod
def FixedSize(list):
"""
FixedSize(list: IList) -> IList
FixedSize(list: ArrayList) -> ArrayList
"""
pass
def GetEnumerator(self, index=None, count=None):
"""
GetEnumerator(self: ArrayList) -> IEnumerator
GetEnumerator(self: ArrayList, index: int, count: int) -> IEnumerator
"""
pass
def GetRange(self, index, count):
""" GetRange(self: ArrayList, index: int, count: int) -> ArrayList """
pass
def IndexOf(self, value, startIndex=None, count=None):
"""
IndexOf(self: ArrayList, value: object) -> int
IndexOf(self: ArrayList, value: object, startIndex: int) -> int
IndexOf(self: ArrayList, value: object, startIndex: int, count: int) -> int
"""
pass
def Insert(self, index, value):
""" Insert(self: ArrayList, index: int, value: object) """
pass
def InsertRange(self, index, c):
""" InsertRange(self: ArrayList, index: int, c: ICollection) """
pass
def LastIndexOf(self, value, startIndex=None, count=None):
"""
LastIndexOf(self: ArrayList, value: object) -> int
LastIndexOf(self: ArrayList, value: object, startIndex: int) -> int
LastIndexOf(self: ArrayList, value: object, startIndex: int, count: int) -> int
"""
pass
@staticmethod
def ReadOnly(list):
"""
ReadOnly(list: IList) -> IList
ReadOnly(list: ArrayList) -> ArrayList
"""
pass
def Remove(self, obj):
""" Remove(self: ArrayList, obj: object) """
pass
def RemoveAt(self, index):
""" RemoveAt(self: ArrayList, index: int) """
pass
def RemoveRange(self, index, count):
""" RemoveRange(self: ArrayList, index: int, count: int) """
pass
@staticmethod
def Repeat(value, count):
""" Repeat(value: object, count: int) -> ArrayList """
pass
def Reverse(self, index=None, count=None):
""" Reverse(self: ArrayList)Reverse(self: ArrayList, index: int, count: int) """
pass
def SetRange(self, index, c):
""" SetRange(self: ArrayList, index: int, c: ICollection) """
pass
def Sort(self, *__args):
""" Sort(self: ArrayList)Sort(self: ArrayList, comparer: IComparer)Sort(self: ArrayList, index: int, count: int, comparer: IComparer) """
pass
@staticmethod
def Synchronized(list):
"""
Synchronized(list: IList) -> IList
Synchronized(list: ArrayList) -> ArrayList
"""
pass
def ToArray(self, type=None):
"""
ToArray(self: ArrayList) -> Array[object]
ToArray(self: ArrayList, type: Type) -> Array
"""
pass
def TrimToSize(self):
""" TrimToSize(self: ArrayList) """
pass
def __add__(self, *args): #cannot find CLR method
""" x.__add__(y) <==> x+y """
pass
def __contains__(self, *args): #cannot find CLR method
""" __contains__(self: IList, value: object) -> bool """
pass
def __getitem__(self, *args): #cannot find CLR method
""" x.__getitem__(y) <==> x[y] """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
@staticmethod # known case of __new__
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type, capacity: int)
__new__(cls: type, c: ICollection)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
def __setitem__(self, *args): #cannot find CLR method
""" x.__setitem__(i, y) <==> x[i]= """
pass
Capacity = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Capacity(self: ArrayList) -> int
Set: Capacity(self: ArrayList) = value
"""
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: ArrayList) -> int
"""
IsFixedSize = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsFixedSize(self: ArrayList) -> bool
"""
IsReadOnly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsReadOnly(self: ArrayList) -> bool
"""
IsSynchronized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsSynchronized(self: ArrayList) -> bool
"""
SyncRoot = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: SyncRoot(self: ArrayList) -> object
"""
class BitArray(object, ICollection, IEnumerable, ICloneable):
"""
BitArray(length: int)
BitArray(length: int, defaultValue: bool)
BitArray(bytes: Array[Byte])
BitArray(values: Array[bool])
BitArray(values: Array[int])
BitArray(bits: BitArray)
"""
def And(self, value):
""" And(self: BitArray, value: BitArray) -> BitArray """
pass
def Clone(self):
""" Clone(self: BitArray) -> object """
pass
def CopyTo(self, array, index):
""" CopyTo(self: BitArray, array: Array, index: int) """
pass
def Get(self, index):
""" Get(self: BitArray, index: int) -> bool """
pass
def GetEnumerator(self):
""" GetEnumerator(self: BitArray) -> IEnumerator """
pass
def Not(self):
""" Not(self: BitArray) -> BitArray """
pass
def Or(self, value):
""" Or(self: BitArray, value: BitArray) -> BitArray """
pass
def Set(self, index, value):
""" Set(self: BitArray, index: int, value: bool) """
pass
def SetAll(self, value):
""" SetAll(self: BitArray, value: bool) """
pass
def Xor(self, value):
""" Xor(self: BitArray, value: BitArray) -> BitArray """
pass
def __getitem__(self, *args): #cannot find CLR method
""" x.__getitem__(y) <==> x[y] """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
@staticmethod # known case of __new__
def __new__(self, *__args):
"""
__new__(cls: type, length: int)
__new__(cls: type, length: int, defaultValue: bool)
__new__(cls: type, bytes: Array[Byte])
__new__(cls: type, values: Array[bool])
__new__(cls: type, values: Array[int])
__new__(cls: type, bits: BitArray)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
def __setitem__(self, *args): #cannot find CLR method
""" x.__setitem__(i, y) <==> x[i]= """
pass
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: BitArray) -> int
"""
IsReadOnly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsReadOnly(self: BitArray) -> bool
"""
IsSynchronized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsSynchronized(self: BitArray) -> bool
"""
Length = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Length(self: BitArray) -> int
Set: Length(self: BitArray) = value
"""
SyncRoot = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: SyncRoot(self: BitArray) -> object
"""
class CaseInsensitiveComparer(object, IComparer):
"""
CaseInsensitiveComparer()
CaseInsensitiveComparer(culture: CultureInfo)
"""
def Compare(self, a, b):
""" Compare(self: CaseInsensitiveComparer, a: object, b: object) -> int """
pass
def __cmp__(self, *args): #cannot find CLR method
""" x.__cmp__(y) <==> cmp(x,y) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, culture=None):
"""
__new__(cls: type)
__new__(cls: type, culture: CultureInfo)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
Default = None
DefaultInvariant = None
class CaseInsensitiveHashCodeProvider(object, IHashCodeProvider):
"""
CaseInsensitiveHashCodeProvider()
CaseInsensitiveHashCodeProvider(culture: CultureInfo)
"""
def GetHashCode(self, obj=None):
""" GetHashCode(self: CaseInsensitiveHashCodeProvider, obj: object) -> int """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, culture=None):
"""
__new__(cls: type)
__new__(cls: type, culture: CultureInfo)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
Default = None
DefaultInvariant = None
class IEnumerable:
# no doc
def GetEnumerator(self):
""" GetEnumerator(self: IEnumerable) -> IEnumerator """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
class ICollection(IEnumerable):
# no doc
def CopyTo(self, array, index):
""" CopyTo(self: ICollection, array: Array, index: int) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: ICollection) -> int
"""
IsSynchronized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsSynchronized(self: ICollection) -> bool
"""
SyncRoot = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: SyncRoot(self: ICollection) -> object
"""
class IList(ICollection, IEnumerable):
# no doc
def Add(self, value):
""" Add(self: IList, value: object) -> int """
pass
def Clear(self):
""" Clear(self: IList) """
pass
def Contains(self, value):
""" __contains__(self: IList, value: object) -> bool """
pass
def IndexOf(self, value):
""" IndexOf(self: IList, value: object) -> int """
pass
def Insert(self, index, value):
""" Insert(self: IList, index: int, value: object) """
pass
def Remove(self, value):
""" Remove(self: IList, value: object) """
pass
def RemoveAt(self, index):
""" RemoveAt(self: IList, index: int) """
pass
def __add__(self, *args): #cannot find CLR method
""" x.__add__(y) <==> x+y """
pass
def __getitem__(self, *args): #cannot find CLR method
""" x.__getitem__(y) <==> x[y] """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
def __setitem__(self, *args): #cannot find CLR method
""" x.__setitem__(i, y) <==> x[i]= """
pass
IsFixedSize = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsFixedSize(self: IList) -> bool
"""
IsReadOnly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsReadOnly(self: IList) -> bool
"""
class CollectionBase(object, IList, ICollection, IEnumerable):
# no doc
def Clear(self):
""" Clear(self: CollectionBase) """
pass
def GetEnumerator(self):
""" GetEnumerator(self: CollectionBase) -> IEnumerator """
pass
def OnClear(self, *args): #cannot find CLR method
""" OnClear(self: CollectionBase) """
pass
def OnClearComplete(self, *args): #cannot find CLR method
""" OnClearComplete(self: CollectionBase) """
pass
def OnInsert(self, *args): #cannot find CLR method
""" OnInsert(self: CollectionBase, index: int, value: object) """
pass
def OnInsertComplete(self, *args): #cannot find CLR method
""" OnInsertComplete(self: CollectionBase, index: int, value: object) """
pass
def OnRemove(self, *args): #cannot find CLR method
""" OnRemove(self: CollectionBase, index: int, value: object) """
pass
def OnRemoveComplete(self, *args): #cannot find CLR method
""" OnRemoveComplete(self: CollectionBase, index: int, value: object) """
pass
def OnSet(self, *args): #cannot find CLR method
""" OnSet(self: CollectionBase, index: int, oldValue: object, newValue: object) """
pass
def OnSetComplete(self, *args): #cannot find CLR method
""" OnSetComplete(self: CollectionBase, index: int, oldValue: object, newValue: object) """
pass
def OnValidate(self, *args): #cannot find CLR method
""" OnValidate(self: CollectionBase, value: object) """
pass
def RemoveAt(self, index):
""" RemoveAt(self: CollectionBase, index: int) """
pass
def __contains__(self, *args): #cannot find CLR method
""" __contains__(self: IList, value: object) -> bool """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
@staticmethod # known case of __new__
def __new__(self, *args): #cannot find CLR constructor
"""
__new__(cls: type)
__new__(cls: type, capacity: int)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
Capacity = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Capacity(self: CollectionBase) -> int
Set: Capacity(self: CollectionBase) = value
"""
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: CollectionBase) -> int
"""
InnerList = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
List = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class Comparer(object, IComparer, ISerializable):
""" Comparer(culture: CultureInfo) """
def Compare(self, a, b):
""" Compare(self: Comparer, a: object, b: object) -> int """
pass
def GetObjectData(self, info, context):
""" GetObjectData(self: Comparer, info: SerializationInfo, context: StreamingContext) """
pass
def __cmp__(self, *args): #cannot find CLR method
""" x.__cmp__(y) <==> cmp(x,y) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod # known case of __new__
def __new__(self, culture):
""" __new__(cls: type, culture: CultureInfo) """
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
Default = None
DefaultInvariant = None
class IDictionary(ICollection, IEnumerable):
# no doc
def Add(self, key, value):
""" Add(self: IDictionary, key: object, value: object) """
pass
def Clear(self):
""" Clear(self: IDictionary) """
pass
def Contains(self, key):
""" Contains(self: IDictionary, key: object) -> bool """
pass
def GetEnumerator(self):
""" GetEnumerator(self: IDictionary) -> IDictionaryEnumerator """
pass
def Remove(self, key):
""" Remove(self: IDictionary, key: object) """
pass
def __add__(self, *args): #cannot find CLR method
""" x.__add__(y) <==> x+y """
pass
def __getitem__(self, *args): #cannot find CLR method
""" x.__getitem__(y) <==> x[y] """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
def __setitem__(self, *args): #cannot find CLR method
""" x.__setitem__(i, y) <==> x[i]= """
pass
IsFixedSize = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsFixedSize(self: IDictionary) -> bool
"""
IsReadOnly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsReadOnly(self: IDictionary) -> bool
"""
Keys = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Keys(self: IDictionary) -> ICollection
"""
Values = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Values(self: IDictionary) -> ICollection
"""
class DictionaryBase(object, IDictionary, ICollection, IEnumerable):
# no doc
def Clear(self):
""" Clear(self: DictionaryBase) """
pass
def CopyTo(self, array, index):
""" CopyTo(self: DictionaryBase, array: Array, index: int) """
pass
def GetEnumerator(self):
""" GetEnumerator(self: DictionaryBase) -> IDictionaryEnumerator """
pass
def OnClear(self, *args): #cannot find CLR method
""" OnClear(self: DictionaryBase) """
pass
def OnClearComplete(self, *args): #cannot find CLR method
""" OnClearComplete(self: DictionaryBase) """
pass
def OnGet(self, *args): #cannot find CLR method
""" OnGet(self: DictionaryBase, key: object, currentValue: object) -> object """
pass
def OnInsert(self, *args): #cannot find CLR method
""" OnInsert(self: DictionaryBase, key: object, value: object) """
pass
def OnInsertComplete(self, *args): #cannot find CLR method
""" OnInsertComplete(self: DictionaryBase, key: object, value: object) """
pass
def OnRemove(self, *args): #cannot find CLR method
""" OnRemove(self: DictionaryBase, key: object, value: object) """
pass
def OnRemoveComplete(self, *args): #cannot find CLR method
""" OnRemoveComplete(self: DictionaryBase, key: object, value: object) """
pass
def OnSet(self, *args): #cannot find CLR method
""" OnSet(self: DictionaryBase, key: object, oldValue: object, newValue: object) """
pass
def OnSetComplete(self, *args): #cannot find CLR method
""" OnSetComplete(self: DictionaryBase, key: object, oldValue: object, newValue: object) """
pass
def OnValidate(self, *args): #cannot find CLR method
""" OnValidate(self: DictionaryBase, key: object, value: object) """
pass
def __contains__(self, *args): #cannot find CLR method
""" Contains(self: IDictionary, key: object) -> bool """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: DictionaryBase) -> int
"""
Dictionary = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
InnerHashtable = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class DictionaryEntry(object):
""" DictionaryEntry(key: object, value: object) """
@staticmethod # known case of __new__
def __new__(self, key, value):
"""
__new__[DictionaryEntry]() -> DictionaryEntry
__new__(cls: type, key: object, value: object)
"""
pass
Key = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Key(self: DictionaryEntry) -> object
Set: Key(self: DictionaryEntry) = value
"""
Value = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Value(self: DictionaryEntry) -> object
Set: Value(self: DictionaryEntry) = value
"""
class Hashtable(object, IDictionary, ICollection, IEnumerable, ISerializable, IDeserializationCallback, ICloneable):
"""
Hashtable()
Hashtable(capacity: int)
Hashtable(capacity: int, loadFactor: Single)
Hashtable(capacity: int, loadFactor: Single, hcp: IHashCodeProvider, comparer: IComparer)
Hashtable(capacity: int, loadFactor: Single, equalityComparer: IEqualityComparer)
Hashtable(hcp: IHashCodeProvider, comparer: IComparer)
Hashtable(equalityComparer: IEqualityComparer)
Hashtable(capacity: int, hcp: IHashCodeProvider, comparer: IComparer)
Hashtable(capacity: int, equalityComparer: IEqualityComparer)
Hashtable(d: IDictionary)
Hashtable(d: IDictionary, loadFactor: Single)
Hashtable(d: IDictionary, hcp: IHashCodeProvider, comparer: IComparer)
Hashtable(d: IDictionary, equalityComparer: IEqualityComparer)
Hashtable(d: IDictionary, loadFactor: Single, hcp: IHashCodeProvider, comparer: IComparer)
Hashtable(d: IDictionary, loadFactor: Single, equalityComparer: IEqualityComparer)
"""
def Add(self, key, value):
""" Add(self: Hashtable, key: object, value: object) """
pass
def Clear(self):
""" Clear(self: Hashtable) """
pass
def Clone(self):
""" Clone(self: Hashtable) -> object """
pass
def Contains(self, key):
""" Contains(self: Hashtable, key: object) -> bool """
pass
def ContainsKey(self, key):
""" ContainsKey(self: Hashtable, key: object) -> bool """
pass
def ContainsValue(self, value):
""" ContainsValue(self: Hashtable, value: object) -> bool """
pass
def CopyTo(self, array, arrayIndex):
""" CopyTo(self: Hashtable, array: Array, arrayIndex: int) """
pass
def GetEnumerator(self):
""" GetEnumerator(self: Hashtable) -> IDictionaryEnumerator """
pass
def GetHash(self, *args): #cannot find CLR method
""" GetHash(self: Hashtable, key: object) -> int """
pass
def GetObjectData(self, info, context):
""" GetObjectData(self: Hashtable, info: SerializationInfo, context: StreamingContext) """
pass
def KeyEquals(self, *args): #cannot find CLR method
""" KeyEquals(self: Hashtable, item: object, key: object) -> bool """
pass
def OnDeserialization(self, sender):
""" OnDeserialization(self: Hashtable, sender: object) """
pass
def Remove(self, key):
""" Remove(self: Hashtable, key: object) """
pass
@staticmethod
def Synchronized(table):
""" Synchronized(table: Hashtable) -> Hashtable """
pass
def __add__(self, *args): #cannot find CLR method
""" x.__add__(y) <==> x+y """
pass
def __contains__(self, *args): #cannot find CLR method
""" Contains(self: IDictionary, key: object) -> bool """
pass
def __getitem__(self, *args): #cannot find CLR method
""" x.__getitem__(y) <==> x[y] """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
@staticmethod # known case of __new__
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type, capacity: int)
__new__(cls: type, capacity: int, loadFactor: Single)
__new__(cls: type, capacity: int, loadFactor: Single, hcp: IHashCodeProvider, comparer: IComparer)
__new__(cls: type, capacity: int, loadFactor: Single, equalityComparer: IEqualityComparer)
__new__(cls: type, hcp: IHashCodeProvider, comparer: IComparer)
__new__(cls: type, equalityComparer: IEqualityComparer)
__new__(cls: type, capacity: int, hcp: IHashCodeProvider, comparer: IComparer)
__new__(cls: type, capacity: int, equalityComparer: IEqualityComparer)
__new__(cls: type, d: IDictionary)
__new__(cls: type, d: IDictionary, loadFactor: Single)
__new__(cls: type, d: IDictionary, hcp: IHashCodeProvider, comparer: IComparer)
__new__(cls: type, d: IDictionary, equalityComparer: IEqualityComparer)
__new__(cls: type, d: IDictionary, loadFactor: Single, hcp: IHashCodeProvider, comparer: IComparer)
__new__(cls: type, d: IDictionary, loadFactor: Single, equalityComparer: IEqualityComparer)
__new__(cls: type, info: SerializationInfo, context: StreamingContext)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
def __setitem__(self, *args): #cannot find CLR method
""" x.__setitem__(i, y) <==> x[i]= """
pass
comparer = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: Hashtable) -> int
"""
EqualityComparer = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
hcp = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
IsFixedSize = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsFixedSize(self: Hashtable) -> bool
"""
IsReadOnly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsReadOnly(self: Hashtable) -> bool
"""
IsSynchronized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsSynchronized(self: Hashtable) -> bool
"""
Keys = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Keys(self: Hashtable) -> ICollection
"""
SyncRoot = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: SyncRoot(self: Hashtable) -> object
"""
Values = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Values(self: Hashtable) -> ICollection
"""
class IComparer:
# no doc
def Compare(self, x, y):
""" Compare(self: IComparer, x: object, y: object) -> int """
pass
def __cmp__(self, *args): #cannot find CLR method
""" x.__cmp__(y) <==> cmp(x,y) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
class IEnumerator:
# no doc
def MoveNext(self):
""" MoveNext(self: IEnumerator) -> bool """
pass
def next(self, *args): #cannot find CLR method
""" next(self: object) -> object """
pass
def Reset(self):
""" Reset(self: IEnumerator) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerator) -> object """
pass
Current = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Current(self: IEnumerator) -> object
"""
class IDictionaryEnumerator(IEnumerator):
# no doc
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
Entry = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Entry(self: IDictionaryEnumerator) -> DictionaryEntry
"""
Key = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Key(self: IDictionaryEnumerator) -> object
"""
Value = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Value(self: IDictionaryEnumerator) -> object
"""
class IEqualityComparer:
# no doc
def Equals(self, x, y):
""" Equals(self: IEqualityComparer, x: object, y: object) -> bool """
pass
def GetHashCode(self, obj):
""" GetHashCode(self: IEqualityComparer, obj: object) -> int """
pass
def __eq__(self, *args): #cannot find CLR method
""" x.__eq__(y) <==> x==y """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
class IHashCodeProvider:
# no doc
def GetHashCode(self, obj):
""" GetHashCode(self: IHashCodeProvider, obj: object) -> int """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
class IStructuralComparable:
# no doc
def CompareTo(self, other, comparer):
""" CompareTo(self: IStructuralComparable, other: object, comparer: IComparer) -> int """
pass
def __eq__(self, *args): #cannot find CLR method
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __ge__(self, *args): #cannot find CLR method
pass
def __gt__(self, *args): #cannot find CLR method
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args): #cannot find CLR method
pass
def __lt__(self, *args): #cannot find CLR method
pass
def __ne__(self, *args): #cannot find CLR method
pass
class IStructuralEquatable:
# no doc
def Equals(self, other, comparer):
""" Equals(self: IStructuralEquatable, other: object, comparer: IEqualityComparer) -> bool """
pass
def GetHashCode(self, comparer):
""" GetHashCode(self: IStructuralEquatable, comparer: IEqualityComparer) -> int """
pass
def __eq__(self, *args): #cannot find CLR method
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __ne__(self, *args): #cannot find CLR method
pass
class Queue(object, ICollection, IEnumerable, ICloneable):
"""
Queue()
Queue(capacity: int)
Queue(capacity: int, growFactor: Single)
Queue(col: ICollection)
"""
def Clear(self):
""" Clear(self: Queue) """
pass
def Clone(self):
""" Clone(self: Queue) -> object """
pass
def Contains(self, obj):
""" Contains(self: Queue, obj: object) -> bool """
pass
def CopyTo(self, array, index):
""" CopyTo(self: Queue, array: Array, index: int) """
pass
def Dequeue(self):
""" Dequeue(self: Queue) -> object """
pass
def Enqueue(self, obj):
""" Enqueue(self: Queue, obj: object) """
pass
def GetEnumerator(self):
""" GetEnumerator(self: Queue) -> IEnumerator """
pass
def Peek(self):
""" Peek(self: Queue) -> object """
pass
@staticmethod
def Synchronized(queue):
""" Synchronized(queue: Queue) -> Queue """
pass
def ToArray(self):
""" ToArray(self: Queue) -> Array[object] """
pass
def TrimToSize(self):
""" TrimToSize(self: Queue) """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
@staticmethod # known case of __new__
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type, capacity: int)
__new__(cls: type, capacity: int, growFactor: Single)
__new__(cls: type, col: ICollection)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: Queue) -> int
"""
IsSynchronized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsSynchronized(self: Queue) -> bool
"""
SyncRoot = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: SyncRoot(self: Queue) -> object
"""
class ReadOnlyCollectionBase(object, ICollection, IEnumerable):
# no doc
def GetEnumerator(self):
""" GetEnumerator(self: ReadOnlyCollectionBase) -> IEnumerator """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: ReadOnlyCollectionBase) -> int
"""
InnerList = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
class SortedList(object, IDictionary, ICollection, IEnumerable, ICloneable):
"""
SortedList()
SortedList(initialCapacity: int)
SortedList(comparer: IComparer)
SortedList(comparer: IComparer, capacity: int)
SortedList(d: IDictionary)
SortedList(d: IDictionary, comparer: IComparer)
"""
def Add(self, key, value):
""" Add(self: SortedList, key: object, value: object) """
pass
def Clear(self):
""" Clear(self: SortedList) """
pass
def Clone(self):
""" Clone(self: SortedList) -> object """
pass
def Contains(self, key):
""" Contains(self: SortedList, key: object) -> bool """
pass
def ContainsKey(self, key):
""" ContainsKey(self: SortedList, key: object) -> bool """
pass
def ContainsValue(self, value):
""" ContainsValue(self: SortedList, value: object) -> bool """
pass
def CopyTo(self, array, arrayIndex):
""" CopyTo(self: SortedList, array: Array, arrayIndex: int) """
pass
def GetByIndex(self, index):
""" GetByIndex(self: SortedList, index: int) -> object """
pass
def GetEnumerator(self):
""" GetEnumerator(self: SortedList) -> IDictionaryEnumerator """
pass
def GetKey(self, index):
""" GetKey(self: SortedList, index: int) -> object """
pass
def GetKeyList(self):
""" GetKeyList(self: SortedList) -> IList """
pass
def GetValueList(self):
""" GetValueList(self: SortedList) -> IList """
pass
def IndexOfKey(self, key):
""" IndexOfKey(self: SortedList, key: object) -> int """
pass
def IndexOfValue(self, value):
""" IndexOfValue(self: SortedList, value: object) -> int """
pass
def Remove(self, key):
""" Remove(self: SortedList, key: object) """
pass
def RemoveAt(self, index):
""" RemoveAt(self: SortedList, index: int) """
pass
def SetByIndex(self, index, value):
""" SetByIndex(self: SortedList, index: int, value: object) """
pass
@staticmethod
def Synchronized(list):
""" Synchronized(list: SortedList) -> SortedList """
pass
def TrimToSize(self):
""" TrimToSize(self: SortedList) """
pass
def __add__(self, *args): #cannot find CLR method
""" x.__add__(y) <==> x+y """
pass
def __contains__(self, *args): #cannot find CLR method
""" Contains(self: IDictionary, key: object) -> bool """
pass
def __getitem__(self, *args): #cannot find CLR method
""" x.__getitem__(y) <==> x[y] """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
@staticmethod # known case of __new__
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type, initialCapacity: int)
__new__(cls: type, comparer: IComparer)
__new__(cls: type, comparer: IComparer, capacity: int)
__new__(cls: type, d: IDictionary)
__new__(cls: type, d: IDictionary, comparer: IComparer)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
def __setitem__(self, *args): #cannot find CLR method
""" x.__setitem__(i, y) <==> x[i]= """
pass
Capacity = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Capacity(self: SortedList) -> int
Set: Capacity(self: SortedList) = value
"""
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: SortedList) -> int
"""
IsFixedSize = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsFixedSize(self: SortedList) -> bool
"""
IsReadOnly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsReadOnly(self: SortedList) -> bool
"""
IsSynchronized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsSynchronized(self: SortedList) -> bool
"""
Keys = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Keys(self: SortedList) -> ICollection
"""
SyncRoot = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: SyncRoot(self: SortedList) -> object
"""
Values = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Values(self: SortedList) -> ICollection
"""
class Stack(object, ICollection, IEnumerable, ICloneable):
"""
Stack()
Stack(initialCapacity: int)
Stack(col: ICollection)
"""
def Clear(self):
""" Clear(self: Stack) """
pass
def Clone(self):
""" Clone(self: Stack) -> object """
pass
def Contains(self, obj):
""" Contains(self: Stack, obj: object) -> bool """
pass
def CopyTo(self, array, index):
""" CopyTo(self: Stack, array: Array, index: int) """
pass
def GetEnumerator(self):
""" GetEnumerator(self: Stack) -> IEnumerator """
pass
def Peek(self):
""" Peek(self: Stack) -> object """
pass
def Pop(self):
""" Pop(self: Stack) -> object """
pass
def Push(self, obj):
""" Push(self: Stack, obj: object) """
pass
@staticmethod
def Synchronized(stack):
""" Synchronized(stack: Stack) -> Stack """
pass
def ToArray(self):
""" ToArray(self: Stack) -> Array[object] """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args): #cannot find CLR method
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self, *args): #cannot find CLR method
""" x.__len__() <==> len(x) """
pass
@staticmethod # known case of __new__
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type, initialCapacity: int)
__new__(cls: type, col: ICollection)
"""
pass
def __reduce_ex__(self, *args): #cannot find CLR method
pass
def __repr__(self, *args): #cannot find CLR method
""" __repr__(self: object) -> str """
pass
Count = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: Count(self: Stack) -> int
"""
IsSynchronized = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsSynchronized(self: Stack) -> bool
"""
SyncRoot = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: SyncRoot(self: Stack) -> object
"""
class StructuralComparisons(object):
# no doc
StructuralComparer = None
StructuralEqualityComparer = None
__all__ = []
# variables with complex values
| 32.237883 | 256 | 0.586184 | 5,341 | 50,549 | 5.231417 | 0.043438 | 0.054615 | 0.064135 | 0.082459 | 0.787051 | 0.740346 | 0.688809 | 0.632762 | 0.58756 | 0.561469 | 0 | 0.001289 | 0.278502 | 50,549 | 1,567 | 257 | 32.258456 | 0.764827 | 0.433144 | 0 | 0.842022 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.410743 | false | 0.410743 | 0 | 0 | 0.557662 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
64ab8ef3d8e17f9112a348cc176a2682d8b03aad | 57 | py | Python | intro-to-python/examples/export.py | AIRONAXSolutions/python-education | a0105c619f55e60c35f0881f642851c9b716f5bb | [
"MIT"
] | 408 | 2015-07-21T10:30:05.000Z | 2022-03-31T18:14:05.000Z | learning-python/examples/export.py | iraghavr/python-education | 87941ea736ac7d630e1a1db9ad07a734a4311490 | [
"MIT"
] | 4 | 2016-07-05T09:01:16.000Z | 2022-03-03T20:49:20.000Z | learning-python/examples/export.py | iraghavr/python-education | 87941ea736ac7d630e1a1db9ad07a734a4311490 | [
"MIT"
] | 60 | 2015-10-06T17:34:36.000Z | 2022-03-10T13:50:46.000Z | def hello(name: str) -> None:
print(f"Hello {name}")
| 19 | 29 | 0.596491 | 9 | 57 | 3.777778 | 0.777778 | 0.529412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192982 | 57 | 2 | 30 | 28.5 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 0.5 | 0.5 | 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 | 0 | 0 | 1 | 0 | 5 |
64ca5ad519567a01c59edf97b32f7d072fbefdce | 65,875 | py | Python | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/000.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | 1 | 2020-02-28T12:03:39.000Z | 2020-02-28T12:03:39.000Z | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/000.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | null | null | null | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/000.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 23 11:11:57 2018
@author: kazuki.onodera
-d- -> /
-x- -> *
-p- -> +
-m- -> -
nohup python -u 000.py 0 > LOG/log_000.py_0.txt &
nohup python -u 000.py 1 > LOG/log_000.py_1.txt &
nohup python -u 000.py 2 > LOG/log_000.py_2.txt &
nohup python -u 000.py 3 > LOG/log_000.py_3.txt &
nohup python -u 000.py 4 > LOG/log_000.py_4.txt &
nohup python -u 000.py 5 > LOG/log_000.py_5.txt &
nohup python -u 000.py 6 > LOG/log_000.py_6.txt &
"""
import numpy as np
import pandas as pd
from multiprocessing import Pool, cpu_count
NTHREAD = cpu_count()
from itertools import combinations
from tqdm import tqdm
import sys
argv = sys.argv
import os, utils, gc
utils.start(__file__)
#==============================================================================
folders = [
# '../data',
'../feature', '../feature_unused',
# '../feature_var0', '../feature_corr1'
]
for fol in folders:
os.system(f'rm -rf {fol}')
os.system(f'mkdir {fol}')
col_app_money = ['app_AMT_INCOME_TOTAL', 'app_AMT_CREDIT', 'app_AMT_ANNUITY', 'app_AMT_GOODS_PRICE']
col_app_day = ['app_DAYS_BIRTH', 'app_DAYS_EMPLOYED', 'app_DAYS_REGISTRATION', 'app_DAYS_ID_PUBLISH', 'app_DAYS_LAST_PHONE_CHANGE']
def get_trte():
usecols = ['SK_ID_CURR', 'AMT_INCOME_TOTAL', 'AMT_CREDIT', 'AMT_ANNUITY', 'AMT_GOODS_PRICE']
usecols += ['DAYS_BIRTH', 'DAYS_EMPLOYED', 'DAYS_REGISTRATION', 'DAYS_ID_PUBLISH', 'DAYS_LAST_PHONE_CHANGE']
rename_di = {
'AMT_INCOME_TOTAL': 'app_AMT_INCOME_TOTAL',
'AMT_CREDIT': 'app_AMT_CREDIT',
'AMT_ANNUITY': 'app_AMT_ANNUITY',
'AMT_GOODS_PRICE': 'app_AMT_GOODS_PRICE',
'DAYS_BIRTH': 'app_DAYS_BIRTH',
'DAYS_EMPLOYED': 'app_DAYS_EMPLOYED',
'DAYS_REGISTRATION': 'app_DAYS_REGISTRATION',
'DAYS_ID_PUBLISH': 'app_DAYS_ID_PUBLISH',
'DAYS_LAST_PHONE_CHANGE': 'app_DAYS_LAST_PHONE_CHANGE',
}
trte = pd.concat([pd.read_csv('../input/application_train.csv.zip', usecols=usecols).rename(columns=rename_di),
pd.read_csv('../input/application_test.csv.zip', usecols=usecols).rename(columns=rename_di)],
ignore_index=True)
return trte
def prep_prev(df):
df['AMT_APPLICATION'].replace(0, np.nan, inplace=True)
df['AMT_CREDIT'].replace(0, np.nan, inplace=True)
df['CNT_PAYMENT'].replace(0, np.nan, inplace=True)
df['AMT_DOWN_PAYMENT'].replace(np.nan, 0, inplace=True)
df.loc[df['NAME_CONTRACT_STATUS']!='Approved', 'AMT_DOWN_PAYMENT'] = np.nan
df['RATE_DOWN_PAYMENT'].replace(np.nan, 0, inplace=True)
df.loc[df['NAME_CONTRACT_STATUS']!='Approved', 'RATE_DOWN_PAYMENT'] = np.nan
# df['xxx'].replace(0, np.nan, inplace=True)
# df['xxx'].replace(0, np.nan, inplace=True)
return
p = int(argv[1])
if True:
#def multi(p):
if p==0:
# =============================================================================
# application
# =============================================================================
def f1(df):
df['CODE_GENDER'] = 1 - (df['CODE_GENDER']=='F')*1 # 4 'XNA' are converted to 'M'
df['FLAG_OWN_CAR'] = (df['FLAG_OWN_CAR']=='Y')*1
df['FLAG_OWN_REALTY'] = (df['FLAG_OWN_REALTY']=='Y')*1
df['EMERGENCYSTATE_MODE'] = (df['EMERGENCYSTATE_MODE']=='Yes')*1
df['AMT_CREDIT-d-AMT_INCOME_TOTAL'] = df['AMT_CREDIT'] / df['AMT_INCOME_TOTAL']
df['AMT_ANNUITY-d-AMT_INCOME_TOTAL'] = df['AMT_ANNUITY'] / df['AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-d-AMT_INCOME_TOTAL'] = df['AMT_GOODS_PRICE'] / df['AMT_INCOME_TOTAL']
df['AMT_CREDIT-d-AMT_ANNUITY'] = df['AMT_CREDIT'] / df['AMT_ANNUITY'] # how long should user pay?(month)
df['AMT_GOODS_PRICE-d-AMT_ANNUITY'] = df['AMT_GOODS_PRICE'] / df['AMT_ANNUITY']# how long should user pay?(month)
df['AMT_GOODS_PRICE-d-AMT_CREDIT'] = df['AMT_GOODS_PRICE'] / df['AMT_CREDIT']
df['AMT_GOODS_PRICE-m-AMT_CREDIT'] = df['AMT_GOODS_PRICE'] - df['AMT_CREDIT']
df['AMT_GOODS_PRICE-m-AMT_CREDIT-d-AMT_INCOME_TOTAL'] = df['AMT_GOODS_PRICE-m-AMT_CREDIT'] / df['AMT_INCOME_TOTAL']
df['age_finish_payment'] = df['DAYS_BIRTH'].abs() + (df['AMT_CREDIT-d-AMT_ANNUITY']*30)
# df['age_finish_payment'] = (df['DAYS_BIRTH']/-365) + df['credit-d-annuity']
df.loc[df['DAYS_EMPLOYED']==365243, 'DAYS_EMPLOYED'] = np.nan
df['DAYS_EMPLOYED-m-DAYS_BIRTH'] = df['DAYS_EMPLOYED'] - df['DAYS_BIRTH']
df['DAYS_REGISTRATION-m-DAYS_BIRTH'] = df['DAYS_REGISTRATION'] - df['DAYS_BIRTH']
df['DAYS_ID_PUBLISH-m-DAYS_BIRTH'] = df['DAYS_ID_PUBLISH'] - df['DAYS_BIRTH']
df['DAYS_LAST_PHONE_CHANGE-m-DAYS_BIRTH'] = df['DAYS_LAST_PHONE_CHANGE'] - df['DAYS_BIRTH']
df['DAYS_REGISTRATION-m-DAYS_EMPLOYED'] = df['DAYS_REGISTRATION'] - df['DAYS_EMPLOYED']
df['DAYS_ID_PUBLISH-m-DAYS_EMPLOYED'] = df['DAYS_ID_PUBLISH'] - df['DAYS_EMPLOYED']
df['DAYS_LAST_PHONE_CHANGE-m-DAYS_EMPLOYED'] = df['DAYS_LAST_PHONE_CHANGE'] - df['DAYS_EMPLOYED']
df['DAYS_ID_PUBLISH-m-DAYS_REGISTRATION'] = df['DAYS_ID_PUBLISH'] - df['DAYS_REGISTRATION']
df['DAYS_LAST_PHONE_CHANGE-m-DAYS_REGISTRATION'] = df['DAYS_LAST_PHONE_CHANGE'] - df['DAYS_REGISTRATION']
df['DAYS_LAST_PHONE_CHANGE-m-DAYS_ID_PUBLISH'] = df['DAYS_LAST_PHONE_CHANGE'] - df['DAYS_ID_PUBLISH']
col = ['DAYS_EMPLOYED-m-DAYS_BIRTH',
'DAYS_REGISTRATION-m-DAYS_BIRTH',
'DAYS_ID_PUBLISH-m-DAYS_BIRTH',
'DAYS_LAST_PHONE_CHANGE-m-DAYS_BIRTH',
'DAYS_REGISTRATION-m-DAYS_EMPLOYED',
'DAYS_ID_PUBLISH-m-DAYS_EMPLOYED',
'DAYS_LAST_PHONE_CHANGE-m-DAYS_EMPLOYED',
'DAYS_ID_PUBLISH-m-DAYS_REGISTRATION',
'DAYS_LAST_PHONE_CHANGE-m-DAYS_REGISTRATION',
'DAYS_LAST_PHONE_CHANGE-m-DAYS_ID_PUBLISH'
]
col_comb = list(combinations(col, 2))
for i,j in col_comb:
df[f'{i}-d-{j}'] = df[i] / df[j]
df['DAYS_EMPLOYED-d-DAYS_BIRTH'] = df['DAYS_EMPLOYED'] / df['DAYS_BIRTH']
df['DAYS_REGISTRATION-d-DAYS_BIRTH'] = df['DAYS_REGISTRATION'] / df['DAYS_BIRTH']
df['DAYS_ID_PUBLISH-d-DAYS_BIRTH'] = df['DAYS_ID_PUBLISH'] / df['DAYS_BIRTH']
df['DAYS_LAST_PHONE_CHANGE-d-DAYS_BIRTH'] = df['DAYS_LAST_PHONE_CHANGE'] / df['DAYS_BIRTH']
df['DAYS_REGISTRATION-d-DAYS_EMPLOYED'] = df['DAYS_REGISTRATION'] / df['DAYS_EMPLOYED']
df['DAYS_ID_PUBLISH-d-DAYS_EMPLOYED'] = df['DAYS_ID_PUBLISH'] / df['DAYS_EMPLOYED']
df['DAYS_LAST_PHONE_CHANGE-d-DAYS_EMPLOYED'] = df['DAYS_LAST_PHONE_CHANGE'] / df['DAYS_EMPLOYED']
df['DAYS_ID_PUBLISH-d-DAYS_REGISTRATION'] = df['DAYS_ID_PUBLISH'] / df['DAYS_REGISTRATION']
df['DAYS_LAST_PHONE_CHANGE-d-DAYS_REGISTRATION'] = df['DAYS_LAST_PHONE_CHANGE'] / df['DAYS_REGISTRATION']
df['DAYS_LAST_PHONE_CHANGE-d-DAYS_ID_PUBLISH'] = df['DAYS_LAST_PHONE_CHANGE'] / df['DAYS_ID_PUBLISH']
df['OWN_CAR_AGE-d-DAYS_BIRTH'] = (df['OWN_CAR_AGE']*(-365)) / df['DAYS_BIRTH']
df['OWN_CAR_AGE-m-DAYS_BIRTH'] = df['DAYS_BIRTH'] + (df['OWN_CAR_AGE']*365)
df['OWN_CAR_AGE-d-DAYS_EMPLOYED'] = df['OWN_CAR_AGE'] / df['DAYS_EMPLOYED']
df['OWN_CAR_AGE-m-DAYS_EMPLOYED'] = df['DAYS_EMPLOYED'] + (df['OWN_CAR_AGE']*365)
df['cnt_adults'] = df['CNT_FAM_MEMBERS'] - df['CNT_CHILDREN']
df['CNT_CHILDREN-d-CNT_FAM_MEMBERS'] = df['CNT_CHILDREN'] / df['CNT_FAM_MEMBERS']
df['income_per_adult'] = df['AMT_INCOME_TOTAL'] / df['cnt_adults']
# df.loc[df['CNT_CHILDREN']==0, 'CNT_CHILDREN'] = np.nan
df['AMT_INCOME_TOTAL-d-CNT_CHILDREN'] = df['AMT_INCOME_TOTAL'] / (df['CNT_CHILDREN']+0.000001)
df['AMT_CREDIT-d-CNT_CHILDREN'] = df['AMT_CREDIT'] / (df['CNT_CHILDREN']+0.000001)
df['AMT_ANNUITY-d-CNT_CHILDREN'] = df['AMT_ANNUITY'] / (df['CNT_CHILDREN']+0.000001)
df['AMT_GOODS_PRICE-d-CNT_CHILDREN'] = df['AMT_GOODS_PRICE'] / (df['CNT_CHILDREN']+0.000001)
df['AMT_INCOME_TOTAL-d-cnt_adults'] = df['AMT_INCOME_TOTAL'] / df['cnt_adults']
df['AMT_CREDIT-d-cnt_adults'] = df['AMT_CREDIT'] / df['cnt_adults']
df['AMT_ANNUITY-d-cnt_adults'] = df['AMT_ANNUITY'] / df['cnt_adults']
df['AMT_GOODS_PRICE-d-cnt_adults'] = df['AMT_GOODS_PRICE'] / df['cnt_adults']
df['AMT_INCOME_TOTAL-d-CNT_FAM_MEMBERS'] = df['AMT_INCOME_TOTAL'] / df['CNT_FAM_MEMBERS']
df['AMT_CREDIT-d-CNT_FAM_MEMBERS'] = df['AMT_CREDIT'] / df['CNT_FAM_MEMBERS']
df['AMT_ANNUITY-d-CNT_FAM_MEMBERS'] = df['AMT_ANNUITY'] / df['CNT_FAM_MEMBERS']
df['AMT_GOODS_PRICE-d-CNT_FAM_MEMBERS'] = df['AMT_GOODS_PRICE'] / df['CNT_FAM_MEMBERS']
# EXT_SOURCE_x
df['EXT_SOURCES_prod'] = df['EXT_SOURCE_1'] * df['EXT_SOURCE_2'] * df['EXT_SOURCE_3']
df['EXT_SOURCES_sum'] = df[['EXT_SOURCE_1', 'EXT_SOURCE_2', 'EXT_SOURCE_3']].sum(axis=1)
df['EXT_SOURCES_sum'] = df['EXT_SOURCES_sum'].fillna(df['EXT_SOURCES_sum'].mean())
df['EXT_SOURCES_mean'] = df[['EXT_SOURCE_1', 'EXT_SOURCE_2', 'EXT_SOURCE_3']].mean(axis=1)
df['EXT_SOURCES_mean'] = df['EXT_SOURCES_mean'].fillna(df['EXT_SOURCES_mean'].mean())
df['EXT_SOURCES_std'] = df[['EXT_SOURCE_1', 'EXT_SOURCE_2', 'EXT_SOURCE_3']].std(axis=1)
df['EXT_SOURCES_std'] = df['EXT_SOURCES_std'].fillna(df['EXT_SOURCES_std'].mean())
df['EXT_SOURCES_1-2-3'] = df['EXT_SOURCE_1'] - df['EXT_SOURCE_2'] - df['EXT_SOURCE_3']
df['EXT_SOURCES_2-1-3'] = df['EXT_SOURCE_2'] - df['EXT_SOURCE_1'] - df['EXT_SOURCE_3']
df['EXT_SOURCES_1-2'] = df['EXT_SOURCE_1'] - df['EXT_SOURCE_2']
df['EXT_SOURCES_2-3'] = df['EXT_SOURCE_2'] - df['EXT_SOURCE_3']
df['EXT_SOURCES_1-3'] = df['EXT_SOURCE_1'] - df['EXT_SOURCE_3']
# =========
# https://www.kaggle.com/jsaguiar/updated-0-792-lb-lightgbm-with-simple-features/code
# =========
df['DAYS_EMPLOYED_PERC'] = df['DAYS_EMPLOYED'] / df['DAYS_BIRTH']
df['INCOME_PER_PERSON'] = df['AMT_INCOME_TOTAL'] / df['CNT_FAM_MEMBERS']
df['PAYMENT_RATE'] = df['AMT_ANNUITY'] / df['AMT_CREDIT']
# =========
# https://www.kaggle.com/poohtls/fork-of-fork-lightgbm-with-simple-features/code
# =========
docs = [_f for _f in df.columns if 'FLAG_DOC' in _f]
live = [_f for _f in df.columns if ('FLAG_' in _f) & ('FLAG_DOC' not in _f) & ('_FLAG_' not in _f)]
inc_by_org = df[['AMT_INCOME_TOTAL', 'ORGANIZATION_TYPE']].groupby('ORGANIZATION_TYPE').median()['AMT_INCOME_TOTAL']
df['alldocs_kurt'] = df[docs].kurtosis(axis=1)
df['alldocs_skew'] = df[docs].skew(axis=1)
df['alldocs_mean'] = df[docs].mean(axis=1)
df['alldocs_sum'] = df[docs].sum(axis=1)
df['alldocs_std'] = df[docs].std(axis=1)
df['NEW_LIVE_IND_SUM'] = df[live].sum(axis=1)
df['NEW_INC_PER_CHLD'] = df['AMT_INCOME_TOTAL'] / (1 + df['CNT_CHILDREN'])
df['NEW_INC_BY_ORG'] = df['ORGANIZATION_TYPE'].map(inc_by_org)
df['NEW_ANNUITY_TO_INCOME_RATIO'] = df['AMT_ANNUITY'] / (1 + df['AMT_INCOME_TOTAL'])
df['NEW_CAR_TO_BIRTH_RATIO'] = df['OWN_CAR_AGE'] / df['DAYS_BIRTH']
df['NEW_CAR_TO_EMPLOY_RATIO'] = df['OWN_CAR_AGE'] / df['DAYS_EMPLOYED']
df['NEW_PHONE_TO_BIRTH_RATIO'] = df['DAYS_LAST_PHONE_CHANGE'] / df['DAYS_BIRTH']
df['NEW_PHONE_TO_EMPLOYED_RATIO'] = df['DAYS_LAST_PHONE_CHANGE'] / df['DAYS_EMPLOYED']
# =============================================================================
# Maxwell features
# =============================================================================
bdg_avg = df.filter(regex='_AVG$').columns
bdg_mode = df.filter(regex='_MODE$').columns
bdg_medi = df.filter(regex='_MEDI$').columns[:len(bdg_avg)] # ignore FONDKAPREMONT_MODE...
df['building_score_avg_mean'] = df[bdg_avg].mean(1)
df['building_score_avg_std'] = df[bdg_avg].std(1)
df['building_score_avg_sum'] = df[bdg_avg].sum(1)
df['building_score_mode_mean'] = df[bdg_mode].mean(1)
df['building_score_mode_std'] = df[bdg_mode].std(1)
df['building_score_mode_sum'] = df[bdg_mode].sum(1)
df['building_score_medi_mean'] = df[bdg_medi].mean(1)
df['building_score_medi_std'] = df[bdg_medi].std(1)
df['building_score_medi_sum'] = df[bdg_medi].sum(1)
df['maxwell_feature_1'] = (df['EXT_SOURCE_1'] * df['EXT_SOURCE_3']) ** (1 / 2)
df.replace(np.inf, np.nan, inplace=True) # TODO: any other plan?
df.replace(-np.inf, np.nan, inplace=True)
return
df = pd.read_csv('../input/application_train.csv.zip')
f1(df)
utils.to_pickles(df, '../data/train', utils.SPLIT_SIZE)
utils.to_pickles(df[['TARGET']], '../data/label', utils.SPLIT_SIZE)
df = pd.read_csv('../input/application_test.csv.zip')
f1(df)
utils.to_pickles(df, '../data/test', utils.SPLIT_SIZE)
df[['SK_ID_CURR']].to_pickle('../data/sub.p')
elif p==1:
# =============================================================================
# prev
# =============================================================================
"""
df = utils.read_pickles('../data/previous_application')
"""
df = pd.merge(pd.read_csv('../data/prev_new_v4.csv.gz'),
get_trte(), on='SK_ID_CURR', how='left')
# df = pd.merge(pd.read_csv('../input/previous_application.csv.zip'),
# get_trte(), on='SK_ID_CURR', how='left')
prep_prev(df)
df['FLAG_LAST_APPL_PER_CONTRACT'] = (df['FLAG_LAST_APPL_PER_CONTRACT']=='Y')*1
# day
for c in ['DAYS_FIRST_DRAWING', 'DAYS_FIRST_DUE', 'DAYS_LAST_DUE_1ST_VERSION',
'DAYS_LAST_DUE', 'DAYS_TERMINATION']:
df.loc[df[c]==365243, c] = np.nan
df['days_fdue-m-fdrw'] = df['DAYS_FIRST_DUE'] - df['DAYS_FIRST_DRAWING']
df['days_ldue1-m-fdrw'] = df['DAYS_LAST_DUE_1ST_VERSION'] - df['DAYS_FIRST_DRAWING']
df['days_ldue-m-fdrw'] = df['DAYS_LAST_DUE'] - df['DAYS_FIRST_DRAWING'] # total span
df['days_trm-m-fdrw'] = df['DAYS_TERMINATION'] - df['DAYS_FIRST_DRAWING']
df['days_ldue1-m-fdue'] = df['DAYS_LAST_DUE_1ST_VERSION'] - df['DAYS_FIRST_DUE']
df['days_ldue-m-fdue'] = df['DAYS_LAST_DUE'] - df['DAYS_FIRST_DUE']
df['days_trm-m-fdue'] = df['DAYS_TERMINATION'] - df['DAYS_FIRST_DUE']
df['days_ldue-m-ldue1'] = df['DAYS_LAST_DUE'] - df['DAYS_LAST_DUE_1ST_VERSION']
df['days_trm-m-ldue1'] = df['DAYS_TERMINATION'] - df['DAYS_LAST_DUE_1ST_VERSION']
df['days_trm-m-ldue'] = df['DAYS_TERMINATION'] - df['DAYS_LAST_DUE']
# money
df['total_debt'] = df['AMT_ANNUITY'] * df['CNT_PAYMENT']
df['AMT_CREDIT-d-total_debt'] = df['AMT_CREDIT'] / df['total_debt']
df['AMT_GOODS_PRICE-d-total_debt'] = df['AMT_GOODS_PRICE'] / df['total_debt']
df['AMT_GOODS_PRICE-d-AMT_CREDIT'] = df['AMT_GOODS_PRICE'] / df['AMT_CREDIT']
# app & money
df['AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = df['AMT_ANNUITY'] / df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-d-app_AMT_INCOME_TOTAL'] = df['AMT_APPLICATION'] / df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = df['AMT_CREDIT'] / df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = df['AMT_GOODS_PRICE'] / df['app_AMT_INCOME_TOTAL']
df['AMT_ANNUITY-m-app_AMT_INCOME_TOTAL'] = df['AMT_ANNUITY'] - df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-m-app_AMT_INCOME_TOTAL'] = df['AMT_APPLICATION'] - df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-m-app_AMT_INCOME_TOTAL'] = df['AMT_CREDIT'] - df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-m-app_AMT_INCOME_TOTAL'] = df['AMT_GOODS_PRICE'] - df['app_AMT_INCOME_TOTAL']
df['AMT_ANNUITY-d-app_AMT_CREDIT'] = df['AMT_ANNUITY'] / df['app_AMT_CREDIT']
df['AMT_APPLICATION-d-app_AMT_CREDIT'] = df['AMT_APPLICATION'] / df['app_AMT_CREDIT']
df['AMT_CREDIT-d-app_AMT_CREDIT'] = df['AMT_CREDIT'] / df['app_AMT_CREDIT']
df['AMT_GOODS_PRICE-d-app_AMT_CREDIT'] = df['AMT_GOODS_PRICE'] / df['app_AMT_CREDIT']
df['AMT_ANNUITY-m-app_AMT_CREDIT'] = df['AMT_ANNUITY'] - df['app_AMT_CREDIT']
df['AMT_APPLICATION-m-app_AMT_CREDIT'] = df['AMT_APPLICATION'] - df['app_AMT_CREDIT']
df['AMT_CREDIT-m-app_AMT_CREDIT'] = df['AMT_CREDIT'] - df['app_AMT_CREDIT']
df['AMT_GOODS_PRICE-m-app_AMT_CREDIT'] = df['AMT_GOODS_PRICE'] - df['app_AMT_CREDIT']
df['AMT_ANNUITY-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = (df['AMT_ANNUITY'] - df['app_AMT_CREDIT']) / df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = (df['AMT_APPLICATION'] - df['app_AMT_CREDIT']) / df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = (df['AMT_CREDIT'] - df['app_AMT_CREDIT']) / df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = (df['AMT_GOODS_PRICE'] - df['app_AMT_CREDIT']) / df['app_AMT_INCOME_TOTAL']
df['AMT_ANNUITY-d-app_AMT_ANNUITY'] = df['AMT_ANNUITY'] / df['app_AMT_ANNUITY']
df['AMT_APPLICATION-d-app_AMT_ANNUITY'] = df['AMT_APPLICATION'] / df['app_AMT_ANNUITY']
df['AMT_CREDIT-d-app_AMT_ANNUITY'] = df['AMT_CREDIT'] / df['app_AMT_ANNUITY']
df['AMT_GOODS_PRICE-d-app_AMT_ANNUITY'] = df['AMT_GOODS_PRICE'] / df['app_AMT_ANNUITY']
df['AMT_ANNUITY-m-app_AMT_ANNUITY'] = df['AMT_ANNUITY'] - df['app_AMT_ANNUITY']
df['AMT_APPLICATION-m-app_AMT_ANNUITY'] = df['AMT_APPLICATION'] - df['app_AMT_ANNUITY']
df['AMT_CREDIT-m-app_AMT_ANNUITY'] = df['AMT_CREDIT'] - df['app_AMT_ANNUITY']
df['AMT_GOODS_PRICE-m-app_AMT_ANNUITY'] = df['AMT_GOODS_PRICE'] - df['app_AMT_ANNUITY']
df['AMT_ANNUITY-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = (df['AMT_ANNUITY'] - df['app_AMT_ANNUITY']) / df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = (df['AMT_APPLICATION'] - df['app_AMT_ANNUITY']) / df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = (df['AMT_CREDIT'] - df['app_AMT_ANNUITY']) / df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = (df['AMT_GOODS_PRICE'] - df['app_AMT_ANNUITY']) / df['app_AMT_INCOME_TOTAL']
df['AMT_ANNUITY-d-app_AMT_GOODS_PRICE'] = df['AMT_ANNUITY'] / df['app_AMT_GOODS_PRICE']
df['AMT_APPLICATION-d-app_AMT_GOODS_PRICE'] = df['AMT_APPLICATION'] / df['app_AMT_GOODS_PRICE']
df['AMT_CREDIT-d-app_AMT_GOODS_PRICE'] = df['AMT_CREDIT'] / df['app_AMT_GOODS_PRICE']
df['AMT_GOODS_PRICE-d-app_AMT_GOODS_PRICE'] = df['AMT_GOODS_PRICE'] / df['app_AMT_GOODS_PRICE']
df['AMT_ANNUITY-m-app_AMT_GOODS_PRICE'] = df['AMT_ANNUITY'] - df['app_AMT_GOODS_PRICE']
df['AMT_APPLICATION-m-app_AMT_GOODS_PRICE'] = df['AMT_APPLICATION'] - df['app_AMT_GOODS_PRICE']
df['AMT_CREDIT-m-app_AMT_GOODS_PRICE'] = df['AMT_CREDIT'] - df['app_AMT_GOODS_PRICE']
df['AMT_GOODS_PRICE-m-app_AMT_GOODS_PRICE'] = df['AMT_GOODS_PRICE'] - df['app_AMT_GOODS_PRICE']
df['AMT_ANNUITY-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = (df['AMT_ANNUITY'] - df['app_AMT_GOODS_PRICE']) / df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = (df['AMT_APPLICATION'] - df['app_AMT_GOODS_PRICE']) / df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = (df['AMT_CREDIT'] - df['app_AMT_GOODS_PRICE']) / df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = (df['AMT_GOODS_PRICE'] - df['app_AMT_GOODS_PRICE']) / df['app_AMT_INCOME_TOTAL']
# nejumi
f_name='nejumi'; init_rate=0.9; n_iter=500
df['AMT_ANNUITY_d_AMT_CREDIT_temp'] = df.AMT_ANNUITY / df.AMT_CREDIT
df[f_name] = df['AMT_ANNUITY_d_AMT_CREDIT_temp']*((1 + init_rate)**df.CNT_PAYMENT - 1)/((1 + init_rate)**df.CNT_PAYMENT)
for i in range(n_iter):
df[f_name] = df['AMT_ANNUITY_d_AMT_CREDIT_temp']*((1 + df[f_name])**df.CNT_PAYMENT - 1)/((1 + df[f_name])**df.CNT_PAYMENT)
df.drop(['AMT_ANNUITY_d_AMT_CREDIT_temp'], axis=1, inplace=True)
df.sort_values(['SK_ID_CURR', 'DAYS_DECISION'], inplace=True)
df.reset_index(drop=True, inplace=True)
col = [
'total_debt',
'AMT_CREDIT-d-total_debt',
'AMT_GOODS_PRICE-d-total_debt',
'AMT_GOODS_PRICE-d-AMT_CREDIT',
'AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'AMT_ANNUITY-d-app_AMT_CREDIT',
'AMT_APPLICATION-d-app_AMT_CREDIT',
'AMT_CREDIT-d-app_AMT_CREDIT',
'AMT_GOODS_PRICE-d-app_AMT_CREDIT',
'AMT_ANNUITY-d-app_AMT_ANNUITY',
'AMT_APPLICATION-d-app_AMT_ANNUITY',
'AMT_CREDIT-d-app_AMT_ANNUITY',
'AMT_GOODS_PRICE-d-app_AMT_ANNUITY',
'AMT_ANNUITY-d-app_AMT_GOODS_PRICE',
'AMT_APPLICATION-d-app_AMT_GOODS_PRICE',
'AMT_CREDIT-d-app_AMT_GOODS_PRICE',
'AMT_GOODS_PRICE-d-app_AMT_GOODS_PRICE',
'AMT_ANNUITY-m-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-m-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-m-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-m-app_AMT_INCOME_TOTAL',
'AMT_ANNUITY-m-app_AMT_CREDIT',
'AMT_APPLICATION-m-app_AMT_CREDIT',
'AMT_CREDIT-m-app_AMT_CREDIT',
'AMT_GOODS_PRICE-m-app_AMT_CREDIT',
'AMT_ANNUITY-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_ANNUITY-m-app_AMT_ANNUITY',
'AMT_APPLICATION-m-app_AMT_ANNUITY',
'AMT_CREDIT-m-app_AMT_ANNUITY',
'AMT_GOODS_PRICE-m-app_AMT_ANNUITY',
'AMT_ANNUITY-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_ANNUITY-m-app_AMT_GOODS_PRICE',
'AMT_APPLICATION-m-app_AMT_GOODS_PRICE',
'AMT_CREDIT-m-app_AMT_GOODS_PRICE',
'AMT_GOODS_PRICE-m-app_AMT_GOODS_PRICE',
'AMT_ANNUITY-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'nejumi'
]
def multi_prev(c):
ret_diff = []
ret_pctchng = []
key_bk = x_bk = None
for key, x in df[['SK_ID_CURR', c]].values:
# for key, x in tqdm(df[['SK_ID_CURR', c]].values, mininterval=30):
if key_bk is None:
ret_diff.append(None)
ret_pctchng.append(None)
else:
if key_bk == key:
ret_diff.append(x - x_bk)
ret_pctchng.append( (x_bk-x) / x_bk)
else:
ret_diff.append(None)
ret_pctchng.append(None)
key_bk = key
x_bk = x
ret_diff = pd.Series(ret_diff, name=f'{c}_diff')
ret_pctchng = pd.Series(ret_pctchng, name=f'{c}_pctchange')
ret = pd.concat([ret_diff, ret_pctchng], axis=1)
return ret
pool = Pool(len(col))
callback = pd.concat(pool.map(multi_prev, col), axis=1)
print('===== PREV ====')
print(callback.columns.tolist())
pool.close()
df = pd.concat([df, callback], axis=1)
# app & day
col_prev = ['DAYS_FIRST_DRAWING', 'DAYS_FIRST_DUE', 'DAYS_LAST_DUE_1ST_VERSION',
'DAYS_LAST_DUE', 'DAYS_TERMINATION']
for c1 in col_prev:
for c2 in col_app_day:
# print(f"'{c1}-m-{c2}',")
df[f'{c1}-m-{c2}'] = df[c1] - df[c2]
df[f'{c1}-d-{c2}'] = df[c1] / df[c2]
df['cnt_paid'] = df.apply(lambda x: min( np.ceil(x['DAYS_FIRST_DUE']/-30), x['CNT_PAYMENT'] ), axis=1)
df['cnt_paid_ratio'] = df['cnt_paid'] / df['CNT_PAYMENT']
df['cnt_unpaid'] = df['CNT_PAYMENT'] - df['cnt_paid']
df['amt_paid'] = df['AMT_ANNUITY'] * df['cnt_paid']
# df['amt_paid_ratio'] = df['amt_paid'] / df['total_debt'] # same as cnt_paid_ratio
df['amt_unpaid'] = df['total_debt'] - df['amt_paid']
df['active'] = (df['cnt_unpaid']>0)*1
df['completed'] = (df['cnt_unpaid']==0)*1
# future payment
df_tmp = pd.DataFrame()
print('future payment')
rem_max = df['cnt_unpaid'].max() # 80
# rem_max = 1
df['cnt_unpaid_tmp'] = df['cnt_unpaid']
for i in range(int( rem_max )):
c = f'future_payment_{i+1}m'
df_tmp[c] = df['cnt_unpaid_tmp'].map(lambda x: min(x, 1)) * df['AMT_ANNUITY']
df_tmp.loc[df_tmp[c]==0, c] = np.nan
df['cnt_unpaid_tmp'] -= 1
df['cnt_unpaid_tmp'] = df['cnt_unpaid_tmp'].map(lambda x: max(x, 0))
# df['prev_future_payment_max'] = df.filter(regex='^prev_future_payment_').max(1)
del df['cnt_unpaid_tmp']
df = pd.concat([df, df_tmp], axis=1)
# past payment
df_tmp = pd.DataFrame()
print('past payment')
rem_max = df['cnt_paid'].max() # 72
df['cnt_paid_tmp'] = df['cnt_paid']
for i in range(int( rem_max )):
c = f'past_payment_{i+1}m'
df_tmp[c] = df['cnt_paid_tmp'].map(lambda x: min(x, 1)) * df['AMT_ANNUITY']
df_tmp.loc[df_tmp[c]==0, c] = np.nan
df['cnt_paid_tmp'] -= 1
df['cnt_paid_tmp'] = df['cnt_paid_tmp'].map(lambda x: max(x, 0))
# df['prev_past_payment_max'] = df.filter(regex='^prev_past_payment_').max(1)
del df['cnt_paid_tmp']
df = pd.concat([df, df_tmp], axis=1)
df['APP_CREDIT_PERC'] = df['AMT_APPLICATION'] / df['AMT_CREDIT']
#df.filter(regex='^amt_future_payment_')
df.replace(np.inf, np.nan, inplace=True) # TODO: any other plan?
df.replace(-np.inf, np.nan, inplace=True)
utils.to_pickles(df, '../data/previous_application', utils.SPLIT_SIZE)
elif p==2:
# =============================================================================
# POS
# =============================================================================
"""
df = utils.read_pickles('../data/POS_CASH_balance')
"""
df = pd.read_csv('../input/POS_CASH_balance.csv.zip')
# data cleansing!!!
## drop signed. sample SK_ID_PREV==1769939
df = df[df.NAME_CONTRACT_STATUS!='Signed']
## Zombie NAME_CONTRACT_STATUS=='Completed' and CNT_INSTALMENT_FUTURE!=0. 1134377
df.loc[(df.NAME_CONTRACT_STATUS=='Completed') & (df.CNT_INSTALMENT_FUTURE!=0), 'NAME_CONTRACT_STATUS'] = 'Active'
## CNT_INSTALMENT_FUTURE=0 and Active. sample SK_ID_PREV==1998905, 2174168
df.loc[(df.CNT_INSTALMENT_FUTURE==0) & (df.NAME_CONTRACT_STATUS=='Active'), 'NAME_CONTRACT_STATUS'] = 'Completed'
## remove duplicated CNT_INSTALMENT_FUTURE=0. sample SK_ID_PREV==2601827
df_0 = df[df['CNT_INSTALMENT_FUTURE']==0]
df_1 = df[df['CNT_INSTALMENT_FUTURE']>0]
df_0['NAME_CONTRACT_STATUS'] = 'Completed'
df_0.sort_values(['SK_ID_PREV', 'MONTHS_BALANCE'], ascending=[True, False], inplace=True)
df_0.drop_duplicates('SK_ID_PREV', keep='last', inplace=True)
df = pd.concat([df_0, df_1], ignore_index=True)
del df_0, df_1; gc.collect()
# TODO: end in active. 1002879
# df['CNT_INSTALMENT_FUTURE_min'] = df.groupby('SK_ID_PREV').CNT_INSTALMENT_FUTURE.transform('min')
# df['MONTHS_BALANCE_max'] = df.groupby('SK_ID_PREV').MONTHS_BALANCE.transform('max')
# df.loc[(df.CNT_INSTALMENT_FUTURE_min!=0) & (df.MONTHS_BALANCE_max!=-1)]
df['CNT_INSTALMENT-m-CNT_INSTALMENT_FUTURE'] = df['CNT_INSTALMENT'] - df['CNT_INSTALMENT_FUTURE']
df['CNT_INSTALMENT_FUTURE-d-CNT_INSTALMENT'] = df['CNT_INSTALMENT_FUTURE'] / df['CNT_INSTALMENT']
df.sort_values(['SK_ID_PREV', 'MONTHS_BALANCE'], inplace=True)
df.reset_index(drop=True, inplace=True)
col = ['CNT_INSTALMENT_FUTURE', 'SK_DPD', 'SK_DPD_DEF']
def multi_pos(c):
ret_diff = []
ret_pctchng = []
key_bk = x_bk = None
for key, x in df[['SK_ID_PREV', c]].values:
# for key, x in tqdm(df[['SK_ID_CURR', c]].values, mininterval=30):
if key_bk is None:
ret_diff.append(None)
ret_pctchng.append(None)
else:
if key_bk == key:
ret_diff.append(x - x_bk)
ret_pctchng.append( (x_bk-x) / x_bk)
else:
ret_diff.append(None)
ret_pctchng.append(None)
key_bk = key
x_bk = x
ret_diff = pd.Series(ret_diff, name=f'{c}_diff')
ret_pctchng = pd.Series(ret_pctchng, name=f'{c}_pctchange')
ret = pd.concat([ret_diff, ret_pctchng], axis=1)
return ret
pool = Pool(len(col))
callback = pd.concat(pool.map(multi_pos, col), axis=1)
print('===== POS ====')
print(callback.columns.tolist())
pool.close()
df = pd.concat([df, callback], axis=1)
df['SK_DPD-m-SK_DPD_DEF'] = df['SK_DPD'] - df['SK_DPD_DEF']
# df['SK_DPD_diff_over0'] = (df['SK_DPD_diff']>0)*1
# df['SK_DPD_diff_over5'] = (df['SK_DPD_diff']>5)*1
# df['SK_DPD_diff_over10'] = (df['SK_DPD_diff']>10)*1
# df['SK_DPD_diff_over15'] = (df['SK_DPD_diff']>15)*1
# df['SK_DPD_diff_over20'] = (df['SK_DPD_diff']>20)*1
# df['SK_DPD_diff_over25'] = (df['SK_DPD_diff']>25)*1
df.replace(np.inf, np.nan, inplace=True) # TODO: any other plan?
df.replace(-np.inf, np.nan, inplace=True)
utils.to_pickles(df, '../data/POS_CASH_balance', utils.SPLIT_SIZE)
elif p==3:
# =============================================================================
# ins
# =============================================================================
"""
df = utils.read_pickles('../data/installments_payments')
"""
df = pd.read_csv('../input/installments_payments.csv.zip')
trte = get_trte()
df = pd.merge(df, trte, on='SK_ID_CURR', how='left')
prev = pd.read_csv('../input/previous_application.csv.zip',
usecols=['SK_ID_PREV', 'CNT_PAYMENT', 'AMT_ANNUITY'])
prev['CNT_PAYMENT'].replace(0, np.nan, inplace=True)
# prep_prev(prev)
df = pd.merge(df, prev, on='SK_ID_PREV', how='left')
del trte, prev; gc.collect()
df['month'] = (df['DAYS_ENTRY_PAYMENT']/30).map(np.floor)
# app
df['DAYS_ENTRY_PAYMENT-m-app_DAYS_BIRTH'] = df['DAYS_ENTRY_PAYMENT'] - df['app_DAYS_BIRTH']
df['DAYS_ENTRY_PAYMENT-m-app_DAYS_EMPLOYED'] = df['DAYS_ENTRY_PAYMENT'] - df['app_DAYS_EMPLOYED']
df['DAYS_ENTRY_PAYMENT-m-app_DAYS_REGISTRATION'] = df['DAYS_ENTRY_PAYMENT'] - df['app_DAYS_REGISTRATION']
df['DAYS_ENTRY_PAYMENT-m-app_DAYS_ID_PUBLISH'] = df['DAYS_ENTRY_PAYMENT'] - df['app_DAYS_ID_PUBLISH']
df['DAYS_ENTRY_PAYMENT-m-app_DAYS_LAST_PHONE_CHANGE'] = df['DAYS_ENTRY_PAYMENT'] - df['app_DAYS_LAST_PHONE_CHANGE']
df['AMT_PAYMENT-d-app_AMT_INCOME_TOTAL'] = df['AMT_PAYMENT'] / df['app_AMT_INCOME_TOTAL']
df['AMT_PAYMENT-d-app_AMT_CREDIT'] = df['AMT_PAYMENT'] / df['app_AMT_CREDIT']
df['AMT_PAYMENT-d-app_AMT_ANNUITY'] = df['AMT_PAYMENT'] / df['app_AMT_ANNUITY']
df['AMT_PAYMENT-d-app_AMT_GOODS_PRICE'] = df['AMT_PAYMENT'] / df['app_AMT_GOODS_PRICE']
# prev
df['NUM_INSTALMENT_ratio'] = df['NUM_INSTALMENT_NUMBER'] / df['CNT_PAYMENT']
df['AMT_PAYMENT-d-AMT_ANNUITY'] = df['AMT_PAYMENT'] / df['AMT_ANNUITY']
df['days_delayed_payment'] = df['DAYS_ENTRY_PAYMENT'] - df['DAYS_INSTALMENT']
df['amt_ratio'] = df['AMT_PAYMENT'] / df['AMT_INSTALMENT']
df['amt_delta'] = df['AMT_INSTALMENT'] - df['AMT_PAYMENT']
df['days_weighted_delay'] = df['amt_ratio'] * df['days_delayed_payment']
# Days past due and days before due (no negative values)
df['DPD'] = df['DAYS_ENTRY_PAYMENT'] - df['DAYS_INSTALMENT']
df['DBD'] = df['DAYS_INSTALMENT'] - df['DAYS_ENTRY_PAYMENT']
df['DPD'] = df['DPD'].apply(lambda x: x if x > 0 else 0)
df['DBD'] = df['DBD'].apply(lambda x: x if x > 0 else 0)
decay = 0.0003 # decay rate per a day
feature = f'days_weighted_delay_tsw3' # Time Series Weight
df[feature] = df['days_weighted_delay'] * (1 + (df['DAYS_ENTRY_PAYMENT']*decay) )
# df_tmp = pd.DataFrame()
# for i in range(0, 50, 5):
# c1 = f'delayed_day_over{i}'
# df_tmp[c1] = (df['days_delayed_payment']>i)*1
#
# c2 = f'delayed_money_{i}'
# df_tmp[c2] = df_tmp[c1] * df.AMT_PAYMENT
#
# c3 = f'delayed_money_ratio_{i}'
# df_tmp[c3] = df_tmp[c1] * df.amt_ratio
#
# c1 = f'not-delayed_day_{i}'
# df_tmp[c1] = (df['days_delayed_payment']<=i)*1
#
# c2 = f'not-delayed_money_{i}'
# df_tmp[c2] = df_tmp[c1] * df.AMT_PAYMENT
#
# c3 = f'not-delayed_money_ratio_{i}'
# df_tmp[c3] = df_tmp[c1] * df.amt_ratio
#
# df = pd.concat([df, df_tmp], axis=1)
df.replace(np.inf, np.nan, inplace=True) # TODO: any other plan?
df.replace(-np.inf, np.nan, inplace=True)
utils.to_pickles(df, '../data/installments_payments', utils.SPLIT_SIZE)
utils.to_pickles(df[df['days_delayed_payment']>0].reset_index(drop=True),
'../data/installments_payments_delay', utils.SPLIT_SIZE)
utils.to_pickles(df[df['days_delayed_payment']<=0].reset_index(drop=True),
'../data/installments_payments_notdelay', utils.SPLIT_SIZE)
elif p==4:
# =============================================================================
# credit card
# =============================================================================
"""
df = utils.read_pickles('../data/credit_card_balance')
"""
df = pd.read_csv('../input/credit_card_balance.csv.zip')
df = pd.merge(df, get_trte(), on='SK_ID_CURR', how='left')
df[col_app_day] = df[col_app_day]/30
# app
df['AMT_BALANCE-d-app_AMT_INCOME_TOTAL'] = df['AMT_BALANCE'] / df['app_AMT_INCOME_TOTAL']
df['AMT_BALANCE-d-app_AMT_CREDIT'] = df['AMT_BALANCE'] / df['app_AMT_CREDIT']
df['AMT_BALANCE-d-app_AMT_ANNUITY'] = df['AMT_BALANCE'] / df['app_AMT_ANNUITY']
df['AMT_BALANCE-d-app_AMT_GOODS_PRICE'] = df['AMT_BALANCE'] / df['app_AMT_GOODS_PRICE']
df['AMT_DRAWINGS_CURRENT-d-app_AMT_INCOME_TOTAL'] = df['AMT_DRAWINGS_CURRENT'] / df['app_AMT_INCOME_TOTAL']
df['AMT_DRAWINGS_CURRENT-d-app_AMT_CREDIT'] = df['AMT_DRAWINGS_CURRENT'] / df['app_AMT_CREDIT']
df['AMT_DRAWINGS_CURRENT-d-app_AMT_ANNUITY'] = df['AMT_DRAWINGS_CURRENT'] / df['app_AMT_ANNUITY']
df['AMT_DRAWINGS_CURRENT-d-app_AMT_GOODS_PRICE'] = df['AMT_DRAWINGS_CURRENT'] / df['app_AMT_GOODS_PRICE']
for c in col_app_day:
print(f'MONTHS_BALANCE-m-{c}')
df[f'MONTHS_BALANCE-m-{c}'] = df['MONTHS_BALANCE'] - df[c]
df['AMT_BALANCE-d-AMT_CREDIT_LIMIT_ACTUAL'] = df['AMT_BALANCE'] / df['AMT_CREDIT_LIMIT_ACTUAL']
df['AMT_BALANCE-d-AMT_DRAWINGS_CURRENT'] = df['AMT_BALANCE'] / df['AMT_DRAWINGS_CURRENT']
df['AMT_DRAWINGS_CURRENT-d-AMT_CREDIT_LIMIT_ACTUAL'] = df['AMT_DRAWINGS_CURRENT'] / df['AMT_CREDIT_LIMIT_ACTUAL']
df['AMT_TOTAL_RECEIVABLE-m-AMT_RECEIVABLE_PRINCIPAL'] = df['AMT_TOTAL_RECEIVABLE'] - df['AMT_RECEIVABLE_PRINCIPAL']
df['AMT_RECEIVABLE_PRINCIPAL-d-AMT_TOTAL_RECEIVABLE'] = df['AMT_RECEIVABLE_PRINCIPAL'] / df['AMT_TOTAL_RECEIVABLE']
df['SK_DPD-m-SK_DPD_DEF'] = df['SK_DPD'] - df['SK_DPD_DEF']
df['SK_DPD-m-SK_DPD_DEF_over0'] = (df['SK_DPD-m-SK_DPD_DEF']>0)*1
df['SK_DPD-m-SK_DPD_DEF_over5'] = (df['SK_DPD-m-SK_DPD_DEF']>5)*1
df['SK_DPD-m-SK_DPD_DEF_over10'] = (df['SK_DPD-m-SK_DPD_DEF']>10)*1
df['SK_DPD-m-SK_DPD_DEF_over15'] = (df['SK_DPD-m-SK_DPD_DEF']>15)*1
df['SK_DPD-m-SK_DPD_DEF_over20'] = (df['SK_DPD-m-SK_DPD_DEF']>20)*1
df['SK_DPD-m-SK_DPD_DEF_over25'] = (df['SK_DPD-m-SK_DPD_DEF']>25)*1
col = ['AMT_BALANCE', 'AMT_CREDIT_LIMIT_ACTUAL', 'AMT_DRAWINGS_ATM_CURRENT',
'AMT_DRAWINGS_CURRENT', 'AMT_DRAWINGS_OTHER_CURRENT',
'AMT_DRAWINGS_POS_CURRENT', 'AMT_INST_MIN_REGULARITY',
'AMT_PAYMENT_CURRENT', 'AMT_PAYMENT_TOTAL_CURRENT',
'AMT_RECEIVABLE_PRINCIPAL', 'AMT_RECIVABLE', 'AMT_TOTAL_RECEIVABLE',
'CNT_DRAWINGS_ATM_CURRENT', 'CNT_DRAWINGS_CURRENT',
'CNT_DRAWINGS_OTHER_CURRENT', 'CNT_DRAWINGS_POS_CURRENT',
'CNT_INSTALMENT_MATURE_CUM', 'SK_DPD',
'SK_DPD_DEF', 'AMT_BALANCE-d-app_AMT_INCOME_TOTAL',
'AMT_BALANCE-d-app_AMT_CREDIT', 'AMT_BALANCE-d-app_AMT_ANNUITY',
'AMT_BALANCE-d-app_AMT_GOODS_PRICE', 'AMT_DRAWINGS_CURRENT-d-app_AMT_INCOME_TOTAL',
'AMT_DRAWINGS_CURRENT-d-app_AMT_CREDIT', 'AMT_DRAWINGS_CURRENT-d-app_AMT_ANNUITY',
'AMT_DRAWINGS_CURRENT-d-app_AMT_GOODS_PRICE', 'AMT_BALANCE-d-AMT_CREDIT_LIMIT_ACTUAL',
'AMT_BALANCE-d-AMT_DRAWINGS_CURRENT', 'AMT_DRAWINGS_CURRENT-d-AMT_CREDIT_LIMIT_ACTUAL',
'AMT_TOTAL_RECEIVABLE-m-AMT_RECEIVABLE_PRINCIPAL',
'AMT_RECEIVABLE_PRINCIPAL-d-AMT_TOTAL_RECEIVABLE'
]
df.sort_values(['SK_ID_PREV', 'MONTHS_BALANCE'], inplace=True)
df.reset_index(drop=True, inplace=True)
def multi_cre(c):
ret_diff = []
ret_pctchng = []
key_bk = x_bk = None
for key, x in df[['SK_ID_PREV', c]].values:
if key_bk is None:
ret_diff.append(None)
ret_pctchng.append(None)
else:
if key_bk == key:
ret_diff.append(x - x_bk)
ret_pctchng.append( (x_bk-x) / x_bk)
else:
ret_diff.append(None)
ret_pctchng.append(None)
key_bk = key
x_bk = x
ret_diff = pd.Series(ret_diff, name=f'{c}_diff')
ret_pctchng = pd.Series(ret_pctchng, name=f'{c}_pctchange')
ret = pd.concat([ret_diff, ret_pctchng], axis=1)
return ret
pool = Pool(len(col))
callback1 = pd.concat(pool.map(multi_cre, col), axis=1)
print('===== CRE ====')
col = callback1.columns.tolist()
print(col)
pool.close()
# callback1['SK_ID_PREV'] = df['SK_ID_PREV']
df = pd.concat([df, callback1], axis=1)
del callback1; gc.collect()
pool = Pool(10)
callback2 = pd.concat(pool.map(multi_cre, col), axis=1)
print('===== CRE ====')
col = callback2.columns.tolist()
print(col)
pool.close()
df = pd.concat([df, callback2], axis=1)
del callback2; gc.collect()
df.replace(np.inf, np.nan, inplace=True) # TODO: any other plan?
df.replace(-np.inf, np.nan, inplace=True)
utils.to_pickles(df, '../data/credit_card_balance', utils.SPLIT_SIZE)
elif p==5:
# =============================================================================
# bureau
# =============================================================================
df = pd.read_csv('../input/bureau.csv.zip')
df = pd.merge(df, get_trte(), on='SK_ID_CURR', how='left')
col_bure_money = ['AMT_CREDIT_SUM', 'AMT_CREDIT_SUM_DEBT',
'AMT_CREDIT_SUM_LIMIT', 'AMT_CREDIT_SUM_OVERDUE']
col_bure_day = ['DAYS_CREDIT', 'DAYS_CREDIT_ENDDATE', 'DAYS_ENDDATE_FACT']
# app
for c1 in col_bure_money:
for c2 in col_app_money:
# print(f"'{c1}-d-{c2}',")
df[f'{c1}-d-{c2}'] = df[c1] / df[c2]
for c1 in col_bure_day:
for c2 in col_app_day:
# print(f"'{c1}-m-{c2}',")
df[f'{c1}-m-{c2}'] = df[c1] - df[c2]
df[f'{c1}-d-{c2}'] = df[c1] / df[c2]
df['DAYS_CREDIT_ENDDATE-m-DAYS_CREDIT'] = df['DAYS_CREDIT_ENDDATE'] - df['DAYS_CREDIT']
df['DAYS_ENDDATE_FACT-m-DAYS_CREDIT'] = df['DAYS_ENDDATE_FACT'] - df['DAYS_CREDIT']
df['DAYS_ENDDATE_FACT-m-DAYS_CREDIT_ENDDATE'] = df['DAYS_ENDDATE_FACT'] - df['DAYS_CREDIT_ENDDATE']
df['DAYS_CREDIT_UPDATE-m-DAYS_CREDIT'] = df['DAYS_CREDIT_UPDATE'] - df['DAYS_CREDIT']
df['DAYS_CREDIT_UPDATE-m-DAYS_CREDIT_ENDDATE'] = df['DAYS_CREDIT_UPDATE'] - df['DAYS_CREDIT_ENDDATE']
df['DAYS_CREDIT_UPDATE-m-DAYS_ENDDATE_FACT'] = df['DAYS_CREDIT_UPDATE'] - df['DAYS_ENDDATE_FACT']
df['AMT_CREDIT_SUM-m-AMT_CREDIT_SUM_DEBT'] = df['AMT_CREDIT_SUM'] - df['AMT_CREDIT_SUM_DEBT']
df['AMT_CREDIT_SUM_DEBT-d-AMT_CREDIT_SUM'] = df['AMT_CREDIT_SUM_DEBT'] / df['AMT_CREDIT_SUM']
df['AMT_CREDIT_SUM-m-AMT_CREDIT_SUM_DEBT-d-AMT_CREDIT_SUM_LIMIT'] = df['AMT_CREDIT_SUM-m-AMT_CREDIT_SUM_DEBT'] / df['AMT_CREDIT_SUM_LIMIT']
df['AMT_CREDIT_SUM_DEBT-d-AMT_CREDIT_SUM_LIMIT'] = df['AMT_CREDIT_SUM_DEBT'] / df['AMT_CREDIT_SUM_LIMIT']
df['AMT_CREDIT_SUM_DEBT-p-AMT_CREDIT_SUM_LIMIT'] = df['AMT_CREDIT_SUM_DEBT'] + df['AMT_CREDIT_SUM_LIMIT']
df['AMT_CREDIT_SUM-d-debt-p-AMT_CREDIT_SUM_DEBT-p-AMT_CREDIT_SUM_LIMIT'] = df['AMT_CREDIT_SUM'] / df['AMT_CREDIT_SUM_DEBT-p-AMT_CREDIT_SUM_LIMIT']
col = ['AMT_CREDIT_MAX_OVERDUE', 'CNT_CREDIT_PROLONG',
'AMT_CREDIT_SUM', 'AMT_CREDIT_SUM_DEBT', 'AMT_CREDIT_SUM_LIMIT',
'AMT_CREDIT_SUM_OVERDUE', 'DAYS_CREDIT_UPDATE',
'AMT_ANNUITY', 'AMT_CREDIT_SUM-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT_SUM-d-app_AMT_CREDIT', 'AMT_CREDIT_SUM-d-app_AMT_ANNUITY',
'AMT_CREDIT_SUM-d-app_AMT_GOODS_PRICE',
'AMT_CREDIT_SUM_DEBT-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT_SUM_DEBT-d-app_AMT_CREDIT',
'AMT_CREDIT_SUM_DEBT-d-app_AMT_ANNUITY',
'AMT_CREDIT_SUM_DEBT-d-app_AMT_GOODS_PRICE',
'AMT_CREDIT_SUM_LIMIT-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT_SUM_LIMIT-d-app_AMT_CREDIT',
'AMT_CREDIT_SUM_LIMIT-d-app_AMT_ANNUITY',
'AMT_CREDIT_SUM_LIMIT-d-app_AMT_GOODS_PRICE',
'AMT_CREDIT_SUM_OVERDUE-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT_SUM_OVERDUE-d-app_AMT_CREDIT',
'AMT_CREDIT_SUM_OVERDUE-d-app_AMT_ANNUITY',
'AMT_CREDIT_SUM_OVERDUE-d-app_AMT_GOODS_PRICE',
'AMT_CREDIT_SUM-m-AMT_CREDIT_SUM_DEBT',
'AMT_CREDIT_SUM_DEBT-d-AMT_CREDIT_SUM',
'AMT_CREDIT_SUM-m-AMT_CREDIT_SUM_DEBT-d-AMT_CREDIT_SUM_LIMIT',
'AMT_CREDIT_SUM_DEBT-d-AMT_CREDIT_SUM_LIMIT',
'AMT_CREDIT_SUM_DEBT-p-AMT_CREDIT_SUM_LIMIT',
'AMT_CREDIT_SUM-d-debt-p-AMT_CREDIT_SUM_DEBT-p-AMT_CREDIT_SUM_LIMIT'
]
df.sort_values(['SK_ID_CURR', 'DAYS_CREDIT'], inplace=True)
df.reset_index(drop=True, inplace=True)
def multi_b(c):
ret_diff = []
ret_pctchng = []
key_bk = x_bk = None
for key, x in df[['SK_ID_CURR', c]].values:
# for key, x in tqdm(df[['SK_ID_CURR', c]].values, mininterval=30):
if key_bk is None:
ret_diff.append(None)
ret_pctchng.append(None)
else:
if key_bk == key:
ret_diff.append(x - x_bk)
ret_pctchng.append( (x_bk-x) / x_bk)
else:
ret_diff.append(None)
ret_pctchng.append(None)
key_bk = key
x_bk = x
ret_diff = pd.Series(ret_diff, name=f'{c}_diff')
ret_pctchng = pd.Series(ret_pctchng, name=f'{c}_pctchange')
ret = pd.concat([ret_diff, ret_pctchng], axis=1)
return ret
pool = Pool(len(col))
callback = pd.concat(pool.map(multi_b, col), axis=1)
print('===== bureau ====')
print(callback.columns.tolist())
pool.close()
df = pd.concat([df, callback], axis=1)
df.replace(np.inf, np.nan, inplace=True) # TODO: any other plan?
df.replace(-np.inf, np.nan, inplace=True)
utils.to_pickles(df, '../data/bureau', utils.SPLIT_SIZE)
elif p==6:
# =============================================================================
# bureau_balance
# =============================================================================
df = pd.read_csv('../input/bureau_balance.csv.zip')
df.sort_values(['SK_ID_BUREAU', 'MONTHS_BALANCE'], inplace=True)
df = pd.get_dummies(df, columns=['STATUS'])
df.reset_index(drop=True, inplace=True)
# def multi_bb(c):
# ret_diff = []
# ret_pctchng = []
# key_bk = x_bk = None
# for key, x in df[['SK_ID_BUREAU', c]].values:
#
# if key_bk is None:
# ret_diff.append(None)
# ret_pctchng.append(None)
# else:
# if key_bk == key:
# ret_diff.append(x - x_bk)
# ret_pctchng.append( (x_bk-x) / x_bk)
# else:
# ret_diff.append(None)
# ret_pctchng.append(None)
# key_bk = key
# x_bk = x
#
# ret_diff = pd.Series(ret_diff, name=f'{c}_diff')
# ret_pctchng = pd.Series(ret_pctchng, name=f'{c}_pctchange')
# ret = pd.concat([ret_diff, ret_pctchng], axis=1)
#
# return ret
#
# pool = Pool(len(col))
# callback = pd.concat(pool.map(multi_bb, col), axis=1)
# print('===== bureau_balance ====')
# print(callback.columns.tolist())
# pool.close()
# df = pd.concat([df, callback], axis=1)
utils.to_pickles(df, '../data/bureau_balance', utils.SPLIT_SIZE)
elif p==7:
# =============================================================================
# future
# =============================================================================
df = pd.merge(pd.read_csv('../data/future_application_v3.csv.gz'),
get_trte(), on='SK_ID_CURR', how='left')
# df = pd.merge(pd.read_csv('../input/previous_application.csv.zip'),
# get_trte(), on='SK_ID_CURR', how='left')
prep_prev(df)
df['FLAG_LAST_APPL_PER_CONTRACT'] = (df['FLAG_LAST_APPL_PER_CONTRACT']=='Y')*1
# day
for c in ['DAYS_FIRST_DRAWING', 'DAYS_FIRST_DUE', 'DAYS_LAST_DUE_1ST_VERSION',
'DAYS_LAST_DUE', 'DAYS_TERMINATION']:
df.loc[df[c]==365243, c] = np.nan
df['days_fdue-m-fdrw'] = df['DAYS_FIRST_DUE'] - df['DAYS_FIRST_DRAWING']
df['days_ldue1-m-fdrw'] = df['DAYS_LAST_DUE_1ST_VERSION'] - df['DAYS_FIRST_DRAWING']
df['days_ldue-m-fdrw'] = df['DAYS_LAST_DUE'] - df['DAYS_FIRST_DRAWING'] # total span
df['days_trm-m-fdrw'] = df['DAYS_TERMINATION'] - df['DAYS_FIRST_DRAWING']
df['days_ldue1-m-fdue'] = df['DAYS_LAST_DUE_1ST_VERSION'] - df['DAYS_FIRST_DUE']
df['days_ldue-m-fdue'] = df['DAYS_LAST_DUE'] - df['DAYS_FIRST_DUE']
df['days_trm-m-fdue'] = df['DAYS_TERMINATION'] - df['DAYS_FIRST_DUE']
df['days_ldue-m-ldue1'] = df['DAYS_LAST_DUE'] - df['DAYS_LAST_DUE_1ST_VERSION']
df['days_trm-m-ldue1'] = df['DAYS_TERMINATION'] - df['DAYS_LAST_DUE_1ST_VERSION']
df['days_trm-m-ldue'] = df['DAYS_TERMINATION'] - df['DAYS_LAST_DUE']
# money
df['total_debt'] = df['AMT_ANNUITY'] * df['CNT_PAYMENT']
df['AMT_CREDIT-d-total_debt'] = df['AMT_CREDIT'] / df['total_debt']
df['AMT_GOODS_PRICE-d-total_debt'] = df['AMT_GOODS_PRICE'] / df['total_debt']
df['AMT_GOODS_PRICE-d-AMT_CREDIT'] = df['AMT_GOODS_PRICE'] / df['AMT_CREDIT']
# app & money
df['AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = df['AMT_ANNUITY'] / df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-d-app_AMT_INCOME_TOTAL'] = df['AMT_APPLICATION'] / df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = df['AMT_CREDIT'] / df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = df['AMT_GOODS_PRICE'] / df['app_AMT_INCOME_TOTAL']
df['AMT_ANNUITY-m-app_AMT_INCOME_TOTAL'] = df['AMT_ANNUITY'] - df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-m-app_AMT_INCOME_TOTAL'] = df['AMT_APPLICATION'] - df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-m-app_AMT_INCOME_TOTAL'] = df['AMT_CREDIT'] - df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-m-app_AMT_INCOME_TOTAL'] = df['AMT_GOODS_PRICE'] - df['app_AMT_INCOME_TOTAL']
df['AMT_ANNUITY-d-app_AMT_CREDIT'] = df['AMT_ANNUITY'] / df['app_AMT_CREDIT']
df['AMT_APPLICATION-d-app_AMT_CREDIT'] = df['AMT_APPLICATION'] / df['app_AMT_CREDIT']
df['AMT_CREDIT-d-app_AMT_CREDIT'] = df['AMT_CREDIT'] / df['app_AMT_CREDIT']
df['AMT_GOODS_PRICE-d-app_AMT_CREDIT'] = df['AMT_GOODS_PRICE'] / df['app_AMT_CREDIT']
df['AMT_ANNUITY-m-app_AMT_CREDIT'] = df['AMT_ANNUITY'] - df['app_AMT_CREDIT']
df['AMT_APPLICATION-m-app_AMT_CREDIT'] = df['AMT_APPLICATION'] - df['app_AMT_CREDIT']
df['AMT_CREDIT-m-app_AMT_CREDIT'] = df['AMT_CREDIT'] - df['app_AMT_CREDIT']
df['AMT_GOODS_PRICE-m-app_AMT_CREDIT'] = df['AMT_GOODS_PRICE'] - df['app_AMT_CREDIT']
df['AMT_ANNUITY-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = (df['AMT_ANNUITY'] - df['app_AMT_CREDIT']) / df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = (df['AMT_APPLICATION'] - df['app_AMT_CREDIT']) / df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = (df['AMT_CREDIT'] - df['app_AMT_CREDIT']) / df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL'] = (df['AMT_GOODS_PRICE'] - df['app_AMT_CREDIT']) / df['app_AMT_INCOME_TOTAL']
df['AMT_ANNUITY-d-app_AMT_ANNUITY'] = df['AMT_ANNUITY'] / df['app_AMT_ANNUITY']
df['AMT_APPLICATION-d-app_AMT_ANNUITY'] = df['AMT_APPLICATION'] / df['app_AMT_ANNUITY']
df['AMT_CREDIT-d-app_AMT_ANNUITY'] = df['AMT_CREDIT'] / df['app_AMT_ANNUITY']
df['AMT_GOODS_PRICE-d-app_AMT_ANNUITY'] = df['AMT_GOODS_PRICE'] / df['app_AMT_ANNUITY']
df['AMT_ANNUITY-m-app_AMT_ANNUITY'] = df['AMT_ANNUITY'] - df['app_AMT_ANNUITY']
df['AMT_APPLICATION-m-app_AMT_ANNUITY'] = df['AMT_APPLICATION'] - df['app_AMT_ANNUITY']
df['AMT_CREDIT-m-app_AMT_ANNUITY'] = df['AMT_CREDIT'] - df['app_AMT_ANNUITY']
df['AMT_GOODS_PRICE-m-app_AMT_ANNUITY'] = df['AMT_GOODS_PRICE'] - df['app_AMT_ANNUITY']
df['AMT_ANNUITY-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = (df['AMT_ANNUITY'] - df['app_AMT_ANNUITY']) / df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = (df['AMT_APPLICATION'] - df['app_AMT_ANNUITY']) / df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = (df['AMT_CREDIT'] - df['app_AMT_ANNUITY']) / df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL'] = (df['AMT_GOODS_PRICE'] - df['app_AMT_ANNUITY']) / df['app_AMT_INCOME_TOTAL']
df['AMT_ANNUITY-d-app_AMT_GOODS_PRICE'] = df['AMT_ANNUITY'] / df['app_AMT_GOODS_PRICE']
df['AMT_APPLICATION-d-app_AMT_GOODS_PRICE'] = df['AMT_APPLICATION'] / df['app_AMT_GOODS_PRICE']
df['AMT_CREDIT-d-app_AMT_GOODS_PRICE'] = df['AMT_CREDIT'] / df['app_AMT_GOODS_PRICE']
df['AMT_GOODS_PRICE-d-app_AMT_GOODS_PRICE'] = df['AMT_GOODS_PRICE'] / df['app_AMT_GOODS_PRICE']
df['AMT_ANNUITY-m-app_AMT_GOODS_PRICE'] = df['AMT_ANNUITY'] - df['app_AMT_GOODS_PRICE']
df['AMT_APPLICATION-m-app_AMT_GOODS_PRICE'] = df['AMT_APPLICATION'] - df['app_AMT_GOODS_PRICE']
df['AMT_CREDIT-m-app_AMT_GOODS_PRICE'] = df['AMT_CREDIT'] - df['app_AMT_GOODS_PRICE']
df['AMT_GOODS_PRICE-m-app_AMT_GOODS_PRICE'] = df['AMT_GOODS_PRICE'] - df['app_AMT_GOODS_PRICE']
df['AMT_ANNUITY-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = (df['AMT_ANNUITY'] - df['app_AMT_GOODS_PRICE']) / df['app_AMT_INCOME_TOTAL']
df['AMT_APPLICATION-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = (df['AMT_APPLICATION'] - df['app_AMT_GOODS_PRICE']) / df['app_AMT_INCOME_TOTAL']
df['AMT_CREDIT-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = (df['AMT_CREDIT'] - df['app_AMT_GOODS_PRICE']) / df['app_AMT_INCOME_TOTAL']
df['AMT_GOODS_PRICE-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL'] = (df['AMT_GOODS_PRICE'] - df['app_AMT_GOODS_PRICE']) / df['app_AMT_INCOME_TOTAL']
# nejumi
f_name='nejumi'; init_rate=0.9; n_iter=500
df['AMT_ANNUITY_d_AMT_CREDIT_temp'] = df.AMT_ANNUITY / df.AMT_CREDIT
df[f_name] = df['AMT_ANNUITY_d_AMT_CREDIT_temp']*((1 + init_rate)**df.CNT_PAYMENT - 1)/((1 + init_rate)**df.CNT_PAYMENT)
for i in range(n_iter):
df[f_name] = df['AMT_ANNUITY_d_AMT_CREDIT_temp']*((1 + df[f_name])**df.CNT_PAYMENT - 1)/((1 + df[f_name])**df.CNT_PAYMENT)
df.drop(['AMT_ANNUITY_d_AMT_CREDIT_temp'], axis=1, inplace=True)
df.sort_values(['SK_ID_CURR', 'DAYS_DECISION'], inplace=True)
df.reset_index(drop=True, inplace=True)
col = [
'total_debt',
'AMT_CREDIT-d-total_debt',
'AMT_GOODS_PRICE-d-total_debt',
'AMT_GOODS_PRICE-d-AMT_CREDIT',
'AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'AMT_ANNUITY-d-app_AMT_CREDIT',
'AMT_APPLICATION-d-app_AMT_CREDIT',
'AMT_CREDIT-d-app_AMT_CREDIT',
'AMT_GOODS_PRICE-d-app_AMT_CREDIT',
'AMT_ANNUITY-d-app_AMT_ANNUITY',
'AMT_APPLICATION-d-app_AMT_ANNUITY',
'AMT_CREDIT-d-app_AMT_ANNUITY',
'AMT_GOODS_PRICE-d-app_AMT_ANNUITY',
'AMT_ANNUITY-d-app_AMT_GOODS_PRICE',
'AMT_APPLICATION-d-app_AMT_GOODS_PRICE',
'AMT_CREDIT-d-app_AMT_GOODS_PRICE',
'AMT_GOODS_PRICE-d-app_AMT_GOODS_PRICE',
'AMT_ANNUITY-m-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-m-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-m-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-m-app_AMT_INCOME_TOTAL',
'AMT_ANNUITY-m-app_AMT_CREDIT',
'AMT_APPLICATION-m-app_AMT_CREDIT',
'AMT_CREDIT-m-app_AMT_CREDIT',
'AMT_GOODS_PRICE-m-app_AMT_CREDIT',
'AMT_ANNUITY-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-m-app_AMT_CREDIT-d-app_AMT_INCOME_TOTAL',
'AMT_ANNUITY-m-app_AMT_ANNUITY',
'AMT_APPLICATION-m-app_AMT_ANNUITY',
'AMT_CREDIT-m-app_AMT_ANNUITY',
'AMT_GOODS_PRICE-m-app_AMT_ANNUITY',
'AMT_ANNUITY-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-m-app_AMT_ANNUITY-d-app_AMT_INCOME_TOTAL',
'AMT_ANNUITY-m-app_AMT_GOODS_PRICE',
'AMT_APPLICATION-m-app_AMT_GOODS_PRICE',
'AMT_CREDIT-m-app_AMT_GOODS_PRICE',
'AMT_GOODS_PRICE-m-app_AMT_GOODS_PRICE',
'AMT_ANNUITY-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'AMT_APPLICATION-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'AMT_CREDIT-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'AMT_GOODS_PRICE-m-app_AMT_GOODS_PRICE-d-app_AMT_INCOME_TOTAL',
'nejumi'
]
def multi_prev(c):
ret_diff = []
ret_pctchng = []
key_bk = x_bk = None
for key, x in df[['SK_ID_CURR', c]].values:
# for key, x in tqdm(df[['SK_ID_CURR', c]].values, mininterval=30):
if key_bk is None:
ret_diff.append(None)
ret_pctchng.append(None)
else:
if key_bk == key:
ret_diff.append(x - x_bk)
ret_pctchng.append( (x_bk-x) / x_bk)
else:
ret_diff.append(None)
ret_pctchng.append(None)
key_bk = key
x_bk = x
ret_diff = pd.Series(ret_diff, name=f'{c}_diff')
ret_pctchng = pd.Series(ret_pctchng, name=f'{c}_pctchange')
ret = pd.concat([ret_diff, ret_pctchng], axis=1)
return ret
pool = Pool(len(col))
callback = pd.concat(pool.map(multi_prev, col), axis=1)
print('===== PREV ====')
print(callback.columns.tolist())
pool.close()
df = pd.concat([df, callback], axis=1)
# app & day
col_prev = ['DAYS_FIRST_DRAWING', 'DAYS_FIRST_DUE', 'DAYS_LAST_DUE_1ST_VERSION',
'DAYS_LAST_DUE', 'DAYS_TERMINATION']
for c1 in col_prev:
for c2 in col_app_day:
# print(f"'{c1}-m-{c2}',")
df[f'{c1}-m-{c2}'] = df[c1] - df[c2]
df[f'{c1}-d-{c2}'] = df[c1] / df[c2]
df['cnt_paid'] = df.apply(lambda x: min( np.ceil(x['DAYS_FIRST_DUE']/-30), x['CNT_PAYMENT'] ), axis=1)
df['cnt_paid_ratio'] = df['cnt_paid'] / df['CNT_PAYMENT']
df['cnt_unpaid'] = df['CNT_PAYMENT'] - df['cnt_paid']
df['amt_paid'] = df['AMT_ANNUITY'] * df['cnt_paid']
# df['amt_paid_ratio'] = df['amt_paid'] / df['total_debt'] # same as cnt_paid_ratio
df['amt_unpaid'] = df['total_debt'] - df['amt_paid']
df['active'] = (df['cnt_unpaid']>0)*1
df['completed'] = (df['cnt_unpaid']==0)*1
# future payment
df_tmp = pd.DataFrame()
print('future payment')
rem_max = df['cnt_unpaid'].max() # 80
# rem_max = 1
df['cnt_unpaid_tmp'] = df['cnt_unpaid']
for i in range(int( rem_max )):
c = f'future_payment_{i+1}m'
df_tmp[c] = df['cnt_unpaid_tmp'].map(lambda x: min(x, 1)) * df['AMT_ANNUITY']
df_tmp.loc[df_tmp[c]==0, c] = np.nan
df['cnt_unpaid_tmp'] -= 1
df['cnt_unpaid_tmp'] = df['cnt_unpaid_tmp'].map(lambda x: max(x, 0))
# df['prev_future_payment_max'] = df.filter(regex='^prev_future_payment_').max(1)
del df['cnt_unpaid_tmp']
df = pd.concat([df, df_tmp], axis=1)
# past payment
df_tmp = pd.DataFrame()
print('past payment')
rem_max = df['cnt_paid'].max() # 72
df['cnt_paid_tmp'] = df['cnt_paid']
for i in range(int( rem_max )):
c = f'past_payment_{i+1}m'
df_tmp[c] = df['cnt_paid_tmp'].map(lambda x: min(x, 1)) * df['AMT_ANNUITY']
df_tmp.loc[df_tmp[c]==0, c] = np.nan
df['cnt_paid_tmp'] -= 1
df['cnt_paid_tmp'] = df['cnt_paid_tmp'].map(lambda x: max(x, 0))
# df['prev_past_payment_max'] = df.filter(regex='^prev_past_payment_').max(1)
del df['cnt_paid_tmp']
df = pd.concat([df, df_tmp], axis=1)
df['APP_CREDIT_PERC'] = df['AMT_APPLICATION'] / df['AMT_CREDIT']
#df.filter(regex='^amt_future_payment_')
df.replace(np.inf, np.nan, inplace=True) # TODO: any other plan?
df.replace(-np.inf, np.nan, inplace=True)
utils.to_pickles(df, '../data/future_application', utils.SPLIT_SIZE)
else:
pass
# return
# =============================================================================
# main
# =============================================================================
#pool = Pool(NTHREAD)
#callback = pool.map(multi, range(10))
#pool.close()
#multi(int(argv[1]))
#==============================================================================
utils.end(__file__)
| 53.819444 | 157 | 0.566376 | 8,973 | 65,875 | 3.76407 | 0.044578 | 0.069637 | 0.070052 | 0.067446 | 0.859393 | 0.814449 | 0.767846 | 0.701347 | 0.643434 | 0.626025 | 0 | 0.011611 | 0.263939 | 65,875 | 1,223 | 158 | 53.863451 | 0.684953 | 0.117677 | 0 | 0.588307 | 0 | 0 | 0.448059 | 0.253155 | 0 | 0 | 0 | 0.004088 | 0 | 1 | 0.009744 | false | 0.001218 | 0.008526 | 0 | 0.028015 | 0.020706 | 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 |
64d3b05025d4081fff8c6d1a895da821bed8de6d | 43,253 | py | Python | linear_regression_least_squares_regression (1).py | azfar154/Machine-Learning-Traditional-Python | bb9a17f6c6c12d60e6508b1b20453cbd5c91f512 | [
"MIT"
] | 3 | 2019-11-03T05:21:39.000Z | 2020-02-08T18:21:21.000Z | linear_regression_least_squares_regression (1).py | azfar154/Machine-Learning-Traditional-Python | bb9a17f6c6c12d60e6508b1b20453cbd5c91f512 | [
"MIT"
] | null | null | null | linear_regression_least_squares_regression (1).py | azfar154/Machine-Learning-Traditional-Python | bb9a17f6c6c12d60e6508b1b20453cbd5c91f512 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Linear Regression Least Squares Regression
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/gist/azfar154/705e9db05fd2afaff5f92749e2cca3bc/copy-of-linear-regression-least-squares-regression.ipynb
**IMPORTANT READ ME!!!**
You must connect to a hosted gpu don't use your local environment.
You can choose to run programs using GPU acceleration or with a TPU
Dark Mode is amazing so like on the top bar go to Tools then Preferences then change the mode to dark.
AZFAR MOHAMED © High School South
Import important Libraries
"""
# Commented out IPython magic to ensure Python compatibility.
# %matplotlib notebook
import numpy as np
import pandas as pd
import seaborn as sn
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
"""Make a Linear Regression Set"""
from sklearn.datasets import make_regression
X_R1,y_R1=make_regression(n_samples=100,n_features=1,n_informative=1,bias=150.0,noise=30,random_state=0)
"""Make a 75% train and 25% test ratio"""
X_train,x_test,y_train,y_test=train_test_split(X_R1,y_R1,random_state=0)
"""Linear Regression Least Squares"""
from sklearn.linear_model import LinearRegression
#Normal Linear Regression doesn't need an alpha paramter
linreg=LinearRegression().fit(X_train,y_train)
print("The linear coef/w hat is {}".format(linreg.coef_))
print("The intercept/bias term is {}".format(linreg.intercept_))
print("The score for the training data is {:.2f}".format(linreg.score(X_train,y_train)))
print("The score for the testing data is {:.2f}".format(linreg.score(x_test,y_test)))
"""Plotting this Linear Regression"""
plt.figure(figsize=(5,4))
plt.title("Linear Regression:Least Squares")
plt.scatter(X_R1,y_R1,marker='o',s=50,alpha=0.8)
plt.plot(X_R1,X_R1*linreg.coef_+linreg.intercept_,'r-')
"""Ridge Regression"""
from sklearn.linear_model import Ridge
## Ridge Regression uses the L2 penalty which features normalization this is essential when you have features that have a huge impact on the y hat which is the output.
#L2 penalty helps the user for overfitting. Overfitting only benefits the training data. Ridge Regression uses the least squares critera for calculating the W and B but adds a large penalty to the coefficents.
#"In other words, all things being equal, if ridge regression finds two possible linear models that predict the training data values equally well, it will prefer the linear model that has a smaller overall sum of squared feature weights"
ridgeregress=Ridge(alpha=20).fit(X_train,y_train)
print('ridge regression linear model intercept: {}'
.format(ridgeregress.intercept_))
print('ridge regression linear model coeff:\n{}'
.format(ridgeregress.coef_))
print('R-squared score (training): {:.3f}'
.format(ridgeregress.score(X_train, y_train)))
print('R-squared score (test): {:.3f}'
.format(ridgeregress.score(x_test, y_test)))
print('Number of non-zero features: {}'.format(np.sum(ridgeregress.coef_ !=0)))
"""Finding the "best" alpha variable"""
for i in [1,10,20,50,100,200]:
ridgeregress=Ridge(alpha=i).fit(X_train,y_train)
print("When the alpha is",i)
print("The score is {:.2f} for the training data".format(ridgeregress.score(X_train,y_train)))
print("The score is {:.2f} for the training data".format(ridgeregress.score(x_test,y_test)))
"""Ridge Regression with feature normalization"""
#Scaler helps normalize the training and the test data we can use the MinMaxScaler)
scaler=MinMaxScaler()
x_train_scaled=scaler.fit_transform(X_train)
x_test_scaled=scaler.transform(x_test)
ridgeregressnorm=Ridge(alpha=20.0).fit(x_train_scaled,y_train)
print("Ridge regress noralization scores. Test:{:.2f} \n Training {:.2f}".format(ridgeregressnorm.score(x_train_scaled,y_train),ridgeregressnorm.score(x_test_scaled,y_test)))
"""Normalization will help your data.
LOOK AT THE DIFFERENCE BETWEEN THESE GRAPHS
https://towardsdatascience.com/scale-standardize-or-normalize-with-scikit-learn-6ccc7d176a02
If you want to find the amount of time to run a cell you can use the function %%time
"""
# Commented out IPython magic to ensure Python compatibility.
# %%time
# 6
# scaler=MinMaxScaler()
# x_train_scaled=scaler.fit_transform(X_train)
# x_test_scaled=scaler.transform(x_test)
# ridgeregressnorm=Ridge(alpha=20.0).fit(x_train_scaled,y_train)
#
# print("Ridge regress noralization scores. Test:{:.2f} \n Training {:.2f}".format(ridgeregressnorm.score(x_train_scaled,y_train),ridgeregressnorm.score(x_test_scaled,y_test)))
"""Without an external gpu it is usually impossible to achieve such speeds.
Formula:
Input=(x0,x1...x n)
Function:
y hat= w hat 0 x 0 ... w hat n x n +b hat
y hat is the output
w hat is the model coefficent/slope
b hat is the y intercept
Least Squares
RSS=(y-(w i*x+b)
Least Squares Ridge Regression:
RSS=(y-(w i*x+b)+a wj squared
a wj squared is the alpha L2 which prefers the linear model which has a smaller squared sum of feature weights
Lasso Regression
"""
# In this regression you take the square root of wj rather than squaring it which means that it favors few data with medium/large effect
from sklearn.linear_model import Lasso
lassoregress=Lasso().fit(X_train,y_train)
print("The average score for the training data is {:.2f}".format(lassoregress.score(X_train,y_train)))
print("The average score for the testing data is {:.2f}".format(lassoregress.score(x_test,y_test)))
print("The number of non zero features is {}.".format(np.sum(lassoregress.coef_!=0)))
#With the line of code above you can find if Lasso Regression is what you need for your data
"""Polynomial Features"""
#Generates new feature that can match some Addition of many polynomial features often leads to
#overfitting, so we often use polynomial features in combination with regression that has a regularization penalty, like ridge regression. This allows to use a much richer functions that can be used to fit ununsal data
#The degree of the polynomial shows how many variable participate at a time with this feature
from sklearn.preprocessing import PolynomialFeatures
# Making a more complex regression problem where these features are important in
from sklearn.datasets import make_friedman1
X_F1, y_F1 = make_friedman1(n_samples = 100,
n_features = 7, random_state=0)
#If doesn't plot copy and paste this into another window
plt.figure()
plt.scatter(X_F1[:, 2], y_F1, marker= 'o', s=50)
""""""
#Lets try doing this with linear regression and polynomial features
poly=PolynomialFeatures(degree=2)
x_f1_poly=poly.fit_transform(X_F1)
X_train, X_test, y_train, y_test = train_test_split(x_f1_poly, y_F1,
random_state = 0)
linreg=LinearRegression().fit(X_train,y_train)
print("For linear regression the score is:")
print("The training score is {:.2f}".format(linreg.score(X_train,y_train)))
print("The testing score is {:.2f}".format(linreg.score(X_test,y_test)))
##Lets try this with ridgeregression
linridge=Ridge(alpha=2).fit(X_train,y_train)
print("The score for ridge regression is:")
print("The training score is {:.2f}".format(linridge.score(X_train,y_train)))
print("The testing score is {:.2f}".format(linridge.score(X_test,y_test)))
#There is not many medium effecting feature weights
| 235.070652 | 35,878 | 0.933739 | 2,212 | 43,253 | 18.201627 | 0.597649 | 0.003279 | 0.003825 | 0.003577 | 0.049252 | 0.039765 | 0.037902 | 0.035219 | 0.025061 | 0.023769 | 0 | 0.130861 | 0.022287 | 43,253 | 183 | 35,879 | 236.355191 | 0.821183 | 0.063903 | 0 | 0.031746 | 1 | 0 | 0.233239 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.190476 | 0 | 0.190476 | 0.349206 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
b39b59e3f839b9385247c3d890802feddd230d7d | 2,006 | py | Python | tests/test_sig_quality.py | renestraub/vcu-ui | 10c972bb6e1f6fc513740b7da2c1d053e046f0fe | [
"MIT"
] | null | null | null | tests/test_sig_quality.py | renestraub/vcu-ui | 10c972bb6e1f6fc513740b7da2c1d053e046f0fe | [
"MIT"
] | 31 | 2020-09-04T13:17:08.000Z | 2022-03-18T20:12:45.000Z | tests/test_sig_quality.py | renestraub/vcu-ui | 10c972bb6e1f6fc513740b7da2c1d053e046f0fe | [
"MIT"
] | 1 | 2021-01-19T09:35:31.000Z | 2021-01-19T09:35:31.000Z | import math
from vcuui.sig_quality import SignalQuality_LTE
class TestLTE:
def test_rsrq_1(self):
q = SignalQuality_LTE._rsrq_to_q(0)
assert(math.isclose(q, 1.0))
q = SignalQuality_LTE._rsrq_to_q(-6.999)
assert(math.isclose(q, 1.0))
q = SignalQuality_LTE._rsrq_to_q(-7)
assert(math.isclose(q, 1.0))
q = SignalQuality_LTE._rsrq_to_q(-10.25)
assert(math.isclose(q, 0.775))
q = SignalQuality_LTE._rsrq_to_q(-13.5)
assert(math.isclose(q, 0.55))
q = SignalQuality_LTE._rsrq_to_q(-16.75)
assert(math.isclose(q, 0.325))
q = SignalQuality_LTE._rsrq_to_q(-20)
assert(math.isclose(q, 0.10))
q = SignalQuality_LTE._rsrq_to_q(-20.001)
assert(math.isclose(q, 0.10))
q = SignalQuality_LTE._rsrq_to_q(-30)
assert(math.isclose(q, 0.10))
def test_rsrp_1(self):
q = SignalQuality_LTE._rsrp_to_q(0)
assert(math.isclose(q, 1.0))
q = SignalQuality_LTE._rsrp_to_q(-79.999)
assert(math.isclose(q, 1.00))
q = SignalQuality_LTE._rsrp_to_q(-80)
assert(math.isclose(q, 1.00))
q = SignalQuality_LTE._rsrp_to_q(-85)
assert(math.isclose(q, 0.775))
q = SignalQuality_LTE._rsrp_to_q(-90)
assert(math.isclose(q, 0.55))
q = SignalQuality_LTE._rsrp_to_q(-95)
assert(math.isclose(q, 0.325))
q = SignalQuality_LTE._rsrp_to_q(-100)
assert(math.isclose(q, 0.10))
q = SignalQuality_LTE._rsrp_to_q(-100.001)
assert(math.isclose(q, 0.10))
q = SignalQuality_LTE._rsrp_to_q(-140)
assert(math.isclose(q, 0.10))
def test_1(self):
# Excellent
lte_q = SignalQuality_LTE(-7, -80)
q = lte_q.quality()
assert(math.isclose(q, 1.0))
# Cell edge - Close to disconnection
lte_q = SignalQuality_LTE(-20, -100)
q = lte_q.quality()
print(q)
assert(math.isclose(q, 0.1))
| 27.108108 | 50 | 0.602692 | 306 | 2,006 | 3.673203 | 0.163399 | 0.298932 | 0.302491 | 0.320285 | 0.798043 | 0.772242 | 0.680605 | 0.659253 | 0.609431 | 0.403025 | 0 | 0.081757 | 0.262213 | 2,006 | 73 | 51 | 27.479452 | 0.677703 | 0.021934 | 0 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.408163 | 1 | 0.061224 | false | 0 | 0.040816 | 0 | 0.122449 | 0.020408 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
b3ab3b6f7fa041e092fd5c45ce30337dd1d18a17 | 84 | py | Python | Project1_KNN/test.py | Unrealluver/CV-Projects | a293262200057dee40758f09fcd35a4d6722311b | [
"MIT"
] | null | null | null | Project1_KNN/test.py | Unrealluver/CV-Projects | a293262200057dee40758f09fcd35a4d6722311b | [
"MIT"
] | null | null | null | Project1_KNN/test.py | Unrealluver/CV-Projects | a293262200057dee40758f09fcd35a4d6722311b | [
"MIT"
] | null | null | null | x = 500000
for i in range(5):
x += x * 0.045
print(x-500000, " ", 500000*0.45*5) | 21 | 35 | 0.559524 | 18 | 84 | 2.611111 | 0.611111 | 0.297872 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.415385 | 0.22619 | 84 | 4 | 35 | 21 | 0.307692 | 0 | 0 | 0 | 0 | 0 | 0.011765 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
b3b68a9bae1bf559ef7f4e4489097dab98c08fcb | 162 | py | Python | src/thumbs_up/analyzers/__init__.py | CrackerCat/Karta | b845928487b50a5b41acd532ae0399177a4356aa | [
"MIT"
] | 716 | 2019-03-20T23:01:52.000Z | 2022-03-30T13:11:17.000Z | src/thumbs_up/analyzers/__init__.py | CrackerCat/Karta | b845928487b50a5b41acd532ae0399177a4356aa | [
"MIT"
] | 29 | 2019-03-21T13:01:34.000Z | 2021-12-19T05:07:42.000Z | src/thumbs_up/analyzers/__init__.py | CrackerCat/Karta | b845928487b50a5b41acd532ae0399177a4356aa | [
"MIT"
] | 97 | 2019-03-21T23:40:59.000Z | 2022-03-23T23:15:35.000Z | from .analyzer import *
from .analyzer_factory import *
from .arm import *
from .mips import *
from .intel import *
| 27 | 32 | 0.530864 | 16 | 162 | 5.3125 | 0.4375 | 0.470588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.407407 | 162 | 5 | 33 | 32.4 | 0.885417 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
b3d38e6a58c3eed669e21e577cd01b6806bb9d15 | 1,021 | py | Python | dask_cloudprovider/tests/test_imports.py | gitschneider/dask-cloudprovider | bc949ee2d8cfa6161c4e424973356ac007fd599e | [
"BSD-3-Clause"
] | null | null | null | dask_cloudprovider/tests/test_imports.py | gitschneider/dask-cloudprovider | bc949ee2d8cfa6161c4e424973356ac007fd599e | [
"BSD-3-Clause"
] | null | null | null | dask_cloudprovider/tests/test_imports.py | gitschneider/dask-cloudprovider | bc949ee2d8cfa6161c4e424973356ac007fd599e | [
"BSD-3-Clause"
] | null | null | null | import pytest
def test_imports():
from dask_cloudprovider.aws import EC2Cluster # noqa
from dask_cloudprovider.aws import ECSCluster # noqa
from dask_cloudprovider.aws import FargateCluster # noqa
from dask_cloudprovider.azure import AzureVMCluster # noqa
from dask_cloudprovider.gcp import GCPCluster # noqa
from dask_cloudprovider.digitalocean import DropletCluster # noqa
def test_import_exceptions():
with pytest.raises(ImportError):
from dask_cloudprovider import EC2Cluster # noqa
with pytest.raises(ImportError):
from dask_cloudprovider import ECSCluster # noqa
with pytest.raises(ImportError):
from dask_cloudprovider import FargateCluster # noqa
with pytest.raises(ImportError):
from dask_cloudprovider import AzureVMCluster # noqa
with pytest.raises(ImportError):
from dask_cloudprovider import GCPCluster # noqa
with pytest.raises(ImportError):
from dask_cloudprovider import DropletCluster # noqa
| 39.269231 | 70 | 0.755142 | 111 | 1,021 | 6.810811 | 0.207207 | 0.126984 | 0.333333 | 0.214286 | 0.584656 | 0.544974 | 0.455026 | 0.455026 | 0.383598 | 0 | 0 | 0.002442 | 0.197845 | 1,021 | 25 | 71 | 40.84 | 0.920635 | 0.057786 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.095238 | true | 0 | 1 | 0 | 1.095238 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
b3e3bb2ef5d4b7cfb1d0c0d4a6c070413870c39e | 172 | py | Python | mayan/apps/common/tests/literals.py | Fourdee/mayan-edms | 39a94f8b4fed519a3b20ab419e920ea53c11eb84 | [
"Apache-2.0"
] | null | null | null | mayan/apps/common/tests/literals.py | Fourdee/mayan-edms | 39a94f8b4fed519a3b20ab419e920ea53c11eb84 | [
"Apache-2.0"
] | null | null | null | mayan/apps/common/tests/literals.py | Fourdee/mayan-edms | 39a94f8b4fed519a3b20ab419e920ea53c11eb84 | [
"Apache-2.0"
] | 1 | 2020-02-05T18:07:08.000Z | 2020-02-05T18:07:08.000Z | from __future__ import unicode_literals
TEST_ERROR_LOG_ENTRY_RESULT = 'test_error_log_entry_result_text'
TEST_VIEW_NAME = 'test view name'
TEST_VIEW_URL = 'test-view-url'
| 28.666667 | 64 | 0.843023 | 28 | 172 | 4.535714 | 0.5 | 0.251969 | 0.188976 | 0.267717 | 0.614173 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093023 | 172 | 5 | 65 | 34.4 | 0.814103 | 0 | 0 | 0 | 0 | 0 | 0.343023 | 0.186047 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 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 |
b606f256d0e114fa48ed12f7661b6d77406ed159 | 59 | py | Python | mcfp/__init__.py | MCW-My-Colony-Wiki/MyColonyFileParser | 9c8a1bcf69265962b5064ec49047537b4e81d9c7 | [
"MIT"
] | 1 | 2021-02-23T15:12:46.000Z | 2021-02-23T15:12:46.000Z | mcfp/__init__.py | MCW-My-Colony-Wiki/mcp | 9c8a1bcf69265962b5064ec49047537b4e81d9c7 | [
"MIT"
] | null | null | null | mcfp/__init__.py | MCW-My-Colony-Wiki/mcp | 9c8a1bcf69265962b5064ec49047537b4e81d9c7 | [
"MIT"
] | null | null | null | from .file import Game, Strings
from .config import config
| 19.666667 | 31 | 0.79661 | 9 | 59 | 5.222222 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152542 | 59 | 2 | 32 | 29.5 | 0.94 | 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 |
3734eedac9560f0c913e10e5a102911d8319bb69 | 743 | py | Python | cm/htmllib/__init__.py | likwoka/ak | e6ac14e202e5a0d8f1b57e3e1a5c5a1ed9ecc14b | [
"Apache-2.0"
] | null | null | null | cm/htmllib/__init__.py | likwoka/ak | e6ac14e202e5a0d8f1b57e3e1a5c5a1ed9ecc14b | [
"Apache-2.0"
] | null | null | null | cm/htmllib/__init__.py | likwoka/ak | e6ac14e202e5a0d8f1b57e3e1a5c5a1ed9ecc14b | [
"Apache-2.0"
] | null | null | null | #Expose this!!!
from cm.htmllib.internal_renderer import Grid, Message, Link, Pre
from cm.htmllib.form import AKForm
from cm.htmllib.mime import FileType
from cm.htmllib.list import List, AKCol
from cm.htmllib.tabpage import TabPage
from quixote.form.form import register_widget_class
from cm.htmllib.widget import *
register_widget_class(AKStringWidget)
register_widget_class(AKCheckboxWidget)
register_widget_class(AKIntWidget)
register_widget_class(AKFloatWidget)
register_widget_class(AKDateWidget)
register_widget_class(AKTimeWidget)
register_widget_class(AKTextWidget)
register_widget_class(AKFileWidget)
register_widget_class(AKRadiobuttonsWidget)
register_widget_class(AKSingleSelectWidget)
register_widget_class(AKPasswordWidget)
| 30.958333 | 65 | 0.873486 | 94 | 743 | 6.638298 | 0.361702 | 0.269231 | 0.365385 | 0.080128 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065949 | 743 | 23 | 66 | 32.304348 | 0.899135 | 0.018843 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.055556 | 0.388889 | 0 | 0.388889 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 5 |
3738e2653f0ed5d6c9dcba8e52768feb204c599c | 249 | py | Python | DTL/db/__init__.py | rocktavious/DevToolsLib | 117200c91a3361e04f7c8e07d2ed4999bbcfc469 | [
"MIT"
] | 1 | 2015-03-23T18:52:12.000Z | 2015-03-23T18:52:12.000Z | DTL/db/__init__.py | rocktavious/DevToolsLib | 117200c91a3361e04f7c8e07d2ed4999bbcfc469 | [
"MIT"
] | null | null | null | DTL/db/__init__.py | rocktavious/DevToolsLib | 117200c91a3361e04f7c8e07d2ed4999bbcfc469 | [
"MIT"
] | 2 | 2017-05-21T12:50:41.000Z | 2021-10-17T03:32:45.000Z | from DTL.db.base import BaseProperty, BaseData
from DTL.db.properties import StringProperty, FloatProperty, IntegerProperty, BooleanProperty, ListProperty, CustomDataProperty
from DTL.db.data import Node, FloatTransformNode, IntTransformNode, Layer
| 62.25 | 127 | 0.855422 | 27 | 249 | 7.888889 | 0.703704 | 0.098592 | 0.126761 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084337 | 249 | 3 | 128 | 83 | 0.934211 | 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 |
37708ff4febdb4f379846653d07f63af969e9dde | 22 | py | Python | tccli/services/cpdp/v20190820/__init__.py | zyh911/tencentcloud-cli | dfc5dbd660d4c60d265921c4edc630091478fc41 | [
"Apache-2.0"
] | null | null | null | tccli/services/cpdp/v20190820/__init__.py | zyh911/tencentcloud-cli | dfc5dbd660d4c60d265921c4edc630091478fc41 | [
"Apache-2.0"
] | null | null | null | tccli/services/cpdp/v20190820/__init__.py | zyh911/tencentcloud-cli | dfc5dbd660d4c60d265921c4edc630091478fc41 | [
"Apache-2.0"
] | null | null | null | version = "2019-08-20" | 22 | 22 | 0.681818 | 4 | 22 | 3.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | 0.090909 | 22 | 1 | 22 | 22 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0.434783 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
378a841460cb888a731d6f1d8845e572701b9fb6 | 2,575 | py | Python | tests/test_items.py | andela-jmuli/wishlist | 39650f7545606aedfe0b32f39bcc883d9b38985c | [
"MIT"
] | 2 | 2017-10-07T09:26:46.000Z | 2019-01-20T01:34:13.000Z | tests/test_items.py | mrmuli/wishlist | 39650f7545606aedfe0b32f39bcc883d9b38985c | [
"MIT"
] | null | null | null | tests/test_items.py | mrmuli/wishlist | 39650f7545606aedfe0b32f39bcc883d9b38985c | [
"MIT"
] | null | null | null | from base_tests import BaseTest
from rest_framework import status
class TestItems(BaseTest):
""" class for item tests """
def test_item_creation(self):
"""Test creation of bucketlist items"""
self.get_token()
response = self.client.post('/bucketlists/',{'name': 'Test Bucketlist'}, format='json')
bucket_id = str(response.data['id'])
url = '/bucketlists/' + bucket_id + '/items/'
response = self.client.post(url, data={"item_name": "named"}, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
def test_editing_an_item(self):
"""Test editing an item"""
self.get_token()
response = self.client.post('/bucketlists/',{'name': 'Test Bucketlist'}, format='json')
bucket_id = str(response.data['id'])
url = '/bucketlists/' + bucket_id + '/items/'
response = self.client.post(url, data={"item_name": "named"}, format='json')
item_id = str(response.data['id'])
url = '/bucketlists/' + bucket_id + '/items/' + item_id + '/'
response = self.client.put(url, data={'item_name': "apple"}, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
def test_editing_an_item_that_does_not_exist(self):
"""Test editing a none-existent item"""
name = 'apple'
data = {'name': name}
self.get_token()
url = self.single_bucketlist_item__url + '465/'
response = self.client.put(url, data)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
def test_item_deletion(self):
""" test deletion of an item """
self.get_token()
response = self.client.post('/bucketlists/',{'name': 'Test Bucketlist'}, format='json')
bucket_id = str(response.data['id'])
url = '/bucketlists/' + bucket_id + '/items/'
response = self.client.post(url, data={"item_name": "named"}, format='json')
item_id = str(response.data['id'])
url = '/bucketlists/' + bucket_id + '/items/' + item_id + '/'
response = self.client.delete(url)
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
def test_deleting_an_item_that_does_not_exist(self):
"""Test deletion of a none-existent item"""
name = 'mac'
data = {'name': name}
self.get_token()
url = self.single_bucketlist_item__url + '465/'
response = self.client.delete(url, data)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
| 37.867647 | 95 | 0.627184 | 317 | 2,575 | 4.873817 | 0.198738 | 0.07767 | 0.116505 | 0.085437 | 0.829126 | 0.760518 | 0.752104 | 0.724272 | 0.685437 | 0.623301 | 0 | 0.010484 | 0.222136 | 2,575 | 67 | 96 | 38.432836 | 0.760859 | 0.067184 | 0 | 0.613636 | 0 | 0 | 0.133446 | 0 | 0 | 0 | 0 | 0 | 0.113636 | 1 | 0.113636 | false | 0 | 0.045455 | 0 | 0.181818 | 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 |
37b03efc5d2a5ed0a45f2a20b1257b52b1ac8bec | 90 | py | Python | visigoth/map_layers/choropleth/__init__.py | visigoths/visigoth | c5297148209d630f6668f0e5ba3039a8856d8320 | [
"MIT"
] | null | null | null | visigoth/map_layers/choropleth/__init__.py | visigoths/visigoth | c5297148209d630f6668f0e5ba3039a8856d8320 | [
"MIT"
] | 1 | 2021-01-26T16:55:48.000Z | 2021-09-03T15:29:14.000Z | visigoth/map_layers/choropleth/__init__.py | visigoths/visigoth | c5297148209d630f6668f0e5ba3039a8856d8320 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from visigoth.map_layers.choropleth.choropleth import Choropleth | 22.5 | 64 | 0.755556 | 11 | 90 | 6.090909 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0125 | 0.111111 | 90 | 4 | 64 | 22.5 | 0.825 | 0.233333 | 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 |
807e9df580d8d9205bd0e7f0f20101adf2a01a17 | 17,381 | py | Python | huaweicloud-sdk-sdrs/huaweicloudsdksdrs/v1/__init__.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-sdrs/huaweicloudsdksdrs/v1/__init__.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-sdrs/huaweicloudsdksdrs/v1/__init__.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
from __future__ import absolute_import
# import SdrsClient
from huaweicloudsdksdrs.v1.sdrs_client import SdrsClient
from huaweicloudsdksdrs.v1.sdrs_async_client import SdrsAsyncClient
# import models into sdk package
from huaweicloudsdksdrs.v1.model.add_protected_instance_nic_request import AddProtectedInstanceNicRequest
from huaweicloudsdksdrs.v1.model.add_protected_instance_nic_response import AddProtectedInstanceNicResponse
from huaweicloudsdksdrs.v1.model.add_protected_instance_tags_request import AddProtectedInstanceTagsRequest
from huaweicloudsdksdrs.v1.model.add_protected_instance_tags_response import AddProtectedInstanceTagsResponse
from huaweicloudsdksdrs.v1.model.attach_protected_instance_replication_request import AttachProtectedInstanceReplicationRequest
from huaweicloudsdksdrs.v1.model.attach_protected_instance_replication_response import AttachProtectedInstanceReplicationResponse
from huaweicloudsdksdrs.v1.model.batch_add_tags_request import BatchAddTagsRequest
from huaweicloudsdksdrs.v1.model.batch_add_tags_request_body import BatchAddTagsRequestBody
from huaweicloudsdksdrs.v1.model.batch_add_tags_response import BatchAddTagsResponse
from huaweicloudsdksdrs.v1.model.batch_create_protected_instances_request import BatchCreateProtectedInstancesRequest
from huaweicloudsdksdrs.v1.model.batch_create_protected_instances_request_body import BatchCreateProtectedInstancesRequestBody
from huaweicloudsdksdrs.v1.model.batch_create_protected_instances_request_params import BatchCreateProtectedInstancesRequestParams
from huaweicloudsdksdrs.v1.model.batch_create_protected_instances_response import BatchCreateProtectedInstancesResponse
from huaweicloudsdksdrs.v1.model.batch_delete_protected_instances_request import BatchDeleteProtectedInstancesRequest
from huaweicloudsdksdrs.v1.model.batch_delete_protected_instances_request_body import BatchDeleteProtectedInstancesRequestBody
from huaweicloudsdksdrs.v1.model.batch_delete_protected_instances_response import BatchDeleteProtectedInstancesResponse
from huaweicloudsdksdrs.v1.model.batch_delete_tags_request import BatchDeleteTagsRequest
from huaweicloudsdksdrs.v1.model.batch_delete_tags_request_body import BatchDeleteTagsRequestBody
from huaweicloudsdksdrs.v1.model.batch_delete_tags_response import BatchDeleteTagsResponse
from huaweicloudsdksdrs.v1.model.create_disaster_recovery_drill_request import CreateDisasterRecoveryDrillRequest
from huaweicloudsdksdrs.v1.model.create_disaster_recovery_drill_request_body import CreateDisasterRecoveryDrillRequestBody
from huaweicloudsdksdrs.v1.model.create_disaster_recovery_drill_request_params import CreateDisasterRecoveryDrillRequestParams
from huaweicloudsdksdrs.v1.model.create_disaster_recovery_drill_response import CreateDisasterRecoveryDrillResponse
from huaweicloudsdksdrs.v1.model.create_protected_instance_request import CreateProtectedInstanceRequest
from huaweicloudsdksdrs.v1.model.create_protected_instance_request_body import CreateProtectedInstanceRequestBody
from huaweicloudsdksdrs.v1.model.create_protected_instance_request_params import CreateProtectedInstanceRequestParams
from huaweicloudsdksdrs.v1.model.create_protected_instance_response import CreateProtectedInstanceResponse
from huaweicloudsdksdrs.v1.model.create_protection_group_request import CreateProtectionGroupRequest
from huaweicloudsdksdrs.v1.model.create_protection_group_request_body import CreateProtectionGroupRequestBody
from huaweicloudsdksdrs.v1.model.create_protection_group_request_params import CreateProtectionGroupRequestParams
from huaweicloudsdksdrs.v1.model.create_protection_group_response import CreateProtectionGroupResponse
from huaweicloudsdksdrs.v1.model.create_replication_request import CreateReplicationRequest
from huaweicloudsdksdrs.v1.model.create_replication_request_body import CreateReplicationRequestBody
from huaweicloudsdksdrs.v1.model.create_replication_request_params import CreateReplicationRequestParams
from huaweicloudsdksdrs.v1.model.create_replication_response import CreateReplicationResponse
from huaweicloudsdksdrs.v1.model.delete_all_server_group_failure_jobs_request import DeleteAllServerGroupFailureJobsRequest
from huaweicloudsdksdrs.v1.model.delete_all_server_group_failure_jobs_response import DeleteAllServerGroupFailureJobsResponse
from huaweicloudsdksdrs.v1.model.delete_disaster_recovery_drill_request import DeleteDisasterRecoveryDrillRequest
from huaweicloudsdksdrs.v1.model.delete_disaster_recovery_drill_response import DeleteDisasterRecoveryDrillResponse
from huaweicloudsdksdrs.v1.model.delete_failure_job_request import DeleteFailureJobRequest
from huaweicloudsdksdrs.v1.model.delete_failure_job_response import DeleteFailureJobResponse
from huaweicloudsdksdrs.v1.model.delete_protected_instance_nic_request import DeleteProtectedInstanceNicRequest
from huaweicloudsdksdrs.v1.model.delete_protected_instance_nic_response import DeleteProtectedInstanceNicResponse
from huaweicloudsdksdrs.v1.model.delete_protected_instance_request import DeleteProtectedInstanceRequest
from huaweicloudsdksdrs.v1.model.delete_protected_instance_request_body import DeleteProtectedInstanceRequestBody
from huaweicloudsdksdrs.v1.model.delete_protected_instance_response import DeleteProtectedInstanceResponse
from huaweicloudsdksdrs.v1.model.delete_protected_instance_tag_request import DeleteProtectedInstanceTagRequest
from huaweicloudsdksdrs.v1.model.delete_protected_instance_tag_response import DeleteProtectedInstanceTagResponse
from huaweicloudsdksdrs.v1.model.delete_protection_group_request import DeleteProtectionGroupRequest
from huaweicloudsdksdrs.v1.model.delete_protection_group_response import DeleteProtectionGroupResponse
from huaweicloudsdksdrs.v1.model.delete_replication_request import DeleteReplicationRequest
from huaweicloudsdksdrs.v1.model.delete_replication_request_body import DeleteReplicationRequestBody
from huaweicloudsdksdrs.v1.model.delete_replication_request_params import DeleteReplicationRequestParams
from huaweicloudsdksdrs.v1.model.delete_replication_response import DeleteReplicationResponse
from huaweicloudsdksdrs.v1.model.delete_resource_tag import DeleteResourceTag
from huaweicloudsdksdrs.v1.model.delete_server_group_failure_jobs_request import DeleteServerGroupFailureJobsRequest
from huaweicloudsdksdrs.v1.model.delete_server_group_failure_jobs_response import DeleteServerGroupFailureJobsResponse
from huaweicloudsdksdrs.v1.model.detach_protected_instance_replication_request import DetachProtectedInstanceReplicationRequest
from huaweicloudsdksdrs.v1.model.detach_protected_instance_replication_response import DetachProtectedInstanceReplicationResponse
from huaweicloudsdksdrs.v1.model.drill_server_params import DrillServerParams
from huaweicloudsdksdrs.v1.model.expand_replication_request import ExpandReplicationRequest
from huaweicloudsdksdrs.v1.model.expand_replication_response import ExpandReplicationResponse
from huaweicloudsdksdrs.v1.model.extend_replication_request_body import ExtendReplicationRequestBody
from huaweicloudsdksdrs.v1.model.extend_replication_request_params import ExtendReplicationRequestParams
from huaweicloudsdksdrs.v1.model.failover_protection_group_request_body import FailoverProtectionGroupRequestBody
from huaweicloudsdksdrs.v1.model.failure_job_params import FailureJobParams
from huaweicloudsdksdrs.v1.model.job_entities import JobEntities
from huaweicloudsdksdrs.v1.model.list_active_active_domains_request import ListActiveActiveDomainsRequest
from huaweicloudsdksdrs.v1.model.list_active_active_domains_response import ListActiveActiveDomainsResponse
from huaweicloudsdksdrs.v1.model.list_api_versions_request import ListApiVersionsRequest
from huaweicloudsdksdrs.v1.model.list_api_versions_response import ListApiVersionsResponse
from huaweicloudsdksdrs.v1.model.list_disaster_recovery_drills_request import ListDisasterRecoveryDrillsRequest
from huaweicloudsdksdrs.v1.model.list_disaster_recovery_drills_response import ListDisasterRecoveryDrillsResponse
from huaweicloudsdksdrs.v1.model.list_failure_jobs_request import ListFailureJobsRequest
from huaweicloudsdksdrs.v1.model.list_failure_jobs_response import ListFailureJobsResponse
from huaweicloudsdksdrs.v1.model.list_protected_instance_tags_request import ListProtectedInstanceTagsRequest
from huaweicloudsdksdrs.v1.model.list_protected_instance_tags_response import ListProtectedInstanceTagsResponse
from huaweicloudsdksdrs.v1.model.list_protected_instances_by_tags_request import ListProtectedInstancesByTagsRequest
from huaweicloudsdksdrs.v1.model.list_protected_instances_by_tags_request_body import ListProtectedInstancesByTagsRequestBody
from huaweicloudsdksdrs.v1.model.list_protected_instances_by_tags_response import ListProtectedInstancesByTagsResponse
from huaweicloudsdksdrs.v1.model.list_protected_instances_project_tags_request import ListProtectedInstancesProjectTagsRequest
from huaweicloudsdksdrs.v1.model.list_protected_instances_project_tags_response import ListProtectedInstancesProjectTagsResponse
from huaweicloudsdksdrs.v1.model.list_protected_instances_request import ListProtectedInstancesRequest
from huaweicloudsdksdrs.v1.model.list_protected_instances_response import ListProtectedInstancesResponse
from huaweicloudsdksdrs.v1.model.list_protection_groups_request import ListProtectionGroupsRequest
from huaweicloudsdksdrs.v1.model.list_protection_groups_response import ListProtectionGroupsResponse
from huaweicloudsdksdrs.v1.model.list_replications_request import ListReplicationsRequest
from huaweicloudsdksdrs.v1.model.list_replications_response import ListReplicationsResponse
from huaweicloudsdksdrs.v1.model.list_rpo_statistics_request import ListRpoStatisticsRequest
from huaweicloudsdksdrs.v1.model.list_rpo_statistics_response import ListRpoStatisticsResponse
from huaweicloudsdksdrs.v1.model.match_params import MatchParams
from huaweicloudsdksdrs.v1.model.metadata_params import MetadataParams
from huaweicloudsdksdrs.v1.model.protected_instance_add_nic_request_body import ProtectedInstanceAddNicRequestBody
from huaweicloudsdksdrs.v1.model.protected_instance_add_tags_request_body import ProtectedInstanceAddTagsRequestBody
from huaweicloudsdksdrs.v1.model.protected_instance_attach_replication_request_body import ProtectedInstanceAttachReplicationRequestBody
from huaweicloudsdksdrs.v1.model.protected_instance_attach_replication_request_params import ProtectedInstanceAttachReplicationRequestParams
from huaweicloudsdksdrs.v1.model.protected_instance_attachment import ProtectedInstanceAttachment
from huaweicloudsdksdrs.v1.model.protected_instance_delete_nic_request_body import ProtectedInstanceDeleteNicRequestBody
from huaweicloudsdksdrs.v1.model.quota_params import QuotaParams
from huaweicloudsdksdrs.v1.model.quota_resource_params import QuotaResourceParams
from huaweicloudsdksdrs.v1.model.replication_attachment import ReplicationAttachment
from huaweicloudsdksdrs.v1.model.replication_cluster_params import ReplicationClusterParams
from huaweicloudsdksdrs.v1.model.replication_record_metadata import ReplicationRecordMetadata
from huaweicloudsdksdrs.v1.model.resize_protected_instance_request import ResizeProtectedInstanceRequest
from huaweicloudsdksdrs.v1.model.resize_protected_instance_request_body import ResizeProtectedInstanceRequestBody
from huaweicloudsdksdrs.v1.model.resize_protected_instance_request_params import ResizeProtectedInstanceRequestParams
from huaweicloudsdksdrs.v1.model.resize_protected_instance_response import ResizeProtectedInstanceResponse
from huaweicloudsdksdrs.v1.model.resource_id import ResourceId
from huaweicloudsdksdrs.v1.model.resource_params import ResourceParams
from huaweicloudsdksdrs.v1.model.resource_tag import ResourceTag
from huaweicloudsdksdrs.v1.model.reverse_protection_group_request_body import ReverseProtectionGroupRequestBody
from huaweicloudsdksdrs.v1.model.reverse_protection_group_request_params import ReverseProtectionGroupRequestParams
from huaweicloudsdksdrs.v1.model.rpo_stattistics_params import RpoStattisticsParams
from huaweicloudsdksdrs.v1.model.security_groups_params import SecurityGroupsParams
from huaweicloudsdksdrs.v1.model.server_info import ServerInfo
from huaweicloudsdksdrs.v1.model.show_active_active_domain_params import ShowActiveActiveDomainParams
from huaweicloudsdksdrs.v1.model.show_api_version_links_params import ShowApiVersionLinksParams
from huaweicloudsdksdrs.v1.model.show_api_version_params import ShowApiVersionParams
from huaweicloudsdksdrs.v1.model.show_disaster_recovery_drill_params import ShowDisasterRecoveryDrillParams
from huaweicloudsdksdrs.v1.model.show_disaster_recovery_drill_request import ShowDisasterRecoveryDrillRequest
from huaweicloudsdksdrs.v1.model.show_disaster_recovery_drill_response import ShowDisasterRecoveryDrillResponse
from huaweicloudsdksdrs.v1.model.show_job_status_request import ShowJobStatusRequest
from huaweicloudsdksdrs.v1.model.show_job_status_response import ShowJobStatusResponse
from huaweicloudsdksdrs.v1.model.show_protected_instance_params import ShowProtectedInstanceParams
from huaweicloudsdksdrs.v1.model.show_protected_instance_request import ShowProtectedInstanceRequest
from huaweicloudsdksdrs.v1.model.show_protected_instance_response import ShowProtectedInstanceResponse
from huaweicloudsdksdrs.v1.model.show_protection_group_params import ShowProtectionGroupParams
from huaweicloudsdksdrs.v1.model.show_protection_group_request import ShowProtectionGroupRequest
from huaweicloudsdksdrs.v1.model.show_protection_group_response import ShowProtectionGroupResponse
from huaweicloudsdksdrs.v1.model.show_quota_request import ShowQuotaRequest
from huaweicloudsdksdrs.v1.model.show_quota_response import ShowQuotaResponse
from huaweicloudsdksdrs.v1.model.show_replication_params import ShowReplicationParams
from huaweicloudsdksdrs.v1.model.show_replication_request import ShowReplicationRequest
from huaweicloudsdksdrs.v1.model.show_replication_response import ShowReplicationResponse
from huaweicloudsdksdrs.v1.model.show_specified_api_version_request import ShowSpecifiedApiVersionRequest
from huaweicloudsdksdrs.v1.model.show_specified_api_version_response import ShowSpecifiedApiVersionResponse
from huaweicloudsdksdrs.v1.model.start_failover_protection_group_request import StartFailoverProtectionGroupRequest
from huaweicloudsdksdrs.v1.model.start_failover_protection_group_response import StartFailoverProtectionGroupResponse
from huaweicloudsdksdrs.v1.model.start_protection_group_request import StartProtectionGroupRequest
from huaweicloudsdksdrs.v1.model.start_protection_group_request_body import StartProtectionGroupRequestBody
from huaweicloudsdksdrs.v1.model.start_protection_group_response import StartProtectionGroupResponse
from huaweicloudsdksdrs.v1.model.start_reverse_protection_group_request import StartReverseProtectionGroupRequest
from huaweicloudsdksdrs.v1.model.start_reverse_protection_group_response import StartReverseProtectionGroupResponse
from huaweicloudsdksdrs.v1.model.stop_protection_group_request import StopProtectionGroupRequest
from huaweicloudsdksdrs.v1.model.stop_protection_group_request_body import StopProtectionGroupRequestBody
from huaweicloudsdksdrs.v1.model.stop_protection_group_response import StopProtectionGroupResponse
from huaweicloudsdksdrs.v1.model.sub_job_entities import SubJobEntities
from huaweicloudsdksdrs.v1.model.sub_job_params import SubJobParams
from huaweicloudsdksdrs.v1.model.tag_params import TagParams
from huaweicloudsdksdrs.v1.model.update_disaster_recovery_drill_name_request import UpdateDisasterRecoveryDrillNameRequest
from huaweicloudsdksdrs.v1.model.update_disaster_recovery_drill_name_request_body import UpdateDisasterRecoveryDrillNameRequestBody
from huaweicloudsdksdrs.v1.model.update_disaster_recovery_drill_name_request_params import UpdateDisasterRecoveryDrillNameRequestParams
from huaweicloudsdksdrs.v1.model.update_disaster_recovery_drill_name_response import UpdateDisasterRecoveryDrillNameResponse
from huaweicloudsdksdrs.v1.model.update_protected_instance_name_request import UpdateProtectedInstanceNameRequest
from huaweicloudsdksdrs.v1.model.update_protected_instance_name_request_body import UpdateProtectedInstanceNameRequestBody
from huaweicloudsdksdrs.v1.model.update_protected_instance_name_request_params import UpdateProtectedInstanceNameRequestParams
from huaweicloudsdksdrs.v1.model.update_protected_instance_name_response import UpdateProtectedInstanceNameResponse
from huaweicloudsdksdrs.v1.model.update_protection_group_name_request import UpdateProtectionGroupNameRequest
from huaweicloudsdksdrs.v1.model.update_protection_group_name_request_body import UpdateProtectionGroupNameRequestBody
from huaweicloudsdksdrs.v1.model.update_protection_group_name_request_params import UpdateProtectionGroupNameRequestParams
from huaweicloudsdksdrs.v1.model.update_protection_group_name_response import UpdateProtectionGroupNameResponse
from huaweicloudsdksdrs.v1.model.update_replication_name_request import UpdateReplicationNameRequest
from huaweicloudsdksdrs.v1.model.update_replication_name_request_body import UpdateReplicationNameRequestBody
from huaweicloudsdksdrs.v1.model.update_replication_name_request_params import UpdateReplicationNameRequestParams
from huaweicloudsdksdrs.v1.model.update_replication_name_response import UpdateReplicationNameResponse
| 99.32 | 140 | 0.931477 | 1,752 | 17,381 | 8.912671 | 0.143265 | 0.235287 | 0.256676 | 0.306436 | 0.559846 | 0.508357 | 0.458021 | 0.324688 | 0.117195 | 0.028754 | 0 | 0.010064 | 0.039526 | 17,381 | 174 | 141 | 99.890805 | 0.925303 | 0.003567 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
03840b5a331a5d23d11c9048a4e3ca2808e6b122 | 58 | py | Python | Term 2/9/7-example.py | theseana/ajisa | 1c92b00acd3fad7c92b8222b5f6a86fc6db4bcae | [
"MIT"
] | null | null | null | Term 2/9/7-example.py | theseana/ajisa | 1c92b00acd3fad7c92b8222b5f6a86fc6db4bcae | [
"MIT"
] | null | null | null | Term 2/9/7-example.py | theseana/ajisa | 1c92b00acd3fad7c92b8222b5f6a86fc6db4bcae | [
"MIT"
] | null | null | null | a = "*****Ja****va******ad****"
print(a.replace("*", "")) | 19.333333 | 31 | 0.344828 | 7 | 58 | 2.857143 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086207 | 58 | 3 | 32 | 19.333333 | 0.377358 | 0 | 0 | 0 | 0 | 0 | 0.440678 | 0.423729 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
03aad271b0d5d304a0b5f23c71e677f8f6e32be5 | 189 | py | Python | app/main/views.py | ThiraTheNerd/recipe-book | 46a1f01a7da13cec582e726fc6948b7509be330e | [
"MIT"
] | null | null | null | app/main/views.py | ThiraTheNerd/recipe-book | 46a1f01a7da13cec582e726fc6948b7509be330e | [
"MIT"
] | null | null | null | app/main/views.py | ThiraTheNerd/recipe-book | 46a1f01a7da13cec582e726fc6948b7509be330e | [
"MIT"
] | null | null | null | from flask import render_template,request,redirect,url_for
from . import main
# Views
@main.route('/')
def index():
title = "Homepage"
return render_template('index.html', title=title) | 23.625 | 58 | 0.746032 | 26 | 189 | 5.307692 | 0.692308 | 0.202899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121693 | 189 | 8 | 59 | 23.625 | 0.831325 | 0.026455 | 0 | 0 | 0 | 0 | 0.103825 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 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 |
03bd4184c08ec85db7796a720c4989f24dc3d975 | 78 | py | Python | TegClass.py | MacMullen/TegBOT | c4954588a965f581cd9312635222c49c9a878c4f | [
"MIT"
] | null | null | null | TegClass.py | MacMullen/TegBOT | c4954588a965f581cd9312635222c49c9a878c4f | [
"MIT"
] | null | null | null | TegClass.py | MacMullen/TegBOT | c4954588a965f581cd9312635222c49c9a878c4f | [
"MIT"
] | null | null | null | class TEG:
def __init__(self, players):
self.players = players
| 19.5 | 33 | 0.615385 | 9 | 78 | 4.888889 | 0.666667 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.294872 | 78 | 3 | 34 | 26 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 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 | 0 | 1 | 0 | 0 | 5 |
ff0fec14e7c1fb8aedb6157085205640f787d5dc | 219 | py | Python | propara/evaluator/process/__init__.py | allenai/aristo-leaderboard | 60d5be31b5a7d36f29d13223ece29a8d2bfa8b5f | [
"Apache-2.0"
] | 36 | 2018-10-19T13:37:31.000Z | 2022-01-14T12:52:00.000Z | propara/evaluator/process/__init__.py | allenai/aristo-leaderboard | 60d5be31b5a7d36f29d13223ece29a8d2bfa8b5f | [
"Apache-2.0"
] | 9 | 2018-10-08T20:04:31.000Z | 2021-05-12T19:44:06.000Z | propara/evaluator/process/__init__.py | allenai/aristo-leaderboard | 60d5be31b5a7d36f29d13223ece29a8d2bfa8b5f | [
"Apache-2.0"
] | 10 | 2018-10-26T11:37:11.000Z | 2020-11-17T11:24:34.000Z | from process.process import Process, Conversion, Move, Input, Output
from process.summary import ProcessSummary
from process.action_file import ActionFile
from process.sentence_file import sentences_from_sentences_file
| 43.8 | 68 | 0.872146 | 29 | 219 | 6.413793 | 0.482759 | 0.236559 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091324 | 219 | 4 | 69 | 54.75 | 0.934673 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
20e56c989808621d0f904205e289b34f0a35dc0d | 145 | py | Python | 3-integration-test.py | antonhajdinaj/cryptocmd | cf5f8dc5e5dfdd753135fc33cbf852abdca21439 | [
"MIT"
] | null | null | null | 3-integration-test.py | antonhajdinaj/cryptocmd | cf5f8dc5e5dfdd753135fc33cbf852abdca21439 | [
"MIT"
] | 1 | 2020-10-16T22:07:12.000Z | 2020-10-16T22:07:12.000Z | 3-integration-test.py | antonhajdinaj/cryptocmd | cf5f8dc5e5dfdd753135fc33cbf852abdca21439 | [
"MIT"
] | null | null | null | #install native messaging
#Verify configuration file
#Verify registry settings
#Integration & Fuzzing tests for the native messaging component | 20.714286 | 63 | 0.827586 | 17 | 145 | 7.058824 | 0.823529 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 145 | 7 | 63 | 20.714286 | 0.96 | 0.931034 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 1 | 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 |
20f59ccdf69cb63a909ff3fbda21a1c04704d434 | 20 | py | Python | main/controllers/__init__.py | ducminh-phan/final-project-template | faec7c6e6f8db53d901667b7ef6644ed01c06390 | [
"MIT"
] | null | null | null | main/controllers/__init__.py | ducminh-phan/final-project-template | faec7c6e6f8db53d901667b7ef6644ed01c06390 | [
"MIT"
] | null | null | null | main/controllers/__init__.py | ducminh-phan/final-project-template | faec7c6e6f8db53d901667b7ef6644ed01c06390 | [
"MIT"
] | null | null | null | from . import probe
| 10 | 19 | 0.75 | 3 | 20 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 20 | 1 | 20 | 20 | 0.9375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
4551ab4e7302a96063007ecb24f2dd5e2d1e7e12 | 84 | py | Python | authentication/forms.py | ThatsSoMeta/NotTwitter | c9c1c04d204685aaeeb79d6a29167c374a7071d8 | [
"MIT"
] | 1 | 2021-03-08T18:32:59.000Z | 2021-03-08T18:32:59.000Z | authentication/forms.py | ThatsSoMeta/NotTwitter | c9c1c04d204685aaeeb79d6a29167c374a7071d8 | [
"MIT"
] | null | null | null | authentication/forms.py | ThatsSoMeta/NotTwitter | c9c1c04d204685aaeeb79d6a29167c374a7071d8 | [
"MIT"
] | null | null | null | # from django import forms
# from django.contrib.auth.forms import UserCreationForm
| 28 | 56 | 0.821429 | 11 | 84 | 6.272727 | 0.636364 | 0.289855 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119048 | 84 | 2 | 57 | 42 | 0.932432 | 0.940476 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 1 | 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 |
455712270c6920b55790ab6607127bc9253032a5 | 130 | py | Python | dnachisel/Specification/__init__.py | simone-pignotti/DnaChisel | b7f0f925c9daefcc5fec903a13cfa74c3b726a7a | [
"MIT"
] | 124 | 2017-11-14T14:42:25.000Z | 2022-03-31T08:02:07.000Z | dnachisel/Specification/__init__.py | simone-pignotti/DnaChisel | b7f0f925c9daefcc5fec903a13cfa74c3b726a7a | [
"MIT"
] | 65 | 2017-11-15T07:25:38.000Z | 2022-01-31T10:38:45.000Z | dnachisel/Specification/__init__.py | simone-pignotti/DnaChisel | b7f0f925c9daefcc5fec903a13cfa74c3b726a7a | [
"MIT"
] | 31 | 2018-10-18T12:59:47.000Z | 2022-02-11T16:54:43.000Z | from .Specification import Specification
from .SpecificationSet import SpecificationSet
from .SpecEvaluation import SpecEvaluation | 43.333333 | 46 | 0.892308 | 12 | 130 | 9.666667 | 0.416667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084615 | 130 | 3 | 47 | 43.333333 | 0.97479 | 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 |
4589907381667217ad8ca1444302f52c723e38c1 | 205 | py | Python | py_reportit/shared/repository/report.py | fedus/py_reportit | 46422cabb652571d8cce6c8e91a229009dcca141 | [
"MIT"
] | 1 | 2021-12-05T19:16:16.000Z | 2021-12-05T19:16:16.000Z | py_reportit/shared/repository/report.py | fedus/py_reportit | 46422cabb652571d8cce6c8e91a229009dcca141 | [
"MIT"
] | null | null | null | py_reportit/shared/repository/report.py | fedus/py_reportit | 46422cabb652571d8cce6c8e91a229009dcca141 | [
"MIT"
] | null | null | null | from py_reportit.shared.repository.abstract_repository import AbstractRepository
from py_reportit.shared.model.report import Report
class ReportRepository(AbstractRepository[Report]):
model = Report
| 29.285714 | 80 | 0.84878 | 23 | 205 | 7.434783 | 0.521739 | 0.070175 | 0.163743 | 0.233918 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.092683 | 205 | 6 | 81 | 34.166667 | 0.919355 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
45b4e821e55bad3e3133e507e9d3f0bc4f550db4 | 133 | py | Python | pema/www/darwinex.py | hpema/pema | b1dfb270f34e066bc85ce9fceff1bb71dfca7fa7 | [
"MIT"
] | null | null | null | pema/www/darwinex.py | hpema/pema | b1dfb270f34e066bc85ce9fceff1bb71dfca7fa7 | [
"MIT"
] | null | null | null | pema/www/darwinex.py | hpema/pema | b1dfb270f34e066bc85ce9fceff1bb71dfca7fa7 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe
no_cache = 1
def get_context(context):
context.user = frappe.session.user
| 14.777778 | 39 | 0.796992 | 19 | 133 | 5.210526 | 0.736842 | 0.282828 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008772 | 0.142857 | 133 | 8 | 40 | 16.625 | 0.859649 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 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 |
45b6eda2f304ef8266924d896a5270fbd76d000e | 58 | py | Python | config.py | Auraxc/Flask_web | 4a8e32a2a4bf1e7548ef68471ccbfe9da53a1489 | [
"MIT"
] | 2 | 2019-09-24T00:43:25.000Z | 2019-10-12T00:50:53.000Z | config.py | Auraxc/web | 4a8e32a2a4bf1e7548ef68471ccbfe9da53a1489 | [
"MIT"
] | null | null | null | config.py | Auraxc/web | 4a8e32a2a4bf1e7548ef68471ccbfe9da53a1489 | [
"MIT"
] | null | null | null | test_mail = 'ab@auramux.com'
admin_mail = 'ab@auramux.com' | 29 | 29 | 0.741379 | 10 | 58 | 4.1 | 0.6 | 0.292683 | 0.634146 | 0.780488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086207 | 58 | 2 | 29 | 29 | 0.773585 | 0 | 0 | 0 | 0 | 0 | 0.474576 | 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 |
afe0219dacfe855c9204012df0d191a8e3996f38 | 160 | py | Python | bookshelf/books/admin.py | Danielvalev/bookshelf | eda857b275de49623c57e2288f86f401b87406c9 | [
"MIT"
] | null | null | null | bookshelf/books/admin.py | Danielvalev/bookshelf | eda857b275de49623c57e2288f86f401b87406c9 | [
"MIT"
] | null | null | null | bookshelf/books/admin.py | Danielvalev/bookshelf | eda857b275de49623c57e2288f86f401b87406c9 | [
"MIT"
] | null | null | null | from django.contrib import admin
from books.models import Book, Category
# Register your models here.
admin.site.register(Book)
admin.site.register(Category)
| 20 | 39 | 0.80625 | 23 | 160 | 5.608696 | 0.565217 | 0.139535 | 0.263566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1125 | 160 | 7 | 40 | 22.857143 | 0.908451 | 0.1625 | 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 |
aff303df5202fd58c5522312de12883b86b550a0 | 118 | py | Python | app/eventFrameAttributes/__init__.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 27 | 2017-11-27T05:01:05.000Z | 2020-11-14T19:52:26.000Z | app/eventFrameAttributes/__init__.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 259 | 2017-11-23T00:43:26.000Z | 2020-11-03T01:07:30.000Z | app/eventFrameAttributes/__init__.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 8 | 2018-10-29T04:39:29.000Z | 2020-10-01T22:18:12.000Z | from flask import Blueprint
eventFrameAttributes = Blueprint("eventFrameAttributes", __name__)
from . import routes
| 19.666667 | 66 | 0.822034 | 11 | 118 | 8.454545 | 0.636364 | 0.623656 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.118644 | 118 | 5 | 67 | 23.6 | 0.894231 | 0 | 0 | 0 | 0 | 0 | 0.169492 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0.666667 | 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 | 0 | 1 | 0 | 5 |
b32158b8f8c08f7e22546ff517b7185159aa1dd6 | 76 | py | Python | selective_gp/point_processes/__init__.py | akuhren/selective_gp | 155713ede4de29f8ac6a9918c53f0ff7287c382a | [
"MIT"
] | 14 | 2020-11-18T07:07:19.000Z | 2021-12-26T07:59:58.000Z | selective_gp/point_processes/__init__.py | akuhren/selective_gp | 155713ede4de29f8ac6a9918c53f0ff7287c382a | [
"MIT"
] | 1 | 2021-08-23T20:53:05.000Z | 2021-08-23T20:53:05.000Z | selective_gp/point_processes/__init__.py | akuhren/selective_gp | 155713ede4de29f8ac6a9918c53f0ff7287c382a | [
"MIT"
] | 2 | 2021-07-27T17:05:45.000Z | 2021-12-20T19:25:21.000Z | from .point_process import SquaredReducingPointProcess, PoissonPointProcess
| 38 | 75 | 0.907895 | 6 | 76 | 11.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065789 | 76 | 1 | 76 | 76 | 0.957746 | 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 |
b344488e16bef1d0f149ae62d6baa5091d4a0ba4 | 895 | py | Python | server-src/users.py | Artingl/Fluffy | e51ca77651a67ea6206dcbfa0a3436c032f3a3ed | [
"Apache-2.0"
] | null | null | null | server-src/users.py | Artingl/Fluffy | e51ca77651a67ea6206dcbfa0a3436c032f3a3ed | [
"Apache-2.0"
] | null | null | null | server-src/users.py | Artingl/Fluffy | e51ca77651a67ea6206dcbfa0a3436c032f3a3ed | [
"Apache-2.0"
] | null | null | null | import datetime
import sqlalchemy
import db
class User(db.SqlAlchemyBase):
__tablename__ = 'users'
id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True, autoincrement=True)
nickname = sqlalchemy.Column(sqlalchemy.String, nullable=True)
name = sqlalchemy.Column(sqlalchemy.String, nullable=True)
surname = sqlalchemy.Column(sqlalchemy.String, nullable=True)
email = sqlalchemy.Column(sqlalchemy.String, index=True, unique=True)
password = sqlalchemy.Column(sqlalchemy.String)
reg_date = sqlalchemy.Column(sqlalchemy.DateTime, default=datetime.datetime.now)
is_email = sqlalchemy.Column(sqlalchemy.Boolean, default=False)
session_key = sqlalchemy.Column(sqlalchemy.String, index=True, nullable=True)
friends = sqlalchemy.Column(sqlalchemy.String, index=True, nullable=True)
anotherInfo = sqlalchemy.Column(sqlalchemy.String, default='{}')
| 44.75 | 84 | 0.77095 | 100 | 895 | 6.82 | 0.35 | 0.258065 | 0.419355 | 0.375367 | 0.409091 | 0.409091 | 0.155425 | 0.155425 | 0 | 0 | 0 | 0 | 0.121788 | 895 | 19 | 85 | 47.105263 | 0.867684 | 0 | 0 | 0 | 0 | 0 | 0.007821 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.0625 | 0.1875 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
2faa7bb4bb57a33e56df5be543bc8b8c56ea6bd5 | 220 | py | Python | ticket/home/models.py | canurag18212/Computer_Project | 57a5215cdbd0287f4408b60b2832f35b3a9bf667 | [
"bzip2-1.0.6"
] | null | null | null | ticket/home/models.py | canurag18212/Computer_Project | 57a5215cdbd0287f4408b60b2832f35b3a9bf667 | [
"bzip2-1.0.6"
] | null | null | null | ticket/home/models.py | canurag18212/Computer_Project | 57a5215cdbd0287f4408b60b2832f35b3a9bf667 | [
"bzip2-1.0.6"
] | null | null | null | from django.db import models
# Create your models here.
class see_sign(models.Model):
name=models.CharField(max_length=50)
email=models.CharField(max_length=50)
password=models.CharField(max_length=50)
| 24.444444 | 44 | 0.754545 | 32 | 220 | 5.0625 | 0.59375 | 0.277778 | 0.333333 | 0.444444 | 0.481481 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031915 | 0.145455 | 220 | 9 | 45 | 24.444444 | 0.829787 | 0.109091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.2 | 0.2 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
2fb72314fa645a7538839379d2f65817c45dc78e | 18 | py | Python | snow.py | boristulch/cs3240-labdemo | fa8f85cc21a8ee4b721b71a9425b2fc8df06a0c2 | [
"MIT"
] | null | null | null | snow.py | boristulch/cs3240-labdemo | fa8f85cc21a8ee4b721b71a9425b2fc8df06a0c2 | [
"MIT"
] | null | null | null | snow.py | boristulch/cs3240-labdemo | fa8f85cc21a8ee4b721b71a9425b2fc8df06a0c2 | [
"MIT"
] | null | null | null | print("Snow Day!") | 18 | 18 | 0.666667 | 3 | 18 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 18 | 1 | 18 | 18 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0.473684 | 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 |
2fd7cc170c6ec8332d9c3acc4c15401687bba747 | 112 | py | Python | db/__init__.py | stohrendorf/confckurator | 6497d684739ed750324a081600c2adedb460c144 | [
"MIT"
] | 1 | 2017-10-14T23:47:04.000Z | 2017-10-14T23:47:04.000Z | db/__init__.py | stohrendorf/confckurator | 6497d684739ed750324a081600c2adedb460c144 | [
"MIT"
] | 6 | 2017-10-10T17:44:00.000Z | 2017-11-02T06:46:19.000Z | db/__init__.py | stohrendorf/confckurator | 6497d684739ed750324a081600c2adedb460c144 | [
"MIT"
] | null | null | null | from .dao import *
from .session import make_session, boot_database
from .utility import get_history_for_entity
| 28 | 48 | 0.839286 | 17 | 112 | 5.235294 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116071 | 112 | 3 | 49 | 37.333333 | 0.89899 | 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 |
2fe861bdc2b5c629ecf5bfa30a5ce2d247ec39af | 30 | py | Python | pyjector/__init__.py | nomike/pyjector | 5a50fb2f0ab7f84d582925c0adf0c4d099b7e64a | [
"MIT"
] | 37 | 2015-03-27T22:07:41.000Z | 2021-09-21T16:04:55.000Z | pyjector/__init__.py | nomike/pyjector | 5a50fb2f0ab7f84d582925c0adf0c4d099b7e64a | [
"MIT"
] | 14 | 2015-07-06T10:59:37.000Z | 2020-07-01T22:16:43.000Z | pyjector/__init__.py | nomike/pyjector | 5a50fb2f0ab7f84d582925c0adf0c4d099b7e64a | [
"MIT"
] | 19 | 2015-10-15T08:08:11.000Z | 2022-03-02T15:16:42.000Z | from pyjector import Pyjector
| 15 | 29 | 0.866667 | 4 | 30 | 6.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 30 | 1 | 30 | 30 | 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 |
2ff838163505ec489fdf79c38579640d9cd59961 | 23 | py | Python | a.py | toandaominh1997/ProductDetectionShopee | 9fe66b1e96ec3709630d486b66fc13a0fbc55a05 | [
"MIT"
] | null | null | null | a.py | toandaominh1997/ProductDetectionShopee | 9fe66b1e96ec3709630d486b66fc13a0fbc55a05 | [
"MIT"
] | null | null | null | a.py | toandaominh1997/ProductDetectionShopee | 9fe66b1e96ec3709630d486b66fc13a0fbc55a05 | [
"MIT"
] | 1 | 2020-07-06T07:15:43.000Z | 2020-07-06T07:15:43.000Z | print('toan dao minh')
| 11.5 | 22 | 0.695652 | 4 | 23 | 4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 23 | 1 | 23 | 23 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.565217 | 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 |
643bdffb940871462e4064f4be09c9442ad857ce | 67 | py | Python | Chapter 01/Chap01_Example1.19.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 01/Chap01_Example1.19.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 01/Chap01_Example1.19.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | print('Hello','I am printing space without concatenation operator') | 67 | 67 | 0.80597 | 9 | 67 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.089552 | 67 | 1 | 67 | 67 | 0.885246 | 0 | 0 | 0 | 0 | 0 | 0.808824 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
ff2c690cd10ade9345ef19cb87c0bc152c8c720d | 37 | py | Python | san/error.py | saninstein/sanpy | c0d936d65b52ac09721778dd1d7a2c4152725ab5 | [
"MIT"
] | 1 | 2022-03-21T22:38:43.000Z | 2022-03-21T22:38:43.000Z | san/error.py | saninstein/sanpy | c0d936d65b52ac09721778dd1d7a2c4152725ab5 | [
"MIT"
] | null | null | null | san/error.py | saninstein/sanpy | c0d936d65b52ac09721778dd1d7a2c4152725ab5 | [
"MIT"
] | null | null | null | class SanError(ValueError):
pass
| 12.333333 | 27 | 0.72973 | 4 | 37 | 6.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189189 | 37 | 2 | 28 | 18.5 | 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 |
ff5b2d4d3995f78982f30bee62216cf24a00f530 | 34 | py | Python | quart_xl/__main__.py | rafiibrahim8/quart-xl | 27333b93f093d638beb2962d74352aae5a9f2c59 | [
"MIT"
] | 2 | 2020-12-02T16:01:31.000Z | 2021-01-26T22:37:30.000Z | quart_xl/__main__.py | rafiibrahim8/quart-xl | 27333b93f093d638beb2962d74352aae5a9f2c59 | [
"MIT"
] | null | null | null | quart_xl/__main__.py | rafiibrahim8/quart-xl | 27333b93f093d638beb2962d74352aae5a9f2c59 | [
"MIT"
] | null | null | null | from .quart_xl import main
main()
| 11.333333 | 26 | 0.764706 | 6 | 34 | 4.166667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147059 | 34 | 2 | 27 | 17 | 0.862069 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
ff5d092269c2c23a907440d270d90bee59291a91 | 419 | py | Python | inversion/__init__.py | FabianKP/adaptive_eki | c83b5b05f601ef1fafbf6ad056cd59c1a7f0b072 | [
"MIT"
] | 1 | 2021-11-23T14:17:37.000Z | 2021-11-23T14:17:37.000Z | inversion/__init__.py | FabianKP/adaptive_eki | c83b5b05f601ef1fafbf6ad056cd59c1a7f0b072 | [
"MIT"
] | null | null | null | inversion/__init__.py | FabianKP/adaptive_eki | c83b5b05f601ef1fafbf6ad056cd59c1a7f0b072 | [
"MIT"
] | null | null | null |
from inversion.tikhonov import tikhonov
from inversion.direct_eki import direct_eki
from inversion.iterative_tikhonov import iterative_tikhonov
from inversion.adaptive_eki import adaptive_eki
from inversion.alpha_list import tikhonov_list, eki_list
from inversion.ornstein_uhlenbeck import ornstein_uhlenbeck
from inversion.simulate_measurement import simulate_measurement
from inversion.matrix_sqrt import matrix_sqrt | 46.555556 | 63 | 0.899761 | 56 | 419 | 6.464286 | 0.285714 | 0.287293 | 0.116022 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078759 | 419 | 9 | 64 | 46.555556 | 0.937824 | 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 |
441e152f119dca644bf6a4fb59bb5bd38d4b02b5 | 4,845 | py | Python | tests/src/Student_Attendance/student_timeseries.py | sreenivas8084/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | null | null | null | tests/src/Student_Attendance/student_timeseries.py | sreenivas8084/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | 2 | 2022-02-01T00:55:12.000Z | 2022-03-29T22:29:09.000Z | tests/src/Student_Attendance/student_timeseries.py | SreenivasNimmagadda/cQube | 3352a13f41679d707979e287d1880f0723b27510 | [
"MIT"
] | null | null | null | import unittest
from Student_Attendance.click_on_Home_icon import Home
from Student_Attendance.sar_time_series import time_series
from reuse_func import GetData
class cQube_Student_Attendance(unittest.TestCase):
@classmethod
def setUpClass(self):
self.data = GetData()
self.driver = self.data.get_driver()
self.driver.implicitly_wait(100)
self.data.open_cqube_appln(self.driver)
self.data.login_cqube(self.driver)
self.data.navigate_to_student_report()
self.data.page_loading(self.driver)
#
# def test_time_series(self):
# p = time_series(self.driver)
# res = p.check_time_series_day()
# self.assertEqual(0,res,msg='Time series dropdown having no options ')
# print('checked with Time series drop down ')
# self.data.page_loading(self.driver)
#
# def test_time_series_dropdown_options(self):
# p = time_series(self.driver)
# res = p.check_time_series_dropdown_options()
# self.assertNotEqual(0,res,msg='Time series dropdown having no options ')
# print('checked with Time series drop down ')
# self.data.page_loading(self.driver)
#
# def test_time_last_day_series(self):
# p = time_series(self.driver)
# res = p.check_time_series_month_and_year()
# self.assertEqual(0,res,msg='last day csv file is not downloaded')
# print('checked with Time series last day')
# self.data.page_loading(self.driver)
#
# def test_time_day_series(self):
# p = time_series(self.driver)
# res = p.check_time_series_day()
# # self.assertEqual(0, res, msg='time series day csv file is not downloaded')
# print('checked with Time series last day')
# self.data.page_loading(self.driver)
#
# def test_time_last_7day_series(self):
# p = time_series(self.driver)
# res = p.check_time_series_last_7_days()
# self.assertEqual(0, res, msg='last 7 days csv file is not downloaded')
# print('checked with Time series last 7 day')
# self.data.page_loading(self.driver)
#
# def test_time_last_30_day_series(self):
# p = time_series(self.driver)
# res = p.check_time_series_last_30_days()
# self.assertEqual(0, res, msg='last 30 days csv file is not downloaded')
# print('checked with Time series last 30 day')
# self.data.page_loading(self.driver)
#
# def test_timeseries_overall_series(self):
# p = time_series(self.driver)
# res = p.check_time_overall_series_dropdown()
# self.assertEqual(0, res, msg='overall csv file is not downloaded')
# print('checked with Time series overall')
# self.data.page_loading(self.driver)
#
# def test_month_and_year(self):
# p = time_series(self.driver)
# res = p.check_time_series_month_and_year()
# self.assertEqual(0, res, msg='year and month csv file is not downloaded')
# print('checked with Time series year and month')
# self.data.page_loading(self.driver)
#
# def test_month_and_year_csv_file(self):
# p = time_series(self.driver)
# res = p.check_year_and_month_dropdowns_csv_download()
# self.assertEqual(0, res, msg='year and month csv file is not downloaded')
# print('checked with Time series year and month')
# self.data.page_loading(self.driver)
#
# def test_time_series_and_click_on_block_cluster_school_btns(self):
# p = time_series(self.driver)
# res = p.check_select_time_series_and_click_on_block_cluster_school_btns()
# self.assertEqual(0, res, msg='Footer value mismatch found')
# print("Checking with block ,cluster and school level of time series")
# self.data.page_loading(self.driver)
def test_academic_dropdown_box(self):
p = Home(self.driver)
res = p.check_academic_dropdown_is_present()
self.assertNotEqual(0, res, msg="Options are not present in dropdown")
print('checked with academic dropdown')
self.data.page_loading(self.driver)
def test_academic_dropdown_options(self):
p = Home(self.driver)
res = p.check_academic_dropdown_options()
self.assertNotEqual(0, res, msg="Options are not present in dropdown")
print('checked with academic years')
self.data.page_loading(self.driver)
def test_academic_year_csv_file_download(self):
p = Home(self.driver)
res = p.download_yearwise_files_by_academic_year()
self.assertEqual(0, res, msg="Academic file is not downloaded")
print('checked with academic years')
self.data.page_loading(self.driver)
@classmethod
def tearDownClass(cls):
cls.driver.close() | 43.258929 | 86 | 0.666047 | 657 | 4,845 | 4.671233 | 0.144597 | 0.117302 | 0.054741 | 0.086673 | 0.776149 | 0.758227 | 0.748452 | 0.702183 | 0.702183 | 0.663734 | 0 | 0.007539 | 0.233437 | 4,845 | 112 | 87 | 43.258929 | 0.818794 | 0.598555 | 0 | 0.371429 | 0 | 0 | 0.098719 | 0 | 0 | 0 | 0 | 0 | 0.085714 | 1 | 0.142857 | false | 0 | 0.114286 | 0 | 0.285714 | 0.085714 | 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 |
9256234949a3c4ca183ca6946f9e5da061d3ce6d | 349 | py | Python | src/loader/loader_util.py | AngelRealms/jsFO | 1a61d1e9c50ea7d5a6e65ddf114872839a7b26fd | [
"Apache-2.0"
] | 29 | 2015-05-13T08:39:15.000Z | 2021-09-19T12:52:18.000Z | src/loader/loader_util.py | AngelRealms/jsFO | 1a61d1e9c50ea7d5a6e65ddf114872839a7b26fd | [
"Apache-2.0"
] | 31 | 2015-05-13T08:05:12.000Z | 2021-09-20T03:28:35.000Z | src/loader/loader_util.py | AngelRealms/jsFO | 1a61d1e9c50ea7d5a6e65ddf114872839a7b26fd | [
"Apache-2.0"
] | 8 | 2015-05-14T15:12:45.000Z | 2022-01-16T16:40:23.000Z | import struct
def readUint32(stream, bigEndian = 0):
return struct.unpack((">I" if bigEndian else "<I"), stream.read(4))[0]
def readInt32(stream, bigEndian = 0):
return struct.unpack((">i" if bigEndian else "<i"), stream.read(4))[0]
def readUint16(stream, bigEndian = 0):
return struct.unpack((">H" if bigEndian else "<H"), stream.read(2))[0]
| 31.727273 | 71 | 0.684814 | 53 | 349 | 4.509434 | 0.339623 | 0.188285 | 0.200837 | 0.276151 | 0.694561 | 0.694561 | 0.552301 | 0.552301 | 0.552301 | 0.552301 | 0 | 0.04918 | 0.126075 | 349 | 10 | 72 | 34.9 | 0.734426 | 0 | 0 | 0 | 0 | 0 | 0.034384 | 0 | 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 |
92720a644940c5851dd3a2e7c9820ae78862c3b7 | 89 | py | Python | todos/admin.py | sandeepagrawal8875/django_rest_ToDo_app | 87f042d3fc613f5c82b7ffd2a9dd9fe446bfdb2f | [
"MIT"
] | null | null | null | todos/admin.py | sandeepagrawal8875/django_rest_ToDo_app | 87f042d3fc613f5c82b7ffd2a9dd9fe446bfdb2f | [
"MIT"
] | null | null | null | todos/admin.py | sandeepagrawal8875/django_rest_ToDo_app | 87f042d3fc613f5c82b7ffd2a9dd9fe446bfdb2f | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Todo
admin.site.register(Todo) | 17.8 | 33 | 0.775281 | 13 | 89 | 5.307692 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157303 | 89 | 5 | 34 | 17.8 | 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 |
927d705a2ebd7dae6232a266952c0158c62599a9 | 171 | py | Python | dexp/cli/dexp_commands/speedtest.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 16 | 2021-04-21T14:09:19.000Z | 2022-03-22T02:30:59.000Z | dexp/cli/dexp_commands/speedtest.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 28 | 2021-04-15T17:43:08.000Z | 2022-03-29T16:08:35.000Z | dexp/cli/dexp_commands/speedtest.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 3 | 2022-02-08T17:41:30.000Z | 2022-03-18T15:32:27.000Z | import click
from dexp.utils.speed_test import perform_speed_test
@click.command()
def speedtest():
"""Estimates storage medium speed."""
perform_speed_test()
| 15.545455 | 52 | 0.74269 | 22 | 171 | 5.545455 | 0.636364 | 0.221311 | 0.262295 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152047 | 171 | 10 | 53 | 17.1 | 0.841379 | 0.181287 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.4 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
928302a2e6378a338118fa27a1220040860a4061 | 122 | py | Python | tech_gallery_bot/repositories/__init__.py | ciandt/tech-gallery-chat-bot | f4c83ab626d829b8c8ce6dd549156224a034aa6d | [
"MIT"
] | 1 | 2020-02-19T14:03:25.000Z | 2020-02-19T14:03:25.000Z | tech_gallery_bot/repositories/__init__.py | ciandt/tech-gallery-chat-bot | f4c83ab626d829b8c8ce6dd549156224a034aa6d | [
"MIT"
] | null | null | null | tech_gallery_bot/repositories/__init__.py | ciandt/tech-gallery-chat-bot | f4c83ab626d829b8c8ce6dd549156224a034aa6d | [
"MIT"
] | 1 | 2020-03-31T15:11:35.000Z | 2020-03-31T15:11:35.000Z | """Repositories"""
from .user_profile_repository import UserProfileRepository
from .user_repository import UserRepository
| 30.5 | 58 | 0.860656 | 12 | 122 | 8.5 | 0.666667 | 0.156863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.07377 | 122 | 3 | 59 | 40.666667 | 0.902655 | 0.098361 | 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 |
92ad49d62cabc7f2fa8183745eca6e321e8661ff | 155 | py | Python | server.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | 1 | 2021-03-04T13:04:28.000Z | 2021-03-04T13:04:28.000Z | g_packages/official_py_docker/docker/server.py | lanagarmire/granatumx | 3dee3a8fb2ba851c31a9f6338aef1817217769f9 | [
"MIT"
] | 16 | 2020-01-28T23:03:40.000Z | 2022-02-10T00:30:16.000Z | g_packages/official_py_docker/docker/server.py | lanagarmire/granatumx | 3dee3a8fb2ba851c31a9f6338aef1817217769f9 | [
"MIT"
] | 2 | 2020-06-16T16:42:40.000Z | 2020-08-28T16:59:42.000Z | from flask import Flask, request
from time import sleep
app = Flask(__name__)
@app.route("/run", methods=["POST"])
def hello():
return "Hello World!"
| 15.5 | 36 | 0.696774 | 22 | 155 | 4.727273 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154839 | 155 | 9 | 37 | 17.222222 | 0.793893 | 0 | 0 | 0 | 0 | 0 | 0.129032 | 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 |
2b8027b7e937db70b8d5a3625b2288addbe810f7 | 36 | py | Python | tests/__init__.py | Clariteia/api_gateway_common | e68095f31091699fc6cc4537bd6acf97a8dc6c3e | [
"MIT"
] | 3 | 2021-05-14T08:13:09.000Z | 2021-05-26T11:25:35.000Z | tests/__init__.py | Clariteia/api_gateway_common | e68095f31091699fc6cc4537bd6acf97a8dc6c3e | [
"MIT"
] | 27 | 2021-05-13T08:43:19.000Z | 2021-08-24T17:19:36.000Z | tests/__init__.py | Clariteia/api_gateway_common | e68095f31091699fc6cc4537bd6acf97a8dc6c3e | [
"MIT"
] | null | null | null | """Unit test package for common."""
| 18 | 35 | 0.666667 | 5 | 36 | 4.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138889 | 36 | 1 | 36 | 36 | 0.774194 | 0.805556 | 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 |
2bca774f5ecbd06aa3c9c102f56d2552e1f3d951 | 25 | py | Python | __init__.py | drewejohnson/sssFile | 32a90aeeab58538615e904cd11db1be0d9579657 | [
"MIT"
] | null | null | null | __init__.py | drewejohnson/sssFile | 32a90aeeab58538615e904cd11db1be0d9579657 | [
"MIT"
] | null | null | null | __init__.py | drewejohnson/sssFile | 32a90aeeab58538615e904cd11db1be0d9579657 | [
"MIT"
] | null | null | null | from SerpentFile import * | 25 | 25 | 0.84 | 3 | 25 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 25 | 1 | 25 | 25 | 0.954545 | 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 |
2be139443bec737d830df2107d74bcee943bb09d | 162 | py | Python | backend/server/task/admin.py | munteanugabriel25/Javascript-Django-TodoList- | e3cb8d4a573dfbb84960839b7a01a24a195c7755 | [
"Unlicense"
] | null | null | null | backend/server/task/admin.py | munteanugabriel25/Javascript-Django-TodoList- | e3cb8d4a573dfbb84960839b7a01a24a195c7755 | [
"Unlicense"
] | null | null | null | backend/server/task/admin.py | munteanugabriel25/Javascript-Django-TodoList- | e3cb8d4a573dfbb84960839b7a01a24a195c7755 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Task, User_profile
# Register your models here.
admin.site.register(Task)
admin.site.register(User_profile) | 23.142857 | 38 | 0.814815 | 24 | 162 | 5.416667 | 0.541667 | 0.169231 | 0.261538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104938 | 162 | 7 | 39 | 23.142857 | 0.896552 | 0.160494 | 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 |
920d1d5cde4aaa6b378bd63f2cf4409e64372988 | 8,151 | py | Python | tests/functional/test_read.py | ThomasThoren/pockette | cea8ed9cdccda4fc8a06057ebfe3ec2952bc2a2b | [
"MIT"
] | 1 | 2020-06-19T04:04:04.000Z | 2020-06-19T04:04:04.000Z | tests/functional/test_read.py | ThomasThoren/pockette | cea8ed9cdccda4fc8a06057ebfe3ec2952bc2a2b | [
"MIT"
] | null | null | null | tests/functional/test_read.py | ThomasThoren/pockette | cea8ed9cdccda4fc8a06057ebfe3ec2952bc2a2b | [
"MIT"
] | null | null | null | """Test reading Pocket data with the `pockette read` command."""
import json
import os
from unittest.mock import patch, MagicMock
from click.testing import CliRunner
import pytest # type: ignore
from pockette import DATA_FILE, COUNT_DEFAULT
from pockette.cli import read
@pytest.fixture
def mock_env_vars(monkeypatch):
"""Temporarily set environment variables."""
monkeypatch.setenv("POCKET_CONSUMER_KEY", "consumer_key")
monkeypatch.setenv("POCKET_ACCESS_TOKEN", "access_token")
@pytest.fixture
def fake_pocket_response(scope="module") -> MagicMock: # pylint: disable=unused-argument
"""Get fake Pocket response."""
response = MagicMock()
fake_pocket_response_file = os.path.realpath(
os.path.join(os.path.dirname(DATA_FILE), '..', 'tests', 'data', 'pocket.json')
)
with open(fake_pocket_response_file, 'r') as f_in:
response.text = json.dumps(json.load(f_in))
return response
@patch('pockette.pocket_handler.webbrowser.open')
@patch('pockette.pocket_handler.requests.post')
class TestRead: # pylint: disable=no-self-use,redefined-outer-name,unused-argument
"""Test reading Pocket data."""
def test_read(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read)
assert result.exit_code == 0
assert 'Pages found (44)' in result.output
assert mock_webbrowser.called
def test_read_all(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --all option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--all'])
assert result.exit_code == 0
assert 'Pages found (44)' in result.output
assert mock_webbrowser.called
def test_read_include(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --include option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--include', 'nytimes.com'])
assert result.exit_code == 0
assert 'Pages found (18)' in result.output
assert 'nytimes.com' in result.output
assert mock_webbrowser.called
def test_read_exclude(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --exclude option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--exclude', 'nytimes.com'])
assert result.exit_code == 0
assert 'Pages found (26)' in result.output
assert 'nytimes.com' not in result.output
assert mock_webbrowser.called
def test_read_start_date(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --start option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--start', '2020-01-01'])
assert result.exit_code == 0
assert 'Pages found (17)' in result.output
assert mock_webbrowser.called
def test_read_end_date(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --end option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--end', '2019-06-01'])
assert result.exit_code == 0
assert 'Pages found (16)' in result.output
assert mock_webbrowser.called
def test_read_short_length(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --lenth=short option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--length', 'short'])
assert result.exit_code == 0
assert 'Pages found (10)' in result.output
assert mock_webbrowser.called
def test_read_long_length(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --lenth=long option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--length', 'long'])
assert result.exit_code == 0
assert 'Pages found (19)' in result.output
assert mock_webbrowser.called
def test_read_count(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --count option. Check that count default isn't exceeded."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--count', str(COUNT_DEFAULT + 1)])
assert result.exit_code == 0
assert 'Pages found (44)' in result.output
assert f'{COUNT_DEFAULT}: ' in result.output
assert f'{COUNT_DEFAULT + 1}: ' not in result.output
assert mock_webbrowser.call_count == COUNT_DEFAULT * 2
def test_read_sort_by_time(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --sort=time option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--sort', 'time'])
assert result.exit_code == 0
assert 'Pages found (44)' in result.output
assert '1: Yes, We Mean Literally Abolish the Police' in result.output
assert mock_webbrowser.called
def test_read_sort_by_site(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --sort=site option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--sort', 'site'])
assert result.exit_code == 0
assert 'Pages found (44)' in result.output
assert '1: You Are Not Google' in result.output
assert mock_webbrowser.called
def test_read_sort_by_time_reverse(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --reverse option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--reverse']) # Default is to sort by time
assert result.exit_code == 0
assert 'Pages found (44)' in result.output
assert '1: The Rent Racket — ProPublica' in result.output
assert mock_webbrowser.called
def test_read_offset(self, mock_post: MagicMock, mock_webbrowser: MagicMock, mock_env_vars,
fake_pocket_response: dict):
"""Test reading Pocket data with the --offset option."""
mock_post.return_value = fake_pocket_response
runner = CliRunner()
result = runner.invoke(read, args=['--offset', '1'])
assert result.exit_code == 0
assert 'Pages found (44)' in result.output
assert '1: The Virus Will Win' in result.output
assert mock_webbrowser.called
| 39.567961 | 109 | 0.656238 | 1,005 | 8,151 | 5.104478 | 0.147264 | 0.05848 | 0.105263 | 0.081871 | 0.768616 | 0.768616 | 0.746589 | 0.722027 | 0.707602 | 0.692398 | 0 | 0.010237 | 0.245001 | 8,151 | 205 | 110 | 39.760976 | 0.823204 | 0.11974 | 0 | 0.540741 | 0 | 0 | 0.098645 | 0.010725 | 0 | 0 | 0 | 0 | 0.348148 | 1 | 0.111111 | false | 0 | 0.051852 | 0 | 0.177778 | 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 |
a632eceb2058704ae9d641a4ab900ea101454eee | 10,211 | py | Python | tests/test_multiparser.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 26 | 2016-02-25T19:27:55.000Z | 2022-01-22T09:54:59.000Z | tests/test_multiparser.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 28 | 2018-11-22T19:51:06.000Z | 2022-03-20T23:02:13.000Z | tests/test_multiparser.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 18 | 2016-06-01T11:53:45.000Z | 2021-12-27T03:41:03.000Z | #!/usr/bin/python
import os
import csv
import shutil
import sys
import unittest
from io import StringIO
sys.path.append(".")
from annogesiclib.multiparser import Multiparser
class TestMultiparser(unittest.TestCase):
def setUp(self):
self.multiparser = Multiparser()
self.example = Example()
self.ref_folder = "ref_folder"
if (not os.path.exists(self.ref_folder)):
os.mkdir(self.ref_folder)
self.tar_folder = "tar_folder"
if (not os.path.exists(self.tar_folder)):
os.mkdir(self.tar_folder)
def tearDown(self):
if os.path.exists(self.ref_folder):
shutil.rmtree(self.ref_folder)
if os.path.exists(self.tar_folder):
shutil.rmtree(self.tar_folder)
def test_combine_fasta(self):
tmp_tar = os.path.join(self.tar_folder, "tmp")
tmp_ref = os.path.join(self.ref_folder, "test.gff_folder")
os.mkdir(tmp_ref)
os.mkdir(tmp_tar)
sub_fasta1 = os.path.join(tmp_tar, "aaa.fa")
with open(sub_fasta1, "w") as rh:
rh.write(self.example.sub_fasta1)
sub_fasta2 = os.path.join(tmp_tar, "bbb.fa")
with open(sub_fasta2, "w") as rh:
rh.write(self.example.sub_fasta2)
sub_gff1 = os.path.join(tmp_ref, "aaa.gff")
with open(sub_gff1, "w") as rh:
rh.write(self.example.sub_gff1)
sub_gff2 = os.path.join(tmp_ref, "bbb.gff")
with open(sub_gff2, "w") as rh:
rh.write(self.example.sub_gff2)
self.multiparser.combine_fasta(self.ref_folder, tmp_tar, None)
self.assertTrue(os.path.exists(os.path.join(tmp_tar, "test.fa")))
def test_combine_wig(self):
tmp_tar = os.path.join(self.tar_folder, "tmp")
tmp_ref = os.path.join(self.ref_folder, "test.fa_folder")
os.mkdir(tmp_ref)
os.mkdir(tmp_tar)
sub_fasta1 = os.path.join(tmp_ref, "aaa.fa")
with open(sub_fasta1, "w") as rh:
rh.write(self.example.sub_fasta1)
sub_fasta2 = os.path.join(tmp_ref, "bbb.fa")
with open(sub_fasta2, "w") as rh:
rh.write(self.example.sub_fasta2)
sub_wig1 = os.path.join(tmp_tar, "test_forward.wig_STRAIN_aaa.wig")
sub_wig2 = os.path.join(tmp_tar, "test_forward.wig_STRAIN_bbb.wig")
sub_wig3 = os.path.join(tmp_tar, "test_reverse.wig_STRAIN_aaa.wig")
sub_wig4 = os.path.join(tmp_tar, "test_reverse.wig_STRAIN_bbb.wig")
wig_files = [sub_wig1, sub_wig2, sub_wig3, sub_wig4]
example_wigs = [self.example.sub_f_wig1, self.example.sub_f_wig2,
self.example.sub_r_wig1, self.example.sub_r_wig2]
for index in range(0, 4):
with open(wig_files[index], "w") as fh:
fh.write(example_wigs[index])
libs = ["test_forward.wig_STRAIN_aaa.wig:frag:1:a:+",
"test_reverse.wig_STRAIN_aaa.wig:frag:1:a:-"]
self.multiparser.combine_wig(self.ref_folder, tmp_tar, "fasta", libs)
self.assertTrue(os.path.exists(os.path.join(
tmp_tar, "test_forward.wig")))
self.assertTrue(os.path.exists(os.path.join(
tmp_tar, "test_reverse.wig")))
def test_combine_gff(self):
tmp_tar = os.path.join(self.tar_folder, "tmp")
tmp_ref = os.path.join(self.ref_folder, "test.fa_folder")
os.mkdir(tmp_ref)
os.mkdir(tmp_tar)
sub_fasta1 = os.path.join(tmp_ref, "aaa.fa")
with open(sub_fasta1, "w") as rh:
rh.write(self.example.sub_fasta1)
sub_fasta2 = os.path.join(tmp_ref, "bbb.fa")
with open(sub_fasta2, "w") as rh:
rh.write(self.example.sub_fasta2)
sub_gff1 = os.path.join(tmp_tar, "aaa.gff")
with open(sub_gff1, "w") as rh:
rh.write(self.example.sub_gff1)
sub_gff2 = os.path.join(tmp_tar, "bbb.gff")
with open(sub_gff2, "w") as rh:
rh.write(self.example.sub_gff2)
self.multiparser.combine_gff(self.ref_folder, tmp_tar, "fasta", None)
self.assertTrue(os.path.exists(os.path.join(tmp_tar, "test.gff")))
def test_parser_fasta(self):
fasta_file = os.path.join(self.ref_folder, "test.fa")
with open(fasta_file, "w") as rh:
rh.write(self.example.fasta_file)
self.multiparser.parser_fasta(self.ref_folder)
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "tmp/aaa.fa")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "tmp/bbb.fa")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "test.fa_folder/aaa.fa")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "test.fa_folder/bbb.fa")))
def test_parser_gff(self):
gff_file = os.path.join(self.ref_folder, "test.gff")
with open(gff_file, "w") as rh:
rh.write(self.example.gff_file)
self.multiparser.parser_gff(self.ref_folder, None)
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "tmp/aaa.gff")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "tmp/bbb.gff")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "test.gff_folder/aaa.gff")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "test.gff_folder/bbb.gff")))
tss_file = os.path.join(self.ref_folder, "test_TSS.gff")
os.rename(gff_file, tss_file)
tss_file = os.path.join(self.ref_folder, "test_TSS.gff")
with open(tss_file, "w") as rh:
rh.write(self.example.gff_file)
self.multiparser.parser_gff(self.ref_folder, "TSS")
self.assertTrue(os.path.exists(os.path.join(
self.ref_folder, "tmp/aaa_TSS.gff")))
self.assertTrue(os.path.exists(os.path.join(
self.ref_folder, "tmp/bbb_TSS.gff")))
self.assertTrue(os.path.exists(os.path.join(
self.ref_folder, "test_TSS.gff_folder/aaa_TSS.gff")))
self.assertTrue(os.path.exists(os.path.join(
self.ref_folder, "test_TSS.gff_folder/bbb_TSS.gff")))
def test_parser_wig(self):
wig_f_file = os.path.join(self.ref_folder, "test_forward.wig")
with open(wig_f_file, "w") as rh:
rh.write(self.example.wig_f_file)
wig_r_file = os.path.join(self.ref_folder, "test_reverse.wig")
with open(wig_r_file, "w") as rh:
rh.write(self.example.wig_r_file)
self.multiparser.parser_wig(self.ref_folder)
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "tmp/test_forward_STRAIN_aaa.wig")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "tmp/test_forward_STRAIN_bbb.wig")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "tmp/test_reverse_STRAIN_aaa.wig")))
self.assertTrue(os.path.exists(
os.path.join(self.ref_folder, "tmp/test_reverse_STRAIN_bbb.wig")))
self.assertTrue(os.path.exists(os.path.join(
self.ref_folder,
"test_forward.wig_folder/test_forward_STRAIN_aaa.wig")))
self.assertTrue(os.path.exists(os.path.join(
self.ref_folder,
"test_forward.wig_folder/test_forward_STRAIN_bbb.wig")))
self.assertTrue(os.path.exists(os.path.join(
self.ref_folder,
"test_reverse.wig_folder/test_reverse_STRAIN_aaa.wig")))
self.assertTrue(os.path.exists(os.path.join(
self.ref_folder,
"test_reverse.wig_folder/test_reverse_STRAIN_bbb.wig")))
class Example(object):
fasta_file = """>aaa
CGCAGGTTGAGTTCCTGTTCCCGATAGATCCGATAAACCCGCTTATGATTCCAGAGCTGTCCCTGCACAT
>bbb
CGACAGGCCAGTGCTGACCCCATGATGCGCCACAGCTTGTGCGGCCAGTTCCCGGCGCTGGGCTG"""
sub_fasta1 = """>aaa
CGCAGGTTGAGTTCCTGTTCCCGATAGATCCGATAAACCCGCTTATGATTCCAGAGCTGTCCCTGCACAT"""
sub_fasta2 = """>bbb
CGACAGGCCAGTGCTGACCCCATGATGCGCCACAGCTTGTGCGGCCAGTTCCCGGCGCTGGGCTG"""
gff_file = """##gff3
aaa Refseq gene 517 1878 . + . db_xref=GeneID:3919798;locus_tag=SAOUHSC_00001;gene=dnaA
aaa Refseq gene 1234 2344 . + . db_xref=GeneID:3919798;locus_tag=SAOUHSC_00001;gene=dnaA
bbb Refseq gene 5755 8456 . - . db_xref=GeneID:3919180;locus_tag=SAOUHSC_00007
bbb Refseq gene 9755 10456 . - . db_xref=GeneID:3919180;locus_tag=SAOUHSC_00007"""
sub_gff1 = """aaa Refseq gene 517 1878 . + . db_xref=GeneID:3919798;locus_tag=SAOUHSC_00001;gene=dnaA
aaa Refseq gene 1234 2344 . + . db_xref=GeneID:3919798;locus_tag=SAOUHSC_00001;gene=dnaA"""
sub_gff2 = """bbb Refseq gene 5755 8456 . - . db_xref=GeneID:3919180;locus_tag=SAOUHSC_00007
bbb Refseq gene 9755 10456 . - . db_xref=GeneID:3919180;locus_tag=SAOUHSC_00007"""
wig_f_file = """track type=wiggle_0 name="test_forward"
variableStep chrom=aaa span=1
312 1.4041251228308191
313 56.867067474648174
314 56.867067474648174
315 56.867067474648174
variableStep chrom=bbb span=1
32 1.4041251228308191
33 56.867067474648174
34 56.867067474648174
35 56.867067474648174"""
wig_r_file = """track type=wiggle_0 name="test_reverse"
variableStep chrom=aaa span=1
312 -1.4041251228308191
313 -56.867067474648174
314 -56.867067474648174
315 -56.867067474648174
variableStep chrom=bbb span=1
32 -1.4041251228308191
33 -56.867067474648174
34 -56.867067474648174
35 -56.867067474648174"""
sub_f_wig1 = """track type=wiggle_0 name="test_forward"
variableStep chrom=aaa span=1
312 1.4041251228308191
313 56.867067474648174
314 56.867067474648174
315 56.867067474648174
"""
sub_f_wig2 = """track type=wiggle_0 name="test_forward"
variableStep chrom=bbb span=1
32 1.4041251228308191
33 56.867067474648174
34 56.867067474648174
35 56.867067474648174
"""
sub_r_wig1 = """track type=wiggle_0 name="test_reverse"
variableStep chrom=aaa span=1
312 -1.4041251228308191
313 -56.867067474648174
314 -56.867067474648174
315 -56.867067474648174
"""
sub_r_wig2 = """track type=wiggle_0 name="test_reverse"
variableStep chrom=bbb span=1
32 -1.4041251228308191
33 -56.867067474648174
34 -56.867067474648174
35 -56.867067474648174
"""
if __name__ == "__main__":
unittest.main()
| 40.200787 | 105 | 0.671433 | 1,481 | 10,211 | 4.419987 | 0.084402 | 0.071494 | 0.076383 | 0.068439 | 0.797434 | 0.792087 | 0.766422 | 0.74809 | 0.729911 | 0.676444 | 0 | 0.104483 | 0.20047 | 10,211 | 253 | 106 | 40.359684 | 0.69733 | 0.001567 | 0 | 0.480176 | 0 | 0.017621 | 0.316951 | 0.133804 | 0 | 0 | 0 | 0 | 0.105727 | 1 | 0.035242 | false | 0 | 0.030837 | 0 | 0.127753 | 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 |
a69c54f0511550786d0165d297de88847d00d525 | 129 | py | Python | pandemicsim/pandemic/test.py | enceladus2000/abm | 08edff29aad51614d9bb183fb355d692c9f4f67e | [
"MIT"
] | null | null | null | pandemicsim/pandemic/test.py | enceladus2000/abm | 08edff29aad51614d9bb183fb355d692c9f4f67e | [
"MIT"
] | null | null | null | pandemicsim/pandemic/test.py | enceladus2000/abm | 08edff29aad51614d9bb183fb355d692c9f4f67e | [
"MIT"
] | null | null | null | from pandemicsim.pandemic.pandemic import Pandemic
pandemic_model = Pandemic()
pandemic_model.run_model()
# datacollector.serve | 21.5 | 50 | 0.837209 | 15 | 129 | 7 | 0.533333 | 0.457143 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085271 | 129 | 6 | 51 | 21.5 | 0.889831 | 0.147287 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 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 |
a6a0c61221f4630f0edeab0d2a51b9f0d3bf0519 | 114 | py | Python | systemonachip/register/__init__.py | tannewt/systemonachip | 6440b7ad7648a1affa1e6ddbdbf8d6fe76f57df7 | [
"BSD-2-Clause"
] | 5 | 2020-08-01T00:28:34.000Z | 2020-08-10T19:14:35.000Z | systemonachip/register/__init__.py | tannewt/systemonachip | 6440b7ad7648a1affa1e6ddbdbf8d6fe76f57df7 | [
"BSD-2-Clause"
] | null | null | null | systemonachip/register/__init__.py | tannewt/systemonachip | 6440b7ad7648a1affa1e6ddbdbf8d6fe76f57df7 | [
"BSD-2-Clause"
] | null | null | null | from .static import *
from .readwrite import *
from .config import *
from .variable import *
from .event import *
| 19 | 24 | 0.736842 | 15 | 114 | 5.6 | 0.466667 | 0.47619 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175439 | 114 | 5 | 25 | 22.8 | 0.893617 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
a6a6119056720cbb6313581efb0bf23fede3be92 | 103 | py | Python | src/evolvepy/integrations/wandb/__init__.py | EltonCN/evolvepy | 4489264d6c03ea4f3c23ea665fdf12fe4ead1ccc | [
"MIT"
] | 1 | 2022-01-13T21:11:53.000Z | 2022-01-13T21:11:53.000Z | src/evolvepy/integrations/wandb/__init__.py | EltonCN/evolvepy | 4489264d6c03ea4f3c23ea665fdf12fe4ead1ccc | [
"MIT"
] | null | null | null | src/evolvepy/integrations/wandb/__init__.py | EltonCN/evolvepy | 4489264d6c03ea4f3c23ea665fdf12fe4ead1ccc | [
"MIT"
] | null | null | null | '''
Integration with "Weights & Biases" (https://wandb.ai/site)
'''
from .wandb import WandbLogger | 20.6 | 63 | 0.679612 | 12 | 103 | 5.833333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15534 | 103 | 5 | 64 | 20.6 | 0.804598 | 0.572816 | 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 |
a6ca1f69d469a518b2df7d83f604e2f20733dee2 | 2,600 | py | Python | 1391. Check if There is a Valid Path in a Grid/main.py | amanchadha/LeetCode | 20dddf0616351ad399f0fa03cb6a2b5cbdd25279 | [
"MIT"
] | 1 | 2021-07-18T06:18:40.000Z | 2021-07-18T06:18:40.000Z | 1391. Check if There is a Valid Path in a Grid/main.py | amanchadha/LeetCode | 20dddf0616351ad399f0fa03cb6a2b5cbdd25279 | [
"MIT"
] | null | null | null | 1391. Check if There is a Valid Path in a Grid/main.py | amanchadha/LeetCode | 20dddf0616351ad399f0fa03cb6a2b5cbdd25279 | [
"MIT"
] | 3 | 2020-09-27T05:48:30.000Z | 2021-08-13T10:07:08.000Z | from collections import deque
class Solution:
def hasValidPath(self, grid: List[List[int]]) -> bool:
m, n = len(grid), len(grid[0])
visited = [[-1 for j in range(n)] for i in range(m)]
q = deque([(0, 0)])
visited[0][0] = 1
while len(q) != 0:
#print(q)
u = q.popleft()
i, j = u
visited[i][j] = 1
if i == m-1 and j == n-1:
return True
k = grid[i][j]
if k == 1:
if j-1>=0 and visited[i][j-1] == -1 and grid[i][j-1] in [1, 4, 6]:
q.append((i, j-1))
visited[i][j-1] == 1
if j+1<n and visited[i][j+1] == -1 and grid[i][j+1] in [1, 3, 5]:
q.append((i, j+1))
visited[i][j+1] == 1
elif k == 2:
if i-1>=0 and visited[i-1][j] == -1 and grid[i-1][j] in [2, 3, 4]:
q.append((i-1, j))
visited[i-1][j] == 1
if i+1<m and visited[i+1][j] == -1 and grid[i+1][j] in [2, 5, 6]:
q.append((i+1, j))
visited[i+1][j] == 1
elif k == 3:
if j-1>=0 and visited[i][j-1] == -1 and grid[i][j-1] in [1, 4, 6]:
q.append((i, j-1))
visited[i][j-1] == 1
if i+1<m and visited[i+1][j] == -1 and grid[i+1][j] in [2, 5, 6]:
q.append((i+1, j))
visited[i+1][j] == 1
elif k == 4:
if i+1<m and visited[i+1][j] == -1 and grid[i+1][j] in [2, 5, 6]:
q.append((i+1, j))
visited[i+1][j] == 1
if j+1<n and visited[i][j+1] == -1 and grid[i][j+1] in [1, 3, 5]:
q.append((i, j+1))
visited[i][j+1] == 1
elif k == 5:
if j-1>=0 and visited[i][j-1] == -1 and grid[i][j-1] in [1, 4, 6]:
q.append((i, j-1))
visited[i][j-1] == 1
if i-1>=0 and visited[i-1][j] == -1 and grid[i-1][j] in [2, 3, 4]:
q.append((i-1, j))
visited[i-1][j] == 1
elif k == 6:
if i-1>=0 and visited[i-1][j] == -1 and grid[i-1][j] in [2, 3, 4]:
q.append((i-1, j))
visited[i-1][j] == 1
if j+1<n and visited[i][j+1] == -1 and grid[i][j+1] in [1, 3, 5]:
q.append((i, j+1))
visited[i][j+1] == 1
return False
| 43.333333 | 82 | 0.351923 | 439 | 2,600 | 2.084282 | 0.095672 | 0.093989 | 0.081967 | 0.142077 | 0.748634 | 0.748634 | 0.748634 | 0.748634 | 0.748634 | 0.748634 | 0 | 0.100563 | 0.453077 | 2,600 | 59 | 83 | 44.067797 | 0.542897 | 0.003077 | 0 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.017544 | false | 0 | 0.017544 | 0 | 0.087719 | 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 |
a6dcca2543a3c064be025715ec50cdb5b44287ff | 332 | py | Python | ramda/take_test.py | jakobkolb/ramda.py | 982b2172f4bb95b9a5b09eff8077362d6f2f0920 | [
"MIT"
] | 56 | 2018-08-06T08:44:58.000Z | 2022-03-17T09:49:03.000Z | ramda/take_test.py | jakobkolb/ramda.py | 982b2172f4bb95b9a5b09eff8077362d6f2f0920 | [
"MIT"
] | 28 | 2019-06-17T11:09:52.000Z | 2022-02-18T16:59:21.000Z | ramda/take_test.py | jakobkolb/ramda.py | 982b2172f4bb95b9a5b09eff8077362d6f2f0920 | [
"MIT"
] | 5 | 2019-09-18T09:24:38.000Z | 2021-07-21T08:40:23.000Z | from ramda import *
from ramda.private.asserts import *
def take_nocurry_test():
assert_iterables_equal(take(2, [1, 2, 3, 4]), [1, 2])
def take_curry_test():
assert_iterables_equal(take(2)([1, 2, 3, 4]), [1, 2])
assert_iterables_equal(
take(2)(({"a": 1, "b": 2, "c": 3}).items()), [("a", 1), ("b", 2)]
)
| 23.714286 | 73 | 0.572289 | 54 | 332 | 3.333333 | 0.388889 | 0.044444 | 0.333333 | 0.4 | 0.527778 | 0.388889 | 0.388889 | 0.388889 | 0.388889 | 0.388889 | 0 | 0.074906 | 0.195783 | 332 | 13 | 74 | 25.538462 | 0.599251 | 0 | 0 | 0 | 0 | 0 | 0.01506 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 1 | 0.222222 | true | 0 | 0.222222 | 0 | 0.444444 | 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 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
5b2b9440258430fb8bf1d4c500c02f8d698847d7 | 256 | py | Python | DesignPatterns/03_decorator/2_decorator/decorators/vinyl.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | DesignPatterns/03_decorator/2_decorator/decorators/vinyl.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | DesignPatterns/03_decorator/2_decorator/decorators/vinyl.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | from .abstract_decorator import AbstractDecorator
class Vinyl(AbstractDecorator):
@property
def description(self):
return self.car.description + ', vinyl upholstery'
@property
def cost(self):
return self.car.cost + 500.00
| 23.272727 | 58 | 0.695313 | 28 | 256 | 6.321429 | 0.607143 | 0.124294 | 0.158192 | 0.19209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025 | 0.21875 | 256 | 10 | 59 | 25.6 | 0.86 | 0 | 0 | 0.25 | 0 | 0 | 0.070313 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.25 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
5b550f16186e947f0f6d491c3ec6ccc79b79d6b7 | 187 | py | Python | work/auxiliary/exceptions.py | SirCumberdale/Cherry_stem | 912393cccead83728a71ec09d7685a59521c5e16 | [
"MIT"
] | null | null | null | work/auxiliary/exceptions.py | SirCumberdale/Cherry_stem | 912393cccead83728a71ec09d7685a59521c5e16 | [
"MIT"
] | 13 | 2020-01-28T22:18:55.000Z | 2022-03-12T00:02:59.000Z | work/auxiliary/exceptions.py | SirCumberdale/Cherry_stem | 912393cccead83728a71ec09d7685a59521c5e16 | [
"MIT"
] | null | null | null |
class CvException(Exception):
pass
class ReadImageException(CvException):
pass
class CustomImageException(Exception):
pass
class UnetModelException(Exception):
pass | 12.466667 | 38 | 0.754011 | 16 | 187 | 8.8125 | 0.4375 | 0.276596 | 0.255319 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 187 | 15 | 39 | 12.466667 | 0.921569 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
5ba27af153b90d6739df0749f8cec1a5784abaa8 | 248 | py | Python | gumshoe/classes/habits.py | philipcsaplar/gumshoe-cli | a1e205c6d16975841d97286a821a1da858ac03e9 | [
"MIT"
] | null | null | null | gumshoe/classes/habits.py | philipcsaplar/gumshoe-cli | a1e205c6d16975841d97286a821a1da858ac03e9 | [
"MIT"
] | null | null | null | gumshoe/classes/habits.py | philipcsaplar/gumshoe-cli | a1e205c6d16975841d97286a821a1da858ac03e9 | [
"MIT"
] | null | null | null |
class Habit:
def __init__(self, name, quota , period):
self.name = name
self.quota = quota
self.period = period
def __repr__(self):
return "Habit('{}', '{}', {})".format(self.name, self.quota, self.period) | 24.8 | 81 | 0.568548 | 29 | 248 | 4.586207 | 0.37931 | 0.180451 | 0.195489 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.270161 | 248 | 10 | 81 | 24.8 | 0.734807 | 0 | 0 | 0 | 0 | 0 | 0.084677 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0.142857 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
5bb39e6a8bca0dfc8d524c8dff4d3a20a3233dfe | 199 | py | Python | mmdet/core/bbox/iou_calculators/__init__.py | lnmdlong/mmdetection | 87768a5d0a0188d46c50b575b417e9ec2fb5c06c | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/iou_calculators/__init__.py | lnmdlong/mmdetection | 87768a5d0a0188d46c50b575b417e9ec2fb5c06c | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/iou_calculators/__init__.py | lnmdlong/mmdetection | 87768a5d0a0188d46c50b575b417e9ec2fb5c06c | [
"Apache-2.0"
] | null | null | null | from .builder import build_iou_calculator
from .iou2d_calculator import BboxOverlaps2D, bbox_overlaps, batched_nms
__all__ = ['build_iou_calculator', 'BboxOverlaps2D', 'bbox_overlaps', 'batch_nms']
| 39.8 | 82 | 0.824121 | 24 | 199 | 6.291667 | 0.583333 | 0.10596 | 0.238411 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016484 | 0.085427 | 199 | 4 | 83 | 49.75 | 0.813187 | 0 | 0 | 0 | 0 | 0 | 0.281407 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
5bc193021841353d1901efb3ec526d932573557c | 5,336 | py | Python | pystratis/api/diagnostic/tests/test_diagnostic.py | madrazzl3/pystratis | 8b78552e753ae1d12f2afb39e9a322a270fbb7b3 | [
"MIT"
] | null | null | null | pystratis/api/diagnostic/tests/test_diagnostic.py | madrazzl3/pystratis | 8b78552e753ae1d12f2afb39e9a322a270fbb7b3 | [
"MIT"
] | null | null | null | pystratis/api/diagnostic/tests/test_diagnostic.py | madrazzl3/pystratis | 8b78552e753ae1d12f2afb39e9a322a270fbb7b3 | [
"MIT"
] | null | null | null | import pytest
from pytest_mock import MockerFixture
from pystratis.api.diagnostic import Diagnostic
from pystratis.api.diagnostic.responsemodels import *
from pystratis.core.networks import StraxMain, CirrusMain
def test_all_strax_endpoints_implemented(strax_swagger_json):
paths = [key.lower() for key in strax_swagger_json['paths']]
for endpoint in paths:
if Diagnostic.route + '/' in endpoint:
assert endpoint in Diagnostic.endpoints
def test_all_cirrus_endpoints_implemented(cirrus_swagger_json):
paths = [key.lower() for key in cirrus_swagger_json['paths']]
for endpoint in paths:
if Diagnostic.route + '/' in endpoint:
assert endpoint in Diagnostic.endpoints
def test_all_interfluxstrax_endpoints_implemented(interfluxstrax_swagger_json):
paths = [key.lower() for key in interfluxstrax_swagger_json['paths']]
for endpoint in paths:
if Diagnostic.route + '/' in endpoint:
assert endpoint in Diagnostic.endpoints
def test_all_interfluxcirrus_endpoints_implemented(interfluxcirrus_swagger_json):
paths = [key.lower() for key in interfluxcirrus_swagger_json['paths']]
for endpoint in paths:
if Diagnostic.route + '/' in endpoint:
assert endpoint in Diagnostic.endpoints
@pytest.mark.parametrize('network', [StraxMain(), CirrusMain()], ids=['StraxMain', 'CirrusMain'])
def test_get_connected_peers_info(mocker: MockerFixture, network):
data = {
'peersByPeerId': [
{
'isConnected': True,
'disconnectReason': None,
'state': 1,
'endPoint': '[::ffff:x.x.x.x]:17105'
}
],
'connectedPeers': [
{
'isConnected': True,
'disconnectReason': None,
'state': 1,
'endPoint': '[::ffff:x.x.x.x]:17105'
}
],
'connectedPeersNotInPeersByPeerId': [
{
'isConnected': True,
'disconnectReason': None,
'state': 1,
'endPoint': '[::ffff:x.x.x.x]:17105'
}
]
}
mocker.patch.object(Diagnostic, 'get', return_value=data)
diagnostic = Diagnostic(network=network, baseuri=mocker.MagicMock(), session=mocker.MagicMock())
response = diagnostic.get_connectedpeers_info()
assert response == GetConnectedPeersInfoModel(**data)
# noinspection PyUnresolvedReferences
diagnostic.get.assert_called_once()
@pytest.mark.parametrize('network', [StraxMain(), CirrusMain()], ids=['StraxMain', 'CirrusMain'])
def test_get_status(mocker: MockerFixture, network):
data = {'peerStatistics': 'Enabled'}
mocker.patch.object(Diagnostic, 'get', return_value=data)
diagnostic = Diagnostic(network=network, baseuri=mocker.MagicMock(), session=mocker.MagicMock())
response = diagnostic.get_status()
assert response == GetStatusModel(**data)
# noinspection PyUnresolvedReferences
diagnostic.get.assert_called_once()
@pytest.mark.parametrize('network', [StraxMain(), CirrusMain()], ids=['StraxMain', 'CirrusMain'])
def test_get_peer_statistics(mocker: MockerFixture, network):
data = [
{
'peerEndPoint': '[::ffff:x.x.x.x]:17105',
'connected': True,
'inbound': True,
'bytesSent': 0,
'bytesReceived': 0,
'receivedMessages': 0,
'sentMessages': 0,
'latestEvents': []
},
{
'peerEndPoint': '[::ffff:x.x.x.x]:17105',
'connected': True,
'inbound': True,
'bytesSent': 0,
'bytesReceived': 0,
'receivedMessages': 0,
'sentMessages': 0,
'latestEvents': []
}
]
mocker.patch.object(Diagnostic, 'get', return_value=data)
diagnostic = Diagnostic(network=network, baseuri=mocker.MagicMock(), session=mocker.MagicMock())
response = diagnostic.get_peer_statistics(connected_only=True)
assert response == [PeerStatisticsModel(**x) for x in data]
# noinspection PyUnresolvedReferences
diagnostic.get.assert_called_once()
@pytest.mark.parametrize('network', [StraxMain(), CirrusMain()], ids=['StraxMain', 'CirrusMain'])
def test_start_collecting_peer_statistics(mocker: MockerFixture, network):
data = 'Diagnostic Peer Statistic Collector enabled.'
mocker.patch.object(Diagnostic, 'get', return_value=data)
diagnostic = Diagnostic(network=network, baseuri=mocker.MagicMock(), session=mocker.MagicMock())
response = diagnostic.start_collecting_peerstatistics()
assert response == data
# noinspection PyUnresolvedReferences
diagnostic.get.assert_called_once()
@pytest.mark.parametrize('network', [StraxMain(), CirrusMain()], ids=['StraxMain', 'CirrusMain'])
def test_stop_collecting_peer_statistics(mocker: MockerFixture, network):
data = 'Diagnostic Peer Statistic Collector disabled.'
mocker.patch.object(Diagnostic, 'get', return_value=data)
diagnostic = Diagnostic(network=network, baseuri=mocker.MagicMock(), session=mocker.MagicMock())
response = diagnostic.stop_collecting_peerstatistics()
assert response == data
# noinspection PyUnresolvedReferences
diagnostic.get.assert_called_once()
| 36.547945 | 100 | 0.658921 | 518 | 5,336 | 6.642857 | 0.173745 | 0.008718 | 0.008718 | 0.045336 | 0.785237 | 0.785237 | 0.77245 | 0.77245 | 0.735251 | 0.735251 | 0 | 0.008664 | 0.221327 | 5,336 | 145 | 101 | 36.8 | 0.819495 | 0.033546 | 0 | 0.576577 | 0 | 0 | 0.145215 | 0.027567 | 0 | 0 | 0 | 0 | 0.126126 | 1 | 0.081081 | false | 0 | 0.045045 | 0 | 0.126126 | 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 |
750812045397299a196396b9c08c1ff609847eee | 1,652 | py | Python | tests/python_frontend/call_sdfg_with_symbols_test.py | xiacijie/dace | 2d942440b1d7b139ba112434bfa78f754e10bfe5 | [
"BSD-3-Clause"
] | 1 | 2021-07-26T07:58:06.000Z | 2021-07-26T07:58:06.000Z | tests/python_frontend/call_sdfg_with_symbols_test.py | xiacijie/dace | 2d942440b1d7b139ba112434bfa78f754e10bfe5 | [
"BSD-3-Clause"
] | null | null | null | tests/python_frontend/call_sdfg_with_symbols_test.py | xiacijie/dace | 2d942440b1d7b139ba112434bfa78f754e10bfe5 | [
"BSD-3-Clause"
] | 1 | 2021-03-04T13:01:48.000Z | 2021-03-04T13:01:48.000Z | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import numpy as np
import dace
N = dace.symbol("N")
@dace.program
def add_one(A: dace.int64[N, N], result: dace.int64[N, N]):
result[:] = A + 1
def call_test():
@dace.program
def add_one_more(A: dace.int64[N, N]):
result = dace.define_local([N, N], dace.int64)
add_one(A, result)
return result + 1
A = np.random.randint(0, 10, size=(11, 11), dtype=np.int64)
result = add_one_more(A=A.copy())
assert np.allclose(result, A + 2)
def call_sdfg_test():
add_one_sdfg = add_one.to_sdfg()
@dace.program
def add_one_more(A: dace.int64[N, N]):
result = dace.define_local([N, N], dace.int64)
add_one_sdfg(A=A, result=result)
return result + 1
A = np.random.randint(0, 10, size=(11, 11), dtype=np.int64)
result = add_one_more(A=A.copy())
assert np.allclose(result, A + 2)
other_N = dace.symbol("N")
@dace.program
def add_one_other_n(A: dace.int64[other_N - 1, other_N - 1],
result: dace.int64[other_N - 1, other_N - 1]):
result[:] = A + 1
def call_sdfg_same_symbol_name_test():
add_one_sdfg = add_one_other_n.to_sdfg()
@dace.program
def add_one_more(A: dace.int64[N, N]):
result = dace.define_local([N, N], dace.int64)
add_one_sdfg(A=A, result=result)
return result + 1
A = np.random.randint(0, 10, size=(11, 11), dtype=np.int64)
result = add_one_more(A=A.copy())
assert np.allclose(result, A + 2)
if __name__ == "__main__":
call_test()
call_sdfg_test()
call_sdfg_same_symbol_name_test()
| 25.030303 | 75 | 0.630145 | 276 | 1,652 | 3.543478 | 0.181159 | 0.092025 | 0.06135 | 0.067485 | 0.847648 | 0.820041 | 0.730061 | 0.707566 | 0.707566 | 0.582822 | 0 | 0.052262 | 0.223971 | 1,652 | 65 | 76 | 25.415385 | 0.710608 | 0.044189 | 0 | 0.613636 | 0 | 0 | 0.006341 | 0 | 0 | 0 | 0 | 0 | 0.068182 | 1 | 0.181818 | false | 0 | 0.045455 | 0 | 0.295455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
7509f1f1f410a471eac734b035ed1488e97e6311 | 96 | py | Python | pyball/modules/base_module.py | SlapBot/pyball | 31982673b3608b6a407ca9809150f78e3a14676d | [
"MIT"
] | null | null | null | pyball/modules/base_module.py | SlapBot/pyball | 31982673b3608b6a407ca9809150f78e3a14676d | [
"MIT"
] | null | null | null | pyball/modules/base_module.py | SlapBot/pyball | 31982673b3608b6a407ca9809150f78e3a14676d | [
"MIT"
] | null | null | null | class BaseModule(object):
def __init__(self, requester):
self.requester = requester
| 24 | 34 | 0.697917 | 10 | 96 | 6.3 | 0.7 | 0.412698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208333 | 96 | 3 | 35 | 32 | 0.828947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 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 | 0 | 1 | 0 | 0 | 5 |
75243ffc9fb94aab3c39074481d7bbe95eeb208a | 336 | py | Python | kats/models/globalmodel/__init__.py | iamxiaodong/Kats | 31df55acc22797ce06330586542fe6e5f315e574 | [
"MIT"
] | 3,580 | 2021-06-21T03:55:17.000Z | 2022-03-31T20:21:38.000Z | kats/models/globalmodel/__init__.py | iamxiaodong/Kats | 31df55acc22797ce06330586542fe6e5f315e574 | [
"MIT"
] | 164 | 2021-06-22T03:00:32.000Z | 2022-03-31T22:08:16.000Z | kats/models/globalmodel/__init__.py | iamxiaodong/Kats | 31df55acc22797ce06330586542fe6e5f315e574 | [
"MIT"
] | 350 | 2021-06-21T19:53:47.000Z | 2022-03-30T08:07:03.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import backtester # noqa
# from . import data_processer # noqa
from . import ensemble # noqa
from . import model # noqa
from . import utils # noqa
| 30.545455 | 65 | 0.732143 | 50 | 336 | 4.9 | 0.64 | 0.204082 | 0.228571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208333 | 336 | 10 | 66 | 33.6 | 0.921053 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
755da3533a4747c8fdfd3724e4110c724449b6b2 | 115 | py | Python | dynamo/preprocessing/__init__.py | softbear/dynamo-release | 18b64d257c755ccb3aedd7877d9d39f8c40f46fa | [
"BSD-3-Clause"
] | 1 | 2019-10-02T19:38:55.000Z | 2019-10-02T19:38:55.000Z | dynamo/preprocessing/__init__.py | softbear/dynamo-release | 18b64d257c755ccb3aedd7877d9d39f8c40f46fa | [
"BSD-3-Clause"
] | null | null | null | dynamo/preprocessing/__init__.py | softbear/dynamo-release | 18b64d257c755ccb3aedd7877d9d39f8c40f46fa | [
"BSD-3-Clause"
] | null | null | null | """Mapping Vector Field of Single Cells
"""
from .preprocess import szFactor, normalize_expr_data, recipe_monocle
| 23 | 69 | 0.8 | 15 | 115 | 5.933333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121739 | 115 | 4 | 70 | 28.75 | 0.881188 | 0.313043 | 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 |
f336a6612e024435fd270d750d149073aa700720 | 160 | py | Python | hubcare/metrics/pull_request_metrics/acceptance_quality/admin.py | aleronupe/2019.1-hubcare-api | 3f031eac9559a10fdcf70a88ee4c548cf93e4ac2 | [
"MIT"
] | 7 | 2019-03-31T17:58:45.000Z | 2020-02-29T22:44:27.000Z | hubcare/metrics/pull_request_metrics/acceptance_quality/admin.py | aleronupe/2019.1-hubcare-api | 3f031eac9559a10fdcf70a88ee4c548cf93e4ac2 | [
"MIT"
] | 90 | 2019-03-26T01:14:54.000Z | 2021-06-10T21:30:25.000Z | hubcare/metrics/pull_request_metrics/acceptance_quality/admin.py | aleronupe/2019.1-hubcare-api | 3f031eac9559a10fdcf70a88ee4c548cf93e4ac2 | [
"MIT"
] | null | null | null | from django.contrib import admin
from acceptance_quality.models import PullRequestQuality
# Register your models here.
admin.site.register(PullRequestQuality)
| 26.666667 | 56 | 0.85625 | 19 | 160 | 7.157895 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09375 | 160 | 5 | 57 | 32 | 0.937931 | 0.1625 | 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 |
f349131ebf5346e814a1d54bdd1f3309d7c74d04 | 86 | py | Python | scripts/upload/__init__.py | AnneL1202/Trend_Analysis | cae00583ec0d2cf743a6786599aa06971b3b8cca | [
"MIT"
] | 2 | 2018-01-23T10:07:28.000Z | 2018-06-18T16:18:08.000Z | scripts/upload/__init__.py | AnneL1202/Trend_Analysis | cae00583ec0d2cf743a6786599aa06971b3b8cca | [
"MIT"
] | 2 | 2020-08-18T13:04:22.000Z | 2020-11-02T14:29:41.000Z | scripts/upload/__init__.py | UMCUGenetics/Trend_Analysis_tool | 9f57ef842026a401c140ada4dbde0862d2a64168 | [
"MIT"
] | 1 | 2018-01-30T15:01:53.000Z | 2018-01-30T15:01:53.000Z | """Upload functions."""
import run_processed
import raw_data
import sample_processed
| 14.333333 | 23 | 0.813953 | 11 | 86 | 6.090909 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104651 | 86 | 5 | 24 | 17.2 | 0.87013 | 0.197674 | 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 |
f36652cff8c8e8512d8e37c6498040c3f6848190 | 260 | py | Python | nr_oai_pmh_harvester/rules/nusl/field046__k.py | Narodni-repozitar/oai-pmh-harvester | 6703f925c404d72385e070445eb5f8af330384d3 | [
"MIT"
] | null | null | null | nr_oai_pmh_harvester/rules/nusl/field046__k.py | Narodni-repozitar/oai-pmh-harvester | 6703f925c404d72385e070445eb5f8af330384d3 | [
"MIT"
] | 2 | 2021-01-04T11:40:37.000Z | 2021-02-08T12:31:05.000Z | nr_oai_pmh_harvester/rules/nusl/field046__k.py | Narodni-repozitar/nr-oai-pmh-harvester | b8c6d76325485fc506a31a94b5533d80cdd04596 | [
"MIT"
] | null | null | null | from oarepo_oai_pmh_harvester.decorators import rule
@rule("nusl", "marcxml", "/046__/k", phase="pre")
def call_date_issued(el, **kwargs):
return date_issued(el, **kwargs) # pragma: no cover
def date_issued(el, **kwargs):
return {"dateIssued": el}
| 23.636364 | 55 | 0.7 | 37 | 260 | 4.675676 | 0.675676 | 0.17341 | 0.208092 | 0.312139 | 0.277457 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013393 | 0.138462 | 260 | 10 | 56 | 26 | 0.758929 | 0.061538 | 0 | 0 | 0 | 0 | 0.132231 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0.333333 | 0.833333 | 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 |
f383c9cdfbff8ef92d7b908c0543b7cd37081e5e | 40 | py | Python | Backend/src/authentication/__init__.py | ahmerique/DREAM | 22e3207c2708342e10e366afe635f44f8d4a378d | [
"MIT"
] | null | null | null | Backend/src/authentication/__init__.py | ahmerique/DREAM | 22e3207c2708342e10e366afe635f44f8d4a378d | [
"MIT"
] | null | null | null | Backend/src/authentication/__init__.py | ahmerique/DREAM | 22e3207c2708342e10e366afe635f44f8d4a378d | [
"MIT"
] | null | null | null | # Backend/src/authentication/__init__.py | 40 | 40 | 0.85 | 5 | 40 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025 | 40 | 1 | 40 | 40 | 0.769231 | 0.95 | 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 |
f394f2171ef28bdad1414769aaf2fc625214fd54 | 33 | py | Python | login.py | B-POTATO/test1- | c572d04d8e3932f3171ba3d2af3636fdb4c35739 | [
"MIT"
] | null | null | null | login.py | B-POTATO/test1- | c572d04d8e3932f3171ba3d2af3636fdb4c35739 | [
"MIT"
] | null | null | null | login.py | B-POTATO/test1- | c572d04d8e3932f3171ba3d2af3636fdb4c35739 | [
"MIT"
] | null | null | null | num=1
num=2
nump=33333
num4=88888 | 8.25 | 10 | 0.787879 | 8 | 33 | 3.25 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.433333 | 0.090909 | 33 | 4 | 11 | 8.25 | 0.433333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
f39857d27dbf65e6a2e36d251f75180cbf68567e | 43 | py | Python | Data/generating_scripts/__init__.py | CursedKeyboard/UofT-Class-selection | 7c69e07b10753566efc049d603e3f52694b07c36 | [
"MIT"
] | 1 | 2020-05-02T05:07:59.000Z | 2020-05-02T05:07:59.000Z | Data/generating_scripts/__init__.py | CursedKeyboard/UofT-Class-selection | 7c69e07b10753566efc049d603e3f52694b07c36 | [
"MIT"
] | null | null | null | Data/generating_scripts/__init__.py | CursedKeyboard/UofT-Class-selection | 7c69e07b10753566efc049d603e3f52694b07c36 | [
"MIT"
] | null | null | null | """Data generating scripts for program."""
| 21.5 | 42 | 0.72093 | 5 | 43 | 6.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116279 | 43 | 1 | 43 | 43 | 0.815789 | 0.837209 | 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 |
45ffa4128a1bb39245a85cbf89856dd6a7262c96 | 194 | py | Python | allauth_microsoft/urls.py | schaenzer/django-allauth-microsoft | ca0822923c222c38dbd5a70f443e3b0d69371d7a | [
"MIT"
] | 2 | 2017-12-09T16:38:16.000Z | 2020-07-23T20:11:21.000Z | allauth_microsoft/urls.py | schaenzer/django-allauth-microsoft | ca0822923c222c38dbd5a70f443e3b0d69371d7a | [
"MIT"
] | null | null | null | allauth_microsoft/urls.py | schaenzer/django-allauth-microsoft | ca0822923c222c38dbd5a70f443e3b0d69371d7a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import MicrosoftProvider
urlpatterns = default_urlpatterns(MicrosoftProvider)
| 32.333333 | 75 | 0.824742 | 20 | 194 | 7.9 | 0.7 | 0.227848 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011299 | 0.087629 | 194 | 5 | 76 | 38.8 | 0.881356 | 0.108247 | 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 |
caa176b0f9276842a509d50e6ce6421e9ae99b30 | 7,666 | py | Python | microsim/test/test_person_wave_status.py | jburke5/microsim | 4a484b9fe4fd0a4faf05150238fd79be4d8827f6 | [
"MIT"
] | null | null | null | microsim/test/test_person_wave_status.py | jburke5/microsim | 4a484b9fe4fd0a4faf05150238fd79be4d8827f6 | [
"MIT"
] | 2 | 2021-05-17T21:19:09.000Z | 2021-06-02T20:20:13.000Z | microsim/test/test_person_wave_status.py | jburke5/microsim | 4a484b9fe4fd0a4faf05150238fd79be4d8827f6 | [
"MIT"
] | 1 | 2020-05-18T02:12:58.000Z | 2020-05-18T02:12:58.000Z | from microsim.person import Person
from microsim.gender import NHANESGender
from microsim.race_ethnicity import NHANESRaceEthnicity
from microsim.outcome_model_repository import OutcomeModelRepository
from microsim.outcome import Outcome
from microsim.alcohol_category import AlcoholCategory
from microsim.outcome import OutcomeType
from microsim.education import Education
from microsim.test.test_risk_model_repository import TestRiskModelRepository
from microsim.gcp_model import GCPModel
from microsim.dementia_model import DementiaModel
from microsim.outcome_model_type import OutcomeModelType
from microsim.smoking_status import SmokingStatus
import unittest
def initializeAFib(person):
return None
class AgeOver50CausesFatalStroke(OutcomeModelRepository):
def __init__(self):
super(OutcomeModelRepository, self).__init__()
self._models = {}
self._models[OutcomeModelType.GLOBAL_COGNITIVE_PERFORMANCE] = GCPModel()
self._models[OutcomeModelType.DEMENTIA] = DementiaModel()
# override super to alays return a probability of each outcom eas 1
def assign_cv_outcome(self, person, years=1, manualStrokeMIProbability=None):
return Outcome(OutcomeType.STROKE, 1) if person._age[-1] > 50 else None
def assign_non_cv_mortality(self, person, years=1):
return False
def get_gcp(self, person):
return 50
class NonFatalStrokeAndNonCVMortality(OutcomeModelRepository):
def __init__(self):
super(OutcomeModelRepository, self).__init__()
self._models = {}
self._models[OutcomeModelType.GLOBAL_COGNITIVE_PERFORMANCE] = GCPModel()
self._models[OutcomeModelType.DEMENTIA] = DementiaModel()
# override super to alays return a probability of each outcom eas 1
def assign_cv_outcome(self, person, years=1, manualStrokeMIProbability=None):
return Outcome(OutcomeType.STROKE, 0)
def assign_non_cv_mortality(self, person, years=1):
return True
def get_gcp(self, person):
return 50
class AgeOver50CausesNonCVMortality(OutcomeModelRepository):
def __init__(self):
super(OutcomeModelRepository, self).__init__()
self._models = {}
self._models[OutcomeModelType.GLOBAL_COGNITIVE_PERFORMANCE] = GCPModel()
self._models[OutcomeModelType.DEMENTIA] = DementiaModel()
# override super to alays return a probability of each outcom eas 1
def assign_cv_outcome(self, person, years=1, manualStrokeMIProbability=None):
return None
def assign_non_cv_mortality(self, person, years=1):
return True if person._age[-1] > 50 else False
def get_gcp(self, person):
return 50
class TestPersonWaveStatus(unittest.TestCase):
def setUp(self):
self.oldJoe = Person(
age=60,
gender=NHANESGender.MALE,
raceEthnicity=NHANESRaceEthnicity.NON_HISPANIC_BLACK,
sbp=140,
dbp=90,
a1c=5.5,
hdl=50,
totChol=200,
bmi=25,
ldl=90,
trig=150,
waist=45,
anyPhysicalActivity=0,
education=Education.COLLEGEGRADUATE,
smokingStatus=SmokingStatus.NEVER,
alcohol=AlcoholCategory.NONE,
antiHypertensiveCount=0,
statin=0,
otherLipidLoweringMedicationCount=0,
creatinine = 0,
initializeAfib=initializeAFib,
)
self.youngJoe = Person(
age=40,
gender=NHANESGender.MALE,
raceEthnicity=NHANESRaceEthnicity.NON_HISPANIC_BLACK,
sbp=140,
dbp=90,
a1c=5.5,
hdl=50,
totChol=200,
bmi=25,
ldl=90,
trig=150,
waist=45,
anyPhysicalActivity=0,
education=Education.COLLEGEGRADUATE,
smokingStatus=SmokingStatus.NEVER,
alcohol=AlcoholCategory.NONE,
antiHypertensiveCount=0,
statin=0,
otherLipidLoweringMedicationCount=0,
creatinine = 0,
initializeAfib=initializeAFib,
)
def testStatusAfterFatalStroke(self):
self.youngJoe.advance_year(TestRiskModelRepository(), AgeOver50CausesFatalStroke())
self.assertEqual(41, self.youngJoe._age[-1])
self.assertEqual(False, self.youngJoe.is_dead())
self.assertEqual(False, self.youngJoe._stroke)
self.assertEqual(True, self.youngJoe.alive_at_start_of_wave(1))
self.assertEqual(True, self.youngJoe.alive_at_start_of_wave(2))
with self.assertRaises(Exception):
self.youngJoe.alive_at_start_of_wave(3)
self.youngJoe.advance_year(TestRiskModelRepository(), AgeOver50CausesFatalStroke())
self.assertEqual(True, self.youngJoe.alive_at_start_of_wave(3))
self.oldJoe.advance_year(TestRiskModelRepository(), AgeOver50CausesFatalStroke())
self.assertEqual(60, self.oldJoe._age[-1])
self.assertEqual(True, self.oldJoe.is_dead())
self.assertEqual(True, self.oldJoe._stroke)
self.assertEqual(True, self.oldJoe.alive_at_start_of_wave(1))
self.assertEqual(False, self.oldJoe.alive_at_start_of_wave(2))
# this is called to verify that it DOES NOT throw an excepiotn
self.oldJoe.alive_at_start_of_wave(3)
def testNonCVMortalityLeadsToCorrectStatus(self):
self.youngJoe.advance_year(TestRiskModelRepository(), AgeOver50CausesNonCVMortality())
self.assertEqual(41, self.youngJoe._age[-1])
self.assertEqual(False, self.youngJoe.is_dead())
self.assertEqual(False, self.youngJoe._stroke)
self.assertEqual(True, self.youngJoe.alive_at_start_of_wave(1))
self.assertEqual(True, self.youngJoe.alive_at_start_of_wave(2))
with self.assertRaises(Exception):
self.youngJoe.alive_at_start_of_wave(3)
self.youngJoe.advance_year(TestRiskModelRepository(), AgeOver50CausesNonCVMortality())
self.assertEqual(True, self.youngJoe.alive_at_start_of_wave(3))
self.oldJoe.advance_year(TestRiskModelRepository(), AgeOver50CausesNonCVMortality())
self.assertEqual(60, self.oldJoe._age[-1])
self.assertEqual(True, self.oldJoe.is_dead())
self.assertEqual(False, self.oldJoe._stroke)
self.assertEqual(True, self.oldJoe.alive_at_start_of_wave(1))
self.assertEqual(False, self.oldJoe.alive_at_start_of_wave(2))
# this is called to verify that it DOES NOT throw an excepiotn
self.oldJoe.alive_at_start_of_wave(3)
def testHasFatalStrokeInWaveIsCaptured(self):
self.oldJoe.advance_year(TestRiskModelRepository(), AgeOver50CausesFatalStroke())
self.assertEqual(True, self.oldJoe.has_stroke_during_simulation())
self.assertEqual(True, self.oldJoe.has_stroke_during_wave(1))
with self.assertRaises(Exception):
self.oldJoe.has_stroke_during_wave(0)
# calling to make sure it does NOT raise an exception...you should
# be able to ask whether somebody has a stroke in a wave after they are dead, the answer is
# "No"
self.assertEqual(False, self.oldJoe.has_stroke_during_wave(2))
def testNonFatalStrokeInWaveWithNonCVDeathIsCaptured(self):
self.oldJoe.advance_year(TestRiskModelRepository(), NonFatalStrokeAndNonCVMortality())
self.assertEqual(True, self.oldJoe.has_stroke_during_simulation())
self.assertEqual(True, self.oldJoe.has_stroke_during_wave(1))
self.assertEqual(True, self.oldJoe.is_dead())
if __name__ == "__main__":
unittest.main()
| 39.112245 | 99 | 0.699322 | 833 | 7,666 | 6.222089 | 0.188475 | 0.081034 | 0.058653 | 0.071001 | 0.781594 | 0.771368 | 0.735096 | 0.735096 | 0.664673 | 0.650396 | 0 | 0.021468 | 0.216149 | 7,666 | 195 | 100 | 39.312821 | 0.841072 | 0.062484 | 0 | 0.713333 | 0 | 0 | 0.001115 | 0 | 0 | 0 | 0 | 0 | 0.206667 | 1 | 0.12 | false | 0 | 0.093333 | 0.066667 | 0.306667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
cac1463a7ab6b0aa7673146c9d65f94b68da4b73 | 135 | py | Python | Week 3 - mEmE tExT/Sourav-Meme Text.py | Jasleenk47/BeginnerRoom-2020 | 32903f6917a236fe685106c148b8531c62210f1f | [
"Unlicense"
] | 5 | 2021-01-19T00:31:22.000Z | 2021-03-05T02:31:10.000Z | Week 3 - mEmE tExT/Sourav-Meme Text.py | Jasleenk47/BeginnerRoom-2020 | 32903f6917a236fe685106c148b8531c62210f1f | [
"Unlicense"
] | 34 | 2021-01-14T21:00:18.000Z | 2021-03-11T17:57:26.000Z | Week 3 - mEmE tExT/Sourav-Meme Text.py | Jasleenk47/BeginnerRoom-2020 | 32903f6917a236fe685106c148b8531c62210f1f | [
"Unlicense"
] | 43 | 2021-01-14T20:40:47.000Z | 2021-03-11T02:29:30.000Z | text = input("Enter 4 Letter Word: ")
print(text[0].upper())
print(text[1].lower())
print(text[2].upper())
print(text[3].lower()) | 22.5 | 38 | 0.62963 | 22 | 135 | 3.863636 | 0.590909 | 0.423529 | 0.329412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042017 | 0.118519 | 135 | 6 | 39 | 22.5 | 0.672269 | 0 | 0 | 0 | 0 | 0 | 0.160305 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.8 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
1b5460ff5c82c456b83810f035d5fd6e62273fe3 | 192 | py | Python | recipe/run_test.py | conda-forge-linter/omas-feedstock | 031d84a9aaeabefe6185ca1eca1723be08688a7d | [
"BSD-3-Clause"
] | null | null | null | recipe/run_test.py | conda-forge-linter/omas-feedstock | 031d84a9aaeabefe6185ca1eca1723be08688a7d | [
"BSD-3-Clause"
] | null | null | null | recipe/run_test.py | conda-forge-linter/omas-feedstock | 031d84a9aaeabefe6185ca1eca1723be08688a7d | [
"BSD-3-Clause"
] | null | null | null | import os
if 'USER' not in os.environ:
os.environ['USER'] = 'TEST_CONDA_USER'
if 'HOME' not in os.environ:
os.environ['HOME'] = '/tmp/'
import omas
import unittest
unittest.main(omas)
| 21.333333 | 42 | 0.6875 | 31 | 192 | 4.193548 | 0.451613 | 0.276923 | 0.107692 | 0.215385 | 0.353846 | 0.353846 | 0 | 0 | 0 | 0 | 0 | 0 | 0.161458 | 192 | 8 | 43 | 24 | 0.807453 | 0 | 0 | 0 | 0 | 0 | 0.1875 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.375 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
1b67020929cee7267b10146ad38b0a6ff3e88f60 | 121 | py | Python | train.py | mzntaka0/mlinit | a44f3d420ccde60c2fe662ed00b7354bdc9d3353 | [
"Apache-2.0"
] | null | null | null | train.py | mzntaka0/mlinit | a44f3d420ccde60c2fe662ed00b7354bdc9d3353 | [
"Apache-2.0"
] | null | null | null | train.py | mzntaka0/mlinit | a44f3d420ccde60c2fe662ed00b7354bdc9d3353 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
"""
import argparse
import os
import sys
import torch
if __name__ == '__main__':
pass
| 9.307692 | 26 | 0.61157 | 15 | 121 | 4.4 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010638 | 0.223141 | 121 | 12 | 27 | 10.083333 | 0.691489 | 0.173554 | 0 | 0 | 0 | 0 | 0.087912 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.166667 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 5 |
1b749415147a2d03d7a37d2e0f123459f454760f | 13 | py | Python | yyok-shares/yyok-share-utils/yyok-share-util-hadoop/src/main/python/Hero.py | ssydxa219/yyok | dbf327bb3cb6c3ff16bb2f91d2fdebd1931c14ce | [
"Apache-2.0"
] | 1 | 2018-11-26T16:53:50.000Z | 2018-11-26T16:53:50.000Z | yyok-shares/yyok-share-utils/yyok-share-util-hadoop/src/main/python/Hero.py | ssydxa219/yyok | dbf327bb3cb6c3ff16bb2f91d2fdebd1931c14ce | [
"Apache-2.0"
] | null | null | null | yyok-shares/yyok-share-utils/yyok-share-util-hadoop/src/main/python/Hero.py | ssydxa219/yyok | dbf327bb3cb6c3ff16bb2f91d2fdebd1931c14ce | [
"Apache-2.0"
] | 2 | 2021-03-01T05:25:41.000Z | 2021-05-16T09:06:49.000Z | print('Hero') | 13 | 13 | 0.692308 | 2 | 13 | 4.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 1 | 13 | 13 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 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 |
1b759f701ede32f545de22a885eadd51ba62a927 | 34 | py | Python | src/godel_utils/__init__.py | DenverCoder1/godel-number-to-code | 1f4fc3d5eba97ca45411302a67db79c77e44e19d | [
"MIT"
] | null | null | null | src/godel_utils/__init__.py | DenverCoder1/godel-number-to-code | 1f4fc3d5eba97ca45411302a67db79c77e44e19d | [
"MIT"
] | null | null | null | src/godel_utils/__init__.py | DenverCoder1/godel-number-to-code | 1f4fc3d5eba97ca45411302a67db79c77e44e19d | [
"MIT"
] | 1 | 2022-01-18T19:51:33.000Z | 2022-01-18T19:51:33.000Z | from .godel_utils import * # noqa
| 17 | 33 | 0.735294 | 5 | 34 | 4.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 34 | 1 | 34 | 34 | 0.857143 | 0.117647 | 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 |
1b990301136aad2567b4f10b58f956be8866e1fb | 70 | py | Python | regpfa/models/eventlog/__init__.py | damianangelo1712/pred_analytics_context_dbn | ebe7040a929d59354579b18500718f51c6d89851 | [
"BSD-2-Clause"
] | null | null | null | regpfa/models/eventlog/__init__.py | damianangelo1712/pred_analytics_context_dbn | ebe7040a929d59354579b18500718f51c6d89851 | [
"BSD-2-Clause"
] | null | null | null | regpfa/models/eventlog/__init__.py | damianangelo1712/pred_analytics_context_dbn | ebe7040a929d59354579b18500718f51c6d89851 | [
"BSD-2-Clause"
] | null | null | null | from .log import Log
from .trace import Trace
from .event import Event | 23.333333 | 24 | 0.8 | 12 | 70 | 4.666667 | 0.416667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157143 | 70 | 3 | 25 | 23.333333 | 0.949153 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
1bbd528ca1e5b6883390e0c15fa71665d22dfde8 | 105 | py | Python | src/config/views.py | fortytw0/default-django-deploy | ea90c55b9770bb6580264b91b72e62bfb827e300 | [
"MIT"
] | null | null | null | src/config/views.py | fortytw0/default-django-deploy | ea90c55b9770bb6580264b91b72e62bfb827e300 | [
"MIT"
] | null | null | null | src/config/views.py | fortytw0/default-django-deploy | ea90c55b9770bb6580264b91b72e62bfb827e300 | [
"MIT"
] | null | null | null | from django.shortcuts import render
def default_view(request) :
return render(request, 'index.html') | 26.25 | 40 | 0.771429 | 14 | 105 | 5.714286 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 105 | 4 | 40 | 26.25 | 0.879121 | 0 | 0 | 0 | 0 | 0 | 0.09434 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 5 |
1bd5d285b84c89f8985d1ad524617bb3f4e8d044 | 141 | py | Python | psopt/combination/__init__.py | artur-deluca/psopt | a880793c48533ad7e3af0ccea999c1554f37e19c | [
"MIT"
] | 13 | 2019-07-26T18:30:44.000Z | 2020-11-29T17:43:12.000Z | psopt/combination/__init__.py | artur-deluca/psopt | a880793c48533ad7e3af0ccea999c1554f37e19c | [
"MIT"
] | 12 | 2019-08-03T02:05:40.000Z | 2019-09-20T13:53:37.000Z | psopt/combination/__init__.py | artur-deluca/psopt | a880793c48533ad7e3af0ccea999c1554f37e19c | [
"MIT"
] | 1 | 2019-07-29T02:20:46.000Z | 2019-07-29T02:20:46.000Z | """
Module dedicated to seek an optimum combination of values according to a given objective function
"""
from .optimizer import Combination
| 28.2 | 97 | 0.801418 | 19 | 141 | 5.947368 | 0.894737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148936 | 141 | 4 | 98 | 35.25 | 0.941667 | 0.687943 | 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 |
941cbdd7235b0fcc2f66cb4b991797cf5c2e0f85 | 52 | py | Python | researchacademic/__init__.py | wyh/pymsresearch | c529636d6b6202c1a1d8c6a70bcdb44b862bca5a | [
"Apache-2.0"
] | null | null | null | researchacademic/__init__.py | wyh/pymsresearch | c529636d6b6202c1a1d8c6a70bcdb44b862bca5a | [
"Apache-2.0"
] | null | null | null | researchacademic/__init__.py | wyh/pymsresearch | c529636d6b6202c1a1d8c6a70bcdb44b862bca5a | [
"Apache-2.0"
] | null | null | null | from .fetcher import ResearchAcademic, EntityParser
| 26 | 51 | 0.865385 | 5 | 52 | 9 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096154 | 52 | 1 | 52 | 52 | 0.957447 | 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 |
941cd4ac0d8ccde021768ec12fedefa77aac5c00 | 45 | py | Python | gdsfactory/icyaml/__main__.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | gdsfactory/icyaml/__main__.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | gdsfactory/icyaml/__main__.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | from gdsfactory.icyaml.app import run
run()
| 11.25 | 37 | 0.777778 | 7 | 45 | 5 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 45 | 3 | 38 | 15 | 0.897436 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.