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
0ef5d8e319619c1a53ac859271323c396e9cc2e8
157
py
Python
oscar_vue_api/apps.py
hurta2yaisel/django-oscar-api-vue-storefront
832c14d1220a26601409332578dc1c6c8def9021
[ "BSD-3-Clause" ]
24
2018-09-28T11:46:35.000Z
2020-12-22T19:47:23.000Z
oscar_vue_api/apps.py
ladrua/django-oscar-api-vue-storefront
07714c5278e5a54ef3f8261597e60526050a5550
[ "BSD-3-Clause" ]
null
null
null
oscar_vue_api/apps.py
ladrua/django-oscar-api-vue-storefront
07714c5278e5a54ef3f8261597e60526050a5550
[ "BSD-3-Clause" ]
4
2018-10-09T11:54:09.000Z
2020-10-19T18:38:12.000Z
from django.apps import AppConfig class OscarVueApiConfig(AppConfig): name = 'oscar_vue_api' def ready(self): import oscar_vue_api.signals
19.625
36
0.732484
20
157
5.55
0.75
0.144144
0.198198
0
0
0
0
0
0
0
0
0
0.197452
157
7
37
22.428571
0.880952
0
0
0
0
0
0.082803
0
0
0
0
0
0
1
0.2
false
0
0.4
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
1606165218bc91c2a5f2e576c969d6af625564f1
6,379
py
Python
tests/views/userprofile/authentication_test.py
BMeu/Aerarium
119946cead727ef68b5ecea339990d982c006391
[ "MIT" ]
null
null
null
tests/views/userprofile/authentication_test.py
BMeu/Aerarium
119946cead727ef68b5ecea339990d982c006391
[ "MIT" ]
139
2018-12-26T07:54:31.000Z
2021-06-01T23:14:45.000Z
tests/views/userprofile/authentication_test.py
BMeu/Aerarium
119946cead727ef68b5ecea339990d982c006391
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from unittest.mock import MagicMock from unittest.mock import patch from tests.views import ViewTestCase class AuthenticationTest(ViewTestCase): # region Login def test_login_get_logged_out(self): """ Test accessing the login page with an anonymous user. Expected result: The user is displayed the login form. """ data = self.get('/user/login') self.assertIn('<h1>Log In</h1>', data) self.assertIn('<form', data) def test_login_get_logged_in(self): """ Test accessing the login page with an authorized user. Expected result: The user is redirected to the homepage. """ self.create_and_login_user() data = self.get('/user/login') self.assertNotIn('<h1>Log In</h1>', data) self.assertIn('<h1>Dashboard</h1>', data) def test_login_post_success(self): """ Test logging in with valid credentials. Expected result: The login succeeds, the user is redirected to the home page and greeted. """ email = 'test@example.com' password = '123456' name = 'John Doe' self.create_user(email, name, password) data = self.post('/user/login', data=dict( email=email, password=password )) self.assertNotIn('<h1>Log In</h1>', data) self.assertIn('<h1>Dashboard</h1>', data) self.assertIn(f'Welcome, {name}!', data) def test_login_post_success_with_next_page(self): """ Test logging in with valid credentials and a given next page. Expected result: The login succeeds, the user is redirected to the given next page and greeted. """ email = 'test@example.com' password = '123456' name = 'John Doe' self.create_user(email, name, password) data = self.post('/user/login?next=user', expected_status=404, data=dict( email=email, password=password )) self.assertNotIn('<h1>Log In</h1>', data) self.assertNotIn('<h1>Dashboard</h1>', data) self.assertIn(f'Welcome, {name}!', data) self.assertIn('User Profile', data) def test_login_post_failure(self): """ Test logging in with invalid credentials. Expected result: The login fails and the user stays on the login page. """ email = 'test@example.com' password = '123456' name = 'John Doe' self.create_user(email, name, password) data = self.post('/user/login', data=dict( email=email, password='invalid' + password )) self.assertIn('<h1>Log In</h1>', data) self.assertIn('Invalid email address or password.', data) self.assertNotIn('<h1>Dashboard</h1>', data) # endregion # region Refresh Login def test_login_refresh_get_fresh(self): """ Test accessing the login refresh page with a freshly authorized user. Expected result: The user is redirected to the home page. """ self.create_and_login_user() data = self.get('/user/login/refresh') self.assertNotIn('<h1>Confirm Login</h1>', data) self.assertIn('<h1>Dashboard</h1>', data) @patch('app.views.userprofile.authentication.login_fresh') def test_login_refresh_get_stale(self, mock_login_fresh: MagicMock): """ Test accessing the login refresh page with a stale login. Expected result: The refresh login page is shown. """ mock_login_fresh.return_value = False self.create_and_login_user() data = self.get('/user/login/refresh') self.assertIn('<h1>Confirm Login</h1>', data) self.assertNotIn('<h1>Dashboard</h1>', data) @patch('app.views.userprofile.authentication.login_fresh') def test_login_refresh_post_invalid_password(self, mock_login_fresh: MagicMock): """ Test refreshing the login with an invalid password. Expected result: The refresh login page is shown, the login is not refreshed. """ mock_login_fresh.return_value = False password = 'ABC123!' self.create_and_login_user(password=password) data = self.post('/user/login/refresh', data=dict( password='invalid' + password )) self.assertIn('<h1>Confirm Login</h1>', data) self.assertIn('Invalid password', data) self.assertNotIn('<h1>Dashboard</h1>', data) @patch('app.views.userprofile.authentication.login_fresh') def test_login_refresh_post_valid_password(self, mock_login_fresh: MagicMock): """ Test refreshing the login with a valid password. Expected result: The refresh home page is shown, the login is refreshed. """ mock_login_fresh.return_value = False password = 'ABC123!' user = self.create_and_login_user(password=password) data = self.post('/user/login/refresh', data=dict( password=password )) self.assertNotIn('<h1>Confirm Login</h1>', data) self.assertNotIn('Invalid password', data) self.assertIn(f'Welcome, {user.name}!', data) self.assertIn('<h1>Dashboard</h1>', data) # endregion # region Logout def test_logout_logged_in(self): """ Test logging out with a logged in user. Expected result: The user is logged out, redirected to the home page (and from there to the login page), and shown a success message. """ self.create_and_login_user() data = self.get('/user/logout') self.assertIn('You were successfully logged out.', data) self.assertIn('<h1>Log In</h1>', data) def test_logout_logged_out(self): """ Test logging out with an anonymous user. Expected result: The user is redirected to the home page (and from there to the login page), but not shown a success message. """ data = self.get('/user/logout') self.assertNotIn('You were successfully logged out.', data) self.assertIn('<h1>Log In</h1>', data) # endregion
29.808411
116
0.604797
767
6,379
4.920469
0.134289
0.061473
0.055114
0.038156
0.846317
0.77451
0.701378
0.667992
0.555909
0.482247
0
0.014483
0.285625
6,379
213
117
29.948357
0.813693
0.250196
0
0.723404
0
0
0.223456
0.038168
0
0
0
0
0.308511
1
0.117021
false
0.212766
0.031915
0
0.159574
0
0
0
0
null
0
0
0
1
1
1
0
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
1
0
0
0
0
0
5
1624d0be0f63ff90a76f09e697bc12fb6daf22a4
94
py
Python
bulletins/admin.py
itmonitoringcommunity/backend
3107cceecc29bbc94ba692bd67922f679a61d2fd
[ "MIT" ]
null
null
null
bulletins/admin.py
itmonitoringcommunity/backend
3107cceecc29bbc94ba692bd67922f679a61d2fd
[ "MIT" ]
2
2021-03-19T09:46:09.000Z
2021-06-04T23:34:54.000Z
bulletins/admin.py
smiley-py/backend
3107cceecc29bbc94ba692bd67922f679a61d2fd
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Bulletin admin.site.register(Bulletin)
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
162670019b41058fa618e7b6e0ac35fd2b26c00e
167
py
Python
functions/sell.py
renataeva/python-basics
0d8a2c6eda3aa31cca61fb2c727956f82642ebc8
[ "Apache-2.0" ]
1
2021-02-14T10:43:43.000Z
2021-02-14T10:43:43.000Z
functions/sell.py
renataeva/python-basics
0d8a2c6eda3aa31cca61fb2c727956f82642ebc8
[ "Apache-2.0" ]
null
null
null
functions/sell.py
renataeva/python-basics
0d8a2c6eda3aa31cca61fb2c727956f82642ebc8
[ "Apache-2.0" ]
null
null
null
def sell(goods, price): return goods*price goods = int(input('Goods...')) price = int(input('Price...')) r = sell(goods, price) print(f'Прибыль составит {r} $')
18.555556
32
0.634731
24
167
4.416667
0.5
0.377358
0.264151
0
0
0
0
0
0
0
0
0
0.149701
167
9
32
18.555556
0.746479
0
0
0
0
0
0.227545
0
0
0
0
0
0
1
0.166667
false
0
0
0.166667
0.333333
0.166667
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
1
0
0
0
5
162d7c40d8b72020c8084f3f0aaf1155a8703773
1,493
py
Python
tests/rest/test_get_rooms_list.py
lellisls/rentomatic
777af27f202ee9c773f8a485a06ba960b6a1654e
[ "MIT" ]
null
null
null
tests/rest/test_get_rooms_list.py
lellisls/rentomatic
777af27f202ee9c773f8a485a06ba960b6a1654e
[ "MIT" ]
null
null
null
tests/rest/test_get_rooms_list.py
lellisls/rentomatic
777af27f202ee9c773f8a485a06ba960b6a1654e
[ "MIT" ]
null
null
null
import json from unittest import mock from rentomatic.domain.room import Room from rentomatic.response_objects import response_objects as res room_dict = { 'code': '3251a5bd-86be-428d-8ae9-6e51a8048c33', 'size': 200, 'price': 10, 'longitude': -0.09998975, 'latitude': 51.75436293 } room = Room.from_dict(room_dict) rooms = [room] @mock.patch('rentomatic.use_cases.room_list_use_case.RoomListUseCase') def test_get(mock_use_case, client): mock_use_case().execute.return_value = res.ResponseSuccess(rooms) http_response = client.get('/rooms') assert json.loads(http_response.data.decode('UTF-8')) == [room_dict] mock_use_case().execute.assert_called() args, kwargs = mock_use_case().execute.call_args assert args[0].filters == {} assert http_response.status_code == 200 assert http_response.mimetype == 'application/json' @mock.patch('rentomatic.use_cases.room_list_use_case.RoomListUseCase') def test_get_with_filters(mock_use_case, client): mock_use_case().execute.return_value = res.ResponseSuccess(rooms) http_response = client.get('/rooms?filter_price__gt=2&filter_price__lt=6') assert json.loads(http_response.data.decode('UTF-8')) == [room_dict] mock_use_case().execute.assert_called() args, kwargs = mock_use_case().execute.call_args assert args[0].filters == {'price__gt': '2', 'price__lt': '6'} assert http_response.status_code == 200 assert http_response.mimetype == 'application/json'
31.104167
78
0.735432
207
1,493
5.009662
0.31401
0.067502
0.08486
0.104147
0.707811
0.707811
0.707811
0.707811
0.707811
0.707811
0
0.045595
0.133289
1,493
47
79
31.765957
0.755796
0
0
0.424242
0
0
0.1929
0.127261
0
0
0
0
0.30303
1
0.060606
false
0
0.121212
0
0.181818
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
16851d88e9bb86e9e9da191d62751ca2e72c8486
2,098
py
Python
smdebug_rulesconfig/builtin_rules.py
mchoi8739/sagemaker-debugger-rulesconfig
27c3d1be228fe8f6cc171e70fba245ebb5bef678
[ "Apache-2.0" ]
null
null
null
smdebug_rulesconfig/builtin_rules.py
mchoi8739/sagemaker-debugger-rulesconfig
27c3d1be228fe8f6cc171e70fba245ebb5bef678
[ "Apache-2.0" ]
null
null
null
smdebug_rulesconfig/builtin_rules.py
mchoi8739/sagemaker-debugger-rulesconfig
27c3d1be228fe8f6cc171e70fba245ebb5bef678
[ "Apache-2.0" ]
null
null
null
from ._utils import _get_rule_config def vanishing_gradient() : rule_config = _get_rule_config("VanishingGradient") return rule_config def similar_across_runs() : rule_config = _get_rule_config("SimilarAcrossRuns") return rule_config def weight_update_ratio() : rule_config = _get_rule_config("WeightUpdateRatio") return rule_config def all_zero() : rule_config = _get_rule_config("AllZero") return rule_config def exploding_tensor() : rule_config = _get_rule_config("ExplodingTensor") return rule_config def unchanged_tensor() : rule_config = _get_rule_config("UnchangedTensor") return rule_config def loss_not_decreasing() : rule_config = _get_rule_config("LossNotDecreasing") return rule_config def check_input_images() : rule_config = _get_rule_config("CheckInputImages") return rule_config def dead_relu() : rule_config = _get_rule_config("DeadRelu") return rule_config def confusion() : rule_config = _get_rule_config("Confusion") return rule_config def tree_depth() : rule_config = _get_rule_config("TreeDepth") return rule_config def class_imbalance() : rule_config = _get_rule_config("ClassImbalance") return rule_config def overfit() : rule_config = _get_rule_config("Overfit") return rule_config def tensor_variance(): rule_config = _get_rule_config("TensorVariance") return rule_config def overtraining(): rule_config = _get_rule_config("Overtraining") return rule_config def poor_weight_initialization(): rule_config = _get_rule_config("PoorWeightInitialization") return rule_config def saturated_activation(): rule_config = _get_rule_config("SaturatedActivation") return rule_config def nlp_sequence_ratio(): rule_config = _get_rule_config("NLPSequenceRatio") return rule_config def stalled_training_rule(): rule_config = _get_rule_config("StalledTrainingRule") return rule_config def feature_importance_overweight(): rule_config = _get_rule_config("FeatureImportanceOverweight") return rule_config
24.114943
65
0.760248
251
2,098
5.840637
0.258964
0.416098
0.186221
0.231924
0.328786
0.077763
0
0
0
0
0
0
0.163012
2,098
86
66
24.395349
0.834852
0
0
0.327869
0
0
0.142517
0.024309
0
0
0
0
0
1
0.327869
false
0
0.04918
0
0.704918
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
16a24fdb1b969762f233f9f13d0ce751bdbac518
273
py
Python
council/__init__.py
bentheiii/coiuncil
badf96ca580e4935a5686d974c99d8bfd708ebcf
[ "MIT" ]
null
null
null
council/__init__.py
bentheiii/coiuncil
badf96ca580e4935a5686d974c99d8bfd708ebcf
[ "MIT" ]
null
null
null
council/__init__.py
bentheiii/coiuncil
badf96ca580e4935a5686d974c99d8bfd708ebcf
[ "MIT" ]
null
null
null
from council_data import * from council.abstract_council import Council, AbstractCouncil from council.list_council import ListCouncil from council.council_member import council_member, CouncilMember from council.return_value import * from council.member_wrapper import *
30.333333
64
0.860806
35
273
6.514286
0.371429
0.289474
0.149123
0
0
0
0
0
0
0
0
0
0.102564
273
8
65
34.125
0.930612
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
16a693d61fc57cfca719e63bd47ac6c316524e21
50
py
Python
tnt/layers/__init__.py
BigFishMaster/tnt
8b80bb3b194eb87ac18924428ef0924c2fb263c5
[ "BSD-3-Clause" ]
3
2020-12-18T08:50:47.000Z
2020-12-18T08:50:55.000Z
tnt/layers/__init__.py
BigFishMaster/tnt
8b80bb3b194eb87ac18924428ef0924c2fb263c5
[ "BSD-3-Clause" ]
5
2021-03-19T11:49:52.000Z
2022-03-12T00:21:18.000Z
tnt/layers/__init__.py
BigFishMaster/tnt
8b80bb3b194eb87ac18924428ef0924c2fb263c5
[ "BSD-3-Clause" ]
1
2021-04-20T04:36:40.000Z
2021-04-20T04:36:40.000Z
from .multipooling_model import MultiPoolingModel
25
49
0.9
5
50
8.8
1
0
0
0
0
0
0
0
0
0
0
0
0.08
50
1
50
50
0.956522
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
16a901eef919ee9ad1576762c6db04f9a34bd6f5
2,308
py
Python
tests/test_beziercurve.py
lonevox/pyclick
f0140038c20d184608bed4bac321128287b9eff8
[ "MIT" ]
null
null
null
tests/test_beziercurve.py
lonevox/pyclick
f0140038c20d184608bed4bac321128287b9eff8
[ "MIT" ]
null
null
null
tests/test_beziercurve.py
lonevox/pyclick
f0140038c20d184608bed4bac321128287b9eff8
[ "MIT" ]
1
2021-04-11T09:07:46.000Z
2021-04-11T09:07:46.000Z
import unittest from pyclick._beziercurve import BezierCurve class TestBezierCurve(unittest.TestCase): def test_binomial(self): self.assertEqual(BezierCurve.binomial(10,2), 45) self.assertEqual(BezierCurve.binomial(4,2), 6) self.assertEqual(BezierCurve.binomial(1,1), 1) self.assertEqual(BezierCurve.binomial(2,0), 1) def test_bernstein_polynomial_point(self): self.assertEqual(BezierCurve.bernstein_polynomial_point(5,0,0), 1) self.assertEqual(BezierCurve.bernstein_polynomial_point(3, 0, 1), -2) self.assertEqual(BezierCurve.bernstein_polynomial_point(3, 1, 1), 3) self.assertEqual(BezierCurve.bernstein_polynomial_point(3, 0, 2), 4) self.assertEqual(BezierCurve.bernstein_polynomial_point(3, 1, 2), -12) self.assertEqual(BezierCurve.bernstein_polynomial_point(3, 2, 2), 9) def test_simple_bernstein_polynomial(self): bernstein_polynomial = BezierCurve.bernstein_polynomial([(0,0), (50,50), (100,100)]) self.assertEqual(bernstein_polynomial(0), (0,0)) self.assertEqual(bernstein_polynomial(0.25), (25, 25)) self.assertEqual(bernstein_polynomial(0.5), (50, 50)) self.assertEqual(bernstein_polynomial(0.75), (75, 75)) self.assertEqual(bernstein_polynomial(1), (100,100)) def test_complex_bernstein_polynomial(self): bernstein_polynomial = BezierCurve.bernstein_polynomial([(0,0), (40,40), (100,100)]) self.assertEqual(bernstein_polynomial(0), (0,0)) self.assertEqual(bernstein_polynomial(0.25), (21.25,21.25)) self.assertEqual(bernstein_polynomial(0.5), (45,45)) self.assertEqual(bernstein_polynomial(0.75), (71.25, 71.25)) self.assertEqual(bernstein_polynomial(1), (100,100)) def test_simple_curve_points(self): points = [(0,0), (50,50), (100,100)] n = 5 expected_curve_points = [(0,0),(25,25),(50,50),(75,75),(100,100)] self.assertEqual(BezierCurve.curve_points(n, points), expected_curve_points) def test_complex_curve_points(self): points = [(0,0), (40,40), (100,100)] n = 5 expected_curve_points = [(0,0),(21.25,21.25),(45,45),(71.25,71.25),(100,100)] self.assertEqual(BezierCurve.curve_points(n, points), expected_curve_points)
46.16
92
0.685875
303
2,308
5.049505
0.132013
0.285621
0.203922
0.222222
0.733987
0.73268
0.611111
0.528105
0.392157
0.291503
0
0.10666
0.167244
2,308
49
93
47.102041
0.689386
0
0
0.205128
0
0
0
0
0
0
0
0
0.564103
1
0.153846
false
0
0.051282
0
0.230769
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
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
bc4225b4551e4b8dd72d7005ae5d9f05be472e6d
155
py
Python
Test.py
Gustavolsl/Test-Travis-ci
e7fa13724fc269db26fa20940b8146e1677a14e2
[ "Apache-2.0" ]
null
null
null
Test.py
Gustavolsl/Test-Travis-ci
e7fa13724fc269db26fa20940b8146e1677a14e2
[ "Apache-2.0" ]
null
null
null
Test.py
Gustavolsl/Test-Travis-ci
e7fa13724fc269db26fa20940b8146e1677a14e2
[ "Apache-2.0" ]
null
null
null
import pytest from principal import dividir,multiplicar #import principal def test_dividir(): assert dividir(10,2)==5.0 assert multiplicar(2,4)==8
22.142857
41
0.754839
23
155
5.043478
0.652174
0
0
0
0
0
0
0
0
0
0
0.06015
0.141935
155
7
42
22.142857
0.81203
0.103226
0
0
0
0
0
0
0
0
0
0
0.4
1
0.2
true
0
0.4
0
0.6
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
bc5e484253bb1286de6c2971fc47a59791a1fa92
63
py
Python
korea.py
sunshane6726/sunshane6726.github.io
ed482b0bce9a5524e93aed15980e0dbe57064bc9
[ "MIT" ]
null
null
null
korea.py
sunshane6726/sunshane6726.github.io
ed482b0bce9a5524e93aed15980e0dbe57064bc9
[ "MIT" ]
1
2021-02-17T10:59:25.000Z
2021-02-17T10:59:25.000Z
korea.py
sunshane6726/sunshane6726.github.io
ed482b0bce9a5524e93aed15980e0dbe57064bc9
[ "MIT" ]
null
null
null
def so: sum = 0; a = 3; b= 2: result a+b:
10.5
16
0.333333
11
63
1.909091
0.818182
0
0
0
0
0
0
0
0
0
0
0.1
0.52381
63
5
17
12.6
0.6
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
1
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
bc62eb54a7a2d1421723652e8f749fbe4fd589a2
199
py
Python
testlauncher/grouping/__init__.py
slickqa/snot-example
1476c01b6c3c2283715fc20b23f550fb8b5b369a
[ "Apache-2.0" ]
1
2015-01-22T02:57:45.000Z
2015-01-22T02:57:45.000Z
testlauncher/grouping/__init__.py
slickqa/snot-example
1476c01b6c3c2283715fc20b23f550fb8b5b369a
[ "Apache-2.0" ]
null
null
null
testlauncher/grouping/__init__.py
slickqa/snot-example
1476c01b6c3c2283715fc20b23f550fb8b5b369a
[ "Apache-2.0" ]
null
null
null
from testlauncher import log_run def setup_package(): log_run("Inside testlauncher.grouping.setup_package") def teardown_package(): log_run("Inside testlauncher.grouping.teardown_package")
24.875
60
0.798995
25
199
6.08
0.44
0.118421
0.171053
0.25
0.513158
0.513158
0
0
0
0
0
0
0.110553
199
7
61
28.428571
0.858757
0
0
0
0
0
0.437186
0.366834
0
0
0
0
0
1
0.4
true
0
0.2
0
0.6
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
1
1
0
0
0
0
0
0
5
bc67fa02be9a9965286fccad82e7d8cae7d2704b
3,242
py
Python
tests/test_http.py
etienne-napoleone/restpass
4a1a7583da61b8eb3f6a2075b1fc58e05037a7db
[ "MIT" ]
null
null
null
tests/test_http.py
etienne-napoleone/restpass
4a1a7583da61b8eb3f6a2075b1fc58e05037a7db
[ "MIT" ]
null
null
null
tests/test_http.py
etienne-napoleone/restpass
4a1a7583da61b8eb3f6a2075b1fc58e05037a7db
[ "MIT" ]
null
null
null
import json from apistar import test from app import app from restpass import redisclient client = test.TestClient(app) test_id = {'login': 'supermail@test.com', 'password': '12345'} password_slug = '?p=password123' def test_get_ids_list(): redisclient.set_id('test_id', json.dumps(test_id)) response = client.get('/ids/'+password_slug) assert response.status_code == 200 assert 'test_id' in response.json()['identities'] redisclient.delete_id('test_id') def test_get_existing_id(): redisclient.set_id('test_id', json.dumps(test_id)) response = client.get('/ids/test_id' + password_slug) assert response.status_code == 200 assert response.json() == json.loads(json.dumps(test_id)) redisclient.delete_id('test_id') def test_get_absent_id(): redisclient.delete_id('test_id') response = client.get('/ids/test_id' + password_slug) assert response.status_code == 404 def test_create_existing_id(): redisclient.set_id('test_id', json.dumps(test_id)) response = client.post('/ids/test_id' + password_slug + '&login={}'.format(test_id['login']) + '&password={}'.format(test_id['password'])) assert response.status_code == 500 redisclient.delete_id('test_id') def test_create_absent_id(): response = client.post('/ids/test_id' + password_slug + '&login={}'.format(test_id['login']) + '&password={}'.format(test_id['password'])) assert response.status_code == 200 assert(redisclient.get_id('test_id')) assert response.json() == {'created': 'test_id'} redisclient.delete_id('test_id') def test_update_existing_id(): redisclient.set_id('test_id', json.dumps(test_id)) response = client.put('/ids/test_id' + password_slug + '&login={}'.format('updated')) assert response.status_code == 200 assert response.json() == {'login': 'updated', 'password': '12345'} response = client.put('/ids/test_id' + password_slug + '&password={}'.format('updated')) assert response.status_code == 200 assert response.json() == {'login': 'updated', 'password': 'updated'} response = client.put('/ids/test_id' + password_slug + '&login={}'.format('again') + '&password={}'.format('again')) assert response.status_code == 200 assert response.json() == {'login': 'again', 'password': 'again'} response = client.put('/ids/test_id' + password_slug) assert response.status_code == 400 redisclient.delete_id('test_id') def test_update_absent_id(): response = client.put('/ids/test_id' + password_slug + '&password={}'.format('updated')) assert response.status_code == 404 redisclient.delete_id('test_id') def test_delete_existing_id(): redisclient.set_id('test_id', json.dumps(test_id)) response = client.delete('/ids/test_id' + password_slug) assert response.status_code == 200 assert response.json() == {'deleted': 'test_id'} def test_delete_absent_id(): response = client.delete('/ids/test_id' + password_slug) assert response.status_code == 404
36.426966
73
0.643738
399
3,242
4.972431
0.120301
0.114919
0.052419
0.145161
0.805948
0.791835
0.776714
0.744456
0.671875
0.584677
0
0.018963
0.202961
3,242
88
74
36.840909
0.748839
0
0
0.550725
0
0
0.169957
0
0
0
0
0
0.289855
1
0.130435
false
0.333333
0.057971
0
0.188406
0
0
0
0
null
0
0
0
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
1
0
0
0
0
0
5
bc739e49e01a43475b5f13583827c22108cd3538
54,067
py
Python
cms/tests/test_nested_plugins.py
rspeed/django-cms-contrib
c5fbbea191646ab922b5ff6f89a1de6baa648e7f
[ "BSD-3-Clause" ]
null
null
null
cms/tests/test_nested_plugins.py
rspeed/django-cms-contrib
c5fbbea191646ab922b5ff6f89a1de6baa648e7f
[ "BSD-3-Clause" ]
null
null
null
cms/tests/test_nested_plugins.py
rspeed/django-cms-contrib
c5fbbea191646ab922b5ff6f89a1de6baa648e7f
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from djangocms_text_ckeditor.models import Text from cms.api import create_page, add_plugin from cms.models import Page from cms.models.placeholdermodel import Placeholder from cms.models.pluginmodel import CMSPlugin from cms.tests.test_plugins import PluginsTestBaseCase from cms.utils.compat.tests import UnittestCompatMixin from cms.utils.copy_plugins import copy_plugins_to from cms.utils.plugins import reorder_plugins class NestedPluginsTestCase(PluginsTestBaseCase, UnittestCompatMixin): def reorder_positions(self, plugin=None, parent=None): if parent: parent_id = parent.pk plugin = parent else: parent_id = plugin.parent_id x = 0 for p in CMSPlugin.objects.filter(parent_id=parent_id, language=plugin.language, placeholder_id=plugin.placeholder_id): p.position = x p.save() x += 1 def copy_placeholders_and_check_results(self, placeholders): """ This function is not itself a test; rather, it can be used by any test that has created placeholders. It will check that whatever the plugin structure in the placeholder, it will be copied accurately when they are copied. placeholders is a list of placeholders """ for original_placeholder in placeholders: # get the plugins original_plugins = original_placeholder.get_plugins() # copy them to a new placeholder copied_placeholder = Placeholder.objects.create(slot=original_placeholder.slot) copy_plugins_to( original_placeholder.get_plugins(), copied_placeholder ) copied_plugins = copied_placeholder.get_plugins() # we should find the same number of plugins in both placeholders self.assertEqual( original_plugins.count(), copied_plugins.count() ) # quick check: make sure the two querysets match: for original, copy in zip(original_plugins, copied_plugins): self.assertEqual( Text.objects.get(id=original.id).body, Text.objects.get(id=copy.id).body ) # Now build a *tree* of the plugins, and match those - it's not # enough just to compare querysets as above; we should *also* check # that when we build a tree, the various nodes are assembled as we # would expect. We will pump the trees into a pair of lists: original_plugins_list = [] copied_plugins_list = [] # This function builds the tree of plugins, starting from its roots. # In that respect it's like many of the plugin tree-building # routines elsewhere in the system. def plugin_list_from_tree(roots, plugin_list): for plugin in roots: plugin_list.append(plugin) # recurse over the set of nodes plugin_list_from_tree(plugin.get_children(), plugin_list) # build the tree for each set of plugins plugin_list_from_tree(original_plugins.filter(depth=1), original_plugins_list) plugin_list_from_tree(copied_plugins.filter(depth=1), copied_plugins_list) self.assertEqual(len(original_plugins_list), original_plugins.count()) self.assertEqual(len(copied_plugins_list), copied_plugins.count()) # Check that each pair of items in the two lists match, in lots of # different ways for original, copy in zip(original_plugins_list, copied_plugins_list): original_text_plugin = Text.objects.get(id=original.id) copied_text_plugin = Text.objects.get(id=copy.id) # This first one is a sanity test, just to prove that we aren't # simply comparing *exactly the same items* in all these tests. # It could happen... self.assertNotEquals(original.id, copy.id) self.assertEqual( original_text_plugin.body, copied_text_plugin.body ) self.assertEqual( original_text_plugin.depth, copied_text_plugin.depth ) self.assertEqual( original_text_plugin.position, copied_text_plugin.position ) self.assertEqual( original_text_plugin.numchild, copied_text_plugin.numchild ) self.assertEqual( original_text_plugin.get_descendant_count(), copied_text_plugin.get_descendant_count() ) self.assertEqual( original_text_plugin.get_ancestors().count(), copied_text_plugin.get_ancestors().count() ) # just in case the test method that called us wants it: return copied_placeholder def test_plugin_fix_tree(self): """ Tests CMSPlugin.fix_tree by creating a plugin structure, setting the position value to Null for all the plugins and then rebuild the tree. The structure below isn't arbitrary, but has been designed to test various conditions, including: * nodes four levels deep * siblings with and without children 1 2 4 10 8 3 9 5 6 7 """ placeholder = Placeholder(slot=u"some_slot") placeholder.save() # a good idea, if not strictly necessary # plugin in placeholder plugin_1 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"01") # IMPORTANT: plugins must be reloaded, before they can be assigned # as a parent. Otherwise, the Tree structure doesn't seem to rebuild # properly. # child of plugin_1 plugin_1 = self.reload(plugin_1) plugin_2 = add_plugin(placeholder, u"TextPlugin", u"en", # nopyflakes body=u"02", target=plugin_1, ) # create a second child of plugin_1 plugin_1 = self.reload(plugin_1) plugin_3 = add_plugin(placeholder, u"TextPlugin", u"en", # nopyflakes body=u"03", target=plugin_1 ) # child of plugin_2 plugin_2 = self.reload(plugin_2) plugin_4 = add_plugin(placeholder, u"TextPlugin", u"en", # nopyflakes body=u"04", target=plugin_2 ) plugin_1 = self.reload(plugin_1) # nopyflakes # create a second root plugin plugin_5 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"05") left = CMSPlugin.objects.filter(parent__isnull=True).order_by('path')[0] plugin_5 = self.reload(plugin_5) plugin_5 = plugin_5.move(left, pos='right') self.reorder_positions(plugin_5) self.reorder_positions(plugin_2) # child of plugin_5 plugin_5 = self.reload(plugin_5) plugin_6 = add_plugin(placeholder, u"TextPlugin", u"en", # nopyflakes body=u"06", target=plugin_5 ) # child of plugin_6 plugin_5 = self.reload(plugin_5) plugin_7 = add_plugin(placeholder, u"TextPlugin", u"en", # nopyflakes body=u"07", target=plugin_5 ) # another child of plugin_2 plugin_2 = self.reload(plugin_2) plugin_8 = add_plugin(placeholder, u"TextPlugin", u"en", # nopyflakes body=u"08", target=plugin_2 ) # child of plugin_3 plugin_3 = self.reload(plugin_3) plugin_9 = add_plugin(placeholder, u"TextPlugin", u"en", # nopyflakes body=u"09", target=plugin_3 ) # child of plugin_4 plugin_4 = self.reload(plugin_4) plugin_10 = add_plugin(placeholder, u"TextPlugin", u"en", # nopyflakes body=u"10", target=plugin_4 ) # We do two comparisons here. # One is to compare plugin position values # per plugin instance. # To do this we get a dictionary mapping plugin # ids to their respective position. # The second comparison is to make sure that # plugins retain their position/path ordering. # The reason for the these comparisons # is because of an obscure behavior with postgres # where somehow items with the same value that are # sorted by that value will be returned in different # order based on the orm query construction. # By comparing ids with positions, we make sure that # each plugin has the correct position after the fix-tree. # See ticket #5291 plugins = ( CMSPlugin .objects .filter(placeholder=placeholder) ) # Maps plugin ids to positions original_plugin_positions = dict( plugins .order_by('position') .values_list('pk', 'position') ) # List of plugin ids sorted by position and path original_plugin_ids = list( plugins .order_by('position', 'path') .values_list('pk', flat=True) ) # We use 1 to effectively "break" the tree # and as a way to test that fixing trees with # equal position values retains the correct ordering. CMSPlugin.objects.update(position=1) CMSPlugin.fix_tree() new_plugin_positions = dict( plugins .order_by('position') .values_list('pk', 'position') ) new_plugin_ids = list( plugins .order_by('position', 'path') .values_list('pk', flat=True) ) self.assertDictEqual(original_plugin_positions, new_plugin_positions) self.assertSequenceEqual(original_plugin_ids, new_plugin_ids) # Now, check to see if the correct order is restored, even if we # re-arrange the plugins so that their natural «pk» order is different # than their «position» order. # Move the 2nd top-level plugin to the "left" or before the 1st. reorder_plugins(placeholder, None, u"en", [plugin_5.pk, plugin_1.pk]) reordered_plugins = list(placeholder.get_plugins().order_by('position', 'path')) CMSPlugin.fix_tree() # Now, they should NOT be in the original order at all. Are they? new_plugins = list(placeholder.get_plugins().order_by('position', 'path')) self.assertSequenceEqual( reordered_plugins, new_plugins, "Plugin order not preserved during fix_tree().") def test_plugin_deep_nesting_and_copying(self): """ Create a deeply-nested plugin structure, tests its properties, and tests that it is copied accurately when the placeholder containing them is copied. The structure below isn't arbitrary, but has been designed to test various conditions, including: * nodes four levels deep * multiple successive level increases * multiple successive level decreases * successive nodes on the same level followed by level changes * multiple level decreases between successive nodes * siblings with and without children * nodes and branches added to the tree out of sequence First we create the structure: 11 1 2 12 4 10 8 3 9 5 6 7 13 14 and then we move it all around. """ placeholder = Placeholder(slot=u"some_slot") placeholder.save() # a good idea, if not strictly necessary # plugin in placeholder plugin_1 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"01") # IMPORTANT: plugins must be reloaded, before they can be assigned # as a parent. Otherwise, the MPTT structure doesn't seem to rebuild # properly. # child of plugin_1 plugin_1 = self.reload(plugin_1) plugin_2 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"02", target=plugin_1, ) # plugin_2 should be plugin_1's only child # for a single item we use assertSequenceEqual self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_1.pk).get_children(), [CMSPlugin.objects.get(id=plugin_2.pk)]) # create a second child of plugin_1 plugin_1 = self.reload(plugin_1) plugin_3 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"03", target=plugin_1 ) # plugin_2 & plugin_3 should be plugin_1's children # for multiple items we use assertSequenceEqual, because # assertSequenceEqual may re-order the list without warning self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_1.pk).get_children(), [ CMSPlugin.objects.get(id=plugin_2.pk), CMSPlugin.objects.get(id=plugin_3.pk), ]) # child of plugin_2 plugin_2 = self.reload(plugin_2) plugin_4 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"04", target=plugin_2 ) # plugin_4 should be plugin_2's child self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_2.pk).get_children(), [CMSPlugin.objects.get(id=plugin_4.pk)]) # 2,3 & 4 should be descendants of 1 self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_1.pk).get_descendants(), [ # note path ordering of MP reflected here: CMSPlugin.objects.get(id=plugin_2.pk), CMSPlugin.objects.get(id=plugin_4.pk), CMSPlugin.objects.get(id=plugin_3.pk), ], ) plugin_1 = self.reload(plugin_1) # create a second root plugin plugin_5 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"05") left = CMSPlugin.objects.filter(parent__isnull=True).order_by('path')[0] plugin_5 = self.reload(plugin_5) plugin_5 = plugin_5.move(left, pos='right') self.reorder_positions(plugin_5) self.reorder_positions(plugin_2) # child of plugin_5 plugin_5 = self.reload(plugin_5) plugin_6 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"06", target=plugin_5 ) # plugin_6 should be plugin_5's child self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_5.pk).get_children(), [CMSPlugin.objects.get(id=plugin_6.pk)]) # child of plugin_6 plugin_5 = self.reload(plugin_5) plugin_7 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"07", target=plugin_5 ) # plugin_7 should be plugin_5's child self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_5.pk).get_children(), [ CMSPlugin.objects.get(id=plugin_6.pk), CMSPlugin.objects.get(id=plugin_7.pk) ]) # 6 & 7 should be descendants of 5 self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_5.pk).get_descendants(), [ CMSPlugin.objects.get(id=plugin_6.pk), CMSPlugin.objects.get(id=plugin_7.pk), ]) # another child of plugin_2 plugin_2 = self.reload(plugin_2) plugin_8 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"08", target=plugin_2 ) # plugin_4 should be plugin_2's child self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_2.pk).get_children(), [ CMSPlugin.objects.get(id=plugin_4.pk), CMSPlugin.objects.get(id=plugin_8.pk), ]) # child of plugin_3 plugin_3 = self.reload(plugin_3) plugin_9 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"09", target=plugin_3 ) # plugin_9 should be plugin_3's child self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_3.pk).get_children(), [CMSPlugin.objects.get(id=plugin_9.pk)]) # child of plugin_4 plugin_4 = self.reload(plugin_4) plugin_10 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"10", target=plugin_4 ) # plugin_10 should be plugin_4's child self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_4.pk).get_children(), [CMSPlugin.objects.get(id=plugin_10.pk)]) original_plugins = placeholder.get_plugins() self.assertEqual(original_plugins.count(), 10) # elder sibling of plugin_1 plugin_1 = self.reload(plugin_1) plugin_11 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"11", target=plugin_1, position="left" ) self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_1.pk).get_children(), [ CMSPlugin.objects.get(id=plugin_2.pk), CMSPlugin.objects.get(id=plugin_3.pk) ]) # elder sibling of plugin_4 plugin_4 = self.reload(plugin_4) plugin_12 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"12", target=plugin_4, position="left" ) self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_2.pk).get_children(), [ CMSPlugin.objects.get(id=plugin_12.pk), CMSPlugin.objects.get(id=plugin_4.pk), CMSPlugin.objects.get(id=plugin_8.pk) ]) # younger sibling of plugin_7 plugin_7 = self.reload(plugin_7) plugin_13 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"13", target=plugin_7, position="right" ) self.assertSequenceEqual( CMSPlugin.objects.get(id=plugin_5.pk).get_children(), [ CMSPlugin.objects.get(id=plugin_6.pk), CMSPlugin.objects.get(id=plugin_7.pk), CMSPlugin.objects.get(id=plugin_13.pk) ]) # new sibling of plugin_5 plugin_5 = self.reload(plugin_5) plugin_14 = add_plugin(placeholder, u"TextPlugin", u"en", body=u"14" ) self.assertSequenceEqual( CMSPlugin.objects.filter(depth=1).order_by('path'), [ CMSPlugin.objects.get(id=plugin_11.pk), CMSPlugin.objects.get(id=plugin_1.pk), CMSPlugin.objects.get(id=plugin_5.pk), CMSPlugin.objects.get(id=plugin_14.pk) ]) self.copy_placeholders_and_check_results([placeholder]) # now let's move plugins around in the tree # move plugin_2 before plugin_11 plugin_2 = self.reload(plugin_2) plugin_1 = self.reload(plugin_1) old_parent = plugin_2.parent plugin_2.parent_id = plugin_1.parent_id plugin_2.save() plugin_2 = plugin_2.move(target=plugin_1, pos="left") self.reorder_positions(parent=old_parent) self.reorder_positions(plugin_2) self.copy_placeholders_and_check_results([placeholder]) # move plugin_6 after plugin_7 plugin_6 = self.reload(plugin_6) plugin_7 = self.reload(plugin_7) old_parent = plugin_6.parent plugin_6.parent_id = plugin_7.parent_id plugin_6.save() plugin_6 = plugin_6.move(target=plugin_7, pos="right") self.reorder_positions(parent=old_parent) self.reorder_positions(plugin_6) self.copy_placeholders_and_check_results([placeholder]) # move plugin_3 before plugin_2 plugin_2 = self.reload(plugin_2) plugin_3 = self.reload(plugin_3) old_parent = plugin_3.parent plugin_3.parent_id = plugin_2.parent_id plugin_3.save() plugin_3 = plugin_3.move(target=plugin_2, pos="left") self.reorder_positions(parent=old_parent) self.reorder_positions(plugin_3) self.copy_placeholders_and_check_results([placeholder]) # make plugin_3 plugin_2's first-child plugin_2 = self.reload(plugin_2) plugin_3 = self.reload(plugin_3) old_parent = plugin_3.parent plugin_3.parent_id = plugin_2.pk plugin_3.save() plugin_3 = plugin_3.move(target=plugin_2, pos="first-child") self.reorder_positions(CMSPlugin.objects.filter(placeholder_id=plugin_3.placeholder_id, language=plugin_3.language, depth=1)[0]) self.reorder_positions(plugin_3) self.copy_placeholders_and_check_results([placeholder]) # make plugin_7 plugin_2's first-child plugin_3 = self.reload(plugin_3) plugin_7 = self.reload(plugin_7) old_parent = plugin_7.parent plugin_7.parent_id = plugin_3.parent_id plugin_7.save() plugin_7 = plugin_7.move(target=plugin_3, pos="right") self.reorder_positions(parent=old_parent) self.reorder_positions(plugin_7) self.copy_placeholders_and_check_results([placeholder, ]) def test_nested_plugin_on_page(self): """ Validate a textplugin with a nested link plugin mptt values are correctly showing a parent child relationship of a nested plugin """ with self.settings(CMS_PERMISSION=False): # setup page 1 page_one = create_page(u"Three Placeholder", u"col_three.html", u"en", position=u"last-child", published=True, in_navigation=True) page_one_ph_two = page_one.placeholders.get(slot=u"col_left") # add a plugin pre_nesting_body = u"<p>the nested text plugin with a link inside</p>" text_plugin = add_plugin(page_one_ph_two, u"TextPlugin", u"en", body=pre_nesting_body) # prepare nestin plugin page_one_ph_two = self.reload(page_one_ph_two) text_plugin = self.reload(text_plugin) link_plugin = add_plugin(page_one_ph_two, u"LinkPlugin", u"en", target=text_plugin) link_plugin.name = u"django-cms Link" link_plugin.external_link = u"https://www.django-cms.org" # as for some reason mptt does not # update the parent child relationship # in the add_plugin method when a target present # but this is not the topic of the test link_plugin.parent = text_plugin link_plugin.save() # reloading needs to be done after every save link_plugin = self.reload(link_plugin) text_plugin = self.reload(text_plugin) # mptt related insertion correct? msg = u"parent plugin right is not updated, child not inserted correctly" self.assertTrue(text_plugin.position == link_plugin.position, msg=msg) msg = u"link has no parent" self.assertFalse(link_plugin.parent is None, msg=msg) msg = u"parent plugin path is not updated, child not inserted correctly" self.assertTrue(text_plugin.path == link_plugin.path[:4], msg=msg) msg = u"child level is not bigger than parent level" self.assertTrue(text_plugin.depth < link_plugin.depth, msg=msg) # add the link plugin to the body # emulate the editor in admin that adds some txt for the nested plugin in_txt = u"""<img id="plugin_obj_%s" title="Link" alt="Link" src="/static/cms/img/icons/plugins/link.png">""" nesting_body = u"%s<p>%s</p>" % (text_plugin.body, (in_txt % (link_plugin.id))) text_plugin.body = nesting_body text_plugin.save() text_plugin = self.reload(text_plugin) # none of the descendants should have a placeholder other then my own one self.assertEqual(text_plugin.get_descendants().exclude(placeholder=text_plugin.placeholder).count(), 0) post_add_plugin_count = CMSPlugin.objects.count() self.assertEqual(post_add_plugin_count, 2) def test_copy_page_nested_plugin(self): """ Test to verify that page copy with a nested plugin works page one - 3 placeholder col_sidebar: 1 text plugin col_left: 1 text plugin with nested link plugin col_right: no plugin page two (copy target) Verify copied page, placeholders, plugins and body text """ with self.settings(CMS_PERMISSION=False): # setup page 1 page_one = create_page(u"Three Placeholder", u"col_three.html", u"en", position=u"last-child", published=True, in_navigation=True) page_one_ph_one = page_one.placeholders.get(slot=u"col_sidebar") page_one_ph_two = page_one.placeholders.get(slot=u"col_left") page_one.placeholders.get(slot=u"col_right") # add the text plugin to placeholder one text_plugin_en = add_plugin(page_one_ph_one, u"TextPlugin", u"en", body="Hello World") self.assertEqual(text_plugin_en.id, CMSPlugin.objects.all()[0].id) self.assertEqual(text_plugin_en.get_children().count(), 0) pre_add_plugin_count = CMSPlugin.objects.count() self.assertEqual(pre_add_plugin_count, 1) ### # add a plugin to placeholder two ### pre_nesting_body = u"<p>the nested text plugin with a link inside</p>" text_plugin_two = add_plugin(page_one_ph_two, u"TextPlugin", u"en", body=pre_nesting_body) text_plugin_two = self.reload(text_plugin_two) # prepare nesting plugin page_one_ph_two = self.reload(page_one_ph_two) text_plugin_two = self.reload(text_plugin_two) link_plugin = add_plugin(page_one_ph_two, u"LinkPlugin", u"en", target=text_plugin_two) link_plugin.name = u"django-cms Link" link_plugin.external_link = u"https://www.django-cms.org" link_plugin.parent = text_plugin_two link_plugin.save() link_plugin = self.reload(link_plugin) text_plugin_two = self.reload(text_plugin_two) in_txt = """<cms-plugin id="%s" title="Link" alt="Link"></cms-plugin>""" nesting_body = "%s<p>%s</p>" % (text_plugin_two.body, (in_txt % (link_plugin.id))) # emulate the editor in admin that adds some txt for the nested plugin text_plugin_two.body = nesting_body text_plugin_two.save() text_plugin_two = self.reload(text_plugin_two) # the link is attached as a child? self.assertEqual(text_plugin_two.get_children().count(), 1) post_add_plugin_count = CMSPlugin.objects.filter(placeholder__page__publisher_is_draft=True).count() self.assertEqual(post_add_plugin_count, 3) page_one.save() # get the plugins from the original page page_one = self.reload(page_one) page_one_ph_one = page_one.placeholders.get(slot=u"col_sidebar") page_one_ph_two = page_one.placeholders.get(slot=u"col_left") page_one_ph_three = page_one.placeholders.get(slot=u"col_right") # verify that the plugins got created org_placeholder_one_plugins = page_one_ph_one.get_plugins() self.assertEqual(len(org_placeholder_one_plugins), 1) org_placeholder_two_plugins = page_one_ph_two.get_plugins() self.assertEqual(len(org_placeholder_two_plugins), 2) org_placeholder_three_plugins = page_one_ph_three.get_plugins() self.assertEqual(len(org_placeholder_three_plugins), 0) self.assertEqual(page_one.placeholders.count(), 3) placeholder_count = Placeholder.objects.filter(page__publisher_is_draft=True).count() self.assertEqual(placeholder_count, 3) self.assertEqual(CMSPlugin.objects.filter(placeholder__page__publisher_is_draft=True).count(), 3) ## # setup page_copy_target page ## page_copy_target = create_page("Three Placeholder - page copy target", "col_three.html", "en", position="last-child", published=True, in_navigation=True) all_page_count = Page.objects.drafts().count() pre_copy_placeholder_count = Placeholder.objects.filter(page__publisher_is_draft=True).count() self.assertEqual(pre_copy_placeholder_count, 6) # copy the page superuser = self.get_superuser() with self.login_user_context(superuser): page_two = self.copy_page(page_one, page_copy_target) # validate the expected pages,placeholders,plugins,pluginbodies after_copy_page_plugin_count = CMSPlugin.objects.filter(placeholder__page__publisher_is_draft=True).count() self.assertEqual(after_copy_page_plugin_count, 6) # check the amount of copied stuff after_copy_page_count = Page.objects.drafts().count() after_copy_placeholder_count = Placeholder.objects.filter(page__publisher_is_draft=True).count() self.assertGreater(after_copy_page_count, all_page_count, u"no new page after copy") self.assertGreater(after_copy_page_plugin_count, post_add_plugin_count, u"plugin count is not grown") self.assertGreater(after_copy_placeholder_count, pre_copy_placeholder_count, u"placeholder count is not grown") self.assertEqual(after_copy_page_count, 3, u"no new page after copy") # original placeholder page_one = self.reload(page_one) page_one_ph_one = page_one.placeholders.get(slot=u"col_sidebar") page_one_ph_two = page_one.placeholders.get(slot=u"col_left") page_one_ph_three = page_one.placeholders.get(slot=u"col_right") # check if there are multiple pages assigned to this placeholders found_page = page_one_ph_one.page if page_one_ph_one else None self.assertEqual(found_page, page_one) found_page = page_one_ph_two.page if page_one_ph_two else None self.assertEqual(found_page, page_one) found_page = page_one_ph_three.page if page_one_ph_three else None self.assertEqual(found_page, page_one) page_two = self.reload(page_two) page_two_ph_one = page_two.placeholders.get(slot=u"col_sidebar") page_two_ph_two = page_two.placeholders.get(slot=u"col_left") page_two_ph_three = page_two.placeholders.get(slot=u"col_right") # check if there are multiple pages assigned to this placeholders found_page = page_two_ph_one.page if page_two_ph_one else None self.assertEqual(found_page, page_two) found_page = page_two_ph_two.page if page_two_ph_two else None self.assertEqual(found_page, page_two) found_page = page_two_ph_three.page if page_two_ph_three else None self.assertEqual(found_page, page_two) # check the stored placeholders org vs copy msg = 'placehoder ids copy:%s org:%s copied page %s are identical - tree broken' % ( page_two_ph_one.pk, page_one_ph_one.pk, page_two.pk) self.assertNotEquals(page_two_ph_one.pk, page_one_ph_one.pk, msg) msg = 'placehoder ids copy:%s org:%s copied page %s are identical - tree broken' % ( page_two_ph_two.pk, page_one_ph_two.pk, page_two.pk) self.assertNotEquals(page_two_ph_two.pk, page_one_ph_two.pk, msg) msg = 'placehoder ids copy:%s org:%s copied page %s are identical - tree broken' % ( page_two_ph_three.pk, page_one_ph_three.pk, page_two.pk) self.assertNotEquals(page_two_ph_three.pk, page_one_ph_three.pk, msg) # get the plugins from the original page org_placeholder_one_plugins = page_one_ph_one.get_plugins() self.assertEqual(len(org_placeholder_one_plugins), 1) org_placeholder_two_plugins = page_one_ph_two.get_plugins() self.assertEqual(len(org_placeholder_two_plugins), 2) org_placeholder_three_plugins = page_one_ph_three.get_plugins() self.assertEqual(len(org_placeholder_three_plugins), 0) # get the plugins from the copied page copied_placeholder_one_plugins = page_two_ph_one.get_plugins() self.assertEqual(len(copied_placeholder_one_plugins), 1) copied_placeholder_two_plugins = page_two_ph_two.get_plugins() self.assertEqual(len(copied_placeholder_two_plugins), 2) copied_placeholder_three_plugins = page_two_ph_three.get_plugins() self.assertEqual(len(copied_placeholder_three_plugins), 0) # verify the plugins got copied # placeholder 1 count_plugins_copied = len(copied_placeholder_one_plugins) count_plugins_org = len(org_placeholder_one_plugins) msg = u"plugin count %s %s for placeholder one not equal" % (count_plugins_copied, count_plugins_org) self.assertEqual(count_plugins_copied, count_plugins_org, msg) # placeholder 2 count_plugins_copied = len(copied_placeholder_two_plugins) count_plugins_org = len(org_placeholder_two_plugins) msg = u"plugin count %s %s for placeholder two not equal" % (count_plugins_copied, count_plugins_org) self.assertEqual(count_plugins_copied, count_plugins_org, msg) # placeholder 3 count_plugins_copied = len(copied_placeholder_three_plugins) count_plugins_org = len(org_placeholder_three_plugins) msg = u"plugin count %s %s for placeholder three not equal" % (count_plugins_copied, count_plugins_org) self.assertEqual(count_plugins_copied, count_plugins_org, msg) # verify the body of text plugin with nested link plugin # org to copied org_nested_text_plugin = None # do this iteration to find the real text plugin with the attached link # the inheritance mechanism for the cmsplugins works through # (tuple)get_plugin_instance() for x in org_placeholder_two_plugins: if x.plugin_type == u"TextPlugin": instance = x.get_plugin_instance()[0] if instance.body.startswith(pre_nesting_body): org_nested_text_plugin = instance break copied_nested_text_plugin = None for x in copied_placeholder_two_plugins: if x.plugin_type == u"TextPlugin": instance = x.get_plugin_instance()[0] if instance.body.startswith(pre_nesting_body): copied_nested_text_plugin = instance break msg = u"orginal nested text plugin not found" self.assertNotEquals(org_nested_text_plugin, None, msg=msg) msg = u"copied nested text plugin not found" self.assertNotEquals(copied_nested_text_plugin, None, msg=msg) # get the children ids of the texplugin with a nested link # to check if the body of the text is genrated correctly org_link_child_plugin = org_nested_text_plugin.get_children()[0] copied_link_child_plugin = copied_nested_text_plugin.get_children()[0] # validate the textplugin body texts msg = u"org plugin and copied plugin are the same" self.assertTrue(org_link_child_plugin.id != copied_link_child_plugin.id, msg) needle = u"%s" msg = u"child plugin id differs to parent in body" # linked child is in body self.assertTrue(org_nested_text_plugin.body.find(needle % (org_link_child_plugin.id)) != -1, msg) msg = u"copy: child plugin id differs to parent in body" self.assertTrue(copied_nested_text_plugin.body.find(needle % (copied_link_child_plugin.id)) != -1, msg) # really nothing else msg = u"child link plugin id differs to parent body" self.assertTrue(org_nested_text_plugin.body.find(needle % (copied_link_child_plugin.id)) == -1, msg) msg = u"copy: child link plugin id differs to parent body" self.assertTrue(copied_nested_text_plugin.body.find(needle % (org_link_child_plugin.id)) == -1, msg) # now reverse lookup the placeholders from the plugins org_placeholder = org_link_child_plugin.placeholder copied_placeholder = copied_link_child_plugin.placeholder msg = u"placeholder of the orginal plugin and copied plugin are the same" ok = ((org_placeholder.id != copied_placeholder.id)) self.assertTrue(ok, msg) def test_copy_page_nested_plugin_moved_parent_plugin(self): """ Test to verify that page copy with a nested plugin works when a plugin with child got moved to another placeholder page one - 3 placeholder col_sidebar: 1 text plugin col_left: 1 text plugin with nested link plugin col_right: no plugin page two (copy target) step2: move the col_left text plugin to col_right col_sidebar: 1 text plugin col_left: no plugin col_right: 1 text plugin with nested link plugin verify the copied page structure """ with self.settings(CMS_PERMISSION=False): # setup page 1 page_one = create_page(u"Three Placeholder", u"col_three.html", u"en", position=u"last-child", published=True, in_navigation=True) page_one_ph_one = page_one.placeholders.get(slot=u"col_sidebar") page_one_ph_two = page_one.placeholders.get(slot=u"col_left") page_one.placeholders.get(slot=u"col_right") # add the text plugin to placeholder one text_plugin_en = add_plugin(page_one_ph_one, u"TextPlugin", u"en", body=u"Hello World") self.assertEqual(text_plugin_en.id, CMSPlugin.objects.all()[0].id) self.assertEqual(text_plugin_en.get_children().count(), 0) pre_add_plugin_count = CMSPlugin.objects.count() self.assertEqual(pre_add_plugin_count, 1) # add a plugin to placeholder twho pre_nesting_body = u"<p>the nested text plugin with a link inside</p>" text_plugin_two = add_plugin(page_one_ph_two, u"TextPlugin", u"en", body=pre_nesting_body) text_plugin_two = self.reload(text_plugin_two) # prepare nestin plugin page_one_ph_two = self.reload(page_one_ph_two) text_plugin_two = self.reload(text_plugin_two) link_plugin = add_plugin(page_one_ph_two, u"LinkPlugin", u"en", target=text_plugin_two) link_plugin.name = u"django-cms Link" link_plugin.external_link = u"https://www.django-cms.org" link_plugin.parent = text_plugin_two link_plugin.save() # reload after every save link_plugin = self.reload(link_plugin) text_plugin_two = self.reload(text_plugin_two) in_txt = u"""<cms-plugin id="%s" title="Link" alt="Link"></cms-plugin>""" nesting_body = "%s<p>%s</p>" % (text_plugin_two.body, (in_txt % (link_plugin.id))) # emulate the editor in admin that adds some txt for the nested plugin text_plugin_two.body = nesting_body text_plugin_two.save() text_plugin_two = self.reload(text_plugin_two) # the link is attached as a child? self.assertEqual(text_plugin_two.get_children().count(), 1) post_add_plugin_count = CMSPlugin.objects.count() self.assertEqual(post_add_plugin_count, 3) page_one.save() # get the plugins from the original page page_one = self.reload(page_one) page_one_ph_one = page_one.placeholders.get(slot=u"col_sidebar") page_one_ph_two = page_one.placeholders.get(slot=u"col_left") page_one_ph_three = page_one.placeholders.get(slot=u"col_right") # verify the plugins got created org_placeholder_one_plugins = page_one_ph_one.get_plugins() self.assertEqual(len(org_placeholder_one_plugins), 1) org_placeholder_two_plugins = page_one_ph_two.get_plugins() self.assertEqual(len(org_placeholder_two_plugins), 2) org_placeholder_three_plugins = page_one_ph_three.get_plugins() self.assertEqual(len(org_placeholder_three_plugins), 0) self.assertEqual(page_one.placeholders.count(), 3) placeholder_count = Placeholder.objects.filter(page__publisher_is_draft=True).count() self.assertEqual(placeholder_count, 3) self.assertEqual(CMSPlugin.objects.count(), 3) # setup page_copy_target page_copy_target = create_page("Three Placeholder - page copy target", "col_three.html", "en", position="last-child", published=True, in_navigation=True) all_page_count = Page.objects.drafts().count() pre_copy_placeholder_count = Placeholder.objects.filter(page__publisher_is_draft=True).count() self.assertEqual(pre_copy_placeholder_count, 6) superuser = self.get_superuser() with self.login_user_context(superuser): # now move the parent text plugin to another placeholder post_data = { 'placeholder_id': page_one_ph_three.id, 'plugin_id': text_plugin_two.id, 'plugin_language': 'en', 'plugin_parent': '', } edit_url = self.get_move_plugin_uri(text_plugin_two) response = self.client.post(edit_url, post_data) self.assertEqual(response.status_code, 200) # check if the plugin got moved page_one = self.reload(page_one) self.reload(text_plugin_two) page_one_ph_one = page_one.placeholders.get(slot=u"col_sidebar") page_one_ph_two = page_one.placeholders.get(slot=u"col_left") page_one_ph_three = page_one.placeholders.get(slot=u"col_right") org_placeholder_one_plugins = page_one_ph_one.get_plugins() self.assertEqual(len(org_placeholder_one_plugins), 1) org_placeholder_two_plugins = page_one_ph_two.get_plugins() # the plugin got moved and child got moved self.assertEqual(len(org_placeholder_two_plugins), 0) org_placeholder_three_plugins = page_one_ph_three.get_plugins() self.assertEqual(len(org_placeholder_three_plugins), 2) # copy the page page_two = self.copy_page(page_one, page_copy_target) # validate the expected pages,placeholders,plugins,pluginbodies after_copy_page_plugin_count = CMSPlugin.objects.count() self.assertEqual(after_copy_page_plugin_count, 6) after_copy_page_count = Page.objects.drafts().count() after_copy_placeholder_count = Placeholder.objects.filter(page__publisher_is_draft=True).count() self.assertGreater(after_copy_page_count, all_page_count, u"no new page after copy") self.assertGreater(after_copy_page_plugin_count, post_add_plugin_count, u"plugin count is not grown") self.assertGreater(after_copy_placeholder_count, pre_copy_placeholder_count, u"placeholder count is not grown") self.assertEqual(after_copy_page_count, 3, u"no new page after copy") # validate the structure # orginal placeholder page_one = self.reload(page_one) page_one_ph_one = page_one.placeholders.get(slot=u"col_sidebar") page_one_ph_two = page_one.placeholders.get(slot=u"col_left") page_one_ph_three = page_one.placeholders.get(slot=u"col_right") # check if there are multiple pages assigned to this placeholders found_page = page_one_ph_one.page if page_one_ph_one else None self.assertEqual(found_page, page_one) found_page = page_one_ph_two.page if page_one_ph_two else None self.assertEqual(found_page, page_one) found_page = page_one_ph_three.page if page_one_ph_three else None self.assertEqual(found_page, page_one) page_two = self.reload(page_two) page_two_ph_one = page_two.placeholders.get(slot=u"col_sidebar") page_two_ph_two = page_two.placeholders.get(slot=u"col_left") page_two_ph_three = page_two.placeholders.get(slot=u"col_right") # check if there are multiple pages assigned to this placeholders found_page = page_two_ph_one.page if page_two_ph_one else None self.assertEqual(found_page, page_two) found_page = page_two_ph_two.page if page_two_ph_two else None self.assertEqual(found_page, page_two) found_page = page_two_ph_three.page if page_two_ph_three else None self.assertEqual(found_page, page_two) # check the stored placeholders org vs copy msg = u'placehoder ids copy:%s org:%s copied page %s are identical - tree broken' % ( page_two_ph_one.pk, page_one_ph_one.pk, page_two.pk) self.assertNotEquals(page_two_ph_one.pk, page_one_ph_one.pk, msg) msg = u'placehoder ids copy:%s org:%s copied page %s are identical - tree broken' % ( page_two_ph_two.pk, page_one_ph_two.pk, page_two.pk) self.assertNotEquals(page_two_ph_two.pk, page_one_ph_two.pk, msg) msg = u'placehoder ids copy:%s org:%s copied page %s are identical - tree broken' % ( page_two_ph_three.pk, page_one_ph_three.pk, page_two.pk) self.assertNotEquals(page_two_ph_three.pk, page_one_ph_three.pk, msg) # get the plugins from the original page org_placeholder_one_plugins = page_one_ph_one.get_plugins() self.assertEqual(len(org_placeholder_one_plugins), 1) org_placeholder_two_plugins = page_one_ph_two.get_plugins() self.assertEqual(len(org_placeholder_two_plugins), 0) org_placeholder_three_plugins = page_one_ph_three.get_plugins() self.assertEqual(len(org_placeholder_three_plugins), 2) # get the plugins from the copied page copied_placeholder_one_plugins = page_two_ph_one.get_plugins() self.assertEqual(len(copied_placeholder_one_plugins), 1) copied_placeholder_two_plugins = page_two_ph_two.get_plugins() self.assertEqual(len(copied_placeholder_two_plugins), 0) copied_placeholder_three_plugins = page_two_ph_three.get_plugins() self.assertEqual(len(copied_placeholder_three_plugins), 2) # verify the plugins got copied # placeholder 1 count_plugins_copied = len(copied_placeholder_one_plugins) count_plugins_org = len(org_placeholder_one_plugins) msg = u"plugin count %s %s for placeholder one not equal" % (count_plugins_copied, count_plugins_org) self.assertEqual(count_plugins_copied, count_plugins_org, msg) # placeholder 2 count_plugins_copied = len(copied_placeholder_two_plugins) count_plugins_org = len(org_placeholder_two_plugins) msg = u"plugin count %s %s for placeholder two not equal" % (count_plugins_copied, count_plugins_org) self.assertEqual(count_plugins_copied, count_plugins_org, msg) # placeholder 3 count_plugins_copied = len(copied_placeholder_three_plugins) count_plugins_org = len(org_placeholder_three_plugins) msg = u"plugin count %s %s for placeholder three not equal" % (count_plugins_copied, count_plugins_org) self.assertEqual(count_plugins_copied, count_plugins_org, msg) # verify the body of text plugin with nested link plugin # org to copied org_nested_text_plugin = None # do this iteration to find the real text plugin with the attached link # the inheritance mechanism for the cmsplugins works through # (tuple)get_plugin_instance() for x in org_placeholder_three_plugins: if x.plugin_type == u"TextPlugin": instance = x.get_plugin_instance()[0] if instance.body.startswith(pre_nesting_body): org_nested_text_plugin = instance break copied_nested_text_plugin = None for x in copied_placeholder_three_plugins: if x.plugin_type == u"TextPlugin": instance = x.get_plugin_instance()[0] if instance.body.startswith(pre_nesting_body): copied_nested_text_plugin = instance break msg = u"orginal nested text plugin not found" self.assertNotEquals(org_nested_text_plugin, None, msg=msg) msg = u"copied nested text plugin not found" self.assertNotEquals(copied_nested_text_plugin, None, msg=msg) # get the children ids of the texplugin with a nested link # to check if the body of the text is generated correctly org_link_child_plugin = org_nested_text_plugin.get_children()[0] copied_link_child_plugin = copied_nested_text_plugin.get_children()[0] # validate the textplugin body texts msg = u"org plugin and copied plugin are the same" self.assertNotEqual(org_link_child_plugin.id, copied_link_child_plugin.id, msg) needle = u"%s" msg = u"child plugin id differs to parent in body" # linked child is in body self.assertTrue(org_nested_text_plugin.body.find(needle % (org_link_child_plugin.id)) != -1, msg) msg = u"copy: child plugin id differs to parent in body plugin_obj_id" self.assertTrue(copied_nested_text_plugin.body.find(needle % (copied_link_child_plugin.id)) != -1, msg) # really nothing else msg = u"child link plugin id differs to parent body" self.assertTrue(org_nested_text_plugin.body.find(needle % (copied_link_child_plugin.id)) == -1, msg) msg = u"copy: child link plugin id differs to parent body" self.assertTrue(copied_nested_text_plugin.body.find(needle % (org_link_child_plugin.id)) == -1, msg) # now reverse lookup the placeholders from the plugins org_placeholder = org_link_child_plugin.placeholder copied_placeholder = copied_link_child_plugin.placeholder msg = u"placeholder of the orginal plugin and copied plugin are the same" self.assertNotEqual(org_placeholder.id, copied_placeholder.id, msg) def test_add_child_plugin(self): page_one = create_page(u"Three Placeholder", u"col_three.html", u"en", position=u"last-child", published=True, in_navigation=True) page_one_ph_one = page_one.placeholders.get(slot=u"col_sidebar") # add the text plugin to placeholder one text_plugin_en = add_plugin(page_one_ph_one, u"TextPlugin", u"en", body=u"Hello World") superuser = self.get_superuser() with self.login_user_context(superuser): post_data = { 'name': 'test', 'external_link': 'http://www.example.org/' } add_url = self.get_add_plugin_uri(page_one_ph_one, 'LinkPlugin', parent=text_plugin_en) response = self.client.post(add_url, post_data) self.assertEqual(response.status_code, 200) self.assertTemplateUsed( response, 'admin/cms/page/plugin/confirm_form.html' ) link_plugin = CMSPlugin.objects.get(parent_id=text_plugin_en.pk) self.assertEqual(link_plugin.parent_id, text_plugin_en.pk) self.assertEqual(link_plugin.path, '00010001')
49.241348
136
0.623745
6,859
54,067
4.647325
0.06896
0.028109
0.02174
0.027011
0.780807
0.76029
0.734377
0.722362
0.717248
0.692308
0
0.012207
0.298482
54,067
1,097
137
49.286235
0.8281
0.173082
0
0.660221
0
0.001381
0.086734
0.003011
0
0
0
0
0.178177
1
0.012431
false
0
0.012431
0
0.027624
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
4c02973a00bdf3002932376377a37a1014ad7ddd
210
py
Python
week3-sql/airline/flights/views.py
patrickphat/cs50-web-dev
82ddc2ca063f2028f0e3aa536c96b861f8eeed97
[ "MIT" ]
2
2021-08-01T16:47:16.000Z
2021-12-21T14:32:11.000Z
week3-sql/airline/flights/views.py
patrickphat/cs50-web-dev
82ddc2ca063f2028f0e3aa536c96b861f8eeed97
[ "MIT" ]
null
null
null
week3-sql/airline/flights/views.py
patrickphat/cs50-web-dev
82ddc2ca063f2028f0e3aa536c96b861f8eeed97
[ "MIT" ]
null
null
null
from django.shortcuts import render from .models import Flight # Create your views here. def index(request): return render(request, "flights/index.html", { "flights": Flight.objects.all(), })
21
50
0.690476
26
210
5.576923
0.730769
0
0
0
0
0
0
0
0
0
0
0
0.190476
210
9
51
23.333333
0.852941
0.109524
0
0
0
0
0.13587
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0.166667
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
5
4c0834019cf4c5ecd4baebf59dbf80959c71fed7
68
py
Python
reachy_tictactoe/__init__.py
CircuitLaunch/reachy-tictactoe
83b07224212b61af4eb13dfd11fc775ae3fbea9c
[ "Apache-2.0" ]
4
2020-07-14T09:32:21.000Z
2021-01-20T22:34:48.000Z
reachy_tictactoe/__init__.py
CircuitLaunch/reachy-tictactoe
83b07224212b61af4eb13dfd11fc775ae3fbea9c
[ "Apache-2.0" ]
null
null
null
reachy_tictactoe/__init__.py
CircuitLaunch/reachy-tictactoe
83b07224212b61af4eb13dfd11fc775ae3fbea9c
[ "Apache-2.0" ]
1
2021-01-27T22:56:31.000Z
2021-01-27T22:56:31.000Z
from .tictactoe_playground import TictactoePlayground # noqa: F401
34
67
0.838235
7
68
8
1
0
0
0
0
0
0
0
0
0
0
0.05
0.117647
68
1
68
68
0.883333
0.147059
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
4c44f337ec64ad97c82858bade446b139ecdcc58
244
py
Python
moviemaker3/__init__.py
friedrichromstedt/moviemaker3
7941a06d43bbbb63e45496044040a163ab97d78d
[ "MIT" ]
1
2018-12-30T18:40:07.000Z
2018-12-30T18:40:07.000Z
moviemaker3/__init__.py
friedrichromstedt/moviemaker3
7941a06d43bbbb63e45496044040a163ab97d78d
[ "MIT" ]
null
null
null
moviemaker3/__init__.py
friedrichromstedt/moviemaker3
7941a06d43bbbb63e45496044040a163ab97d78d
[ "MIT" ]
null
null
null
from moviemaker3.stacks import * from moviemaker3.parameter import * from moviemaker3.assignment import * from moviemaker3.branch import * __version_tuple__ = (0, 1, 0, 'beta', 1) __version_string__ = '0.1.0b1' __version_date__ = '2011-05-03'
27.111111
40
0.766393
33
244
5.212121
0.545455
0.348837
0.366279
0
0
0
0
0
0
0
0
0.093458
0.122951
244
8
41
30.5
0.71028
0
0
0
0
0
0.086066
0
0
0
0
0
0
1
0
false
0
0.571429
0
0.571429
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
4c4d5a8ebf53549d52deb59af37c56900ad190b9
57
py
Python
src/application/__init__.py
nedagarmo/Libraries
7618bd329593684d475a9e64a38409ffb30697df
[ "Apache-2.0" ]
null
null
null
src/application/__init__.py
nedagarmo/Libraries
7618bd329593684d475a9e64a38409ffb30697df
[ "Apache-2.0" ]
null
null
null
src/application/__init__.py
nedagarmo/Libraries
7618bd329593684d475a9e64a38409ffb30697df
[ "Apache-2.0" ]
null
null
null
from .services import CreateBook, SearchBook, DeleteBook
28.5
56
0.842105
6
57
8
1
0
0
0
0
0
0
0
0
0
0
0
0.105263
57
1
57
57
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
4c634b2fc12e30b2f687df998d54c02aac88c1a8
57
py
Python
configs/mmdet/detection/detection_openvino_dynamic-800x1344.py
zhiqwang/mmdeploy
997d111a6f4ca9624ab3b36717748e6ce002037d
[ "Apache-2.0" ]
746
2021-12-27T10:50:28.000Z
2022-03-31T13:34:14.000Z
configs/mmdet/detection/detection_openvino_dynamic-800x1344.py
zhiqwang/mmdeploy
997d111a6f4ca9624ab3b36717748e6ce002037d
[ "Apache-2.0" ]
253
2021-12-28T05:59:13.000Z
2022-03-31T18:22:25.000Z
configs/mmdet/detection/detection_openvino_dynamic-800x1344.py
zhiqwang/mmdeploy
997d111a6f4ca9624ab3b36717748e6ce002037d
[ "Apache-2.0" ]
147
2021-12-27T10:50:33.000Z
2022-03-30T10:44:20.000Z
_base_ = ['../_base_/base_openvino_dynamic-800x1344.py']
28.5
56
0.754386
7
57
5.285714
0.714286
0.432432
0
0
0
0
0
0
0
0
0
0.12963
0.052632
57
1
57
57
0.555556
0
0
0
0
0
0.754386
0.754386
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d5b798e01a448cd840e8c96d3a3f6b7eba93abb0
97
py
Python
model/trainer/__init__.py
elviva404/food-detection-yolov5
796a0c1df6e9c9a705dff7782b3f9b213344f11b
[ "MIT" ]
24
2021-08-09T00:47:22.000Z
2022-03-06T09:38:48.000Z
model/trainer/__init__.py
elviva404/food-detection-yolov5
796a0c1df6e9c9a705dff7782b3f9b213344f11b
[ "MIT" ]
3
2021-07-19T16:01:37.000Z
2022-03-03T07:09:03.000Z
model/trainer/__init__.py
elviva404/food-detection-yolov5
796a0c1df6e9c9a705dff7782b3f9b213344f11b
[ "MIT" ]
8
2021-11-08T12:39:05.000Z
2022-01-30T14:59:37.000Z
from .checkpoint import Checkpoint, load_checkpoint, get_epoch_iters, get_config, get_class_names
97
97
0.876289
14
97
5.642857
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.072165
97
1
97
97
0.877778
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
912a7c8e5b381a3089ea9495ea75602baed4379d
81
py
Python
fba/discriminator/__init__.py
hukkelas/full_body_anonymization
c61745b137c84ffb742ef6ab2f4721db4acf22b7
[ "MIT" ]
27
2022-01-06T20:15:24.000Z
2022-03-29T11:54:49.000Z
fba/discriminator/__init__.py
hukkelas/full_body_anonymization
c61745b137c84ffb742ef6ab2f4721db4acf22b7
[ "MIT" ]
2
2022-03-17T06:04:23.000Z
2022-03-25T08:50:57.000Z
fba/discriminator/__init__.py
hukkelas/full_body_anonymization
c61745b137c84ffb742ef6ab2f4721db4acf22b7
[ "MIT" ]
2
2022-01-07T13:16:59.000Z
2022-01-16T02:10:50.000Z
from .stylegan2_D import StyleDiscriminator from .fpn_net import FPNDiscriminator
40.5
43
0.888889
10
81
7
0.8
0
0
0
0
0
0
0
0
0
0
0.013514
0.08642
81
2
44
40.5
0.932432
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
e66ccee12882e379416b0434b7f4bbbd5859eea0
141
py
Python
{{cookiecutter.github_repo}}/{{cookiecutter.project_slug}}/core.py
carlba/cookiecutter-pypackage
4b812440ce6aa38f1c7b1c930767874bf4a09f55
[ "MIT" ]
null
null
null
{{cookiecutter.github_repo}}/{{cookiecutter.project_slug}}/core.py
carlba/cookiecutter-pypackage
4b812440ce6aa38f1c7b1c930767874bf4a09f55
[ "MIT" ]
null
null
null
{{cookiecutter.github_repo}}/{{cookiecutter.project_slug}}/core.py
carlba/cookiecutter-pypackage
4b812440ce6aa38f1c7b1c930767874bf4a09f55
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Main module""" import click def start(): click.echo('Starting') def stop(): click.echo('Stopping')
9.4
26
0.567376
17
141
4.705882
0.764706
0.225
0
0
0
0
0
0
0
0
0
0.009009
0.212766
141
14
27
10.071429
0.711712
0.241135
0
0
0
0
0.161616
0
0
0
0
0
0
1
0.4
true
0
0.2
0
0.6
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
1
0
0
5
e68b6eda55550130f9e9cde908bd93deb17381fe
62
py
Python
src/data/sets/__init__.py
dmitry-s-danilov/kaggle-house-prices-advanced-regression-techniques
ab5130ea6d5b1c7373a886b9289cf0fde4f7c27d
[ "MIT" ]
1
2022-02-08T11:54:16.000Z
2022-02-08T11:54:16.000Z
src/data/sets/__init__.py
dmitry-s-danilov/kaggle-house-prices-advanced-regression-techniques
ab5130ea6d5b1c7373a886b9289cf0fde4f7c27d
[ "MIT" ]
null
null
null
src/data/sets/__init__.py
dmitry-s-danilov/kaggle-house-prices-advanced-regression-techniques
ab5130ea6d5b1c7373a886b9289cf0fde4f7c27d
[ "MIT" ]
null
null
null
from .load import load from .paths import file_paths as paths
20.666667
38
0.806452
11
62
4.454545
0.545455
0
0
0
0
0
0
0
0
0
0
0
0.16129
62
2
39
31
0.942308
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
e6af06e550d3607694295d48dcd073a95bcd0af0
49
py
Python
ecowater_softener/__init__.py
barleybobs/ecowater-softener
c99f6bb33ebf717fcd6f3a420003aeae54ee024b
[ "MIT" ]
4
2021-08-25T15:33:47.000Z
2022-01-11T17:04:23.000Z
ecowater_softener/__init__.py
barleybobs/ecowater_softener
c99f6bb33ebf717fcd6f3a420003aeae54ee024b
[ "MIT" ]
2
2021-09-07T23:21:22.000Z
2021-09-13T20:19:03.000Z
ecowater_softener/__init__.py
barleybobs/ecowater_softener
c99f6bb33ebf717fcd6f3a420003aeae54ee024b
[ "MIT" ]
2
2021-09-05T09:20:41.000Z
2021-09-18T07:55:46.000Z
from ecowater_softener.ecowater import Ecowater
24.5
48
0.877551
6
49
7
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.102041
49
1
49
49
0.954545
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e6ca0e3d37ff5eec0f8b74e2f9fc5f1dfb6c56b8
65
py
Python
config.py
Dextroz/Marvel_Flask_Website
39f826a3d0e536e0c1e1113e13f0552133c0c051
[ "MIT" ]
2
2021-01-25T08:58:36.000Z
2021-07-30T23:12:42.000Z
config.py
Dextroz/Marvel_Flask_Website
39f826a3d0e536e0c1e1113e13f0552133c0c051
[ "MIT" ]
null
null
null
config.py
Dextroz/Marvel_Flask_Website
39f826a3d0e536e0c1e1113e13f0552133c0c051
[ "MIT" ]
2
2022-02-20T14:42:27.000Z
2022-02-20T22:14:04.000Z
public_key = "Insert Key Here." private_key = "Insert Key Here."
21.666667
32
0.723077
10
65
4.5
0.5
0.4
0.533333
0.711111
0
0
0
0
0
0
0
0
0.153846
65
2
33
32.5
0.818182
0
0
0
0
0
0.492308
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
fc4cfd0b4bab0542a78eecfbe82837b9a02eeeb9
22
py
Python
__init__.py
SagarKurada/Data-Butler---Data-profiling-Python-package
2209dfc80230af7c58ee55df8531e09f9b0f924f
[ "MIT" ]
1
2020-02-28T17:18:19.000Z
2020-02-28T17:18:19.000Z
__init__.py
DataButler/Data-Butler
2209dfc80230af7c58ee55df8531e09f9b0f924f
[ "MIT" ]
null
null
null
__init__.py
DataButler/Data-Butler
2209dfc80230af7c58ee55df8531e09f9b0f924f
[ "MIT" ]
2
2020-03-19T03:00:17.000Z
2021-09-09T02:27:39.000Z
#init file for package
22
22
0.818182
4
22
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.136364
22
1
22
22
0.947368
0.954545
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
fc5aa2149d30ce3153d01ae5442fe3d09bca92e5
160
py
Python
src/pgoapi/pgoapi/protos/__init__.py
SovietKnowHow/slackplotbot
016cbe1dde7b9114c4e80b564fb73aa91ac76b14
[ "MIT" ]
null
null
null
src/pgoapi/pgoapi/protos/__init__.py
SovietKnowHow/slackplotbot
016cbe1dde7b9114c4e80b564fb73aa91ac76b14
[ "MIT" ]
null
null
null
src/pgoapi/pgoapi/protos/__init__.py
SovietKnowHow/slackplotbot
016cbe1dde7b9114c4e80b564fb73aa91ac76b14
[ "MIT" ]
null
null
null
import os import sys # add directory of this file to PATH, so that the package will be found sys.path.append(os.path.dirname(os.path.realpath(__file__)))
26.666667
72
0.75
28
160
4.142857
0.714286
0.103448
0
0
0
0
0
0
0
0
0
0
0.1625
160
6
73
26.666667
0.865672
0.43125
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
fc5f545e7b12832d3d2351ec1cc73147005e3e66
110
py
Python
plotly/graph_objs/surface/colorbar/__init__.py
gnestor/plotly.py
a8ae062795ddbf9867b8578fe6d9e244948c15ff
[ "MIT" ]
2
2018-12-03T15:20:42.000Z
2018-12-03T15:20:47.000Z
plotly/graph_objs/surface/colorbar/__init__.py
gnestor/plotly.py
a8ae062795ddbf9867b8578fe6d9e244948c15ff
[ "MIT" ]
1
2020-12-15T16:56:11.000Z
2020-12-15T16:56:11.000Z
plotly/graph_objs/surface/colorbar/__init__.py
gnestor/plotly.py
a8ae062795ddbf9867b8578fe6d9e244948c15ff
[ "MIT" ]
4
2019-06-03T14:49:12.000Z
2022-01-06T01:05:12.000Z
from ._titlefont import Titlefont from ._tickformatstop import Tickformatstop from ._tickfont import Tickfont
27.5
43
0.863636
12
110
7.666667
0.416667
0
0
0
0
0
0
0
0
0
0
0
0.109091
110
3
44
36.666667
0.938776
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
5d9c01734de613e53bdaf29d32f56c206f2be801
61
py
Python
c15/c15.py
avnish19/project-euler
263d60a133174d72e8117671ca61b41156a70191
[ "Unlicense" ]
null
null
null
c15/c15.py
avnish19/project-euler
263d60a133174d72e8117671ca61b41156a70191
[ "Unlicense" ]
null
null
null
c15/c15.py
avnish19/project-euler
263d60a133174d72e8117671ca61b41156a70191
[ "Unlicense" ]
null
null
null
""" Module to provide solution to Challenge 15 """ import sys
15.25
42
0.737705
9
61
5
0.888889
0
0
0
0
0
0
0
0
0
0
0.039216
0.163934
61
4
43
15.25
0.843137
0.688525
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
5d9ffe2a4c950ca67af0b951c360f69ad5d60f7a
116
py
Python
Living_SDK/board/uno-91h/ucube.py
Ai-Thinker-Open/Ai-Thinker-Open_ALIOS_DEV
27b3e2883d5801551c6919bf405583919d2f3f08
[ "Apache-2.0" ]
2
2020-07-14T07:48:18.000Z
2020-08-20T03:14:18.000Z
Living_SDK/board/uno-91h/ucube.py
Ai-Thinker-Open/Ai-Thinker-Open_ALIOS_DEV
27b3e2883d5801551c6919bf405583919d2f3f08
[ "Apache-2.0" ]
1
2022-03-18T07:14:27.000Z
2022-03-18T07:14:27.000Z
Living_SDK/board/uno-91h/ucube.py
Ai-Thinker-Open/Ai-Thinker-Open_ALIOS_DEV
27b3e2883d5801551c6919bf405583919d2f3f08
[ "Apache-2.0" ]
3
2020-07-04T14:37:00.000Z
2021-11-15T01:59:51.000Z
linux_only_targets="living_platform linkkit_gateway smart_outlet smart_outlet_meter smart_led_bulb smart_led_strip"
58
115
0.922414
18
116
5.333333
0.722222
0.229167
0
0
0
0
0
0
0
0
0
0
0.051724
116
1
116
116
0.872727
0
0
0
0
0
0.810345
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5df0286fe60e4602b6e796f6cc9096a19a94dd4c
1,496
py
Python
app/models.py
Jobenland/MFC-WebApp
aa5817ca32d8a797400971f4fcd40344cd6509ae
[ "MIT" ]
null
null
null
app/models.py
Jobenland/MFC-WebApp
aa5817ca32d8a797400971f4fcd40344cd6509ae
[ "MIT" ]
1
2020-01-23T16:43:48.000Z
2020-01-23T16:43:48.000Z
app/models.py
Jobenland/MFC-WebApp
aa5817ca32d8a797400971f4fcd40344cd6509ae
[ "MIT" ]
null
null
null
from json import dumps from werkzeug.security import generate_password_hash, check_password_hash from . import db from .utils import timestamp class User(db.Model): """The User model""" __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(256), nullable=False, unique=True) created_at = db.Column(db.Integer, default=timestamp) password_hash = db.Column(db.String(256), nullable=False) def verify_password(self, password): return check_password_hash(self.password_hash, password) def to_dict(self): """Export user to a dictionary.""" return { 'id': self.id, 'email': self.email, 'created_at': self.created_at } @staticmethod def create(email, password): user = User() user.password_hash = generate_password_hash(password) user.email = email return user @staticmethod def get_user(email, password): for user in User.query.all(): if user.email == email and user.verify_password(password): return user def __repr__(self): return dumps(self.to_dict()) @property def is_authenticated(self): return True @property def is_active(self): return True @property def is_anonymous(self): return False def get_id(self): return str(self.id)
25.793103
74
0.608289
178
1,496
4.932584
0.331461
0.095672
0.045558
0.038724
0.134396
0.134396
0.072893
0
0
0
0
0.005703
0.296791
1,496
57
75
26.245614
0.828897
0.028743
0
0.214286
1
0
0.015884
0
0
0
0
0
0
1
0.214286
false
0.190476
0.095238
0.142857
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
5
b90f680b7833a3ad914a9f07d7f6dc221ef8e44b
432
py
Python
src/handwritten_text_recognition/config.py
CrazyCrud/ocr_with_keras
f71fb7f4c4a1d57c68001ef0fa273154050edee4
[ "MIT" ]
null
null
null
src/handwritten_text_recognition/config.py
CrazyCrud/ocr_with_keras
f71fb7f4c4a1d57c68001ef0fa273154050edee4
[ "MIT" ]
3
2020-09-25T23:07:18.000Z
2021-05-21T15:14:33.000Z
src/handwritten_text_recognition/config.py
CrazyCrud/ocr-with-keras
f71fb7f4c4a1d57c68001ef0fa273154050edee4
[ "MIT" ]
1
2019-12-12T08:34:47.000Z
2019-12-12T08:34:47.000Z
import os def get_base_dir(): return os.path.dirname(__file__) def get_path_to_file_in_assets(*args): return os.path.join(get_base_dir(), 'assets', *args) def get_path_to_image_file_in_assets(*args): return os.path.join(get_base_dir(), 'assets', 'images', *args) def get_path_to_model_dir_in_assets(*args): return os.path.join(get_base_dir(), 'assets', 'models', *args) if __name__ == "__main__": pass
19.636364
66
0.712963
70
432
3.871429
0.328571
0.088561
0.147601
0.132841
0.634686
0.516605
0.516605
0.516605
0.516605
0.516605
0
0
0.141204
432
21
67
20.571429
0.730458
0
0
0
0
0
0.087963
0
0
0
0
0
0
1
0.363636
true
0.090909
0.090909
0.363636
0.818182
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
1
1
0
0
5
f8d800290b6227ca8e0f8d370a26a55490ec1c4e
56
py
Python
{{cookiecutter.project_name}}/service/tests/services/test_core.py
ProjectTemplates/python-backend-service
5266916e54faaf236bc972a2cd7bb1217e8a8625
[ "MIT" ]
7
2020-07-28T18:45:20.000Z
2021-12-11T23:33:49.000Z
{{cookiecutter.project_name}}/tests/services/test_core.py
KovalevVasiliy/python-fastapi-backend
e9ed466c00bae2eeb0b4271b013cc8dacd98acf0
[ "MIT" ]
null
null
null
{{cookiecutter.project_name}}/tests/services/test_core.py
KovalevVasiliy/python-fastapi-backend
e9ed466c00bae2eeb0b4271b013cc8dacd98acf0
[ "MIT" ]
1
2020-05-10T20:26:02.000Z
2020-05-10T20:26:02.000Z
# Tests for service *core* from services.core import *
14
27
0.732143
8
56
5.125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.178571
56
3
28
18.666667
0.891304
0.428571
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
f8db44abf4d82b3d95b2890794ea9c62cc494529
13,603
py
Python
calculator/expression/expression_level.py
restless-dreamer/awesome-calculator
52c20d0f935cd6906b5020cbd69fb2d537b93efe
[ "MIT" ]
null
null
null
calculator/expression/expression_level.py
restless-dreamer/awesome-calculator
52c20d0f935cd6906b5020cbd69fb2d537b93efe
[ "MIT" ]
1
2021-07-27T21:08:10.000Z
2021-07-28T11:22:24.000Z
calculator/expression/expression_level.py
restless-dreamer/awesome-calculator
52c20d0f935cd6906b5020cbd69fb2d537b93efe
[ "MIT" ]
null
null
null
from math import * from calculator.language_content import get_error_text class ExpressionLevel: def __init__(self, language, items, pos=0): self.__items = [] self.end_pos = None self.error = None self.error_pos = None self.error_group = None self.language = language while pos < len(items): if items[pos] == '(': next_level = ExpressionLevel(self.language, items, pos + 1) pos = next_level.end_pos result = next_level.get_result() if result is None: self.error = next_level.error self.error_pos = next_level.error_pos self.error_group = next_level.error_group break self.__items.append(result) elif items[pos] == ')': self.end_pos = pos break else: self.__items.append([items[pos], pos]) pos += 1 def calculate(self): pos = 0 while pos < len(self.__items): if self.__items[pos][0] == 'p': self.__items[pos][0] = pi elif self.__items[pos][0] == 'e': self.__items[pos][0] = e elif self.__items[pos][0] == 't': self.__items[pos][0] = tau pos += 1 pos = 0 while pos < len(self.__items): if self.__items[pos][0] == '√': number = float(self.__items[pos + 1][0]) if number < 0: self.error = get_error_text(self.language, '√') self.error_pos = self.__items[pos][1] self.error_group = 3 return None result = pow(number, 0.5) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'deg': number = float(self.__items[pos + 1][0]) result = degrees(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'rad': number = float(self.__items[pos + 1][0]) result = radians(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'exp': number = float(self.__items[pos + 1][0]) result = exp(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'abs': number = float(self.__items[pos + 1][0]) result = abs(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'log': number = float(self.__items[pos + 1][0]) result = log10(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'ln': number = float(self.__items[pos + 1][0]) result = log(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'sin': number = float(self.__items[pos + 1][0]) result = sin(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'cos': number = float(self.__items[pos + 1][0]) result = cos(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'tan': number = float(self.__items[pos + 1][0]) result = tan(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'sinh': number = float(self.__items[pos + 1][0]) result = sinh(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'cosh': number = float(self.__items[pos + 1][0]) result = cosh(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'tanh': number = float(self.__items[pos + 1][0]) result = tanh(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'asin': number = float(self.__items[pos + 1][0]) if number < -1 or number > 1: self.error = get_error_text(self.language, 'asin') self.error_pos = self.__items[pos][1] self.error_group = 4 return None result = asin(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'acos': number = float(self.__items[pos + 1][0]) if number < -1 or number > 1: self.error = get_error_text(self.language, 'acos') self.error_pos = self.__items[pos][1] self.error_group = 4 return None result = acos(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'atan': number = float(self.__items[pos + 1][0]) result = atan(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'asinh': number = float(self.__items[pos + 1][0]) result = asinh(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'acosh': number = float(self.__items[pos + 1][0]) if number < 1: self.error = get_error_text(self.language, 'acosh') self.error_pos = self.__items[pos][1] self.error_group = 4 return None result = acosh(number) self.__items[pos][0] = result self.__items.pop(pos + 1) elif self.__items[pos][0] == 'atanh': number = float(self.__items[pos + 1][0]) if number <= -1 or number >= 1: self.error = get_error_text(self.language, 'atanh') self.error_pos = self.__items[pos][1] self.error_group = 4 return None result = atanh(number) self.__items[pos][0] = result self.__items.pop(pos + 1) pos += 1 pos = 0 while pos < len(self.__items): if self.__items[pos][0] == '−': if pos == 0 or self.__items[pos - 1][0] == '(': number = float(self.__items[pos + 1][0]) result = number * (-1) self.__items[pos][0] = result self.__items.pop(pos + 1) pos += 1 pos = 0 while pos < len(self.__items): if self.__items[pos][0] == '!': number = float(self.__items[pos - 1][0]) if 0 > number or number != int(number): self.error = get_error_text(self.language, '!') self.error_pos = self.__items[pos][1] self.error_group = 2 return None result = factorial(number) self.__items[pos - 1][0] = result self.__items.pop(pos) pos -= 1 elif self.__items[pos][0] == '%': number_a = float(self.__items[pos - 1][0]) if pos == 1 or self.__items[pos - 2][0] in ['÷', '^']: result = number_a / 100 self.__items[pos - 1][0] = result self.__items.pop(pos) pos -= 1 elif pos > 1 and self.__items[pos - 2][0] in ['+', '−', '×']: number_b = float(self.__items[pos - 3][0]) result = None if self.__items[pos - 2][0] == '+': result = number_b + number_b / 100 * number_a elif self.__items[pos - 2][0] == '−': result = number_b - number_b / 100 * number_a elif self.__items[pos - 2][0] == '×': result = number_b / 100 * number_a self.__items[pos - 3][0] = result self.__items.pop(pos) self.__items.pop(pos - 1) self.__items.pop(pos - 2) pos -= 3 pos += 1 pos = 0 while pos < len(self.__items): if self.__items[pos][0] == '^': number_a = float(self.__items[pos - 1][0]) number_b = float(self.__items[pos + 1][0]) if number_a < 0 and int(number_b) != number_b \ or number_a == 0 and number_b < 0: self.error = get_error_text(self.language, '^') self.error_pos = self.__items[pos][1] self.error_group = 1 return None result = pow(number_a, number_b) self.__items[pos - 1][0] = result self.__items.pop(pos) self.__items.pop(pos) pos -= 1 pos += 1 pos = 0 while pos < len(self.__items): if self.__items[pos][0] == '×': number_a = float(self.__items[pos - 1][0]) number_b = float(self.__items[pos + 1][0]) result = number_a * number_b self.__items[pos - 1][0] = result self.__items.pop(pos) self.__items.pop(pos) pos -= 1 elif self.__items[pos][0] == '÷': number_a = float(self.__items[pos - 1][0]) number_b = float(self.__items[pos + 1][0]) if number_b == 0: self.error = get_error_text(self.language, '÷') self.error_pos = self.__items[pos][1] self.error_group = 1 return None result = number_a / number_b self.__items[pos - 1][0] = result self.__items.pop(pos) self.__items.pop(pos) pos -= 1 pos += 1 pos = 0 while pos < len(self.__items): if self.__items[pos][0] == '+': number_a = float(self.__items[pos - 1][0]) number_b = float(self.__items[pos + 1][0]) result = number_a + number_b self.__items[pos - 1][0] = result self.__items.pop(pos) self.__items.pop(pos) pos -= 1 elif self.__items[pos][0] == '−': number_a = float(self.__items[pos - 1][0]) number_b = float(self.__items[pos + 1][0]) result = number_a - number_b self.__items[pos - 1][0] = result self.__items.pop(pos) self.__items.pop(pos) pos -= 1 pos += 1 return self.__items[0] def get_result(self): if self.error is not None: return None elif len(self.__items) == 1: number = self.__items[0][0] if number == 'p': return [pi, 0] elif number == 'e': return [e, 0] elif number == 't': return [tau, 0] try: int(float(number)) except OverflowError: self.set_overflow_error() return None if len(number) > 87: self.set_overflow_error() return None return [float(number), 0] result = None try: result = self.calculate() if self.error is None: try: int(result[0]) except OverflowError: self.set_overflow_error() return None except OverflowError: self.set_overflow_error() if self.error is None: if int(result[0]) == result[0]: result_str = str(int(result[0])) if len(result_str) > 87: self.set_overflow_error() return None else: result_str = str(result[0]) if 'e' in list(result_str): from calculator.calculator_engine \ import convert_e_type_to_decimal result_str = convert_e_type_to_decimal(result_str) if len(result_str) > 87: self.set_overflow_error() return None return result def set_overflow_error(self): self.error = get_error_text(self.language, 'overflow') self.error_pos = self.__items[0][1] self.error_group = 0
42.245342
77
0.446372
1,521
13,603
3.710059
0.061801
0.250399
0.229665
0.122098
0.770689
0.741272
0.718412
0.701577
0.583023
0.571327
0
0.034384
0.433434
13,603
321
78
42.376947
0.69625
0
0
0.544304
0
0
0.008969
0
0
0
0
0
0
1
0.012658
false
0
0.009494
0
0.088608
0
0
0
0
null
1
1
0
0
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
f8e495742e95c52f7a3ab33bf91894d4df7ae730
21
py
Python
docs/cli/iterm/__init__.py
ChakshuGautam/PDF-Package
e054a4125c8bb979f0e2ac6a8137523868742d8a
[ "MIT" ]
null
null
null
docs/cli/iterm/__init__.py
ChakshuGautam/PDF-Package
e054a4125c8bb979f0e2ac6a8137523868742d8a
[ "MIT" ]
18
2020-05-01T03:17:56.000Z
2022-02-21T18:20:15.000Z
docs/cli/iterm/__init__.py
ChakshuGautam/PDF-Package
e054a4125c8bb979f0e2ac6a8137523868742d8a
[ "MIT" ]
4
2020-05-01T03:20:35.000Z
2021-11-17T13:37:52.000Z
#!./venv/bin python3
10.5
20
0.666667
3
21
4.666667
1
0
0
0
0
0
0
0
0
0
0
0.052632
0.095238
21
1
21
21
0.684211
0.904762
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
5d2c2193fb890f10c4ae45d82631c7a802fc38b2
329
py
Python
bentoctl/utils/operator_helpers/__init__.py
jjmachan/bentoctl
54ca1968a7197f658a7e9dc7ab0b46db1fc7439d
[ "Apache-2.0" ]
19
2021-12-12T13:27:54.000Z
2022-03-26T13:21:08.000Z
bentoctl/utils/operator_helpers/__init__.py
jjmachan/bentoctl
54ca1968a7197f658a7e9dc7ab0b46db1fc7439d
[ "Apache-2.0" ]
22
2021-12-09T17:37:15.000Z
2022-03-15T20:47:43.000Z
bentoctl/utils/operator_helpers/__init__.py
jjmachan/bentoctl
54ca1968a7197f658a7e9dc7ab0b46db1fc7439d
[ "Apache-2.0" ]
7
2021-12-13T06:48:04.000Z
2022-03-01T17:21:13.000Z
from bentoctl.utils.operator_helpers.create_deployable import ( create_deployable_from_local_bentostore, ) from bentoctl.utils.operator_helpers.generate import Generate from bentoctl.utils.operator_helpers.utils import run_shell_command __all__ = ["Generate", "create_deployable_from_local_bentostore", "run_shell_command"]
41.125
86
0.857143
41
329
6.390244
0.365854
0.137405
0.194656
0.28626
0.633588
0
0
0
0
0
0
0
0.072948
329
7
87
47
0.859016
0
0
0
1
0
0.194529
0.118541
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
5d3d9c5dbaba70c0668747a61a2f58fafaafa04b
1,376
py
Python
extract_features/save_inDir.py
CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding
36151165f0ce23c168b893a9e916023b34630cf3
[ "MIT" ]
null
null
null
extract_features/save_inDir.py
CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding
36151165f0ce23c168b893a9e916023b34630cf3
[ "MIT" ]
null
null
null
extract_features/save_inDir.py
CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding
36151165f0ce23c168b893a9e916023b34630cf3
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import numpy as np import pandas as pd import random import os,sys import shutil ##################################MAIN##################################### def save_train_val(dir,in_csv): name_path_save_val = os.path.join(dir,'val/') if not os.path.isdir(name_path_save_val): os.mkdir(name_path_save_val) name_path_save_train = os.path.join(dir,'train/') if not os.path.isdir(name_path_save_train): os.mkdir(name_path_save_train) ## val df = pd.read_csv(os.path.join(in_csv,'val_.csv')) print(df.label.values) for i in range(len(df.label.values)): if not os.path.isdir(name_path_save_val+str(df.label.values[i])): os.mkdir(name_path_save_val+str(df.label.values[i])) name_image = df.path.values[i].split('/')[-2]+'-'+df.path.values[i].split('/')[-1] shutil.copyfile(df.path.values[i], name_path_save_val+str(df.label.values[i])+'/'+name_image) print(name_image) ## train df = pd.read_csv(os.path.join(in_csv,'train_.csv')) print(df.label.values) for i in range(len(df.label.values)): if not os.path.isdir(name_path_save_train+str(df.label.values[i])): os.mkdir(name_path_save_train+str(df.label.values[i])) name_image = df.path.values[i].split('/')[-2]+'-'+df.path.values[i].split('/')[-1] shutil.copyfile(df.path.values[i], name_path_save_train+str(df.label.values[i])+'/'+name_image) print(name_image)
32
97
0.681686
241
1,376
3.680498
0.182573
0.10823
0.162345
0.101466
0.825254
0.784667
0.732807
0.732807
0.732807
0.59301
0
0.003984
0.087936
1,376
42
98
32.761905
0.702789
0.025436
0
0.285714
0
0
0.028459
0
0
0
0
0
0
1
0.035714
false
0
0.178571
0
0.214286
0.142857
0
0
0
null
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5d48448653a4c943daf437bdf006be3409cf7fa8
415
py
Python
car-segment/test.py
chicm/carvana
493a19fbb2fdab1cc1b4b95d97742684e4144229
[ "Apache-2.0" ]
null
null
null
car-segment/test.py
chicm/carvana
493a19fbb2fdab1cc1b4b95d97742684e4144229
[ "Apache-2.0" ]
null
null
null
car-segment/test.py
chicm/carvana
493a19fbb2fdab1cc1b4b95d97742684e4144229
[ "Apache-2.0" ]
null
null
null
import bcolz import numpy as np def save_array(fname, arr): c=bcolz.carray(arr, rootdir=fname, mode='w') c.flush() def load_array(fname): return bcolz.open(fname)[:] probs = np.load('/home/chicm/ml/kgdata/carvana/results/single/UNet_double_1024_5/submit/049/probs-part10.8.npy') save_array('/home/chicm/ml/kgdata/carvana/results/single/UNet_double_1024_5/submit/ensemble/probs-part10.8.npy', probs)
29.642857
119
0.751807
69
415
4.391304
0.536232
0.059406
0.072607
0.112211
0.382838
0.382838
0.382838
0.382838
0.382838
0.382838
0
0.050398
0.091566
415
14
119
29.642857
0.753316
0
0
0
0
0.222222
0.462651
0.460241
0
0
0
0
0
1
0.222222
false
0
0.222222
0.111111
0.555556
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
1
0
1
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
539cada9683e27c1a9acbec75148b38c99c9b8b5
130
py
Python
apps/profiles/admin.py
tofumatt/quotes
340013c2c3a21b406ffff9c26bc84540707439e7
[ "MIT" ]
null
null
null
apps/profiles/admin.py
tofumatt/quotes
340013c2c3a21b406ffff9c26bc84540707439e7
[ "MIT" ]
1
2015-12-05T02:05:54.000Z
2015-12-05T02:05:54.000Z
apps/profiles/admin.py
tofumatt/quotes
340013c2c3a21b406ffff9c26bc84540707439e7
[ "MIT" ]
null
null
null
from profiles.models import * from django.contrib import admin admin.site.register(FriendGroup) admin.site.register(UserProfile)
21.666667
32
0.830769
17
130
6.352941
0.647059
0.166667
0.314815
0
0
0
0
0
0
0
0
0
0.084615
130
5
33
26
0.907563
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
53ca6f16389d5721e5ce1a3a334c66f1cbca4466
88
py
Python
soda/__init__.py
lbnl-cybersecurity/SoDa
e07987e2ed05e036b72cf6d668ce43e60eccf2f4
[ "BSD-3-Clause-LBNL" ]
null
null
null
soda/__init__.py
lbnl-cybersecurity/SoDa
e07987e2ed05e036b72cf6d668ce43e60eccf2f4
[ "BSD-3-Clause-LBNL" ]
null
null
null
soda/__init__.py
lbnl-cybersecurity/SoDa
e07987e2ed05e036b72cf6d668ce43e60eccf2f4
[ "BSD-3-Clause-LBNL" ]
null
null
null
from soda.solar_data import SolarSite from soda.config import * __all__ = ['SolarSite']
22
37
0.784091
12
88
5.333333
0.666667
0.25
0
0
0
0
0
0
0
0
0
0
0.125
88
3
38
29.333333
0.831169
0
0
0
0
0
0.102273
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
54e838ba226f9f22b6c3ad3ded5558de77088d59
1,747
py
Python
okra/utils.py
NonsoAmadi10/Okra
ce0c98722b5ca24206bf86dbd0fc348aa9ed4510
[ "MIT" ]
2
2021-03-16T01:47:57.000Z
2022-01-25T09:13:46.000Z
okra/utils.py
NonsoAmadi10/Okra
ce0c98722b5ca24206bf86dbd0fc348aa9ed4510
[ "MIT" ]
null
null
null
okra/utils.py
NonsoAmadi10/Okra
ce0c98722b5ca24206bf86dbd0fc348aa9ed4510
[ "MIT" ]
null
null
null
import functools import datetime def validate_id(func): @functools.wraps(func) def wrapper(_, id): if type(id) != str: raise TypeError( f"\n Expecting an id type of string but got {type(id)}\n") result = func(_, id) return result return wrapper def validate_dates(func): @functools.wraps(func) def wrapper(_, _from, _to): # Check if the date format is in the order YYYY-MM_DD date_format = '%Y-%m-%d' try: _from = datetime.datetime.strptime(_from, date_format) _to = datetime.datetime.strptime(_to, date_format) except ValueError: raise ValueError("Incorrect data format, should be YYYY-MM-DD") if _to < _from: raise Exception( "The start date cannot be greater than the end date") result = func(_, _from, _to) return result return wrapper def validate_date_id(func): @functools.wraps(func) def wrapper(_, _from, _to, customer): if type(customer) != str: raise TypeError( f"\n Expecting an id type of string but got {type(customer)}\n") # Check if the date format is in the order YYYY-MM_DD date_format = '%Y-%m-%d' try: _from = datetime.datetime.strptime(_from, date_format) _to = datetime.datetime.strptime(_to, date_format) except ValueError: raise ValueError("Incorrect data format, should be YYYY-MM-DD") if _to < _from: raise Exception( "The start date cannot be greater than the end date") result = func(_, _from, _to, customer) return result return wrapper
27.296875
80
0.589582
218
1,747
4.550459
0.252294
0.080645
0.032258
0.066532
0.860887
0.860887
0.788306
0.752016
0.675403
0.675403
0
0
0.321694
1,747
63
81
27.730159
0.837131
0.058958
0
0.659091
0
0
0.192566
0
0
0
0
0
0
1
0.136364
false
0
0.045455
0
0.318182
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
07378ae573b863c3b7316681adc4cbfe59e908bc
1,668
py
Python
face_example/traingt_showfeaturemap.py
wujiyang/caffe
2ff25a86ec1d8cc8ab56776ca12bf60411bff27c
[ "Apache-2.0" ]
1
2018-06-11T12:50:26.000Z
2018-06-11T12:50:26.000Z
face_example/traingt_showfeaturemap.py
wujiyang/caffe
2ff25a86ec1d8cc8ab56776ca12bf60411bff27c
[ "Apache-2.0" ]
null
null
null
face_example/traingt_showfeaturemap.py
wujiyang/caffe
2ff25a86ec1d8cc8ab56776ca12bf60411bff27c
[ "Apache-2.0" ]
1
2019-04-08T02:37:29.000Z
2019-04-08T02:37:29.000Z
import caffe import numpy as np import matplotlib.pyplot as plt caffe.set_device(1) caffe.set_mode_gpu() solver = caffe.SGDSolver('./gait.prototxt') #solver.net.copy_from('kenel256_att_iter_2000.caffemodel') for j in range(15000): solver.step(1) if j % 100 == 0: for i in range(16): plt.subplot(4,4,i+1) plt.imshow(solver.net.blobs['conv3'].data[0,i,:,:]) plt.axis('off') plt.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9,hspace=0, wspace=0.05) #plt.suptitle('{}'.format(j)) a="conv3" plt.suptitle('{}'.format(a)) plt.savefig('./tmp/base/{0:5s},{1:5d}.png'.format(a,j), dpi=100) plt.close() # for i in range(2): # plt.subplot(1,2,i+1) # plt.imshow(solver.net.blobs['conv2_att_my'].data[0,i,:,:]) # plt.axis('off') # plt.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9,hspace=0, wspace=0.05) # a="conv2_att_my" # plt.suptitle('{}'.format(a)) # plt.savefig('./tmp/base/{0:12s}{1:5d}.png'.format(a,j), dpi=100) # plt.close() for i in range(16): plt.subplot(4,4,i+1) plt.imshow(solver.net.blobs['conv2'].data[0,i,:,:]) plt.axis('off') plt.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9,hspace=0, wspace=0.05) a="conv2" plt.suptitle('{}'.format(a)) plt.savefig('./tmp/base/{0:5s},{1:5d}.png'.format(a,j), dpi=100) plt.close() for i in range(16): plt.subplot(4,4,i+1) plt.imshow(solver.net.blobs['conv1'].data[0,i,:,:]) plt.axis('off') plt.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9,hspace=0, wspace=0.05) a="conv1" plt.suptitle('{}'.format(a)) plt.savefig('./tmp/base/{0:5s},{1:5d}.png'.format(a,j), dpi=100) plt.close()
34.040816
88
0.627098
313
1,668
3.29393
0.223642
0.015519
0.082444
0.042677
0.747818
0.747818
0.747818
0.747818
0.71387
0.678952
0
0.086598
0.127698
1,668
49
89
34.040816
0.621993
0.244005
0
0.583333
0
0
0.115108
0.067146
0
0
0
0
0
1
0
false
0
0.083333
0
0.083333
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
4acfac3cf0e6f0734cb4363ca074ae6dd6741f9c
56
py
Python
part1/src/python_exercise/__init__.py
ModusCreateOrg/python-exercise
a94446048ef8a7c145ecc8c1432aa17c580c61fe
[ "MIT" ]
null
null
null
part1/src/python_exercise/__init__.py
ModusCreateOrg/python-exercise
a94446048ef8a7c145ecc8c1432aa17c580c61fe
[ "MIT" ]
null
null
null
part1/src/python_exercise/__init__.py
ModusCreateOrg/python-exercise
a94446048ef8a7c145ecc8c1432aa17c580c61fe
[ "MIT" ]
15
2019-09-04T01:14:53.000Z
2021-02-03T10:15:10.000Z
print "This is our Django project generator tool set."
18.666667
54
0.767857
9
56
4.777778
1
0
0
0
0
0
0
0
0
0
0
0
0.178571
56
2
55
28
0.934783
0
0
0
0
0
0.836364
0
0
0
0
0
0
0
null
null
0
0
null
null
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
4ad944d94ba81fb38c0cf6ae3ddc93af499b75ea
215
py
Python
plyse/__init__.py
timdrijvers/plyse
a1aa625813b3aec907e363b8738b93f624b1cf03
[ "MIT" ]
null
null
null
plyse/__init__.py
timdrijvers/plyse
a1aa625813b3aec907e363b8738b93f624b1cf03
[ "MIT" ]
null
null
null
plyse/__init__.py
timdrijvers/plyse
a1aa625813b3aec907e363b8738b93f624b1cf03
[ "MIT" ]
null
null
null
from .grammar import GrammarFactory from .parser import QueryParser from .query import Query from .term_parser import * from .expressions.primitives import * from .expressions.terms import * __version__ = '1.0.2'
21.5
37
0.790698
28
215
5.892857
0.535714
0.145455
0.254545
0
0
0
0
0
0
0
0
0.016129
0.134884
215
9
38
23.888889
0.870968
0
0
0
0
0
0.023256
0
0
0
0
0
0
1
0
false
0
0.857143
0
0.857143
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
4adf62cdb2a6d32bd991880e360a3c9f7ac6a37f
91
py
Python
test cases/unit/68 test env value/test.py
iinuwa/meson
7528c69fcca63889d67c1d6c2463c9e9485585a8
[ "Apache-2.0" ]
4,047
2015-06-18T10:36:48.000Z
2022-03-31T09:47:02.000Z
test cases/unit/68 test env value/test.py
iinuwa/meson
7528c69fcca63889d67c1d6c2463c9e9485585a8
[ "Apache-2.0" ]
8,206
2015-06-14T12:20:48.000Z
2022-03-31T22:50:37.000Z
test cases/unit/68 test env value/test.py
iinuwa/meson
7528c69fcca63889d67c1d6c2463c9e9485585a8
[ "Apache-2.0" ]
1,489
2015-06-27T04:06:38.000Z
2022-03-29T10:14:48.000Z
#!/usr/bin/env python3 import os import sys assert os.environ['TEST_VAR'] == sys.argv[1]
13
44
0.703297
16
91
3.9375
0.8125
0
0
0
0
0
0
0
0
0
0
0.025316
0.131868
91
6
45
15.166667
0.772152
0.230769
0
0
0
0
0.115942
0
0
0
0
0
0.333333
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
ab06aa18c26284a1fe487a043b3a54430957ae83
116
py
Python
plotbox/__init__.py
anmolgarg/plotbox
841467ca5adb7f8ccd23762eb97e0361bdec2edb
[ "MIT" ]
null
null
null
plotbox/__init__.py
anmolgarg/plotbox
841467ca5adb7f8ccd23762eb97e0361bdec2edb
[ "MIT" ]
null
null
null
plotbox/__init__.py
anmolgarg/plotbox
841467ca5adb7f8ccd23762eb97e0361bdec2edb
[ "MIT" ]
null
null
null
import plot import iplot import movie import utils import tables import reference from ._version import __version__
14.5
33
0.853448
16
116
5.875
0.5625
0
0
0
0
0
0
0
0
0
0
0
0.137931
116
8
33
14.5
0.94
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ab09464d3d2a73be6cf8a84b0368f0a3131730ae
2,490
py
Python
print_parameters.py
bhishanpdl/Mass_Estimation
63d6361023057290408fc6ef129558f83b913eaf
[ "MIT" ]
null
null
null
print_parameters.py
bhishanpdl/Mass_Estimation
63d6361023057290408fc6ef129558f83b913eaf
[ "MIT" ]
null
null
null
print_parameters.py
bhishanpdl/Mass_Estimation
63d6361023057290408fc6ef129558f83b913eaf
[ "MIT" ]
null
null
null
from tabulate import tabulate params = "# id coord_ra coord_dec parent deblend_nChild deblend_psfCenter_x deblend_psfCenter_y deblend_psfFlux base_GaussianCentroid_x base_GaussianCentroid_y base_NaiveCentroid_x base_NaiveCentroid_y base_SdssCentroid_x base_SdssCentroid_y base_SdssCentroid_xSigma base_SdssCentroid_ySigma base_SdssShape_xx base_SdssShape_yy base_SdssShape_xy base_SdssShape_xxSigma base_SdssShape_yySigma base_SdssShape_xySigma base_SdssShape_x base_SdssShape_y base_SdssShape_flux base_SdssShape_fluxSigma base_SdssShape_psf_xx base_SdssShape_psf_yy base_SdssShape_psf_xy base_SdssShape_flux_xx_Cov base_SdssShape_flux_yy_Cov base_SdssShape_flux_xy_Cov ext_shapeHSM_HsmPsfMoments_x ext_shapeHSM_HsmPsfMoments_y ext_shapeHSM_HsmPsfMoments_xx ext_shapeHSM_HsmPsfMoments_yy ext_shapeHSM_HsmPsfMoments_xy ext_shapeHSM_HsmShapeRegauss_e1 ext_shapeHSM_HsmShapeRegauss_e2 ext_shapeHSM_HsmShapeRegauss_sigma ext_shapeHSM_HsmShapeRegauss_resolution ext_shapeHSM_HsmSourceMoments_x ext_shapeHSM_HsmSourceMoments_y ext_shapeHSM_HsmSourceMoments_xx ext_shapeHSM_HsmSourceMoments_yy ext_shapeHSM_HsmSourceMoments_xy base_CircularApertureFlux_3_0_flux base_CircularApertureFlux_3_0_fluxSigma base_CircularApertureFlux_4_5_flux base_CircularApertureFlux_4_5_fluxSigma base_CircularApertureFlux_6_0_flux base_CircularApertureFlux_6_0_fluxSigma base_CircularApertureFlux_9_0_flux base_CircularApertureFlux_9_0_fluxSigma base_CircularApertureFlux_12_0_flux base_CircularApertureFlux_12_0_fluxSigma base_CircularApertureFlux_17_0_flux base_CircularApertureFlux_17_0_fluxSigma base_CircularApertureFlux_25_0_flux base_CircularApertureFlux_25_0_fluxSigma base_CircularApertureFlux_35_0_flux base_CircularApertureFlux_35_0_fluxSigma base_CircularApertureFlux_50_0_flux base_CircularApertureFlux_50_0_fluxSigma base_CircularApertureFlux_70_0_flux base_CircularApertureFlux_70_0_fluxSigma base_GaussianFlux_flux base_GaussianFlux_fluxSigma base_PsfFlux_flux base_PsfFlux_fluxSigma base_Variance_value base_PsfFlux_apCorr base_PsfFlux_apCorrSigma base_GaussianFlux_apCorr base_GaussianFlux_apCorrSigma base_ClassificationExtendedness_value footprint" params = params.lstrip('#') lst = params.split() odd = lst[::2] even = lst[1::2] + [''] # odd has len 39, even has len 38 # list of pair of tuples lst = [(odd[i] + ' (' + str(i*2) + ')',even[i] + ' (' + str(i*2+1) + ')') for i in range(len(odd))] print(tabulate(lst))
207.5
2,189
0.883936
336
2,490
5.934524
0.244048
0.240722
0.140421
0.130893
0
0
0
0
0
0
0
0.028107
0.085542
2,490
12
2,190
207.5
0.847607
0.021687
0
0
0
0.125
0.897699
0.693509
0
0
0
0
0
1
0
false
0
0.125
0
0.125
0.25
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
ab144bc9d99c6a7d63f4330782b51ce2fc7cbcfe
77
py
Python
mne/datasets/somato/__init__.py
TanayGahlot/mne-python
857aa97c201451b82931c5eba50642975afc423d
[ "BSD-3-Clause" ]
4
2017-01-08T15:36:30.000Z
2022-03-08T13:07:27.000Z
mne/datasets/somato/__init__.py
TanayGahlot/mne-python
857aa97c201451b82931c5eba50642975afc423d
[ "BSD-3-Clause" ]
4
2015-04-20T16:10:47.000Z
2016-11-01T13:32:48.000Z
mne/datasets/somato/__init__.py
TanayGahlot/mne-python
857aa97c201451b82931c5eba50642975afc423d
[ "BSD-3-Clause" ]
null
null
null
"""Somatosensory dataset """ from .somato import data_path, has_somato_data
15.4
46
0.779221
10
77
5.7
0.8
0
0
0
0
0
0
0
0
0
0
0
0.116883
77
4
47
19.25
0.838235
0.272727
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
ab1a8ac3bad4766fa0a887af049b78874ed0342f
3,956
py
Python
tests/test_request.py
VALDOM-PROJET-TRANSVERSE-2019/Module4_VehicleTracking
4d3c3fa0a21f68116ae59346a4cc9bd0bb4b3af9
[ "MIT" ]
1
2020-03-23T16:11:20.000Z
2020-03-23T16:11:20.000Z
tests/test_request.py
VALDOM-PROJET-TRANSVERSE-2019/Module4_VehicleTracking
4d3c3fa0a21f68116ae59346a4cc9bd0bb4b3af9
[ "MIT" ]
4
2020-03-13T10:41:37.000Z
2020-03-24T22:05:49.000Z
tests/test_request.py
VALDOM-PROJET-TRANSVERSE-2019/Module4_VehicleTracking
4d3c3fa0a21f68116ae59346a4cc9bd0bb4b3af9
[ "MIT" ]
1
2020-09-11T13:45:00.000Z
2020-09-11T13:45:00.000Z
""" Module for testing flask api with unittest """ import json import unittest import urllib from urllib import request from urllib.error import HTTPError class TestGet(unittest.TestCase): """ Test functions of request to flask server """ def setUp(self): self.data = {'list_frame_contour': 'data/bounding_box.json', "frame_path": 'data/image/'} self.data_bb_missing = {"frame_path": 'data/image/'} self.data_frame_missing = {'list_frame_contour': 'data/bounding_boxes/'} self.data_all_missing = {} self.url = "http://0.0.0.0:5000/Track_from_JSON/" def test_json_output(self): """ test types of output request test values and length of output request :return: """ url_values = urllib.parse.urlencode(self.data) full_url = self.url + '?' + url_values req = request.Request(full_url) req.add_header('Content-Type', 'application/json; charset=utf-8') result = request.urlopen(full_url).read() output = json.loads(result.decode("utf8")) self.assertEqual(type(output), dict) for k in output.keys(): self.assertEqual(type(output[k]), list) for item in output[k]: self.assertEqual(type(item), int) self.assertEqual(output["frame 11"], [1]) self.assertEqual(output["frame 18"], [1, 3]) self.assertEqual(output["frame 518"], [101]) self.assertNotIn("frame 519", output.keys()) self.assertEqual(len(output), 519) def test_json_output_with_dict_input(self): """ test types of output request test values and length of output request :return: """ with open('data/bounding_box.json', 'r') as file: data_file = json.load(file) json_data = json.dumps(data_file) data = {'list_frame_contour': json_data, "frame_path": 'data/image/'} url_values = urllib.parse.urlencode(data) full_url = self.url + '?' + url_values req = request.Request(full_url) req.add_header('Content-Type', 'application/json; charset=utf-8') result = request.urlopen(full_url).read() output = json.loads(result.decode("utf8")) self.assertEqual(type(output), dict) for k in output.keys(): self.assertEqual(type(output[k]), list) for item in output[k]: self.assertEqual(type(item), int) self.assertEqual(output["frame 11"], [1]) self.assertEqual(output["frame 18"], [1, 3]) self.assertEqual(output["frame 518"], [101]) self.assertNotIn("frame 519", output.keys()) self.assertEqual(len(output), 519) def test_error_bb_missing(self): """ tests error message values when list_frame_contour is missing :return: """ url_values = urllib.parse.urlencode(self.data_bb_missing) full_url = self.url + '?' + url_values req = request.Request(full_url) with self.assertRaises(HTTPError): request.urlopen(req).read() def test_error_frame_missing(self): """ tests error message values when frame_path is missing :return: """ url_values = urllib.parse.urlencode(self.data_frame_missing) full_url = self.url + '?' + url_values req = request.Request(full_url) with self.assertRaises(HTTPError): request.urlopen(req).read() def test_error_all_missing(self): """ tests error message values when list_frame_contour and frame_path are missing :return: """ url_values = urllib.parse.urlencode(self.data_all_missing) url = "http://0.0.0.0:5000/Track_from_JSON/" full_url = url + '?' + url_values req = request.Request(full_url) with self.assertRaises(HTTPError): request.urlopen(req).read()
32.966667
97
0.612487
488
3,956
4.805328
0.194672
0.089552
0.048614
0.066525
0.790618
0.754371
0.732196
0.715991
0.701919
0.680597
0
0.019883
0.262639
3,956
119
98
33.243697
0.784025
0.117037
0
0.594203
0
0
0.127614
0.013337
0
0
0
0
0.275362
1
0.086957
false
0
0.072464
0
0.173913
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
ab2303e5d7ac1d80b37241fdf79be14e4ad57184
5,929
py
Python
tests/funcat/conditional_selection/test_turtle.py
pchaos/funcat2
ff554cc134906a5a182fc31774488d62a839b314
[ "Apache-2.0" ]
10
2021-05-06T01:17:28.000Z
2022-01-09T16:56:51.000Z
tests/funcat/conditional_selection/test_turtle.py
pchaos/funcat2
ff554cc134906a5a182fc31774488d62a839b314
[ "Apache-2.0" ]
null
null
null
tests/funcat/conditional_selection/test_turtle.py
pchaos/funcat2
ff554cc134906a5a182fc31774488d62a839b314
[ "Apache-2.0" ]
4
2021-05-26T14:25:01.000Z
2022-01-09T16:56:44.000Z
# -*- coding: utf-8 -*- import unittest import numpy as np from datetime import date from funcat import FOURWEEK, FOURWEEKQTY from funcat.api import T, S, set_current_freq, symbol, \ CLOSE from funcat.utils import FuncatTestCase class TestTurtle(FuncatTestCase): @classmethod def setUp(cls) -> None: T("20210506") S("000001.XSHG") set_current_freq("1d") def test_four_week_qty(self): n = 20 last_high, last_low = FOURWEEKQTY() print(last_high, last_low.series[-10:]) print(last_high.series[n - 1:n + 20], last_low.series[:10]) print(last_high, last_low.series[-10:]) print(tuple(zip(last_high.series, last_low.series))) for h, l in tuple(zip(last_high.series, last_low.series)): self.assertTrue((h > l) or not(h > 0), f"四周规则上轨应该比下轨大:{h},{l} ; {type(h)}") self.assertTrue(len(CLOSE) == len(last_high), f"{len(CLOSE)} == {len(last_high)}") def test_four_week_qty_weeks(self): """周为单位计算四周规则""" set_current_freq("W") n = 4 last_high, last_low = FOURWEEKQTY(CLOSE, CLOSE, n, n) print(last_high, last_low.series[-10:]) print(last_high.series[n - 1:n + 20], last_low.series[:10]) print(last_high, last_low.series[-10:]) print(tuple(zip(last_high.series, last_low.series))) for h, l in tuple(zip(last_high.series, last_low.series)): self.assertTrue((h > l) or not(h > 0), f"四周规则上轨应该比下轨大:{h},{l} ; {type(h)}") self.assertTrue(len(CLOSE) == len(last_high), f"{len(CLOSE)} == {len(last_high)}") def test_four_week(self): n = 20 fakedata = self.fakeMarketData() hh, ll = FOURWEEK(fakedata, fakedata, n, n) data = hh + ll print(data.series[n - 1:n + 20]) last_high, last_low = FOURWEEKQTY(fakedata, fakedata, n, n) for count, item in enumerate(data.tolist()): if count >= n - 1: if data.series[count] > 0: self.assertTrue(fakedata.series[count] > last_high.series[count - 1], f"{count}: { data.series[count]} --> {fakedata.series[count]}, {last_high.series[count-1]} --> {last_low.series[count-1]}") elif data.series[count] < 0: self.assertTrue(fakedata.series[count] < last_low.series[count - 1], f"{count}: { data.series[count]} --> {fakedata.series[count]}, {last_high.series[count-1]} --> {last_low.series[count-1]}") def test_four_week2(self): n = 20 hh, ll = FOURWEEK() data = hh + ll print(data.series[n - 1:n + 20]) last_high, last_low = FOURWEEKQTY() print(f"CLose: {len(CLOSE)}\n", CLOSE.series[n - 1:20]) print(f"high series: {len(last_high)}\n", last_high.series[n - 1:n + 20], "\nlow series:\n", last_low.series[n - 1:n + 20]) print(data.series[-10:]) for count, item in enumerate(data.tolist()): if count >= n - 1: if data.series[count]: self.assertTrue(CLOSE.series[count] > last_high.series[count - 1] or CLOSE.series[count] < last_low.series[count - 1] , f"{count}: { data.series[count]} --> {CLOSE.series[count]}, {last_high.series[count-1]} --> {last_low.series[count-1]}") def test_four_week_002124(self): n = 20 code = "002124" S(code) hh, ll = FOURWEEK(high_n=n, low_n=n) data = hh + ll print(data.series[n - 1:]) print(f"{symbol(code)}:", data.series[data.series == 1]) last_high, last_low = FOURWEEKQTY(high_n=n, low_n=n) fakedata, _ = FOURWEEKQTY.__self__.default_quantity() for count, item in enumerate(data.tolist()): if count >= n - 1: if data.series[count] > 0: self.assertTrue(fakedata.series[count] > last_high.series[count - 1], f"{count}: { data.series[count]} --> {fakedata.series[count]}, {last_high.series[count-1]} --> {last_low.series[count-1]}") # print() elif data.series[count] < 0: self.assertTrue(fakedata.series[count] < last_low.series[count - 1], f"{count}: { data.series[count]} --> {fakedata.series[count]}, {last_high.series[count-1]} --> {last_low.series[count-1]}") # print(fakedata.__class__) self.assertTrue(type(fakedata) == type(CLOSE), f"类型不匹配:{type(fakedata)}") def test_four_week_399673(self): n = 20 T("20210520") code = "399673.XSHE" S(code) hh, ll = FOURWEEK(high_n=n, low_n=n) data = hh + ll print(data.series[n - 1:]) print(f"{symbol(code)}:", data.series[data.series == 1]) # print(data.series[hh.series == 1]) print(data.series[data.series == -1]) last_high, last_low = FOURWEEKQTY(high_n=n, low_n=n) fakedata, _ = FOURWEEKQTY.__self__.default_quantity() for count, item in enumerate(data.tolist()): if count >= n - 1: if data.series[count] > 0: self.assertTrue(fakedata.series[count] > last_high.series[count - 1], f"{count}: { data.series[count]} --> {fakedata.series[count]}, {last_high.series[count-1]} --> {last_low.series[count-1]}") # print() elif data.series[count] < 0: self.assertTrue(fakedata.series[count] < last_low.series[count - 1], f"{count}: { data.series[count]} --> {fakedata.series[count]}, {last_high.series[count-1]} --> {last_low.series[count-1]}") expect_result = [ 0, 0, 0, 0, 0, 0, 1, 0, 1, 1] self.assertListEqual(data.tolist()[-10:], expect_result, f"和预期不同:{data.tolist()[-10:]}\n{expect_result}")
48.598361
148
0.561983
784
5,929
4.108418
0.117347
0.17417
0.088792
0.085688
0.760012
0.73176
0.73176
0.725862
0.702577
0.702577
0
0.034683
0.275426
5,929
121
149
49
0.715084
0.018722
0
0.619048
0
0.066667
0.201137
0.104873
0
0
0
0
0.12381
1
0.066667
false
0
0.057143
0
0.133333
0.171429
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
ab2a2fa34e6930772e5cdcb82477af440543ffcc
130
py
Python
adblockparser/__init__.py
rriemann/adblockparser
4089612d65018d38dbb88dd7f697bcb07814014d
[ "MIT" ]
162
2015-01-26T22:41:39.000Z
2022-02-15T04:49:13.000Z
adblockparser/__init__.py
rriemann/adblockparser
4089612d65018d38dbb88dd7f697bcb07814014d
[ "MIT" ]
18
2015-01-30T21:20:17.000Z
2021-11-23T00:56:24.000Z
adblockparser/__init__.py
rriemann/adblockparser
4089612d65018d38dbb88dd7f697bcb07814014d
[ "MIT" ]
43
2015-03-28T03:15:09.000Z
2021-12-09T03:29:39.000Z
# -*- coding: utf-8 -*- from __future__ import absolute_import from .parser import AdblockRules, AdblockRule, AdblockParsingError
32.5
66
0.792308
14
130
7
0.785714
0
0
0
0
0
0
0
0
0
0
0.008696
0.115385
130
3
67
43.333333
0.843478
0.161538
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
ab451e38ef2666da719601cd0a2cea9c48c59d31
8,840
py
Python
ceilometer/tests/publisher/test_kafka_broker_publisher.py
shahbazn/ceilometer
6308a46f14b21fb39c0e728c150ab4efde5b532a
[ "Apache-2.0" ]
null
null
null
ceilometer/tests/publisher/test_kafka_broker_publisher.py
shahbazn/ceilometer
6308a46f14b21fb39c0e728c150ab4efde5b532a
[ "Apache-2.0" ]
null
null
null
ceilometer/tests/publisher/test_kafka_broker_publisher.py
shahbazn/ceilometer
6308a46f14b21fb39c0e728c150ab4efde5b532a
[ "Apache-2.0" ]
null
null
null
# # Copyright 2015 Cisco Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Tests for ceilometer/publisher/kafka_broker.py """ import datetime import uuid import mock from oslo_utils import netutils from ceilometer.event.storage import models as event from ceilometer.publisher.kafka_broker import KafkaBrokerPublisher from ceilometer import sample from ceilometer.tests import base as tests_base class TestKafkaPublisher(tests_base.BaseTestCase): test_event_data = [ event.Event(message_id=uuid.uuid4(), event_type='event_%d' % i, generated=datetime.datetime.utcnow(), traits=[], raw={}) for i in range(0, 5) ] test_data = [ sample.Sample( name='test', type=sample.TYPE_CUMULATIVE, unit='', volume=1, user_id='test', project_id='test', resource_id='test_run_tasks', timestamp=datetime.datetime.utcnow().isoformat(), resource_metadata={'name': 'TestPublish'}, ), sample.Sample( name='test', type=sample.TYPE_CUMULATIVE, unit='', volume=1, user_id='test', project_id='test', resource_id='test_run_tasks', timestamp=datetime.datetime.utcnow().isoformat(), resource_metadata={'name': 'TestPublish'}, ), sample.Sample( name='test2', type=sample.TYPE_CUMULATIVE, unit='', volume=1, user_id='test', project_id='test', resource_id='test_run_tasks', timestamp=datetime.datetime.utcnow().isoformat(), resource_metadata={'name': 'TestPublish'}, ), sample.Sample( name='test2', type=sample.TYPE_CUMULATIVE, unit='', volume=1, user_id='test', project_id='test', resource_id='test_run_tasks', timestamp=datetime.datetime.utcnow().isoformat(), resource_metadata={'name': 'TestPublish'}, ), sample.Sample( name='test3', type=sample.TYPE_CUMULATIVE, unit='', volume=1, user_id='test', project_id='test', resource_id='test_run_tasks', timestamp=datetime.datetime.utcnow().isoformat(), resource_metadata={'name': 'TestPublish'}, ), ] def setUp(self): super(TestKafkaPublisher, self).setUp() @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish(self, mock_method): publisher = KafkaBrokerPublisher(netutils.urlsplit( 'kafka://127.0.0.1:9092?topic=ceilometer')) with mock.patch.object(publisher, '_send') as fake_send: fake_send.side_effect = mock.Mock() publisher.publish_samples(mock.MagicMock(), self.test_data) self.assertEqual(1, len(fake_send.mock_calls)) self.assertEqual(0, len(publisher.local_queue)) @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish_without_options(self, mock_method): publisher = KafkaBrokerPublisher( netutils.urlsplit('kafka://127.0.0.1:9092')) with mock.patch.object(publisher, '_send') as fake_send: fake_send.side_effect = mock.Mock() publisher.publish_samples(mock.MagicMock(), self.test_data) self.assertEqual(1, len(fake_send.mock_calls)) self.assertEqual(0, len(publisher.local_queue)) @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish_to_host_without_policy(self, mock_method): publisher = KafkaBrokerPublisher(netutils.urlsplit( 'kafka://127.0.0.1:9092?topic=ceilometer')) self.assertEqual('default', publisher.policy) publisher = KafkaBrokerPublisher(netutils.urlsplit( 'kafka://127.0.0.1:9092?topic=ceilometer&policy=test')) self.assertEqual('default', publisher.policy) @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish_to_host_with_default_policy(self, mock_method): publisher = KafkaBrokerPublisher(netutils.urlsplit( 'kafka://127.0.0.1:9092?topic=ceilometer&policy=default')) with mock.patch.object(publisher, '_send') as fake_send: fake_send.side_effect = TypeError self.assertRaises(TypeError, publisher.publish_samples, mock.MagicMock(), self.test_data) self.assertEqual(100, len(fake_send.mock_calls)) self.assertEqual(0, len(publisher.local_queue)) @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish_to_host_with_drop_policy(self, mock_method): publisher = KafkaBrokerPublisher(netutils.urlsplit( 'kafka://127.0.0.1:9092?topic=ceilometer&policy=drop')) with mock.patch.object(publisher, '_send') as fake_send: fake_send.side_effect = Exception("test") publisher.publish_samples(mock.MagicMock(), self.test_data) self.assertEqual(1, len(fake_send.mock_calls)) self.assertEqual(0, len(publisher.local_queue)) @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish_to_host_with_queue_policy(self, mock_method): publisher = KafkaBrokerPublisher(netutils.urlsplit( 'kafka://127.0.0.1:9092?topic=ceilometer&policy=queue')) with mock.patch.object(publisher, '_send') as fake_send: fake_send.side_effect = Exception("test") publisher.publish_samples(mock.MagicMock(), self.test_data) self.assertEqual(1, len(fake_send.mock_calls)) self.assertEqual(1, len(publisher.local_queue)) @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish_to_down_host_with_default_queue_size(self, mock_method): publisher = KafkaBrokerPublisher(netutils.urlsplit( 'kafka://127.0.0.1:9092?topic=ceilometer&policy=queue')) for i in range(0, 2000): for s in self.test_data: s.name = 'test-%d' % i publisher.publish_samples(mock.MagicMock(), self.test_data) self.assertEqual(1024, len(publisher.local_queue)) self.assertEqual( 'test-976', publisher.local_queue[0][0]['counter_name'] ) self.assertEqual( 'test-1999', publisher.local_queue[1023][0]['counter_name'] ) @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish_to_host_from_down_to_up_with_queue(self, mock_method): publisher = KafkaBrokerPublisher(netutils.urlsplit( 'kafka://127.0.0.1:9092?topic=ceilometer&policy=queue')) for i in range(0, 16): for s in self.test_data: s.name = 'test-%d' % i publisher.publish_samples(mock.MagicMock(), self.test_data) self.assertEqual(16, len(publisher.local_queue)) with mock.patch.object(publisher, '_send') as fake_send: fake_send.return_value = mock.Mock() for s in self.test_data: s.name = 'test-%d' % 16 publisher.publish_samples(mock.MagicMock(), self.test_data) self.assertEqual(0, len(publisher.local_queue)) @mock.patch.object(KafkaBrokerPublisher, '_get_client') def test_publish_event_with_default_policy(self, mock_method): publisher = KafkaBrokerPublisher( netutils.urlsplit('kafka://127.0.0.1:9092?topic=ceilometer')) with mock.patch.object(KafkaBrokerPublisher, '_send') as fake_send: publisher.publish_events(mock.MagicMock(), self.test_event_data) self.assertEqual(1, len(fake_send.mock_calls)) with mock.patch.object(KafkaBrokerPublisher, '_send') as fake_send: fake_send.side_effect = TypeError self.assertRaises(TypeError, publisher.publish_events, mock.MagicMock(), self.test_event_data) self.assertEqual(100, len(fake_send.mock_calls)) self.assertEqual(0, len(publisher.local_queue))
40.181818
77
0.633371
1,004
8,840
5.373506
0.163347
0.032623
0.047266
0.071362
0.779055
0.763114
0.763114
0.763114
0.763114
0.73494
0
0.025311
0.25362
8,840
219
78
40.365297
0.792361
0.067421
0
0.685714
0
0
0.10822
0.054839
0
0
0
0
0.125714
1
0.057143
false
0
0.045714
0
0.12
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
ab5fa8ac6f3305bf209f156d7a3038aedaf6e6c4
760
py
Python
meraki/models/type2_enum.py
dexterlabora/meraki-python-sdk
f6e6d61bd8694548169cd872b0642def69115bcb
[ "MIT" ]
37
2019-04-24T14:01:33.000Z
2022-01-28T01:37:21.000Z
meraki/models/type2_enum.py
ankita66666666/meraki-python-sdk
9894089eb013318243ae48869cc5130eb37f80c0
[ "MIT" ]
10
2019-07-09T16:35:11.000Z
2021-12-07T03:47:53.000Z
meraki/models/type2_enum.py
ankita66666666/meraki-python-sdk
9894089eb013318243ae48869cc5130eb37f80c0
[ "MIT" ]
17
2019-04-30T23:53:21.000Z
2022-02-07T22:57:44.000Z
# -*- coding: utf-8 -*- """ meraki This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ class Type2Enum(object): """Implementation of the 'Type2' enum. Type of the L7 Rule. Must be 'application', 'applicationCategory', 'host', 'port' or 'ipRange' Attributes: APPLICATION: TODO: type description here. APPLICATIONCATEGORY: TODO: type description here. HOST: TODO: type description here. PORT: TODO: type description here. IPRANGE: TODO: type description here. """ APPLICATION = 'application' APPLICATIONCATEGORY = 'applicationCategory' HOST = 'host' PORT = 'port' IPRANGE = 'ipRange'
21.714286
95
0.607895
75
760
6.16
0.52
0.08658
0.205628
0.248918
0
0
0
0
0
0
0
0.01107
0.286842
760
34
96
22.352941
0.841328
0.639474
0
0
1
0
0.25
0
0
0
0
0.147059
0
1
0
false
0
0
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
5
db3e30c49cb2b9b1f78b2bf2b673476b52cea1e9
143
py
Python
src/services/project_manager/test.py
melkyah/gcp_lab_keeper
98c2ac32269e25710f9f2c1938c17d3a86127189
[ "Apache-2.0" ]
null
null
null
src/services/project_manager/test.py
melkyah/gcp_lab_keeper
98c2ac32269e25710f9f2c1938c17d3a86127189
[ "Apache-2.0" ]
null
null
null
src/services/project_manager/test.py
melkyah/gcp_lab_keeper
98c2ac32269e25710f9f2c1938c17d3a86127189
[ "Apache-2.0" ]
null
null
null
from project_manager_client import ProjectManagerClient curr_client = ProjectManagerClient() curr_client.get_projects('../credentials.json')
23.833333
55
0.846154
15
143
7.733333
0.733333
0.413793
0.517241
0
0
0
0
0
0
0
0
0
0.06993
143
5
56
28.6
0.87218
0
0
0
0
0
0.132867
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
db492fb1ded044aa1c172919b06e695a88a34bfe
11,942
py
Python
conans/test/unittests/util/build_sln_command_test.py
ssaavedra/conan
e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c
[ "MIT" ]
1
2021-08-05T15:33:08.000Z
2021-08-05T15:33:08.000Z
conans/test/unittests/util/build_sln_command_test.py
ssaavedra/conan
e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c
[ "MIT" ]
null
null
null
conans/test/unittests/util/build_sln_command_test.py
ssaavedra/conan
e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import unittest import warnings import pytest from nose.plugins.attrib import attr from six import StringIO from conans.client import tools from conans.client.output import ConanOutput from conans.client.tools.oss import cpu_count from conans.client.tools.win import build_sln_command from conans.errors import ConanException from conans.model.settings import Settings from conans.test.utils.mocks import MockSettings from conans.test.utils.test_files import temp_folder from conans.util.files import load, save @attr('visual_studio') @pytest.mark.tool_visual_studio class BuildSLNCommandTest(unittest.TestCase): def test_no_configuration(self): dummy = """GlobalSection EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection """ folder = temp_folder() path = os.path.join(folder, "dummy.sln") save(path, dummy) with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") new_out = StringIO() command = build_sln_command(Settings({}), sln_path=path, targets=None, upgrade_project=False, build_type='Debug', arch="x86", parallel=False, output=ConanOutput(new_out)) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertIn('/p:Configuration="Debug" /p:UseEnv=false /p:Platform="x86"', command) self.assertIn("WARN: ***** The configuration Debug|x86 does not exist in this solution *****", new_out.getvalue()) # use platforms with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") new_out = StringIO() command = build_sln_command(Settings({}), sln_path=path, targets=None, upgrade_project=False, build_type='Debug', arch="x86", parallel=False, platforms={"x86": "Win32"}, output=ConanOutput(new_out)) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertIn('/p:Configuration="Debug" /p:UseEnv=false /p:Platform="Win32"', command) self.assertNotIn("WARN", new_out.getvalue()) self.assertNotIn("ERROR", new_out.getvalue()) def test_no_arch(self): with self.assertRaises(ConanException): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") new_out = StringIO() build_sln_command(Settings({}), sln_path='dummy.sln', targets=None, upgrade_project=False, build_type='Debug', arch=None, parallel=False, output=ConanOutput(new_out)) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) def test_no_build_type(self): with self.assertRaises(ConanException): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") new_out = StringIO() build_sln_command(Settings({}), sln_path='dummy.sln', targets=None, upgrade_project=False, build_type=None, arch='x86', parallel=False, output=ConanOutput(new_out)) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) def test_positive(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") output = ConanOutput(StringIO()) command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None, upgrade_project=False, build_type='Debug', arch='x86', parallel=False, output=output) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertIn('msbuild "dummy.sln"', command) self.assertIn('/p:Platform="x86"', command) self.assertNotIn('devenv "dummy.sln" /upgrade', command) self.assertNotIn('/m:%s' % cpu_count(output=output), command) self.assertNotIn('/target:teapot', command) def test_upgrade(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") output = ConanOutput(StringIO()) command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None, upgrade_project=True, build_type='Debug', arch='x86_64', parallel=False, output=output) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertIn('msbuild "dummy.sln"', command) self.assertIn('/p:Platform="x64"', command) self.assertIn('devenv "dummy.sln" /upgrade', command) self.assertNotIn('/m:%s' % cpu_count(output=output), command) self.assertNotIn('/target:teapot', command) with tools.environment_append({"CONAN_SKIP_VS_PROJECTS_UPGRADE": "1"}): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") output = ConanOutput(StringIO()) command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None, upgrade_project=True, build_type='Debug', arch='x86_64', parallel=False, output=output) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertIn('msbuild "dummy.sln"', command) self.assertIn('/p:Platform="x64"', command) self.assertNotIn('devenv "dummy.sln" /upgrade', command) self.assertNotIn('/m:%s' % cpu_count(output=output), command) self.assertNotIn('/target:teapot', command) with tools.environment_append({"CONAN_SKIP_VS_PROJECTS_UPGRADE": "False"}): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") output = ConanOutput(StringIO()) command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None, upgrade_project=True, build_type='Debug', arch='x86_64', parallel=False, output=output) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertIn('devenv "dummy.sln" /upgrade', command) def test_parallel(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") output = ConanOutput(StringIO()) command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=None, upgrade_project=True, build_type='Debug', arch='armv7', parallel=False, output=output) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertIn('msbuild "dummy.sln"', command) self.assertIn('/p:Platform="ARM"', command) self.assertIn('devenv "dummy.sln" /upgrade', command) self.assertNotIn('/m:%s' % cpu_count(output=output), command) self.assertNotIn('/target:teapot', command) def test_target(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") output = ConanOutput(StringIO()) command = build_sln_command(Settings({}), sln_path='dummy.sln', targets=['teapot'], upgrade_project=False, build_type='Debug', arch='armv8', parallel=False, output=output) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertIn('msbuild "dummy.sln"', command) self.assertIn('/p:Platform="ARM64"', command) self.assertNotIn('devenv "dummy.sln" /upgrade', command) self.assertNotIn('/m:%s' % cpu_count(output=output), command) self.assertIn('/target:teapot', command) def test_toolset(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") new_out = StringIO() command = build_sln_command(MockSettings({"compiler": "Visual Studio", "compiler.version": "17", "build_type": "Debug", "compiler.runtime": "MDd", "cppstd": "17"}), sln_path='dummy.sln', targets=None, upgrade_project=False, build_type='Debug', arch='armv7', parallel=False, toolset="v110", output=ConanOutput(new_out)) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertTrue(command.startswith('msbuild "dummy.sln" /p:Configuration="Debug" ' '/p:UseEnv=false ' '/p:Platform="ARM" ' '/p:PlatformToolset="v110" ' '/verbosity:minimal ' '/p:ForceImportBeforeCppTargets='), command) def test_properties_file(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") new_out = StringIO() command = build_sln_command(MockSettings({"compiler": "Visual Studio", "compiler.version": "17", "build_type": "Debug", "compiler.runtime": "MDd", "cppstd": "17"}), sln_path='dummy.sln', targets=None, upgrade_project=False, build_type='Debug', arch='armv7', parallel=False, output=ConanOutput(new_out)) self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[0].category, DeprecationWarning)) self.assertTrue(command.startswith('msbuild "dummy.sln" /p:Configuration="Debug" ' '/p:UseEnv=false ' '/p:Platform="ARM" ' '/verbosity:minimal ' '/p:ForceImportBeforeCppTargets='), command) path_tmp = command.split("/p:ForceImportBeforeCppTargets=")[1][1:-1] # remove quotes self.assertTrue(os.path.exists(path_tmp)) contents = load(path_tmp) self.assertIn("<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>", contents) self.assertIn("<AdditionalOptions>/std:c++17 %(AdditionalOptions)</AdditionalOptions>", contents)
47.015748
105
0.557109
1,144
11,942
5.699301
0.136364
0.029448
0.029908
0.046012
0.782362
0.760123
0.760123
0.750153
0.749387
0.749387
0
0.012811
0.326746
11,942
253
106
47.201581
0.798134
0.005862
0
0.671717
0
0
0.158578
0.037243
0
0
0
0
0.313131
1
0.045455
false
0
0.090909
0
0.141414
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
db6c8efe5eb6e677296a3f85dc1ce71befc192f3
1,380
py
Python
src/obfuscapk/obfuscator_category.py
AkshayJainG/Obfuscapk
6f2e791dbc06afc17d69393b3e5064cc4821a582
[ "MIT" ]
12
2020-02-24T13:40:41.000Z
2021-05-05T12:41:43.000Z
src/obfuscapk/obfuscator_category.py
z3r0Sec/Obfuscapk
3adbf7bfa84adf117326409c683e375ceb5a5df4
[ "MIT" ]
null
null
null
src/obfuscapk/obfuscator_category.py
z3r0Sec/Obfuscapk
3adbf7bfa84adf117326409c683e375ceb5a5df4
[ "MIT" ]
3
2020-05-15T16:44:43.000Z
2021-07-31T03:21:14.000Z
#!/usr/bin/env python3.7 # coding: utf-8 from abc import ABC, abstractmethod from yapsy.IPlugin import IPlugin from .obfuscation import Obfuscation class IBaseObfuscator(ABC, IPlugin): def __init__(self): super().__init__() self.is_adding_fields = False self.is_adding_methods = False @abstractmethod def obfuscate(self, obfuscation_info: Obfuscation): raise NotImplementedError() class ITrivialObfuscator(IBaseObfuscator): @abstractmethod def obfuscate(self, obfuscation_info: Obfuscation): raise NotImplementedError() class IRenameObfuscator(IBaseObfuscator): @abstractmethod def obfuscate(self, obfuscation_info: Obfuscation): raise NotImplementedError() class IEncryptionObfuscator(IBaseObfuscator): @abstractmethod def obfuscate(self, obfuscation_info: Obfuscation): raise NotImplementedError() class ICodeObfuscator(IBaseObfuscator): @abstractmethod def obfuscate(self, obfuscation_info: Obfuscation): raise NotImplementedError() class IResourcesObfuscator(IBaseObfuscator): @abstractmethod def obfuscate(self, obfuscation_info: Obfuscation): raise NotImplementedError() class IOtherObfuscator(IBaseObfuscator): @abstractmethod def obfuscate(self, obfuscation_info: Obfuscation): raise NotImplementedError()
21.5625
55
0.739855
122
1,380
8.213115
0.295082
0.118762
0.181637
0.209581
0.678643
0.678643
0.678643
0.678643
0.678643
0.678643
0
0.002671
0.186232
1,380
63
56
21.904762
0.889581
0.026812
0
0.6
0
0
0
0
0
0
0
0
0
1
0.228571
false
0
0.085714
0
0.514286
0
0
0
0
null
0
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
db78fae042aceeac2ae33d1017a602c2e12901d8
578
py
Python
sdk/python/pulumi_aws/wafv2/__init__.py
Otanikotani/pulumi-aws
00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/wafv2/__init__.py
Otanikotani/pulumi-aws
00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/wafv2/__init__.py
Otanikotani/pulumi-aws
00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** # Export this package's modules as members: from .get_ip_set import * from .get_regex_pattern_set import * from .get_rule_group import * from .get_web_acl import * from .ip_set import * from .regex_pattern_set import * from .rule_group import * from .web_acl import * from .web_acl_association import * from .web_acl_logging_configuration import * from ._inputs import * from . import outputs
32.111111
87
0.759516
92
578
4.554348
0.532609
0.26253
0.124105
0.114558
0.119332
0
0
0
0
0
0
0.002049
0.155709
578
17
88
34
0.856557
0.378893
0
0
1
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
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
dbc2721165cc9707201d61ad67675eed18db4540
403,704
py
Python
trame/html/vuetify/__init__.py
DrewLazzeriKitware/trame
fdc73f07f17d2601e1b1d3934d2d6326a3c0281e
[ "BSD-3-Clause" ]
null
null
null
trame/html/vuetify/__init__.py
DrewLazzeriKitware/trame
fdc73f07f17d2601e1b1d3934d2d6326a3c0281e
[ "BSD-3-Clause" ]
null
null
null
trame/html/vuetify/__init__.py
DrewLazzeriKitware/trame
fdc73f07f17d2601e1b1d3934d2d6326a3c0281e
[ "BSD-3-Clause" ]
null
null
null
from trame import get_app_instance from trame.html import AbstractElement, Template try: import numpy as np from numbers import Number except: # dataframe_to_grid won't work pass # Make sure used module is available _app = get_app_instance() if "vuetify" not in _app.vue_use: _app.vue_use += ["vuetify"] type_mapper = { "b": ["textColumn"], "i": [], # ["numericColumn", "numberColumnFilter"], "u": [], # ["numericColumn", "numberColumnFilter"], "f": [], # ["numericColumn", "numberColumnFilter"], "c": [], "m": [], # ['timedeltaFormat'], "M": [], # ["dateColumnFilter", "shortDateTimeFormat"], "O": [], "S": [], "U": [], "V": [], } def cast_to_serializable(value): isoformat = getattr(value, "isoformat", None) if (isoformat) and callable(isoformat): return isoformat() elif isinstance(value, Number): if np.isnan(value) or np.isinf(value): return value.__str__() return value return value.__str__() def dataframe_to_grid(dataframe, options={}): """ Transform a dataframe for use with a VDataTable :param dataframe: A pandas dataframe :param options: Control which columns are sortable, filterable, grouped, aligned, etc. A dictionary where keys are the columns from the dataframe and values are Vuetify DataTableHeader objects. See more info |header_doc_link|. .. |header_doc_link| raw:: html <a href="https://vuetifyjs.com/en/api/v-data-table/#props-headers" target="_blank">here</a> >>> headers, rows = vuetify.dataframe_to_grid(dataframe) >>> VDataTable( ... headers=("table_headers", headers), ... items=("table_rows", rows)) """ headers = {} for col_name in dataframe.columns: headers[col_name] = {"text": col_name, "value": col_name} if options.get(col_name): headers[col_name].update(options.get(col_name)) return list(headers.values()), dataframe.applymap(cast_to_serializable).to_dict( orient="records" ) slot_names = [ "day-label", "group.header", "expanded-item", "item.data-table-expand", "group.summary", "body.append", "foot", "no-results", "badge", "category", "placeholder", "icon", "body", "selection", "progress", "day-month", "actions", "group", "header.<name>", "label", "append-outer", "page-text", "day-label-header", "counter", "extension", "close", "prepend-item", "img", "loader", "footer.page-text", "day-header", "prepend", "prev", "item", "interval", "item.data-table-select", "default", "divider", "no-data", "footer", "top", "thumb-label", "opposite", "append-item", "body.prepend", "appendIcon", "prepend-inner", "loading", "header.data-table-select", "activator", "day-body", "header", "event", "item.<name>", "message", "footer.prepend", "prependIcon", "next", "input", "append", "day", "action", ] Template.slot_names.update(slot_names) class VApp(AbstractElement): """ Vuetify's VApp component. See more info and examples |VApp_vuetify_link|. .. |VApp_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-app" target="_blank">here</a> :param id: Sets the DOM id on the component :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-app", children, **kwargs) self._attr_names += [ "id", ] class VAppBar(AbstractElement): """ Vuetify's VAppBar component. See more info and examples |VAppBar_vuetify_link|. .. |VAppBar_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-app-bar" target="_blank">here</a> :param absolute: Applies position: absolute to the component. :type boolean: :param app: See description |VAppBar_vuetify_link|. :type boolean: :param bottom: Aligns the component towards the bottom. :type boolean: :param clipped_left: Designates that the application's `v-navigation-drawer` that is positioned on the left is below the app-bar. :type boolean: :param clipped_right: Designates that the application's `v-navigation-drawer` that is positioned on the right is below the app-bar. :type boolean: :param collapse: Puts the toolbar into a collapsed state reducing its maximum width. :type boolean: :param collapse_on_scroll: Puts the app-bar into a collapsed state when scrolling. :type boolean: :param color: See description |VAppBar_vuetify_link|. :type string: :param dark: See description |VAppBar_vuetify_link|. :type boolean: :param dense: Reduces the height of the toolbar content to 48px (96px when using the **prominent** prop). :type boolean: :param elevate_on_scroll: Elevates the app-bar when scrolling. :type boolean: :param elevation: See description |VAppBar_vuetify_link|. :type ['number', 'string']: :param extended: Use this prop to increase the height of the toolbar _without_ using the `extension` slot for adding content. May be used in conjunction with the **extension-height** prop, and any of the other props that affect the height of the toolbar, e.g. **prominent**, **dense**, etc., **WITH THE EXCEPTION** of **height**. :type boolean: :param extension_height: Specify an explicit height for the `extension` slot. :type ['number', 'string']: :param fade_img_on_scroll: When using the **src** prop or `img` slot, will fade the image when scrolling. :type boolean: :param fixed: Applies **position: fixed** to the component. :type boolean: :param flat: Removes the toolbar's box-shadow. :type boolean: :param floating: Applies **display: inline-flex** to the component. :type boolean: :param height: Designates a specific height for the toolbar. Overrides the heights imposed by other props, e.g. **prominent**, **dense**, **extended**, etc. :type ['number', 'string']: :param hide_on_scroll: Hides the app-bar when scrolling. Will still show the `extension` slot. :type boolean: :param inverted_scroll: Hides the app-bar when scrolling down and displays it when scrolling up. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param prominent: Increases the height of the toolbar content to 128px. :type boolean: :param rounded: See description |VAppBar_vuetify_link|. :type ['boolean', 'string']: :param scroll_off_screen: Hides the app-bar when scrolling. Will **NOT** show the `extension` slot. :type boolean: :param scroll_target: Designates the element to target for scrolling events. Uses `window` by default. :type string: :param scroll_threshold: The amount of scroll distance down before **hide-on-scroll** activates. :type ['string', 'number']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param short: Reduce the height of the toolbar content to 56px (112px when using the **prominent** prop). :type boolean: :param shrink_on_scroll: Shrinks a **prominent** toolbar to a **dense** or **short** (default) one when scrolling. :type boolean: :param src: Image source. See `v-img` for details :type ['string', 'object']: :param tag: Specify a custom tag used on the root element. :type string: :param tile: Removes the component's **border-radius**. :type boolean: :param value: Controls whether the component is visible or hidden. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-app-bar", children, **kwargs) self._attr_names += [ "absolute", "app", "bottom", "clipped_left", "clipped_right", "collapse", "collapse_on_scroll", "color", "dark", "dense", "elevate_on_scroll", "elevation", "extended", "extension_height", "fade_img_on_scroll", "fixed", "flat", "floating", "height", "hide_on_scroll", "inverted_scroll", "light", "max_height", "max_width", "min_height", "min_width", "outlined", "prominent", "rounded", "scroll_off_screen", "scroll_target", "scroll_threshold", "shaped", "short", "shrink_on_scroll", "src", "tag", "tile", "value", "width", ] class VAppBarNavIcon(AbstractElement): """ Vuetify's VAppBarNavIcon component. See more info and examples |VAppBarNavIcon_vuetify_link|. .. |VAppBarNavIcon_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-app-bar-nav-icon" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-app-bar-nav-icon", children, **kwargs) class VAppBarTitle(AbstractElement): """ Vuetify's VAppBarTitle component. See more info and examples |VAppBarTitle_vuetify_link|. .. |VAppBarTitle_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-app-bar-title" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-app-bar-title", children, **kwargs) class VAlert(AbstractElement): """ Vuetify's VAlert component. See more info and examples |VAlert_vuetify_link|. .. |VAlert_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-alert" target="_blank">here</a> :param border: Puts a border on the alert. Accepts **top** \| **right** \| **bottom** \| **left**. :type string: :param close_icon: Change the default icon used for **dismissible** alerts. :type string: :param close_label: See description |VAlert_vuetify_link|. :type string: :param color: See description |VAlert_vuetify_link|. :type string: :param colored_border: Applies the defined **color** to the alert's border. :type boolean: :param dark: See description |VAlert_vuetify_link|. :type boolean: :param dense: Decreases component's height. :type boolean: :param dismissible: Adds a close icon that can hide the alert. :type boolean: :param elevation: See description |VAlert_vuetify_link|. :type ['number', 'string']: :param height: Sets the height for the component. :type ['number', 'string']: :param icon: Designates a specific icon. :type ['boolean', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param mode: See description |VAlert_vuetify_link|. :type string: :param origin: See description |VAlert_vuetify_link|. :type string: :param outlined: Makes the background transparent and applies a thin border. :type boolean: :param prominent: Displays a larger vertically centered icon to draw more attention. :type boolean: :param rounded: See description |VAlert_vuetify_link|. :type ['boolean', 'string']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param text: Applies the defined **color** to text and a low opacity background of the same. :type boolean: :param tile: Removes the component's border-radius. :type boolean: :param transition: See description |VAlert_vuetify_link|. :type string: :param type: Specify a **success**, **info**, **warning** or **error** alert. Uses the contextual color and has a pre-defined icon. :type string: :param value: Controls whether the component is visible or hidden. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: Events :param input: The updated bound model """ def __init__(self, children=None, **kwargs): super().__init__("v-alert", children, **kwargs) self._attr_names += [ "border", "close_icon", "close_label", "color", "colored_border", "dark", "dense", "dismissible", "elevation", "height", "icon", "light", "max_height", "max_width", "min_height", "min_width", "mode", "origin", "outlined", "prominent", "rounded", "shaped", "tag", "text", "tile", "transition", "type", "value", "width", ] self._event_names += [ "input", ] class VAutocomplete(AbstractElement): """ Vuetify's VAutocomplete component. See more info and examples |VAutocomplete_vuetify_link|. .. |VAutocomplete_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-autocomplete" target="_blank">here</a> :param allow_overflow: Allow the menu to overflow off the screen :type boolean: :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param append_outer_icon: Appends an icon to the outside the component's input, uses same syntax as `v-icon` :type string: :param attach: Specifies which DOM element that this component should detach to. String can be any valid querySelector and Object can be any valid Node. This will attach to the root `v-app` component by default. :type any: :param auto_select_first: When searching, will always highlight the first option :type boolean: :param autofocus: Enables autofocus :type boolean: :param background_color: Changes the background-color of the input :type string: :param cache_items: Keeps a local _unique_ copy of all items that have been passed through the **items** prop. :type boolean: :param chips: Changes display of selections to chips :type boolean: :param clear_icon: Applied when using **clearable** and the input is dirty :type string: :param clearable: Add input clear functionality, default icon is Material Design Icons **mdi-clear** :type boolean: :param color: See description |VAutocomplete_vuetify_link|. :type string: :param counter: Creates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation. :type ['boolean', 'number', 'string']: :param counter_value: :type function: :param dark: See description |VAutocomplete_vuetify_link|. :type boolean: :param deletable_chips: Adds a remove icon to selected chips :type boolean: :param dense: Reduces the input height :type boolean: :param disable_lookup: Disables keyboard lookup :type boolean: :param disabled: Disables the input :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param filled: Applies the alternate filled input style :type boolean: :param filter: See description |VAutocomplete_vuetify_link|. :type function: :param flat: Removes elevation (shadow) added to element when using the **solo** or **solo-inverted** props :type boolean: :param full_width: Designates input type as full-width :type boolean: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hide_no_data: Hides the menu when there are no options to show. Useful for preventing the menu from opening before results are fetched asynchronously. Also has the effect of opening the menu when the `items` array changes if not already open. :type boolean: :param hide_selected: Do not display in the select menu items that are already selected :type boolean: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param item_color: Sets color of selected items :type string: :param item_disabled: Set property of **items**'s disabled value :type ['string', 'array', 'function']: :param item_text: Set property of **items**'s text value :type ['string', 'array', 'function']: :param item_value: See description |VAutocomplete_vuetify_link|. :type ['string', 'array', 'function']: :param items: Can be an array of objects or array of strings. When using objects, will look for a text, value and disabled keys. This can be changed using the **item-text**, **item-value** and **item-disabled** props. Objects that have a **header** or **divider** property are considered special cases and generate a list header or divider; these items are not selectable. :type array: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param menu_props: Pass props through to the `v-menu` component. Accepts either a string for boolean props `menu-props="auto, overflowY"`, or an object `:menu-props="{ auto: true, overflowY: true }"` :type ['string', 'array', 'object']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param multiple: Changes select to multiple. Accepts array for value :type boolean: :param no_data_text: Display text when there is no data :type string: :param no_filter: Do not apply filtering when searching. Useful when data is being filtered server side :type boolean: :param open_on_clear: When using the **clearable** prop, once cleared, the select menu will either open or stay open, depending on the current state :type boolean: :param outlined: Applies the outlined style to the input :type boolean: :param persistent_hint: Forces hint to always be visible :type boolean: :param persistent_placeholder: Forces placeholder to always be visible :type boolean: :param placeholder: Sets the input's placeholder text :type string: :param prefix: Displays prefix text :type string: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param prepend_inner_icon: Prepends an icon inside the component's input, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param return_object: Changes the selection behavior to return the object directly rather than the value specified with **item-value** :type boolean: :param reverse: Reverses the input orientation :type boolean: :param rounded: Adds a border radius to the input :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param search_input: Search value. Can be used with `.sync` modifier. :type string: :param shaped: Round if `outlined` and increase `border-radius` if `filled`. Must be used with either `outlined` or `filled` :type boolean: :param single_line: Label does not move on focus/dirty :type boolean: :param small_chips: Changes display of selections to chips with the **small** property :type boolean: :param solo: Changes the style of the input :type boolean: :param solo_inverted: Reduces element opacity until focused :type boolean: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param suffix: Displays suffix text :type string: :param type: Sets input type :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param value_comparator: See description |VAutocomplete_vuetify_link|. :type function: Events :param blur: Emitted when the input is blurred :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_append_outer: Emitted when appended outer icon is clicked :param click_clear: Emitted when clearable icon clicked :param click_prepend: Emitted when prepended icon is clicked :param click_prepend_inner: Emitted when prepended inner icon is clicked :param focus: Emitted when component is focused :param input: The updated bound model :param keydown: Emitted when **any** key is pressed :param update_error: The `error.sync` event :param update_list_index: Emitted when menu item is selected using keyboard arrows :param update_search_input: The `search-input.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-autocomplete", children, **kwargs) self._attr_names += [ "allow_overflow", "append_icon", "append_outer_icon", "attach", "auto_select_first", "autofocus", "background_color", "cache_items", "chips", "clear_icon", "clearable", "color", "counter", "counter_value", # JS functions unimplemented "dark", "deletable_chips", "dense", "disable_lookup", "disabled", "eager", "error", "error_count", "error_messages", "filled", "filter", # JS functions unimplemented "flat", "full_width", "height", "hide_details", "hide_no_data", "hide_selected", "hint", "id", "item_color", "item_disabled", # JS functions unimplemented "item_text", # JS functions unimplemented "item_value", # JS functions unimplemented "items", "label", "light", "loader_height", "loading", "menu_props", "messages", "multiple", "no_data_text", "no_filter", "open_on_clear", "outlined", "persistent_hint", "persistent_placeholder", "placeholder", "prefix", "prepend_icon", "prepend_inner_icon", "readonly", "return_object", "reverse", "rounded", "rules", "search_input", "shaped", "single_line", "small_chips", "solo", "solo_inverted", "success", "success_messages", "suffix", "type", "validate_on_blur", "value", "value_comparator", # JS functions unimplemented ] self._event_names += [ "blur", "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_append_outer", "click:append-outer"), ("click_clear", "click:clear"), ("click_prepend", "click:prepend"), ("click_prepend_inner", "click:prepend-inner"), "focus", "input", "keydown", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ("update_list_index", "update:list-index"), ("update_search_input", "update:search-input"), ] class VAvatar(AbstractElement): """ Vuetify's VAvatar component. See more info and examples |VAvatar_vuetify_link|. .. |VAvatar_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-avatar" target="_blank">here</a> :param color: See description |VAvatar_vuetify_link|. :type string: :param height: Sets the height for the component. :type ['number', 'string']: :param left: See description |VAvatar_vuetify_link|. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param right: See description |VAvatar_vuetify_link|. :type boolean: :param rounded: See description |VAvatar_vuetify_link|. :type ['boolean', 'string']: :param size: Sets the height and width of the component. :type ['number', 'string']: :param tile: Removes the component's **border-radius**. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-avatar", children, **kwargs) self._attr_names += [ "color", "height", "left", "max_height", "max_width", "min_height", "min_width", "right", "rounded", "size", "tile", "width", ] class VBadge(AbstractElement): """ Vuetify's VBadge component. See more info and examples |VBadge_vuetify_link|. .. |VBadge_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-badge" target="_blank">here</a> :param avatar: Removes badge padding for the use of the `v-avatar` in the **badge** slot. :type boolean: :param bordered: Applies a **2px** by default and **1.5px** border around the badge when using the **dot** property. :type boolean: :param bottom: Aligns the component towards the bottom. :type boolean: :param color: See description |VBadge_vuetify_link|. :type string: :param content: Any content you want injected as text into the badge. :type any: :param dark: See description |VBadge_vuetify_link|. :type boolean: :param dot: Reduce the size of the badge and hide its contents :type boolean: :param icon: Designates a specific icon used in the badge. :type string: :param inline: Moves the badge to be inline with the wrapping element. Supports the usage of the **left** prop. :type boolean: :param label: The **aria-label** used for the badge :type string: :param left: Aligns the component towards the left. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mode: See description |VBadge_vuetify_link|. :type string: :param offset_x: Offset the badge on the x-axis. :type ['number', 'string']: :param offset_y: Offset the badge on the y-axis. :type ['number', 'string']: :param origin: See description |VBadge_vuetify_link|. :type string: :param overlap: Overlaps the slotted content on top of the component. :type boolean: :param tile: Removes the component's border-radius. :type boolean: :param transition: See description |VBadge_vuetify_link|. :type string: :param value: Controls whether the component is visible or hidden. :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-badge", children, **kwargs) self._attr_names += [ "avatar", "bordered", "bottom", "color", "content", "dark", "dot", "icon", "inline", "label", "left", "light", "mode", "offset_x", "offset_y", "origin", "overlap", "tile", "transition", "value", ] class VBanner(AbstractElement): """ Vuetify's VBanner component. See more info and examples |VBanner_vuetify_link|. .. |VBanner_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-banner" target="_blank">here</a> :param app: When used inside of `v-main`, will calculate top based upon application `v-toolbar` and `v-system-bar`. :type boolean: :param color: See description |VBanner_vuetify_link|. :type string: :param dark: See description |VBanner_vuetify_link|. :type boolean: :param elevation: See description |VBanner_vuetify_link|. :type ['number', 'string']: :param height: Sets the height for the component. :type ['number', 'string']: :param icon: Designates a specific icon. :type string: :param icon_color: Designates a specific icon color. :type string: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param mobile_breakpoint: Sets the designated mobile breakpoint for the component. :type ['number', 'string']: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param rounded: See description |VBanner_vuetify_link|. :type ['boolean', 'string']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param single_line: Forces the banner onto a single line. :type boolean: :param sticky: See description |VBanner_vuetify_link|. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param tile: Removes the component's **border-radius**. :type boolean: :param value: Controls whether the component is visible or hidden. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-banner", children, **kwargs) self._attr_names += [ "app", "color", "dark", "elevation", "height", "icon", "icon_color", "light", "max_height", "max_width", "min_height", "min_width", "mobile_breakpoint", "outlined", "rounded", "shaped", "single_line", "sticky", "tag", "tile", "value", "width", ] class VBottomNavigation(AbstractElement): """ Vuetify's VBottomNavigation component. See more info and examples |VBottomNavigation_vuetify_link|. .. |VBottomNavigation_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-bottom-navigation" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param active_class: See description |VBottomNavigation_vuetify_link|. :type string: :param app: See description |VBottomNavigation_vuetify_link|. :type boolean: :param background_color: Changes the background-color for the component. :type string: :param color: See description |VBottomNavigation_vuetify_link|. :type string: :param dark: See description |VBottomNavigation_vuetify_link|. :type boolean: :param fixed: Applies **position: fixed** to the component. :type boolean: :param grow: See description |VBottomNavigation_vuetify_link|. :type boolean: :param height: Sets the height for the component. :type ['number', 'string']: :param hide_on_scroll: Will transition the navigation off screen when scrolling up. :type boolean: :param horizontal: See description |VBottomNavigation_vuetify_link|. :type boolean: :param input_value: Controls whether the component is visible or hidden. Supports the **.sync** modifier. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param scroll_target: Designates the element to target for scrolling events. Uses `window` by default. :type string: :param scroll_threshold: The amount of scroll distance down before **hide-on-scroll** activates. :type ['string', 'number']: :param shift: See description |VBottomNavigation_vuetify_link|. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param value: See description |VBottomNavigation_vuetify_link|. :type any: :param width: Sets the width for the component. :type ['number', 'string']: Events :param change: The value of currently selected button. If no value is assigned, will be the current index of the button. :param update_input_value: The event used for `input-value.sync`. """ def __init__(self, children=None, **kwargs): super().__init__("v-bottom-navigation", children, **kwargs) self._attr_names += [ "absolute", "active_class", "app", "background_color", "color", "dark", "fixed", "grow", "height", "hide_on_scroll", "horizontal", "input_value", "light", "mandatory", "max_height", "max_width", "min_height", "min_width", "scroll_target", "scroll_threshold", "shift", "tag", "value", "width", ] self._event_names += [ "change", ("update_input_value", "update:input-value"), ] class VBottomSheet(AbstractElement): """ Vuetify's VBottomSheet component. See more info and examples |VBottomSheet_vuetify_link|. .. |VBottomSheet_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-bottom-sheet" target="_blank">here</a> :param activator: Designate a custom activator when the `activator` slot is not used. String can be any valid querySelector and Object can be any valid Node. :type any: :param attach: Specifies which DOM element that this component should detach to. String can be any valid querySelector and Object can be any valid Node. This will attach to the root `v-app` component by default. :type any: :param close_delay: Milliseconds to wait before closing component. :type ['number', 'string']: :param content_class: Applies a custom class to the detached element. This is useful because the content is moved to the beginning of the `v-app` component (unless the **attach** prop is provided) and is not targetable by classes passed directly on the component. :type string: :param dark: See description |VBottomSheet_vuetify_link|. :type boolean: :param disabled: Disables the ability to open the component. :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param fullscreen: Changes layout for fullscreen display. :type boolean: :param hide_overlay: Hides the display of the overlay. :type boolean: :param inset: Reduces the sheet content maximum width to 70%. :type boolean: :param internal_activator: Detaches the menu content inside of the component as opposed to the document. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param max_width: Sets the maximum width for the component. :type ['string', 'number']: :param no_click_animation: Disables the bounce effect when clicking outside of a `v-dialog`'s content when using the **persistent** prop. :type boolean: :param open_delay: Milliseconds to wait before opening component. :type ['number', 'string']: :param open_on_focus: :type boolean: :param open_on_hover: Designates whether component should activate when its activator is hovered. :type boolean: :param origin: See description |VBottomSheet_vuetify_link|. :type string: :param overlay_color: Sets the overlay color. :type string: :param overlay_opacity: Sets the overlay opacity. :type ['number', 'string']: :param persistent: Clicking outside of the element or pressing **esc** key will not deactivate it. :type boolean: :param retain_focus: Tab focus will return to the first child of the dialog by default. Disable this when using external tools that require focus such as TinyMCE or vue-clipboard. :type boolean: :param return_value: :type any: :param scrollable: See description |VBottomSheet_vuetify_link|. :type boolean: :param transition: See description |VBottomSheet_vuetify_link|. :type string: :param value: Controls whether the component is visible or hidden. :type any: :param width: Sets the width for the component. :type ['string', 'number']: """ def __init__(self, children=None, **kwargs): super().__init__("v-bottom-sheet", children, **kwargs) self._attr_names += [ "activator", "attach", "close_delay", "content_class", "dark", "disabled", "eager", "fullscreen", "hide_overlay", "inset", "internal_activator", "light", "max_width", "no_click_animation", "open_delay", "open_on_focus", "open_on_hover", "origin", "overlay_color", "overlay_opacity", "persistent", "retain_focus", "return_value", "scrollable", "transition", "value", "width", ] class VBreadcrumbs(AbstractElement): """ Vuetify's VBreadcrumbs component. See more info and examples |VBreadcrumbs_vuetify_link|. .. |VBreadcrumbs_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-breadcrumbs" target="_blank">here</a> :param dark: See description |VBreadcrumbs_vuetify_link|. :type boolean: :param divider: Specifies the dividing character between items. :type string: :param items: An array of objects for each breadcrumb. :type array: :param large: Increase the font-size of the breadcrumb item text to 16px (14px default). :type boolean: :param light: Applies the light theme variant to the component. :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-breadcrumbs", children, **kwargs) self._attr_names += [ "dark", "divider", "items", "large", "light", ] class VBreadcrumbsItem(AbstractElement): """ Vuetify's VBreadcrumbsItem component. See more info and examples |VBreadcrumbsItem_vuetify_link|. .. |VBreadcrumbsItem_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-breadcrumbs-item" target="_blank">here</a> :param active_class: See description |VBreadcrumbsItem_vuetify_link|. :type string: :param append: See description |VBreadcrumbsItem_vuetify_link|. :type boolean: :param disabled: Removes the ability to click or target the component. :type boolean: :param exact: See description |VBreadcrumbsItem_vuetify_link|. :type boolean: :param exact_active_class: See description |VBreadcrumbsItem_vuetify_link|. :type string: :param exact_path: See description |VBreadcrumbsItem_vuetify_link|. :type boolean: :param href: Designates the component as anchor and applies the **href** attribute. :type ['string', 'object']: :param link: Designates that the component is a link. This is automatic when using the **href** or **to** prop. :type boolean: :param nuxt: See description |VBreadcrumbsItem_vuetify_link|. :type boolean: :param replace: See description |VBreadcrumbsItem_vuetify_link|. :type boolean: :param ripple: See description |VBreadcrumbsItem_vuetify_link|. :type ['boolean', 'object']: :param tag: Specify a custom tag used on the root element. :type string: :param target: Designates the target attribute. This should only be applied when using the **href** prop. :type string: :param to: See description |VBreadcrumbsItem_vuetify_link|. :type ['string', 'object']: """ def __init__(self, children=None, **kwargs): super().__init__("v-breadcrumbs-item", children, **kwargs) self._attr_names += [ "active_class", "append", "disabled", "exact", "exact_active_class", "exact_path", "href", "link", "nuxt", "replace", "ripple", "tag", "target", "to", ] class VBreadcrumbsDivider(AbstractElement): """ Vuetify's VBreadcrumbsDivider component. See more info and examples |VBreadcrumbsDivider_vuetify_link|. .. |VBreadcrumbsDivider_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-breadcrumbs-divider" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-breadcrumbs-divider", children, **kwargs) class VBtn(AbstractElement): """ Vuetify's VBtn component. See more info and examples |VBtn_vuetify_link|. .. |VBtn_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-btn" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param active_class: See description |VBtn_vuetify_link|. :type string: :param append: See description |VBtn_vuetify_link|. :type boolean: :param block: Expands the button to 100% of available space. :type boolean: :param bottom: Aligns the component towards the bottom. :type boolean: :param color: See description |VBtn_vuetify_link|. :type string: :param dark: See description |VBtn_vuetify_link|. :type boolean: :param depressed: Removes the button box shadow. :type boolean: :param disabled: Removes the ability to click or target the component. :type boolean: :param elevation: See description |VBtn_vuetify_link|. :type ['number', 'string']: :param exact: See description |VBtn_vuetify_link|. :type boolean: :param exact_active_class: See description |VBtn_vuetify_link|. :type string: :param exact_path: See description |VBtn_vuetify_link|. :type boolean: :param fab: Designates the button as a floating-action-button. Button will become _round_. :type boolean: :param fixed: Applies **position: fixed** to the component. :type boolean: :param height: Sets the height for the component. :type ['number', 'string']: :param href: Designates the component as anchor and applies the **href** attribute. :type ['string', 'object']: :param icon: Designates the button as icon. Button will become _round_ and applies the **text** prop. :type boolean: :param input_value: Controls the button's active state. :type any: :param large: Makes the component large. :type boolean: :param left: Aligns the component towards the left. This should be used with the **absolute** or **fixed** props. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param link: Designates that the component is a link. This is automatic when using the **href** or **to** prop. :type boolean: :param loading: Adds a loading icon animation. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param nuxt: See description |VBtn_vuetify_link|. :type boolean: :param outlined: Makes the background transparent and applies a thin border. :type boolean: :param plain: Removes the default background change applied when hovering over the button. :type boolean: :param replace: See description |VBtn_vuetify_link|. :type boolean: :param retain_focus_on_click: Don't blur on click. :type boolean: :param right: Aligns the component towards the right. This should be used with the **absolute** or **fixed** props. :type boolean: :param ripple: See description |VBtn_vuetify_link|. :type ['boolean', 'object']: :param rounded: Applies a large border radius on the button. :type boolean: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param small: Makes the component small. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param target: Designates the target attribute. This should only be applied when using the **href** prop. :type string: :param text: Makes the background transparent. When using the **color** prop, the color will be applied to the button text instead of the background. :type boolean: :param tile: Removes the component's **border-radius**. :type boolean: :param to: See description |VBtn_vuetify_link|. :type ['string', 'object']: :param top: Aligns the content towards the top. :type boolean: :param type: Set the button's **type** attribute. :type string: :param value: Controls whether the component is visible or hidden. :type any: :param width: Sets the width for the component. :type ['number', 'string']: :param x_large: Makes the component extra large. :type boolean: :param x_small: Makes the component extra small. :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-btn", children, **kwargs) self._attr_names += [ "absolute", "active_class", "append", "block", "bottom", "color", "dark", "depressed", "disabled", "elevation", "exact", "exact_active_class", "exact_path", "fab", "fixed", "height", "href", "icon", "input_value", "large", "left", "light", "link", "loading", "max_height", "max_width", "min_height", "min_width", "nuxt", "outlined", "plain", "replace", "retain_focus_on_click", "right", "ripple", "rounded", "shaped", "small", "tag", "target", "text", "tile", "to", "top", "type", "value", "width", "x_large", "x_small", ] self._event_names += [ # click, #Implemented in AbstractElement parent class ] class VBtnToggle(AbstractElement): """ Vuetify's VBtnToggle component. See more info and examples |VBtnToggle_vuetify_link|. .. |VBtnToggle_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-btn-toggle" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param background_color: Changes the background-color for the component. :type string: :param borderless: Removes the group's border. :type boolean: :param color: See description |VBtnToggle_vuetify_link|. :type string: :param dark: See description |VBtnToggle_vuetify_link|. :type boolean: :param dense: Reduces the button size and padding. :type boolean: :param group: See description |VBtnToggle_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param rounded: Round edge buttons :type boolean: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param tile: Removes the component's border-radius. :type boolean: :param value: The designated model value for the component. :type any: Events :param change: Emitted when the input is changed by user interaction """ def __init__(self, children=None, **kwargs): super().__init__("v-btn-toggle", children, **kwargs) self._attr_names += [ "active_class", "background_color", "borderless", "color", "dark", "dense", "group", "light", "mandatory", "max", "multiple", "rounded", "shaped", "tag", "tile", "value", ] self._event_names += [ "change", ] class VCalendar(AbstractElement): """ Vuetify's VCalendar component. See more info and examples |VCalendar_vuetify_link|. .. |VCalendar_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-calendar" target="_blank">here</a> :param categories: Specifies what categories to display in the `category` view. This controls the order of the categories as well. If the calendar uses events any categories specified in those events not specified in this value are dynamically rendered in the view unless `category-hide-dynamic` is true. :type ['array', 'string']: :param category_days: The number of days to render in the `category` view. :type ['number', 'string']: :param category_for_invalid: The category to place events in that have invalid categories. A category is invalid when it is not a string. By default events without a category are not displayed until this value is specified. :type string: :param category_hide_dynamic: Sets whether categories specified in an event should be hidden if it's not defined in `categories`. :type boolean: :param category_show_all: Set whether the `category` view should show all defined `categories` even if there are no events for a category. :type boolean: :param category_text: If categories is a list of objects, you can use this to determine what property to print out as the category text on the calendar. You can provide a function to do some logic or just define the prop name. It's similar to item-text on v-select :type ['string', 'function']: :param color: See description |VCalendar_vuetify_link|. :type string: :param dark: See description |VCalendar_vuetify_link|. :type boolean: :param day_format: Formats day of the month string that appears in a day to a specified locale :type function: :param end: The ending date on the calendar (inclusive) in the format of `YYYY-MM-DD`. This may be ignored depending on the `type` of the calendar. :type ['string', 'number', 'date']: :param event_category: Set property of *event*'s category. Instead of a property a function can be given which takes an event and returns the category. :type ['string', 'function']: :param event_color: A background color for all events or a function which accepts an event object passed to the calendar to return a color. :type ['string', 'function']: :param event_end: Set property of *event*'s end timestamp. :type string: :param event_height: The height of an event in pixels in the `month` view and at the top of the `day` views. :type number: :param event_margin_bottom: Margin bottom for event :type number: :param event_more: Whether the more 'button' is displayed on a calendar with too many events in a given day. It will say something like '5 more' and when clicked generates a `click:more` event. :type boolean: :param event_more_text: The text to display in the more 'button' given the number of hidden events. :type string: :param event_name: Set property of *event*'s displayed name, or a function which accepts an event object passed to the calendar as the first argument and a flag signalling whether the name is for a timed event (true) or an event over a day. :type ['string', 'function']: :param event_overlap_mode: One of `stack`, `column`, or a custom render function :type ['string', 'function']: :param event_overlap_threshold: A value in minutes that's used to determine whether two timed events should be placed in column beside each other or should be treated as slightly overlapping events. :type ['string', 'number']: :param event_ripple: Applies the `v-ripple` directive. :type ['boolean', 'object']: :param event_start: Set property of *event*'s start timestamp. :type string: :param event_text_color: A text color for all events or a function which accepts an event object passed to the calendar to return a color. :type ['string', 'function']: :param event_timed: If Dates or milliseconds are used as the start or end timestamp of an event, this prop can be a string to a property on the event that is truthy if the event is a timed event or a function which takes the event and returns a truthy value if the event is a timed event. :type ['string', 'function']: :param events: An array of event objects with a property for a start timestamp and optionally a name and end timestamp. If an end timestamp is not given, the value of start will be used. If no name is given, you must provide an implementation for the `event` slot. :type array: :param first_interval: The first interval to display in the `day` view. If `intervalMinutes` is set to 60 and this is set to 9 the first time in the view is 9am. :type ['number', 'string']: :param first_time: The first time to display in the `day` view. If specified, this overwrites any `firstInterval` value specified. This can be the number of minutes since midnight, a string in the format of `HH:mm`, or an object with number properties hour and minute. :type ['number', 'string', 'object']: :param hide_header: If the header at the top of the `day` view should be visible. :type boolean: :param interval_count: The number of intervals to display in the `day` view. :type ['number', 'string']: :param interval_format: Formats time of day string that appears in the interval gutter of the `day` and `week` view to specified locale :type function: :param interval_height: The height of an interval in pixels in the `day` view. :type ['number', 'string']: :param interval_minutes: The number of minutes the intervals are in the `day` view. A common interval is 60 minutes so the intervals are an hour. :type ['number', 'string']: :param interval_style: Returns CSS styling to apply to the interval. :type function: :param interval_width: The width of the interval gutter on the left side in the `day` view. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param locale: The locale of the calendar. :type string: :param locale_first_day_of_year: Sets the day that determines the first week of the year, starting with 0 for **Sunday**. For ISO 8601 this should be 4. :type ['string', 'number']: :param max_days: The maximum number of days to display in the custom calendar if an `end` day is not set. :type number: :param min_weeks: The minimum number of weeks to display in the `month` or `week` view. :type any: :param month_format: Formats month string that appears in a day to specified locale :type function: :param now: Override the day & time which is considered now. This is in the format of `YYYY-MM-DD hh:mm:ss`. The calendar is styled according to now. :type string: :param short_intervals: If true, the intervals in the `day` view will be 9 AM as opposed to 09:00 AM :type boolean: :param short_months: Whether the short versions of a month should be used (Jan vs January). :type boolean: :param short_weekdays: Whether the short versions of a weekday should be used (Mon vs Monday). :type boolean: :param show_interval_label: Checks if a given day and time should be displayed in the interval gutter of the `day` view. :type function: :param show_month_on_first: Whether the name of the month should be displayed on the first day of the month. :type boolean: :param show_week: Whether week numbers should be displayed when using the `month` view. :type boolean: :param start: The starting date on the calendar (inclusive) in the format of `YYYY-MM-DD`. This may be ignored depending on the `type` of the calendar. :type ['string', 'number', 'date']: :param type: A string which is one of `month`, `week`, `day`, `4day`, `custom-weekly`, `custom-daily`, and `category`. The custom types look at the `start` and `end` dates passed to the component as opposed to the `value`. :type string: :param value: A date in the format of `YYYY-MM-DD` which determines what span of time for the calendar. :type ['string', 'number', 'date']: :param weekday_format: Formats day of the week string that appears in the header to specified locale :type function: :param weekdays: Specifies which days of the week to display. To display Monday through Friday only, a value of `[1, 2, 3, 4, 5]` can be used. To display a week starting on Monday a value of `[1, 2, 3, 4, 5, 6, 0]` can be used. :type ['array', 'string']: Events :param change: The range of days displayed on the calendar changed. This is triggered on initialization. The event passed is an object with start and end date objects. :param click_date: The click event on the day of the month link. The event passed is the day & time object. :param click_day: The click event on a day. The event passed is the day object. :param click_day_category: The click event on a day in the `category` view. The event passed is the day object. :param click_event: The click event on a specific event. The event passed is the day & time object. :param click_interval: The click event at a specific interval label in the `day` view. The event passed is the day & time object. :param click_more: The click event on the `X more` button on views with too many events in a day. :param click_time: The click event at a specific time in the `day` view. The event passed is the day & time object. :param click_time_category: The click event at a specific time in the `category` view. The event passed is the day & time object. :param contextmenu_date: The right-click event on the day of the month link. The event passed is the day & time object. :param contextmenu_day: The right-click event on a day. The event passed is the day object. :param contextmenu_day_category: The right-click event on a day in the `category` view. The event passed is the day object. :param contextmenu_event: The right-click event on an event. The event passed is the day & time object. :param contextmenu_interval: The right-click event at a specific interval label in the `day` view. The event passed is the day & time object. :param contextmenu_time: The right-click event at a specific time in the `day` view. The event passed is the day & time object. :param contextmenu_time_category: The right-click event at a specific time in the `category` view. The event passed is the day & time object. :param input: An alias to the `click:date` event used to support v-model. :param mousedown_day: The mousedown event on a day. The event passed is the day object. :param mousedown_day_category: The mousedown event on a day in the `category` view. The event passed is the day object. :param mousedown_event: The mousedown event on an event. The event passed is the day & time object. :param mousedown_interval: The mousedown event at a specific interval label in the `day` view. The event passed is the day & time object. :param mousedown_time: The mousedown event at a specific time in the `day` view. The event passed is the day & time object. :param mousedown_time_category: The mousedown event at a specific time in the `category` view. The event passed is the day & time object. :param mouseenter_day: The mouseenter event on a day. The event passed is the day object. :param mouseenter_day_category: The mouseenter event on a day in the `category` view. The event passed is the day object. :param mouseenter_event: The mouseenter event on an event. The event passed is the day & time object. :param mouseenter_interval: The mouseenter event at a specific interval label in the `day` view. The event passed is the day & time object. :param mouseenter_time: The mouseenter event at a specific time in the `day` view. The event passed is the day & time object. :param mouseenter_time_category: The mouseenter event at a specific time in the `category` view. The event passed is the day & time object. :param mouseleave_day: The mouseleave event on a day. The event passed is the day object. :param mouseleave_day_category: The mouseleave event on a day in the `category` view. The event passed is the day object. :param mouseleave_event: The mouseleave event on an event. The event passed is the day & time object. :param mouseleave_interval: The mouseleave event at a specific interval label in the `day` view. The event passed is the day & time object. :param mouseleave_time: The mouseleave event at a specific time in the `day` view. The event passed is the day & time object. :param mouseleave_time_category: The mouseleave event at a specific time in the `category` view. The event passed is the day & time object. :param mousemove_day: The mousemove event on a day. The event passed is the day object. :param mousemove_day_category: The mousemove event on a day in the `category` view. The event passed is the day object. :param mousemove_event: The mousemove event on an event. The event passed is the day & time object. :param mousemove_interval: The mousemove event at a specific interval label in the `day` view. The event passed is the day & time object. :param mousemove_time: The mousemove event at a specific time in the `day` view. The event passed is the day & time object. :param mousemove_time_category: The mousemove event at a specific time in the `category` view. The event passed is the day & time object. :param mouseup_day: The mouseup event on a day. The event passed is the day object. :param mouseup_day_category: The mouseup event on a day in the `category` view. The event passed is the day object. :param mouseup_event: The mouseup event on an event. The event passed is the day & time object. :param mouseup_interval: The mouseup event at a specific interval label in the `day` view. The event passed is the day & time object. :param mouseup_time: The mouseup event at a specific time in the `day` view. The event passed is the day & time object. :param mouseup_time_category: The mouseup event at a specific time in the `category` view. The event passed is the day & time object. :param moved: One of the functions `next`, `prev`, and `move` was called. The event passed is the day object calculated for the movement. :param touchend_day: The touchend event on a day. The event passed is the day object. :param touchend_day_category: The touchend event on a day in the `category` view. The event passed is the day object. :param touchend_event: The touchend event on am view. The event passed is the day & time object. :param touchend_interval: The touchend event at a specific interval label in the `day` view. The event passed is the day & time object. :param touchend_time: The touchend event at a specific time in the `day` view. The event passed is the day & time object. :param touchend_time_category: The touchend event at a specific time in the `category` view. The event passed is the day & time object. :param touchmove_day: The touchmove event on a day. The event passed is the day object. :param touchmove_day_category: The touchmove event on a day in the `category` view. The event passed is the day object. :param touchmove_event: The touchmove event on an `event` view. The event passed is the day & time object. :param touchmove_interval: The touchmove event at a specific interval label in the `day` view. The event passed is the day & time object. :param touchmove_time: The touchmove event at a specific time in the `day` view. The event passed is the day & time object. :param touchmove_time_category: The touchmove event at a specific time in the `category` view. The event passed is the day & time object. :param touchstart_day: The touchstart event on a day. The event passed is the day object. :param touchstart_day_category: The touchstart event on a day in the `category` view. The event passed is the day object. :param touchstart_event: The touchstart event on an event` view. The event passed is the day & time object. :param touchstart_interval: The touchstart event at a specific interval label in the `day` view. The event passed is the day & time object. :param touchstart_time: The touchstart event at a specific time in the `day` view. The event passed is the day & time object. :param touchstart_time_category: The touchstart event at a specific time in the `category` view. The event passed is the day & time object. """ def __init__(self, children=None, **kwargs): super().__init__("v-calendar", children, **kwargs) self._attr_names += [ "categories", "category_days", "category_for_invalid", "category_hide_dynamic", "category_show_all", "category_text", # JS functions unimplemented "color", "dark", "day_format", # JS functions unimplemented "end", "event_category", # JS functions unimplemented "event_color", # JS functions unimplemented "event_end", "event_height", "event_margin_bottom", "event_more", "event_more_text", "event_name", # JS functions unimplemented "event_overlap_mode", # JS functions unimplemented "event_overlap_threshold", "event_ripple", "event_start", "event_text_color", # JS functions unimplemented "event_timed", # JS functions unimplemented "events", "first_interval", "first_time", "hide_header", "interval_count", "interval_format", # JS functions unimplemented "interval_height", "interval_minutes", "interval_style", # JS functions unimplemented "interval_width", "light", "locale", "locale_first_day_of_year", "max_days", "min_weeks", "month_format", # JS functions unimplemented "now", "short_intervals", "short_months", "short_weekdays", "show_interval_label", # JS functions unimplemented "show_month_on_first", "show_week", "start", "type", "value", "weekday_format", # JS functions unimplemented "weekdays", ] self._event_names += [ "change", ("click_date", "click:date"), ("click_day", "click:day"), ("click_day_category", "click:day-category"), ("click_event", "click:event"), ("click_interval", "click:interval"), ("click_more", "click:more"), ("click_time", "click:time"), ("click_time_category", "click:time-category"), ("contextmenu_date", "contextmenu:date"), ("contextmenu_day", "contextmenu:day"), ("contextmenu_day_category", "contextmenu:day-category"), ("contextmenu_event", "contextmenu:event"), ("contextmenu_interval", "contextmenu:interval"), ("contextmenu_time", "contextmenu:time"), ("contextmenu_time_category", "contextmenu:time-category"), "input", ("mousedown_day", "mousedown:day"), ("mousedown_day_category", "mousedown:day-category"), ("mousedown_event", "mousedown:event"), ("mousedown_interval", "mousedown:interval"), ("mousedown_time", "mousedown:time"), ("mousedown_time_category", "mousedown:time-category"), ("mouseenter_day", "mouseenter:day"), ("mouseenter_day_category", "mouseenter:day-category"), ("mouseenter_event", "mouseenter:event"), ("mouseenter_interval", "mouseenter:interval"), ("mouseenter_time", "mouseenter:time"), ("mouseenter_time_category", "mouseenter:time-category"), ("mouseleave_day", "mouseleave:day"), ("mouseleave_day_category", "mouseleave:day-category"), ("mouseleave_event", "mouseleave:event"), ("mouseleave_interval", "mouseleave:interval"), ("mouseleave_time", "mouseleave:time"), ("mouseleave_time_category", "mouseleave:time-category"), ("mousemove_day", "mousemove:day"), ("mousemove_day_category", "mousemove:day-category"), ("mousemove_event", "mousemove:event"), ("mousemove_interval", "mousemove:interval"), ("mousemove_time", "mousemove:time"), ("mousemove_time_category", "mousemove:time-category"), ("mouseup_day", "mouseup:day"), ("mouseup_day_category", "mouseup:day-category"), ("mouseup_event", "mouseup:event"), ("mouseup_interval", "mouseup:interval"), ("mouseup_time", "mouseup:time"), ("mouseup_time_category", "mouseup:time-category"), "moved", ("touchend_day", "touchend:day"), ("touchend_day_category", "touchend:day-category"), ("touchend_event", "touchend:event"), ("touchend_interval", "touchend:interval"), ("touchend_time", "touchend:time"), ("touchend_time_category", "touchend:time-category"), ("touchmove_day", "touchmove:day"), ("touchmove_day_category", "touchmove:day-category"), ("touchmove_event", "touchmove:event"), ("touchmove_interval", "touchmove:interval"), ("touchmove_time", "touchmove:time"), ("touchmove_time_category", "touchmove:time-category"), ("touchstart_day", "touchstart:day"), ("touchstart_day_category", "touchstart:day-category"), ("touchstart_event", "touchstart:event"), ("touchstart_interval", "touchstart:interval"), ("touchstart_time", "touchstart:time"), ("touchstart_time_category", "touchstart:time-category"), ] class VCalendarDaily(AbstractElement): """ Vuetify's VCalendarDaily component. See more info and examples |VCalendarDaily_vuetify_link|. .. |VCalendarDaily_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-calendar-daily" target="_blank">here</a> :param color: See description |VCalendarDaily_vuetify_link|. :type string: :param dark: See description |VCalendarDaily_vuetify_link|. :type boolean: :param day_format: Formats day of the month string that appears in a day to a specified locale :type function: :param end: The ending date on the calendar (inclusive) in the format of `YYYY-MM-DD`. This may be ignored depending on the `type` of the calendar. :type ['string', 'number', 'date']: :param first_interval: The first interval to display in the `day` view. If `intervalMinutes` is set to 60 and this is set to 9 the first time in the view is 9am. :type ['number', 'string']: :param first_time: The first time to display in the `day` view. If specified, this overwrites any `firstInterval` value specified. This can be the number of minutes since midnight, a string in the format of `HH:mm`, or an object with number properties hour and minute. :type ['number', 'string', 'object']: :param hide_header: If the header at the top of the `day` view should be visible. :type boolean: :param interval_count: The number of intervals to display in the `day` view. :type ['number', 'string']: :param interval_format: Formats time of day string that appears in the interval gutter of the `day` and `week` view to specified locale :type function: :param interval_height: The height of an interval in pixels in the `day` view. :type ['number', 'string']: :param interval_minutes: The number of minutes the intervals are in the `day` view. A common interval is 60 minutes so the intervals are an hour. :type ['number', 'string']: :param interval_style: Returns CSS styling to apply to the interval. :type function: :param interval_width: The width of the interval gutter on the left side in the `day` view. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param locale: The locale of the calendar. :type string: :param max_days: The maximum number of days to display in the custom calendar if an `end` day is not set. :type number: :param now: Override the day & time which is considered now. This is in the format of `YYYY-MM-DD hh:mm:ss`. The calendar is styled according to now. :type string: :param short_intervals: If true, the intervals in the `day` view will be 9 AM as opposed to 09:00 AM :type boolean: :param short_weekdays: Whether the short versions of a weekday should be used (Mon vs Monday). :type boolean: :param show_interval_label: Checks if a given day and time should be displayed in the interval gutter of the `day` view. :type function: :param start: The starting date on the calendar (inclusive) in the format of `YYYY-MM-DD`. This may be ignored depending on the `type` of the calendar. :type ['string', 'number', 'date']: :param weekday_format: Formats day of the week string that appears in the header to specified locale :type function: :param weekdays: Specifies which days of the week to display. To display Monday through Friday only, a value of `[1, 2, 3, 4, 5]` can be used. To display a week starting on Monday a value of `[1, 2, 3, 4, 5, 6, 0]` can be used. :type ['array', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-calendar-daily", children, **kwargs) self._attr_names += [ "color", "dark", "day_format", # JS functions unimplemented "end", "first_interval", "first_time", "hide_header", "interval_count", "interval_format", # JS functions unimplemented "interval_height", "interval_minutes", "interval_style", # JS functions unimplemented "interval_width", "light", "locale", "max_days", "now", "short_intervals", "short_weekdays", "show_interval_label", # JS functions unimplemented "start", "weekday_format", # JS functions unimplemented "weekdays", ] class VCalendarWeekly(AbstractElement): """ Vuetify's VCalendarWeekly component. See more info and examples |VCalendarWeekly_vuetify_link|. .. |VCalendarWeekly_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-calendar-weekly" target="_blank">here</a> :param color: See description |VCalendarWeekly_vuetify_link|. :type string: :param dark: See description |VCalendarWeekly_vuetify_link|. :type boolean: :param day_format: Formats day of the month string that appears in a day to a specified locale :type function: :param end: The ending date on the calendar (inclusive) in the format of `YYYY-MM-DD`. This may be ignored depending on the `type` of the calendar. :type ['string', 'number', 'date']: :param hide_header: If the header at the top of the `day` view should be visible. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param locale: The locale of the calendar. :type string: :param locale_first_day_of_year: Sets the day that determines the first week of the year, starting with 0 for **Sunday**. For ISO 8601 this should be 4. :type ['string', 'number']: :param min_weeks: The minimum number of weeks to display in the `month` or `week` view. :type any: :param month_format: Formats month string that appears in a day to specified locale :type function: :param now: Override the day & time which is considered now. This is in the format of `YYYY-MM-DD hh:mm:ss`. The calendar is styled according to now. :type string: :param short_months: Whether the short versions of a month should be used (Jan vs January). :type boolean: :param short_weekdays: Whether the short versions of a weekday should be used (Mon vs Monday). :type boolean: :param show_month_on_first: Whether the name of the month should be displayed on the first day of the month. :type boolean: :param show_week: Whether week numbers should be displayed when using the `month` view. :type boolean: :param start: The starting date on the calendar (inclusive) in the format of `YYYY-MM-DD`. This may be ignored depending on the `type` of the calendar. :type ['string', 'number', 'date']: :param weekday_format: Formats day of the week string that appears in the header to specified locale :type function: :param weekdays: Specifies which days of the week to display. To display Monday through Friday only, a value of `[1, 2, 3, 4, 5]` can be used. To display a week starting on Monday a value of `[1, 2, 3, 4, 5, 6, 0]` can be used. :type ['array', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-calendar-weekly", children, **kwargs) self._attr_names += [ "color", "dark", "day_format", # JS functions unimplemented "end", "hide_header", "light", "locale", "locale_first_day_of_year", "min_weeks", "month_format", # JS functions unimplemented "now", "short_months", "short_weekdays", "show_month_on_first", "show_week", "start", "weekday_format", # JS functions unimplemented "weekdays", ] class VCalendarMonthly(AbstractElement): """ Vuetify's VCalendarMonthly component. See more info and examples |VCalendarMonthly_vuetify_link|. .. |VCalendarMonthly_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-calendar-monthly" target="_blank">here</a> :param color: See description |VCalendarMonthly_vuetify_link|. :type string: :param dark: See description |VCalendarMonthly_vuetify_link|. :type boolean: :param day_format: Formats day of the month string that appears in a day to a specified locale :type function: :param end: The ending date on the calendar (inclusive) in the format of `YYYY-MM-DD`. This may be ignored depending on the `type` of the calendar. :type ['string', 'number', 'date']: :param hide_header: If the header at the top of the `day` view should be visible. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param locale: The locale of the calendar. :type string: :param locale_first_day_of_year: Sets the day that determines the first week of the year, starting with 0 for **Sunday**. For ISO 8601 this should be 4. :type ['string', 'number']: :param min_weeks: The minimum number of weeks to display in the `month` or `week` view. :type any: :param month_format: Formats month string that appears in a day to specified locale :type function: :param now: Override the day & time which is considered now. This is in the format of `YYYY-MM-DD hh:mm:ss`. The calendar is styled according to now. :type string: :param short_months: Whether the short versions of a month should be used (Jan vs January). :type boolean: :param short_weekdays: Whether the short versions of a weekday should be used (Mon vs Monday). :type boolean: :param show_month_on_first: Whether the name of the month should be displayed on the first day of the month. :type boolean: :param show_week: Whether week numbers should be displayed when using the `month` view. :type boolean: :param start: The starting date on the calendar (inclusive) in the format of `YYYY-MM-DD`. This may be ignored depending on the `type` of the calendar. :type ['string', 'number', 'date']: :param weekday_format: Formats day of the week string that appears in the header to specified locale :type function: :param weekdays: Specifies which days of the week to display. To display Monday through Friday only, a value of `[1, 2, 3, 4, 5]` can be used. To display a week starting on Monday a value of `[1, 2, 3, 4, 5, 6, 0]` can be used. :type ['array', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-calendar-monthly", children, **kwargs) self._attr_names += [ "color", "dark", "day_format", # JS functions unimplemented "end", "hide_header", "light", "locale", "locale_first_day_of_year", "min_weeks", "month_format", # JS functions unimplemented "now", "short_months", "short_weekdays", "show_month_on_first", "show_week", "start", "weekday_format", # JS functions unimplemented "weekdays", ] class VCard(AbstractElement): """ Vuetify's VCard component. See more info and examples |VCard_vuetify_link|. .. |VCard_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-card" target="_blank">here</a> :param active_class: See description |VCard_vuetify_link|. :type string: :param append: See description |VCard_vuetify_link|. :type boolean: :param color: See description |VCard_vuetify_link|. :type string: :param dark: See description |VCard_vuetify_link|. :type boolean: :param disabled: Removes the ability to click or target the component. :type boolean: :param elevation: See description |VCard_vuetify_link|. :type ['number', 'string']: :param exact: See description |VCard_vuetify_link|. :type boolean: :param exact_active_class: See description |VCard_vuetify_link|. :type string: :param exact_path: See description |VCard_vuetify_link|. :type boolean: :param flat: Removes the card's elevation. :type boolean: :param height: Sets the height for the component. :type ['number', 'string']: :param hover: See description |VCard_vuetify_link|. :type boolean: :param href: Designates the component as anchor and applies the **href** attribute. :type ['string', 'object']: :param img: See description |VCard_vuetify_link|. :type string: :param light: Applies the light theme variant to the component. :type boolean: :param link: Designates that the component is a link. This is automatic when using the **href** or **to** prop. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param nuxt: See description |VCard_vuetify_link|. :type boolean: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param raised: See description |VCard_vuetify_link|. :type boolean: :param replace: See description |VCard_vuetify_link|. :type boolean: :param ripple: See description |VCard_vuetify_link|. :type ['boolean', 'object']: :param rounded: See description |VCard_vuetify_link|. :type ['boolean', 'string']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param target: Designates the target attribute. This should only be applied when using the **href** prop. :type string: :param tile: Removes the component's **border-radius**. :type boolean: :param to: See description |VCard_vuetify_link|. :type ['string', 'object']: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-card", children, **kwargs) self._attr_names += [ "active_class", "append", "color", "dark", "disabled", "elevation", "exact", "exact_active_class", "exact_path", "flat", "height", "hover", "href", "img", "light", "link", "loader_height", "loading", "max_height", "max_width", "min_height", "min_width", "nuxt", "outlined", "raised", "replace", "ripple", "rounded", "shaped", "tag", "target", "tile", "to", "width", ] self._event_names += [ # click, #Implemented in AbstractElement parent class ] class VCardActions(AbstractElement): """ Vuetify's VCardActions component. See more info and examples |VCardActions_vuetify_link|. .. |VCardActions_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-card-actions" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-card-actions", children, **kwargs) class VCardSubtitle(AbstractElement): """ Vuetify's VCardSubtitle component. See more info and examples |VCardSubtitle_vuetify_link|. .. |VCardSubtitle_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-card-subtitle" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-card-subtitle", children, **kwargs) class VCardText(AbstractElement): """ Vuetify's VCardText component. See more info and examples |VCardText_vuetify_link|. .. |VCardText_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-card-text" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-card-text", children, **kwargs) class VCardTitle(AbstractElement): """ Vuetify's VCardTitle component. See more info and examples |VCardTitle_vuetify_link|. .. |VCardTitle_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-card-title" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-card-title", children, **kwargs) class VCarousel(AbstractElement): """ Vuetify's VCarousel component. See more info and examples |VCarousel_vuetify_link|. .. |VCarousel_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-carousel" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param continuous: Determines whether carousel is continuous :type boolean: :param cycle: Determines if the carousel should cycle through images. :type boolean: :param dark: See description |VCarousel_vuetify_link|. :type boolean: :param delimiter_icon: Sets icon for carousel delimiter :type string: :param height: Sets the height for the component :type ['number', 'string']: :param hide_delimiter_background: Hides the bottom delimiter background. :type boolean: :param hide_delimiters: Hides the carousel's bottom delimiters. :type boolean: :param interval: The duration between image cycles. Requires the **cycle** prop. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param next_icon: The displayed icon for forcing pagination to the next item. :type ['boolean', 'string']: :param prev_icon: The displayed icon for forcing pagination to the previous item. :type ['boolean', 'string']: :param progress: Displays a carousel progress bar. Requires the **cycle** prop and **interval**. :type boolean: :param progress_color: Applies specified color to progress bar. :type string: :param reverse: Reverse the normal transition direction. :type boolean: :param show_arrows: Displays arrows for next/previous navigation. :type boolean: :param show_arrows_on_hover: Displays navigation arrows only when the carousel is hovered over. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param touch: Provide a custom **left** and **right** function when swiped left or right. :type object: :param touchless: Disable touch support. :type boolean: :param value: The designated model value for the component. :type any: :param vertical: Uses a vertical transition when changing windows. :type boolean: :param vertical_delimiters: Displays carousel delimiters vertically. :type string: Events :param change: Emitted when the component value is changed by user interaction """ def __init__(self, children=None, **kwargs): super().__init__("v-carousel", children, **kwargs) self._attr_names += [ "active_class", "continuous", "cycle", "dark", "delimiter_icon", "height", "hide_delimiter_background", "hide_delimiters", "interval", "light", "mandatory", "max", "multiple", "next_icon", "prev_icon", "progress", "progress_color", "reverse", "show_arrows", "show_arrows_on_hover", "tag", "touch", "touchless", "value", "vertical", "vertical_delimiters", ] self._event_names += [ "change", ] class VCarouselItem(AbstractElement): """ Vuetify's VCarouselItem component. See more info and examples |VCarouselItem_vuetify_link|. .. |VCarouselItem_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-carousel-item" target="_blank">here</a> :param active_class: See description |VCarouselItem_vuetify_link|. :type string: :param append: See description |VCarouselItem_vuetify_link|. :type boolean: :param disabled: Removes the ability to click or target the component. :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param exact: See description |VCarouselItem_vuetify_link|. :type boolean: :param exact_active_class: See description |VCarouselItem_vuetify_link|. :type string: :param exact_path: See description |VCarouselItem_vuetify_link|. :type boolean: :param href: Designates the component as anchor and applies the **href** attribute. :type ['string', 'object']: :param link: Designates that the component is a link. This is automatic when using the **href** or **to** prop. :type boolean: :param nuxt: See description |VCarouselItem_vuetify_link|. :type boolean: :param replace: See description |VCarouselItem_vuetify_link|. :type boolean: :param reverse_transition: Sets the reverse transition :type ['boolean', 'string']: :param ripple: See description |VCarouselItem_vuetify_link|. :type ['boolean', 'object']: :param tag: Specify a custom tag used on the root element. :type string: :param target: Designates the target attribute. This should only be applied when using the **href** prop. :type string: :param to: See description |VCarouselItem_vuetify_link|. :type ['string', 'object']: :param transition: See description |VCarouselItem_vuetify_link|. :type ['boolean', 'string']: :param value: The value used when the component is selected in a group. If not provided, the index will be used. :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-carousel-item", children, **kwargs) self._attr_names += [ "active_class", "append", "disabled", "eager", "exact", "exact_active_class", "exact_path", "href", "link", "nuxt", "replace", "reverse_transition", "ripple", "tag", "target", "to", "transition", "value", ] class VCheckbox(AbstractElement): """ Vuetify's VCheckbox component. See more info and examples |VCheckbox_vuetify_link|. .. |VCheckbox_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-checkbox" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param background_color: Changes the background-color of the input :type string: :param color: See description |VCheckbox_vuetify_link|. :type string: :param dark: See description |VCheckbox_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param false_value: Sets value for falsy state :type any: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param indeterminate: Sets an indeterminate state for the checkbox :type boolean: :param indeterminate_icon: The icon used when in an indeterminate state :type string: :param input_value: The **v-model** bound value :type any: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param multiple: Changes expected model to an array :type boolean: :param off_icon: The icon used when inactive :type string: :param on_icon: The icon used when active :type string: :param persistent_hint: Forces hint to always be visible :type boolean: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param ripple: See description |VCheckbox_vuetify_link|. :type ['boolean', 'object']: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param true_value: Sets value for truthy state :type any: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param value_comparator: Apply a custom value comparator function :type function: Events :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_prepend: Emitted when prepended icon is clicked :param update_error: The `error.sync` event :param update_indeterminate: The **indeterminate.sync** event. """ def __init__(self, children=None, **kwargs): super().__init__("v-checkbox", children, **kwargs) self._attr_names += [ "append_icon", "background_color", "color", "dark", "dense", "disabled", "error", "error_count", "error_messages", "false_value", "hide_details", "hint", "id", "indeterminate", "indeterminate_icon", "input_value", "label", "light", "messages", "multiple", "off_icon", "on_icon", "persistent_hint", "prepend_icon", "readonly", "ripple", "rules", "success", "success_messages", "true_value", "validate_on_blur", "value", "value_comparator", # JS functions unimplemented ] self._event_names += [ "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_prepend", "click:prepend"), # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ("update_indeterminate", "update:indeterminate"), ] class VSimpleCheckbox(AbstractElement): """ Vuetify's VSimpleCheckbox component. See more info and examples |VSimpleCheckbox_vuetify_link|. .. |VSimpleCheckbox_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-simple-checkbox" target="_blank">here</a> :param color: See description |VSimpleCheckbox_vuetify_link|. :type string: :param dark: See description |VSimpleCheckbox_vuetify_link|. :type boolean: :param disabled: Disables simple checkbox. :type boolean: :param indeterminate: Sets an indeterminate state for the simple checkbox. :type boolean: :param indeterminate_icon: The icon used when in an indeterminate state. :type string: :param light: Applies the light theme variant to the component. :type boolean: :param off_icon: The icon used when inactive. :type string: :param on_icon: The icon used when active. :type string: :param ripple: See description |VSimpleCheckbox_vuetify_link|. :type boolean: :param value: A boolean value that represents whether the simple checkbox is checked. :type boolean: Events :param input: The updated bound model """ def __init__(self, children=None, **kwargs): super().__init__("v-simple-checkbox", children, **kwargs) self._attr_names += [ "color", "dark", "disabled", "indeterminate", "indeterminate_icon", "light", "off_icon", "on_icon", "ripple", "value", ] self._event_names += [ "input", ] class VChip(AbstractElement): """ Vuetify's VChip component. See more info and examples |VChip_vuetify_link|. .. |VChip_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-chip" target="_blank">here</a> :param active: Determines whether the chip is visible or not. :type boolean: :param active_class: See description |VChip_vuetify_link|. :type string: :param append: See description |VChip_vuetify_link|. :type boolean: :param close: Adds remove button :type boolean: :param close_icon: Change the default icon used for **close** chips :type string: :param close_label: See description |VChip_vuetify_link|. :type string: :param color: See description |VChip_vuetify_link|. :type string: :param dark: See description |VChip_vuetify_link|. :type boolean: :param disabled: Disables the chip, making it un-selectable :type boolean: :param draggable: Makes the chip draggable :type boolean: :param exact: See description |VChip_vuetify_link|. :type boolean: :param exact_active_class: See description |VChip_vuetify_link|. :type string: :param exact_path: See description |VChip_vuetify_link|. :type boolean: :param filter: Displays a selection icon when selected :type boolean: :param filter_icon: Change the default icon used for **filter** chips :type string: :param href: Designates the component as anchor and applies the **href** attribute. :type ['string', 'object']: :param input_value: Controls the **active** state of the item. This is typically used to highlight the component. :type any: :param label: Removes circle edges :type boolean: :param large: Makes the component large. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param link: Explicitly define the chip as a link :type boolean: :param nuxt: See description |VChip_vuetify_link|. :type boolean: :param outlined: Removes background and applies border and text color :type boolean: :param pill: Remove `v-avatar` padding :type boolean: :param replace: See description |VChip_vuetify_link|. :type boolean: :param ripple: See description |VChip_vuetify_link|. :type ['boolean', 'object']: :param small: Makes the component small. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param target: Designates the target attribute. This should only be applied when using the **href** prop. :type string: :param text_color: Applies a specified color to the control text :type string: :param to: See description |VChip_vuetify_link|. :type ['string', 'object']: :param value: See description |VChip_vuetify_link|. :type any: :param x_large: Makes the component extra large. :type boolean: :param x_small: Makes the component extra small. :type boolean: Events :param click_close: Emitted when close icon is clicked :param input: The updated bound model :param update_active: Emitted when close icon is clicked, sets active to `false` """ def __init__(self, children=None, **kwargs): super().__init__("v-chip", children, **kwargs) self._attr_names += [ "active", "active_class", "append", "close", "close_icon", "close_label", "color", "dark", "disabled", "draggable", "exact", "exact_active_class", "exact_path", "filter", "filter_icon", "href", "input_value", "label", "large", "light", "link", "nuxt", "outlined", "pill", "replace", "ripple", "small", "tag", "target", "text_color", "to", "value", "x_large", "x_small", ] self._event_names += [ # click, #Implemented in AbstractElement parent class ("click_close", "click:close"), "input", ("update_active", "update:active"), ] class VChipGroup(AbstractElement): """ Vuetify's VChipGroup component. See more info and examples |VChipGroup_vuetify_link|. .. |VChipGroup_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-chip-group" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param center_active: Forces the selected chip to be centered :type boolean: :param color: See description |VChipGroup_vuetify_link|. :type string: :param column: Remove horizontal pagination and wrap items as needed :type boolean: :param dark: See description |VChipGroup_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param mobile_breakpoint: Sets the designated mobile breakpoint for the component. :type ['number', 'string']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param next_icon: Specify the icon to use for the next icon :type string: :param prev_icon: Specify the icon to use for the prev icon :type string: :param show_arrows: Force the display of the pagination arrows :type ['boolean', 'string']: :param tag: Specify a custom tag used on the root element. :type string: :param value: The designated model value for the component. :type any: Events :param change: Emitted when the component value is changed by user interaction """ def __init__(self, children=None, **kwargs): super().__init__("v-chip-group", children, **kwargs) self._attr_names += [ "active_class", "center_active", "color", "column", "dark", "light", "mandatory", "max", "mobile_breakpoint", "multiple", "next_icon", "prev_icon", "show_arrows", "tag", "value", ] self._event_names += [ "change", ] class VColorPicker(AbstractElement): """ Vuetify's VColorPicker component. See more info and examples |VColorPicker_vuetify_link|. .. |VColorPicker_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-color-picker" target="_blank">here</a> :param canvas_height: Height of canvas :type ['string', 'number']: :param dark: See description |VColorPicker_vuetify_link|. :type boolean: :param disabled: Disables picker :type boolean: :param dot_size: Changes the size of the selection dot on the canvas :type ['number', 'string']: :param elevation: See description |VColorPicker_vuetify_link|. :type ['number', 'string']: :param flat: Removes elevation :type boolean: :param hide_canvas: Hides canvas :type boolean: :param hide_inputs: Hides inputs :type boolean: :param hide_mode_switch: Hides mode switch :type boolean: :param hide_sliders: Hides sliders :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mode: Sets mode of inputs. Available modes are 'rgba', 'hsla', and 'hexa'. Can be synced with the `.sync` modifier. :type string: :param show_swatches: Displays color swatches :type boolean: :param swatches: Sets the available color swatches to select from - This prop only accepts rgba hex strings :type array: :param swatches_max_height: Sets the maximum height of the swatches section :type ['number', 'string']: :param value: Current color. This can be either a string representing a hex color, or an object representing a RGBA, HSLA, or HSVA value :type ['object', 'string']: :param width: Sets the width of the color picker :type ['number', 'string']: Events :param input: Selected color. Depending on what you passed to the `value` prop this is either a string or an object :param update_color: Selected color. This is the internal representation of the color, containing all values. :param update_mode: Selected mode """ def __init__(self, children=None, **kwargs): super().__init__("v-color-picker", children, **kwargs) self._attr_names += [ "canvas_height", "dark", "disabled", "dot_size", "elevation", "flat", "hide_canvas", "hide_inputs", "hide_mode_switch", "hide_sliders", "light", "mode", "show_swatches", "swatches", "swatches_max_height", "value", "width", ] self._event_names += [ "input", ("update_color", "update:color"), ("update_mode", "update:mode"), ] class VContent(AbstractElement): """ Vuetify's VContent component. See more info and examples |VContent_vuetify_link|. .. |VContent_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-content" target="_blank">here</a> :param tag: Specify a custom tag used on the root element. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-content", children, **kwargs) self._attr_names += [ "tag", ] class VCombobox(AbstractElement): """ Vuetify's VCombobox component. See more info and examples |VCombobox_vuetify_link|. .. |VCombobox_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-combobox" target="_blank">here</a> :param allow_overflow: Allow the menu to overflow off the screen :type boolean: :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param append_outer_icon: Appends an icon to the outside the component's input, uses same syntax as `v-icon` :type string: :param attach: Specifies which DOM element that this component should detach to. String can be any valid querySelector and Object can be any valid Node. This will attach to the root `v-app` component by default. :type any: :param auto_select_first: When searching, will always highlight the first option :type boolean: :param autofocus: Enables autofocus :type boolean: :param background_color: Changes the background-color of the input :type string: :param cache_items: Keeps a local _unique_ copy of all items that have been passed through the **items** prop. :type boolean: :param chips: Changes display of selections to chips :type boolean: :param clear_icon: Applied when using **clearable** and the input is dirty :type string: :param clearable: Add input clear functionality, default icon is Material Design Icons **mdi-clear** :type boolean: :param color: See description |VCombobox_vuetify_link|. :type string: :param counter: Creates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation. :type ['boolean', 'number', 'string']: :param counter_value: :type function: :param dark: See description |VCombobox_vuetify_link|. :type boolean: :param deletable_chips: Adds a remove icon to selected chips :type boolean: :param delimiters: Accepts an array of strings that will trigger a new tag when typing. Does not replace the normal Tab and Enter keys. :type array: :param dense: Reduces the input height :type boolean: :param disable_lookup: Disables keyboard lookup :type boolean: :param disabled: Disables the input :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param filled: Applies the alternate filled input style :type boolean: :param filter: See description |VCombobox_vuetify_link|. :type function: :param flat: Removes elevation (shadow) added to element when using the **solo** or **solo-inverted** props :type boolean: :param full_width: Designates input type as full-width :type boolean: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hide_no_data: Hides the menu when there are no options to show. Useful for preventing the menu from opening before results are fetched asynchronously. Also has the effect of opening the menu when the `items` array changes if not already open. :type boolean: :param hide_selected: Do not display in the select menu items that are already selected :type boolean: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param item_color: Sets color of selected items :type string: :param item_disabled: Set property of **items**'s disabled value :type ['string', 'array', 'function']: :param item_text: Set property of **items**'s text value :type ['string', 'array', 'function']: :param item_value: See description |VCombobox_vuetify_link|. :type ['string', 'array', 'function']: :param items: Can be an array of objects or array of strings. When using objects, will look for a text, value and disabled keys. This can be changed using the **item-text**, **item-value** and **item-disabled** props. Objects that have a **header** or **divider** property are considered special cases and generate a list header or divider; these items are not selectable. :type array: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param menu_props: Pass props through to the `v-menu` component. Accepts either a string for boolean props `menu-props="auto, overflowY"`, or an object `:menu-props="{ auto: true, overflowY: true }"` :type ['string', 'array', 'object']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param multiple: Changes select to multiple. Accepts array for value :type boolean: :param no_data_text: Display text when there is no data :type string: :param no_filter: Do not apply filtering when searching. Useful when data is being filtered server side :type boolean: :param open_on_clear: When using the **clearable** prop, once cleared, the select menu will either open or stay open, depending on the current state :type boolean: :param outlined: Applies the outlined style to the input :type boolean: :param persistent_hint: Forces hint to always be visible :type boolean: :param persistent_placeholder: Forces placeholder to always be visible :type boolean: :param placeholder: Sets the input's placeholder text :type string: :param prefix: Displays prefix text :type string: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param prepend_inner_icon: Prepends an icon inside the component's input, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param return_object: Changes the selection behavior to return the object directly rather than the value specified with **item-value** :type boolean: :param reverse: Reverses the input orientation :type boolean: :param rounded: Adds a border radius to the input :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param search_input: Search value. Can be used with `.sync` modifier. :type string: :param shaped: Round if `outlined` and increase `border-radius` if `filled`. Must be used with either `outlined` or `filled` :type boolean: :param single_line: Label does not move on focus/dirty :type boolean: :param small_chips: Changes display of selections to chips with the **small** property :type boolean: :param solo: Changes the style of the input :type boolean: :param solo_inverted: Reduces element opacity until focused :type boolean: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param suffix: Displays suffix text :type string: :param type: Sets input type :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param value_comparator: See description |VCombobox_vuetify_link|. :type function: Events :param blur: Emitted when the input is blurred :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_append_outer: Emitted when appended outer icon is clicked :param click_clear: Emitted when clearable icon clicked :param click_prepend: Emitted when prepended icon is clicked :param click_prepend_inner: Emitted when prepended inner icon is clicked :param focus: Emitted when component is focused :param input: The updated bound model :param keydown: Emitted when **any** key is pressed :param update_error: The `error.sync` event :param update_list_index: Emitted when menu item is selected using keyboard arrows :param update_search_input: The `search-input.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-combobox", children, **kwargs) self._attr_names += [ "allow_overflow", "append_icon", "append_outer_icon", "attach", "auto_select_first", "autofocus", "background_color", "cache_items", "chips", "clear_icon", "clearable", "color", "counter", "counter_value", # JS functions unimplemented "dark", "deletable_chips", "delimiters", "dense", "disable_lookup", "disabled", "eager", "error", "error_count", "error_messages", "filled", "filter", # JS functions unimplemented "flat", "full_width", "height", "hide_details", "hide_no_data", "hide_selected", "hint", "id", "item_color", "item_disabled", # JS functions unimplemented "item_text", # JS functions unimplemented "item_value", # JS functions unimplemented "items", "label", "light", "loader_height", "loading", "menu_props", "messages", "multiple", "no_data_text", "no_filter", "open_on_clear", "outlined", "persistent_hint", "persistent_placeholder", "placeholder", "prefix", "prepend_icon", "prepend_inner_icon", "readonly", "return_object", "reverse", "rounded", "rules", "search_input", "shaped", "single_line", "small_chips", "solo", "solo_inverted", "success", "success_messages", "suffix", "type", "validate_on_blur", "value", "value_comparator", # JS functions unimplemented ] self._event_names += [ "blur", "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_append_outer", "click:append-outer"), ("click_clear", "click:clear"), ("click_prepend", "click:prepend"), ("click_prepend_inner", "click:prepend-inner"), "focus", "input", "keydown", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ("update_list_index", "update:list-index"), ("update_search_input", "update:search-input"), ] class VDataIterator(AbstractElement): """ Vuetify's VDataIterator component. See more info and examples |VDataIterator_vuetify_link|. .. |VDataIterator_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-data-iterator" target="_blank">here</a> :param checkbox_color: :type string: :param custom_filter: Function to filter items :type function: :param custom_group: Function used to group items :type function: :param custom_sort: Function used to sort items :type function: :param dark: See description |VDataIterator_vuetify_link|. :type boolean: :param disable_filtering: Disables filtering completely :type boolean: :param disable_pagination: Disables pagination completely :type boolean: :param disable_sort: Disables sorting completely :type boolean: :param expanded: Array of expanded items. Can be used with `.sync` modifier :type array: :param footer_props: See description |VDataIterator_vuetify_link|. :type object: :param group_by: Changes which item property should be used for grouping items. Currently only supports a single grouping in the format: `group` or `['group']`. When using an array, only the first element is considered. Can be used with `.sync` modifier :type ['string', 'array']: :param group_desc: Changes which direction grouping is done. Can be used with `.sync` modifier :type ['boolean', 'array']: :param hide_default_footer: Hides default footer :type boolean: :param item_key: The property on each item that is used as a unique key :type string: :param items: The array of items to display :type array: :param items_per_page: Changes how many items per page should be visible. Can be used with `.sync` modifier. Setting this prop to `-1` will display all items on the page :type number: :param light: Applies the light theme variant to the component. :type boolean: :param loading: If `true` and no items are provided, then a loading text will be shown :type ['boolean', 'string']: :param loading_text: Text shown when `loading` is true and no items are provided :type string: :param locale: See description |VDataIterator_vuetify_link|. :type string: :param mobile_breakpoint: Used to set when to toggle between regular table and mobile view :type ['number', 'string']: :param multi_sort: If `true` then one can sort on multiple properties :type boolean: :param must_sort: If `true` then one can not disable sorting, it will always switch between ascending and descending :type boolean: :param no_data_text: Text shown when no items are provided to the component :type string: :param no_results_text: Text shown when `search` prop is used and there are no results :type string: :param options: :type DataOptions: :param page: :type number: :param search: Text input used to filter items :type string: :param selectable_key: The property on each item that is used to determine if it is selectable or not :type string: :param server_items_length: Used only when data is provided by a server. Should be set to the total amount of items available on server so that pagination works correctly :type number: :param single_expand: Changes expansion mode to single expand :type boolean: :param single_select: Changes selection mode to single select :type boolean: :param sort_by: Changes which item property (or properties) should be used for sort order. Can be used with `.sync` modifier :type ['string', 'array']: :param sort_desc: Changes which direction sorting is done. Can be used with `.sync` modifier :type ['boolean', 'array']: :param value: Used for controlling selected rows :type array: Events :param current_items: :param input: Array of selected items :param item_expanded: Event emitted when an item is expanded or closed :param item_selected: Event emitted when an item is selected or deselected :param page_count: :param pagination: :param toggle_select_all: :param update_expanded: The `.sync` event for `expanded` prop :param update_group_by: :param update_group_desc: :param update_items_per_page: :param update_multi_sort: :param update_must_sort: :param update_options: :param update_page: :param update_sort_by: :param update_sort_desc: """ def __init__(self, children=None, **kwargs): super().__init__("v-data-iterator", children, **kwargs) self._attr_names += [ "checkbox_color", "custom_filter", # JS functions unimplemented "custom_group", # JS functions unimplemented "custom_sort", # JS functions unimplemented "dark", "disable_filtering", "disable_pagination", "disable_sort", "expanded", "footer_props", "group_by", "group_desc", "hide_default_footer", "item_key", "items", "items_per_page", "light", "loading", "loading_text", "locale", "mobile_breakpoint", "multi_sort", "must_sort", "no_data_text", "no_results_text", "options", "page", "search", "selectable_key", "server_items_length", "single_expand", "single_select", "sort_by", "sort_desc", "value", ] self._event_names += [ ("current_items", "current-items"), "input", ("item_expanded", "item-expanded"), ("item_selected", "item-selected"), ("page_count", "page-count"), "pagination", ("toggle_select_all", "toggle-select-all"), ("update_expanded", "update:expanded"), ("update_group_by", "update:group-by"), ("update_group_desc", "update:group-desc"), ("update_items_per_page", "update:items-per-page"), ("update_multi_sort", "update:multi-sort"), ("update_must_sort", "update:must-sort"), ("update_options", "update:options"), ("update_page", "update:page"), ("update_sort_by", "update:sort-by"), ("update_sort_desc", "update:sort-desc"), ] class VDataFooter(AbstractElement): """ Vuetify's VDataFooter component. See more info and examples |VDataFooter_vuetify_link|. .. |VDataFooter_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-data-footer" target="_blank">here</a> :param disable_items_per_page: Disables items-per-page dropdown :type boolean: :param disable_pagination: Disables pagination buttons :type boolean: :param first_icon: First icon :type string: :param items_per_page_all_text: Text for 'All' option in items-per-page dropdown :type string: :param items_per_page_options: Array of options to show in the items-per-page dropdown :type array: :param items_per_page_text: Text for items-per-page dropdown :type string: :param last_icon: Last icon :type string: :param next_icon: Next icon :type string: :param options: DataOptions :type object: :param page_text: :type string: :param pagination: DataPagination :type object: :param prev_icon: Previous icon :type string: :param show_current_page: Show current page number between prev/next icons :type boolean: :param show_first_last_page: Show first/last icons :type boolean: Events :param update_options: The `.sync` event for `options` prop """ def __init__(self, children=None, **kwargs): super().__init__("v-data-footer", children, **kwargs) self._attr_names += [ "disable_items_per_page", "disable_pagination", "first_icon", "items_per_page_all_text", "items_per_page_options", "items_per_page_text", "last_icon", "next_icon", "options", "page_text", "pagination", "prev_icon", "show_current_page", "show_first_last_page", ] self._event_names += [ ("update_options", "update:options"), ] class VDataTable(AbstractElement): """ Vuetify's VDataTable component. See more info and examples |VDataTable_vuetify_link|. .. |VDataTable_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-data-table" target="_blank">here</a> :param calculate_widths: Enables calculation of column widths. `widths` property will be available in select scoped slots :type boolean: :param caption: Set the caption (using `<caption>`) :type string: :param checkbox_color: Set the color of the checkboxes (showSelect must be used) :type string: :param custom_filter: Function to filter items :type function: :param custom_group: Function used to group items :type function: :param custom_sort: Function used to sort items :type function: :param dark: See description |VDataTable_vuetify_link|. :type boolean: :param dense: Decreases the height of rows :type boolean: :param disable_filtering: Disables filtering completely :type boolean: :param disable_pagination: Disables pagination completely :type boolean: :param disable_sort: Disables sorting completely :type boolean: :param expand_icon: Icon used for expand toggle button. :type string: :param expanded: Array of expanded items. Can be used with `.sync` modifier :type array: :param fixed_header: Fixed header to top of table. **NOTE:** Does not work in IE11 :type boolean: :param footer_props: See description |VDataTable_vuetify_link|. :type object: :param group_by: Changes which item property should be used for grouping items. Currently only supports a single grouping in the format: `group` or `['group']`. When using an array, only the first element is considered. Can be used with `.sync` modifier :type ['string', 'array']: :param group_desc: Changes which direction grouping is done. Can be used with `.sync` modifier :type ['boolean', 'array']: :param header_props: See description |VDataTable_vuetify_link|. :type object: :param headers: An array of objects that each describe a header column. See the example below for a definition of all properties :type DataTableHeader[]: :param headers_length: Can be used in combination with `hide-default-header` to specify the number of columns in the table to allow expansion rows and loading bar to function properly :type number: :param height: Set an explicit height of table :type ['number', 'string']: :param hide_default_footer: Hides default footer :type boolean: :param hide_default_header: Hide the default headers :type boolean: :param item_class: Property on supplied `items` that contains item's row class or function that takes an item as an argument and returns the class of corresponding row :type ['string', 'function']: :param item_key: The property on each item that is used as a unique key :type string: :param items: The array of items to display :type array: :param items_per_page: Changes how many items per page should be visible. Can be used with `.sync` modifier. Setting this prop to `-1` will display all items on the page :type number: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: If `true` and no items are provided, then a loading text will be shown :type ['boolean', 'string']: :param loading_text: Text shown when `loading` is true and no items are provided :type string: :param locale: See description |VDataTable_vuetify_link|. :type string: :param mobile_breakpoint: Used to set when to toggle between regular table and mobile view :type ['number', 'string']: :param multi_sort: If `true` then one can sort on multiple properties :type boolean: :param must_sort: If `true` then one can not disable sorting, it will always switch between ascending and descending :type boolean: :param no_data_text: Text shown when no items are provided to the component :type string: :param no_results_text: Text shown when `search` prop is used and there are no results :type string: :param options: :type DataOptions: :param page: :type number: :param search: Text input used to filter items :type string: :param selectable_key: The property on each item that is used to determine if it is selectable or not :type string: :param server_items_length: Used only when data is provided by a server. Should be set to the total amount of items available on server so that pagination works correctly :type number: :param show_expand: Shows the expand toggle in default rows :type boolean: :param show_group_by: Shows the group by toggle in the header and enables grouped rows :type boolean: :param show_select: Shows the select checkboxes in both the header and rows (if using default rows) :type boolean: :param single_expand: Changes expansion mode to single expand :type boolean: :param single_select: Changes selection mode to single select :type boolean: :param sort_by: Changes which item property (or properties) should be used for sort order. Can be used with `.sync` modifier :type ['string', 'array']: :param sort_desc: Changes which direction sorting is done. Can be used with `.sync` modifier :type ['boolean', 'array']: :param value: Used for controlling selected rows :type array: Events :param click_row: Emits when a table row is clicked. This event provides 2 arguments: the first is the item data that was clicked and the second is the other related data provided by the `item` slot. **NOTE:** will not emit when table rows are defined through a slot such as `item` or `body`. :param contextmenu_row: Emits when a table row is right-clicked. The item for the row is included. **NOTE:** will not emit when table rows are defined through a slot such as `item` or `body`. :param current_items: :param dblclick_row: Emits when a table row is double-clicked. The item for the row is included. **NOTE:** will not emit when table rows are defined through a slot such as `item` or `body`. :param input: Array of selected items :param item_expanded: Event emitted when an item is expanded or closed :param item_selected: Event emitted when an item is selected or deselected :param page_count: :param pagination: :param toggle_select_all: :param update_expanded: The `.sync` event for `expanded` prop :param update_group_by: :param update_group_desc: :param update_items_per_page: :param update_multi_sort: :param update_must_sort: :param update_options: :param update_page: :param update_sort_by: :param update_sort_desc: """ def __init__(self, children=None, **kwargs): super().__init__("v-data-table", children, **kwargs) self.ttsSensitive() self._attr_names += [ "calculate_widths", "caption", "checkbox_color", "custom_filter", # JS functions unimplemented "custom_group", # JS functions unimplemented "custom_sort", # JS functions unimplemented "dark", "dense", "disable_filtering", "disable_pagination", "disable_sort", "expand_icon", "expanded", "fixed_header", "footer_props", "group_by", "group_desc", "header_props", "headers", "headers_length", "height", "hide_default_footer", "hide_default_header", "item_class", # JS functions unimplemented "item_key", "items", "items_per_page", "light", "loader_height", "loading", "loading_text", "locale", "mobile_breakpoint", "multi_sort", "must_sort", "no_data_text", "no_results_text", "options", "page", "search", "selectable_key", "server_items_length", "show_expand", "show_group_by", "show_select", "single_expand", "single_select", "sort_by", "sort_desc", "value", ] self._event_names += [ ("click_row", "click:row"), ("contextmenu_row", "contextmenu:row"), ("current_items", "current-items"), ("dblclick_row", "dblclick:row"), "input", ("item_expanded", "item-expanded"), ("item_selected", "item-selected"), ("page_count", "page-count"), "pagination", ("toggle_select_all", "toggle-select-all"), ("update_expanded", "update:expanded"), ("update_group_by", "update:group-by"), ("update_group_desc", "update:group-desc"), ("update_items_per_page", "update:items-per-page"), ("update_multi_sort", "update:multi-sort"), ("update_must_sort", "update:must-sort"), ("update_options", "update:options"), ("update_page", "update:page"), ("update_sort_by", "update:sort-by"), ("update_sort_desc", "update:sort-desc"), ] class VEditDialog(AbstractElement): """ Vuetify's VEditDialog component. See more info and examples |VEditDialog_vuetify_link|. .. |VEditDialog_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-edit-dialog" target="_blank">here</a> :param cancel_text: Sets the default text for the cancel button when using the **large** prop :type any: :param dark: See description |VEditDialog_vuetify_link|. :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param large: Attaches a submit and cancel button to the dialog :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param persistent: Clicking outside or pressing **esc** key will not dismiss the dialog :type boolean: :param return_value: :type any: :param save_text: Sets the default text for the save button when using the **large** prop :type any: :param transition: See description |VEditDialog_vuetify_link|. :type string: Events :param cancel: Emits when editing is canceled :param close: Emits when edit-dialog close button is pressed :param open: Emits when editing is opened :param save: Emits when edit-dialog save button is pressed """ def __init__(self, children=None, **kwargs): super().__init__("v-edit-dialog", children, **kwargs) self._attr_names += [ "cancel_text", "dark", "eager", "large", "light", "persistent", "return_value", "save_text", "transition", ] self._event_names += [ "cancel", "close", "open", "save", ] class VDataTableHeader(AbstractElement): """ Vuetify's VDataTableHeader component. See more info and examples |VDataTableHeader_vuetify_link|. .. |VDataTableHeader_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-data-table-header" target="_blank">here</a> :param checkbox_color: :type string: :param disable_sort: Toggles rendering of sort button :type boolean: :param every_item: Indicates if all items in table are selected :type boolean: :param headers: Array of header items to display :type array: :param mobile: Renders mobile view of headers :type boolean: :param options: Options object. Identical to the one on `v-data-table` :type object: :param show_group_by: Shows group by button :type boolean: :param single_select: Toggles rendering of select-all checkbox :type boolean: :param some_items: Indicates if one or more items in table are selected :type boolean: :param sort_by_text: Sets the label text used by the default sort-by selector when `v-data-table` is rendering the mobile view :type string: :param sort_icon: Icon used for sort button :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-data-table-header", children, **kwargs) self._attr_names += [ "checkbox_color", "disable_sort", "every_item", "headers", "mobile", "options", "show_group_by", "single_select", "some_items", "sort_by_text", "sort_icon", ] class VSimpleTable(AbstractElement): """ Vuetify's VSimpleTable component. See more info and examples |VSimpleTable_vuetify_link|. .. |VSimpleTable_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-simple-table" target="_blank">here</a> :param dark: See description |VSimpleTable_vuetify_link|. :type boolean: :param dense: Decreases paddings to render a dense table :type boolean: :param fixed_header: Sets table header to fixed mode :type boolean: :param height: Sets the height for the component :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-simple-table", children, **kwargs) self._attr_names += [ "dark", "dense", "fixed_header", "height", "light", ] class VDatePicker(AbstractElement): """ Vuetify's VDatePicker component. See more info and examples |VDatePicker_vuetify_link|. .. |VDatePicker_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-date-picker" target="_blank">here</a> :param active_picker: Determines which picker in the date or month picker is being displayed. Allowed values: `'DATE'`, `'MONTH'`, `'YEAR'` :type string: :param allowed_dates: Restricts which dates can be selected :type function: :param color: See description |VDatePicker_vuetify_link|. :type string: :param dark: See description |VDatePicker_vuetify_link|. :type boolean: :param day_format: Allows you to customize the format of the day string that appears in the date table. Called with date (ISO 8601 **date** string) arguments. :type function: :param disabled: Disables interaction with the picker :type boolean: :param elevation: See description |VDatePicker_vuetify_link|. :type ['number', 'string']: :param event_color: Sets the color for event dot. It can be string (all events will have the same color) or `object` where attribute is the event date and value is boolean/color/array of colors for specified date or `function` taking date as a parameter and returning boolean/color/array of colors for that date :type ['array', 'function', 'object', 'string']: :param events: Array of dates or object defining events or colors or function returning boolean/color/array of colors :type ['array', 'function', 'object']: :param first_day_of_week: Sets the first day of the week, starting with 0 for Sunday. :type ['string', 'number']: :param flat: Removes elevation :type boolean: :param full_width: Forces 100% width :type boolean: :param header_color: Defines the header color. If not specified it will use the color defined by <code>color</code> prop or the default picker color :type string: :param header_date_format: Allows you to customize the format of the month string that appears in the header of the calendar. Called with date (ISO 8601 **date** string) arguments. :type function: :param landscape: Orients picker horizontal :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param locale: Sets the locale. Accepts a string with a BCP 47 language tag. :type string: :param locale_first_day_of_year: Sets the day that determines the first week of the year, starting with 0 for **Sunday**. For ISO 8601 this should be 4. :type ['string', 'number']: :param max: Maximum allowed date/month (ISO 8601 format) :type string: :param min: Minimum allowed date/month (ISO 8601 format) :type string: :param month_format: Formatting function used for displaying months in the months table. Called with date (ISO 8601 **date** string) arguments. :type function: :param multiple: Allow the selection of multiple dates :type boolean: :param next_icon: Sets the icon for next month/year button :type string: :param next_month_aria_label: :type string: :param next_year_aria_label: :type string: :param no_title: Hide the picker title :type boolean: :param picker_date: Displayed year/month :type string: :param prev_icon: Sets the icon for previous month/year button :type string: :param prev_month_aria_label: :type string: :param prev_year_aria_label: :type string: :param range: Allow the selection of date range :type boolean: :param reactive: Updates the picker model when changing months/years automatically :type boolean: :param readonly: Makes the picker readonly (doesn't allow to select new date) :type boolean: :param scrollable: Allows changing displayed month with mouse scroll :type boolean: :param selected_items_text: See description |VDatePicker_vuetify_link|. :type string: :param show_adjacent_months: Toggles visibility of days from previous and next months :type boolean: :param show_current: Toggles visibility of the current date/month outline or shows the provided date/month as a current :type ['boolean', 'string']: :param show_week: Toggles visibility of the week numbers in the body of the calendar :type boolean: :param title_date_format: Allows you to customize the format of the date string that appears in the title of the date picker. Called with date (ISO 8601 **date** string) arguments. :type function: :param type: Determines the type of the picker - `date` for date picker, `month` for month picker :type string: :param value: Date picker model (ISO 8601 format, YYYY-mm-dd or YYYY-mm) :type ['array', 'string']: :param weekday_format: Allows you to customize the format of the weekday string that appears in the body of the calendar. Called with date (ISO 8601 **date** string) arguments. :type function: :param width: Width of the picker :type ['number', 'string']: :param year_format: Allows you to customize the format of the year string that appears in the header of the calendar. Called with date (ISO 8601 **date** string) arguments. :type function: :param year_icon: Sets the icon in the year selection button :type string: Events :param change: Reactive date picker emits `input` even when any part of the date (year/month/day) changes, but `change` event is emitted only when the day (for date pickers) or month (for month pickers) changes. If `range` prop is set, date picker emits `change` when both [from, to] are selected. :param input: The updated bound model :param update_active_picker: The `.sync` event for `active-picker` prop :param update_picker_date: The `.sync` event for `picker-date` prop """ def __init__(self, children=None, **kwargs): super().__init__("v-date-picker", children, **kwargs) self._attr_names += [ "active_picker", "allowed_dates", # JS functions unimplemented "color", "dark", "day_format", # JS functions unimplemented "disabled", "elevation", "event_color", # JS functions unimplemented "events", # JS functions unimplemented "first_day_of_week", "flat", "full_width", "header_color", "header_date_format", # JS functions unimplemented "landscape", "light", "locale", "locale_first_day_of_year", "max", "min", "month_format", # JS functions unimplemented "multiple", "next_icon", "next_month_aria_label", "next_year_aria_label", "no_title", "picker_date", "prev_icon", "prev_month_aria_label", "prev_year_aria_label", "range", "reactive", "readonly", "scrollable", "selected_items_text", "show_adjacent_months", "show_current", "show_week", "title_date_format", # JS functions unimplemented "type", "value", "weekday_format", # JS functions unimplemented "width", "year_format", # JS functions unimplemented "year_icon", ] self._event_names += [ ("click_date", "click:date"), ("click_month", "click:month"), ("click_year", "click:year"), ("dblclick_date", "dblclick:date"), ("dblclick_month", "dblclick:month"), ("dblclick_year", "dblclick:year"), ("mousedown_date", "mousedown:date"), ("mousedown_month", "mousedown:month"), ("mousedown_year", "mousedown:year"), ("mouseenter_date", "mouseenter:date"), ("mouseenter_month", "mouseenter:month"), ("mouseenter_year", "mouseenter:year"), ("mouseleave_date", "mouseleave:date"), ("mouseleave_month", "mouseleave:month"), ("mouseleave_year", "mouseleave:year"), ("mousemove_date", "mousemove:date"), ("mousemove_month", "mousemove:month"), ("mousemove_year", "mousemove:year"), ("mouseover_date", "mouseover:date"), ("mouseover_month", "mouseover:month"), ("mouseover_year", "mouseover:year"), ("mouseout_date", "mouseout:date"), ("mouseout_month", "mouseout:month"), ("mouseout_year", "mouseout:year"), ("mouseup_date", "mouseup:date"), ("mouseup_month", "mouseup:month"), ("mouseup_year", "mouseup:year"), ("focus_date", "focus:date"), ("focus_month", "focus:month"), ("focus_year", "focus:year"), ("click_date", "click:date"), ("click_month", "click:month"), ("click_year", "click:year"), ("dblclick_date", "dblclick:date"), ("dblclick_month", "dblclick:month"), ("dblclick_year", "dblclick:year"), ("mousedown_date", "mousedown:date"), ("mousedown_month", "mousedown:month"), ("mousedown_year", "mousedown:year"), ("mouseenter_date", "mouseenter:date"), ("mouseenter_month", "mouseenter:month"), ("mouseenter_year", "mouseenter:year"), ("mouseleave_date", "mouseleave:date"), ("mouseleave_month", "mouseleave:month"), ("mouseleave_year", "mouseleave:year"), ("mousemove_date", "mousemove:date"), ("mousemove_month", "mousemove:month"), ("mousemove_year", "mousemove:year"), ("mouseover_date", "mouseover:date"), ("mouseover_month", "mouseover:month"), ("mouseover_year", "mouseover:year"), ("mouseout_date", "mouseout:date"), ("mouseout_month", "mouseout:month"), ("mouseout_year", "mouseout:year"), ("mouseup_date", "mouseup:date"), ("mouseup_month", "mouseup:month"), ("mouseup_year", "mouseup:year"), ("focus_date", "focus:date"), ("focus_month", "focus:month"), ("focus_year", "focus:year"), ("click_date", "click:date"), ("click_month", "click:month"), ("click_year", "click:year"), ("dblclick_date", "dblclick:date"), ("dblclick_month", "dblclick:month"), ("dblclick_year", "dblclick:year"), ("mousedown_date", "mousedown:date"), ("mousedown_month", "mousedown:month"), ("mousedown_year", "mousedown:year"), ("mouseenter_date", "mouseenter:date"), ("mouseenter_month", "mouseenter:month"), ("mouseenter_year", "mouseenter:year"), ("mouseleave_date", "mouseleave:date"), ("mouseleave_month", "mouseleave:month"), ("mouseleave_year", "mouseleave:year"), ("mousemove_date", "mousemove:date"), ("mousemove_month", "mousemove:month"), ("mousemove_year", "mousemove:year"), ("mouseover_date", "mouseover:date"), ("mouseover_month", "mouseover:month"), ("mouseover_year", "mouseover:year"), ("mouseout_date", "mouseout:date"), ("mouseout_month", "mouseout:month"), ("mouseout_year", "mouseout:year"), ("mouseup_date", "mouseup:date"), ("mouseup_month", "mouseup:month"), ("mouseup_year", "mouseup:year"), ("focus_date", "focus:date"), ("focus_month", "focus:month"), ("focus_year", "focus:year"), "change", "input", ("update_active_picker", "update:active-picker"), ("update_picker_date", "update:picker-date"), ] class VDialog(AbstractElement): """ Vuetify's VDialog component. See more info and examples |VDialog_vuetify_link|. .. |VDialog_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-dialog" target="_blank">here</a> :param activator: Designate a custom activator when the `activator` slot is not used. String can be any valid querySelector and Object can be any valid Node. :type any: :param attach: Specifies which DOM element that this component should detach to. String can be any valid querySelector and Object can be any valid Node. This will attach to the root `v-app` component by default. :type any: :param close_delay: Milliseconds to wait before closing component. :type ['number', 'string']: :param content_class: Applies a custom class to the detached element. This is useful because the content is moved to the beginning of the `v-app` component (unless the **attach** prop is provided) and is not targetable by classes passed directly on the component. :type string: :param dark: See description |VDialog_vuetify_link|. :type boolean: :param disabled: Disables the ability to open the component. :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param fullscreen: Changes layout for fullscreen display. :type boolean: :param hide_overlay: Hides the display of the overlay. :type boolean: :param internal_activator: Detaches the menu content inside of the component as opposed to the document. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param max_width: Sets the maximum width for the component. :type ['string', 'number']: :param no_click_animation: Disables the bounce effect when clicking outside of a `v-dialog`'s content when using the **persistent** prop. :type boolean: :param open_delay: Milliseconds to wait before opening component. :type ['number', 'string']: :param open_on_focus: :type boolean: :param open_on_hover: Designates whether component should activate when its activator is hovered. :type boolean: :param origin: See description |VDialog_vuetify_link|. :type string: :param overlay_color: Sets the overlay color. :type string: :param overlay_opacity: Sets the overlay opacity. :type ['number', 'string']: :param persistent: Clicking outside of the element or pressing **esc** key will not deactivate it. :type boolean: :param retain_focus: Tab focus will return to the first child of the dialog by default. Disable this when using external tools that require focus such as TinyMCE or vue-clipboard. :type boolean: :param return_value: :type any: :param scrollable: See description |VDialog_vuetify_link|. :type boolean: :param transition: See description |VDialog_vuetify_link|. :type ['string', 'boolean']: :param value: Controls whether the component is visible or hidden. :type any: :param width: Sets the width for the component. :type ['string', 'number']: Events :param click_outside: Event that fires when clicking outside an active dialog. :param input: The updated bound model :param keydown: Event that fires when key is pressed. If dialog is active and not using the **persistent** prop, the **esc** key will deactivate it. """ def __init__(self, children=None, **kwargs): super().__init__("v-dialog", children, **kwargs) self._attr_names += [ "activator", "attach", "close_delay", "content_class", "dark", "disabled", "eager", "fullscreen", "hide_overlay", "internal_activator", "light", "max_width", "no_click_animation", "open_delay", "open_on_focus", "open_on_hover", "origin", "overlay_color", "overlay_opacity", "persistent", "retain_focus", "return_value", "scrollable", "transition", "value", "width", ] self._event_names += [ ("click_outside", "click:outside"), "input", "keydown", ] class VDivider(AbstractElement): """ Vuetify's VDivider component. See more info and examples |VDivider_vuetify_link|. .. |VDivider_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-divider" target="_blank">here</a> :param dark: See description |VDivider_vuetify_link|. :type boolean: :param inset: Adds indentation (72px) for **normal** dividers, reduces max height for **vertical**. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param vertical: Displays dividers vertically :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-divider", children, **kwargs) self._attr_names += [ "dark", "inset", "light", "vertical", ] class VExpansionPanels(AbstractElement): """ Vuetify's VExpansionPanels component. See more info and examples |VExpansionPanels_vuetify_link|. .. |VExpansionPanels_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-expansion-panels" target="_blank">here</a> :param accordion: Removes the margin around open panels :type boolean: :param active_class: The **active-class** applied to children when they are activated. :type string: :param dark: See description |VExpansionPanels_vuetify_link|. :type boolean: :param disabled: Disables the entire expansion-panel :type boolean: :param flat: Removes the expansion-panel's elevation and borders :type boolean: :param focusable: Makes the expansion-panel headers focusable :type boolean: :param hover: Applies a background-color shift on hover to expansion panel headers :type boolean: :param inset: Makes the expansion-panel open with a inset style :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param popout: Makes the expansion-panel open with an popout style :type boolean: :param readonly: Makes the entire expansion-panel read only. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param tile: Removes the border-radius :type boolean: :param value: Controls the opened/closed state of content in the expansion-panel. Corresponds to a zero-based index of the currently opened content. If the `multiple` prop (previously `expand` in 1.5.x) is used then it is an array of numbers where each entry corresponds to the index of the opened content. The index order is not relevant. :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-expansion-panels", children, **kwargs) self._attr_names += [ "accordion", "active_class", "dark", "disabled", "flat", "focusable", "hover", "inset", "light", "mandatory", "max", "multiple", "popout", "readonly", "tag", "tile", "value", ] class VExpansionPanel(AbstractElement): """ Vuetify's VExpansionPanel component. See more info and examples |VExpansionPanel_vuetify_link|. .. |VExpansionPanel_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-expansion-panel" target="_blank">here</a> :param active_class: See description |VExpansionPanel_vuetify_link|. :type string: :param disabled: Disables the expansion-panel content :type boolean: :param readonly: Makes the expansion-panel content read only. :type boolean: Events :param change: Toggles the value of the selected panel """ def __init__(self, children=None, **kwargs): super().__init__("v-expansion-panel", children, **kwargs) self._attr_names += [ "active_class", "disabled", "readonly", ] self._event_names += [ "change", # click, #Implemented in AbstractElement parent class ] class VExpansionPanelHeader(AbstractElement): """ Vuetify's VExpansionPanelHeader component. See more info and examples |VExpansionPanelHeader_vuetify_link|. .. |VExpansionPanelHeader_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-expansion-panel-header" target="_blank">here</a> :param color: See description |VExpansionPanelHeader_vuetify_link|. :type string: :param disable_icon_rotate: Removes the icon rotation animation when expanding a panel :type boolean: :param expand_icon: Set the expand action icon :type string: :param hide_actions: Hide the expand icon in the content header :type boolean: :param ripple: See description |VExpansionPanelHeader_vuetify_link|. :type ['boolean', 'object']: """ def __init__(self, children=None, **kwargs): super().__init__("v-expansion-panel-header", children, **kwargs) self._attr_names += [ "color", "disable_icon_rotate", "expand_icon", "hide_actions", "ripple", ] self._event_names += [ # click, #Implemented in AbstractElement parent class ] class VExpansionPanelContent(AbstractElement): """ Vuetify's VExpansionPanelContent component. See more info and examples |VExpansionPanelContent_vuetify_link|. .. |VExpansionPanelContent_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-expansion-panel-content" target="_blank">here</a> :param color: See description |VExpansionPanelContent_vuetify_link|. :type string: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-expansion-panel-content", children, **kwargs) self._attr_names += [ "color", "eager", ] class VFileInput(AbstractElement): """ Vuetify's VFileInput component. See more info and examples |VFileInput_vuetify_link|. .. |VFileInput_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-file-input" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param append_outer_icon: Appends an icon to the outside the component's input, uses same syntax as `v-icon` :type string: :param autofocus: Enables autofocus :type boolean: :param background_color: Changes the background-color of the input :type string: :param chips: Changes display of selections to chips :type boolean: :param clear_icon: Applied when using **clearable** and the input is dirty :type string: :param clearable: Add input clear functionality, default icon is Material Design Icons **mdi-clear** :type boolean: :param color: See description |VFileInput_vuetify_link|. :type string: :param counter: Creates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation. :type ['boolean', 'number', 'string']: :param counter_size_string: See description |VFileInput_vuetify_link|. :type string: :param counter_string: See description |VFileInput_vuetify_link|. :type string: :param counter_value: :type function: :param dark: See description |VFileInput_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param filled: Applies the alternate filled input style :type boolean: :param flat: Removes elevation (shadow) added to element when using the **solo** or **solo-inverted** props :type boolean: :param full_width: Designates input type as full-width :type boolean: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hide_input: Display the icon only without the input (file names) :type boolean: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param multiple: Adds the **multiple** attribute to the input, allowing multiple file selections. :type boolean: :param outlined: Applies the outlined style to the input :type boolean: :param persistent_hint: Forces hint to always be visible :type boolean: :param persistent_placeholder: Forces placeholder to always be visible :type boolean: :param placeholder: Sets the input's placeholder text :type string: :param prefix: Displays prefix text :type string: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param prepend_inner_icon: Prepends an icon inside the component's input, uses the same syntax as `v-icon` :type string: :param reverse: Reverses the input orientation :type boolean: :param rounded: Adds a border radius to the input :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param shaped: Round if `outlined` and increase `border-radius` if `filled`. Must be used with either `outlined` or `filled` :type boolean: :param show_size: Sets the displayed size of selected file(s). When using **true** will default to _1000_ displaying (**kB, MB, GB**) while _1024_ will display (**KiB, MiB, GiB**). :type ['boolean', 'number']: :param single_line: Label does not move on focus/dirty :type boolean: :param small_chips: Changes display of selections to chips with the **small** property :type boolean: :param solo: Changes the style of the input :type boolean: :param solo_inverted: Reduces element opacity until focused :type boolean: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param suffix: Displays suffix text :type string: :param truncate_length: The length of a filename before it is truncated with ellipsis :type ['number', 'string']: :param type: Sets input type :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: See description |VFileInput_vuetify_link|. :type any: Events :param blur: Emitted when the input is blurred :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_append_outer: Emitted when appended outer icon is clicked :param click_clear: Emitted when clearable icon clicked :param click_prepend: Emitted when prepended icon is clicked :param click_prepend_inner: Emitted when prepended inner icon is clicked :param focus: Emitted when component is focused :param input: The updated bound model :param keydown: Emitted when **any** key is pressed :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-file-input", children, **kwargs) self._attr_names += [ "append_icon", "append_outer_icon", "autofocus", "background_color", "chips", "clear_icon", "clearable", "color", "counter", "counter_size_string", "counter_string", "counter_value", # JS functions unimplemented "dark", "dense", "disabled", "error", "error_count", "error_messages", "filled", "flat", "full_width", "height", "hide_details", "hide_input", "hint", "id", "label", "light", "loader_height", "loading", "messages", "multiple", "outlined", "persistent_hint", "persistent_placeholder", "placeholder", "prefix", "prepend_icon", "prepend_inner_icon", "reverse", "rounded", "rules", "shaped", "show_size", "single_line", "small_chips", "solo", "solo_inverted", "success", "success_messages", "suffix", "truncate_length", "type", "validate_on_blur", "value", ] self._event_names += [ "blur", "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_append_outer", "click:append-outer"), ("click_clear", "click:clear"), ("click_prepend", "click:prepend"), ("click_prepend_inner", "click:prepend-inner"), "focus", "input", "keydown", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ] class VFooter(AbstractElement): """ Vuetify's VFooter component. See more info and examples |VFooter_vuetify_link|. .. |VFooter_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-footer" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param app: See description |VFooter_vuetify_link|. :type boolean: :param color: See description |VFooter_vuetify_link|. :type string: :param dark: See description |VFooter_vuetify_link|. :type boolean: :param elevation: See description |VFooter_vuetify_link|. :type ['number', 'string']: :param fixed: Applies **position: fixed** to the component. :type boolean: :param height: Sets the height for the component. :type ['number', 'string']: :param inset: Positions the toolbar offset from an application `v-navigation-drawer` :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param padless: Remove all padding from the footer :type boolean: :param rounded: See description |VFooter_vuetify_link|. :type ['boolean', 'string']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param tile: Removes the component's **border-radius**. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-footer", children, **kwargs) self._attr_names += [ "absolute", "app", "color", "dark", "elevation", "fixed", "height", "inset", "light", "max_height", "max_width", "min_height", "min_width", "outlined", "padless", "rounded", "shaped", "tag", "tile", "width", ] class VForm(AbstractElement): """ Vuetify's VForm component. See more info and examples |VForm_vuetify_link|. .. |VForm_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-form" target="_blank">here</a> :param disabled: Puts all children inputs into a disabled state. :type boolean: :param lazy_validation: If enabled, **value** will always be _true_ unless there are visible validation errors. You can still call `validate()` to manually trigger validation :type boolean: :param readonly: Puts all children inputs into a readonly state. :type boolean: :param value: A boolean value representing the validity of the form. :type boolean: Events :param input: The updated bound model :param submit: Emitted when form is submitted """ def __init__(self, children=None, **kwargs): super().__init__("v-form", children, **kwargs) self._attr_names += [ "disabled", "lazy_validation", "readonly", "value", ] self._event_names += [ "input", "submit", ] class VContainer(AbstractElement): """ Vuetify's VContainer component. See more info and examples |VContainer_vuetify_link|. .. |VContainer_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-container" target="_blank">here</a> :param fluid: Removes viewport maximum-width size breakpoints :type boolean: :param id: Sets the DOM id on the component :type string: :param tag: Specify a custom tag used on the root element. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-container", children, **kwargs) self._attr_names += [ "fluid", "id", "tag", ] class VCol(AbstractElement): """ Vuetify's VCol component. See more info and examples |VCol_vuetify_link|. .. |VCol_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-col" target="_blank">here</a> :param align_self: See description |VCol_vuetify_link|. :type string: :param cols: Sets the default number of columns the component extends. Available options are **1 -> 12** and **auto**. :type ['boolean', 'string', 'number']: :param lg: Changes the number of columns on large and greater breakpoints. :type ['boolean', 'string', 'number']: :param md: Changes the number of columns on medium and greater breakpoints. :type ['boolean', 'string', 'number']: :param offset: Sets the default offset for the column. :type ['string', 'number']: :param offset_lg: Changes the offset of the component on large and greater breakpoints. :type ['string', 'number']: :param offset_md: Changes the offset of the component on medium and greater breakpoints. :type ['string', 'number']: :param offset_sm: Changes the offset of the component on small and greater breakpoints. :type ['string', 'number']: :param offset_xl: Changes the offset of the component on extra large and greater breakpoints. :type ['string', 'number']: :param order: See description |VCol_vuetify_link|. :type ['string', 'number']: :param order_lg: Changes the order of the component on large and greater breakpoints. :type ['string', 'number']: :param order_md: Changes the order of the component on medium and greater breakpoints. :type ['string', 'number']: :param order_sm: Changes the order of the component on small and greater breakpoints. :type ['string', 'number']: :param order_xl: Changes the order of the component on extra large and greater breakpoints. :type ['string', 'number']: :param sm: Changes the number of columns on small and greater breakpoints. :type ['boolean', 'string', 'number']: :param tag: Specify a custom tag used on the root element. :type string: :param xl: Changes the number of columns on extra large and greater breakpoints. :type ['boolean', 'string', 'number']: """ def __init__(self, children=None, **kwargs): super().__init__("v-col", children, **kwargs) self._attr_names += [ "align_self", "cols", "lg", "md", "offset", "offset_lg", "offset_md", "offset_sm", "offset_xl", "order", "order_lg", "order_md", "order_sm", "order_xl", "sm", "tag", "xl", ] class VRow(AbstractElement): """ Vuetify's VRow component. See more info and examples |VRow_vuetify_link|. .. |VRow_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-row" target="_blank">here</a> :param align: See description |VRow_vuetify_link|. :type string: :param align_content: See description |VRow_vuetify_link|. :type string: :param align_content_lg: Changes the **align-content** property on large and greater breakpoints. :type string: :param align_content_md: Changes the **align-content** property on medium and greater breakpoints. :type string: :param align_content_sm: Changes the **align-content** property on small and greater breakpoints. :type string: :param align_content_xl: Changes the **align-content** property on extra large and greater breakpoints. :type string: :param align_lg: Changes the **align-items** property on large and greater breakpoints. :type string: :param align_md: Changes the **align-items** property on medium and greater breakpoints. :type string: :param align_sm: Changes the **align-items** property on small and greater breakpoints. :type string: :param align_xl: Changes the **align-items** property on extra large and greater breakpoints. :type string: :param dense: Reduces the gutter between `v-col`s. :type boolean: :param justify: See description |VRow_vuetify_link|. :type string: :param justify_lg: Changes the **justify-content** property on large and greater breakpoints. :type string: :param justify_md: Changes the **justify-content** property on medium and greater breakpoints. :type string: :param justify_sm: Changes the **justify-content** property on small and greater breakpoints. :type string: :param justify_xl: Changes the **justify-content** property on extra large and greater breakpoints. :type string: :param no_gutters: Removes the gutter between `v-col`s. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-row", children, **kwargs) self._attr_names += [ "align", "align_content", "align_content_lg", "align_content_md", "align_content_sm", "align_content_xl", "align_lg", "align_md", "align_sm", "align_xl", "dense", "justify", "justify_lg", "justify_md", "justify_sm", "justify_xl", "no_gutters", "tag", ] class VSpacer(AbstractElement): """ Vuetify's VSpacer component. See more info and examples |VSpacer_vuetify_link|. .. |VSpacer_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-spacer" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-spacer", children, **kwargs) class VLayout(AbstractElement): """ Vuetify's VLayout component. See more info and examples |VLayout_vuetify_link|. .. |VLayout_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-layout" target="_blank">here</a> :param align_baseline: :type Boolean: :param align_center: :type Boolean: :param align_content_center: :type Boolean: :param align_content_end: :type Boolean: :param align_content_space_around: :type Boolean: :param align_content_space_between: :type Boolean: :param align_content_start: :type Boolean: :param align_end: :type Boolean: :param align_start: :type Boolean: :param column: :type boolean: :param d_{type}: :type Boolean: :param fill_height: :type Boolean: :param id: Sets the DOM id on the component :type string: :param justify_center: :type Boolean: :param justify_end: :type Boolean: :param justify_space_around: :type Boolean: :param justify_space_between: :type Boolean: :param justify_start: :type Boolean: :param reverse: :type boolean: :param row: :type boolean: :param tag: Specify a custom tag used on the root element. :type String: :param wrap: :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-layout", children, **kwargs) self._attr_names += [ "align_baseline", "align_center", "align_content_center", "align_content_end", "align_content_space_around", "align_content_space_between", "align_content_start", "align_end", "align_start", "column", "d_{type}", "fill_height", "id", "justify_center", "justify_end", "justify_space_around", "justify_space_between", "justify_start", "reverse", "row", "tag", "wrap", ] class VFlex(AbstractElement): """ Vuetify's VFlex component. See more info and examples |VFlex_vuetify_link|. .. |VFlex_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-flex" target="_blank">here</a> :param (size)(1_12): :type boolean: :param align_self_baseline: :type boolean: :param align_self_center: :type boolean: :param align_self_end: :type boolean: :param align_self_start: :type boolean: :param grow: :type boolean: :param id: Sets the DOM id on the component :type string: :param offset_(size)(0_12): :type boolean: :param order_(size)(1_12): :type boolean: :param shrink: :type boolean: :param tag: Specify a custom tag used on the root element. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-flex", children, **kwargs) self._attr_names += [ "sm1", "sm2", "sm3", "sm4", "sm5", "sm6", "sm7", "sm8", "sm9", "sm10", "sm11", "sm12", "md1", "md2", "md3", "md4", "md5", "md6", "md7", "md8", "md9", "md10", "md11", "md12", "lg1", "lg2", "lg3", "lg4", "lg5", "lg6", "lg7", "lg8", "lg9", "lg10", "lg11", "lg12", "xl1", "xl2", "xl3", "xl4", "xl5", "xl6", "xl7", "xl8", "xl9", "xl10", "xl11", "xl12", "align_self_baseline", "align_self_center", "align_self_end", "align_self_start", "grow", "id", "offset_sm0", "offset_sm1", "offset_sm2", "offset_sm3", "offset_sm4", "offset_sm5", "offset_sm6", "offset_sm7", "offset_sm8", "offset_sm9", "offset_sm10", "offset_sm11", "offset_sm12", "offset_md0", "offset_md1", "offset_md2", "offset_md3", "offset_md4", "offset_md5", "offset_md6", "offset_md7", "offset_md8", "offset_md9", "offset_md10", "offset_md11", "offset_md12", "offset_lg0", "offset_lg1", "offset_lg2", "offset_lg3", "offset_lg4", "offset_lg5", "offset_lg6", "offset_lg7", "offset_lg8", "offset_lg9", "offset_lg10", "offset_lg11", "offset_lg12", "offset_xl0", "offset_xl1", "offset_xl2", "offset_xl3", "offset_xl4", "offset_xl5", "offset_xl6", "offset_xl7", "offset_xl8", "offset_xl9", "offset_xl10", "offset_xl11", "offset_xl12", "order_sm1", "order_sm2", "order_sm3", "order_sm4", "order_sm5", "order_sm6", "order_sm7", "order_sm8", "order_sm9", "order_sm10", "order_sm11", "order_sm12", "order_md1", "order_md2", "order_md3", "order_md4", "order_md5", "order_md6", "order_md7", "order_md8", "order_md9", "order_md10", "order_md11", "order_md12", "order_lg1", "order_lg2", "order_lg3", "order_lg4", "order_lg5", "order_lg6", "order_lg7", "order_lg8", "order_lg9", "order_lg10", "order_lg11", "order_lg12", "order_xl1", "order_xl2", "order_xl3", "order_xl4", "order_xl5", "order_xl6", "order_xl7", "order_xl8", "order_xl9", "order_xl10", "order_xl11", "order_xl12", "shrink", "tag", ] class VHover(AbstractElement): """ Vuetify's VHover component. See more info and examples |VHover_vuetify_link|. .. |VHover_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-hover" target="_blank">here</a> :param close_delay: Milliseconds to wait before closing component. :type ['number', 'string']: :param disabled: Turns off hover functionality :type boolean: :param open_delay: Milliseconds to wait before opening component. :type ['number', 'string']: :param value: Controls whether the component is visible or hidden. :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-hover", children, **kwargs) self._attr_names += [ "close_delay", "disabled", "open_delay", "value", ] class VIcon(AbstractElement): """ Vuetify's VIcon component. See more info and examples |VIcon_vuetify_link|. .. |VIcon_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-icon" target="_blank">here</a> :param color: See description |VIcon_vuetify_link|. :type string: :param dark: See description |VIcon_vuetify_link|. :type boolean: :param dense: Makes icon smaller (20px) :type boolean: :param disabled: Disable the input :type boolean: :param large: Makes the component large. :type boolean: :param left: Applies appropriate margins to the icon inside of a button when placed to the **left** of another element or text :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param right: Applies appropriate margins to the icon inside of a button when placed to the **right** of another element or text :type boolean: :param size: Specifies a custom font size for the icon :type ['number', 'string']: :param small: Makes the component small. :type boolean: :param tag: Specifies a custom tag to be used :type string: :param x_large: Makes the component extra large. :type boolean: :param x_small: Makes the component extra small. :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-icon", children, **kwargs) self._attr_names += [ "color", "dark", "dense", "disabled", "large", "left", "light", "right", "size", "small", "tag", "x_large", "x_small", ] class VImg(AbstractElement): """ Vuetify's VImg component. See more info and examples |VImg_vuetify_link|. .. |VImg_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-img" target="_blank">here</a> :param alt: Alternate text for screen readers. Leave empty for decorative images :type string: :param aspect_ratio: Calculated as `width/height`, so for a 1920x1080px image this will be `1.7778`. Will be calculated automatically if omitted :type ['string', 'number']: :param contain: Prevents the image from being cropped if it doesn't fit :type boolean: :param content_class: Apply a custom class to the responsive content div. :type string: :param dark: See description |VImg_vuetify_link|. :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param gradient: See description |VImg_vuetify_link|. :type string: :param height: Sets the height for the component. :type ['number', 'string']: :param lazy_src: See description |VImg_vuetify_link|. :type string: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param options: See description |VImg_vuetify_link|. :type object: :param position: See description |VImg_vuetify_link|. :type string: :param sizes: See description |VImg_vuetify_link|. :type string: :param src: The image URL. This prop is mandatory :type ['string', 'object']: :param srcset: See description |VImg_vuetify_link|. :type string: :param transition: The transition to use when switching from `lazy-src` to `src` :type ['boolean', 'string']: :param width: Sets the width for the component. :type ['number', 'string']: Events :param error: Emitted when there is an error :param load: Emitted when image is loaded :param loadstart: Emitted when the image starts to load """ def __init__(self, children=None, **kwargs): super().__init__("v-img", children, **kwargs) self._attr_names += [ "alt", "aspect_ratio", "contain", "content_class", "dark", "eager", "gradient", "height", "lazy_src", "light", "max_height", "max_width", "min_height", "min_width", "options", "position", "sizes", "src", "srcset", "transition", "width", ] self._event_names += [ "error", "load", "loadstart", ] class VInput(AbstractElement): """ Vuetify's VInput component. See more info and examples |VInput_vuetify_link|. .. |VInput_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-input" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param background_color: Changes the background-color of the input :type string: :param color: See description |VInput_vuetify_link|. :type string: :param dark: See description |VInput_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type boolean: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param persistent_hint: Forces hint to always be visible :type boolean: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: Events :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_prepend: Emitted when prepended icon is clicked :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-input", children, **kwargs) self._attr_names += [ "append_icon", "background_color", "color", "dark", "dense", "disabled", "error", "error_count", "error_messages", "height", "hide_details", "hint", "id", "label", "light", "loading", "messages", "persistent_hint", "prepend_icon", "readonly", "rules", "success", "success_messages", "validate_on_blur", "value", ] self._event_names += [ "change", ("click_append", "click:append"), ("click_prepend", "click:prepend"), # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ] class VItem(AbstractElement): """ Vuetify's VItem component. See more info and examples |VItem_vuetify_link|. .. |VItem_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-item" target="_blank">here</a> :param active_class: See description |VItem_vuetify_link|. :type string: :param disabled: Removes the ability to click or target the component. :type boolean: :param value: The value used when the component is selected in a group. If not provided, the index will be used. :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-item", children, **kwargs) self._attr_names += [ "active_class", "disabled", "value", ] class VItemGroup(AbstractElement): """ Vuetify's VItemGroup component. See more info and examples |VItemGroup_vuetify_link|. .. |VItemGroup_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-item-group" target="_blank">here</a> :param active_class: See description |VItemGroup_vuetify_link|. :type string: :param dark: See description |VItemGroup_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param value: The designated model value for the component. :type any: Events :param change: Emitted when the component value is changed by user interaction """ def __init__(self, children=None, **kwargs): super().__init__("v-item-group", children, **kwargs) self._attr_names += [ "active_class", "dark", "light", "mandatory", "max", "multiple", "tag", "value", ] self._event_names += [ "change", ] class VLazy(AbstractElement): """ Vuetify's VLazy component. See more info and examples |VLazy_vuetify_link|. .. |VLazy_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-lazy" target="_blank">here</a> :param height: Sets the height for the component. :type ['number', 'string']: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param options: See description |VLazy_vuetify_link|. :type object: :param tag: Specify a custom tag used on the root element. :type string: :param transition: See description |VLazy_vuetify_link|. :type string: :param value: Controls whether the component is visible or hidden. :type any: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-lazy", children, **kwargs) self._attr_names += [ "height", "max_height", "max_width", "min_height", "min_width", "options", "tag", "transition", "value", "width", ] class VListItemActionText(AbstractElement): """ Vuetify's VListItemActionText component. See more info and examples |VListItemActionText_vuetify_link|. .. |VListItemActionText_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item-action-text" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item-action-text", children, **kwargs) class VListItemContent(AbstractElement): """ Vuetify's VListItemContent component. See more info and examples |VListItemContent_vuetify_link|. .. |VListItemContent_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item-content" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item-content", children, **kwargs) class VListItemTitle(AbstractElement): """ Vuetify's VListItemTitle component. See more info and examples |VListItemTitle_vuetify_link|. .. |VListItemTitle_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item-title" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item-title", children, **kwargs) class VListItemSubtitle(AbstractElement): """ Vuetify's VListItemSubtitle component. See more info and examples |VListItemSubtitle_vuetify_link|. .. |VListItemSubtitle_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item-subtitle" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item-subtitle", children, **kwargs) class VList(AbstractElement): """ Vuetify's VList component. See more info and examples |VList_vuetify_link|. .. |VList_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list" target="_blank">here</a> :param color: See description |VList_vuetify_link|. :type string: :param dark: See description |VList_vuetify_link|. :type boolean: :param dense: Lowers max height of list tiles :type boolean: :param disabled: Disables all children `v-list-item` components :type boolean: :param elevation: See description |VList_vuetify_link|. :type ['number', 'string']: :param expand: Will only collapse when explicitly closed :type boolean: :param flat: Remove the highlighted background on active `v-list-item`s :type boolean: :param height: Sets the height for the component. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param nav: See description |VList_vuetify_link|. :type boolean: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param rounded: Rounds the `v-list-item` edges :type boolean: :param shaped: Provides an alternative active style for `v-list-item`. :type boolean: :param subheader: Removes top padding. Used when previous sibling is a header :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param three_line: See description |VList_vuetify_link|. :type boolean: :param tile: Removes the component's **border-radius**. :type boolean: :param two_line: See description |VList_vuetify_link|. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-list", children, **kwargs) self._attr_names += [ "color", "dark", "dense", "disabled", "elevation", "expand", "flat", "height", "light", "max_height", "max_width", "min_height", "min_width", "nav", "outlined", "rounded", "shaped", "subheader", "tag", "three_line", "tile", "two_line", "width", ] class VListGroup(AbstractElement): """ Vuetify's VListGroup component. See more info and examples |VListGroup_vuetify_link|. .. |VListGroup_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-group" target="_blank">here</a> :param active_class: See description |VListGroup_vuetify_link|. :type string: :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param color: See description |VListGroup_vuetify_link|. :type string: :param disabled: Disables all children `v-list-item` components :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param group: Assign a route namespace. Accepts a string or regexp for determining active state :type ['string', 'regexp']: :param no_action: Removes left padding assigned for action icons from group items :type boolean: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param ripple: See description |VListGroup_vuetify_link|. :type ['boolean', 'object']: :param sub_group: Designate the component as nested list group :type boolean: :param value: Expands / Collapse the list-group :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-list-group", children, **kwargs) self._attr_names += [ "active_class", "append_icon", "color", "disabled", "eager", "group", "no_action", "prepend_icon", "ripple", "sub_group", "value", ] self._event_names += [ # click, #Implemented in AbstractElement parent class ] class VListItem(AbstractElement): """ Vuetify's VListItem component. See more info and examples |VListItem_vuetify_link|. .. |VListItem_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item" target="_blank">here</a> :param active_class: See description |VListItem_vuetify_link|. :type string: :param append: See description |VListItem_vuetify_link|. :type boolean: :param color: Applies specified color to the control when in an **active** state or **input-value** is **true** - it can be the name of material color (for example `success` or `purple`) or css color (`#033` or `rgba(255, 0, 0, 0.5)`) :type string: :param dark: See description |VListItem_vuetify_link|. :type boolean: :param dense: Lowers max height of list tiles :type boolean: :param disabled: Disables the component :type boolean: :param exact: See description |VListItem_vuetify_link|. :type boolean: :param exact_active_class: See description |VListItem_vuetify_link|. :type string: :param exact_path: See description |VListItem_vuetify_link|. :type boolean: :param href: Designates the component as anchor and applies the **href** attribute. :type ['string', 'object']: :param inactive: If set, the list tile will not be rendered as a link even if it has to/href prop or @click handler :type boolean: :param input_value: Controls the **active** state of the item. This is typically used to highlight the component :type any: :param light: Applies the light theme variant to the component. :type boolean: :param link: Designates that the component is a link. This is automatic when using the **href** or **to** prop. :type boolean: :param nuxt: See description |VListItem_vuetify_link|. :type boolean: :param replace: See description |VListItem_vuetify_link|. :type boolean: :param ripple: See description |VListItem_vuetify_link|. :type ['boolean', 'object']: :param selectable: See description |VListItem_vuetify_link|. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param target: Designates the target attribute. This should only be applied when using the **href** prop. :type string: :param three_line: See description |VListItem_vuetify_link|. :type boolean: :param to: See description |VListItem_vuetify_link|. :type ['string', 'object']: :param two_line: See description |VListItem_vuetify_link|. :type boolean: :param value: See description |VListItem_vuetify_link|. :type any: Events :param keydown: """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item", children, **kwargs) self._attr_names += [ "active_class", "append", "color", "dark", "dense", "disabled", "exact", "exact_active_class", "exact_path", "href", "inactive", "input_value", "light", "link", "nuxt", "replace", "ripple", "selectable", "tag", "target", "three_line", "to", "two_line", "value", ] self._event_names += [ # click, #Implemented in AbstractElement parent class "keydown", ] class VListItemAction(AbstractElement): """ Vuetify's VListItemAction component. See more info and examples |VListItemAction_vuetify_link|. .. |VListItemAction_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item-action" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item-action", children, **kwargs) class VListItemAvatar(AbstractElement): """ Vuetify's VListItemAvatar component. See more info and examples |VListItemAvatar_vuetify_link|. .. |VListItemAvatar_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item-avatar" target="_blank">here</a> :param color: See description |VListItemAvatar_vuetify_link|. :type string: :param height: Sets the height for the component. :type ['number', 'string']: :param horizontal: Uses an alternative horizontal style. :type boolean: :param left: See description |VListItemAvatar_vuetify_link|. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param right: See description |VListItemAvatar_vuetify_link|. :type boolean: :param rounded: See description |VListItemAvatar_vuetify_link|. :type ['boolean', 'string']: :param size: Sets the height and width of the component. :type ['number', 'string']: :param tile: Removes the component's **border-radius**. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item-avatar", children, **kwargs) self._attr_names += [ "color", "height", "horizontal", "left", "max_height", "max_width", "min_height", "min_width", "right", "rounded", "size", "tile", "width", ] class VListItemIcon(AbstractElement): """ Vuetify's VListItemIcon component. See more info and examples |VListItemIcon_vuetify_link|. .. |VListItemIcon_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item-icon" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item-icon", children, **kwargs) class VListItemGroup(AbstractElement): """ Vuetify's VListItemGroup component. See more info and examples |VListItemGroup_vuetify_link|. .. |VListItemGroup_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-list-item-group" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param color: See description |VListItemGroup_vuetify_link|. :type string: :param dark: See description |VListItemGroup_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param value: Sets the active list-item inside the list-group :type any: Events :param change: Emitted when the component value is changed by user interaction """ def __init__(self, children=None, **kwargs): super().__init__("v-list-item-group", children, **kwargs) self._attr_names += [ "active_class", "color", "dark", "light", "mandatory", "max", "multiple", "tag", "value", ] self._event_names += [ "change", ] class VMain(AbstractElement): """ Vuetify's VMain component. See more info and examples |VMain_vuetify_link|. .. |VMain_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-main" target="_blank">here</a> :param tag: Specify a custom tag used on the root element. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-main", children, **kwargs) self._attr_names += [ "tag", ] class VMenu(AbstractElement): """ Vuetify's VMenu component. See more info and examples |VMenu_vuetify_link|. .. |VMenu_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-menu" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param activator: Designate a custom activator when the `activator` slot is not used. String can be any valid querySelector and Object can be any valid Node. :type any: :param allow_overflow: Removes overflow re-positioning for the content :type boolean: :param attach: Specifies which DOM element that this component should detach to. String can be any valid querySelector and Object can be any valid Node. This will attach to the root `v-app` component by default. :type any: :param auto: Centers list on selected element :type boolean: :param bottom: Aligns the component towards the bottom. :type boolean: :param close_delay: Milliseconds to wait before closing component. Only works with the **open-on-hover** prop :type ['number', 'string']: :param close_on_click: Designates if menu should close on outside-activator click :type boolean: :param close_on_content_click: Designates if menu should close when its content is clicked :type boolean: :param content_class: Applies a custom class to the detached element. This is useful because the content is moved to the beginning of the `v-app` component (unless the **attach** prop is provided) and is not targetable by classes passed directly on the component. :type string: :param dark: See description |VMenu_vuetify_link|. :type boolean: :param disable_keys: Removes all keyboard interaction :type boolean: :param disabled: Disables the menu :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param fixed: Applies **position: fixed** to the component. :type boolean: :param internal_activator: Detaches the menu content inside of the component as opposed to the document. :type boolean: :param left: Aligns the component towards the left. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the max height of the menu content :type ['number', 'string']: :param max_width: Sets the maximum width for the content :type ['number', 'string']: :param min_width: Sets the minimum width for the content :type ['number', 'string']: :param nudge_bottom: Nudge the content to the bottom :type ['number', 'string']: :param nudge_left: Nudge the content to the left :type ['number', 'string']: :param nudge_right: Nudge the content to the right :type ['number', 'string']: :param nudge_top: Nudge the content to the top :type ['number', 'string']: :param nudge_width: Nudge the content width :type ['number', 'string']: :param offset_overflow: Causes the component to flip to the opposite side when repositioned due to overflow :type boolean: :param offset_x: Offset the menu on the x-axis. Works in conjunction with direction left/right :type boolean: :param offset_y: Offset the menu on the y-axis. Works in conjunction with direction top/bottom :type boolean: :param open_delay: Milliseconds to wait before opening component. Only works with the **open-on-hover** prop :type ['number', 'string']: :param open_on_click: Designates whether menu should open on activator click :type boolean: :param open_on_focus: :type boolean: :param open_on_hover: Designates whether menu should open on activator hover :type boolean: :param origin: See description |VMenu_vuetify_link|. :type string: :param position_x: Used to position the content when not using an activator slot :type number: :param position_y: Used to position the content when not using an activator slot :type number: :param return_value: The value that is updated when the menu is closed - must be primitive. Dot notation is supported :type any: :param right: Aligns the component towards the right. :type boolean: :param rounded: See description |VMenu_vuetify_link|. :type ['boolean', 'string']: :param tile: Removes the component's **border-radius**. :type boolean: :param top: Aligns the content towards the top. :type boolean: :param transition: See description |VMenu_vuetify_link|. :type ['boolean', 'string']: :param value: Controls whether the component is visible or hidden. :type any: :param z_index: The z-index used for the component :type ['number', 'string']: Events :param input: The updated bound model """ def __init__(self, children=None, **kwargs): super().__init__("v-menu", children, **kwargs) self._attr_names += [ "absolute", "activator", "allow_overflow", "attach", "auto", "bottom", "close_delay", "close_on_click", "close_on_content_click", "content_class", "dark", "disable_keys", "disabled", "eager", "fixed", "internal_activator", "left", "light", "max_height", "max_width", "min_width", "nudge_bottom", "nudge_left", "nudge_right", "nudge_top", "nudge_width", "offset_overflow", "offset_x", "offset_y", "open_delay", "open_on_click", "open_on_focus", "open_on_hover", "origin", "position_x", "position_y", "return_value", "right", "rounded", "tile", "top", "transition", "value", "z_index", ] self._event_names += [ "input", ] class VNavigationDrawer(AbstractElement): """ Vuetify's VNavigationDrawer component. See more info and examples |VNavigationDrawer_vuetify_link|. .. |VNavigationDrawer_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-navigation-drawer" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param app: See description |VNavigationDrawer_vuetify_link|. :type boolean: :param bottom: Expands from the bottom of the screen on mobile devices :type boolean: :param clipped: A clipped drawer rests under the application toolbar. **Note:** requires the **clipped-left** or **clipped-right** prop on `v-app-bar` to work as intended :type boolean: :param color: See description |VNavigationDrawer_vuetify_link|. :type string: :param dark: See description |VNavigationDrawer_vuetify_link|. :type boolean: :param disable_resize_watcher: Will automatically open/close drawer when resized depending if mobile or desktop. :type boolean: :param disable_route_watcher: Disables opening of navigation drawer when route changes :type boolean: :param expand_on_hover: Collapses the drawer to a **mini-variant** until hovering with the mouse :type boolean: :param fixed: Applies **position: fixed** to the component. :type boolean: :param floating: A floating drawer has no visible container (no border-right) :type boolean: :param height: Sets the height of the navigation drawer :type ['number', 'string']: :param hide_overlay: Hides the display of the overlay. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mini_variant: Condenses navigation drawer width, also accepts the **.sync** modifier. With this, the drawer will re-open when clicking it :type boolean: :param mini_variant_width: Designates the width assigned when the `mini` prop is turned on :type ['number', 'string']: :param mobile_breakpoint: Sets the designated mobile breakpoint for the component. This will apply alternate styles for mobile devices such as the `temporary` prop, or activate the `bottom` prop when the breakpoint value is met. Setting the value to `0` will disable this functionality. :type ['number', 'string']: :param overlay_color: Sets the overlay color. :type string: :param overlay_opacity: Sets the overlay opacity. :type ['number', 'string']: :param permanent: The drawer remains visible regardless of screen size :type boolean: :param right: Places the navigation drawer on the right :type boolean: :param src: See description |VNavigationDrawer_vuetify_link|. :type ['string', 'object']: :param stateless: Remove all automated state functionality (resize, mobile, route) and manually control the drawer state :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param temporary: A temporary drawer sits above its application and uses a scrim (overlay) to darken the background :type boolean: :param touchless: Disable mobile touch functionality :type boolean: :param value: Controls whether the component is visible or hidden. :type any: :param width: Sets the width for the component. :type ['number', 'string']: Events :param input: The updated bound model :param transitionend: Emits event object when transition is complete. :param update_mini_variant: The `mini-variant.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-navigation-drawer", children, **kwargs) self._attr_names += [ "absolute", "app", "bottom", "clipped", "color", "dark", "disable_resize_watcher", "disable_route_watcher", "expand_on_hover", "fixed", "floating", "height", "hide_overlay", "light", "mini_variant", "mini_variant_width", "mobile_breakpoint", "overlay_color", "overlay_opacity", "permanent", "right", "src", "stateless", "tag", "temporary", "touchless", "value", "width", ] self._event_names += [ "input", "transitionend", ("update_mini_variant", "update:mini-variant"), ] class VOverflowBtn(AbstractElement): """ Vuetify's VOverflowBtn component. See more info and examples |VOverflowBtn_vuetify_link|. .. |VOverflowBtn_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-overflow-btn" target="_blank">here</a> :param allow_overflow: Allow the menu to overflow off the screen :type boolean: :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param append_outer_icon: Appends an icon to the outside the component's input, uses same syntax as `v-icon` :type string: :param attach: Specifies which DOM element that this component should detach to. String can be any valid querySelector and Object can be any valid Node. This will attach to the root `v-app` component by default. :type any: :param auto_select_first: When searching, will always highlight the first option :type boolean: :param autofocus: Enables autofocus :type boolean: :param background_color: Changes the background-color of the input :type string: :param cache_items: Keeps a local _unique_ copy of all items that have been passed through the **items** prop. :type boolean: :param chips: Changes display of selections to chips :type boolean: :param clear_icon: Applied when using **clearable** and the input is dirty :type string: :param clearable: Add input clear functionality, default icon is Material Design Icons **mdi-clear** :type boolean: :param color: See description |VOverflowBtn_vuetify_link|. :type string: :param counter: Creates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation. :type ['boolean', 'number', 'string']: :param counter_value: :type function: :param dark: See description |VOverflowBtn_vuetify_link|. :type boolean: :param deletable_chips: Adds a remove icon to selected chips :type boolean: :param dense: Reduces the input height :type boolean: :param disable_lookup: Disables keyboard lookup :type boolean: :param disabled: Disables the input :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param editable: Creates an editable button :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param filled: Applies the alternate filled input style :type boolean: :param filter: See description |VOverflowBtn_vuetify_link|. :type function: :param flat: Removes elevation (shadow) added to element when using the **solo** or **solo-inverted** props :type boolean: :param full_width: Designates input type as full-width :type boolean: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hide_no_data: Hides the menu when there are no options to show. Useful for preventing the menu from opening before results are fetched asynchronously. Also has the effect of opening the menu when the `items` array changes if not already open. :type boolean: :param hide_selected: Do not display in the select menu items that are already selected :type boolean: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param item_color: Sets color of selected items :type string: :param item_disabled: Set property of **items**'s disabled value :type ['string', 'array', 'function']: :param item_text: Set property of **items**'s text value :type ['string', 'array', 'function']: :param item_value: See description |VOverflowBtn_vuetify_link|. :type ['string', 'array', 'function']: :param items: Can be an array of objects or array of strings. When using objects, will look for a text, value and disabled keys. This can be changed using the **item-text**, **item-value** and **item-disabled** props. Objects that have a **header** or **divider** property are considered special cases and generate a list header or divider; these items are not selectable. :type array: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param menu_props: Pass props through to the `v-menu` component. Accepts either a string for boolean props `menu-props="auto, overflowY"`, or an object `:menu-props="{ auto: true, overflowY: true }"` :type ['string', 'array', 'object']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param multiple: Changes select to multiple. Accepts array for value :type boolean: :param no_data_text: Display text when there is no data :type string: :param no_filter: Do not apply filtering when searching. Useful when data is being filtered server side :type boolean: :param open_on_clear: When using the **clearable** prop, once cleared, the select menu will either open or stay open, depending on the current state :type boolean: :param outlined: Applies the outlined style to the input :type boolean: :param persistent_hint: Forces hint to always be visible :type boolean: :param persistent_placeholder: Forces placeholder to always be visible :type boolean: :param placeholder: Sets the input's placeholder text :type string: :param prefix: Displays prefix text :type string: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param prepend_inner_icon: Prepends an icon inside the component's input, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param return_object: Changes the selection behavior to return the object directly rather than the value specified with **item-value** :type boolean: :param reverse: Reverses the input orientation :type boolean: :param rounded: Adds a border radius to the input :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param search_input: Search value. Can be used with `.sync` modifier. :type string: :param segmented: Creates a segmented button :type boolean: :param shaped: Round if `outlined` and increase `border-radius` if `filled`. Must be used with either `outlined` or `filled` :type boolean: :param single_line: Label does not move on focus/dirty :type boolean: :param small_chips: Changes display of selections to chips with the **small** property :type boolean: :param solo: Changes the style of the input :type boolean: :param solo_inverted: Reduces element opacity until focused :type boolean: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param suffix: Displays suffix text :type string: :param type: Sets input type :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param value_comparator: See description |VOverflowBtn_vuetify_link|. :type function: Events :param blur: Emitted when the input is blurred :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_append_outer: Emitted when appended outer icon is clicked :param click_clear: Emitted when clearable icon clicked :param click_prepend: Emitted when prepended icon is clicked :param click_prepend_inner: Emitted when prepended inner icon is clicked :param focus: Emitted when component is focused :param input: The updated bound model :param keydown: Emitted when **any** key is pressed :param update_error: The `error.sync` event :param update_list_index: Emitted when menu item is selected using keyboard arrows :param update_search_input: The `search-input.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-overflow-btn", children, **kwargs) self._attr_names += [ "allow_overflow", "append_icon", "append_outer_icon", "attach", "auto_select_first", "autofocus", "background_color", "cache_items", "chips", "clear_icon", "clearable", "color", "counter", "counter_value", # JS functions unimplemented "dark", "deletable_chips", "dense", "disable_lookup", "disabled", "eager", "editable", "error", "error_count", "error_messages", "filled", "filter", # JS functions unimplemented "flat", "full_width", "height", "hide_details", "hide_no_data", "hide_selected", "hint", "id", "item_color", "item_disabled", # JS functions unimplemented "item_text", # JS functions unimplemented "item_value", # JS functions unimplemented "items", "label", "light", "loader_height", "loading", "menu_props", "messages", "multiple", "no_data_text", "no_filter", "open_on_clear", "outlined", "persistent_hint", "persistent_placeholder", "placeholder", "prefix", "prepend_icon", "prepend_inner_icon", "readonly", "return_object", "reverse", "rounded", "rules", "search_input", "segmented", "shaped", "single_line", "small_chips", "solo", "solo_inverted", "success", "success_messages", "suffix", "type", "validate_on_blur", "value", "value_comparator", # JS functions unimplemented ] self._event_names += [ "blur", "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_append_outer", "click:append-outer"), ("click_clear", "click:clear"), ("click_prepend", "click:prepend"), ("click_prepend_inner", "click:prepend-inner"), "focus", "input", "keydown", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ("update_list_index", "update:list-index"), ("update_search_input", "update:search-input"), ] class VOverlay(AbstractElement): """ Vuetify's VOverlay component. See more info and examples |VOverlay_vuetify_link|. .. |VOverlay_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-overlay" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param color: See description |VOverlay_vuetify_link|. :type string: :param dark: See description |VOverlay_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param opacity: Sets the overlay opacity :type ['number', 'string']: :param value: Controls whether the component is visible or hidden. :type any: :param z_index: The z-index used for the component :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-overlay", children, **kwargs) self._attr_names += [ "absolute", "color", "dark", "light", "opacity", "value", "z_index", ] class VPagination(AbstractElement): """ Vuetify's VPagination component. See more info and examples |VPagination_vuetify_link|. .. |VPagination_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-pagination" target="_blank">here</a> :param circle: Shape pagination elements as circles :type boolean: :param color: See description |VPagination_vuetify_link|. :type string: :param current_page_aria_label: :type string: :param dark: See description |VPagination_vuetify_link|. :type boolean: :param disabled: Disables component :type boolean: :param length: The length of the pagination component :type number: :param light: Applies the light theme variant to the component. :type boolean: :param next_aria_label: :type string: :param next_icon: Specify the icon to use for the next icon :type string: :param page_aria_label: :type string: :param prev_icon: Specify the icon to use for the prev icon :type string: :param previous_aria_label: :type string: :param total_visible: Specify the max total visible pagination numbers :type ['number', 'string']: :param value: Current selected page :type number: :param wrapper_aria_label: :type string: Events :param input: The updated bound model :param next: Emitted when going to next item :param previous: Emitted when going to previous item """ def __init__(self, children=None, **kwargs): super().__init__("v-pagination", children, **kwargs) self._attr_names += [ "circle", "color", "current_page_aria_label", "dark", "disabled", "length", "light", "next_aria_label", "next_icon", "page_aria_label", "prev_icon", "previous_aria_label", "total_visible", "value", "wrapper_aria_label", ] self._event_names += [ "input", "next", "previous", ] class VSheet(AbstractElement): """ Vuetify's VSheet component. See more info and examples |VSheet_vuetify_link|. .. |VSheet_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-sheet" target="_blank">here</a> :param color: See description |VSheet_vuetify_link|. :type string: :param dark: See description |VSheet_vuetify_link|. :type boolean: :param elevation: See description |VSheet_vuetify_link|. :type ['number', 'string']: :param height: Sets the height for the component. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param rounded: See description |VSheet_vuetify_link|. :type ['boolean', 'string']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param tile: Removes the component's **border-radius**. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-sheet", children, **kwargs) self._attr_names += [ "color", "dark", "elevation", "height", "light", "max_height", "max_width", "min_height", "min_width", "outlined", "rounded", "shaped", "tag", "tile", "width", ] class VParallax(AbstractElement): """ Vuetify's VParallax component. See more info and examples |VParallax_vuetify_link|. .. |VParallax_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-parallax" target="_blank">here</a> :param alt: Attaches an alt property to the parallax image :type string: :param height: Sets the height for the component :type ['string', 'number']: :param src: The image to parallax :type string: :param srcset: See description |VParallax_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-parallax", children, **kwargs) self._attr_names += [ "alt", "height", "src", "srcset", ] class VProgressCircular(AbstractElement): """ Vuetify's VProgressCircular component. See more info and examples |VProgressCircular_vuetify_link|. .. |VProgressCircular_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-progress-circular" target="_blank">here</a> :param button: Deprecated - Pending removal :type boolean: :param color: See description |VProgressCircular_vuetify_link|. :type string: :param indeterminate: Constantly animates, use when loading progress is unknown. :type boolean: :param rotate: Rotates the circle start point in deg :type ['number', 'string']: :param size: Sets the diameter of the circle in pixels :type ['number', 'string']: :param value: The percentage value for current progress :type ['number', 'string']: :param width: Sets the stroke of the circle in pixels :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-progress-circular", children, **kwargs) self._attr_names += [ "button", "color", "indeterminate", "rotate", "size", "value", "width", ] class VProgressLinear(AbstractElement): """ Vuetify's VProgressLinear component. See more info and examples |VProgressLinear_vuetify_link|. .. |VProgressLinear_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-progress-linear" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param active: Reduce the height to 0, hiding component :type boolean: :param background_color: Background color, set to component's color if null :type string: :param background_opacity: Background opacity, if null it defaults to 0.3 if background color is not specified or 1 otherwise :type ['number', 'string']: :param bottom: Aligns the component towards the bottom. :type boolean: :param buffer_value: The percentage value for the buffer :type ['number', 'string']: :param color: See description |VProgressLinear_vuetify_link|. :type string: :param dark: See description |VProgressLinear_vuetify_link|. :type boolean: :param fixed: Applies **position: fixed** to the component. :type boolean: :param height: Sets the height for the component :type ['number', 'string']: :param indeterminate: Constantly animates, use when loading progress is unknown. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param query: Animates like **indeterminate** prop but inverse :type boolean: :param reverse: Displays reversed progress (right to left in LTR mode and left to right in RTL) :type boolean: :param rounded: Adds a border radius to the progress component :type boolean: :param stream: An alternative style for portraying loading that works in tandem with **buffer-value** :type boolean: :param striped: Adds a stripe background to the filled portion of the progress component :type boolean: :param top: Aligns the content towards the top. :type boolean: :param value: The designated model value for the component. :type ['number', 'string']: Events :param change: Emitted when the component value is changed by user interaction """ def __init__(self, children=None, **kwargs): super().__init__("v-progress-linear", children, **kwargs) self._attr_names += [ "absolute", "active", "background_color", "background_opacity", "bottom", "buffer_value", "color", "dark", "fixed", "height", "indeterminate", "light", "query", "reverse", "rounded", "stream", "striped", "top", "value", ] self._event_names += [ "change", ] class VRadioGroup(AbstractElement): """ Vuetify's VRadioGroup component. See more info and examples |VRadioGroup_vuetify_link|. .. |VRadioGroup_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-radio-group" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param background_color: Changes the background-color of the input :type string: :param column: Displays radio buttons in column :type boolean: :param dark: See description |VRadioGroup_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param name: Sets the component's name attribute :type string: :param persistent_hint: Forces hint to always be visible :type boolean: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param row: Displays radio buttons in row :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param tag: Specify a custom tag used on the root element. :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param value_comparator: Apply a custom value comparator function :type function: Events :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_prepend: Emitted when prepended icon is clicked :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-radio-group", children, **kwargs) self._attr_names += [ "active_class", "append_icon", "background_color", "column", "dark", "dense", "disabled", "error", "error_count", "error_messages", "hide_details", "hint", "id", "label", "light", "mandatory", "max", "messages", "multiple", "name", "persistent_hint", "prepend_icon", "readonly", "row", "rules", "success", "success_messages", "tag", "validate_on_blur", "value", "value_comparator", # JS functions unimplemented ] self._event_names += [ "change", ("click_append", "click:append"), ("click_prepend", "click:prepend"), # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ] class VRadio(AbstractElement): """ Vuetify's VRadio component. See more info and examples |VRadio_vuetify_link|. .. |VRadio_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-radio" target="_blank">here</a> :param active_class: See description |VRadio_vuetify_link|. :type string: :param color: See description |VRadio_vuetify_link|. :type string: :param dark: See description |VRadio_vuetify_link|. :type boolean: :param disabled: Removes the ability to click or target the component. :type boolean: :param id: Sets the DOM id on the component :type string: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param name: Sets the component's name attribute :type string: :param off_icon: The icon used when inactive :type string: :param on_icon: The icon used when active :type string: :param readonly: Puts input in readonly state :type boolean: :param ripple: See description |VRadio_vuetify_link|. :type ['boolean', 'object']: :param value: The value used when the component is selected in a group. If not provided, the index will be used. :type any: Events :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_prepend: Emitted when prepended icon is clicked :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-radio", children, **kwargs) self._attr_names += [ "active_class", "color", "dark", "disabled", "id", "label", "light", "name", "off_icon", "on_icon", "readonly", "ripple", "value", ] self._event_names += [ "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_prepend", "click:prepend"), # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ] class VRangeSlider(AbstractElement): """ Vuetify's VRangeSlider component. See more info and examples |VRangeSlider_vuetify_link|. .. |VRangeSlider_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-range-slider" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param background_color: Changes the background-color of the input :type string: :param color: See description |VRangeSlider_vuetify_link|. :type string: :param dark: See description |VRangeSlider_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param inverse_label: Reverse the label position. Works with **rtl**. :type boolean: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param max: Sets the maximum allowed value :type ['number', 'string']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param min: Sets the minimum allowed value :type ['number', 'string']: :param persistent_hint: Forces hint to always be visible :type boolean: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param step: If greater than 0, sets step interval for ticks :type ['number', 'string']: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param thumb_color: Sets the thumb and thumb label color :type string: :param thumb_label: Show thumb label. If `true` it shows label when using slider. If set to `'always'` it always shows label. :type ['boolean', 'string']: :param thumb_size: Controls the size of the thumb label. :type ['number', 'string']: :param tick_labels: When provided with Array<string>, will attempt to map the labels to each step in index order :type array: :param tick_size: Controls the size of **ticks** :type ['number', 'string']: :param ticks: Show track ticks. If `true` it shows ticks when using slider. If set to `'always'` it always shows ticks. :type ['boolean', 'string']: :param track_color: Sets the track's color :type string: :param track_fill_color: Sets the track's fill color :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param vertical: Changes slider direction to vertical :type boolean: Events :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_prepend: Emitted when prepended icon is clicked :param end: Slider value emitted at the end of slider movement :param input: The updated bound model :param start: Slider value emitted at start of slider movement :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-range-slider", children, **kwargs) self._attr_names += [ "append_icon", "background_color", "color", "dark", "dense", "disabled", "error", "error_count", "error_messages", "height", "hide_details", "hint", "id", "inverse_label", "label", "light", "loader_height", "loading", "max", "messages", "min", "persistent_hint", "prepend_icon", "readonly", "rules", "step", "success", "success_messages", "thumb_color", "thumb_label", "thumb_size", "tick_labels", "tick_size", "ticks", "track_color", "track_fill_color", "validate_on_blur", "value", "vertical", ] self._event_names += [ "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_prepend", "click:prepend"), "end", "input", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class "start", ("update_error", "update:error"), ] class VRating(AbstractElement): """ Vuetify's VRating component. See more info and examples |VRating_vuetify_link|. .. |VRating_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-rating" target="_blank">here</a> :param background_color: The color used empty icons :type string: :param clearable: Allows for the component to be cleared. Triggers when the icon containing the current value is clicked. :type boolean: :param close_delay: Milliseconds to wait before closing component. :type ['number', 'string']: :param color: See description |VRating_vuetify_link|. :type string: :param dark: See description |VRating_vuetify_link|. :type boolean: :param dense: Icons have a smaller size :type boolean: :param empty_icon: The icon displayed when empty :type string: :param full_icon: The icon displayed when full :type string: :param half_icon: The icon displayed when half (requires **half-increments** prop) :type string: :param half_increments: Allows the selection of half increments :type boolean: :param hover: Provides visual feedback when hovering over icons :type boolean: :param icon_label: The **aria-label** used for icons :type string: :param large: Makes the component large. :type boolean: :param length: The amount of ratings to show :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param open_delay: Milliseconds to wait before opening component. :type ['number', 'string']: :param readonly: Removes all hover effects and pointer events :type boolean: :param ripple: See description |VRating_vuetify_link|. :type ['boolean', 'object']: :param size: Sets the height and width of the component. :type ['number', 'string']: :param small: Makes the component small. :type boolean: :param value: The rating value :type number: :param x_large: Makes the component extra large. :type boolean: :param x_small: Makes the component extra small. :type boolean: Events :param input: Emits the rating number when this value changes """ def __init__(self, children=None, **kwargs): super().__init__("v-rating", children, **kwargs) self._attr_names += [ "background_color", "clearable", "close_delay", "color", "dark", "dense", "empty_icon", "full_icon", "half_icon", "half_increments", "hover", "icon_label", "large", "length", "light", "open_delay", "readonly", "ripple", "size", "small", "value", "x_large", "x_small", ] self._event_names += [ "input", ] class VResponsive(AbstractElement): """ Vuetify's VResponsive component. See more info and examples |VResponsive_vuetify_link|. .. |VResponsive_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-responsive" target="_blank">here</a> :param aspect_ratio: Sets a base aspect ratio, calculated as width/height. This will only set a **minimum** height, the component can still grow if it has a lot of content. :type ['string', 'number']: :param content_class: Apply a custom class to the responsive content div. :type string: :param height: Sets the height for the component. :type ['number', 'string']: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-responsive", children, **kwargs) self._attr_names += [ "aspect_ratio", "content_class", "height", "max_height", "max_width", "min_height", "min_width", "width", ] class VSelect(AbstractElement): """ Vuetify's VSelect component. See more info and examples |VSelect_vuetify_link|. .. |VSelect_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-select" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param append_outer_icon: Appends an icon to the outside the component's input, uses same syntax as `v-icon` :type string: :param attach: Specifies which DOM element that this component should detach to. String can be any valid querySelector and Object can be any valid Node. This will attach to the root `v-app` component by default. :type any: :param autofocus: Enables autofocus :type boolean: :param background_color: Changes the background-color of the input :type string: :param cache_items: Keeps a local _unique_ copy of all items that have been passed through the **items** prop. :type boolean: :param chips: Changes display of selections to chips :type boolean: :param clear_icon: Applied when using **clearable** and the input is dirty :type string: :param clearable: Add input clear functionality, default icon is Material Design Icons **mdi-clear** :type boolean: :param color: See description |VSelect_vuetify_link|. :type string: :param counter: Creates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation. :type ['boolean', 'number', 'string']: :param counter_value: :type function: :param dark: See description |VSelect_vuetify_link|. :type boolean: :param deletable_chips: Adds a remove icon to selected chips :type boolean: :param dense: Reduces the input height :type boolean: :param disable_lookup: Disables keyboard lookup :type boolean: :param disabled: Disables the input :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param filled: Applies the alternate filled input style :type boolean: :param flat: Removes elevation (shadow) added to element when using the **solo** or **solo-inverted** props :type boolean: :param full_width: Designates input type as full-width :type boolean: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hide_selected: Do not display in the select menu items that are already selected :type boolean: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param item_color: Sets color of selected items :type string: :param item_disabled: Set property of **items**'s disabled value :type ['string', 'array', 'function']: :param item_text: Set property of **items**'s text value :type ['string', 'array', 'function']: :param item_value: See description |VSelect_vuetify_link|. :type ['string', 'array', 'function']: :param items: Can be an array of objects or array of strings. When using objects, will look for a text, value and disabled keys. This can be changed using the **item-text**, **item-value** and **item-disabled** props. Objects that have a **header** or **divider** property are considered special cases and generate a list header or divider; these items are not selectable. :type array: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param menu_props: Pass props through to the `v-menu` component. Accepts either a string for boolean props `menu-props="auto, overflowY"`, or an object `:menu-props="{ auto: true, overflowY: true }"` :type ['string', 'array', 'object']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param multiple: Changes select to multiple. Accepts array for value :type boolean: :param no_data_text: Display text when there is no data :type string: :param open_on_clear: When using the **clearable** prop, once cleared, the select menu will either open or stay open, depending on the current state :type boolean: :param outlined: Applies the outlined style to the input :type boolean: :param persistent_hint: Forces hint to always be visible :type boolean: :param persistent_placeholder: Forces placeholder to always be visible :type boolean: :param placeholder: Sets the input's placeholder text :type string: :param prefix: Displays prefix text :type string: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param prepend_inner_icon: Prepends an icon inside the component's input, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param return_object: Changes the selection behavior to return the object directly rather than the value specified with **item-value** :type boolean: :param reverse: Reverses the input orientation :type boolean: :param rounded: Adds a border radius to the input :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param shaped: Round if `outlined` and increase `border-radius` if `filled`. Must be used with either `outlined` or `filled` :type boolean: :param single_line: Label does not move on focus/dirty :type boolean: :param small_chips: Changes display of selections to chips with the **small** property :type boolean: :param solo: Changes the style of the input :type boolean: :param solo_inverted: Reduces element opacity until focused :type boolean: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param suffix: Displays suffix text :type string: :param type: Sets input type :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param value_comparator: See description |VSelect_vuetify_link|. :type function: Events :param blur: Emitted when the input is blurred :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_append_outer: Emitted when appended outer icon is clicked :param click_clear: Emitted when clearable icon clicked :param click_prepend: Emitted when prepended icon is clicked :param click_prepend_inner: Emitted when prepended inner icon is clicked :param focus: Emitted when component is focused :param input: The updated bound model :param keydown: Emitted when **any** key is pressed :param update_error: The `error.sync` event :param update_list_index: Emitted when menu item is selected using keyboard arrows :param update_search_input: The `search-input.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-select", children, **kwargs) self.ttsSensitive() self._attr_names += [ "append_icon", "append_outer_icon", "attach", "autofocus", "background_color", "cache_items", "chips", "clear_icon", "clearable", "color", "counter", "counter_value", # JS functions unimplemented "dark", "deletable_chips", "dense", "disable_lookup", "disabled", "eager", "error", "error_count", "error_messages", "filled", "flat", "full_width", "height", "hide_details", "hide_selected", "hint", "id", "item_color", "item_disabled", # JS functions unimplemented "item_text", # JS functions unimplemented "item_value", # JS functions unimplemented "items", "label", "light", "loader_height", "loading", "menu_props", "messages", "multiple", "no_data_text", "open_on_clear", "outlined", "persistent_hint", "persistent_placeholder", "placeholder", "prefix", "prepend_icon", "prepend_inner_icon", "readonly", "return_object", "reverse", "rounded", "rules", "shaped", "single_line", "small_chips", "solo", "solo_inverted", "success", "success_messages", "suffix", "type", "validate_on_blur", "value", "value_comparator", # JS functions unimplemented ] self._event_names += [ "blur", "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_append_outer", "click:append-outer"), ("click_clear", "click:clear"), ("click_prepend", "click:prepend"), ("click_prepend_inner", "click:prepend-inner"), "focus", "input", "keydown", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ("update_list_index", "update:list-index"), ("update_search_input", "update:search-input"), ] class VSkeletonLoader(AbstractElement): """ Vuetify's VSkeletonLoader component. See more info and examples |VSkeletonLoader_vuetify_link|. .. |VSkeletonLoader_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-skeleton-loader" target="_blank">here</a> :param boilerplate: Remove the loading animation from the skeleton :type boolean: :param dark: See description |VSkeletonLoader_vuetify_link|. :type boolean: :param elevation: See description |VSkeletonLoader_vuetify_link|. :type ['number', 'string']: :param height: Sets the height for the component. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param loading: Applies a loading animation with a on-hover loading cursor. A value of **false** will only work when there is content in the `default` slot. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param tile: Removes the component's border-radius :type boolean: :param transition: See description |VSkeletonLoader_vuetify_link|. :type string: :param type: A string delimited list of skeleton components to create such as `type="text@3"` or `type="card, list-item"`. Will recursively generate a corresponding skeleton from the provided string. Also supports short-hand for multiple elements such as **article@3** and **paragraph@2** which will generate 3 _article_ skeletons and 2 _paragraph_ skeletons. Please see below for a list of available pre-defined options. :type string: :param types: A custom types object that will be combined with the pre-defined options. For a list of available pre-defined options, see the **type** prop. :type object: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-skeleton-loader", children, **kwargs) self._attr_names += [ "boilerplate", "dark", "elevation", "height", "light", "loading", "max_height", "max_width", "min_height", "min_width", "tile", "transition", "type", "types", "width", ] class VSlider(AbstractElement): """ Vuetify's VSlider component. See more info and examples |VSlider_vuetify_link|. .. |VSlider_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-slider" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param background_color: Changes the background-color of the input :type string: :param color: See description |VSlider_vuetify_link|. :type string: :param dark: See description |VSlider_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param inverse_label: Reverse the label position. Works with **rtl**. :type boolean: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param max: Sets the maximum allowed value :type ['number', 'string']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param min: Sets the minimum allowed value :type ['number', 'string']: :param persistent_hint: Forces hint to always be visible :type boolean: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param step: If greater than 0, sets step interval for ticks :type ['number', 'string']: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param thumb_color: Sets the thumb and thumb label color :type string: :param thumb_label: Show thumb label. If `true` it shows label when using slider. If set to `'always'` it always shows label. :type ['boolean', 'string']: :param thumb_size: Controls the size of the thumb label. :type ['number', 'string']: :param tick_labels: When provided with Array<string>, will attempt to map the labels to each step in index order :type array: :param tick_size: Controls the size of **ticks** :type ['number', 'string']: :param ticks: Show track ticks. If `true` it shows ticks when using slider. If set to `'always'` it always shows ticks. :type ['boolean', 'string']: :param track_color: Sets the track's color :type string: :param track_fill_color: Sets the track's fill color :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param vertical: Changes slider direction to vertical :type boolean: Events :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_prepend: Emitted when prepended icon is clicked :param end: Slider value emitted at the end of slider movement :param input: The updated bound model :param start: Slider value emitted at start of slider movement :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-slider", children, **kwargs) self._attr_names += [ "append_icon", "background_color", "color", "dark", "dense", "disabled", "error", "error_count", "error_messages", "height", "hide_details", "hint", "id", "inverse_label", "label", "light", "loader_height", "loading", "max", "messages", "min", "persistent_hint", "prepend_icon", "readonly", "rules", "step", "success", "success_messages", "thumb_color", "thumb_label", "thumb_size", "tick_labels", "tick_size", "ticks", "track_color", "track_fill_color", "validate_on_blur", "value", "vertical", ] self._event_names += [ "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_prepend", "click:prepend"), "end", "input", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class "start", ("update_error", "update:error"), ] class VSlideGroup(AbstractElement): """ Vuetify's VSlideGroup component. See more info and examples |VSlideGroup_vuetify_link|. .. |VSlideGroup_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-slide-group" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param center_active: Forces the selected component to be centered :type boolean: :param dark: See description |VSlideGroup_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param mobile_breakpoint: Sets the designated mobile breakpoint for the component. :type ['number', 'string']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param next_icon: The appended slot when arrows are shown :type string: :param prev_icon: The prepended slot when arrows are shown :type string: :param show_arrows: See description |VSlideGroup_vuetify_link|. :type ['boolean', 'string']: :param tag: Specify a custom tag used on the root element. :type string: :param value: The designated model value for the component. :type any: Events :param change: Emitted when the component value is changed by user interaction :param click_next: Emitted when the next is clicked :param click_prev: Emitted when the prev is clicked """ def __init__(self, children=None, **kwargs): super().__init__("v-slide-group", children, **kwargs) self._attr_names += [ "active_class", "center_active", "dark", "light", "mandatory", "max", "mobile_breakpoint", "multiple", "next_icon", "prev_icon", "show_arrows", "tag", "value", ] self._event_names += [ "change", ("click_next", "click:next"), ("click_prev", "click:prev"), ] class VSlideItem(AbstractElement): """ Vuetify's VSlideItem component. See more info and examples |VSlideItem_vuetify_link|. .. |VSlideItem_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-slide-item" target="_blank">here</a> :param active_class: See description |VSlideItem_vuetify_link|. :type string: :param disabled: Removes the ability to click or target the component. :type boolean: :param value: The value used when the component is selected in a group. If not provided, the index will be used. :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-slide-item", children, **kwargs) self._attr_names += [ "active_class", "disabled", "value", ] class VSnackbar(AbstractElement): """ Vuetify's VSnackbar component. See more info and examples |VSnackbar_vuetify_link|. .. |VSnackbar_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-snackbar" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param app: Respects boundaries of—and will not overlap with—other `app` components like `v-app-bar`, `v-navigation-drawer`, and `v-footer`. :type boolean: :param bottom: Aligns the component towards the bottom. :type boolean: :param centered: Positions the snackbar in the center of the screen, (x and y axis). :type boolean: :param color: See description |VSnackbar_vuetify_link|. :type string: :param content_class: Apply a custom class to the snackbar content :type string: :param dark: See description |VSnackbar_vuetify_link|. :type boolean: :param elevation: See description |VSnackbar_vuetify_link|. :type ['number', 'string']: :param height: Sets the height for the component. :type ['number', 'string']: :param left: Aligns the component towards the left. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param multi_line: Gives the snackbar a larger minimum height. :type boolean: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param right: Aligns the component towards the right. :type boolean: :param rounded: See description |VSnackbar_vuetify_link|. :type ['boolean', 'string']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param text: Applies the defined **color** to text and a low opacity background of the same. :type boolean: :param tile: Removes the component's **border-radius**. :type boolean: :param timeout: Time (in milliseconds) to wait until snackbar is automatically hidden. Use `-1` to keep open indefinitely (`0` in version < 2.3 ). It is recommended for this number to be between `4000` and `10000`. Changes to this property will reset the timeout. :type ['number', 'string']: :param top: Aligns the content towards the top. :type boolean: :param transition: See description |VSnackbar_vuetify_link|. :type ['boolean', 'string']: :param value: Controls whether the component is visible or hidden. :type any: :param vertical: Stacks snackbar content on top of the actions (button). :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: Events :param input: The updated bound model """ def __init__(self, children=None, **kwargs): super().__init__("v-snackbar", children, **kwargs) self._attr_names += [ "absolute", "app", "bottom", "centered", "color", "content_class", "dark", "elevation", "height", "left", "light", "max_height", "max_width", "min_height", "min_width", "multi_line", "outlined", "right", "rounded", "shaped", "tag", "text", "tile", "timeout", "top", "transition", "value", "vertical", "width", ] self._event_names += [ "input", ] class VSparkline(AbstractElement): """ Vuetify's VSparkline component. See more info and examples |VSparkline_vuetify_link|. .. |VSparkline_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-sparkline" target="_blank">here</a> :param auto_draw: Trace the length of the line when first rendered :type boolean: :param auto_draw_duration: Amount of time (in ms) to run the trace animation :type number: :param auto_draw_easing: The easing function to use for the trace animation :type string: :param auto_line_width: Automatically expand bars to use space efficiently :type boolean: :param color: See description |VSparkline_vuetify_link|. :type string: :param fill: Using the **fill** property allows you to better customize the look and feel of your sparkline. :type boolean: :param gradient: An array of colors to use as a linear-gradient :type array: :param gradient_direction: The direction the gradient should run :type string: :param height: Height of the SVG trendline or bars :type ['string', 'number']: :param label_size: The label font size :type ['number', 'string']: :param labels: An array of string labels that correspond to the same index as its data counterpart :type array: :param line_width: The thickness of the line, in px :type ['string', 'number']: :param padding: Low `smooth` or high `line-width` values may result in cropping, increase padding to compensate :type ['string', 'number']: :param show_labels: Show labels below each data point :type boolean: :param smooth: Number of px to use as a corner radius. `true` defaults to 8, `false` is 0 :type ['boolean', 'number', 'string']: :param type: Choose between a trendline or bars :type string: :param value: An array of numbers. :type array: :param width: Width of the SVG trendline or bars :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-sparkline", children, **kwargs) self._attr_names += [ "auto_draw", "auto_draw_duration", "auto_draw_easing", "auto_line_width", "color", "fill", "gradient", "gradient_direction", "height", "label_size", "labels", "line_width", "padding", "show_labels", "smooth", "type", "value", "width", ] class VSpeedDial(AbstractElement): """ Vuetify's VSpeedDial component. See more info and examples |VSpeedDial_vuetify_link|. .. |VSpeedDial_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-speed-dial" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param bottom: Aligns the component towards the bottom. :type boolean: :param direction: Direction in which speed-dial content will show. Possible values are `top`, `bottom`, `left`, `right`. :type string: :param fixed: Applies **position: fixed** to the component. :type boolean: :param left: Aligns the component towards the left. :type boolean: :param mode: See description |VSpeedDial_vuetify_link|. :type string: :param open_on_hover: Opens speed-dial on hover :type boolean: :param origin: See description |VSpeedDial_vuetify_link|. :type string: :param right: Aligns the component towards the right. :type boolean: :param top: Aligns the content towards the top. :type boolean: :param transition: See description |VSpeedDial_vuetify_link|. :type string: :param value: Controls whether the component is visible or hidden. :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-speed-dial", children, **kwargs) self._attr_names += [ "absolute", "bottom", "direction", "fixed", "left", "mode", "open_on_hover", "origin", "right", "top", "transition", "value", ] class VStepper(AbstractElement): """ Vuetify's VStepper component. See more info and examples |VStepper_vuetify_link|. .. |VStepper_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-stepper" target="_blank">here</a> :param alt_labels: Places the labels beneath the step :type boolean: :param color: See description |VStepper_vuetify_link|. :type string: :param dark: See description |VStepper_vuetify_link|. :type boolean: :param elevation: See description |VStepper_vuetify_link|. :type ['number', 'string']: :param flat: Removes the stepper's elevation. :type boolean: :param height: Sets the height for the component. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param non_linear: Allow user to jump to any step :type boolean: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param rounded: See description |VStepper_vuetify_link|. :type ['boolean', 'string']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param tile: Removes the component's **border-radius**. :type boolean: :param value: The designated model value for the component. :type any: :param vertical: Display steps vertically :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: Events :param change: Emitted when step is changed by user interaction """ def __init__(self, children=None, **kwargs): super().__init__("v-stepper", children, **kwargs) self._attr_names += [ "alt_labels", "color", "dark", "elevation", "flat", "height", "light", "max_height", "max_width", "min_height", "min_width", "non_linear", "outlined", "rounded", "shaped", "tag", "tile", "value", "vertical", "width", ] self._event_names += [ "change", ] class VStepperContent(AbstractElement): """ Vuetify's VStepperContent component. See more info and examples |VStepperContent_vuetify_link|. .. |VStepperContent_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-stepper-content" target="_blank">here</a> :param step: Sets step to associate the content to :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-stepper-content", children, **kwargs) self._attr_names += [ "step", ] class VStepperStep(AbstractElement): """ Vuetify's VStepperStep component. See more info and examples |VStepperStep_vuetify_link|. .. |VStepperStep_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-stepper-step" target="_blank">here</a> :param color: See description |VStepperStep_vuetify_link|. :type string: :param complete: Marks step as complete :type boolean: :param complete_icon: Icon to display when step is marked as completed :type string: :param edit_icon: Icon to display when step is editable :type string: :param editable: Marks step as editable :type boolean: :param error_icon: Icon to display when step has an error :type string: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param step: Content to display inside step circle :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-stepper-step", children, **kwargs) self._attr_names += [ "color", "complete", "complete_icon", "edit_icon", "editable", "error_icon", "rules", "step", ] self._event_names += [ # click, #Implemented in AbstractElement parent class ] class VStepperHeader(AbstractElement): """ Vuetify's VStepperHeader component. See more info and examples |VStepperHeader_vuetify_link|. .. |VStepperHeader_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-stepper-header" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-stepper-header", children, **kwargs) class VStepperItems(AbstractElement): """ Vuetify's VStepperItems component. See more info and examples |VStepperItems_vuetify_link|. .. |VStepperItems_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-stepper-items" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-stepper-items", children, **kwargs) class VSubheader(AbstractElement): """ Vuetify's VSubheader component. See more info and examples |VSubheader_vuetify_link|. .. |VSubheader_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-subheader" target="_blank">here</a> :param dark: See description |VSubheader_vuetify_link|. :type boolean: :param inset: Adds indentation (72px) :type boolean: :param light: Applies the light theme variant to the component. :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-subheader", children, **kwargs) self._attr_names += [ "dark", "inset", "light", ] class VSwitch(AbstractElement): """ Vuetify's VSwitch component. See more info and examples |VSwitch_vuetify_link|. .. |VSwitch_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-switch" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param background_color: Changes the background-color of the input :type string: :param color: See description |VSwitch_vuetify_link|. :type string: :param dark: See description |VSwitch_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param false_value: Sets value for falsy state :type any: :param flat: Display component without elevation. Default elevation for thumb is 4dp, `flat` resets it :type boolean: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param input_value: The **v-model** bound value :type any: :param inset: Enlarge the `v-switch` track to encompass the thumb :type boolean: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loading: Displays circular progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - primary, secondary, success, info, warning, error) or a Boolean which uses the component color (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param multiple: Changes expected model to an array :type boolean: :param persistent_hint: Forces hint to always be visible :type boolean: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param ripple: See description |VSwitch_vuetify_link|. :type ['boolean', 'object']: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param true_value: Sets value for truthy state :type any: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: :param value_comparator: Apply a custom value comparator function :type function: Events :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_prepend: Emitted when prepended icon is clicked :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-switch", children, **kwargs) self._attr_names += [ "append_icon", "background_color", "color", "dark", "dense", "disabled", "error", "error_count", "error_messages", "false_value", "flat", "hide_details", "hint", "id", "input_value", "inset", "label", "light", "loading", "messages", "multiple", "persistent_hint", "prepend_icon", "readonly", "ripple", "rules", "success", "success_messages", "true_value", "validate_on_blur", "value", "value_comparator", # JS functions unimplemented ] self._event_names += [ "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_prepend", "click:prepend"), # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ] class VSystemBar(AbstractElement): """ Vuetify's VSystemBar component. See more info and examples |VSystemBar_vuetify_link|. .. |VSystemBar_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-system-bar" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param app: See description |VSystemBar_vuetify_link|. :type boolean: :param color: See description |VSystemBar_vuetify_link|. :type string: :param dark: See description |VSystemBar_vuetify_link|. :type boolean: :param fixed: Applies **position: fixed** to the component. :type boolean: :param height: Sets the height for the component. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param lights_out: Reduces the system bar opacity. :type boolean: :param window: Increases the system bar height to 32px (24px default). :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-system-bar", children, **kwargs) self._attr_names += [ "absolute", "app", "color", "dark", "fixed", "height", "light", "lights_out", "window", ] class VTabs(AbstractElement): """ Vuetify's VTabs component. See more info and examples |VTabs_vuetify_link|. .. |VTabs_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-tabs" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param align_with_title: Make `v-tabs` lined up with the toolbar title :type boolean: :param background_color: Changes the background color of the component. :type string: :param center_active: Forces the selected tab to be centered :type boolean: :param centered: Centers the tabs :type boolean: :param color: See description |VTabs_vuetify_link|. :type string: :param dark: See description |VTabs_vuetify_link|. :type boolean: :param fixed_tabs: `v-tabs-item` min-width 160px, max-width 360px :type boolean: :param grow: Force `v-tab`'s to take up all available space :type boolean: :param height: Sets the height of the tabs bar :type ['number', 'string']: :param hide_slider: Hide's the generated `v-tabs-slider` :type boolean: :param icons_and_text: Will stack icon and text vertically :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mobile_breakpoint: Sets the designated mobile breakpoint for the component. :type ['string', 'number']: :param next_icon: Right pagination icon :type string: :param optional: Does not require an active item. Useful when using `v-tab` as a `router-link` :type boolean: :param prev_icon: Left pagination icon :type string: :param right: Aligns tabs to the right :type boolean: :param show_arrows: Show pagination arrows if the tab items overflow their container. For mobile devices, arrows will only display when using this prop. :type ['boolean', 'string']: :param slider_color: Changes the background color of an auto-generated `v-tabs-slider` :type string: :param slider_size: Changes the size of the slider, **height** for horizontal, **width** for vertical. :type ['number', 'string']: :param value: The designated model value for the component. :type any: :param vertical: Stacks tabs on top of each other vertically. :type boolean: Events :param change: Emitted when tab is changed by user interaction. Returns a string if **href** attribute is set and number if it is not. """ def __init__(self, children=None, **kwargs): super().__init__("v-tabs", children, **kwargs) self._attr_names += [ "active_class", "align_with_title", "background_color", "center_active", "centered", "color", "dark", "fixed_tabs", "grow", "height", "hide_slider", "icons_and_text", "light", "mobile_breakpoint", "next_icon", "optional", "prev_icon", "right", "show_arrows", "slider_color", "slider_size", "value", "vertical", ] self._event_names += [ "change", ] class VTab(AbstractElement): """ Vuetify's VTab component. See more info and examples |VTab_vuetify_link|. .. |VTab_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-tab" target="_blank">here</a> :param active_class: See description |VTab_vuetify_link|. :type string: :param append: See description |VTab_vuetify_link|. :type boolean: :param dark: See description |VTab_vuetify_link|. :type boolean: :param disabled: Removes the ability to click or target the component. :type boolean: :param exact: See description |VTab_vuetify_link|. :type boolean: :param exact_active_class: See description |VTab_vuetify_link|. :type string: :param exact_path: See description |VTab_vuetify_link|. :type boolean: :param href: Designates the component as anchor and applies the **href** attribute. :type ['string', 'object']: :param light: Applies the light theme variant to the component. :type boolean: :param link: Designates that the component is a link. This is automatic when using the **href** or **to** prop. :type boolean: :param nuxt: See description |VTab_vuetify_link|. :type boolean: :param replace: See description |VTab_vuetify_link|. :type boolean: :param ripple: See description |VTab_vuetify_link|. :type ['boolean', 'object']: :param tag: Specify a custom tag used on the root element. :type string: :param target: Designates the target attribute. This should only be applied when using the **href** prop. :type string: :param to: See description |VTab_vuetify_link|. :type ['string', 'object']: Events :param change: Emitted when tab becomes active :param keydown: Emitted when **enter** key is pressed """ def __init__(self, children=None, **kwargs): super().__init__("v-tab", children, **kwargs) self._attr_names += [ "active_class", "append", "dark", "disabled", "exact", "exact_active_class", "exact_path", "href", "light", "link", "nuxt", "replace", "ripple", "tag", "target", "to", ] self._event_names += [ "change", # click, #Implemented in AbstractElement parent class "keydown", ] class VTabItem(AbstractElement): """ Vuetify's VTabItem component. See more info and examples |VTabItem_vuetify_link|. .. |VTabItem_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-tab-item" target="_blank">here</a> :param active_class: See description |VTabItem_vuetify_link|. :type string: :param disabled: Removes the ability to click or target the component. :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param id: Sets the DOM id on the component :type string: :param reverse_transition: Sets the reverse transition :type ['boolean', 'string']: :param transition: See description |VTabItem_vuetify_link|. :type ['boolean', 'string']: :param value: Sets the value of the tab. If not provided, the index will be used. :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-tab-item", children, **kwargs) self._attr_names += [ "active_class", "disabled", "eager", "id", "reverse_transition", "transition", "value", ] class VTabsItems(AbstractElement): """ Vuetify's VTabsItems component. See more info and examples |VTabsItems_vuetify_link|. .. |VTabsItems_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-tabs-items" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param continuous: If `true`, window will "wrap around" from the last item to the first, and from the first item to the last :type boolean: :param dark: See description |VTabsItems_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param mandatory: Forces a value to always be selected (if available). :type boolean: :param max: Sets a maximum number of selections that can be made. :type ['number', 'string']: :param multiple: Allow multiple selections. The **value** prop must be an _array_. :type boolean: :param next_icon: Icon used for the "next" button if `show-arrows` is `true` :type ['boolean', 'string']: :param prev_icon: Icon used for the "prev" button if `show-arrows` is `true` :type ['boolean', 'string']: :param reverse: Reverse the normal transition direction. :type boolean: :param show_arrows: Display the "next" and "prev" buttons :type boolean: :param show_arrows_on_hover: Display the "next" and "prev" buttons on hover. `show-arrows` MUST ALSO be set. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param touch: Provide a custom **left** and **right** function when swiped left or right. :type object: :param touchless: Disable touch support. :type boolean: :param value: The designated model value for the component. :type any: :param vertical: Uses a vertical transition when changing windows. :type boolean: Events :param change: Emitted when user swipes between tabs. """ def __init__(self, children=None, **kwargs): super().__init__("v-tabs-items", children, **kwargs) self._attr_names += [ "active_class", "continuous", "dark", "light", "mandatory", "max", "multiple", "next_icon", "prev_icon", "reverse", "show_arrows", "show_arrows_on_hover", "tag", "touch", "touchless", "value", "vertical", ] self._event_names += [ "change", ] class VTabsSlider(AbstractElement): """ Vuetify's VTabsSlider component. See more info and examples |VTabsSlider_vuetify_link|. .. |VTabsSlider_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-tabs-slider" target="_blank">here</a> :param color: See description |VTabsSlider_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-tabs-slider", children, **kwargs) self._attr_names += [ "color", ] class VTextarea(AbstractElement): """ Vuetify's VTextarea component. See more info and examples |VTextarea_vuetify_link|. .. |VTextarea_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-textarea" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param append_outer_icon: Appends an icon to the outside the component's input, uses same syntax as `v-icon` :type string: :param auto_grow: Automatically grow the textarea depending on amount of text :type boolean: :param autofocus: Enables autofocus :type boolean: :param background_color: Changes the background-color of the input :type string: :param clear_icon: Applied when using **clearable** and the input is dirty :type string: :param clearable: Add input clear functionality, default icon is Material Design Icons **mdi-clear** :type boolean: :param color: See description |VTextarea_vuetify_link|. :type string: :param counter: Creates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation. :type ['boolean', 'number', 'string']: :param counter_value: :type function: :param dark: See description |VTextarea_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param filled: Applies the alternate filled input style :type boolean: :param flat: Removes elevation (shadow) added to element when using the **solo** or **solo-inverted** props :type boolean: :param full_width: Designates input type as full-width :type boolean: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param no_resize: Remove resize handle :type boolean: :param outlined: Applies the outlined style to the input :type boolean: :param persistent_hint: Forces hint to always be visible :type boolean: :param persistent_placeholder: Forces placeholder to always be visible :type boolean: :param placeholder: Sets the input's placeholder text :type string: :param prefix: Displays prefix text :type string: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param prepend_inner_icon: Prepends an icon inside the component's input, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param reverse: Reverses the input orientation :type boolean: :param rounded: Adds a border radius to the input :type boolean: :param row_height: Height value for each row. Requires the use of the **auto-grow** prop. :type ['number', 'string']: :param rows: Default row count :type ['number', 'string']: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param shaped: Round if `outlined` and increase `border-radius` if `filled`. Must be used with either `outlined` or `filled` :type boolean: :param single_line: Label does not move on focus/dirty :type boolean: :param solo: Changes the style of the input :type boolean: :param solo_inverted: Reduces element opacity until focused :type boolean: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param suffix: Displays suffix text :type string: :param type: Sets input type :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: Events :param blur: Emitted when the input is blurred :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_append_outer: Emitted when appended outer icon is clicked :param click_clear: Emitted when clearable icon clicked :param click_prepend: Emitted when prepended icon is clicked :param click_prepend_inner: Emitted when prepended inner icon is clicked :param focus: Emitted when component is focused :param input: The updated bound model :param keydown: Emitted when **any** key is pressed :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-textarea", children, **kwargs) self._attr_names += [ "append_icon", "append_outer_icon", "auto_grow", "autofocus", "background_color", "clear_icon", "clearable", "color", "counter", "counter_value", # JS functions unimplemented "dark", "dense", "disabled", "error", "error_count", "error_messages", "filled", "flat", "full_width", "height", "hide_details", "hint", "id", "label", "light", "loader_height", "loading", "messages", "no_resize", "outlined", "persistent_hint", "persistent_placeholder", "placeholder", "prefix", "prepend_icon", "prepend_inner_icon", "readonly", "reverse", "rounded", "row_height", "rows", "rules", "shaped", "single_line", "solo", "solo_inverted", "success", "success_messages", "suffix", "type", "validate_on_blur", "value", ] self._event_names += [ "blur", "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_append_outer", "click:append-outer"), ("click_clear", "click:clear"), ("click_prepend", "click:prepend"), ("click_prepend_inner", "click:prepend-inner"), "focus", "input", "keydown", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ] class VTextField(AbstractElement): """ Vuetify's VTextField component. See more info and examples |VTextField_vuetify_link|. .. |VTextField_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-text-field" target="_blank">here</a> :param append_icon: Appends an icon to the component, uses the same syntax as `v-icon` :type string: :param append_outer_icon: Appends an icon to the outside the component's input, uses same syntax as `v-icon` :type string: :param autofocus: Enables autofocus :type boolean: :param background_color: Changes the background-color of the input :type string: :param clear_icon: Applied when using **clearable** and the input is dirty :type string: :param clearable: Add input clear functionality, default icon is Material Design Icons **mdi-clear** :type boolean: :param color: See description |VTextField_vuetify_link|. :type string: :param counter: Creates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation. :type ['boolean', 'number', 'string']: :param counter_value: :type function: :param dark: See description |VTextField_vuetify_link|. :type boolean: :param dense: Reduces the input height :type boolean: :param disabled: Disable the input :type boolean: :param error: Puts the input in a manual error state :type boolean: :param error_count: The total number of errors that should display at once :type ['number', 'string']: :param error_messages: Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the **rules** prop. This field will not trigger validation :type ['string', 'array']: :param filled: Applies the alternate filled input style :type boolean: :param flat: Removes elevation (shadow) added to element when using the **solo** or **solo-inverted** props :type boolean: :param full_width: Designates input type as full-width :type boolean: :param height: Sets the height of the input :type ['number', 'string']: :param hide_details: Hides hint and validation errors. When set to `auto` messages will be rendered only if there's a message (hint, error message, counter value etc) to display :type ['boolean', 'string']: :param hint: Hint text :type string: :param id: Sets the DOM id on the component :type string: :param label: Sets input label :type string: :param light: Applies the light theme variant to the component. :type boolean: :param loader_height: Specifies the height of the loader :type ['number', 'string']: :param loading: Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - **primary**, **secondary**, **success**, **info**, **warning**, **error**) or a Boolean which uses the component **color** (set by color prop - if it's supported by the component) or the primary color :type ['boolean', 'string']: :param messages: Displays a list of messages or message if using a string :type ['string', 'array']: :param outlined: Applies the outlined style to the input :type boolean: :param persistent_hint: Forces hint to always be visible :type boolean: :param persistent_placeholder: Forces placeholder to always be visible :type boolean: :param placeholder: Sets the input’s placeholder text :type string: :param prefix: Displays prefix text :type string: :param prepend_icon: Prepends an icon to the component, uses the same syntax as `v-icon` :type string: :param prepend_inner_icon: Prepends an icon inside the component's input, uses the same syntax as `v-icon` :type string: :param readonly: Puts input in readonly state :type boolean: :param reverse: Reverses the input orientation :type boolean: :param rounded: Adds a border radius to the input :type boolean: :param rules: Accepts a mixed array of types `function`, `boolean` and `string`. Functions pass an input value as an argument and must return either `true` / `false` or a `string` containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) `false` or is a `string` :type array: :param shaped: Round if `outlined` and increase `border-radius` if `filled`. Must be used with either `outlined` or `filled` :type boolean: :param single_line: Label does not move on focus/dirty :type boolean: :param solo: Changes the style of the input :type boolean: :param solo_inverted: Reduces element opacity until focused :type boolean: :param success: Puts the input in a manual success state :type boolean: :param success_messages: Puts the input in a success state and passes through custom success messages. :type ['string', 'array']: :param suffix: Displays suffix text :type string: :param type: Sets input type :type string: :param validate_on_blur: Delays validation until blur event :type boolean: :param value: The input's value :type any: Events :param blur: Emitted when the input is blurred :param change: Emitted when the input is changed by user interaction :param click_append: Emitted when appended icon is clicked :param click_append_outer: Emitted when appended outer icon is clicked :param click_clear: Emitted when clearable icon clicked :param click_prepend: Emitted when prepended icon is clicked :param click_prepend_inner: Emitted when prepended inner icon is clicked :param focus: Emitted when component is focused :param input: The updated bound model :param keydown: Emitted when **any** key is pressed :param update_error: The `error.sync` event """ def __init__(self, children=None, **kwargs): super().__init__("v-text-field", children, **kwargs) self._attr_names += [ "append_icon", "append_outer_icon", "autofocus", "background_color", "clear_icon", "clearable", "color", "counter", "counter_value", # JS functions unimplemented "dark", "dense", "disabled", "error", "error_count", "error_messages", "filled", "flat", "full_width", "height", "hide_details", "hint", "id", "label", "light", "loader_height", "loading", "messages", "outlined", "persistent_hint", "persistent_placeholder", "placeholder", "prefix", "prepend_icon", "prepend_inner_icon", "readonly", "reverse", "rounded", "rules", "shaped", "single_line", "solo", "solo_inverted", "success", "success_messages", "suffix", "type", "validate_on_blur", "value", ] self._event_names += [ "blur", "change", # click, #Implemented in AbstractElement parent class ("click_append", "click:append"), ("click_append_outer", "click:append-outer"), ("click_clear", "click:clear"), ("click_prepend", "click:prepend"), ("click_prepend_inner", "click:prepend-inner"), "focus", "input", "keydown", # mousedown, #Implemented in AbstractElement parent class # mouseup, #Implemented in AbstractElement parent class ("update_error", "update:error"), ] class VThemeProvider(AbstractElement): """ Vuetify's VThemeProvider component. See more info and examples |VThemeProvider_vuetify_link|. .. |VThemeProvider_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-theme-provider" target="_blank">here</a> :param dark: See description |VThemeProvider_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param root: Use the current value of `$vuetify.theme.dark` as opposed to the provided one. :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-theme-provider", children, **kwargs) self._attr_names += [ "dark", "light", "root", ] class VTimeline(AbstractElement): """ Vuetify's VTimeline component. See more info and examples |VTimeline_vuetify_link|. .. |VTimeline_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-timeline" target="_blank">here</a> :param align_top: Align caret and dot of timeline items to the top :type boolean: :param dark: See description |VTimeline_vuetify_link|. :type boolean: :param dense: Hide opposite slot content, and position all items to one side of timeline :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param reverse: Reverse direction of timeline items :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-timeline", children, **kwargs) self._attr_names += [ "align_top", "dark", "dense", "light", "reverse", ] class VTimelineItem(AbstractElement): """ Vuetify's VTimelineItem component. See more info and examples |VTimelineItem_vuetify_link|. .. |VTimelineItem_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-timeline-item" target="_blank">here</a> :param color: See description |VTimelineItem_vuetify_link|. :type string: :param dark: See description |VTimelineItem_vuetify_link|. :type boolean: :param fill_dot: Remove padding from dot container :type boolean: :param hide_dot: Hide display of timeline dot :type boolean: :param icon: Specify icon for dot container :type string: :param icon_color: See description |VTimelineItem_vuetify_link|. :type string: :param large: Large size dot :type boolean: :param left: Explicitly set the item to a left orientation :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param right: Explicitly set the item to a right orientation :type boolean: :param small: Small size dot :type boolean: """ def __init__(self, children=None, **kwargs): super().__init__("v-timeline-item", children, **kwargs) self._attr_names += [ "color", "dark", "fill_dot", "hide_dot", "icon", "icon_color", "large", "left", "light", "right", "small", ] class VTimePicker(AbstractElement): """ Vuetify's VTimePicker component. See more info and examples |VTimePicker_vuetify_link|. .. |VTimePicker_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-time-picker" target="_blank">here</a> :param allowed_hours: Restricts which hours can be selected :type ['function', 'array']: :param allowed_minutes: Restricts which minutes can be selected :type ['function', 'array']: :param allowed_seconds: Restricts which seconds can be selected :type ['function', 'array']: :param ampm_in_title: Place AM/PM switch in title, not near the clock. :type boolean: :param color: See description |VTimePicker_vuetify_link|. :type string: :param dark: See description |VTimePicker_vuetify_link|. :type boolean: :param disabled: disables picker :type boolean: :param elevation: See description |VTimePicker_vuetify_link|. :type ['number', 'string']: :param flat: Removes elevation :type boolean: :param format: Defines the format of a time displayed in picker. Available options are `ampm` and `24hr`. :type string: :param full_width: Forces 100% width :type boolean: :param header_color: Defines the header color. If not specified it will use the color defined by <code>color</code> prop or the default picker color :type string: :param landscape: Orients picker horizontal :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param max: Maximum allowed time :type string: :param min: Minimum allowed time :type string: :param no_title: Hide the picker title :type boolean: :param readonly: Puts picker in readonly state :type boolean: :param scrollable: Allows changing hour/minute with mouse scroll :type boolean: :param use_seconds: Toggles the use of seconds in picker :type boolean: :param value: Time picker model (ISO 8601 format, 24hr hh:mm) :type any: :param width: Width of the picker :type ['number', 'string']: Events :param change: Emitted when the time selection is done (when user changes the minute for HH:MM picker and the second for HH:MM:SS picker :param click_hour: Emitted when user selects the hour :param click_minute: Emitted when user selects the minute :param click_second: Emitted when user selects the second :param input: The updated bound model :param update_period: Emitted when user clicks the AM/PM button """ def __init__(self, children=None, **kwargs): super().__init__("v-time-picker", children, **kwargs) self._attr_names += [ "allowed_hours", # JS functions unimplemented "allowed_minutes", # JS functions unimplemented "allowed_seconds", # JS functions unimplemented "ampm_in_title", "color", "dark", "disabled", "elevation", "flat", "format", "full_width", "header_color", "landscape", "light", "max", "min", "no_title", "readonly", "scrollable", "use_seconds", "value", "width", ] self._event_names += [ "change", ("click_hour", "click:hour"), ("click_minute", "click:minute"), ("click_second", "click:second"), "input", ("update_period", "update:period"), ] class VToolbar(AbstractElement): """ Vuetify's VToolbar component. See more info and examples |VToolbar_vuetify_link|. .. |VToolbar_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-toolbar" target="_blank">here</a> :param absolute: Applies position: absolute to the component. :type boolean: :param bottom: Aligns the component towards the bottom. :type boolean: :param collapse: Puts the toolbar into a collapsed state reducing its maximum width. :type boolean: :param color: See description |VToolbar_vuetify_link|. :type string: :param dark: See description |VToolbar_vuetify_link|. :type boolean: :param dense: Reduces the height of the toolbar content to 48px (96px when using the **prominent** prop). :type boolean: :param elevation: See description |VToolbar_vuetify_link|. :type ['number', 'string']: :param extended: Use this prop to increase the height of the toolbar _without_ using the `extension` slot for adding content. May be used in conjunction with the **extension-height** prop, and any of the other props that affect the height of the toolbar, e.g. **prominent**, **dense**, etc., **WITH THE EXCEPTION** of **height**. :type boolean: :param extension_height: Specify an explicit height for the `extension` slot. :type ['number', 'string']: :param flat: Removes the toolbar's box-shadow. :type boolean: :param floating: Applies **display: inline-flex** to the component. :type boolean: :param height: Designates a specific height for the toolbar. Overrides the heights imposed by other props, e.g. **prominent**, **dense**, **extended**, etc. :type ['number', 'string']: :param light: Applies the light theme variant to the component. :type boolean: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param outlined: Removes elevation (box-shadow) and adds a *thin* border. :type boolean: :param prominent: Increases the height of the toolbar content to 128px. :type boolean: :param rounded: See description |VToolbar_vuetify_link|. :type ['boolean', 'string']: :param shaped: Applies a large border radius on the top left and bottom right of the card. :type boolean: :param short: Reduce the height of the toolbar content to 56px (112px when using the **prominent** prop). :type boolean: :param src: See description |VToolbar_vuetify_link|. :type ['string', 'object']: :param tag: Specify a custom tag used on the root element. :type string: :param tile: Removes the component's **border-radius**. :type boolean: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-toolbar", children, **kwargs) self._attr_names += [ "absolute", "bottom", "collapse", "color", "dark", "dense", "elevation", "extended", "extension_height", "flat", "floating", "height", "light", "max_height", "max_width", "min_height", "min_width", "outlined", "prominent", "rounded", "shaped", "short", "src", "tag", "tile", "width", ] class VToolbarItems(AbstractElement): """ Vuetify's VToolbarItems component. See more info and examples |VToolbarItems_vuetify_link|. .. |VToolbarItems_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-toolbar-items" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-toolbar-items", children, **kwargs) class VToolbarTitle(AbstractElement): """ Vuetify's VToolbarTitle component. See more info and examples |VToolbarTitle_vuetify_link|. .. |VToolbarTitle_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-toolbar-title" target="_blank">here</a> """ def __init__(self, children=None, **kwargs): super().__init__("v-toolbar-title", children, **kwargs) class VTooltip(AbstractElement): """ Vuetify's VTooltip component. See more info and examples |VTooltip_vuetify_link|. .. |VTooltip_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-tooltip" target="_blank">here</a> :param absolute: Applies **position: absolute** to the component. :type boolean: :param activator: Designate a custom activator when the `activator` slot is not used. String can be any valid querySelector and Object can be any valid Node. :type any: :param allow_overflow: Removes overflow re-positioning for the content :type boolean: :param attach: Specifies which DOM element that this component should detach to. String can be any valid querySelector and Object can be any valid Node. This will attach to the root `v-app` component by default. :type any: :param bottom: Aligns the component towards the bottom. :type boolean: :param close_delay: Delay (in ms) after which menu closes (when open-on-hover prop is set to true) :type ['number', 'string']: :param color: See description |VTooltip_vuetify_link|. :type string: :param content_class: Applies a custom class to the detached element. This is useful because the content is moved to the beginning of the `v-app` component (unless the **attach** prop is provided) and is not targetable by classes passed directly on the component. :type string: :param disabled: Disables the tooltip :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param fixed: Applies **position: fixed** to the component. :type boolean: :param internal_activator: Designates whether to use an internal activator :type boolean: :param left: Aligns the component towards the left. :type boolean: :param max_width: Sets the maximum width for the content :type ['number', 'string']: :param min_width: Sets the minimum width for the content :type ['number', 'string']: :param nudge_bottom: Nudge the content to the bottom :type ['number', 'string']: :param nudge_left: Nudge the content to the left :type ['number', 'string']: :param nudge_right: Nudge the content to the right :type ['number', 'string']: :param nudge_top: Nudge the content to the top :type ['number', 'string']: :param nudge_width: Nudge the content width :type ['number', 'string']: :param offset_overflow: Causes the component to flip to the opposite side when repositioned due to overflow :type boolean: :param open_delay: Delay (in ms) after which tooltip opens (when `open-on-hover` prop is set to **true**) :type ['number', 'string']: :param open_on_click: Designates whether the tooltip should open on activator click :type boolean: :param open_on_focus: :type boolean: :param open_on_hover: Designates whether the tooltip should open on activator hover :type boolean: :param position_x: Used to position the content when not using an activator slot :type number: :param position_y: Used to position the content when not using an activator slot :type number: :param right: Aligns the component towards the right. :type boolean: :param tag: Specifies a custom tag for the activator wrapper :type string: :param top: Aligns the content towards the top. :type boolean: :param transition: See description |VTooltip_vuetify_link|. :type string: :param value: Controls whether the component is visible or hidden. :type any: :param z_index: The z-index used for the component :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-tooltip", children, **kwargs) self._attr_names += [ "absolute", "activator", "allow_overflow", "attach", "bottom", "close_delay", "color", "content_class", "disabled", "eager", "fixed", "internal_activator", "left", "max_width", "min_width", "nudge_bottom", "nudge_left", "nudge_right", "nudge_top", "nudge_width", "offset_overflow", "open_delay", "open_on_click", "open_on_focus", "open_on_hover", "position_x", "position_y", "right", "tag", "top", "transition", "value", "z_index", ] class VTreeview(AbstractElement): """ Vuetify's VTreeview component. See more info and examples |VTreeview_vuetify_link|. .. |VTreeview_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-treeview" target="_blank">here</a> :param activatable: Allows user to mark a node as active by clicking on it :type boolean: :param active: Syncable prop that allows one to control which nodes are active. The array consists of the `item-key` of each active item. :type array: :param active_class: The class applied to the node when active :type string: :param color: Sets the color of the active node :type string: :param dark: See description |VTreeview_vuetify_link|. :type boolean: :param dense: Decreases the height of the items :type boolean: :param expand_icon: Icon used to indicate that a node can be expanded :type string: :param filter: Custom item filtering function. By default it will use case-insensitive search in item's label. :type function: :param hoverable: Applies a hover class when mousing over nodes :type boolean: :param indeterminate_icon: Icon used when node is in an indeterminate state. Only visible when `selectable` is `true`. :type string: :param item_children: Property on supplied `items` that contains its children :type string: :param item_disabled: Property on supplied `items` that contains the disabled state of the item :type string: :param item_key: Property on supplied `items` used to keep track of node state. The value of this property has to be unique among all items. :type string: :param item_text: Property on supplied `items` that contains its label text :type string: :param items: An array of items used to build the treeview :type array: :param light: Applies the light theme variant to the component. :type boolean: :param load_children: A function used when dynamically loading children. If this prop is set, then the supplied function will be run if expanding an item that has a `item-children` property that is an empty array. Supports returning a Promise. :type function: :param loading_icon: Icon used when node is in a loading state :type string: :param multiple_active: When `true`, allows user to have multiple active nodes at the same time :type boolean: :param off_icon: Icon used when node is not selected. Only visible when `selectable` is `true`. :type string: :param on_icon: Icon used when leaf node is selected or when a branch node is fully selected. Only visible when `selectable` is `true`. :type string: :param open: Syncable prop that allows one to control which nodes are open. The array consists of the `item-key` of each open item. :type array: :param open_all: When `true` will cause all branch nodes to be opened when component is mounted :type boolean: :param open_on_click: When `true` will cause nodes to be opened by clicking anywhere on it, instead of only opening by clicking on expand icon. When using this prop with `activatable` you will be unable to mark nodes with children as active. :type boolean: :param return_object: When `true` will make `v-model`, `active.sync` and `open.sync` return the complete object instead of just the key :type boolean: :param rounded: Provides an alternative active style for `v-treeview` node. Only visible when `activatable` is `true` and should not be used in conjunction with the `shaped` prop. :type boolean: :param search: The search model for filtering results :type string: :param selectable: Will render a checkbox next to each node allowing them to be selected :type boolean: :param selected_color: The color of the selection checkbox :type string: :param selection_type: Controls how the treeview selects nodes. There are two modes available: 'leaf' and 'independent' :type string: :param shaped: Provides an alternative active style for `v-treeview` node. Only visible when `activatable` is `true` and should not be used in conjunction with the `rounded` prop. :type boolean: :param transition: Applies a transition when nodes are opened and closed :type boolean: :param value: Allows one to control which nodes are selected. The array consists of the `item-key` of each selected item. Is used with `@input` event to allow for `v-model` binding. :type array: Events :param input: Emits the array of selected items when this value changes :param update_active: Emits the array of active items when this value changes :param update_open: Emits the array of open items when this value changes """ def __init__(self, children=None, **kwargs): super().__init__("v-treeview", children, **kwargs) self._attr_names += [ "activatable", "active", "active_class", "color", "dark", "dense", "expand_icon", "filter", # JS functions unimplemented "hoverable", "indeterminate_icon", "item_children", "item_disabled", "item_key", "item_text", "items", "light", "load_children", # JS functions unimplemented "loading_icon", "multiple_active", "off_icon", "on_icon", "open", "open_all", "open_on_click", "return_object", "rounded", "search", "selectable", "selected_color", "selection_type", "shaped", "transition", "value", ] self._event_names += [ "input", ("update_active", "update:active"), ("update_open", "update:open"), ] class VVirtualScroll(AbstractElement): """ Vuetify's VVirtualScroll component. See more info and examples |VVirtualScroll_vuetify_link|. .. |VVirtualScroll_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-virtual-scroll" target="_blank">here</a> :param bench: The number of items **outside** the user view that are rendered (even if they are **not** viewable); to help prevent empty white space when scrolling *fast*. :type ['number', 'string']: :param height: Height of the component as a css value :type ['number', 'string']: :param item_height: Height in pixels of the items to display :type ['number', 'string']: :param items: The array of items to display :type array: :param max_height: Sets the maximum height for the component. :type ['number', 'string']: :param max_width: Sets the maximum width for the component. :type ['number', 'string']: :param min_height: Sets the minimum height for the component. :type ['number', 'string']: :param min_width: Sets the minimum width for the component. :type ['number', 'string']: :param width: Sets the width for the component. :type ['number', 'string']: """ def __init__(self, children=None, **kwargs): super().__init__("v-virtual-scroll", children, **kwargs) self._attr_names += [ "bench", "height", "item_height", "items", "max_height", "max_width", "min_height", "min_width", "width", ] class VWindow(AbstractElement): """ Vuetify's VWindow component. See more info and examples |VWindow_vuetify_link|. .. |VWindow_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-window" target="_blank">here</a> :param active_class: The **active-class** applied to children when they are activated. :type string: :param continuous: If `true`, window will "wrap around" from the last item to the first, and from the first item to the last :type boolean: :param dark: See description |VWindow_vuetify_link|. :type boolean: :param light: Applies the light theme variant to the component. :type boolean: :param next_icon: Icon used for the "next" button if `show-arrows` is `true` :type ['boolean', 'string']: :param prev_icon: Icon used for the "prev" button if `show-arrows` is `true` :type ['boolean', 'string']: :param reverse: Reverse the normal transition direction. :type boolean: :param show_arrows: Display the "next" and "prev" buttons :type boolean: :param show_arrows_on_hover: Display the "next" and "prev" buttons on hover. `show-arrows` MUST ALSO be set. :type boolean: :param tag: Specify a custom tag used on the root element. :type string: :param touch: Provide a custom **left** and **right** function when swiped left or right. :type object: :param touchless: Disable touch support. :type boolean: :param value: The designated model value for the component. :type any: :param vertical: Uses a vertical transition when changing windows. :type boolean: Events :param change: Emitted when the component value is changed by user interaction """ def __init__(self, children=None, **kwargs): super().__init__("v-window", children, **kwargs) self._attr_names += [ "active_class", "continuous", "dark", "light", "next_icon", "prev_icon", "reverse", "show_arrows", "show_arrows_on_hover", "tag", "touch", "touchless", "value", "vertical", ] self._event_names += [ "change", ] class VWindowItem(AbstractElement): """ Vuetify's VWindowItem component. See more info and examples |VWindowItem_vuetify_link|. .. |VWindowItem_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-window-item" target="_blank">here</a> :param active_class: See description |VWindowItem_vuetify_link|. :type string: :param disabled: Prevents the item from becoming active when using the "next" and "prev" buttons or the `toggle` method :type boolean: :param eager: Will force the components content to render on mounted. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO. :type boolean: :param reverse_transition: Sets the reverse transition :type ['boolean', 'string']: :param transition: See description |VWindowItem_vuetify_link|. :type ['boolean', 'string']: :param value: The value used when the component is selected in a group. If not provided, the index will be used. :type any: """ def __init__(self, children=None, **kwargs): super().__init__("v-window-item", children, **kwargs) self._attr_names += [ "active_class", "disabled", "eager", "reverse_transition", "transition", "value", ] class VCarouselTransition(AbstractElement): """ Vuetify's VCarouselTransition component. See more info and examples |VCarouselTransition_vuetify_link|. .. |VCarouselTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-carousel-transition" target="_blank">here</a> :param group: See description |VCarouselTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VCarouselTransition_vuetify_link|. :type boolean: :param mode: See description |VCarouselTransition_vuetify_link|. :type string: :param origin: See description |VCarouselTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-carousel-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VCarouselReverseTransition(AbstractElement): """ Vuetify's VCarouselReverseTransition component. See more info and examples |VCarouselReverseTransition_vuetify_link|. .. |VCarouselReverseTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-carousel-reverse-transition" target="_blank">here</a> :param group: See description |VCarouselReverseTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VCarouselReverseTransition_vuetify_link|. :type boolean: :param mode: See description |VCarouselReverseTransition_vuetify_link|. :type string: :param origin: See description |VCarouselReverseTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-carousel-reverse-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VTabTransition(AbstractElement): """ Vuetify's VTabTransition component. See more info and examples |VTabTransition_vuetify_link|. .. |VTabTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-tab-transition" target="_blank">here</a> :param group: See description |VTabTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VTabTransition_vuetify_link|. :type boolean: :param mode: See description |VTabTransition_vuetify_link|. :type string: :param origin: See description |VTabTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-tab-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VTabReverseTransition(AbstractElement): """ Vuetify's VTabReverseTransition component. See more info and examples |VTabReverseTransition_vuetify_link|. .. |VTabReverseTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-tab-reverse-transition" target="_blank">here</a> :param group: See description |VTabReverseTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VTabReverseTransition_vuetify_link|. :type boolean: :param mode: See description |VTabReverseTransition_vuetify_link|. :type string: :param origin: See description |VTabReverseTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-tab-reverse-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VMenuTransition(AbstractElement): """ Vuetify's VMenuTransition component. See more info and examples |VMenuTransition_vuetify_link|. .. |VMenuTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-menu-transition" target="_blank">here</a> :param group: See description |VMenuTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VMenuTransition_vuetify_link|. :type boolean: :param mode: See description |VMenuTransition_vuetify_link|. :type string: :param origin: See description |VMenuTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-menu-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VFabTransition(AbstractElement): """ Vuetify's VFabTransition component. See more info and examples |VFabTransition_vuetify_link|. .. |VFabTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-fab-transition" target="_blank">here</a> :param group: See description |VFabTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VFabTransition_vuetify_link|. :type boolean: :param mode: See description |VFabTransition_vuetify_link|. :type string: :param origin: See description |VFabTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-fab-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VDialogTransition(AbstractElement): """ Vuetify's VDialogTransition component. See more info and examples |VDialogTransition_vuetify_link|. .. |VDialogTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-dialog-transition" target="_blank">here</a> :param group: See description |VDialogTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VDialogTransition_vuetify_link|. :type boolean: :param mode: See description |VDialogTransition_vuetify_link|. :type string: :param origin: See description |VDialogTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-dialog-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VDialogBottomTransition(AbstractElement): """ Vuetify's VDialogBottomTransition component. See more info and examples |VDialogBottomTransition_vuetify_link|. .. |VDialogBottomTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-dialog-bottom-transition" target="_blank">here</a> :param group: See description |VDialogBottomTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VDialogBottomTransition_vuetify_link|. :type boolean: :param mode: See description |VDialogBottomTransition_vuetify_link|. :type string: :param origin: See description |VDialogBottomTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-dialog-bottom-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VDialogTopTransition(AbstractElement): """ Vuetify's VDialogTopTransition component. See more info and examples |VDialogTopTransition_vuetify_link|. .. |VDialogTopTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-dialog-top-transition" target="_blank">here</a> :param group: See description |VDialogTopTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VDialogTopTransition_vuetify_link|. :type boolean: :param mode: See description |VDialogTopTransition_vuetify_link|. :type string: :param origin: See description |VDialogTopTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-dialog-top-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VFadeTransition(AbstractElement): """ Vuetify's VFadeTransition component. See more info and examples |VFadeTransition_vuetify_link|. .. |VFadeTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-fade-transition" target="_blank">here</a> :param group: See description |VFadeTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VFadeTransition_vuetify_link|. :type boolean: :param mode: See description |VFadeTransition_vuetify_link|. :type string: :param origin: See description |VFadeTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-fade-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VScaleTransition(AbstractElement): """ Vuetify's VScaleTransition component. See more info and examples |VScaleTransition_vuetify_link|. .. |VScaleTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-scale-transition" target="_blank">here</a> :param group: See description |VScaleTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VScaleTransition_vuetify_link|. :type boolean: :param mode: See description |VScaleTransition_vuetify_link|. :type string: :param origin: See description |VScaleTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-scale-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VScrollXTransition(AbstractElement): """ Vuetify's VScrollXTransition component. See more info and examples |VScrollXTransition_vuetify_link|. .. |VScrollXTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-scroll-x-transition" target="_blank">here</a> :param group: See description |VScrollXTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VScrollXTransition_vuetify_link|. :type boolean: :param mode: See description |VScrollXTransition_vuetify_link|. :type string: :param origin: See description |VScrollXTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-scroll-x-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VScrollXReverseTransition(AbstractElement): """ Vuetify's VScrollXReverseTransition component. See more info and examples |VScrollXReverseTransition_vuetify_link|. .. |VScrollXReverseTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-scroll-x-reverse-transition" target="_blank">here</a> :param group: See description |VScrollXReverseTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VScrollXReverseTransition_vuetify_link|. :type boolean: :param mode: See description |VScrollXReverseTransition_vuetify_link|. :type string: :param origin: See description |VScrollXReverseTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-scroll-x-reverse-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VScrollYTransition(AbstractElement): """ Vuetify's VScrollYTransition component. See more info and examples |VScrollYTransition_vuetify_link|. .. |VScrollYTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-scroll-y-transition" target="_blank">here</a> :param group: See description |VScrollYTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VScrollYTransition_vuetify_link|. :type boolean: :param mode: See description |VScrollYTransition_vuetify_link|. :type string: :param origin: See description |VScrollYTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-scroll-y-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VScrollYReverseTransition(AbstractElement): """ Vuetify's VScrollYReverseTransition component. See more info and examples |VScrollYReverseTransition_vuetify_link|. .. |VScrollYReverseTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-scroll-y-reverse-transition" target="_blank">here</a> :param group: See description |VScrollYReverseTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VScrollYReverseTransition_vuetify_link|. :type boolean: :param mode: See description |VScrollYReverseTransition_vuetify_link|. :type string: :param origin: See description |VScrollYReverseTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-scroll-y-reverse-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VSlideXTransition(AbstractElement): """ Vuetify's VSlideXTransition component. See more info and examples |VSlideXTransition_vuetify_link|. .. |VSlideXTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-slide-x-transition" target="_blank">here</a> :param group: See description |VSlideXTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VSlideXTransition_vuetify_link|. :type boolean: :param mode: See description |VSlideXTransition_vuetify_link|. :type string: :param origin: See description |VSlideXTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-slide-x-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VSlideXReverseTransition(AbstractElement): """ Vuetify's VSlideXReverseTransition component. See more info and examples |VSlideXReverseTransition_vuetify_link|. .. |VSlideXReverseTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-slide-x-reverse-transition" target="_blank">here</a> :param group: See description |VSlideXReverseTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VSlideXReverseTransition_vuetify_link|. :type boolean: :param mode: See description |VSlideXReverseTransition_vuetify_link|. :type string: :param origin: See description |VSlideXReverseTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-slide-x-reverse-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VSlideYTransition(AbstractElement): """ Vuetify's VSlideYTransition component. See more info and examples |VSlideYTransition_vuetify_link|. .. |VSlideYTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-slide-y-transition" target="_blank">here</a> :param group: See description |VSlideYTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VSlideYTransition_vuetify_link|. :type boolean: :param mode: See description |VSlideYTransition_vuetify_link|. :type string: :param origin: See description |VSlideYTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-slide-y-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VSlideYReverseTransition(AbstractElement): """ Vuetify's VSlideYReverseTransition component. See more info and examples |VSlideYReverseTransition_vuetify_link|. .. |VSlideYReverseTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-slide-y-reverse-transition" target="_blank">here</a> :param group: See description |VSlideYReverseTransition_vuetify_link|. :type boolean: :param hide_on_leave: Hides the leaving element (no exit animation) :type boolean: :param leave_absolute: See description |VSlideYReverseTransition_vuetify_link|. :type boolean: :param mode: See description |VSlideYReverseTransition_vuetify_link|. :type string: :param origin: See description |VSlideYReverseTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-slide-y-reverse-transition", children, **kwargs) self._attr_names += [ "group", "hide_on_leave", "leave_absolute", "mode", "origin", ] class VExpandTransition(AbstractElement): """ Vuetify's VExpandTransition component. See more info and examples |VExpandTransition_vuetify_link|. .. |VExpandTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-expand-transition" target="_blank">here</a> :param mode: See description |VExpandTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-expand-transition", children, **kwargs) self._attr_names += [ "mode", ] class VExpandXTransition(AbstractElement): """ Vuetify's VExpandXTransition component. See more info and examples |VExpandXTransition_vuetify_link|. .. |VExpandXTransition_vuetify_link| raw:: html <a href="https://vuetifyjs.com/api/v-expand-x-transition" target="_blank">here</a> :param mode: See description |VExpandXTransition_vuetify_link|. :type string: """ def __init__(self, children=None, **kwargs): super().__init__("v-expand-x-transition", children, **kwargs) self._attr_names += [ "mode", ]
37.680045
425
0.637977
48,978
403,704
5.133529
0.030932
0.049393
0.064336
0.02063
0.798262
0.776717
0.726934
0.706475
0.663123
0.64624
0
0.001599
0.261055
403,704
10,713
426
37.683562
0.841228
0.673731
0
0.710106
0
0
0.292155
0.017815
0
0
0
0
0
1
0.039827
false
0.000271
0.001084
0
0.08155
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
dbc2f32ae43348583fc320575ee4b83e5c40987a
209
py
Python
src/pynwb/form/backends/hdf5/__init__.py
VBaratham/pynwb
a9429c93f29763b9ebe9022b099afcffbc6be493
[ "BSD-3-Clause-LBNL" ]
1
2021-04-13T20:47:36.000Z
2021-04-13T20:47:36.000Z
src/pynwb/form/backends/hdf5/__init__.py
VBaratham/pynwb
a9429c93f29763b9ebe9022b099afcffbc6be493
[ "BSD-3-Clause-LBNL" ]
null
null
null
src/pynwb/form/backends/hdf5/__init__.py
VBaratham/pynwb
a9429c93f29763b9ebe9022b099afcffbc6be493
[ "BSD-3-Clause-LBNL" ]
null
null
null
# flake8: noqa: F401 from . import h5_utils from .h5tools import HDF5IO from .h5_utils import H5RegionSlicer, H5DataIO from . import h5tools from .h5tools import H5SpecWriter from .h5tools import H5SpecReader
26.125
46
0.813397
28
209
6
0.464286
0.196429
0.303571
0
0
0
0
0
0
0
0
0.083333
0.138756
209
7
47
29.857143
0.85
0.086124
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
918695107c23eb47a93298586ce0722ea8f3cb5e
1,595
py
Python
corehq/apps/smsbillables/tests/utils.py
dimagilg/commcare-hq
ea1786238eae556bb7f1cbd8d2460171af1b619c
[ "BSD-3-Clause" ]
1
2020-07-14T13:00:23.000Z
2020-07-14T13:00:23.000Z
corehq/apps/smsbillables/tests/utils.py
dimagilg/commcare-hq
ea1786238eae556bb7f1cbd8d2460171af1b619c
[ "BSD-3-Clause" ]
94
2020-12-11T06:57:31.000Z
2022-03-15T10:24:06.000Z
corehq/apps/smsbillables/tests/utils.py
dimagilg/commcare-hq
ea1786238eae556bb7f1cbd8d2460171af1b619c
[ "BSD-3-Clause" ]
null
null
null
class FakeTwilioMessage(object): status = 'sent' def __init__(self, price, num_segments=1): self.price = price self.num_segments = str(num_segments) def fetch(self): return self class FakeMessageFactory(object): backend_message_id_to_num_segments = {} backend_message_id_to_price = {} @classmethod def add_price_for_message(cls, backend_message_id, price): cls.backend_message_id_to_price[backend_message_id] = price @classmethod def get_price_for_message(cls, backend_message_id): return cls.backend_message_id_to_price.get(backend_message_id) @classmethod def add_num_segments_for_message(cls, backend_message_id, num_segments): cls.backend_message_id_to_num_segments[backend_message_id] = num_segments @classmethod def get_num_segments_for_message(cls, backend_message_id): return cls.backend_message_id_to_num_segments.get(backend_message_id) or 1 @classmethod def get_twilio_message(cls, backend_message_id): return FakeTwilioMessage( cls.get_price_for_message(backend_message_id) * -1, num_segments=cls.get_num_segments_for_message(backend_message_id), ) @classmethod def get_infobip_message(cls, backend_message_id): return { 'messageCount': cls.get_num_segments_for_message(backend_message_id), 'status': { 'name': 'sent' }, 'price': { 'pricePerMessage': cls.get_price_for_message(backend_message_id) } }
31.9
82
0.692163
196
1,595
5.137755
0.158163
0.278054
0.317776
0.188679
0.632572
0.5571
0.462761
0.410129
0.285998
0.111221
0
0.002447
0.231348
1,595
49
83
32.55102
0.818923
0
0
0.153846
0
0
0.031348
0
0
0
0
0
0
1
0.205128
false
0
0
0.128205
0.461538
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
9188e3fe00e7d846e1fd6c96ad519d3f6b6b9074
165
py
Python
muffin_cache/utils.py
drgarcia1986/muffin-cache
1e749d79751198aaed3e75a2c451b2c9253b84ef
[ "MIT" ]
null
null
null
muffin_cache/utils.py
drgarcia1986/muffin-cache
1e749d79751198aaed3e75a2c451b2c9253b84ef
[ "MIT" ]
1
2015-08-10T11:52:48.000Z
2016-01-13T03:04:42.000Z
muffin_cache/utils.py
drgarcia1986/muffin-cache
1e749d79751198aaed3e75a2c451b2c9253b84ef
[ "MIT" ]
null
null
null
from .handler import CacheHandler def cache_view(view, **kwargs): return CacheHandler.from_view( view, kwargs.get('methods', '*'), view.__name__ )
20.625
55
0.672727
19
165
5.526316
0.631579
0.152381
0.266667
0
0
0
0
0
0
0
0
0
0.193939
165
7
56
23.571429
0.789474
0
0
0
0
0
0.048485
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.6
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
918bf0658b9db6a457826b452ef961ec891b24c7
89
py
Python
goodjson/exceptions.py
namoshizun/goodjson
4cecd2766cacb0bf7de0bbd3011edb02857e44cd
[ "BSD-3-Clause" ]
1
2020-10-24T08:56:29.000Z
2020-10-24T08:56:29.000Z
goodjson/exceptions.py
namoshizun/goodjson
4cecd2766cacb0bf7de0bbd3011edb02857e44cd
[ "BSD-3-Clause" ]
null
null
null
goodjson/exceptions.py
namoshizun/goodjson
4cecd2766cacb0bf7de0bbd3011edb02857e44cd
[ "BSD-3-Clause" ]
null
null
null
class ValueNotRequired(Exception): pass class RaggedListError(Exception): pass
12.714286
34
0.752809
8
89
8.375
0.625
0.38806
0
0
0
0
0
0
0
0
0
0
0.179775
89
6
35
14.833333
0.917808
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
91a94530c23919094aa66ef952f727c90c5e752f
98
py
Python
RestAdm/apps/system/innojoy_calculate/chengyigang/calculate/__init__.py
xeroCBW/testmodel
6000d79f91d11bcf6ba76befb3a94a007231ecdc
[ "MIT" ]
null
null
null
RestAdm/apps/system/innojoy_calculate/chengyigang/calculate/__init__.py
xeroCBW/testmodel
6000d79f91d11bcf6ba76befb3a94a007231ecdc
[ "MIT" ]
54
2020-06-24T07:12:19.000Z
2022-03-12T00:43:57.000Z
RestAdm/apps/system/innojoy_calculate/chengyigang/draw_curve/__init__.py
xeroCBW/testmodel
6000d79f91d11bcf6ba76befb3a94a007231ecdc
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ __title__ = '' __author__ = xiongliff __mtime__ = '2019/7/20' """
16.333333
24
0.55102
10
98
4.2
1
0
0
0
0
0
0
0
0
0
0
0.102564
0.204082
98
6
25
16.333333
0.435897
0.857143
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
91ab4f223dc1e2bef82c4f1dc922d1991ceae8d8
144
py
Python
test/test_builtin_logging.py
DahlitzFlorian/pytest-loguru-support-video-snippets
4a442b16224829630256ab77542e2cfedf9030a8
[ "MIT" ]
null
null
null
test/test_builtin_logging.py
DahlitzFlorian/pytest-loguru-support-video-snippets
4a442b16224829630256ab77542e2cfedf9030a8
[ "MIT" ]
null
null
null
test/test_builtin_logging.py
DahlitzFlorian/pytest-loguru-support-video-snippets
4a442b16224829630256ab77542e2cfedf9030a8
[ "MIT" ]
null
null
null
import builtin_logging import pytest def test_logging(caplog): builtin_logging.func() assert "This is a log message." in caplog.text
16
50
0.75
21
144
5
0.761905
0.266667
0
0
0
0
0
0
0
0
0
0
0.180556
144
8
51
18
0.889831
0
0
0
0
0
0.152778
0
0
0
0
0
0.2
1
0.2
false
0
0.4
0
0.6
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
91ac6f5990221060c0df44a97c9178c1b2f3519e
21
py
Python
myRL/algo/__init__.py
Shiduo-zh/pybulletSim
a51c71adc328d2071d7faf53e4bc5cd695f03ab2
[ "MIT" ]
562
2020-04-10T20:32:46.000Z
2022-03-31T20:36:12.000Z
myRL/algo/__init__.py
Shiduo-zh/pybulletSim
a51c71adc328d2071d7faf53e4bc5cd695f03ab2
[ "MIT" ]
49
2020-04-14T11:59:52.000Z
2022-03-21T08:48:28.000Z
myRL/algo/__init__.py
Shiduo-zh/pybulletSim
a51c71adc328d2071d7faf53e4bc5cd695f03ab2
[ "MIT" ]
118
2020-04-13T04:40:59.000Z
2022-03-31T02:09:50.000Z
from .ppo import PPO
10.5
20
0.761905
4
21
4
0.75
0
0
0
0
0
0
0
0
0
0
0
0.190476
21
1
21
21
0.941176
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
91cc28281e9496e84c803a9049d054f835a256fb
19
py
Python
talked-code.py
ItanuRomero/talking-code
e134b71b467359415ef24c01e415259f20a5643e
[ "MIT" ]
1
2021-10-20T15:36:29.000Z
2021-10-20T15:36:29.000Z
talked-code.py
ItanuRomero/talking-code
e134b71b467359415ef24c01e415259f20a5643e
[ "MIT" ]
8
2021-10-21T18:16:07.000Z
2021-11-30T01:24:34.000Z
talked-code.py
ItanuRomero/talking-code
e134b71b467359415ef24c01e415259f20a5643e
[ "MIT" ]
null
null
null
print('Olha isso')
9.5
18
0.684211
3
19
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.105263
19
1
19
19
0.764706
0
0
0
0
0
0.473684
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
91da58306c36eeee17f19d6a87a983ea626f6949
17,504
py
Python
src/ada.py
tomvars/medical_adv_da
d2c81ee7951c580b62d853497672057b8cf7923e
[ "Apache-2.0" ]
2
2021-08-13T07:21:00.000Z
2021-09-15T08:52:20.000Z
src/ada.py
tomvars/medical_adv_da
d2c81ee7951c580b62d853497672057b8cf7923e
[ "Apache-2.0" ]
null
null
null
src/ada.py
tomvars/medical_adv_da
d2c81ee7951c580b62d853497672057b8cf7923e
[ "Apache-2.0" ]
null
null
null
import multiprocessing import sys import torch.optim as optim import numpy as np from functools import partial from src.base_model import BaseModel from src.networks import Destilation_student_matchingInstance from src.utils import save_images from src.utils import bland_altman_loss, dice_soft_loss, ss_loss, generate_affine, non_geometric_augmentations, apply_transform class ADAModel(BaseModel): def __init__(self, cf, writer, results_folder, models_folder, tensorboard_folder, run_name, starting_epoch=0): self.cf = cf self.results_folder = results_folder self.models_folder = models_folder self.tensorboard_folder = tensorboard_folder self.run_name = run_name self.starting_epoch = starting_epoch self.seg_model = Destilation_student_matchingInstance(self.cf.labels - 1, self.cf.channels) self.seg_model.cuda() self.writer = writer self.seg_optimizer = optim.Adam(self.seg_model.parameters(), lr=self.cf.lr) step_1 = 20000 if self.cf.task == 'ms' else 5000 step_2 = 20000 if self.cf.task == 'ms' else 10000 scheduler_S = optim.lr_scheduler.MultiStepLR(self.seg_optimizer, milestones=[step_1, step_2], gamma=0.1) self.criterion = dice_soft_loss if self.cf.loss == 'dice' else bland_altman_loss self.criterion2 = ss_loss self.iterations = self.cf.iterations # Discriminator setup # self.discriminator = DiscriminatorDomain(352, 2, self.cf.discriminator_complexity) self.optimizer_discriminator = optim.Adam(self.discriminator.parameters(), lr=1e-4) ######################## self.correct = 0 self.num_of_subjects = 0 def initialise(self): self.seg_model.cuda() self.discriminator.cuda() self.p = multiprocessing.Pool(10) def training_loop(self, source_dl, target_dl): if self.iterations < self.cf.iterations_adapt: alpha = 0 beta = 0 else: alpha = self.cf.alpha_lweights beta = self.cf.beta_lweights source_batch = next(source_dl) source_inputs, source_labels = (source_batch['inputs'].to(self.device), source_batch['labels'].to(self.device)) target_batch = next(target_dl) target_inputs, target_labels = (target_batch['inputs'].to(self.device), target_batch['labels'].to(self.device)) outputs, _, _, _, _, _, _, _, _, _ = self.seg_model(source_inputs) # Training Discriminator self.seg_model.eval() self.discriminator.train() # do the sampling here. # Source Domain sampling inputs_source_discriminator = source_inputs # Target batch batch_trs = target_inputs.cpu().numpy() batch_trs = self.p.map( partial(non_geometric_augmentations, method='bias', norm_training_images=None), np.copy(batch_trs)) batch_trs = self.p.map( partial(non_geometric_augmentations, method='kspace', norm_training_images=None), np.copy(batch_trs)) inputs_target_discriminator_aug = torch.Tensor(batch_trs).cuda() Theta, Theta_inv = generate_affine(inputs_target_discriminator_aug, degreeFreedom=self.cf.affine_rot_degree, scale=self.cf.affine_scale, shearingScale=self.cf.affine_shearing) inputs_target_discriminator_aug = apply_transform(inputs_target_discriminator_aug, Theta) inputs_models_discriminator = torch.cat( (inputs_source_discriminator, inputs_target_discriminator_aug), 0) labels_discriminator = to_var_gpu( torch.cat((torch.zeros(inputs_source_discriminator.size(0)), torch.ones(inputs_target_discriminator_aug.size(0))), 0).type(torch.LongTensor)) # print('size Discriminator') # print(inputs_models_discriminator.size()) _, _, _, _, _, _, dec4, dec3, dec2, dec1 = self.seg_model(inputs_models_discriminator) dec1 = F.interpolate(dec1, size=dec2.size()[2:], mode='bilinear') dec2 = F.interpolate(dec2, size=dec2.size()[2:], mode='bilinear') dec3 = F.interpolate(dec3, size=dec2.size()[2:], mode='bilinear') dec4 = F.interpolate(dec4, size=dec2.size()[2:], mode='bilinear') inputs_discriminator = torch.cat((dec1, dec2, dec3, dec4), 1) self.discriminator.zero_grad() outputs_discriminator = self.discriminator(inputs_discriminator) loss_discriminator = torch.nn.CrossEntropyLoss(size_average=True)(outputs_discriminator, labels_discriminator) self.correct += (torch.argmax(outputs_discriminator, dim=1) == labels_discriminator).float().sum() self.num_of_subjects += int(outputs_discriminator.size(0)) loss_discriminator.backward() self.optimizer_discriminator.step() discriminator_loss = loss_discriminator.item() # Train model self.seg_model.train() self.discriminator.eval() # Here we get a new batch of target domain slices target_batch = next(target_dl) target_inputs, target_labels = (target_batch['inputs'].to(device), target_batch['labels'].to(device)) outputst, _, _, _, _, _, _, _, _, _ = self.seg_model(target_inputs) batch_trs = target_inputs.cpu().numpy() batch_trs = self.p.map( partial(non_geometric_augmentations, method='bias', norm_training_images=None), np.copy(batch_trs)) batch_trs = self.p.map( partial(non_geometric_augmentations, method='kspace', norm_training_images=None), np.copy(batch_trs)) inputstaug = torch.Tensor(batch_trs).cuda() Theta, Theta_inv = generate_affine(inputstaug, degreeFreedom=self.cf.affine_rot_degree, scale=self.cf.affine_scale, shearingScale=self.cf.affine_shearing) inputstaug = apply_transform(inputstaug, Theta) self.seg_model.zero_grad() outputstaug, _, _, _, _, _, _, _, _, _ = self.seg_model(inputstaug) outputst_transformed = apply_transform(outputst, Theta) inputs_models_discriminator = torch.cat((source_inputs, inputstaug), 0) _, _, _, _, _, _, dec4, dec3, dec2, dec1 = self.seg_model(inputs_models_discriminator) dec1 = F.interpolate(dec1, size=dec2.size()[2:], mode='bilinear') dec2 = F.interpolate(dec2, size=dec2.size()[2:], mode='bilinear') dec3 = F.interpolate(dec3, size=dec2.size()[2:], mode='bilinear') dec4 = F.interpolate(dec4, size=dec2.size()[2:], mode='bilinear') inputs_discriminator = torch.cat((dec1, dec2, dec3, dec4), 1) outputs_discriminator = self.discriminator(inputs_discriminator) labels_discriminator = to_var_gpu( torch.cat((torch.zeros(source_inputs.size(0)), torch.ones(inputstaug.size(0))), 0).type(torch.LongTensor)) loss_discriminator = torch.nn.CrossEntropyLoss(size_average=True)(outputs_discriminator, labels_discriminator) supervised_loss = dice_soft_loss(torch.sigmoid(outputs), source_labels) pc_loss = alpha * self.criterion(torch.sigmoid(outputstaug), torch.sigmoid(outputst_transformed)) adversarial_loss = - beta * loss_discriminator loss = supervised_loss + pc_loss + adversarial_loss self.seg_model.zero_grad() loss.backward() self.seg_optimizer.step() postfix_dict = {'loss': loss.item(), 'supervised_loss': supervised_loss.item(), 'pc_loss': pc_loss.item(), 'adversarial_loss': adversarial_loss.item(), 'loss_discriminator': loss_discriminator.item(), 'acc_discriminator': self.correct/self.num_of_subjects } tensorboard_dict = {'source_inputs': source_inputs, 'target_inputs': target_inputs, 'source_labels': source_labels, 'target_labels': target_labels, 'inputstaug': inputstaug, 'outputs': outputs, 'outputst': outputst} def validation_loop(self): if self.iterations < self.cf.iterations_adapt: alpha = 0 beta = 0 else: alpha = self.cf.alpha_lweights beta = self.cf.beta_lweights self.seg_model.eval() self.discriminator.eval() source_batch = next(source_dl) source_inputs, source_labels = (source_batch['inputs'].to(self.device), source_batch['labels'].to(self.device)) target_batch = next(target_dl) target_inputs, target_labels = (target_batch['inputs'].to(self.device), target_batch['labels'].to(self.device)) outputs, _, _, _, _, _, _, _, _, _ = self.seg_model(source_inputs) # Source Domain sampling inputs_source_discriminator = source_inputs # Target batch batch_trs = target_inputs.cpu().numpy() batch_trs = self.p.map( partial(non_geometric_augmentations, method='bias', norm_training_images=None), np.copy(batch_trs)) batch_trs = self.p.map( partial(non_geometric_augmentations, method='kspace', norm_training_images=None), np.copy(batch_trs)) inputs_target_discriminator_aug = torch.Tensor(batch_trs).cuda() Theta, Theta_inv = generate_affine(inputs_target_discriminator_aug, degreeFreedom=self.cf.affine_rot_degree, scale=self.cf.affine_scale, shearingScale=self.cf.affine_shearing) inputs_target_discriminator_aug = apply_transform(inputs_target_discriminator_aug, Theta) inputs_models_discriminator = torch.cat( (inputs_source_discriminator, inputs_target_discriminator_aug), 0) labels_discriminator = to_var_gpu( torch.cat((torch.zeros(inputs_source_discriminator.size(0)), torch.ones(inputs_target_discriminator_aug.size(0))), 0).type(torch.LongTensor)) _, _, _, _, _, _, dec4, dec3, dec2, dec1 = self.seg_model(inputs_models_discriminator) dec1 = F.interpolate(dec1, size=dec2.size()[2:], mode='bilinear') dec2 = F.interpolate(dec2, size=dec2.size()[2:], mode='bilinear') dec3 = F.interpolate(dec3, size=dec2.size()[2:], mode='bilinear') dec4 = F.interpolate(dec4, size=dec2.size()[2:], mode='bilinear') inputs_discriminator = torch.cat((dec1, dec2, dec3, dec4), 1) outputs_discriminator = self.discriminator(inputs_discriminator) loss_discriminator = torch.nn.CrossEntropyLoss(size_average=True)(outputs_discriminator, labels_discriminator) self.correct += (torch.argmax(outputs_discriminator, dim=1) == labels_discriminator).float().sum() self.num_of_subjects += int(outputs_discriminator.size(0)) # Here we get a new batch of target domain slices target_batch = next(target_dl) target_inputs, target_labels = (target_batch['inputs'].to(device), target_batch['labels'].to(device)) outputst, _, _, _, _, _, _, _, _, _ = self.seg_model(target_inputs) batch_trs = target_inputs.cpu().numpy() batch_trs = self.p.map( partial(non_geometric_augmentations, method='bias', norm_training_images=None), np.copy(batch_trs)) batch_trs = self.p.map( partial(non_geometric_augmentations, method='kspace', norm_training_images=None), np.copy(batch_trs)) inputstaug = torch.Tensor(batch_trs).cuda() Theta, Theta_inv = generate_affine(inputstaug, degreeFreedom=self.cf.affine_rot_degree, scale=self.cf.affine_scale, shearingScale=self.cf.affine_shearing) inputstaug = apply_transform(inputstaug, Theta) outputstaug, _, _, _, _, _, _, _, _, _ = self.seg_model(inputstaug) outputst_transformed = apply_transform(outputst, Theta) supervised_loss = dice_soft_loss(torch.sigmoid(outputs), source_labels) pc_loss = alpha * self.criterion(torch.sigmoid(outputstaug), torch.sigmoid(outputst_transformed)) adversarial_loss = - beta * loss_discriminator loss = supervised_loss + pc_loss + adversarial_loss postfix_dict = {'loss': loss.item(), 'supervised_loss': supervised_loss.item(), 'pc_loss': pc_loss.item(), 'adversarial_loss': adversarial_loss.item(), 'loss_discriminator': loss_discriminator.item(), 'acc_discriminator': self.correct/self.num_of_subjects } tensorboard_dict = {'source_inputs': source_inputs, 'target_inputs': target_inputs, 'source_labels': source_labels, 'target_labels': target_labels, 'inputstaug': inputstaug, 'outputs': outputs, 'outputst': outputst} def tensorboard_logging(self, tensorboard_dict, split): if self.cf.task == 'tumour': for idx, modality in enumerate(['flair', 't1c', 't1', 't2']): save_images(writer=self.writer, images=tensorboard_dict['source_inputs'][:, (idx,), :, :], normalize=True, sigmoid=False, iteration=self.iterations, name='source_{}/{}'.format(modality, split)) save_images(writer=self.writer, images=tensorboard_dict['target_inputs'][:, (idx,), :, :], normalize=True, sigmoid=False, iteration=self.iterations, name='target_{}/{}'.format(modality, split)) save_images(writer=self.writer, images=tensorboard_dict['inputstaug'][:, (idx,), :, :], normalize=True, sigmoid=False, iteration=self.iterations, name='{}_aug/{}'.format(modality, split)) elif self.cf.task == 'ms': save_images(writer=self.writer, images=tensorboard_dict['source_labels'], normalize=True, sigmoid=False, iteration=self.iterations, name='source_labels/{}'.format(split), png=True) save_images(writer=self.writer, images=tensorboard_dict['target_labels'], normalize=True, sigmoid=False, iteration=self.iterations, name='target_labels/{}'.format(split), png=True) save_images(writer=self.writer, images=tensorboard_dict['outputs'], normalize=False, sigmoid=True, iteration=self.iterations, name='outputs_source/{}'.format(split), png=True) save_images(writer=self.writer, images=tensorboard_dict['source_inputs'], normalize=True, sigmoid=False, png=True, iteration=self.iterations, name='source_inputs/{}'.format(split)) save_images(writer=self.writer, images=tensorboard_dict['target_inputs'], normalize=True, sigmoid=False, png=True, iteration=self.iterations, name='targets_inputs/{}'.format(split)) save_images(writer=self.writer, images=tensorboard_dict['inputstaug'], normalize=True, sigmoid=False, iteration=self.iterations, name='inputsaug/{}'.format(split)) save_images(writer=self.writer, images=tensorboard_dict['outputst'], normalize=False, sigmoid=True, iteration=self.iterations, name='outputs_target/{}'.format(split)) def load(self, checkpoint_path): self.starting_epoch = int(os.path.basename(checkpoint_path.split('.')[0]).split('_')[-1]) checkpoint = torch.load(checkpoint_path) self.seg_model = self.seg_model.load_state_dict(checkpoint['seg_model']) self.discriminator = self.discriminator.load_state_dict(checkpoint['discriminator']) self.optimizer_discriminator = self.optimizer_discriminator.load_state_dict(checkpoint['optimizer_discriminator']) self.seg_optimizer = self.seg_optimizer.load_state_dict(checkpoint['seg_optimizer']) def save(self): torch.save({'seg_model': self.seg_model.state_dict(), 'discriminator': self.discriminator.state_dict(), 'optimizer_discriminator': self.optimizer_discriminator.state_dict(), 'seg_optimizer': self.seg_optimizer.state_dict(), }, os.path.join(self.models_folder, self.run_name + '_{}.pt'.format(self.iterations))) def epoch_reset(self): self.correct = 0 self.num_of_subjects = 0
56.831169
127
0.616431
1,847
17,504
5.551705
0.113156
0.017554
0.024576
0.032768
0.79842
0.757558
0.745465
0.740979
0.730057
0.68939
0
0.011005
0.273252
17,504
308
128
56.831169
0.795063
0.017996
0
0.680451
0
0
0.05393
0.002682
0
0
0
0
0
1
0.030075
false
0
0.033835
0
0.067669
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
91ef4c7cc520071d50b5652d9a0af7d19fff3b0f
116
py
Python
c8ydm/core/__init__.py
pandora2000/cumulocity-devicemanagement-agent
8669d030bf1b2bb63904e7a53ea70483ec37a44e
[ "Apache-2.0" ]
10
2021-08-06T09:29:24.000Z
2022-03-11T05:29:32.000Z
c8ydm/core/__init__.py
pandora2000/cumulocity-devicemanagement-agent
8669d030bf1b2bb63904e7a53ea70483ec37a44e
[ "Apache-2.0" ]
35
2021-08-03T12:49:17.000Z
2022-03-04T08:24:40.000Z
c8ydm/core/__init__.py
pandora2000/cumulocity-devicemanagement-agent
8669d030bf1b2bb63904e7a53ea70483ec37a44e
[ "Apache-2.0" ]
8
2021-09-01T09:19:14.000Z
2022-02-24T15:53:06.000Z
from c8ydm.core.apt_package_manager import AptPackageManager from c8ydm.core.firmware_manager import FirmwareManager
58
60
0.905172
15
116
6.8
0.666667
0.176471
0.254902
0
0
0
0
0
0
0
0
0.018349
0.060345
116
2
61
58
0.917431
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
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
37df92d4550dca43d947fcdc10e969ce7e977ff3
9,990
py
Python
mmtbx/rotamer/tst_rotamer_eval.py
rimmartin/cctbx_project
644090f9432d9afc22cfb542fc3ab78ca8e15e5d
[ "BSD-3-Clause-LBNL" ]
null
null
null
mmtbx/rotamer/tst_rotamer_eval.py
rimmartin/cctbx_project
644090f9432d9afc22cfb542fc3ab78ca8e15e5d
[ "BSD-3-Clause-LBNL" ]
null
null
null
mmtbx/rotamer/tst_rotamer_eval.py
rimmartin/cctbx_project
644090f9432d9afc22cfb542fc3ab78ca8e15e5d
[ "BSD-3-Clause-LBNL" ]
null
null
null
from __future__ import division import mmtbx.monomer_library from scitbx.array_family import flex import iotbx.pdb from mmtbx.rotamer.rotamer_eval import RotamerEval from libtbx.test_utils import approx_equal pdb_str1 = """\ CRYST1 16.960 19.455 19.841 90.00 90.00 90.00 P 1 SCALE1 0.058962 0.000000 0.000000 0.00000 SCALE2 0.000000 0.051401 0.000000 0.00000 SCALE3 0.000000 0.000000 0.050401 0.00000 ATOM 1 N TYR A 20 10.418 10.903 8.137 1.00 23.81 N ATOM 2 CA TYR A 20 10.810 9.981 7.034 1.00 35.69 C ATOM 3 C TYR A 20 9.703 8.988 6.760 1.00 28.94 C ATOM 4 O TYR A 20 9.364 8.158 7.667 1.00 25.26 O ATOM 5 CB TYR A 20 12.115 9.280 7.395 1.00 33.37 C ATOM 6 CG TYR A 20 13.316 10.201 7.509 1.00 31.48 C ATOM 7 CD1 TYR A 20 14.071 10.517 6.393 1.00 36.91 C ATOM 8 CD2 TYR A 20 13.704 10.721 8.703 1.00 21.36 C ATOM 9 CE1 TYR A 20 15.188 11.317 6.471 1.00 36.56 C ATOM 10 CE2 TYR A 20 14.835 11.519 8.817 1.00 29.56 C ATOM 11 CZ TYR A 20 15.540 11.837 7.694 1.00 35.08 C ATOM 12 OH TYR A 20 16.672 12.664 7.781 1.00 38.73 O ATOM 13 N AARG A 21 9.160 8.989 5.577 0.50 38.95 N ATOM 14 CA AARG A 21 8.073 8.140 5.126 0.50 38.77 C ATOM 15 C AARG A 21 6.863 8.252 6.048 0.50 27.69 C ATOM 16 O AARG A 21 6.208 7.218 6.352 0.50 22.82 O ATOM 17 CB AARG A 21 8.542 6.674 5.053 0.50 20.00 C ATOM 18 CG AARG A 21 7.471 5.695 4.562 0.50 20.00 C ATOM 19 CD AARG A 21 8.021 4.282 4.444 0.50 20.00 C ATOM 20 NE AARG A 21 6.983 3.348 3.946 0.50 20.00 N ATOM 21 CZ AARG A 21 5.878 3.748 3.337 0.50 20.00 C ATOM 22 NH1AARG A 21 5.643 5.047 3.127 0.50 20.00 N ATOM 23 NH2AARG A 21 4.997 2.854 2.938 0.50 20.00 N ATOM 13 N BTRP A 21 9.160 8.989 5.577 0.50 38.95 N ATOM 14 CA BTRP A 21 8.073 8.140 5.126 0.50 38.77 C ATOM 15 C BTRP A 21 6.863 8.252 6.048 0.50 27.69 C ATOM 16 O BTRP A 21 6.208 7.218 6.352 0.50 22.82 O ATOM 17 CB BTRP A 21 8.532 6.683 5.040 0.50 20.00 C ATOM 18 CG BTRP A 21 9.522 6.431 3.944 0.50 20.00 C ATOM 19 CD1BTRP A 21 10.883 6.417 4.051 0.50 20.00 C ATOM 20 CD2BTRP A 21 9.228 6.154 2.569 0.50 20.00 C ATOM 21 NE1BTRP A 21 11.453 6.152 2.830 0.50 20.00 N ATOM 22 CE2BTRP A 21 10.459 5.985 1.902 0.50 20.00 C ATOM 23 CE3BTRP A 21 8.047 6.033 1.829 0.50 20.00 C ATOM 24 CZ2BTRP A 21 10.541 5.702 0.540 0.50 20.00 C ATOM 25 CZ3BTRP A 21 8.131 5.752 0.478 0.50 20.00 C ATOM 26 CH2BTRP A 21 9.368 5.590 -0.152 0.50 20.00 C ATOM 29 N CHIS A 21 9.160 8.989 5.577 1.00 38.95 N ATOM 30 CA CHIS A 21 8.073 8.140 5.126 1.00 38.77 C ATOM 31 C CHIS A 21 6.863 8.252 6.048 1.00 27.69 C ATOM 32 O CHIS A 21 6.208 7.218 6.352 1.00 22.82 O ATOM 33 CB CHIS A 21 8.533 6.684 5.037 1.00 20.00 C ATOM 34 CG CHIS A 21 9.008 6.118 6.338 1.00 20.00 C ATOM 35 ND1CHIS A 21 8.412 6.420 7.544 1.00 20.00 N ATOM 36 CD2CHIS A 21 10.019 5.265 6.623 1.00 20.00 C ATOM 37 CE1CHIS A 21 9.038 5.781 8.515 1.00 20.00 C ATOM 38 NE2CHIS A 21 10.017 5.071 7.985 1.00 20.00 N ATOM 32 N GLY A 22 6.554 9.436 6.463 1.00 24.85 N ATOM 33 CA GLY A 22 5.410 9.707 7.327 1.00 29.53 C ATOM 34 C GLY A 22 5.748 9.622 8.821 1.00 33.22 C ATOM 35 O GLY A 22 5.479 10.518 9.577 1.00 30.06 O ATOM 36 N TYR A 23 6.330 8.487 9.201 1.00 27.25 N ATOM 37 CA TYR A 23 6.695 8.251 10.596 1.00 34.16 C ATOM 38 C TYR A 23 7.852 9.136 11.044 1.00 23.48 C ATOM 39 O TYR A 23 8.641 9.570 10.203 1.00 39.30 O ATOM 40 CB TYR A 23 7.052 6.786 10.831 1.00 29.65 C ATOM 41 CG TYR A 23 5.903 5.834 10.636 1.00 34.88 C ATOM 42 CD1 TYR A 23 5.022 5.540 11.687 1.00 30.77 C ATOM 43 CD2 TYR A 23 5.649 5.271 9.396 1.00 32.29 C ATOM 44 CE1 TYR A 23 3.990 4.674 11.505 1.00 39.91 C ATOM 45 CE2 TYR A 23 4.589 4.378 9.190 1.00 30.45 C ATOM 46 CZ TYR A 23 3.770 4.107 10.257 1.00 37.13 C ATOM 47 OH TYR A 23 2.693 3.226 10.097 1.00 38.59 O ATOM 48 N SER A 24 7.948 9.408 12.310 1.00 36.25 N ATOM 49 CA SER A 24 9.013 10.264 12.855 1.00 26.44 C ATOM 50 C SER A 24 9.607 9.636 14.109 1.00 20.40 C ATOM 51 O SER A 24 8.916 9.382 15.096 1.00 39.27 O ATOM 52 CB SER A 24 8.482 11.655 13.176 1.00 21.07 C ATOM 53 OG SER A 24 7.498 11.601 14.206 1.00 34.95 O TER 54 SER A 24 END """ pdb_str2 = """\ ATOM 28 N PRO C 29 61.293 16.365 38.366 1.00 45.42 N ATOM 29 CA PRO C 29 61.610 17.144 39.554 1.00 51.27 C ATOM 30 C PRO C 29 60.399 17.813 40.109 1.00 50.43 C ATOM 31 O PRO C 29 59.324 17.664 39.560 1.00 47.67 O ATOM 32 CB PRO C 29 62.495 18.235 38.993 1.00 49.45 C ATOM 33 CG PRO C 29 61.908 18.507 37.705 1.00 55.39 C ATOM 34 CD PRO C 29 61.575 17.152 37.157 1.00 56.41 C """ pdb_str3 = """\ ATOM 127 N PRO L 18 18.596 -78.410 66.845 1.00 33.30 N ATOM 128 CA PRO L 18 19.467 -77.234 66.790 1.00 32.71 C ATOM 129 C PRO L 18 20.924 -77.585 66.494 1.00 30.96 C ATOM 130 O PRO L 18 21.369 -78.705 66.735 1.00 30.74 O ATOM 131 CB PRO L 18 19.289 -76.622 68.173 1.00 31.82 C ATOM 132 CG PRO L 18 19.175 -77.838 69.037 1.00 33.36 C ATOM 133 CD PRO L 18 18.236 -78.728 68.240 1.00 34.01 C ATOM 134 N ALA L 19 21.657 -76.614 65.963 1.00 28.50 N ATOM 135 CA ALA L 19 23.064 -76.802 65.641 1.00 27.23 C ATOM 136 C ALA L 19 23.816 -75.537 66.027 1.00 27.07 C ATOM 137 O ALA L 19 23.265 -74.434 65.976 1.00 24.32 O ATOM 138 CB ALA L 19 23.231 -77.079 64.157 1.00 30.04 C ATOM 139 N SER L 20 25.075 -75.694 66.411 1.00 24.81 N ATOM 140 CA SER L 20 25.874 -74.549 66.816 1.00 27.97 C ATOM 141 C SER L 20 27.304 -74.675 66.310 1.00 26.96 C ATOM 142 O SER L 20 27.912 -75.739 66.408 1.00 27.07 O ATOM 143 CB SER L 20 25.863 -74.436 68.344 1.00 29.31 C ATOM 144 OG SER L 20 26.505 -73.254 68.779 1.00 39.96 O """ def run(pdb_str, expected_ids): get_class = iotbx.pdb.common_residue_names_get_class mon_lib_srv = mmtbx.monomer_library.server.server() rotamer_manager = RotamerEval() pdb_inp = iotbx.pdb.input(source_info=None, lines=pdb_str) pdb_hierarchy = pdb_inp.construct_hierarchy() result_ids = [] for residue_group in pdb_hierarchy.residue_groups(): for conformer in residue_group.conformers(): for residue in conformer.residues(): sites_cart = residue.atoms().extract_xyz() rotamer_name = rotamer_manager.evaluate_residue(residue=residue) print residue.resname, residue.resseq, rotamer_name result_ids.append(rotamer_name) if(get_class(residue.resname) == "common_amino_acid"): rotamer_iterator = mon_lib_srv.rotamer_iterator( fine_sampling = True, comp_id = residue.resname, atom_names = residue.atoms().extract_name(), sites_cart = sites_cart) if(rotamer_iterator is None or rotamer_iterator.problem_message is not None or rotamer_iterator.rotamer_info is None): rotamer_iterator = None if(rotamer_iterator is not None): d1_min, d2_min = 1.e+9, 1.e+9 for r, rotamer_sites_cart in rotamer_iterator: sites_cart_rot = rotamer_manager.nearest_rotamer_sites_cart( residue=residue) d1= flex.mean(flex.sqrt((sites_cart - sites_cart_rot).dot())) d2= flex.mean(flex.sqrt((sites_cart - rotamer_sites_cart).dot())) if(d1 < d1_min): d1_min = d1 if(d2 < d2_min): d2_min = d2 assert approx_equal(d1_min, d2_min) assert result_ids == expected_ids if(__name__ == "__main__"): run(pdb_str = pdb_str1, expected_ids=['m-80', 'OUTLIER', 'm100', 'OUTLIER', None, 'm-80', 'p']) run(pdb_str = pdb_str2, expected_ids=['Cg_endo']) run(pdb_str = pdb_str3, expected_ids=['Cg_endo', 'EXCEPTION', 't'])
62.830189
97
0.501902
1,936
9,990
2.534607
0.247417
0.042185
0.017322
0.024251
0.137762
0.131649
0.079886
0.068474
0.049725
0.049725
0
0.426687
0.423123
9,990
158
98
63.227848
0.424779
0
0
0.019608
0
0.620915
0.777377
0
0
0
0
0
0.013072
0
null
null
0
0.039216
null
null
0.006536
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
5307e1ef759db6a78baa7071944b677c7953cd2f
14,328
py
Python
src/the_tale/the_tale/game/heroes/tests/test_statistics.py
al-arz/the-tale
542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5
[ "BSD-3-Clause" ]
1
2020-04-02T11:51:20.000Z
2020-04-02T11:51:20.000Z
src/the_tale/the_tale/game/heroes/tests/test_statistics.py
al-arz/the-tale
542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5
[ "BSD-3-Clause" ]
null
null
null
src/the_tale/the_tale/game/heroes/tests/test_statistics.py
al-arz/the-tale
542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5
[ "BSD-3-Clause" ]
null
null
null
import smart_imports smart_imports.all() class HeroStatisticsTest(utils_testcase.TestCase): def setUp(self): super(HeroStatisticsTest, self).setUp() self.place_1, self.place_2, self.place_3 = game_logic.create_test_map() account = self.accounts_factory.create_account() self.storage = game_logic_storage.LogicStorage() self.storage.load_account_data(account) self.hero = self.storage.accounts_to_heroes[account.id] self.hero.statistics.change_money(relations.MONEY_SOURCE.EARNED_FROM_LOOT, 10) self.hero.statistics.change_artifacts_had(11) self.hero.statistics.change_quests_done(12) self.hero.statistics.change_pve_kills(13) self.hero.statistics.change_pve_deaths(14) self.hero.statistics.change_pvp_battles_1x1_victories(16) self.hero.statistics.change_help_count(17) self.hero.statistics.change_cards_used(18) self.hero.statistics.change_cards_combined(19) self.hero.statistics.change_gifts_returned(20) self.hero.statistics.change_companions_count(21) self.assertEqual(self.hero.statistics.pvp_battles_1x1_number, 16) def test_change_money__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_money(relations.MONEY_SOURCE.SPEND_FOR_HEAL, 666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.MONEY, old_value=10, new_value=10)]) with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_money(relations.MONEY_SOURCE.EARNED_FROM_LOOT, 666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.MONEY, old_value=10, new_value=10 + 666)]) def test_change_artifacts_had__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_artifacts_had(666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.ARTIFACTS, old_value=11, new_value=11 + 666)]) def test_change_quests_done__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_quests_done(666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.QUESTS, old_value=12, new_value=12 + 666)]) def test_change_pve_kills__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_pve_kills(666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.MOBS, old_value=13, new_value=13 + 666)]) def test_change_pve_deaths__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_pve_deaths(666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.DEATHS, old_value=14, new_value=14 + 666)]) def test_change_pvp_battles_1x1_victories__achievements(self): self.assertTrue(self.hero.statistics.pvp_battles_1x1_number < conf.settings.MIN_PVP_BATTLES) with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_pvp_battles_1x1_victories(1) self.assertEqual(verify_achievements.call_args_list, [mock.call(new_value=0, old_value=0, account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_VICTORIES_1X1), mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_BATTLES_1X1, old_value=16, new_value=16 + 1)]) self.hero.statistics.change_pvp_battles_1x1_defeats(conf.settings.MIN_PVP_BATTLES) with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_pvp_battles_1x1_victories(666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_VICTORIES_1X1, old_value=int(float(17) / (17 + conf.settings.MIN_PVP_BATTLES) * 100), new_value=int(float(17 + 666) / self.hero.statistics.pvp_battles_1x1_number * 100)), mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_BATTLES_1X1, old_value=16 + 1 + conf.settings.MIN_PVP_BATTLES, new_value=16 + 1 + conf.settings.MIN_PVP_BATTLES + 666)]) def test_change_pvp_battles_1x1_draws__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_pvp_battles_1x1_draws(1) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_BATTLES_1X1, old_value=16, new_value=16 + 1)]) def test_change_pvp_battles_1x1_defeats__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_pvp_battles_1x1_defeats(1) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_BATTLES_1X1, old_value=16, new_value=16 + 1)]) def test_change_help_count__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_help_count(666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.KEEPER_HELP_COUNT, old_value=17, new_value=17 + 666)]) def test_change_cards_used__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_cards_used(666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.KEEPER_CARDS_USED, old_value=18, new_value=18 + 666)]) def test_change_cards_combined__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_cards_combined(666) self.assertEqual(verify_achievements.call_args_list, [mock.call(account_id=self.hero.account_id, type=achievements_relations.ACHIEVEMENT_TYPE.KEEPER_CARDS_COMBINED, old_value=19, new_value=19 + 666)]) def test_change_giftst_used__achievements(self): with mock.patch('the_tale.accounts.achievements.storage.AchievementsStorage.verify_achievements') as verify_achievements: self.hero.statistics.change_gifts_returned(666) self.assertEqual(verify_achievements.call_args_list, []) @mock.patch('the_tale.game.heroes.conf.settings.MIN_PVP_BATTLES', 1000) def test_change_pvp_battles_1x1_victories__multiple_victories_achievements(self): achievement_1 = achievements_prototypes.AchievementPrototype.create(group=achievements_relations.ACHIEVEMENT_GROUP.MONEY, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_VICTORIES_1X1, barrier=10, points=10, caption='achievement_1', description='description_1', approved=True) achievement_2 = achievements_prototypes.AchievementPrototype.create(group=achievements_relations.ACHIEVEMENT_GROUP.MONEY, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_VICTORIES_1X1, barrier=20, points=10, caption='achievement_2', description='description_2', approved=True) achievement_3 = achievements_prototypes.AchievementPrototype.create(group=achievements_relations.ACHIEVEMENT_GROUP.MONEY, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_VICTORIES_1X1, barrier=30, points=10, caption='achievement_3', description='description_3', approved=True) achievement_4 = achievements_prototypes.AchievementPrototype.create(group=achievements_relations.ACHIEVEMENT_GROUP.MONEY, type=achievements_relations.ACHIEVEMENT_TYPE.PVP_VICTORIES_1X1, barrier=40, points=10, caption='achievement_4', description='description_4', approved=True) self.assertEqual(self.hero.statistics.pvp_battles_1x1_number, 16) with self.check_not_changed(achievements_prototypes.GiveAchievementTaskPrototype._db_count): self.hero.statistics.change_pvp_battles_1x1_draws(400) self.hero.statistics.change_pvp_battles_1x1_defeats(300) with self.check_delta(achievements_prototypes.GiveAchievementTaskPrototype._db_count, 3): self.hero.statistics.change_pvp_battles_1x1_victories(300) self.assertEqual(set(achievements_prototypes.GiveAchievementTaskPrototype._db_all().values_list('achievement_id', flat=True)), set([achievement_1.id, achievement_2.id, achievement_3.id])) with self.check_delta(achievements_prototypes.GiveAchievementTaskPrototype._db_count, 1): self.hero.statistics.change_pvp_battles_1x1_victories(200) self.assertEqual(set(achievements_prototypes.GiveAchievementTaskPrototype._db_all().values_list('achievement_id', flat=True)), set([achievement_1.id, achievement_2.id, achievement_3.id, achievement_4.id])) self.assertEqual(self.hero.statistics.pvp_battles_1x1_number, 1216) self.assertEqual(self.hero.statistics.pvp_battles_1x1_victories, 516) self.assertEqual(self.hero.statistics.pvp_battles_1x1_defeats, 300) self.assertEqual(self.hero.statistics.pvp_battles_1x1_draws, 400)
66.333333
216
0.589894
1,359
14,328
5.869021
0.098602
0.054162
0.085757
0.090271
0.845787
0.817828
0.77332
0.751254
0.691324
0.659478
0
0.031343
0.340871
14,328
215
217
66.64186
0.813215
0
0
0.304636
0
0
0.088923
0.07971
0
0
0
0
0.152318
1
0.092715
false
0
0.013245
0
0.112583
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
531172c1133601dd22991cbc9703c845b0101094
78
py
Python
util/data_model_util.py
HaveTwoBrush/chatbot
5532604c810e3e0cb94eb53eecfb07ac9e286ea5
[ "Apache-2.0" ]
29
2019-01-15T02:06:55.000Z
2019-11-03T13:39:36.000Z
util/data_model_util.py
kinggreenhall/chatbot
5532604c810e3e0cb94eb53eecfb07ac9e286ea5
[ "Apache-2.0" ]
1
2019-05-01T06:30:41.000Z
2019-05-03T13:59:20.000Z
util/data_model_util.py
kinggreenhall/chatbot
5532604c810e3e0cb94eb53eecfb07ac9e286ea5
[ "Apache-2.0" ]
5
2019-03-27T08:44:07.000Z
2019-11-05T15:49:50.000Z
from pydantic import BaseModel class Question(BaseModel): question: str
13
30
0.769231
9
78
6.666667
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.179487
78
5
31
15.6
0.9375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
531eb618ebbb57f1677d7ed25bca4b1c7b1d6687
81
py
Python
lessons 21/HomeWork/task1.py
zainllw0w/skillbox
896287b6f7f5612cf589094131fd1a12b0b192ba
[ "MIT" ]
null
null
null
lessons 21/HomeWork/task1.py
zainllw0w/skillbox
896287b6f7f5612cf589094131fd1a12b0b192ba
[ "MIT" ]
null
null
null
lessons 21/HomeWork/task1.py
zainllw0w/skillbox
896287b6f7f5612cf589094131fd1a12b0b192ba
[ "MIT" ]
null
null
null
def f(n, c=1): print(c) if c == n: return c f(n, c+1) f(12)
10.125
16
0.382716
18
81
1.722222
0.5
0.129032
0.193548
0.258065
0
0
0
0
0
0
0
0.085106
0.419753
81
8
17
10.125
0.574468
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.333333
0.166667
1
0
1
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
532893dcc29f4c78c76679c66dd1c282eba9454d
45
py
Python
File/views.py
nikminer/HomeCloud
7571e8002ef0919b382c3802d680421bd094d866
[ "MIT" ]
null
null
null
File/views.py
nikminer/HomeCloud
7571e8002ef0919b382c3802d680421bd094d866
[ "MIT" ]
null
null
null
File/views.py
nikminer/HomeCloud
7571e8002ef0919b382c3802d680421bd094d866
[ "MIT" ]
null
null
null
from django.shortcuts import render,redirect
22.5
44
0.866667
6
45
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.088889
45
1
45
45
0.95122
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
7260a429d8c1962a39620c21dfc5943c5b7662a0
224
py
Python
kivy/core/video/video_null.py
Galland/kivy
95a6bf279883d706f645e4629c16d5ee1038f0ec
[ "MIT" ]
13,889
2015-01-01T06:43:41.000Z
2022-03-31T17:37:56.000Z
kivy/core/video/video_null.py
Galland/kivy
95a6bf279883d706f645e4629c16d5ee1038f0ec
[ "MIT" ]
4,570
2015-01-01T17:58:52.000Z
2022-03-31T18:42:16.000Z
kivy/core/video/video_null.py
Galland/kivy
95a6bf279883d706f645e4629c16d5ee1038f0ec
[ "MIT" ]
3,786
2015-01-01T09:20:45.000Z
2022-03-30T21:15:05.000Z
''' VideoNull: empty implementation of VideoBase for the no provider case ''' from kivy.core.video import VideoBase class VideoNull(VideoBase): '''VideoBase implementation when there is no provider. ''' pass
17.230769
69
0.723214
27
224
6
0.740741
0.123457
0
0
0
0
0
0
0
0
0
0
0.191964
224
12
70
18.666667
0.895028
0.5625
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
72aab33611e5e10f68454d5fc13d3594bfca7476
225
py
Python
enthought/permissions/action/__init__.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/permissions/default/__init__.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/permissions/default/__init__.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
#------------------------------------------------------------------------------ # Copyright (c) 2008 by Enthought, Inc. # All rights reserved. #------------------------------------------------------------------------------
32.142857
79
0.2
9
225
5
1
0
0
0
0
0
0
0
0
0
0
0.019048
0.066667
225
6
80
37.5
0.195238
0.955556
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
72c02e8781764ae150eb0f8148c7d0eef244d3cb
289
py
Python
templates/toto/chat/chat/receive_message.py
VNUELIVE/Toto
6940b4114fc6b680e0d40ae248b7d2599c954f81
[ "MIT" ]
null
null
null
templates/toto/chat/chat/receive_message.py
VNUELIVE/Toto
6940b4114fc6b680e0d40ae248b7d2599c954f81
[ "MIT" ]
null
null
null
templates/toto/chat/chat/receive_message.py
VNUELIVE/Toto
6940b4114fc6b680e0d40ae248b7d2599c954f81
[ "MIT" ]
null
null
null
import toto from toto.invocation import * from tornado.ioloop import IOLoop @asynchronous def invoke(handler, params): def receive_message(message): handler.respond(result={'message': message}) handler.register_event_handler('message', receive_message, deregister_on_finish=True)
28.9
87
0.799308
36
289
6.25
0.583333
0.124444
0.186667
0
0
0
0
0
0
0
0
0
0.103806
289
9
88
32.111111
0.868726
0
0
0
0
0
0.048443
0
0
0
0
0
0
1
0.25
false
0
0.375
0
0.625
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
1
0
0
1
0
1
0
0
5
72d946a523010bfbd7615a76fe493de1fb55345d
43
py
Python
searchengine/__init__.py
qoda/python-searchengine
d514ddbc0be9755ed48143b38dd4591d0123b1bc
[ "BSD-3-Clause" ]
19
2015-01-21T14:46:20.000Z
2021-04-28T22:46:31.000Z
searchengine/__init__.py
gourav245/python-searchengine
d514ddbc0be9755ed48143b38dd4591d0123b1bc
[ "BSD-3-Clause" ]
1
2020-03-07T08:41:20.000Z
2020-03-11T09:16:59.000Z
searchengine/__init__.py
gourav245/python-searchengine
d514ddbc0be9755ed48143b38dd4591d0123b1bc
[ "BSD-3-Clause" ]
15
2015-03-28T07:44:52.000Z
2021-01-28T23:45:20.000Z
from main import SearchEngine, searchengine
43
43
0.883721
5
43
7.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.093023
43
1
43
43
0.974359
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
72f3ffb26050c448bd869255885f3bef17ed3ae6
209
py
Python
omap/assets/admin.py
GoetzGoerisch/open-machine-plattform
b46f12fe008bd72993f2118e003298b99660d673
[ "Apache-2.0" ]
3
2022-03-21T18:01:22.000Z
2022-03-28T11:49:30.000Z
omap/assets/admin.py
GoetzGoerisch/open-machine-plattform
b46f12fe008bd72993f2118e003298b99660d673
[ "Apache-2.0" ]
10
2022-03-18T11:04:16.000Z
2022-03-29T07:23:52.000Z
omap/assets/admin.py
GoetzGoerisch/open-machine-plattform
b46f12fe008bd72993f2118e003298b99660d673
[ "Apache-2.0" ]
1
2022-03-25T09:08:29.000Z
2022-03-25T09:08:29.000Z
from django.contrib import admin from omap.assets.models import SimpleAsset, RelationType, AssetRelation admin.site.register(SimpleAsset) admin.site.register(RelationType) admin.site.register(AssetRelation)
26.125
71
0.84689
25
209
7.08
0.52
0.152542
0.288136
0
0
0
0
0
0
0
0
0
0.07177
209
7
72
29.857143
0.912371
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
72f410461dba5af3864169f018ffcae2204f590a
1,319
py
Python
pyutilib/component/config/__init__.py
PyUtilib/PyUtilib
d99406f2af1fb62268c34453a2fbe6bd4a7348f0
[ "BSD-3-Clause" ]
24
2016-04-02T10:00:02.000Z
2021-03-02T16:40:18.000Z
pyutilib/component/config/__init__.py
PyUtilib/PyUtilib
d99406f2af1fb62268c34453a2fbe6bd4a7348f0
[ "BSD-3-Clause" ]
105
2015-10-29T03:29:58.000Z
2021-12-30T22:00:45.000Z
pyutilib/component/config/__init__.py
PyUtilib/PyUtilib
d99406f2af1fb62268c34453a2fbe6bd4a7348f0
[ "BSD-3-Clause" ]
22
2016-01-21T15:35:25.000Z
2021-05-15T20:17:44.000Z
# _________________________________________________________________________ # # PyUtilib: A Python utility library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the BSD License. # Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, # the U.S. Government retains certain rights in this software. # _________________________________________________________________________ """ The pyutilib.component.config package includes utilities to configure the PyUtilib Component Architecture. This includes facilities for using configuration files, controlling logging, and specifying component options. """ from pyutilib.component.core import PluginGlobals PluginGlobals.add_env("pca") from pyutilib.component.config.env_config import EnvironmentConfig from pyutilib.component.config.options import ExecutableOption, declare_option, Option from pyutilib.component.config.managed_plugin import ManagedPlugin, ManagedSingletonPlugin from pyutilib.component.config.configuration import Configuration, ConfigurationError from pyutilib.component.config.logging_config import LoggingConfig from pyutilib.component.config.tempfiles import ITempfileManager, TempfileManagerPlugin, TempfileManager import pyutilib.component.config.plugin_ConfigParser PluginGlobals.pop_env()
48.851852
104
0.855951
136
1,319
7.176471
0.536765
0.17418
0.188525
0.165984
0
0
0
0
0
0
0
0.010851
0.091736
1,319
26
105
50.730769
0.80384
0.479909
0
0
0
0
0.004471
0
0
0
0
0
0
1
0
true
0
0.8
0
0.8
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
72f6522d25ecaf761815215930c0b9d563767e70
202
py
Python
auth_user/private_permissions.py
volhadounar/infra_sp2
3851fb3a2cc86d447667d00840798c041dedbf9b
[ "BSD-2-Clause" ]
null
null
null
auth_user/private_permissions.py
volhadounar/infra_sp2
3851fb3a2cc86d447667d00840798c041dedbf9b
[ "BSD-2-Clause" ]
null
null
null
auth_user/private_permissions.py
volhadounar/infra_sp2
3851fb3a2cc86d447667d00840798c041dedbf9b
[ "BSD-2-Clause" ]
null
null
null
from rest_framework import permissions class IsAdminRole(permissions.BasePermission): """Права администратора.""" def has_permission(self, request, view): return request.user.is_admin
25.25
46
0.752475
22
202
6.772727
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.158416
202
7
47
28.857143
0.876471
0.10396
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
f4041b89e151d96c231b02e41e07ab84a65e7c1a
134
py
Python
cio/backends/exceptions.py
beshrkayali/content-io
ae44aa4c4eba2234f940ca9d7a4bb310e25075b3
[ "BSD-3-Clause" ]
6
2015-02-12T20:23:42.000Z
2020-01-10T09:42:32.000Z
cio/backends/exceptions.py
beshrkayali/content-io
ae44aa4c4eba2234f940ca9d7a4bb310e25075b3
[ "BSD-3-Clause" ]
5
2015-09-08T08:54:39.000Z
2020-01-10T12:13:21.000Z
cio/backends/exceptions.py
beshrkayali/content-io
ae44aa4c4eba2234f940ca9d7a4bb310e25075b3
[ "BSD-3-Clause" ]
4
2015-06-29T15:21:41.000Z
2019-12-06T09:29:30.000Z
class InvalidBackend(Exception): pass class NodeDoesNotExist(Exception): pass class PersistenceError(Exception): pass
12.181818
34
0.746269
12
134
8.333333
0.5
0.39
0.36
0
0
0
0
0
0
0
0
0
0.186567
134
10
35
13.4
0.917431
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
f43f698a19be9603b81ba2a541d87db259ca719b
166
py
Python
mtgproxies/__init__.py
Buntry/mtg-proxies
dbff7fc9caf984c2c93271ce1b9e8db5114c0f10
[ "MIT" ]
10
2020-05-17T14:30:10.000Z
2022-02-11T19:10:20.000Z
mtgproxies/__init__.py
Buntry/mtg-proxies
dbff7fc9caf984c2c93271ce1b9e8db5114c0f10
[ "MIT" ]
11
2020-05-01T16:56:23.000Z
2022-03-30T21:58:32.000Z
mtgproxies/__init__.py
Buntry/mtg-proxies
dbff7fc9caf984c2c93271ce1b9e8db5114c0f10
[ "MIT" ]
2
2020-06-12T23:44:10.000Z
2021-12-13T13:47:29.000Z
from mtgproxies.print_cards import print_cards from mtgproxies.scans import fetch_scans_scryfall __all__ = [ 'fetch_scans_scryfall', 'print_cards', ]
20.75
50
0.753012
20
166
5.7
0.45
0.263158
0.315789
0
0
0
0
0
0
0
0
0
0.180723
166
7
51
23.714286
0.838235
0
0
0
0
0
0.194969
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.333333
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
f442864f035c912099ce78a4b168f9174c606180
80
py
Python
bases_2021_1S/Grupo 05/client/setup.py
dadu0699/tytus
e1920f6932c840859e3e79eb8756a1d3da88bd77
[ "MIT" ]
35
2020-12-07T03:11:43.000Z
2021-04-15T17:38:16.000Z
bases_2021_1S/Grupo 05/client/setup.py
dadu0699/tytus
e1920f6932c840859e3e79eb8756a1d3da88bd77
[ "MIT" ]
47
2020-12-09T01:29:09.000Z
2021-01-13T05:37:50.000Z
bases_2021_1S/Grupo 05/client/setup.py
dadu0699/tytus
e1920f6932c840859e3e79eb8756a1d3da88bd77
[ "MIT" ]
556
2020-12-07T03:13:31.000Z
2021-06-17T17:41:10.000Z
from distutils.core import setup import py2exe setup(console=['Controller.py'])
20
32
0.8
11
80
5.818182
0.818182
0
0
0
0
0
0
0
0
0
0
0.013699
0.0875
80
4
33
20
0.863014
0
0
0
0
0
0.160494
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
f45cf46dc4403c4c18958b20652387236bb273b6
158
wsgi
Python
supervisor-sample.wsgi
UoMCS/supervisor-finder
e6233b20a39a183ba0fd83acbcdfa308aa42f74c
[ "MIT" ]
null
null
null
supervisor-sample.wsgi
UoMCS/supervisor-finder
e6233b20a39a183ba0fd83acbcdfa308aa42f74c
[ "MIT" ]
null
null
null
supervisor-sample.wsgi
UoMCS/supervisor-finder
e6233b20a39a183ba0fd83acbcdfa308aa42f74c
[ "MIT" ]
null
null
null
import sys import logging sys.path.insert(0, '/path/to/supervisor-finder') logging.basicConfig(stream=sys.stderr) from supervisor import app as application
19.75
48
0.803797
23
158
5.521739
0.695652
0
0
0
0
0
0
0
0
0
0
0.006993
0.094937
158
7
49
22.571429
0.881119
0
0
0
0
0
0.164557
0.164557
0
0
0
0
0
1
0
true
0
0.6
0
0.6
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
f484aa9b11bba37677bbd83d7e370aee531d9a02
27,547
py
Python
apps/dstltcsi/twobranch.py
iamsoroush/deepstream_python_apps
cbdc6cb8f0824a4aa485a83382e9fc521f1b64ea
[ "MIT" ]
null
null
null
apps/dstltcsi/twobranch.py
iamsoroush/deepstream_python_apps
cbdc6cb8f0824a4aa485a83382e9fc521f1b64ea
[ "MIT" ]
null
null
null
apps/dstltcsi/twobranch.py
iamsoroush/deepstream_python_apps
cbdc6cb8f0824a4aa485a83382e9fc521f1b64ea
[ "MIT" ]
null
null
null
import sys sys.path.append('../') sys.path.append('/opt/nvidia/deepstream/deepstream/lib') from time import sleep import time import numpy as np import gi gi.require_version('Gst', '1.0') gi.require_version('GstVideo', '1.0') from gi.repository import GObject, Gst, GstVideo from common.FPS import GETFPS import pyds from gstutils import get_num_channels, get_np_dtype from my_utils import Segmentor PGIE_CLASS_ID_VEHICLE = 0 PGIE_CLASS_ID_BICYCLE = 1 PGIE_CLASS_ID_PERSON = 2 PGIE_CLASS_ID_ROADSIGN = 3 segmentor = Segmentor((720, 1280, 3), network_name='fcn-resnet18-cityscapes-1024x512') def gst_to_np(sample): buffer = sample.get_buffer() # print(f'pts: {buffer.pts / 1e9} -- dts: {buffer.dts / 1e9} -- offset: {buffer.offset} -- duration: {buffer.duration / 1e9}') caps = sample.get_caps() # print(caps.get_structure(0).get_value('format')) # print(caps.get_structure(0).get_value('height')) # print(caps.get_structure(0).get_value('width')) # batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(buffer)) # l_frame = batch_meta.frame_meta_list # frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data) # frame_number = frame_meta.frame_num # pts = frame_meta.buf_pts # ntp_ts = frame_meta.ntp_timestamp # print(f'frame number: {frame_number}') # print(f'frame pts (seconds): {pts / 1e9}') # print(f'ntp timestamp (seconds): {ntp_ts / 1e9}') print(f'from appsink ------- pts: {buffer.pts / 1e9}') caps_format = caps.get_structure(0) video_format = GstVideo.VideoFormat.from_string( caps_format.get_value('format')) w, h = caps_format.get_value('width'), caps_format.get_value('height') c = get_num_channels(video_format) buffer_size = buffer.get_size() shape = (h, w, c) if (h * w * c == buffer_size) else buffer_size array = np.ndarray(shape=shape, buffer=buffer.extract_dup(0, buffer_size), dtype=get_np_dtype(video_format)) return np.squeeze(array), buffer.pts def new_buffer(sink, data): start_time = time.time() sample = sink.emit("pull-sample") arr, pts = gst_to_np(sample) # print(f'data type: {arr.dtype}') segmentor.do_segmentation(arr, str(pts)) # seg_map = segnet.predict(arr) # cv2.imwrite(f'{pts}.jpg', cv2.cvtColor(seg_map, cv2.COLOR_RGB2BGR)) print(f'--------- segmentation done: {time.time() - start_time} ----------') return Gst.FlowReturn.OK class Pipeline: def __init__(self, input_file_path, model_config_path='./model/config_infer_primary_detectnet_v2.txt', labels_path='./model/detectnet_v2_labels.txt', output_file_path='./out.mp4'): self.model_config_path = model_config_path self.labels_path = labels_path self.output_file_path = output_file_path self.width = 1280 self.height = 720 GObject.threads_init() Gst.init(None) self.pipeline = Gst.Pipeline() if not self.pipeline: sys.stderr.write(" Unable to create Pipeline \n") self.source, self.h264parser, self.decoder = self._create_source_elements(input_file_path) self.streammux, self.pgie = self._create_middle_elements() self.nvvidconv, self.capsfilter, self.sink = self._create_sink_elements() # Link the elements print("Linking elements in the Pipeline \n") self._link() # osdsinkpad = self.nvosd.get_static_pad("sink") # if not osdsinkpad: # sys.stderr.write(" Unable to get sink pad of nvosd \n") # # osdsinkpad.add_probe(Gst.PadProbeType.BUFFER, self.osd_sink_pad_buffer_probe, 0) self.loop = GObject.MainLoop() self.bus = self.pipeline.get_bus() self.bus.add_signal_watch() self.bus.connect("message::eos", self._bus_call, self.loop) def start(self): # start play back and listen to events print("Starting pipeline \n") self.pipeline.set_state(Gst.State.PLAYING) self.loop.run() def _create_source_elements(self, file_path): # Source element for reading from the file source = Gst.ElementFactory.make("filesrc", "file-source") if not source: sys.stderr.write(" Unable to create Source \n") # Since the data format in the input file is elementary h264 stream, # we need a h264parser h264parser = Gst.ElementFactory.make("h264parse", "h264-parser") if not h264parser: sys.stderr.write(" Unable to create h264 parser \n") # Use nvdec_h264 for hardware accelerated decode on GPU decoder = Gst.ElementFactory.make("nvv4l2decoder", "nvv4l2-decoder") if not decoder: sys.stderr.write(" Unable to create Nvv4l2 Decoder \n") source.set_property('location', file_path) self.pipeline.add(source) self.pipeline.add(h264parser) self.pipeline.add(decoder) return source, h264parser, decoder def _create_middle_elements(self): streammux = Gst.ElementFactory.make("nvstreammux", "Stream-muxer") if not streammux: sys.stderr.write(" Unable to create NvStreamMux \n") # Use nvinfer to run inferencing on decoder's output, # behaviour of inferencing is set through config file pgie = Gst.ElementFactory.make("nvinfer", "primary-inference") if not pgie: sys.stderr.write(" Unable to create pgie \n") # # Use convertor to convert from NV12 to RGBA as required by nvosd # nvvidconv = Gst.ElementFactory.make("nvvideoconvert", "convertor") # if not nvvidconv: # sys.stderr.write(" Unable to create nvvidconv \n") # Create OSD to draw on the converted RGBA buffer # nvosd = Gst.ElementFactory.make("nvdsosd", "onscreendisplay") # if not nvosd: # sys.stderr.write(" Unable to create nvosd \n") # # nvosd.set_property('display-clock', 1) # here: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvdsosd.html streammux.set_property('width', self.width) streammux.set_property('height', self.height) streammux.set_property('batch-size', 1) streammux.set_property('batched-push-timeout', 4000000) pgie.set_property('config-file-path', self.model_config_path) self.pipeline.add(streammux) self.pipeline.add(pgie) # self.pipeline.add(nvvidconv) # self.pipeline.add(nvosd) return streammux, pgie def _create_sink_elements(self): nvvidconv = Gst.ElementFactory.make("nvvideoconvert", "convertor appsink") if not nvvidconv: sys.stderr.write(" Unable to create nvvidconv2 \n") capsfilter = Gst.ElementFactory.make("capsfilter", "capsfilter") if not capsfilter: sys.stderr.write(" Unable to create capsfilter \n") caps = Gst.Caps.from_string("video/x-raw, format=RGBA") capsfilter.set_property("caps", caps) sink = Gst.ElementFactory.make("appsink", "sink") if not sink: sys.stderr.write(" Unable to create appsink \n") sink.set_property("emit-signals", True) caps = Gst.caps_from_string("video/x-raw, format=RGBA") sink.set_property("caps", caps) # sink.set_property("drop", True) # sink.set_property("max_buffers", 3) # sink.set_property("sync", False) sink.set_property("wait-on-eos", False) sink.connect("new-sample", new_buffer, sink) self.pipeline.add(nvvidconv) self.pipeline.add(capsfilter) self.pipeline.add(sink) return nvvidconv, capsfilter, sink def _link(self): self.source.link(self.h264parser) self.h264parser.link(self.decoder) sinkpad = self.streammux.get_request_pad("sink_0") if not sinkpad: sys.stderr.write(" Unable to get the sink pad of streammux \n") srcpad = self.decoder.get_static_pad("src") if not srcpad: sys.stderr.write(" Unable to get source pad of decoder \n") srcpad.link(sinkpad) self.streammux.link(self.pgie) self.pgie.link(self.nvvidconv) self.nvvidconv.link(self.capsfilter) self.capsfilter.link(self.sink) @staticmethod def _bus_call(bus, message, loop): print('buss called on {}'.format(message)) t = message.type if t == Gst.MessageType.EOS: sys.stdout.write("End-of-stream\n") loop.quit() elif t == Gst.MessageType.WARNING: err, debug = message.parse_warning() sys.stderr.write("Warning: %s: %s\n" % (err, debug)) elif t == Gst.MessageType.ERROR: err, debug = message.parse_error() sys.stderr.write("Error: %s: %s\n" % (err, debug)) loop.quit() return True @staticmethod def osd_sink_pad_buffer_probe(pad, info, u_data): obj_counter = { PGIE_CLASS_ID_VEHICLE: 0, PGIE_CLASS_ID_PERSON: 0, PGIE_CLASS_ID_BICYCLE: 0, PGIE_CLASS_ID_ROADSIGN: 0 } gst_buffer = info.get_buffer() if not gst_buffer: print("Unable to get GstBuffer ") return # Retrieve batch metadata from the gst_buffer # Note that pyds.gst_buffer_get_nvds_batch_meta() expects the # C address of gst_buffer as input, which is obtained with hash(gst_buffer) batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer)) l_frame = batch_meta.frame_meta_list while l_frame is not None: try: # Note that l_frame.data needs a cast to pyds.NvDsFrameMeta # The casting is done by pyds.glist_get_nvds_frame_meta() # The casting also keeps ownership of the underlying memory # in the C code, so the Python garbage collector will leave # it alone. # frame_meta = pyds.glist_get_nvds_frame_meta(l_frame.data) frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data) except StopIteration: break frame_number = frame_meta.frame_num num_rects = frame_meta.num_obj_meta l_obj = frame_meta.obj_meta_list while l_obj is not None: try: # Casting l_obj.data to pyds.NvDsObjectMeta # obj_meta=pyds.glist_get_nvds_object_meta(l_obj.data) obj_meta = pyds.NvDsObjectMeta.cast(l_obj.data) except StopIteration: break obj_counter[obj_meta.class_id] += 1 obj_meta.rect_params.border_color.set(0.0, 0.0, 1.0, 0.0) try: l_obj = l_obj.next except StopIteration: break # Acquiring a display meta object. The memory ownership remains in # the C code so downstream plugins can still access it. Otherwise # the garbage collector will claim it when this probe function exits. display_meta = pyds.nvds_acquire_display_meta_from_pool(batch_meta) display_meta.num_labels = 1 py_nvosd_text_params = display_meta.text_params[0] # Setting display text to be shown on screen # Note that the pyds module allocates a buffer for the string, and the # memory will not be claimed by the garbage collector. # Reading the display_text field here will return the C address of the # allocated string. Use pyds.get_string() to get the string content. fps_stream.get_fps() py_nvosd_text_params.display_text = "Frame Number={} Number of Objects={} Vehicle_count={} Person_count={}" \ .format(frame_number, num_rects, obj_counter[PGIE_CLASS_ID_VEHICLE], obj_counter[PGIE_CLASS_ID_PERSON]) # Now set the offsets where the string should appear py_nvosd_text_params.x_offset = 10 py_nvosd_text_params.y_offset = 12 # Font , font-color and font-size py_nvosd_text_params.font_params.font_name = "Serif" py_nvosd_text_params.font_params.font_size = 10 # set(red, green, blue, alpha); set to White py_nvosd_text_params.font_params.font_color.set(1.0, 1.0, 1.0, 1.0) # Text background color py_nvosd_text_params.set_bg_clr = 1 # set(red, green, blue, alpha); set to Black py_nvosd_text_params.text_bg_clr.set(0.0, 0.0, 0.0, 1.0) # Using pyds.get_string() to get display_text as string print(pyds.get_string(py_nvosd_text_params.display_text)) pyds.nvds_add_display_meta_to_frame(frame_meta, display_meta) # if WRITE_FRAMES: # n_frame = pyds.get_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id) # # convert python array into numy array format. # frame_image = np.array(n_frame, copy=True, order='C') # # covert the array into cv2 default color format # frame_image = cv2.cvtColor(frame_image, cv2.COLOR_RGBA2BGRA) # cv2.imwrite("./frame_" + str(frame_number) + ".jpg", # frame_image) # print('saved to') try: l_frame = l_frame.next except StopIteration: break return Gst.PadProbeReturn.OK class PipelineCamera: def __init__(self, model_config_path='./model/config_infer_primary_detectnet_v2.txt', labels_path='./model/detectnet_v2_labels.txt', output_file_path='./out.mp4'): self.model_config_path = model_config_path self.labels_path = labels_path self.output_file_path = output_file_path self.width = 1280 self.height = 720 GObject.threads_init() Gst.init(None) self.pipeline = Gst.Pipeline() if not self.pipeline: sys.stderr.write(" Unable to create Pipeline \n") self.source, self.nvvidconv_src, self.caps_nvvidconv_src = self._create_source_elements() self.tee, self.queue_od, self.queue_seg = self._create_branching_elements() self.streammux, self.pgie, self.nvvidconvosd, self.nvosd = self._create_middle_elements() self.nvvidconv, self.capsfilter, self.sink, self.fake_sink = self._create_sink_elements() # Link the elements print("Linking elements in the Pipeline \n") self._link() od_sink_pad = self.queue_od.get_static_pad("sink") seg_sink_pad = self.queue_seg.get_static_pad("sink") tee_od_pad = self.tee.get_request_pad("src_%u") tee_seg_pad = self.tee.get_request_pad("src_%u") if not tee_od_pad or not tee_seg_pad: sys.stderr.write("Unable to get request pads\n") tee_od_pad.link(od_sink_pad) tee_seg_pad.link(seg_sink_pad) osdsinkpad = self.nvosd.get_static_pad("sink") if not osdsinkpad: sys.stderr.write(" Unable to get sink pad of nvosd \n") osdsinkpad.add_probe(Gst.PadProbeType.BUFFER, self.osd_sink_pad_buffer_probe, 0) self.loop = GObject.MainLoop() self.bus = self.pipeline.get_bus() self.bus.add_signal_watch() self.bus.connect("message::eos", self._bus_call, self.loop) def start(self): # start play back and listen to events print("Starting pipeline \n") self.pipeline.set_state(Gst.State.PLAYING) self.loop.run() def _create_source_elements(self): source = Gst.ElementFactory.make("nvarguscamerasrc", "src-elem") if not source: sys.stderr.write(" Unable to create Source \n") # Converter to scale the image nvvidconv_src = Gst.ElementFactory.make("nvvideoconvert", "convertor_src") if not nvvidconv_src: sys.stderr.write(" Unable to create nvvidconv_src \n") # Caps for NVMM and resolution scaling caps_nvvidconv_src = Gst.ElementFactory.make("capsfilter", "nvmm_caps") if not caps_nvvidconv_src: sys.stderr.write(" Unable to create capsfilter \n") source.set_property('bufapi-version', True) caps_nvvidconv_src.set_property('caps', Gst.Caps.from_string( 'video/x-raw(memory:NVMM), width={}, height={}'.format(self.width, self.height))) self.pipeline.add(source) self.pipeline.add(nvvidconv_src) self.pipeline.add(caps_nvvidconv_src) return source, nvvidconv_src, caps_nvvidconv_src def _create_middle_elements(self): streammux = Gst.ElementFactory.make("nvstreammux", "Stream-muxer") if not streammux: sys.stderr.write(" Unable to create NvStreamMux \n") # Use nvinfer to run inferencing on decoder's output, # behaviour of inferencing is set through config file pgie = Gst.ElementFactory.make("nvinfer", "primary-inference") if not pgie: sys.stderr.write(" Unable to create pgie \n") # Use convertor to convert from NV12 to RGBA as required by nvosd nvvidconvosd = Gst.ElementFactory.make("nvvideoconvert", "convertor") if not nvvidconvosd: sys.stderr.write(" Unable to create nvvidconv \n") # Create OSD to draw on the converted RGBA buffer nvosd = Gst.ElementFactory.make("nvdsosd", "onscreendisplay") if not nvosd: sys.stderr.write(" Unable to create nvosd \n") nvosd.set_property('display-clock', 1) # here: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvdsosd.html streammux.set_property('width', self.width) streammux.set_property('height', self.height) streammux.set_property('batch-size', 1) streammux.set_property('batched-push-timeout', 4000000) pgie.set_property('config-file-path', self.model_config_path) self.pipeline.add(streammux) self.pipeline.add(pgie) self.pipeline.add(nvvidconvosd) self.pipeline.add(nvosd) return streammux, pgie, nvvidconvosd, nvosd def _create_sink_elements(self): nvvidconv = Gst.ElementFactory.make("nvvideoconvert", "convertor appsink") if not nvvidconv: sys.stderr.write(" Unable to create nvvidconv2 \n") capsfilter = Gst.ElementFactory.make("capsfilter", "capsfilter") if not capsfilter: sys.stderr.write(" Unable to create capsfilter \n") caps = Gst.Caps.from_string("video/x-raw, format=RGBA") capsfilter.set_property("caps", caps) sink = Gst.ElementFactory.make("appsink", "sink") if not sink: sys.stderr.write(" Unable to create appsink \n") sink.set_property("emit-signals", True) caps = Gst.caps_from_string("video/x-raw, format=RGBA") sink.set_property("caps", caps) sink.set_property("drop", True) sink.set_property("max_buffers", 1) # sink.set_property("sync", False) sink.set_property("wait-on-eos", False) sink.connect("new-sample", new_buffer, sink) fakesink = Gst.ElementFactory.make("fakesink", "fakesink") self.pipeline.add(nvvidconv) self.pipeline.add(capsfilter) self.pipeline.add(sink) self.pipeline.add(fakesink) return nvvidconv, capsfilter, sink, fakesink def _create_branching_elements(self): tee = Gst.ElementFactory.make("tee", "tee") queue_od = Gst.ElementFactory.make("queue", "object detection queue") queue_seg = Gst.ElementFactory.make("queue", "segmentation queue") queue_od.set_property("max-size-buffers", 1) queue_seg.set_property("max-size-buffers", 1) queue_seg.set_property("leaky", 2) self.pipeline.add(tee) self.pipeline.add(queue_od) self.pipeline.add(queue_seg) return tee, queue_od, queue_seg def _link(self): self.source.link(self.tee) self.queue_od.link(self.nvvidconv_src) self.nvvidconv_src.link(self.caps_nvvidconv_src) sinkpad = self.streammux.get_request_pad("sink_0") if not sinkpad: sys.stderr.write(" Unable to get the sink pad of streammux \n") srcpad = self.caps_nvvidconv_src.get_static_pad("src") if not srcpad: sys.stderr.write(" Unable to get source pad of decoder \n") srcpad.link(sinkpad) self.streammux.link(self.pgie) self.pgie.link(self.nvvidconvosd) self.nvvidconvosd.link(self.nvosd) self.nvosd.link(self.fake_sink) # self.pgie.link(self.nvvidconv) # self.nvvidconv.link(self.capsfilter) # self.capsfilter.link(self.sink) self.queue_seg.link(self.nvvidconv) self.nvvidconv.link(self.capsfilter) self.capsfilter.link(self.sink) @staticmethod def _bus_call(bus, message, loop): print('buss called on {}'.format(message)) t = message.type if t == Gst.MessageType.EOS: sys.stdout.write("End-of-stream\n") loop.quit() elif t == Gst.MessageType.WARNING: err, debug = message.parse_warning() sys.stderr.write("Warning: %s: %s\n" % (err, debug)) elif t == Gst.MessageType.ERROR: err, debug = message.parse_error() sys.stderr.write("Error: %s: %s\n" % (err, debug)) loop.quit() return True @staticmethod def osd_sink_pad_buffer_probe(pad, info, u_data): obj_counter = { PGIE_CLASS_ID_VEHICLE: 0, PGIE_CLASS_ID_PERSON: 0, PGIE_CLASS_ID_BICYCLE: 0, PGIE_CLASS_ID_ROADSIGN: 0 } gst_buffer = info.get_buffer() if not gst_buffer: print("Unable to get GstBuffer ") return # Retrieve batch metadata from the gst_buffer # Note that pyds.gst_buffer_get_nvds_batch_meta() expects the # C address of gst_buffer as input, which is obtained with hash(gst_buffer) batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer)) l_frame = batch_meta.frame_meta_list while l_frame is not None: try: # Note that l_frame.data needs a cast to pyds.NvDsFrameMeta # The casting is done by pyds.glist_get_nvds_frame_meta() # The casting also keeps ownership of the underlying memory # in the C code, so the Python garbage collector will leave # it alone. # frame_meta = pyds.glist_get_nvds_frame_meta(l_frame.data) frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data) except StopIteration: break frame_number = frame_meta.frame_num num_rects = frame_meta.num_obj_meta l_obj = frame_meta.obj_meta_list pts = frame_meta.buf_pts print(f'from osd ------- pts: {pts / 1e9}') while l_obj is not None: try: # Casting l_obj.data to pyds.NvDsObjectMeta # obj_meta=pyds.glist_get_nvds_object_meta(l_obj.data) obj_meta = pyds.NvDsObjectMeta.cast(l_obj.data) except StopIteration: break obj_counter[obj_meta.class_id] += 1 obj_meta.rect_params.border_color.set(0.0, 0.0, 1.0, 0.0) try: l_obj = l_obj.next except StopIteration: break # Acquiring a display meta object. The memory ownership remains in # the C code so downstream plugins can still access it. Otherwise # the garbage collector will claim it when this probe function exits. display_meta = pyds.nvds_acquire_display_meta_from_pool(batch_meta) display_meta.num_labels = 1 py_nvosd_text_params = display_meta.text_params[0] # Setting display text to be shown on screen # Note that the pyds module allocates a buffer for the string, and the # memory will not be claimed by the garbage collector. # Reading the display_text field here will return the C address of the # allocated string. Use pyds.get_string() to get the string content. fps_stream.get_fps() py_nvosd_text_params.display_text = "Frame Number={} Number of Objects={} Vehicle_count={} Person_count={}" \ .format(frame_number, num_rects, obj_counter[PGIE_CLASS_ID_VEHICLE], obj_counter[PGIE_CLASS_ID_PERSON]) # Now set the offsets where the string should appear py_nvosd_text_params.x_offset = 10 py_nvosd_text_params.y_offset = 12 # Font , font-color and font-size py_nvosd_text_params.font_params.font_name = "Serif" py_nvosd_text_params.font_params.font_size = 10 # set(red, green, blue, alpha); set to White py_nvosd_text_params.font_params.font_color.set(1.0, 1.0, 1.0, 1.0) # Text background color py_nvosd_text_params.set_bg_clr = 1 # set(red, green, blue, alpha); set to Black py_nvosd_text_params.text_bg_clr.set(0.0, 0.0, 0.0, 1.0) # Using pyds.get_string() to get display_text as string print(pyds.get_string(py_nvosd_text_params.display_text)) pyds.nvds_add_display_meta_to_frame(frame_meta, display_meta) # if WRITE_FRAMES: # n_frame = pyds.get_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id) # # convert python array into numy array format. # frame_image = np.array(n_frame, copy=True, order='C') # # covert the array into cv2 default color format # frame_image = cv2.cvtColor(frame_image, cv2.COLOR_RGBA2BGRA) # cv2.imwrite("./frame_" + str(frame_number) + ".jpg", # frame_image) # print('saved to') try: l_frame = l_frame.next except StopIteration: break return Gst.PadProbeReturn.OK if __name__ == '__main__': fps_stream = GETFPS(0) # out_file_name = '{}.mp4'.format(sys.argv[1]) # in_file_path = sys.argv[2] out_file_name = 'out.mp4' # pipeline = Pipeline(output_file_path=out_file_name) # pipeline = Pipeline(in_file_path, output_file_path=out_file_name) pipeline = PipelineCamera(output_file_path=out_file_name) try: pipeline.start() except KeyboardInterrupt as e: # sink.get_static_pad('sink').send_event(Gst.Event.new_eos()) # pipeline.send_event(Gst.Event.new_eos()) # pipeline.set_state(Gst.State.NULL) pipeline.pipeline.send_event(Gst.Event.new_eos()) # Wait for EOS to be catched up by the bus msg = pipeline.bus.timed_pop_filtered( Gst.CLOCK_TIME_NONE, Gst.MessageType.EOS ) print(msg) sleep(5) except Exception as e: print(e) finally: pyds.unset_callback_funcs() pipeline.pipeline.set_state(Gst.State.NULL)
39.923188
145
0.629796
3,573
27,547
4.640918
0.118388
0.017911
0.027862
0.034978
0.785611
0.772464
0.760704
0.72645
0.709625
0.708781
0
0.01185
0.270919
27,547
690
146
39.923188
0.813782
0.23273
0
0.651054
0
0
0.126875
0.011716
0
0
0
0
0
1
0.044496
false
0
0.023419
0
0.107728
0.035129
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
f48bb672fb014932d29e6e32d2e5bec0cd502bd6
50
py
Python
imagepy/tools/Measure/coordinate_tol.py
dada1437903138/imagepy
65d9ce088894eef587054e04018f9d34ff65084f
[ "BSD-4-Clause" ]
1,178
2017-05-25T06:59:01.000Z
2022-03-31T11:38:53.000Z
imagepy/tools/Measure/coordinate_tol.py
TomisTony/imagepy
3c378ebaf72762b94f0826a410897757ebafe689
[ "BSD-4-Clause" ]
76
2017-06-10T17:01:50.000Z
2021-12-23T08:13:29.000Z
imagepy/tools/Measure/coordinate_tol.py
TomisTony/imagepy
3c378ebaf72762b94f0826a410897757ebafe689
[ "BSD-4-Clause" ]
315
2017-05-25T12:59:53.000Z
2022-03-07T22:52:21.000Z
from sciapp.action import CoordinateTool as Plugin
50
50
0.88
7
50
6.285714
1
0
0
0
0
0
0
0
0
0
0
0
0.1
50
1
50
50
0.977778
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
be5b2f102b21186d32a7e5373ae5df920525865d
45
py
Python
marctools/__init__.py
Wooble/marctools
35cdfa960b04c59b07651d9ac3e5f40cdd084e43
[ "MIT" ]
null
null
null
marctools/__init__.py
Wooble/marctools
35cdfa960b04c59b07651d9ac3e5f40cdd084e43
[ "MIT" ]
null
null
null
marctools/__init__.py
Wooble/marctools
35cdfa960b04c59b07651d9ac3e5f40cdd084e43
[ "MIT" ]
null
null
null
"""Command line tools for MARC21 records."""
22.5
44
0.711111
6
45
5.333333
1
0
0
0
0
0
0
0
0
0
0
0.051282
0.133333
45
1
45
45
0.769231
0.844444
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
be5d77dd11751f480c383591da26cb1850257d87
439
py
Python
newWorld/AutoTestPlatform/structure/list/priority_queue.py
CypHelp/TestNewWorldDemo
ee6f73df05756f191c1c56250fa290461fdd1b9a
[ "Apache-2.0" ]
null
null
null
newWorld/AutoTestPlatform/structure/list/priority_queue.py
CypHelp/TestNewWorldDemo
ee6f73df05756f191c1c56250fa290461fdd1b9a
[ "Apache-2.0" ]
null
null
null
newWorld/AutoTestPlatform/structure/list/priority_queue.py
CypHelp/TestNewWorldDemo
ee6f73df05756f191c1c56250fa290461fdd1b9a
[ "Apache-2.0" ]
null
null
null
from AutoTestPlatform.structure.list.heap import MaxHeap class PriorityQueue: def __init__(self): self.__heap = MaxHeap() def is_empty(self): return self.__heap.is_empty() def enqueue(self, data): self.__heap.add(data) def dequeue(self): return self.__heap.extract_max() def size(self): return self.__heap.size() def peek(self): return self.__heap.find_max()
19.086957
56
0.640091
55
439
4.745455
0.436364
0.183908
0.214559
0.275862
0
0
0
0
0
0
0
0
0.252847
439
22
57
19.954545
0.795732
0
0
0
0
0
0
0
0
0
0
0
0
1
0.428571
false
0
0.071429
0.285714
0.857143
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
be61de2f0f5c6b63a856d89a19281e71d64e2779
94
py
Python
setup.py
Solstice-Short-Film/solstice-bootstrap
ace828e00d3f10ff3e8a70d23170f138e4633ff8
[ "MIT" ]
null
null
null
setup.py
Solstice-Short-Film/solstice-bootstrap
ace828e00d3f10ff3e8a70d23170f138e4633ff8
[ "MIT" ]
null
null
null
setup.py
Solstice-Short-Film/solstice-bootstrap
ace828e00d3f10ff3e8a70d23170f138e4633ff8
[ "MIT" ]
null
null
null
from setuptools import setup from solstice.bootstrap.__version__ import __version__ setup()
15.666667
54
0.840426
11
94
6.454545
0.636364
0
0
0
0
0
0
0
0
0
0
0
0.117021
94
5
55
18.8
0.855422
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
be8564ef66884ce4ad1cf92b42dc99e35f7f007f
83
py
Python
tests/import/import_pkg7.py
kaffir/circuitpython
0930f7a7972dc006c079102e292babb1ae02aa1a
[ "MIT" ]
5
2017-07-17T23:28:09.000Z
2020-06-16T17:28:47.000Z
tests/import/import_pkg7.py
kaffir/circuitpython
0930f7a7972dc006c079102e292babb1ae02aa1a
[ "MIT" ]
null
null
null
tests/import/import_pkg7.py
kaffir/circuitpython
0930f7a7972dc006c079102e292babb1ae02aa1a
[ "MIT" ]
null
null
null
# This tests ... relative imports as used in pkg7 import pkg7.subpkg1.subpkg2.mod3
27.666667
49
0.771084
13
83
4.923077
0.923077
0
0
0
0
0
0
0
0
0
0
0.070423
0.144578
83
2
50
41.5
0.830986
0.566265
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
fe8d54005ba9bd98e504ad37599421637b539586
14,556
py
Python
pandas/tests/reshape/test_union_categoricals.py
cclauss/pandas
692b5eeeff9b8e8c750f3e64db0c39dc149a73e8
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "BSD-3-Clause" ]
4
2016-10-05T17:38:58.000Z
2020-08-24T16:26:37.000Z
pandas/tests/reshape/test_union_categoricals.py
cclauss/pandas
692b5eeeff9b8e8c750f3e64db0c39dc149a73e8
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "BSD-3-Clause" ]
null
null
null
pandas/tests/reshape/test_union_categoricals.py
cclauss/pandas
692b5eeeff9b8e8c750f3e64db0c39dc149a73e8
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "BSD-3-Clause" ]
12
2017-05-23T06:01:12.000Z
2021-08-16T05:09:46.000Z
import pytest import numpy as np import pandas as pd from pandas import Categorical, Series, CategoricalIndex from pandas.core.dtypes.concat import union_categoricals from pandas.util import testing as tm class TestUnionCategoricals(object): def test_union_categorical(self): # GH 13361 data = [ (list('abc'), list('abd'), list('abcabd')), ([0, 1, 2], [2, 3, 4], [0, 1, 2, 2, 3, 4]), ([0, 1.2, 2], [2, 3.4, 4], [0, 1.2, 2, 2, 3.4, 4]), (['b', 'b', np.nan, 'a'], ['a', np.nan, 'c'], ['b', 'b', np.nan, 'a', 'a', np.nan, 'c']), (pd.date_range('2014-01-01', '2014-01-05'), pd.date_range('2014-01-06', '2014-01-07'), pd.date_range('2014-01-01', '2014-01-07')), (pd.date_range('2014-01-01', '2014-01-05', tz='US/Central'), pd.date_range('2014-01-06', '2014-01-07', tz='US/Central'), pd.date_range('2014-01-01', '2014-01-07', tz='US/Central')), (pd.period_range('2014-01-01', '2014-01-05'), pd.period_range('2014-01-06', '2014-01-07'), pd.period_range('2014-01-01', '2014-01-07')), ] for a, b, combined in data: for box in [Categorical, CategoricalIndex, Series]: result = union_categoricals([box(Categorical(a)), box(Categorical(b))]) expected = Categorical(combined) tm.assert_categorical_equal(result, expected, check_category_order=True) # new categories ordered by appearance s = Categorical(['x', 'y', 'z']) s2 = Categorical(['a', 'b', 'c']) result = union_categoricals([s, s2]) expected = Categorical(['x', 'y', 'z', 'a', 'b', 'c'], categories=['x', 'y', 'z', 'a', 'b', 'c']) tm.assert_categorical_equal(result, expected) s = Categorical([0, 1.2, 2], ordered=True) s2 = Categorical([0, 1.2, 2], ordered=True) result = union_categoricals([s, s2]) expected = Categorical([0, 1.2, 2, 0, 1.2, 2], ordered=True) tm.assert_categorical_equal(result, expected) # must exactly match types s = Categorical([0, 1.2, 2]) s2 = Categorical([2, 3, 4]) msg = 'dtype of categories must be the same' with tm.assert_raises_regex(TypeError, msg): union_categoricals([s, s2]) msg = 'No Categoricals to union' with tm.assert_raises_regex(ValueError, msg): union_categoricals([]) def test_union_categoricals_nan(self): # GH 13759 res = union_categoricals([pd.Categorical([1, 2, np.nan]), pd.Categorical([3, 2, np.nan])]) exp = Categorical([1, 2, np.nan, 3, 2, np.nan]) tm.assert_categorical_equal(res, exp) res = union_categoricals([pd.Categorical(['A', 'B']), pd.Categorical(['B', 'B', np.nan])]) exp = Categorical(['A', 'B', 'B', 'B', np.nan]) tm.assert_categorical_equal(res, exp) val1 = [pd.Timestamp('2011-01-01'), pd.Timestamp('2011-03-01'), pd.NaT] val2 = [pd.NaT, pd.Timestamp('2011-01-01'), pd.Timestamp('2011-02-01')] res = union_categoricals([pd.Categorical(val1), pd.Categorical(val2)]) exp = Categorical(val1 + val2, categories=[pd.Timestamp('2011-01-01'), pd.Timestamp('2011-03-01'), pd.Timestamp('2011-02-01')]) tm.assert_categorical_equal(res, exp) # all NaN res = union_categoricals([pd.Categorical([np.nan, np.nan]), pd.Categorical(['X'])]) exp = Categorical([np.nan, np.nan, 'X']) tm.assert_categorical_equal(res, exp) res = union_categoricals([pd.Categorical([np.nan, np.nan]), pd.Categorical([np.nan, np.nan])]) exp = Categorical([np.nan, np.nan, np.nan, np.nan]) tm.assert_categorical_equal(res, exp) def test_union_categoricals_empty(self): # GH 13759 res = union_categoricals([pd.Categorical([]), pd.Categorical([])]) exp = Categorical([]) tm.assert_categorical_equal(res, exp) res = union_categoricals([pd.Categorical([]), pd.Categorical([1.0])]) exp = Categorical([1.0]) tm.assert_categorical_equal(res, exp) # to make dtype equal nanc = pd.Categorical(np.array([np.nan], dtype=np.float64)) res = union_categoricals([nanc, pd.Categorical([])]) tm.assert_categorical_equal(res, nanc) def test_union_categorical_same_category(self): # check fastpath c1 = Categorical([1, 2, 3, 4], categories=[1, 2, 3, 4]) c2 = Categorical([3, 2, 1, np.nan], categories=[1, 2, 3, 4]) res = union_categoricals([c1, c2]) exp = Categorical([1, 2, 3, 4, 3, 2, 1, np.nan], categories=[1, 2, 3, 4]) tm.assert_categorical_equal(res, exp) c1 = Categorical(['z', 'z', 'z'], categories=['x', 'y', 'z']) c2 = Categorical(['x', 'x', 'x'], categories=['x', 'y', 'z']) res = union_categoricals([c1, c2]) exp = Categorical(['z', 'z', 'z', 'x', 'x', 'x'], categories=['x', 'y', 'z']) tm.assert_categorical_equal(res, exp) def test_union_categoricals_ordered(self): c1 = Categorical([1, 2, 3], ordered=True) c2 = Categorical([1, 2, 3], ordered=False) msg = 'Categorical.ordered must be the same' with tm.assert_raises_regex(TypeError, msg): union_categoricals([c1, c2]) res = union_categoricals([c1, c1]) exp = Categorical([1, 2, 3, 1, 2, 3], ordered=True) tm.assert_categorical_equal(res, exp) c1 = Categorical([1, 2, 3, np.nan], ordered=True) c2 = Categorical([3, 2], categories=[1, 2, 3], ordered=True) res = union_categoricals([c1, c2]) exp = Categorical([1, 2, 3, np.nan, 3, 2], ordered=True) tm.assert_categorical_equal(res, exp) c1 = Categorical([1, 2, 3], ordered=True) c2 = Categorical([1, 2, 3], categories=[3, 2, 1], ordered=True) msg = "to union ordered Categoricals, all categories must be the same" with tm.assert_raises_regex(TypeError, msg): union_categoricals([c1, c2]) def test_union_categoricals_ignore_order(self): # GH 15219 c1 = Categorical([1, 2, 3], ordered=True) c2 = Categorical([1, 2, 3], ordered=False) res = union_categoricals([c1, c2], ignore_order=True) exp = Categorical([1, 2, 3, 1, 2, 3]) tm.assert_categorical_equal(res, exp) msg = 'Categorical.ordered must be the same' with tm.assert_raises_regex(TypeError, msg): union_categoricals([c1, c2], ignore_order=False) res = union_categoricals([c1, c1], ignore_order=True) exp = Categorical([1, 2, 3, 1, 2, 3]) tm.assert_categorical_equal(res, exp) res = union_categoricals([c1, c1], ignore_order=False) exp = Categorical([1, 2, 3, 1, 2, 3], categories=[1, 2, 3], ordered=True) tm.assert_categorical_equal(res, exp) c1 = Categorical([1, 2, 3, np.nan], ordered=True) c2 = Categorical([3, 2], categories=[1, 2, 3], ordered=True) res = union_categoricals([c1, c2], ignore_order=True) exp = Categorical([1, 2, 3, np.nan, 3, 2]) tm.assert_categorical_equal(res, exp) c1 = Categorical([1, 2, 3], ordered=True) c2 = Categorical([1, 2, 3], categories=[3, 2, 1], ordered=True) res = union_categoricals([c1, c2], ignore_order=True) exp = Categorical([1, 2, 3, 1, 2, 3]) tm.assert_categorical_equal(res, exp) res = union_categoricals([c2, c1], ignore_order=True, sort_categories=True) exp = Categorical([1, 2, 3, 1, 2, 3], categories=[1, 2, 3]) tm.assert_categorical_equal(res, exp) c1 = Categorical([1, 2, 3], ordered=True) c2 = Categorical([4, 5, 6], ordered=True) result = union_categoricals([c1, c2], ignore_order=True) expected = Categorical([1, 2, 3, 4, 5, 6]) tm.assert_categorical_equal(result, expected) msg = "to union ordered Categoricals, all categories must be the same" with tm.assert_raises_regex(TypeError, msg): union_categoricals([c1, c2], ignore_order=False) with tm.assert_raises_regex(TypeError, msg): union_categoricals([c1, c2]) def test_union_categoricals_sort(self): # GH 13846 c1 = Categorical(['x', 'y', 'z']) c2 = Categorical(['a', 'b', 'c']) result = union_categoricals([c1, c2], sort_categories=True) expected = Categorical(['x', 'y', 'z', 'a', 'b', 'c'], categories=['a', 'b', 'c', 'x', 'y', 'z']) tm.assert_categorical_equal(result, expected) # fastpath c1 = Categorical(['a', 'b'], categories=['b', 'a', 'c']) c2 = Categorical(['b', 'c'], categories=['b', 'a', 'c']) result = union_categoricals([c1, c2], sort_categories=True) expected = Categorical(['a', 'b', 'b', 'c'], categories=['a', 'b', 'c']) tm.assert_categorical_equal(result, expected) c1 = Categorical(['a', 'b'], categories=['c', 'a', 'b']) c2 = Categorical(['b', 'c'], categories=['c', 'a', 'b']) result = union_categoricals([c1, c2], sort_categories=True) expected = Categorical(['a', 'b', 'b', 'c'], categories=['a', 'b', 'c']) tm.assert_categorical_equal(result, expected) # fastpath - skip resort c1 = Categorical(['a', 'b'], categories=['a', 'b', 'c']) c2 = Categorical(['b', 'c'], categories=['a', 'b', 'c']) result = union_categoricals([c1, c2], sort_categories=True) expected = Categorical(['a', 'b', 'b', 'c'], categories=['a', 'b', 'c']) tm.assert_categorical_equal(result, expected) c1 = Categorical(['x', np.nan]) c2 = Categorical([np.nan, 'b']) result = union_categoricals([c1, c2], sort_categories=True) expected = Categorical(['x', np.nan, np.nan, 'b'], categories=['b', 'x']) tm.assert_categorical_equal(result, expected) c1 = Categorical([np.nan]) c2 = Categorical([np.nan]) result = union_categoricals([c1, c2], sort_categories=True) expected = Categorical([np.nan, np.nan], categories=[]) tm.assert_categorical_equal(result, expected) c1 = Categorical([]) c2 = Categorical([]) result = union_categoricals([c1, c2], sort_categories=True) expected = Categorical([]) tm.assert_categorical_equal(result, expected) c1 = Categorical(['b', 'a'], categories=['b', 'a', 'c'], ordered=True) c2 = Categorical(['a', 'c'], categories=['b', 'a', 'c'], ordered=True) with pytest.raises(TypeError): union_categoricals([c1, c2], sort_categories=True) def test_union_categoricals_sort_false(self): # GH 13846 c1 = Categorical(['x', 'y', 'z']) c2 = Categorical(['a', 'b', 'c']) result = union_categoricals([c1, c2], sort_categories=False) expected = Categorical(['x', 'y', 'z', 'a', 'b', 'c'], categories=['x', 'y', 'z', 'a', 'b', 'c']) tm.assert_categorical_equal(result, expected) # fastpath c1 = Categorical(['a', 'b'], categories=['b', 'a', 'c']) c2 = Categorical(['b', 'c'], categories=['b', 'a', 'c']) result = union_categoricals([c1, c2], sort_categories=False) expected = Categorical(['a', 'b', 'b', 'c'], categories=['b', 'a', 'c']) tm.assert_categorical_equal(result, expected) # fastpath - skip resort c1 = Categorical(['a', 'b'], categories=['a', 'b', 'c']) c2 = Categorical(['b', 'c'], categories=['a', 'b', 'c']) result = union_categoricals([c1, c2], sort_categories=False) expected = Categorical(['a', 'b', 'b', 'c'], categories=['a', 'b', 'c']) tm.assert_categorical_equal(result, expected) c1 = Categorical(['x', np.nan]) c2 = Categorical([np.nan, 'b']) result = union_categoricals([c1, c2], sort_categories=False) expected = Categorical(['x', np.nan, np.nan, 'b'], categories=['x', 'b']) tm.assert_categorical_equal(result, expected) c1 = Categorical([np.nan]) c2 = Categorical([np.nan]) result = union_categoricals([c1, c2], sort_categories=False) expected = Categorical([np.nan, np.nan], categories=[]) tm.assert_categorical_equal(result, expected) c1 = Categorical([]) c2 = Categorical([]) result = union_categoricals([c1, c2], sort_categories=False) expected = Categorical([]) tm.assert_categorical_equal(result, expected) c1 = Categorical(['b', 'a'], categories=['b', 'a', 'c'], ordered=True) c2 = Categorical(['a', 'c'], categories=['b', 'a', 'c'], ordered=True) result = union_categoricals([c1, c2], sort_categories=False) expected = Categorical(['b', 'a', 'a', 'c'], categories=['b', 'a', 'c'], ordered=True) tm.assert_categorical_equal(result, expected) def test_union_categorical_unwrap(self): # GH 14173 c1 = Categorical(['a', 'b']) c2 = pd.Series(['b', 'c'], dtype='category') result = union_categoricals([c1, c2]) expected = Categorical(['a', 'b', 'b', 'c']) tm.assert_categorical_equal(result, expected) c2 = CategoricalIndex(c2) result = union_categoricals([c1, c2]) tm.assert_categorical_equal(result, expected) c1 = Series(c1) result = union_categoricals([c1, c2]) tm.assert_categorical_equal(result, expected) with pytest.raises(TypeError): union_categoricals([c1, ['a', 'b', 'c']])
42.561404
78
0.541358
1,760
14,556
4.360227
0.06875
0.12184
0.09656
0.12197
0.849231
0.813266
0.772218
0.713318
0.650639
0.622101
0
0.055132
0.288472
14,556
341
79
42.686217
0.685816
0.01587
0
0.568702
0
0
0.054934
0
0
0
0
0
0.175573
1
0.034351
false
0
0.022901
0
0.061069
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
2280afccdd40db004dfad2a09f04129b7df7e1b0
149
py
Python
vaemof/__init__.py
zhenpengyao/Supramolecular_VAE
a6463f9288791799651a7f92cbb8b92c91997dda
[ "Apache-2.0" ]
14
2020-05-25T05:02:58.000Z
2021-11-29T09:58:45.000Z
vaemof/__init__.py
egtai/Supramolecular_VAE
a6463f9288791799651a7f92cbb8b92c91997dda
[ "Apache-2.0" ]
1
2020-08-11T05:39:31.000Z
2020-08-25T03:19:16.000Z
vaemof/__init__.py
egtai/Supramolecular_VAE
a6463f9288791799651a7f92cbb8b92c91997dda
[ "Apache-2.0" ]
7
2021-01-21T16:36:45.000Z
2022-01-12T02:26:36.000Z
from . import configs from . import model from . import scscore from . import training from . import utils from . import vocabs __version__ = '1.0'
16.555556
22
0.744966
21
149
5.095238
0.52381
0.560748
0
0
0
0
0
0
0
0
0
0.016529
0.187919
149
8
23
18.625
0.867769
0
0
0
0
0
0.020134
0
0
0
0
0
0
1
0
false
0
0.857143
0
0.857143
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
228a7a00e54019ecbe14a5128fb98ebc4562db32
8,108
py
Python
main_train_model.py
rosivagyok/Attention
a4cd90dc5f992ae2fe5a7874628d04f531d4aebc
[ "MIT" ]
null
null
null
main_train_model.py
rosivagyok/Attention
a4cd90dc5f992ae2fe5a7874628d04f531d4aebc
[ "MIT" ]
null
null
null
main_train_model.py
rosivagyok/Attention
a4cd90dc5f992ae2fe5a7874628d04f531d4aebc
[ "MIT" ]
1
2019-01-18T12:59:04.000Z
2019-01-18T12:59:04.000Z
import argparse import os import numpy as np from os.path import join, expanduser, exists from model_load import evaluate_flexible, late_DNN2, early_DNN2, late_DNN3, early_DNN3, DNN_single def run(f_in): X_train, X_depth_train, Y_train, X_test, X_depth_test, Y_test = load_data(f_in) shape0 = 40 shape1 = 24 shape2 = 6 if args.model==2: if args.fusiontype==1 or args.fusiontype==0: model = early_DNN2(shape0,shape1,args.fusiontype) history, pred, cnf_matrix, model = evaluate_flexible(model, X_train, Y_train, X_test, Y_test, X_depth_train, X_depth_test, args.model,args.bs,args.ep) elif args.fusiontype==2: file_bool_kp = exists(join(os.path.dirname(__file__), 'models\\keypoints.h5')) file_bool_dist = exists(join(os.path.dirname(__file__), 'models\\distances.h5')) if file_bool_kp==False: model = DNN_single(shape0) modelshape = 1 X_train_kp = np.concatenate([X_train[:,0:12], X_train[:,26:54]],1) X_test_kp = np.concatenate([X_test[:,0:12], X_test[:,26:54]],1) pred, cnf_matrix, model = evaluate_flexible(model, X_train_kp, Y_train, X_test_kp, Y_test, X_depth_train, X_depth_test, modelshape, 32, 175) model.save(join(os.path.dirname(__file__), 'models\\keypoints.h5')) if file_bool_dist==False: model = DNN_single(shape1) modelshape = 1 X_train_dist = np.concatenate([X_train[:,12:24], X_train[:,54:66]],1) X_test_dist = np.concatenate([X_test[:,12:24], X_test[:,54:66]],1) pred, cnf_matrix, model = evaluate_flexible(model, X_train_dist, Y_train, X_test_dist, Y_test, X_depth_train, X_depth_test, modelshape, 32, 175) model.save(join(os.path.dirname(__file__), 'models\\distances.h5')) model = late_DNN2(shape0,shape1,args.type) if args.type==0 or args.type==1: pred = model.predict([np.concatenate([X_test[:,0:12], X_test[:,26:54]],1), np.concatenate([X_test[:,12:24], X_test[:,54:66]],1)], batch_size=32, verbose=2, steps=None) class_pred = pred.argmax(axis=-1) cnf_matrix = get_cnf_mat(Y_test,class_pred) else: history, pred, cnf_matrix, model = evaluate_flexible(model, X_train, Y_train, X_test, Y_test, X_depth_train, X_depth_test, args.model,32,20) elif args.model==3: if args.fusiontype==1 or args.fusiontype==0: model = early_DNN3(shape0,shape1,shape2,args.fusiontype) history, pred, cnf_matrix, model = evaluate_flexible(model, X_train, Y_train, X_test, Y_test, X_depth_train, X_depth_test, args.model,args.bs,args.ep) elif args.fusiontype==2: file_bool_kp = exists(join(os.path.dirname(__file__), 'models\\keypoints.h5')) file_bool_dist = exists(join(os.path.dirname(__file__), 'models\\distances.h5')) file_bool_dp = exists(join(os.path.dirname(__file__), 'models\\depth.h5')) if file_bool_kp==False: model = DNN_single(shape0) modelshape = 1 X_train_kp = np.concatenate([X_train[:,0:12], X_train[:,26:54]],1) X_test_kp = np.concatenate([X_test[:,0:12], X_test[:,26:54]],1) pred, cnf_matrix, model = evaluate_flexible(model, X_train_kp, Y_train, X_test_kp, Y_test, X_depth_train, X_depth_test, modelshape, 32, 175) model.save(join(os.path.dirname(__file__), 'models\\keypoints.h5')) if file_bool_dist==False: model = DNN_single(shape1) modelshape = 1 X_train_dist = np.concatenate([X_train[:,12:24], X_train[:,54:66]],1) X_test_dist = np.concatenate([X_test[:,12:24], X_test[:,54:66]],1) pred, cnf_matrix, model = evaluate_flexible(model, X_train_dist, Y_train, X_test_dist, Y_test, X_depth_train, X_depth_test, modelshape, 32, 175) model.save(join(os.path.dirname(__file__), 'models\\distances.h5')) if file_bool_dp==False: model = DNN_single(shape2) modelshape = 1 X_train_dp = X_depth_train X_test_dp = X_depth_test pred, cnf_matrix, model = evaluate_flexible(model, X_train_dp, Y_train, X_test_dp, Y_test, X_depth_train, X_depth_test, modelshape, 32, 175) model.save(join(os.path.dirname(__file__), 'models\\depth.h5')) model = late_DNN3(shape0,shape1,shape1,args.type) if args.type==0 or args.type==1: pred = model.predict([np.concatenate([X_test[:,0:12], X_test[:,26:54]],1), np.concatenate([X_test[:,12:24], X_test[:,54:66]],1),X_depth_test], batch_size=32, verbose=2, steps=None) class_pred = pred.argmax(axis=-1) cnf_matrix = get_cnf_mat(Y_test,class_pred) else: history, pred, cnf_matrix, model = evaluate_flexible(model, X_train, Y_train, X_test, Y_test, X_depth_train, X_depth_test, args.model,32,20) def load_data(f_in): if args.oversample==False: """Training data""" X_train = np.load(join(f_in,'train.npy')) X_depth_train = np.load(join(f_in,'depth_train.npy')) Y_train = np.load(join(f_in,'labels_train.npy')) Y_train = Y_train.astype(int) """Validation data""" X_test = np.load(join(f_in,'test.npy')) X_depth_test = np.load(join(f_in,'depth_test.npy')) Y_test = np.load(join(f_in,'labels_test.npy')) Y_test = Y_test.astype(int) print('Using ',X_train.shape[0], ' samples for training and ', X_test.shape[0],' samples for validation.\n') else: """Training data""" X_train = np.load(join(f_in,'train_oversampled_ADASYN.npy')) X_depth_train = np.load(join(f_in,'depth_train_oversampled_ADASYN.npy')) Y_train = np.load(join(f_in,'labels_train_oversampled_ADASYN.npy')) Y_train = Y_train.astype(int) """Validation data""" X_test = np.load(join(f_in,'test_for_ADASYN.npy')) X_depth_test = np.load(join(f_in,'depth_test_for_ADASYN.npy')) Y_test = np.load(join(f_in,'labels_test_for_ADASYN.npy')) Y_test = Y_test.astype(int) print('Using ',X_train.shape[0], ' samples for training (with over-sampled data) and ', X_test.shape[0],' samples for validation (without over-sampled data).\n') return X_train, X_depth_train, Y_train, X_test, X_depth_test, Y_test def parse_args(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--oversample', type=bool, default=False, help='Wether or not to use oversampled data for training. Uses the ADASYN data by default.') parser.add_argument('--model', type=int, default=3, help='Two (2) or three (3) stream DNN model.',choices=[2,3]) parser.add_argument('--fusiontype', type=int, default=1, help='Use early (0), fully connected (1) or late (2) fusion.',choices=[0,1,2]) parser.add_argument('--type', type=int, default=2, help='Use average (0), max (1) or WSLF-LW (2) fusion.',choices=[0,1,2]) parser.add_argument('--bs', type=int, default=32, help='Batch size.') parser.add_argument('--ep', type=int, default=50, help='Epochs.') return parser.parse_args() if __name__ == '__main__': args = parse_args() f_in = join(os.path.dirname(__file__), 'PANDORA_features\\') run(f_in)
54.416107
196
0.593611
1,139
8,108
3.921861
0.122915
0.040296
0.03358
0.02955
0.758899
0.754197
0.742557
0.741213
0.71726
0.691963
0
0.038795
0.27516
8,108
149
197
54.416107
0.721286
0
0
0.533898
0
0
0.114211
0.018433
0
0
0
0
0
1
0.025424
false
0
0.042373
0
0.084746
0.016949
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
229013fce2970f7ad54940919f7a7bbe9ed6d749
119
py
Python
HelloWorldPython/app.py
SamIge7/Tutorials
7a3361768432a6493313d1f0ea1ccc8b2b916aa2
[ "MIT" ]
null
null
null
HelloWorldPython/app.py
SamIge7/Tutorials
7a3361768432a6493313d1f0ea1ccc8b2b916aa2
[ "MIT" ]
null
null
null
HelloWorldPython/app.py
SamIge7/Tutorials
7a3361768432a6493313d1f0ea1ccc8b2b916aa2
[ "MIT" ]
null
null
null
name = input('What is your name? ') colour = input('What is your favourite colour? ') print(name + ' likes ' + colour)
29.75
49
0.663866
17
119
4.647059
0.529412
0.227848
0.278481
0.379747
0
0
0
0
0
0
0
0
0.184874
119
3
50
39.666667
0.814433
0
0
0
0
0
0.478992
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
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
22c5bbfec5566226c2036c8600b9d35c096f7b2d
145
py
Python
taskbuster/apps/taskmanager/managers.py
lancelote/taskbuster
fac22d5ae94cf408cfe23dc9faee77cc3f4dadb7
[ "MIT" ]
null
null
null
taskbuster/apps/taskmanager/managers.py
lancelote/taskbuster
fac22d5ae94cf408cfe23dc9faee77cc3f4dadb7
[ "MIT" ]
null
null
null
taskbuster/apps/taskmanager/managers.py
lancelote/taskbuster
fac22d5ae94cf408cfe23dc9faee77cc3f4dadb7
[ "MIT" ]
null
null
null
# coding=utf-8 from django.db import models class ProfileManager(models.Manager): pass class ProjectManager(models.Manager): pass
10.357143
37
0.731034
18
145
5.888889
0.722222
0.245283
0.320755
0
0
0
0
0
0
0
0
0.008475
0.186207
145
13
38
11.153846
0.889831
0.082759
0
0.4
0
0
0
0
0
0
0
0
0
1
0
true
0.4
0.2
0
0.6
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
22d807bef5a52a11b79787a5156a9e1ffbd93fb8
148
py
Python
tests/conftest.py
dyno/euler
30eb0c5d7bb6a6f7dbc25f01f138df0fb3a40267
[ "MIT" ]
null
null
null
tests/conftest.py
dyno/euler
30eb0c5d7bb6a6f7dbc25f01f138df0fb3a40267
[ "MIT" ]
null
null
null
tests/conftest.py
dyno/euler
30eb0c5d7bb6a6f7dbc25f01f138df0fb3a40267
[ "MIT" ]
null
null
null
from itertools import islice import pytest @pytest.fixture(autouse=True) def add_np(doctest_namespace): doctest_namespace["islice"] = islice
16.444444
40
0.783784
19
148
5.947368
0.684211
0.283186
0
0
0
0
0
0
0
0
0
0
0.128378
148
8
41
18.5
0.875969
0
0
0
0
0
0.040541
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.6
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
fe0d6df63c0b092bd7af7baf1a4b8f4d0ead195f
47,938
py
Python
idaes/generic_models/unit_models/tests/test_mixer.py
dangunter/idaes-pse
8f63b4ad8000af8a3eb0316a5f61c32e206925d0
[ "RSA-MD" ]
null
null
null
idaes/generic_models/unit_models/tests/test_mixer.py
dangunter/idaes-pse
8f63b4ad8000af8a3eb0316a5f61c32e206925d0
[ "RSA-MD" ]
3
2021-07-20T20:12:59.000Z
2022-03-09T21:06:40.000Z
idaes/generic_models/unit_models/tests/test_mixer.py
dangunter/idaes-pse
8f63b4ad8000af8a3eb0316a5f61c32e206925d0
[ "RSA-MD" ]
1
2021-08-13T15:20:31.000Z
2021-08-13T15:20:31.000Z
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the software owners: The Regents of the University of California, through # Lawrence Berkeley National Laboratory, National Technology & Engineering # Solutions of Sandia, LLC, Carnegie Mellon University, West Virginia University # Research Corporation, et al. All rights reserved. # # Please see the files COPYRIGHT.md and LICENSE.md for full copyright and # license information. ################################################################################# """ Tests for ControlVolumeBlockData. Author: Andrew Lee """ import pytest from pyomo.environ import (ConcreteModel, Constraint, Param, RangeSet, Set, Var, TerminationCondition, SolverStatus, value, units) from pyomo.util.check_units import (assert_units_consistent, assert_units_equivalent) from pyomo.network import Port from pyomo.common.config import ConfigBlock from idaes.core import (FlowsheetBlock, StateBlock, declare_process_block_class, StateBlockData, StateBlock, PhysicalParameterBlock, MaterialBalanceType, EnergyBalanceType) from idaes.generic_models.properties.activity_coeff_models.BTX_activity_coeff_VLE \ import BTXParameterBlock from idaes.generic_models.properties import iapws95 from idaes.generic_models.properties.examples.saponification_thermo import \ SaponificationParameterBlock from idaes.generic_models.unit_models.mixer import (Mixer, MixerData, MixingType, MomentumMixingType) from idaes.core.util.exceptions import (BurntToast, ConfigurationError, PropertyNotSupportedError) from idaes.core.util.model_statistics import (degrees_of_freedom, number_variables, number_total_constraints, number_unused_variables) from idaes.core.util.testing import (PhysicalParameterTestBlock, TestStateBlock, initialization_tester) from idaes.core.util import get_solver # ----------------------------------------------------------------------------- # Get default solver for testing solver = get_solver() # ----------------------------------------------------------------------------- # Unit Tests for Mixer class TestMixer(object): @declare_process_block_class("MixerFrame") class MixerFrameData(MixerData): def build(self): super(MixerData, self).build() @pytest.fixture(scope="function") def mixer_frame(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = PhysicalParameterTestBlock() m.fs.mix = MixerFrame(default={"property_package": m.fs.pp}) return m @pytest.mark.unit def test_mixer_config(self, mixer_frame): assert len(mixer_frame.fs.mix.config) == 12 assert mixer_frame.fs.mix.config.dynamic is False assert mixer_frame.fs.mix.config.has_holdup is False assert mixer_frame.fs.mix.config.property_package == mixer_frame.fs.pp assert isinstance(mixer_frame.fs.mix.config.property_package_args, ConfigBlock) assert len(mixer_frame.fs.mix.config.property_package_args) == 0 assert mixer_frame.fs.mix.config.inlet_list is None assert mixer_frame.fs.mix.config.num_inlets is None assert mixer_frame.fs.mix.config.has_phase_equilibrium is False assert mixer_frame.fs.mix.config.energy_mixing_type == \ MixingType.extensive assert mixer_frame.fs.mix.config.momentum_mixing_type == \ MomentumMixingType.minimize assert mixer_frame.fs.mix.config.mixed_state_block is None assert mixer_frame.fs.mix.config.construct_ports is True assert mixer_frame.fs.mix.config.material_balance_type == \ MaterialBalanceType.useDefault @pytest.mark.unit def test_inherited_methods(self, mixer_frame): mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() assert hasattr(mixer_frame.fs.mix.config.property_package, "phase_list") @pytest.mark.unit def test_create_inlet_list_default(self, mixer_frame): mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() for i in inlet_list: assert i in ["inlet_1", "inlet_2"] @pytest.mark.unit def test_create_inlet_list_inlet_list(self, mixer_frame): mixer_frame.fs.mix.config.inlet_list = ["foo", "bar"] mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() for i in inlet_list: assert i in ["foo", "bar"] @pytest.mark.unit def test_create_inlet_list_num_inlets(self, mixer_frame): mixer_frame.fs.mix.config.num_inlets = 3 mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() for i in inlet_list: assert i in ["inlet_1", "inlet_2", "inlet_3"] @pytest.mark.unit def test_create_inlet_list_both_args_consistent(self, mixer_frame): mixer_frame.fs.mix.config.inlet_list = ["foo", "bar"] mixer_frame.fs.mix.config.num_inlets = 2 mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() for i in inlet_list: assert i in ["foo", "bar"] @pytest.mark.unit def test_create_inlet_list_both_args_inconsistent(self, mixer_frame): mixer_frame.fs.mix.config.inlet_list = ["foo", "bar"] mixer_frame.fs.mix.config.num_inlets = 3 mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() with pytest.raises(ConfigurationError): mixer_frame.fs.mix.create_inlet_list() @pytest.mark.unit def test_add_inlet_state_blocks(self, mixer_frame): mixer_frame.fs.mix.config.inlet_list = ["foo", "bar"] mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) assert isinstance(mixer_frame.fs.mix.foo_state, StateBlock) assert isinstance(mixer_frame.fs.mix.bar_state, StateBlock) assert len(inlet_blocks) == 2 for i in inlet_blocks: assert isinstance(i, StateBlock) assert i.local_name in ["foo_state", "bar_state"] assert i[0].config.has_phase_equilibrium is False assert i[0].config.defined_state is True assert len(i[0].config) == 3 @pytest.mark.unit def test_add_inlet_state_blocks_prop_pack_args(self, mixer_frame): mixer_frame.fs.mix.config.property_package_args = {"test": 1} mixer_frame.fs.mix.config.inlet_list = ["foo", "bar"] mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) assert isinstance(mixer_frame.fs.mix.foo_state, StateBlock) assert isinstance(mixer_frame.fs.mix.bar_state, StateBlock) assert len(inlet_blocks) == 2 for i in inlet_blocks: assert isinstance(i, StateBlock) assert i.local_name in ["foo_state", "bar_state"] assert i[0].config.has_phase_equilibrium is False assert i[0].config.defined_state is True assert len(i[0].config) == 4 assert i[0].config.test == 1 @pytest.mark.unit def test_add_mixed_state_block(self, mixer_frame): mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() mixed_block = mixer_frame.fs.mix.add_mixed_state_block() assert isinstance(mixed_block, StateBlock) assert hasattr(mixer_frame.fs.mix, "mixed_state") assert not mixer_frame.fs.mix.mixed_state[0].config.has_phase_equilibrium assert mixer_frame.fs.mix.mixed_state[0].config.defined_state is False assert len(mixer_frame.fs.mix.mixed_state[0].config) == 3 @pytest.mark.unit def test_add_mixed_state_block_prop_pack_args(self, mixer_frame): mixer_frame.fs.mix.config.property_package_args = {"test": 1} mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() mixed_block = mixer_frame.fs.mix.add_mixed_state_block() assert isinstance(mixed_block, StateBlock) assert hasattr(mixer_frame.fs.mix, "mixed_state") assert not mixer_frame.fs.mix.mixed_state[0].config.has_phase_equilibrium assert mixer_frame.fs.mix.mixed_state[0].config.defined_state is False assert len(mixer_frame.fs.mix.mixed_state[0].config) == 4 assert mixer_frame.fs.mix.mixed_state[0].config.test == 1 @pytest.mark.unit def test_get_mixed_state_block(self, mixer_frame): mixer_frame.fs.sb = TestStateBlock( mixer_frame.fs.time, default={"parameters": mixer_frame.fs.pp}) mixer_frame.fs.mix.config.mixed_state_block = mixer_frame.fs.sb mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() mixed_block = mixer_frame.fs.mix.get_mixed_state_block() assert mixed_block == mixer_frame.fs.sb @pytest.mark.unit def test_get_mixed_state_block_none(self, mixer_frame): mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() with pytest.raises(BurntToast): mixer_frame.fs.mix.get_mixed_state_block() @pytest.mark.unit def test_get_mixed_state_block_mismatch(self, mixer_frame): mixer_frame.fs.sb = TestStateBlock( mixer_frame.fs.time, default={"parameters": mixer_frame.fs.pp}) # Change parameters arg to create mismatch mixer_frame.fs.sb[0].config.parameters = None mixer_frame.fs.mix.config.mixed_state_block = mixer_frame.fs.sb mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() with pytest.raises(ConfigurationError): mixer_frame.fs.mix.get_mixed_state_block() # Test mixing equation methods @pytest.mark.unit def test_add_material_mixing_equations_pc(self, mixer_frame): mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.componentPhase) assert isinstance(mixer_frame.fs.mix.material_mixing_equations, Constraint) assert len(mixer_frame.fs.mix.material_mixing_equations) == 4 @pytest.mark.unit def test_add_material_mixing_equations_pc_equilibrium(self, mixer_frame): mixer_frame.fs.mix.config.has_phase_equilibrium = True mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.componentPhase) assert isinstance(mixer_frame.fs.mix.phase_equilibrium_generation, Var) assert isinstance(mixer_frame.fs.mix.material_mixing_equations, Constraint) assert len(mixer_frame.fs.mix.material_mixing_equations) == 4 @pytest.mark.unit def test_add_material_mixing_equations_pc_equilibrium_not_supported( self, mixer_frame): mixer_frame.fs.mix.config.has_phase_equilibrium = True # Remove phase equilibrium list to trigger error mixer_frame.fs.pp.del_component( mixer_frame.fs.pp.phase_equilibrium_idx) mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() with pytest.raises(PropertyNotSupportedError): mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.componentPhase) @pytest.mark.unit def test_add_material_mixing_equations_tc(self, mixer_frame): mixer_frame.fs.mix.config.material_balance_type = \ MaterialBalanceType.componentTotal mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.componentTotal) assert isinstance(mixer_frame.fs.mix.material_mixing_equations, Constraint) assert len(mixer_frame.fs.mix.material_mixing_equations) == 2 @pytest.mark.unit def test_add_material_mixing_equations_tc_equilibrium(self, mixer_frame): mixer_frame.fs.mix.config.material_balance_type = \ MaterialBalanceType.componentTotal mixer_frame.fs.mix.config.has_phase_equilibrium = True mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.componentTotal) assert isinstance(mixer_frame.fs.mix.material_mixing_equations, Constraint) assert len(mixer_frame.fs.mix.material_mixing_equations) == 2 @pytest.mark.unit def test_add_material_mixing_equations_t(self, mixer_frame): mixer_frame.fs.mix.config.material_balance_type = \ MaterialBalanceType.total mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.total) assert isinstance(mixer_frame.fs.mix.material_mixing_equations, Constraint) assert len(mixer_frame.fs.mix.material_mixing_equations) == 1 @pytest.mark.unit def test_add_material_mixing_equations_t_equilibrium(self, mixer_frame): mixer_frame.fs.mix.config.material_balance_type = \ MaterialBalanceType.total mixer_frame.fs.mix.config.has_phase_equilibrium = True mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.total) assert isinstance(mixer_frame.fs.mix.material_mixing_equations, Constraint) assert len(mixer_frame.fs.mix.material_mixing_equations) == 1 @pytest.mark.unit def test_add_material_mixing_equations_e(self, mixer_frame): mixer_frame.fs.mix.config.material_balance_type = \ MaterialBalanceType.elementTotal mixer_frame.fs.mix.config.has_phase_equilibrium = True mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() with pytest.raises(ConfigurationError): mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.elementTotal) @pytest.mark.unit def test_add_material_mixing_equations_none(self, mixer_frame): mixer_frame.fs.mix.config.material_balance_type = \ MaterialBalanceType.none mixer_frame.fs.mix.config.has_phase_equilibrium = True mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_material_mixing_equations( inlet_blocks, mixed_block, MaterialBalanceType.none) assert not hasattr(mixer_frame.fs.mix, "material_mixing_equations") @pytest.mark.unit def test_add_energy_mixing_equations(self, mixer_frame): mixer_frame.fs.mix.config.has_phase_equilibrium = True mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_energy_mixing_equations(inlet_blocks, mixed_block) assert isinstance(mixer_frame.fs.mix.enthalpy_mixing_equations, Constraint) assert len(mixer_frame.fs.mix.enthalpy_mixing_equations) == 1 @pytest.mark.unit def test_add_pressure_minimization_equations(self, mixer_frame): mixer_frame.fs.mix.config.has_phase_equilibrium = True mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_pressure_minimization_equations(inlet_blocks, mixed_block) assert mixer_frame.fs.mix.inlet_idx.type() is RangeSet assert isinstance(mixer_frame.fs.mix.minimum_pressure, Var) assert len(mixer_frame.fs.mix.minimum_pressure) == 2 assert isinstance(mixer_frame.fs.mix.eps_pressure, Param) assert isinstance(mixer_frame.fs.mix.minimum_pressure_constraint, Constraint) assert len(mixer_frame.fs.mix.minimum_pressure) == 2 assert isinstance(mixer_frame.fs.mix.mixture_pressure, Constraint) @pytest.mark.unit def test_add_pressure_equality_equations(self, mixer_frame): mixer_frame.fs.mix.config.has_phase_equilibrium = True mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_pressure_equality_equations(inlet_blocks, mixed_block) assert isinstance(mixer_frame.fs.mix.pressure_equality_constraints, Constraint) assert len(mixer_frame.fs.mix.pressure_equality_constraints) == 2 @pytest.mark.unit def test_add_port_objects(self, mixer_frame): mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_port_objects(inlet_list, inlet_blocks, mixed_block) assert isinstance(mixer_frame.fs.mix.inlet_1, Port) assert isinstance(mixer_frame.fs.mix.inlet_2, Port) assert isinstance(mixer_frame.fs.mix.outlet, Port) @pytest.mark.unit def test_add_port_objects_construct_ports_False(self, mixer_frame): mixer_frame.fs.mix.config.construct_ports = False mixer_frame.fs.mix._get_property_package() mixer_frame.fs.mix._get_indexing_sets() inlet_list = mixer_frame.fs.mix.create_inlet_list() inlet_blocks = mixer_frame.fs.mix.add_inlet_state_blocks(inlet_list) mixed_block = mixer_frame.fs.mix.add_mixed_state_block() mixer_frame.fs.mix.add_port_objects(inlet_list, inlet_blocks, mixed_block) assert hasattr(mixer_frame.fs.mix, "inlet_1") is False assert hasattr(mixer_frame.fs.mix, "inlet_2") is False assert hasattr(mixer_frame.fs.mix, "outlet") is False # ------------------------------------------------------------------------- # Test build method @pytest.mark.build @pytest.mark.unit def test_build_default(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = PhysicalParameterTestBlock() m.fs.mix = Mixer(default={"property_package": m.fs.pp}) assert isinstance(m.fs.mix.material_mixing_equations, Constraint) assert len(m.fs.mix.material_mixing_equations) == 4 assert hasattr(m.fs.mix, "phase_equilibrium_idx_ref") is False assert isinstance(m.fs.mix.enthalpy_mixing_equations, Constraint) assert len(m.fs.mix.enthalpy_mixing_equations) == 1 assert m.fs.mix.inlet_idx.type() is RangeSet assert isinstance(m.fs.mix.minimum_pressure, Var) assert len(m.fs.mix.minimum_pressure) == 2 assert isinstance(m.fs.mix.eps_pressure, Param) assert isinstance(m.fs.mix.minimum_pressure_constraint, Constraint) assert len(m.fs.mix.minimum_pressure) == 2 assert isinstance(m.fs.mix.mixture_pressure, Constraint) assert isinstance(m.fs.mix.inlet_1, Port) assert isinstance(m.fs.mix.inlet_2, Port) assert isinstance(m.fs.mix.outlet, Port) @pytest.mark.build @pytest.mark.unit def test_build_phase_equilibrium(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = PhysicalParameterTestBlock() m.fs.mix = Mixer(default={"property_package": m.fs.pp, "has_phase_equilibrium": True}) assert isinstance(m.fs.mix.material_mixing_equations, Constraint) assert len(m.fs.mix.material_mixing_equations) == 4 assert isinstance(m.fs.mix.phase_equilibrium_generation, Var) assert isinstance(m.fs.mix.enthalpy_mixing_equations, Constraint) assert len(m.fs.mix.enthalpy_mixing_equations) == 1 assert m.fs.mix.inlet_idx.type() is RangeSet assert isinstance(m.fs.mix.minimum_pressure, Var) assert len(m.fs.mix.minimum_pressure) == 2 assert isinstance(m.fs.mix.eps_pressure, Param) assert isinstance(m.fs.mix.minimum_pressure_constraint, Constraint) assert len(m.fs.mix.minimum_pressure) == 2 assert isinstance(m.fs.mix.mixture_pressure, Constraint) assert isinstance(m.fs.mix.inlet_1, Port) assert isinstance(m.fs.mix.inlet_2, Port) assert isinstance(m.fs.mix.outlet, Port) @pytest.mark.build @pytest.mark.unit def test_build_phase_pressure_equality(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = PhysicalParameterTestBlock() m.fs.mix = Mixer(default={ "property_package": m.fs.pp, "momentum_mixing_type": MomentumMixingType.equality}) assert isinstance(m.fs.mix.material_mixing_equations, Constraint) assert len(m.fs.mix.material_mixing_equations) == 4 assert isinstance(m.fs.mix.enthalpy_mixing_equations, Constraint) assert len(m.fs.mix.enthalpy_mixing_equations) == 1 assert isinstance(m.fs.mix.pressure_equality_constraints, Constraint) assert len(m.fs.mix.pressure_equality_constraints) == 2 assert isinstance(m.fs.mix.inlet_1, Port) assert isinstance(m.fs.mix.inlet_2, Port) assert isinstance(m.fs.mix.outlet, Port) # ------------------------------------------------------------------------- # Test models checks, initialize and release state methods @pytest.mark.unit def test_model_checks(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = PhysicalParameterTestBlock() m.fs.mix = Mixer(default={ "property_package": m.fs.pp, "momentum_mixing_type": MomentumMixingType.equality}) m.fs.mix.model_check() assert m.fs.mix.inlet_1_state[0].check is True assert m.fs.mix.inlet_2_state[0].check is True assert m.fs.mix.mixed_state[0].check is True @pytest.mark.initialization @pytest.mark.component def test_initialize(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = PhysicalParameterTestBlock() m.fs.sb = TestStateBlock(m.fs.time, default={"parameters": m.fs.pp}) m.fs.mix = Mixer(default={ "property_package": m.fs.pp, "mixed_state_block": m.fs.sb}) # Change one inlet pressure to check initialization calculations m.fs.mix.inlet_1_state[0].pressure = 8e4 f = m.fs.mix.initialize(hold_state=True) assert m.fs.mix.inlet_1_state[0].init_test is True assert m.fs.mix.inlet_2_state[0].init_test is True assert m.fs.sb[0].init_test is True assert m.fs.mix.inlet_1_state[0].hold_state is True assert m.fs.mix.inlet_2_state[0].hold_state is True assert m.fs.sb[0].hold_state is False assert m.fs.sb[0].flow_mol_phase_comp["p1", "c1"].value == 4 assert m.fs.sb[0].flow_mol_phase_comp["p1", "c2"].value == 4 assert m.fs.sb[0].flow_mol_phase_comp["p2", "c1"].value == 4 assert m.fs.sb[0].flow_mol_phase_comp["p2", "c2"].value == 4 assert m.fs.sb[0].temperature.value == 300 assert m.fs.sb[0].pressure.value == 8e4 m.fs.mix.release_state(flags=f) assert m.fs.mix.inlet_1_state[0].hold_state is False assert m.fs.mix.inlet_2_state[0].hold_state is False assert m.fs.sb[0].hold_state is False @pytest.mark.ui @pytest.mark.component def test_report(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = PhysicalParameterTestBlock() m.fs.sb = TestStateBlock(m.fs.time, default={"parameters": m.fs.pp}) m.fs.mix = Mixer(default={ "property_package": m.fs.pp}) m.fs.mix.report() # ----------------------------------------------------------------------------- class TestBTX(object): @pytest.fixture(scope="class") def btx(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = BTXParameterBlock(default={"valid_phase": 'Liq'}) m.fs.unit = Mixer(default={"property_package": m.fs.properties}) m.fs.unit.inlet_1.flow_mol[0].fix(5) # mol/s m.fs.unit.inlet_1.temperature[0].fix(365) # K m.fs.unit.inlet_1.pressure[0].fix(2e5) # Pa m.fs.unit.inlet_1.mole_frac_comp[0, "benzene"].fix(0.5) m.fs.unit.inlet_1.mole_frac_comp[0, "toluene"].fix(0.5) m.fs.unit.inlet_2.flow_mol[0].fix(1) # mol/s m.fs.unit.inlet_2.temperature[0].fix(300) # K m.fs.unit.inlet_2.pressure[0].fix(101325) # Pa m.fs.unit.inlet_2.mole_frac_comp[0, "benzene"].fix(0.5) m.fs.unit.inlet_2.mole_frac_comp[0, "toluene"].fix(0.5) return m @pytest.mark.build @pytest.mark.unit def test_build(self, btx): assert hasattr(btx.fs.unit, "inlet_1") assert len(btx.fs.unit.inlet_1.vars) == 4 assert hasattr(btx.fs.unit.inlet_1, "flow_mol") assert hasattr(btx.fs.unit.inlet_1, "mole_frac_comp") assert hasattr(btx.fs.unit.inlet_1, "temperature") assert hasattr(btx.fs.unit.inlet_1, "pressure") assert hasattr(btx.fs.unit, "inlet_2") assert len(btx.fs.unit.inlet_2.vars) == 4 assert hasattr(btx.fs.unit.inlet_2, "flow_mol") assert hasattr(btx.fs.unit.inlet_2, "mole_frac_comp") assert hasattr(btx.fs.unit.inlet_2, "temperature") assert hasattr(btx.fs.unit.inlet_2, "pressure") assert hasattr(btx.fs.unit, "outlet") assert len(btx.fs.unit.outlet.vars) == 4 assert hasattr(btx.fs.unit.outlet, "flow_mol") assert hasattr(btx.fs.unit.outlet, "mole_frac_comp") assert hasattr(btx.fs.unit.outlet, "temperature") assert hasattr(btx.fs.unit.outlet, "pressure") assert number_variables(btx) == 35 assert number_total_constraints(btx) == 25 assert number_unused_variables(btx) == 0 @pytest.mark.component def test_units(self, btx): assert_units_consistent(btx) @pytest.mark.unit def test_dof(self, btx): assert degrees_of_freedom(btx) == 0 @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_initialize(self, btx): initialization_tester(btx) @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_solve(self, btx): results = solver.solve(btx) # Check for optimal solution assert results.solver.termination_condition == \ TerminationCondition.optimal assert results.solver.status == SolverStatus.ok @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_solution(self, btx): assert (pytest.approx(6, abs=1e-3) == value(btx.fs.unit.outlet.flow_mol[0])) assert (pytest.approx(354.7, abs=1e-1) == value(btx.fs.unit.outlet.temperature[0])) assert (pytest.approx(101325, abs=1e3) == value(btx.fs.unit.outlet.pressure[0])) @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_conservation(self, btx): assert abs(value(btx.fs.unit.inlet_1.flow_mol[0] + btx.fs.unit.inlet_2.flow_mol[0] - btx.fs.unit.outlet.flow_mol[0])) <= 1e-6 assert 1e-6 >= abs(value( btx.fs.unit.inlet_1.flow_mol[0] * btx.fs.unit.inlet_1_state[0].enth_mol_phase['Liq'] + btx.fs.unit.inlet_2.flow_mol[0] * btx.fs.unit.inlet_2_state[0].enth_mol_phase['Liq'] - btx.fs.unit.outlet.flow_mol[0] * btx.fs.unit.mixed_state[0].enth_mol_phase['Liq'])) @pytest.mark.ui @pytest.mark.unit def test_report(self, btx): btx.fs.unit.report() # ----------------------------------------------------------------------------- # Tests for Mixer in cases where proeprties do not support pressure @declare_process_block_class("NoPressureTestBlock") class _NoPressureParameterBlock(PhysicalParameterBlock): def build(self): super(_NoPressureParameterBlock, self).build() self.phase_list = Set(initialize=["p1", "p2"]) self.component_list = Set(initialize=["c1", "c2"]) self.phase_equilibrium_idx = Set(initialize=["e1", "e2"]) self.phase_equilibrium_list = \ {"e1": ["c1", ("p1", "p2")], "e2": ["c2", ("p1", "p2")]} self.state_block_class = NoPressureStateBlock @classmethod def define_metadata(cls, obj): obj.add_default_units({'time': 's', 'length': 'm', 'mass': 'g', 'amount': 'mol', 'temperature': 'K', 'energy': 'J', 'holdup': 'mol'}) @declare_process_block_class("NoPressureStateBlock", block_class=StateBlock) class NoPressureStateBlockData(StateBlockData): CONFIG = ConfigBlock(implicit=True) def build(self): super(NoPressureStateBlockData, self).build() self.flow_vol = Var(initialize=20) self.flow_mol_phase_comp = Var(self._params.phase_list, self._params.component_list, initialize=2) self.temperature = Var(initialize=300) self.test_var = Var(initialize=1) def get_material_flow_terms(b, p, j): return b.test_var def get_enthalpy_flow_terms(b, p): return b.test_var def default_material_balance_type(self): return MaterialBalanceType.componentPhase def default_energy_balance_type(self): return EnergyBalanceType.enthalpyTotal class TestMixer_NoPressure(object): @declare_process_block_class("MixerFrame") class MixerFrameData(MixerData): def build(self): super(MixerData, self).build() @pytest.mark.build @pytest.mark.unit def test_pressure_minimization_unsupported(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = NoPressureTestBlock() with pytest.raises( PropertyNotSupportedError, match="fs.mix The property package supplied for this unit " "does not appear to support pressure, which is required for " "momentum mixing. Please set momentum_mixing_type to " "MomentumMixingType.none or provide a property package which " "supports pressure."): m.fs.mix = Mixer(default={ "property_package": m.fs.pp, "momentum_mixing_type": MomentumMixingType.minimize, "construct_ports": False}) @pytest.mark.build @pytest.mark.unit def test_pressure_equal_unsupported(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = NoPressureTestBlock() with pytest.raises( PropertyNotSupportedError, match="fs.mix The property package supplied for this unit " "does not appear to support pressure, which is required for " "momentum mixing. Please set momentum_mixing_type to " "MomentumMixingType.none or provide a property package which " "supports pressure."): m.fs.mix = Mixer(default={ "property_package": m.fs.pp, "momentum_mixing_type": MomentumMixingType.equality, "construct_ports": False}) @pytest.mark.build @pytest.mark.unit def test_pressure_equal_and_min_unsupported(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = NoPressureTestBlock() with pytest.raises( PropertyNotSupportedError, match="fs.mix The property package supplied for this unit " "does not appear to support pressure, which is required for " "momentum mixing. Please set momentum_mixing_type to " "MomentumMixingType.none or provide a property package which " "supports pressure."): m.fs.mix = Mixer(default={ "property_package": m.fs.pp, "momentum_mixing_type": MomentumMixingType.minimize_and_equality, "construct_ports": False}) @pytest.mark.build @pytest.mark.unit def test_pressure_none_unsupported(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.pp = NoPressureTestBlock() m.fs.mix = Mixer(default={ "property_package": m.fs.pp, "momentum_mixing_type": MomentumMixingType.none, "construct_ports": False}) # ----------------------------------------------------------------------------- @pytest.mark.iapws @pytest.mark.skipif(not iapws95.iapws95_available(), reason="IAPWS not available") class TestIAPWS(object): @pytest.fixture(scope="class") def iapws(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = iapws95.Iapws95ParameterBlock() m.fs.unit = Mixer(default={ "property_package": m.fs.properties, "material_balance_type": MaterialBalanceType.componentTotal, "momentum_mixing_type": MomentumMixingType.equality}) m.fs.unit.inlet_1.flow_mol[0].fix(100) m.fs.unit.inlet_1.enth_mol[0].fix(4000) m.fs.unit.inlet_1.pressure[0].fix(101325) m.fs.unit.inlet_2.flow_mol[0].fix(100) m.fs.unit.inlet_2.enth_mol[0].fix(3500) return m @pytest.mark.build @pytest.mark.unit def test_build(self, iapws): assert len(iapws.fs.unit.inlet_1.vars) == 3 assert hasattr(iapws.fs.unit.inlet_1, "flow_mol") assert hasattr(iapws.fs.unit.inlet_1, "enth_mol") assert hasattr(iapws.fs.unit.inlet_1, "pressure") assert len(iapws.fs.unit.inlet_2.vars) == 3 assert hasattr(iapws.fs.unit.inlet_2, "flow_mol") assert hasattr(iapws.fs.unit.inlet_2, "enth_mol") assert hasattr(iapws.fs.unit.inlet_2, "pressure") assert hasattr(iapws.fs.unit, "outlet") assert len(iapws.fs.unit.outlet.vars) == 3 assert hasattr(iapws.fs.unit.outlet, "flow_mol") assert hasattr(iapws.fs.unit.outlet, "enth_mol") assert hasattr(iapws.fs.unit.outlet, "pressure") @pytest.mark.component def test_units(self, iapws): assert_units_consistent(iapws) @pytest.mark.unit def test_dof(self, iapws): assert degrees_of_freedom(iapws) == 0 @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_initialize(self, iapws): initialization_tester(iapws) @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_solve(self, iapws): results = solver.solve(iapws) # Check for optimal solution assert results.solver.termination_condition == \ TerminationCondition.optimal assert results.solver.status == SolverStatus.ok @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_solution(self, iapws): assert pytest.approx(200, abs=1e-5) == \ value(iapws.fs.unit.outlet.flow_mol[0]) assert pytest.approx(3750, abs=1e0) == \ value(iapws.fs.unit.outlet.enth_mol[0]) assert pytest.approx(101325, abs=1e2) == \ value(iapws.fs.unit.outlet.pressure[0]) @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_conservation(self, iapws): assert abs(value(iapws.fs.unit.inlet_1.flow_mol[0] + iapws.fs.unit.inlet_2.flow_mol[0] - iapws.fs.unit.outlet.flow_mol[0])) <= 1e-6 assert abs(value(iapws.fs.unit.inlet_1.flow_mol[0] * iapws.fs.unit.inlet_1.enth_mol[0] + iapws.fs.unit.inlet_2.flow_mol[0] * iapws.fs.unit.inlet_2.enth_mol[0] - iapws.fs.unit.outlet.flow_mol[0] * iapws.fs.unit.outlet.enth_mol[0])) <= 1e-6 @pytest.mark.ui @pytest.mark.unit def test_report(self, iapws): iapws.fs.unit.report() # ----------------------------------------------------------------------------- class TestSaponification(object): @pytest.fixture(scope="class") def sapon(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = SaponificationParameterBlock() m.fs.unit = Mixer(default={"property_package": m.fs.properties}) m.fs.unit.inlet_1.flow_vol[0].fix(1e-3) m.fs.unit.inlet_1.temperature[0].fix(320) m.fs.unit.inlet_1.pressure[0].fix(101325) m.fs.unit.inlet_1.conc_mol_comp[0, "H2O"].fix(55388.0) m.fs.unit.inlet_1.conc_mol_comp[0, "NaOH"].fix(100.0) m.fs.unit.inlet_1.conc_mol_comp[0, "EthylAcetate"].fix(100.0) m.fs.unit.inlet_1.conc_mol_comp[0, "SodiumAcetate"].fix(0.0) m.fs.unit.inlet_1.conc_mol_comp[0, "Ethanol"].fix(0.0) m.fs.unit.inlet_2.flow_vol[0].fix(1e-3) m.fs.unit.inlet_2.temperature[0].fix(300) m.fs.unit.inlet_2.pressure[0].fix(101325) m.fs.unit.inlet_2.conc_mol_comp[0, "H2O"].fix(55388.0) m.fs.unit.inlet_2.conc_mol_comp[0, "NaOH"].fix(100.0) m.fs.unit.inlet_2.conc_mol_comp[0, "EthylAcetate"].fix(100.0) m.fs.unit.inlet_2.conc_mol_comp[0, "SodiumAcetate"].fix(0.0) m.fs.unit.inlet_2.conc_mol_comp[0, "Ethanol"].fix(0.0) return m @pytest.mark.build @pytest.mark.unit def test_build(self, sapon): assert len(sapon.fs.unit.inlet_1.vars) == 4 assert hasattr(sapon.fs.unit.inlet_1, "flow_vol") assert hasattr(sapon.fs.unit.inlet_1, "conc_mol_comp") assert hasattr(sapon.fs.unit.inlet_1, "temperature") assert hasattr(sapon.fs.unit.inlet_1, "pressure") assert len(sapon.fs.unit.inlet_2.vars) == 4 assert hasattr(sapon.fs.unit.inlet_2, "flow_vol") assert hasattr(sapon.fs.unit.inlet_2, "conc_mol_comp") assert hasattr(sapon.fs.unit.inlet_2, "temperature") assert hasattr(sapon.fs.unit.inlet_2, "pressure") assert len(sapon.fs.unit.outlet.vars) == 4 assert hasattr(sapon.fs.unit.outlet, "flow_vol") assert hasattr(sapon.fs.unit.outlet, "conc_mol_comp") assert hasattr(sapon.fs.unit.outlet, "temperature") assert hasattr(sapon.fs.unit.outlet, "pressure") assert number_variables(sapon) == 26 assert number_total_constraints(sapon) == 10 assert number_unused_variables(sapon) == 0 @pytest.mark.component def test_units(self, sapon): assert_units_consistent(sapon) @pytest.mark.unit def test_dof(self, sapon): assert degrees_of_freedom(sapon) == 0 @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_initialize(self, sapon): initialization_tester(sapon) @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_solve(self, sapon): results = solver.solve(sapon) # Check for optimal solution assert results.solver.termination_condition == \ TerminationCondition.optimal assert results.solver.status == SolverStatus.ok @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_solution(self, sapon): assert pytest.approx(2e-3, abs=1e-6) == \ value(sapon.fs.unit.outlet.flow_vol[0]) assert pytest.approx(55388.0, abs=1e0) == value( sapon.fs.unit.outlet.conc_mol_comp[0, "H2O"]) assert pytest.approx(100.0, abs=1e-3) == value( sapon.fs.unit.outlet.conc_mol_comp[0, "NaOH"]) assert pytest.approx(100.0, abs=1e-3) == value( sapon.fs.unit.outlet.conc_mol_comp[0, "EthylAcetate"]) assert pytest.approx(0.0, abs=1e-3) == value( sapon.fs.unit.outlet.conc_mol_comp[0, "SodiumAcetate"]) assert pytest.approx(0.0, abs=1e-3) == value( sapon.fs.unit.outlet.conc_mol_comp[0, "Ethanol"]) assert pytest.approx(310.0, abs=1e-1) == \ value(sapon.fs.unit.outlet.temperature[0]) assert pytest.approx(101325, abs=1e2) == \ value(sapon.fs.unit.outlet.pressure[0]) @pytest.mark.solver @pytest.mark.skipif(solver is None, reason="Solver not available") @pytest.mark.component def test_conservation(self, sapon): assert abs(value(sapon.fs.unit.inlet_1.flow_vol[0] + sapon.fs.unit.inlet_2.flow_vol[0] - sapon.fs.unit.outlet.flow_vol[0])) <= 1e-6 assert abs(value( sapon.fs.unit.inlet_1.flow_vol[0] * sapon.fs.properties.dens_mol*sapon.fs.properties.cp_mol * (sapon.fs.unit.inlet_1.temperature[0] - sapon.fs.properties.temperature_ref) + sapon.fs.unit.inlet_2.flow_vol[0] * sapon.fs.properties.dens_mol*sapon.fs.properties.cp_mol * (sapon.fs.unit.inlet_2.temperature[0] - sapon.fs.properties.temperature_ref) - sapon.fs.unit.outlet.flow_vol[0] * sapon.fs.properties.dens_mol*sapon.fs.properties.cp_mol * (sapon.fs.unit.outlet.temperature[0] - sapon.fs.properties.temperature_ref))) <= 1e-3 @pytest.mark.ui @pytest.mark.unit def test_report(self, sapon): sapon.fs.unit.report()
40.454008
83
0.64089
6,098
47,938
4.791899
0.061988
0.047569
0.091989
0.108313
0.84518
0.823825
0.800862
0.749735
0.683139
0.634065
0
0.014422
0.240623
47,938
1,184
84
40.488176
0.788287
0.036213
0
0.547884
0
0
0.054612
0.0035
0
0
0
0
0.247216
1
0.083519
false
0
0.01559
0.004454
0.119154
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
a3b55c60dfa9d569e78e3d1e2aba457e5008b694
1,014
py
Python
python/anyascii/_data/_04a.py
casept/anyascii
d4f426b91751254b68eaa84c6cd23099edd668e6
[ "ISC" ]
null
null
null
python/anyascii/_data/_04a.py
casept/anyascii
d4f426b91751254b68eaa84c6cd23099edd668e6
[ "ISC" ]
null
null
null
python/anyascii/_data/_04a.py
casept/anyascii
d4f426b91751254b68eaa84c6cd23099edd668e6
[ "ISC" ]
null
null
null
b='Di Wu Qiu Yan Liao Bi Soeng Bin Zing Yuan Nue Bao Ying Hong Ci Qia Ti Yu Lei Bao Wu Ji Fu Xian Cen Hu Se Beng Qing Yu Wa Ai Han Dan Ge Di Huo Pang Zaam Zhui Ling Mai Mai Lian Xiao Xue Zhen Po Fu Nou Xi Dui Dan Yun Xian Yin Shu Dui Beng Hu Fei Fei Za Bei Fei Xian Shi Mian Zhan Zhan Zhan Hui Fu Wan Mo Qiao Liao Mie Hu Hong Yu Qi Duo Ang Saa Ba Di Xuan Di Bi Zhou Pao Tie Yi Ting Jia Zhi Tu Xie Dan Tiao Xie Chang Yuan Guan Liang Beng Gei Lu Ji Xuan Shu Du Sou Hu Yun Chan Bang Rong E Weng Ba Feng Yu Zhe Fen Guan Bu Ge Dun Huang Du Ti Bo Qian Lie Long Wei Zhan Lan Sui Na Bi Tuo Zhu Die Bu Ju Po Xia Wei Po Da Fan Chan Hu Za Saai Zai Zai Zai Fan Xie Hong Chi Bao Yin Jing Bo Ruan Chou Ying Yi Gai Kun Yun Zhen Ya Ju Hou Min Bai Ge Bian Zhuo Hao Zhen Sheng Gen Bi Duo Chun Chua San Cheng Ran Chen Mao Pei Wei Pi Fu Zhuo Qi Lin Yi Men Wu Qi Die Chen Xia He Sang Gua Hou Ao Fu Qiao Hun Pi Yan Si Xi Ming Kui Ge Ao San Shuang Lou Zhen Hui Chan Ci Lin Na Han Du Jin Mian Fan E Chao Hong Hong Yu Xue Pao Bi Chao'
1,014
1,014
0.745562
252
1,014
3
0.595238
0.021164
0
0
0
0
0
0
0
0
0
0
0.251479
1,014
1
1,014
1,014
0.996047
0
0
0
0
1
0.995074
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
a3b5652c3a9916b4d6952e60107a16196e6b33ba
61
py
Python
argue/__init__.py
jrkerns/argue
94d27db9687696985553c3eea7dcb9d9920990c5
[ "MIT" ]
1
2018-06-19T17:59:28.000Z
2018-06-19T17:59:28.000Z
argue/__init__.py
jrkerns/argue
94d27db9687696985553c3eea7dcb9d9920990c5
[ "MIT" ]
null
null
null
argue/__init__.py
jrkerns/argue
94d27db9687696985553c3eea7dcb9d9920990c5
[ "MIT" ]
null
null
null
from argue.argumentative import bounds, options, conditional
30.5
60
0.852459
7
61
7.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.098361
61
1
61
61
0.945455
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
a3ce3e94a16ea539c72c1e2a9a20a10eace85ce5
14,515
py
Python
src/opserver/test/test_analytics_db.py
sagarc-contrail/contrail-controller
834302367f3ff81f1ce93f4036b6b3788dfd6994
[ "Apache-2.0" ]
null
null
null
src/opserver/test/test_analytics_db.py
sagarc-contrail/contrail-controller
834302367f3ff81f1ce93f4036b6b3788dfd6994
[ "Apache-2.0" ]
null
null
null
src/opserver/test/test_analytics_db.py
sagarc-contrail/contrail-controller
834302367f3ff81f1ce93f4036b6b3788dfd6994
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # # # analytics_db_test.py # # System tests for analytics # import os import sys import signal import gevent from gevent import monkey monkey.patch_all() import os import unittest import testtools import fixtures import socket from utils.analytics_fixture import AnalyticsFixture from mockcassandra import mockcassandra import logging from pysandesh.util import UTCTimestampUsec from utils.util import find_buildroot logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s') builddir = find_buildroot(os.getcwd()) class AnalyticsDbTest(testtools.TestCase, fixtures.TestWithFixtures): @classmethod def setUpClass(cls): if AnalyticsDbTest._check_skip_test() is True: return if (os.getenv('LD_LIBRARY_PATH', '').find('build/lib') < 0): if (os.getenv('DYLD_LIBRARY_PATH', '').find('build/lib') < 0): assert(False) cls.cassandra_port = AnalyticsDbTest.get_free_port() mockcassandra.start_cassandra(cls.cassandra_port) @classmethod def tearDownClass(cls): if AnalyticsDbTest._check_skip_test() is True: return mockcassandra.stop_cassandra(cls.cassandra_port) pass #@unittest.skip('Skipping test_00_verify_database_purge_with_percentage_input') def test_00_verify_database_purge_with_percentage_input(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_00_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port)) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_with_percentage_input() return True # end test_00_database_purge_query #@unittest.skip('Skipping test_01_verify_database_purge_support_utc_time_format') def test_01_verify_database_purge_support_utc_time_format(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' self.skipTest('Skipping test_01_database_purge_query') logging.info("%%% test_01_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port)) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_support_utc_time_format() return True # end test_01_database_purge_query #@unittest.skip('Skipping test_02_verify_database_purge_support_datetime_format') def test_02_verify_database_purge_support_datetime_format(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_02_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port)) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_support_datetime_format() return True # end test_02_database_purge_query #@unittest.skip('Skipping test_03_verify_database_purge_support_deltatime_format') def test_03_verify_database_purge_support_deltatime_format(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_03_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port)) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_support_deltatime_format() return True # end test_03_database_purge_query #@unittest.skip('Skipping test_04_verify_database_purge_request_limit') def test_04_verify_database_purge_request_limit(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_04_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port)) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_request_limit() return True # end test_04_database_purge_query #@unittest.skip('Skipping test_05_verify_database_purge_with_percentage_input_with_redis_password') def test_05_verify_database_purge_with_percentage_input_with_redis_password(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_05_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port, redis_password='contrail')) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_with_percentage_input() return True # end test_05_database_purge_query #@unittest.skip('Skipping test_06_verify_database_purge_support_utc_time_format_with_redis_password') def test_06_verify_database_purge_support_utc_time_format_with_redis_password(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_06_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port, redis_password='contrail')) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_support_utc_time_format() return True # end test_06_database_purge_query #@unittest.skip('Skipping test_07_verify_database_purge_support_datetime_format_with_redis_password') def test_07_verify_database_purge_support_datetime_format_with_redis_password(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_07_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port, redis_password='contrail')) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_support_datetime_format() return True # end test_07_database_purge_query #@unittest.skip('Skipping test_08_verify_database_purge_support_deltatime_format_with_redis_password') def test_08_verify_database_purge_support_deltatime_format_with_redis_password(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_08_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port, redis_password='contrail')) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_support_deltatime_format() return True # end test_08_database_purge_query #@unittest.skip('Skipping test_09_verify_database_purge_request_limit_with_redis_password') def test_09_verify_database_purge_request_limit_with_redis_password(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance and checks if database purge functonality is is working properly ''' logging.info("%%% test_09_database_purge_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port, redis_password='contrail')) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_generator_collector_connection( vizd_obj.opserver.http_port) assert vizd_obj.verify_database_purge_request_limit() return True #@unittest.skip('Query query engine logs to test QE w/ ClusterName') def test_10_message_table_query(self): ''' This test starts redis,vizd,opserver and qed It uses the test class' cassandra instance Then it checks that the collector UVE (via redis) and syslog (via cassandra) can be accessed from opserver. ''' logging.info("%%% test_10_message_table_query %%%") if AnalyticsDbTest._check_skip_test() is True: return True vizd_obj = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port, cluster_id='Cluster1')) vizd_obj2 = self.useFixture( AnalyticsFixture(logging, builddir, self.__class__.cassandra_port, cluster_id='Cluster2')) assert vizd_obj.verify_on_setup() assert vizd_obj.verify_collector_obj_count() assert vizd_obj.verify_message_table_moduleid() assert vizd_obj.verify_message_table_select_uint_type() assert vizd_obj.verify_message_table_messagetype() assert vizd_obj.verify_message_table_where_or() assert vizd_obj.verify_message_table_where_and() assert vizd_obj.verify_message_table_where_prefix() assert vizd_obj.verify_message_table_filter() assert vizd_obj.verify_message_table_filter2() assert vizd_obj.verify_message_table_sort() assert vizd_obj.verify_message_table_limit() assert vizd_obj2.verify_on_setup() assert vizd_obj2.verify_collector_obj_count() assert vizd_obj2.verify_message_table_moduleid() assert vizd_obj2.verify_message_table_select_uint_type() assert vizd_obj2.verify_message_table_messagetype() assert vizd_obj2.verify_message_table_where_or() assert vizd_obj2.verify_message_table_where_and() assert vizd_obj2.verify_message_table_where_prefix() assert vizd_obj2.verify_message_table_filter() assert vizd_obj2.verify_message_table_filter2() assert vizd_obj2.verify_message_table_sort() assert vizd_obj2.verify_message_table_limit() return True @staticmethod def get_free_port(): cs = socket.socket(socket.AF_INET, socket.SOCK_STREAM) cs.bind(("", 0)) cport = cs.getsockname()[1] cs.close() return cport @staticmethod def _check_skip_test(): if (socket.gethostname() == 'build01'): logging.info("Skipping test") return True return False # end class AnalyticsDbTest def _term_handler(*_): raise IntSignal() if __name__ == '__main__': gevent.signal(signal.SIGINT,_term_handler) unittest.main(catchbreak=True)
39.65847
106
0.678539
1,691
14,515
5.406268
0.112951
0.055896
0.073944
0.108073
0.846642
0.831547
0.777073
0.703019
0.665172
0.646139
0
0.010284
0.256424
14,515
365
107
39.767123
0.836746
0.215295
0
0.60177
0
0
0.055653
0.030918
0
0
0
0
0.287611
1
0.070796
false
0.048673
0.066372
0
0.261062
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