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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39ab865cd62184fd317a22977c5cca8df50dc628 | 262 | py | Python | src/__init__.py | USArmyResearchLab/ARL_Battlespace | 2f17a478f62c20a4db387d5d3e4bbeaa3197cd49 | [
"MIT"
] | 1 | 2022-03-31T19:15:04.000Z | 2022-03-31T19:15:04.000Z | src/__init__.py | USArmyResearchLab/ARL_Battlespace | 2f17a478f62c20a4db387d5d3e4bbeaa3197cd49 | [
"MIT"
] | null | null | null | src/__init__.py | USArmyResearchLab/ARL_Battlespace | 2f17a478f62c20a4db387d5d3e4bbeaa3197cd49 | [
"MIT"
] | null | null | null | print(f'Invoking __init__.py for {__name__}')
import src.AgentTypes, src.Games, src.StateTypes, src.UnitTypes, src.UI_Files
import src.AgentModule, src.GameModule, src.StateModule, src.UnitModule, src.CSVOutputModule
| 37.428571 | 92 | 0.671756 | 30 | 262 | 5.566667 | 0.666667 | 0.107784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.232824 | 262 | 7 | 93 | 37.428571 | 0.830846 | 0 | 0 | 0 | 0 | 0 | 0.13308 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0.333333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
39d1d2f1ae63926645afa730efeb125b6a80bebc | 92 | py | Python | text_detail/readline_lib.py | Lcoderfit/PythonStandardLibrary | 324ad6e852e4726581fa9ceed6e323b206c643a5 | [
"MIT"
] | 2 | 2021-06-25T04:30:27.000Z | 2021-08-09T11:28:31.000Z | text_detail/readline_lib.py | Lcoderfit/PythonStandardLibrary | 324ad6e852e4726581fa9ceed6e323b206c643a5 | [
"MIT"
] | 1 | 2020-10-11T13:36:07.000Z | 2020-10-12T16:05:10.000Z | text_detail/readline_lib.py | Lcoderfit/PythonStandardLibrary | 324ad6e852e4726581fa9ceed6e323b206c643a5 | [
"MIT"
] | null | null | null | import readline
if __name__ == "__main__":
print(readline.parse_and_bind("Lcodefit"))
| 15.333333 | 46 | 0.728261 | 11 | 92 | 5.181818 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141304 | 92 | 5 | 47 | 18.4 | 0.721519 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
8412444e5f2aac085d42fb774893ed67bb52dc22 | 186 | py | Python | 00_SOFTWARE/mod_reactor_controller/__init__.py | photonZfeed/modularPhotoreactor | ab93eab028adebccbde0c079e898d79e5fab76fd | [
"CC0-1.0"
] | 1 | 2022-01-30T06:48:53.000Z | 2022-01-30T06:48:53.000Z | 00_SOFTWARE/mod_reactor_controller/__init__.py | photonZfeed/modularPhotoreactor | ab93eab028adebccbde0c079e898d79e5fab76fd | [
"CC0-1.0"
] | null | null | null | 00_SOFTWARE/mod_reactor_controller/__init__.py | photonZfeed/modularPhotoreactor | ab93eab028adebccbde0c079e898d79e5fab76fd | [
"CC0-1.0"
] | null | null | null | from .controller import *
from .modules import *
#from .multi_ramp import *
#from .koradserial import *
__all__ = ['controller','modules'
#, 'multi_ramp','koradserial'
]
| 20.666667 | 33 | 0.66129 | 19 | 186 | 6.157895 | 0.421053 | 0.25641 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204301 | 186 | 8 | 34 | 23.25 | 0.790541 | 0.424731 | 0 | 0 | 0 | 0 | 0.163462 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
841f0c3a7a7a6e66e8126fd0a90fa6886745bffc | 146 | py | Python | problems[026-050]/problem048.py | yadkee/euler | 2094862e44c0dd9e5a5b7067c3ad33d72b5fa58c | [
"MIT"
] | null | null | null | problems[026-050]/problem048.py | yadkee/euler | 2094862e44c0dd9e5a5b7067c3ad33d72b5fa58c | [
"MIT"
] | null | null | null | problems[026-050]/problem048.py | yadkee/euler | 2094862e44c0dd9e5a5b7067c3ad33d72b5fa58c | [
"MIT"
] | null | null | null | #! python3
"""Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000"""
print(str(sum(i ** i for i in range(1, 1001)))[-10:])
| 29.2 | 79 | 0.568493 | 29 | 146 | 2.862069 | 0.724138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.186441 | 0.191781 | 146 | 4 | 80 | 36.5 | 0.516949 | 0.568493 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
842a6ddb5e709d5a45dd9ed297471dc11a6e225d | 80 | py | Python | popseg/models/backbones/__init__.py | sithu31296/panoptic-segmentation | bd3f5bf51729dcf5698959b3a6b53a1da8e2db65 | [
"MIT"
] | 1 | 2021-11-06T09:00:11.000Z | 2021-11-06T09:00:11.000Z | popseg/models/backbones/__init__.py | sithu31296/panoptic-segmentation | bd3f5bf51729dcf5698959b3a6b53a1da8e2db65 | [
"MIT"
] | 1 | 2021-11-07T11:59:57.000Z | 2021-11-08T14:29:10.000Z | popseg/models/backbones/__init__.py | sithu31296/panoptic-segmentation | bd3f5bf51729dcf5698959b3a6b53a1da8e2db65 | [
"MIT"
] | null | null | null | from .resnet import ResNet
from .pvt import PVTv2
__all__ = ['ResNet', 'PVTv2'] | 20 | 29 | 0.725 | 11 | 80 | 4.909091 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029412 | 0.15 | 80 | 4 | 29 | 20 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0.135802 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
844ee495ceac9219199bf129e3b4ce754f46530a | 22 | py | Python | pytorch_metric_learning/__init__.py | liyongsheng-tech/pytorch-metric-learning | ae3807249a748512a1f7db62b380a524869b5911 | [
"MIT"
] | 2 | 2020-01-26T11:23:22.000Z | 2020-05-13T07:22:55.000Z | pytorch_metric_learning/__init__.py | liyongsheng-tech/pytorch-metric-learning | ae3807249a748512a1f7db62b380a524869b5911 | [
"MIT"
] | null | null | null | pytorch_metric_learning/__init__.py | liyongsheng-tech/pytorch-metric-learning | ae3807249a748512a1f7db62b380a524869b5911 | [
"MIT"
] | null | null | null | __version__ = "0.9.62" | 22 | 22 | 0.681818 | 4 | 22 | 2.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0.090909 | 22 | 1 | 22 | 22 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0.26087 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
ffca5acec98bb6debf6dd926df6258f80f34ca27 | 103 | py | Python | spextra/version.py | astronomyk/speXtra | 906422d99e9cc8db9127a3a32652b0d48f9561d0 | [
"MIT"
] | null | null | null | spextra/version.py | astronomyk/speXtra | 906422d99e9cc8db9127a3a32652b0d48f9561d0 | [
"MIT"
] | null | null | null | spextra/version.py | astronomyk/speXtra | 906422d99e9cc8db9127a3a32652b0d48f9561d0 | [
"MIT"
] | null | null | null | # THIS FILE GENERATED BY speXtra setup.py
version = '0.22'
date = '2021-03-08 09:46:11 GMT'
| 25.75 | 42 | 0.621359 | 18 | 103 | 3.555556 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.220779 | 0.252427 | 103 | 4 | 43 | 25.75 | 0.61039 | 0.378641 | 0 | 0 | 1 | 0 | 0.435484 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
fffa0efd97e6743e194b614eb23c032a1f1355fe | 165 | py | Python | problem0281.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0281.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0281.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | ###########################
#
# #281 Pizza Toppings - Project Euler
# https://projecteuler.net/problem=281
#
# Code by Kevin Marciniak
#
###########################
| 18.333333 | 38 | 0.472727 | 14 | 165 | 5.571429 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041096 | 0.115152 | 165 | 8 | 39 | 20.625 | 0.493151 | 0.575758 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
081054f23fa83c87e3f5238b1bfd4b0d919a9652 | 2,847 | py | Python | test/unit/vint/linting/config/test_toggle_config_comment_source.py | mosheavni/vint | 9078dd626415cfe37ddaf03032e714bbaca8b336 | [
"MIT"
] | 538 | 2015-01-03T18:54:53.000Z | 2020-01-11T01:34:51.000Z | test/unit/vint/linting/config/test_toggle_config_comment_source.py | mosheavni/vint | 9078dd626415cfe37ddaf03032e714bbaca8b336 | [
"MIT"
] | 235 | 2015-01-01T06:20:01.000Z | 2020-01-17T11:32:39.000Z | test/unit/vint/linting/config/test_toggle_config_comment_source.py | mosheavni/vint | 9078dd626415cfe37ddaf03032e714bbaca8b336 | [
"MIT"
] | 43 | 2015-01-23T16:59:49.000Z | 2019-12-27T10:56:12.000Z | import unittest
from test.asserting.config_source import ConfigSourceAssertion
from vint.ast.node_type import NodeType
from vint.linting.config.config_toggle_comment_source import ConfigToggleCommentSource
class TestToggleConfigCommentSource(ConfigSourceAssertion, unittest.TestCase):
def test_get_config_dict(self):
expected_config_dict = {
'policies': {
'Policy1': {
'enabled': False,
},
'Policy2': {
'enabled': True,
},
},
'source_name': 'ConfigToggleCommentSource',
}
node = {
'type': NodeType.COMMENT,
'str': ' vint: -Policy1 +Policy2',
'pos': {
'lnum': 10,
},
}
config_source = ConfigToggleCommentSource()
config_source.update_by_node(node)
self.assertConfigDict(config_source, expected_config_dict)
def test_update_by_node_by_no_switches(self):
node = {
'type': NodeType.COMMENT,
'str': ' vint:',
'pos': {
'lnum': 10,
},
}
expected_config_dict = {
'policies': {},
'source_name': 'ConfigToggleCommentSource',
}
config_source = ConfigToggleCommentSource()
config_source.update_by_node(node)
self.assertConfigDict(config_source, expected_config_dict)
def test_update_by_node_by_single_switch(self):
node = {
'type': NodeType.COMMENT,
'str': ' vint: -Policy1',
'pos': {
'lnum': 10,
},
}
expected_config_dict = {
'policies': {
'Policy1': {
'enabled': False,
},
},
'source_name': 'ConfigToggleCommentSource',
}
config_source = ConfigToggleCommentSource()
config_source.update_by_node(node)
self.assertConfigDict(config_source, expected_config_dict)
def test_update_by_node_by_multiple_switches(self):
node = {
'type': NodeType.COMMENT,
'str': ' vint: -Policy1 +Policy2',
'pos': {
'lnum': 10,
},
}
expected_config_dict = {
'policies': {
'Policy1': {
'enabled': False,
},
'Policy2': {
'enabled': True,
},
},
'source_name': 'ConfigToggleCommentSource',
}
config_source = ConfigToggleCommentSource()
config_source.update_by_node(node)
self.assertConfigDict(config_source, expected_config_dict)
if __name__ == '__main__':
unittest.main()
| 26.607477 | 86 | 0.517035 | 217 | 2,847 | 6.442396 | 0.211982 | 0.111588 | 0.103004 | 0.074392 | 0.771817 | 0.771817 | 0.771817 | 0.746781 | 0.678827 | 0.678827 | 0 | 0.010233 | 0.382157 | 2,847 | 106 | 87 | 26.858491 | 0.784537 | 0 | 0 | 0.6 | 0 | 0 | 0.133123 | 0.035125 | 0 | 0 | 0 | 0 | 0.070588 | 1 | 0.047059 | false | 0 | 0.047059 | 0 | 0.105882 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0814d9f95270f243812d64c778c066f46255fc5e | 101 | py | Python | encryptfinance/utils/ref_code.py | dark-codr/encryptfinance | 573a8179c3a7c4b0f68d71bc9d461246f6fdba29 | [
"Apache-2.0"
] | null | null | null | encryptfinance/utils/ref_code.py | dark-codr/encryptfinance | 573a8179c3a7c4b0f68d71bc9d461246f6fdba29 | [
"Apache-2.0"
] | 1 | 2022-03-31T03:16:16.000Z | 2022-03-31T03:16:16.000Z | encryptfinance/utils/ref_code.py | dark-codr/encryptfinance | 573a8179c3a7c4b0f68d71bc9d461246f6fdba29 | [
"Apache-2.0"
] | null | null | null | import uuid
def ref_generator():
code = str(uuid.uuid4()).replace("-", "")[:7]
return code
| 14.428571 | 49 | 0.594059 | 13 | 101 | 4.538462 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024691 | 0.19802 | 101 | 6 | 50 | 16.833333 | 0.703704 | 0 | 0 | 0 | 0 | 0 | 0.009901 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
081cc7a81c11a87c103e9dfeafa3ba685ae7585b | 114 | py | Python | code/abc022_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc022_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc022_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | n,s,t=map(int,input().split())
w=[int(input()) for i in range(n)]
print(sum(s<=sum(w[:i+1])<=t for i in range(n))) | 38 | 48 | 0.596491 | 28 | 114 | 2.428571 | 0.535714 | 0.235294 | 0.176471 | 0.323529 | 0.352941 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009615 | 0.087719 | 114 | 3 | 48 | 38 | 0.644231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f22afa13ef56e8423e181821c1c9111d64122d74 | 42 | py | Python | pubmedasync/pubmedasync.py | pokey/pubmedasync | f660e2ecd6caa6393d59b15812f4936811755fc8 | [
"MIT"
] | null | null | null | pubmedasync/pubmedasync.py | pokey/pubmedasync | f660e2ecd6caa6393d59b15812f4936811755fc8 | [
"MIT"
] | 1 | 2021-03-25T21:45:01.000Z | 2021-03-25T21:45:01.000Z | pubmedasync/pubmedasync.py | pokey/pubmedasync | f660e2ecd6caa6393d59b15812f4936811755fc8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
something
"""
| 8.4 | 23 | 0.452381 | 4 | 42 | 4.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029412 | 0.190476 | 42 | 4 | 24 | 10.5 | 0.529412 | 0.761905 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
f2529eb16a8c3b9693fd73bf1b7663bd639eae3c | 162 | py | Python | python_module/sirius/edft/helpers.py | mtaillefumier/SIRIUS | 50ec1c202c019113c5660f1966b170dec9dfd4d4 | [
"BSD-2-Clause"
] | 77 | 2016-03-18T08:38:30.000Z | 2022-03-11T14:06:25.000Z | python_module/sirius/edft/helpers.py | simonpintarelli/SIRIUS | f4b5c4810af2a3ea1e67992d65750535227da84b | [
"BSD-2-Clause"
] | 240 | 2016-04-12T16:39:11.000Z | 2022-03-31T08:46:12.000Z | python_module/sirius/edft/helpers.py | simonpintarelli/SIRIUS | f4b5c4810af2a3ea1e67992d65750535227da84b | [
"BSD-2-Clause"
] | 43 | 2016-03-18T17:45:07.000Z | 2022-02-28T05:27:59.000Z | from sirius.coefficient_array import threaded
import numpy as np
@threaded
def has_enough_bands(fn):
fn_sorted = np.sort(fn)
return fn_sorted[0] < 1e-10
| 20.25 | 45 | 0.753086 | 27 | 162 | 4.333333 | 0.740741 | 0.136752 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02963 | 0.166667 | 162 | 7 | 46 | 23.142857 | 0.837037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
f252c4020eaf28d07bf0ac25fb0f90d1f147d065 | 139 | py | Python | server/pyfiles/db/db_instance.py | TheDarrenJoseph/AberWebMUD | c8b33e03a0c78e5d0aceaa1ce85a2924c71cdb1c | [
"MIT"
] | 2 | 2018-08-20T18:09:47.000Z | 2019-04-29T06:18:42.000Z | server/pyfiles/db/db_instance.py | TheDarrenJoseph/AberWebMUD | c8b33e03a0c78e5d0aceaa1ce85a2924c71cdb1c | [
"MIT"
] | 6 | 2019-04-28T20:56:25.000Z | 2022-02-12T04:33:23.000Z | server/pyfiles/db/db_instance.py | TheDarrenJoseph/AberWebMUD | c8b33e03a0c78e5d0aceaa1ce85a2924c71cdb1c | [
"MIT"
] | null | null | null | from pony.orm import *
class DatabaseInstance():
#Shared class variable to prevent multiple instanciations
_database = Database()
| 23.166667 | 61 | 0.755396 | 15 | 139 | 6.933333 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179856 | 139 | 5 | 62 | 27.8 | 0.912281 | 0.402878 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
f259064c8ded1d28fe6c4480b6a02a6c7be38ff9 | 119 | py | Python | generators/activerecord/templates/models/entry.py | afeiship/generator-scrapy | 85331b6cca8be96ca9de631536edaf7305b0293a | [
"MIT"
] | null | null | null | generators/activerecord/templates/models/entry.py | afeiship/generator-scrapy | 85331b6cca8be96ca9de631536edaf7305b0293a | [
"MIT"
] | null | null | null | generators/activerecord/templates/models/entry.py | afeiship/generator-scrapy | 85331b6cca8be96ca9de631536edaf7305b0293a | [
"MIT"
] | null | null | null | # from orator import Model
from jsw_scrapy.models import BaseModel
class Entry(BaseModel):
__table__ = 'entries'
| 17 | 39 | 0.764706 | 15 | 119 | 5.733333 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.168067 | 119 | 6 | 40 | 19.833333 | 0.868687 | 0.201681 | 0 | 0 | 0 | 0 | 0.075269 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
f25a4884964d5878b3047f7a1ce5fab67ab36c4c | 126 | py | Python | test/testdata/demopackage/_child_d.py | Dliwk/pdoc | 6de34d2a121d66c266bbe373bad865f15ff61c73 | [
"Unlicense"
] | 831 | 2018-06-02T01:01:53.000Z | 2022-03-31T14:56:15.000Z | test/testdata/demopackage/_child_d.py | Dliwk/pdoc | 6de34d2a121d66c266bbe373bad865f15ff61c73 | [
"Unlicense"
] | 254 | 2018-06-01T21:30:46.000Z | 2022-03-30T18:34:22.000Z | test/testdata/demopackage/_child_d.py | Dliwk/pdoc | 6de34d2a121d66c266bbe373bad865f15ff61c73 | [
"Unlicense"
] | 92 | 2018-06-02T22:36:44.000Z | 2022-03-22T20:49:58.000Z | """_child_d docstr"""
class Test:
"""The Test class from _child_d."""
def foo(self, a: int):
"""Do foo."""
| 14 | 39 | 0.52381 | 18 | 126 | 3.444444 | 0.722222 | 0.193548 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.269841 | 126 | 8 | 40 | 15.75 | 0.673913 | 0.420635 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
f285cb12abd13ff9dcd22d00485612b5e41b8f48 | 91 | py | Python | aioalfacrm/managers/lesson.py | stas12312/aioalfacrm | 1501634fa5ef4591936be2e6147827565e4a0b36 | [
"MIT"
] | null | null | null | aioalfacrm/managers/lesson.py | stas12312/aioalfacrm | 1501634fa5ef4591936be2e6147827565e4a0b36 | [
"MIT"
] | 49 | 2021-11-11T16:00:40.000Z | 2021-11-24T15:37:34.000Z | aioalfacrm/managers/lesson.py | stas12312/aioalfacrm | 1501634fa5ef4591936be2e6147827565e4a0b36 | [
"MIT"
] | null | null | null | from ..core import EntityManager
class Lesson(EntityManager):
object_name = 'lesson'
| 15.166667 | 32 | 0.747253 | 10 | 91 | 6.7 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164835 | 91 | 5 | 33 | 18.2 | 0.881579 | 0 | 0 | 0 | 0 | 0 | 0.065934 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
4b2f56695eaadae323978da7b052a5fe11450016 | 64 | py | Python | setup.py | andergrim/gofi | 49c619cf72707a4181274cbae9efa18c68ae2403 | [
"MIT"
] | null | null | null | setup.py | andergrim/gofi | 49c619cf72707a4181274cbae9efa18c68ae2403 | [
"MIT"
] | null | null | null | setup.py | andergrim/gofi | 49c619cf72707a4181274cbae9efa18c68ae2403 | [
"MIT"
] | null | null | null | #!/usr/bin/env/ python3
from setuptools import setup
setup()
| 9.142857 | 28 | 0.71875 | 9 | 64 | 5.111111 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018519 | 0.15625 | 64 | 6 | 29 | 10.666667 | 0.833333 | 0.34375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
4b368de54d101e62445044b8c333bcf3f4076f6e | 1,013 | py | Python | case_management/config/cpbns.py | amutaher/case_management | d39af5f49614672fc30ac6019eb0772c28de3df3 | [
"MIT"
] | null | null | null | case_management/config/cpbns.py | amutaher/case_management | d39af5f49614672fc30ac6019eb0772c28de3df3 | [
"MIT"
] | null | null | null | case_management/config/cpbns.py | amutaher/case_management | d39af5f49614672fc30ac6019eb0772c28de3df3 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Protection Monitoring"),
"items": [
{
"type": "doctype",
"name": "Focus Group Discussion",
},
{
"type": "doctype",
"name": "Key Information Interview",
},
{
"type": "doctype",
"name": "Direct Observation",
},
{
"type": "doctype",
"name": "Household Assessment",
},
]
},
{
"label": _("Mapping Services"),
"items": [
{
"type": "doctype",
"name": "Service",
},
{
"type": "doctype",
"name": "Service Provider",
},
]
},
{
"label": _("Referrals"),
"items": [
{
"type": "doctype",
"name": "Referral",
},
]
},
{
"label": _("Location"),
"items": [
{
"type": "doctype",
"name": "Governorate",
},
{
"type": "doctype",
"name": "District",
},
{
"type": "doctype",
"name": "Area",
},
]
}
]
| 14.681159 | 41 | 0.442251 | 73 | 1,013 | 5.986301 | 0.506849 | 0.251716 | 0.343249 | 0.183066 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.342547 | 1,013 | 68 | 42 | 14.897059 | 0.656156 | 0 | 0 | 0.215385 | 0 | 0 | 0.378085 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.015385 | true | 0 | 0.030769 | 0.015385 | 0.061538 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b4e07651ea5d91dec06db85eadbed687f243831 | 1,088 | py | Python | contentcuration/contentcuration/dev_settings.py | divad12/studio | 9cf0f07cd1cd69f6a07bb83badb2cfc51b48b50e | [
"MIT"
] | null | null | null | contentcuration/contentcuration/dev_settings.py | divad12/studio | 9cf0f07cd1cd69f6a07bb83badb2cfc51b48b50e | [
"MIT"
] | null | null | null | contentcuration/contentcuration/dev_settings.py | divad12/studio | 9cf0f07cd1cd69f6a07bb83badb2cfc51b48b50e | [
"MIT"
] | null | null | null | import logging
import os
from .test_settings import *
try:
import debug_panel
except ImportError:
# no debug panel, no use trying to add it to our middleware
pass
else:
# if debug_panel exists, add it to our INSTALLED_APPS
INSTALLED_APPS += ('debug_panel', 'debug_toolbar', 'pympler')
MIDDLEWARE_CLASSES += ('debug_panel.middleware.DebugPanelMiddleware',)
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': lambda x: True,
}
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
]
| 31.085714 | 74 | 0.747243 | 123 | 1,088 | 6.390244 | 0.471545 | 0.229008 | 0.29771 | 0.025445 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148897 | 1,088 | 34 | 75 | 32 | 0.848812 | 0.100184 | 0 | 0 | 0 | 0 | 0.606154 | 0.574359 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.037037 | 0.185185 | 0 | 0.185185 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b71d98f4d680984f9102d485e8959f874025945 | 136 | py | Python | env_var.py | UtkarshR8j/evolv-challenge | 81469c2eab27db140e2c7a369885b7e3b1584b77 | [
"MIT"
] | null | null | null | env_var.py | UtkarshR8j/evolv-challenge | 81469c2eab27db140e2c7a369885b7e3b1584b77 | [
"MIT"
] | null | null | null | env_var.py | UtkarshR8j/evolv-challenge | 81469c2eab27db140e2c7a369885b7e3b1584b77 | [
"MIT"
] | null | null | null | export FLASK_ENV=development
export JWT_SECRET_KEY=secret
export DATABASE_URI = mysql+pymysql://username:passowrd@localhost:1234/crud_db | 45.333333 | 78 | 0.867647 | 20 | 136 | 5.65 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031008 | 0.051471 | 136 | 3 | 78 | 45.333333 | 0.844961 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.333333 | 0 | null | null | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
4b75f01ab3e8115b2219c79499a0a5139622a235 | 773 | py | Python | main.py | Eric-SOIPP/install_wordpress | 6a96dd07d811989b0b2166fd22f9943b64b8e735 | [
"MIT"
] | null | null | null | main.py | Eric-SOIPP/install_wordpress | 6a96dd07d811989b0b2166fd22f9943b64b8e735 | [
"MIT"
] | null | null | null | main.py | Eric-SOIPP/install_wordpress | 6a96dd07d811989b0b2166fd22f9943b64b8e735 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Installation prérequis
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
os.system("apt update")
os.system("apt install python3-pip -y")
os.system("pip3 install mysql-connector-python wget")
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Installation Apache, PHP and mariadb-server
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
os.system("apt install apache2 -y")
os.system("apt install php php-mysql php-curl php-dom php-mbstring php-imagick php-zip php-gd -y")
os.system("apt install mariadb-server -y")
# Define a password for root
# Not necessary if you already have a password
os.system("mysqladmin -u root password 'password'")
os.system("service mysql restart")
| 28.62963 | 98 | 0.564036 | 93 | 773 | 4.688172 | 0.516129 | 0.146789 | 0.126147 | 0.165138 | 0.087156 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007246 | 0.107374 | 773 | 26 | 99 | 29.730769 | 0.624638 | 0.455369 | 0 | 0 | 0 | 0.111111 | 0.659367 | 0.053528 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.111111 | 0.111111 | 0 | 0.111111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
4b7f0e5016f29511cbbbbf8fa354dd860c3941d2 | 850 | py | Python | test/test_suit.py | gabrielbarker/snap | 14272297463d4a2272644dca0e7a33773cdb32d5 | [
"MIT"
] | null | null | null | test/test_suit.py | gabrielbarker/snap | 14272297463d4a2272644dca0e7a33773cdb32d5 | [
"MIT"
] | null | null | null | test/test_suit.py | gabrielbarker/snap | 14272297463d4a2272644dca0e7a33773cdb32d5 | [
"MIT"
] | null | null | null | import unittest
from snap.suit import Suit
class TestSuit(unittest.TestCase):
def test__char__index_0_returns_heart(self):
self.assertEqual("♡", Suit.char(0))
def test__char__index_1_returns_diamond(self):
self.assertEqual("♢", Suit.char(1))
def test__char__index_2_returns_club(self):
self.assertEqual("♣", Suit.char(2))
def test__char__index_3_returns_spade(self):
self.assertEqual("♠", Suit.char(3))
def test__name__index_0_returns_heart(self):
self.assertEqual("heart", Suit.name(0))
def test__name__index_1_returns_diamond(self):
self.assertEqual("diamond", Suit.name(1))
def test__name__index_2_returns_club(self):
self.assertEqual("club", Suit.name(2))
def test__name__index_3_returns_spade(self):
self.assertEqual("spade", Suit.name(3))
| 29.310345 | 50 | 0.705882 | 123 | 850 | 4.455285 | 0.227642 | 0.10219 | 0.277372 | 0.116788 | 0.543796 | 0.543796 | 0.543796 | 0 | 0 | 0 | 0 | 0.022695 | 0.170588 | 850 | 28 | 51 | 30.357143 | 0.748936 | 0 | 0 | 0 | 0 | 0 | 0.029412 | 0 | 0 | 0 | 0 | 0 | 0.421053 | 1 | 0.421053 | false | 0 | 0.105263 | 0 | 0.578947 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
4b8bc3e419c2842d493457cd8accc010fb69498c | 1,317 | py | Python | src/airfly/_vendor/airflow/contrib/operators/gcp_sql_operator.py | ryanchao2012/airfly | 230ddd88885defc67485fa0c51f66c4a67ae98a9 | [
"MIT"
] | 7 | 2021-09-27T11:38:48.000Z | 2022-02-01T06:06:24.000Z | src/airfly/_vendor/airflow/contrib/operators/gcp_sql_operator.py | ryanchao2012/airfly | 230ddd88885defc67485fa0c51f66c4a67ae98a9 | [
"MIT"
] | null | null | null | src/airfly/_vendor/airflow/contrib/operators/gcp_sql_operator.py | ryanchao2012/airfly | 230ddd88885defc67485fa0c51f66c4a67ae98a9 | [
"MIT"
] | null | null | null | # Auto generated by 'inv collect-airflow'
from airfly._vendor.airflow.providers.google.cloud.operators.cloud_sql import (
CloudSQLBaseOperator,
CloudSQLCreateInstanceDatabaseOperator,
CloudSQLCreateInstanceOperator,
CloudSQLDeleteInstanceDatabaseOperator,
CloudSQLDeleteInstanceOperator,
CloudSQLExecuteQueryOperator,
CloudSQLExportInstanceOperator,
CloudSQLImportInstanceOperator,
CloudSQLInstancePatchOperator,
CloudSQLPatchInstanceDatabaseOperator,
)
class CloudSqlBaseOperator(CloudSQLBaseOperator):
pass
class CloudSqlInstanceCreateOperator(CloudSQLCreateInstanceOperator):
pass
class CloudSqlInstanceDatabaseCreateOperator(CloudSQLCreateInstanceDatabaseOperator):
pass
class CloudSqlInstanceDatabaseDeleteOperator(CloudSQLDeleteInstanceDatabaseOperator):
pass
class CloudSqlInstanceDatabasePatchOperator(CloudSQLPatchInstanceDatabaseOperator):
pass
class CloudSqlInstanceDeleteOperator(CloudSQLDeleteInstanceOperator):
pass
class CloudSqlInstanceExportOperator(CloudSQLExportInstanceOperator):
pass
class CloudSqlInstanceImportOperator(CloudSQLImportInstanceOperator):
pass
class CloudSqlInstancePatchOperator(CloudSQLInstancePatchOperator):
pass
class CloudSqlQueryOperator(CloudSQLExecuteQueryOperator):
pass
| 24.388889 | 85 | 0.845103 | 67 | 1,317 | 16.58209 | 0.522388 | 0.072907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.114655 | 1,317 | 53 | 86 | 24.849057 | 0.95283 | 0.029613 | 0 | 0.3125 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.3125 | 0.09375 | 0 | 0.40625 | 0 | 0 | 0 | 1 | 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 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
4ba3725e74ab323c469c2653e33209886edb60c1 | 73 | py | Python | cunyfirstapi/__init__.py | mraza007/CunyFirstAPI | 95428416a263297de735830cc801b403a6d3bc1c | [
"MIT"
] | null | null | null | cunyfirstapi/__init__.py | mraza007/CunyFirstAPI | 95428416a263297de735830cc801b403a6d3bc1c | [
"MIT"
] | null | null | null | cunyfirstapi/__init__.py | mraza007/CunyFirstAPI | 95428416a263297de735830cc801b403a6d3bc1c | [
"MIT"
] | null | null | null | name = "cunyfirstapi"
from .cunyfirstapi import *
from . import constants | 24.333333 | 27 | 0.780822 | 8 | 73 | 7.125 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136986 | 73 | 3 | 28 | 24.333333 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
2999d8351b11f32f12bb7793ce03fe7b2a2e1f40 | 2,123 | py | Python | grammar/python/optdesc/line.py | philip-h-dye/docpt-parser | abb5ea6566dac4cb77851d0cff69ed4aca3b804b | [
"MIT"
] | 2 | 2021-05-01T02:34:05.000Z | 2022-02-13T06:41:36.000Z | grammar/python/optdesc/line.py | philip-h-dye/docpt-parser | abb5ea6566dac4cb77851d0cff69ed4aca3b804b | [
"MIT"
] | null | null | null | grammar/python/optdesc/line.py | philip-h-dye/docpt-parser | abb5ea6566dac4cb77851d0cff69ed4aca3b804b | [
"MIT"
] | null | null | null | # option-description section
# option-intro-line
# options-descriptions
# option-description-line
# \s*<option-list>\s\s<option-help>
# option-list
# ( option [ option operand [=|, ] comand]* )
# ^^^ the atoms or terms
#
# FIXME: add support for option-list continuation :
# - track amount of leading white space per line
# - continuation lines start with extra indent
# and may include '|' prior to lead option
#------------------------------------------------------------------------------
from arpeggio import EOF, Sequence, OrderedChoice, Optional, StrMatch
from arpeggio import And, Not, RegExMatch as _
# from docopt_parser.boundedre import RegExMatchBounded
from ..common import wx, newline, space
# from ..operand import operand
# from ..option import option
from .list import option_list
ALL = ( ' option_line option_line_gap option_help '
).split()
#------------------------------------------------------------------------------
def any_until_eol():
return _(r'.*$', rule_name="any_until_eol")
#------------------------------------------------------------------------------
def option_line_gap():
"""Two or more spaces -- option line gap"""
return _(r' *', rule_name='option_line_gap', skipws=False )
#------------------------------------------------------------------------------
def option_help():
return Sequence ( ( Not(space), any_until_eol, ), rule_name='option_help')
#------------------------------------------------------------------------------
def option_line():
# It should not be necessary to incorporate EOF so often.
# arpeggio.NoMatch: Expected comma or bar or space or ' ' or
# newline at position (1, 6) => '-f -x*'.
return Sequence( ( wx, option_list ,
Optional ( ( option_line_gap() ,
Optional ( option_help() ) ) ) ,
[ EOF, newline ] ) ,
rule_name='option_line', skipws=False )
#------------------------------------------------------------------------------
| 34.803279 | 79 | 0.482336 | 200 | 2,123 | 4.965 | 0.45 | 0.080564 | 0.065458 | 0.030211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001193 | 0.210551 | 2,123 | 60 | 80 | 35.383333 | 0.591289 | 0.581724 | 0 | 0 | 0 | 0 | 0.114219 | 0 | 0 | 0 | 0 | 0.016667 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.166667 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
29d5b14fd3105d36ff93d8344b20c6996fe20c67 | 146 | py | Python | company/views.py | yankeecharlie/python-windows-2 | 477744d0482bec921951f90ff4a099798b364d22 | [
"Apache-2.0"
] | null | null | null | company/views.py | yankeecharlie/python-windows-2 | 477744d0482bec921951f90ff4a099798b364d22 | [
"Apache-2.0"
] | null | null | null | company/views.py | yankeecharlie/python-windows-2 | 477744d0482bec921951f90ff4a099798b364d22 | [
"Apache-2.0"
] | 4 | 2021-06-10T01:31:04.000Z | 2022-03-23T16:29:33.000Z | from django.views import generic
from django.utils import timezone
class HomePageView(generic.TemplateView):
template_name = 'site/home.html' | 29.2 | 41 | 0.808219 | 19 | 146 | 6.157895 | 0.789474 | 0.17094 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116438 | 146 | 5 | 42 | 29.2 | 0.906977 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
29d793412d066714a26203dec0d35d5adbb0f4ea | 156 | py | Python | net_check.py | jpegleg/net-gargoyle2 | 5681063df9d1c64fe324b5b7caa57eccd2ee62b8 | [
"MIT"
] | 1 | 2021-01-20T23:51:42.000Z | 2021-01-20T23:51:42.000Z | net_check.py | jpegleg/net-gargoyle2 | 5681063df9d1c64fe324b5b7caa57eccd2ee62b8 | [
"MIT"
] | null | null | null | net_check.py | jpegleg/net-gargoyle2 | 5681063df9d1c64fe324b5b7caa57eccd2ee62b8 | [
"MIT"
] | null | null | null | '''net_check.py imports the functions from net_gargoyle.py to print the gargoyle.db contents'''
import net_gargoyle as netg
netg.interact()
netg.printdb()
| 26 | 95 | 0.788462 | 25 | 156 | 4.8 | 0.68 | 0.183333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 156 | 5 | 96 | 31.2 | 0.869565 | 0.570513 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
29d847eac55b298ef988e4546a0d4df7b10aab0c | 178 | py | Python | custom_components/thermal_comfort/__init__.py | ViPeR5000/thermal_comfort | 4b9e26f94c04f346b8759035d392f6c14357fa8d | [
"MIT"
] | 156 | 2019-04-11T09:22:26.000Z | 2022-03-29T07:56:13.000Z | custom_components/thermal_comfort/__init__.py | ViPeR5000/thermal_comfort | 4b9e26f94c04f346b8759035d392f6c14357fa8d | [
"MIT"
] | 80 | 2019-06-13T21:11:58.000Z | 2022-03-29T19:16:34.000Z | custom_components/thermal_comfort/__init__.py | ViPeR5000/thermal_comfort | 4b9e26f94c04f346b8759035d392f6c14357fa8d | [
"MIT"
] | 46 | 2019-06-14T15:22:16.000Z | 2022-02-19T12:13:13.000Z | """
Custom integration to integrate thermal_comfort with Home Assistant.
For more details about this integration, please refer to
https://github.com/dolezsa/thermal_comfort
"""
| 25.428571 | 68 | 0.803371 | 24 | 178 | 5.875 | 0.833333 | 0.198582 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117978 | 178 | 6 | 69 | 29.666667 | 0.898089 | 0.949438 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b12df7e1689aca7b52938941d7392e6e1d67c37 | 276 | py | Python | metadata/admin/eui_level_2.py | bmampaey/SDA | 4cbe6fc699a6f0724a4801b3cedf4ab47ca08721 | [
"MIT"
] | null | null | null | metadata/admin/eui_level_2.py | bmampaey/SDA | 4cbe6fc699a6f0724a4801b3cedf4ab47ca08721 | [
"MIT"
] | 2 | 2021-07-06T12:14:40.000Z | 2021-08-23T11:23:21.000Z | metadata/admin/eui_level_2.py | bmampaey/SDA | 4cbe6fc699a6f0724a4801b3cedf4ab47ca08721 | [
"MIT"
] | null | null | null | # Generated by command write_metadata_files version 1
from django.contrib import admin
from metadata.models import EuiLevel2
from .base_metadata import BaseMetadataAdmin
__all__ = ['EuiLevel2Admin']
@admin.register(EuiLevel2)
class EuiLevel2Admin(BaseMetadataAdmin):
pass
| 23 | 53 | 0.833333 | 32 | 276 | 6.96875 | 0.6875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020325 | 0.108696 | 276 | 11 | 54 | 25.090909 | 0.886179 | 0.184783 | 0 | 0 | 1 | 0 | 0.06278 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 0.428571 | 0 | 0.571429 | 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 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 4 |
4b1431fdc560ef097a2d656672891e2d1d5d9fef | 34 | py | Python | src/wai/annotations/imgaug/isp/base/__init__.py | waikato-ufdl/wai-annotations-processors | 9dcd5d421983cd717f738f54fcbae04ede2954d1 | [
"Apache-2.0"
] | null | null | null | src/wai/annotations/imgaug/isp/base/__init__.py | waikato-ufdl/wai-annotations-processors | 9dcd5d421983cd717f738f54fcbae04ede2954d1 | [
"Apache-2.0"
] | 2 | 2020-06-17T01:59:38.000Z | 2020-06-17T02:03:06.000Z | src/wai/annotations/imgaug/isp/base/__init__.py | waikato-ufdl/wai-annotations-processors | 9dcd5d421983cd717f738f54fcbae04ede2954d1 | [
"Apache-2.0"
] | null | null | null | """
Package for base classes.
"""
| 8.5 | 25 | 0.617647 | 4 | 34 | 5.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 34 | 3 | 26 | 11.333333 | 0.75 | 0.735294 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4b1d9d4170d45e607e77a77895cc96b4b302fe91 | 173 | py | Python | sysinfo/variables_data.py | Tech-Overlord/system-info | f1641505a368af640b394d8dfbf2bdd281561dfd | [
"BSD-2-Clause"
] | 2 | 2018-10-09T05:09:54.000Z | 2018-12-11T14:16:11.000Z | sysinfo/variables_data.py | darkwizard242/system-info | f1641505a368af640b394d8dfbf2bdd281561dfd | [
"BSD-2-Clause"
] | 8 | 2018-07-29T20:30:50.000Z | 2018-08-07T13:11:40.000Z | sysinfo/variables_data.py | Tech-Overlord/system-info | f1641505a368af640b394d8dfbf2bdd281561dfd | [
"BSD-2-Clause"
] | null | null | null | #! /usr/bin/env python3
# Defining data measurements
bit = 0 or 1
byte = float(8)
kilobyte = float(1024)
megabyte = float(1024 * 1024)
gigabyte = float(1024 * 1024 * 1024)
| 19.222222 | 36 | 0.693642 | 26 | 173 | 4.615385 | 0.692308 | 0.225 | 0.216667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.197183 | 0.179191 | 173 | 8 | 37 | 21.625 | 0.647887 | 0.283237 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d9b0394325a3cdc3b23d1a5f1a531c36c2b0fdac | 197 | py | Python | tests/proxy/models.py | emihir0/django-schema-graph | 0c8280c035f47a7c736b8feb05d4dd1084b27979 | [
"MIT"
] | 316 | 2020-02-17T13:47:47.000Z | 2022-03-29T20:25:36.000Z | tests/proxy/models.py | emihir0/django-schema-graph | 0c8280c035f47a7c736b8feb05d4dd1084b27979 | [
"MIT"
] | 20 | 2020-02-23T07:59:36.000Z | 2021-05-11T03:39:17.000Z | tests/proxy/models.py | emihir0/django-schema-graph | 0c8280c035f47a7c736b8feb05d4dd1084b27979 | [
"MIT"
] | 11 | 2020-03-02T17:31:31.000Z | 2022-03-17T05:55:50.000Z | from django.db import models
class Target(models.Model):
pass
class ProxyNode2(Target):
class Meta:
proxy = True
class ProxyNode(Target):
class Meta:
proxy = True
| 12.3125 | 28 | 0.64467 | 24 | 197 | 5.291667 | 0.583333 | 0.173228 | 0.23622 | 0.314961 | 0.377953 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007042 | 0.279188 | 197 | 15 | 29 | 13.133333 | 0.887324 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.111111 | 0.111111 | 0 | 0.666667 | 0 | 1 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
d9beee877a589431fd60df1bd8b9fed2f2d183b4 | 29 | py | Python | src/mhlib/l2/__init__.py | MarkHallett/mh | 0be14875940f8d53003a430a322818f7e6a6669a | [
"MIT"
] | 1 | 2019-03-13T23:45:07.000Z | 2019-03-13T23:45:07.000Z | src/mhlib/l2/__init__.py | MarkHallett/mh | 0be14875940f8d53003a430a322818f7e6a6669a | [
"MIT"
] | null | null | null | src/mhlib/l2/__init__.py | MarkHallett/mh | 0be14875940f8d53003a430a322818f7e6a6669a | [
"MIT"
] | null | null | null | '''Description for l2 ...'''
| 14.5 | 28 | 0.551724 | 3 | 29 | 5.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0.137931 | 29 | 1 | 29 | 29 | 0.6 | 0.758621 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d9d1852c54d9d584ff7bb9ff3a556773e92206db | 294 | py | Python | plotly/graph_objs/mesh3d/__init__.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/graph_objs/mesh3d/__init__.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/graph_objs/mesh3d/__init__.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | from ._stream import Stream
from ._lightposition import Lightposition
from ._lighting import Lighting
from ._hoverlabel import Hoverlabel
from plotly.graph_objs.mesh3d import hoverlabel
from ._contour import Contour
from ._colorbar import ColorBar
from plotly.graph_objs.mesh3d import colorbar
| 32.666667 | 47 | 0.857143 | 38 | 294 | 6.421053 | 0.315789 | 0.131148 | 0.163934 | 0.155738 | 0.254098 | 0.254098 | 0 | 0 | 0 | 0 | 0 | 0.007634 | 0.108844 | 294 | 8 | 48 | 36.75 | 0.923664 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 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 | 4 |
d9df7a3da9e711b59d303829fde0eba8ffc9afe8 | 144 | py | Python | steptst.py | MarkFang0093/HCI-class-project | 329f341f0522a9416a4427aea308ddbe8595e4e8 | [
"MIT"
] | null | null | null | steptst.py | MarkFang0093/HCI-class-project | 329f341f0522a9416a4427aea308ddbe8595e4e8 | [
"MIT"
] | null | null | null | steptst.py | MarkFang0093/HCI-class-project | 329f341f0522a9416a4427aea308ddbe8595e4e8 | [
"MIT"
] | null | null | null | from nanpy import Stepper
from nanpy import Arduino
motor = Stepper(100, 9 , 10, 1000)
while True:
motor.step(-10)
Arduino.delay(1000) | 18 | 34 | 0.708333 | 22 | 144 | 4.636364 | 0.636364 | 0.176471 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 0.194444 | 144 | 8 | 35 | 18 | 0.741379 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 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 | 0 | 0 | 0 | 4 |
d9e68a20fae42dbfd5ed1e60d369bd90721829e8 | 214 | py | Python | Array/3.Access-items-using-index.py | manish1822510059/Python-1000-program | d03c1920fe63a7e32ac5bd9a13e2766d7a25756c | [
"Apache-2.0"
] | 1 | 2021-03-06T03:33:42.000Z | 2021-03-06T03:33:42.000Z | Array/3.Access-items-using-index.py | manish1822510059/Python-1000-programs | d03c1920fe63a7e32ac5bd9a13e2766d7a25756c | [
"Apache-2.0"
] | null | null | null | Array/3.Access-items-using-index.py | manish1822510059/Python-1000-programs | d03c1920fe63a7e32ac5bd9a13e2766d7a25756c | [
"Apache-2.0"
] | null | null | null | import array as arr
numarr = arr.array('i',[10,20,30,40,50,60,70,80])
print("Array items at index 2 is :")
print(numarr[2]) #print30
#Negative Indexing
print('Array items at index 3 is :')
print(numarr[-2]) | 26.75 | 50 | 0.672897 | 39 | 214 | 3.692308 | 0.615385 | 0.138889 | 0.208333 | 0.236111 | 0.305556 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121547 | 0.154206 | 214 | 8 | 51 | 26.75 | 0.674033 | 0.11215 | 0 | 0 | 0 | 0 | 0.302198 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.666667 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
d9e77564e47fe37c552bec3377bf364b57b0f8ec | 147 | py | Python | pycfdns/const.py | mikelduke/pycfdns | 476cbe5830ed4c7b7bd71c55e28529677f3c9c24 | [
"MIT"
] | null | null | null | pycfdns/const.py | mikelduke/pycfdns | 476cbe5830ed4c7b7bd71c55e28529677f3c9c24 | [
"MIT"
] | null | null | null | pycfdns/const.py | mikelduke/pycfdns | 476cbe5830ed4c7b7bd71c55e28529677f3c9c24 | [
"MIT"
] | null | null | null | """Constants for pycfdns."""
BASE_URL = "https://api.cloudflare.com/client/v4/zones/{}"
GET_EXT_IP_URL = "https://api.ipify.org/"
NAME = "pycfdns"
| 29.4 | 58 | 0.693878 | 22 | 147 | 4.454545 | 0.818182 | 0.163265 | 0.22449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007407 | 0.081633 | 147 | 4 | 59 | 36.75 | 0.718519 | 0.14966 | 0 | 0 | 0 | 0 | 0.621849 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d9f1d10f4b8f2eb6fdfe7e267aea05cd240e1bf0 | 23 | py | Python | graph-algos/BFS/bfs.py | mritunjaygoutam1/Smvdu-Algos | 2becf98bde9ad0c828debb70be0f4217ea0ec1cf | [
"MIT"
] | 21 | 2017-11-01T06:57:13.000Z | 2021-04-26T12:59:16.000Z | graph-algos/BFS/bfs.py | mritunjaygoutam1/Smvdu-Algos | 2becf98bde9ad0c828debb70be0f4217ea0ec1cf | [
"MIT"
] | 85 | 2017-07-19T07:39:48.000Z | 2018-08-08T05:27:09.000Z | graph-algos/BFS/bfs.py | mritunjaygoutam1/Smvdu-Algos | 2becf98bde9ad0c828debb70be0f4217ea0ec1cf | [
"MIT"
] | 73 | 2017-07-17T21:06:07.000Z | 2019-03-06T11:43:34.000Z | //write your code here
| 11.5 | 22 | 0.73913 | 4 | 23 | 4.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 23 | 1 | 23 | 23 | 0.894737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8a12729485f1a1d595d95a0e1bacb2edc3f9777f | 39 | py | Python | .history/ClassFiles/Python301/ObjectOrientatedProgramming/ErrorCatching/ErrorsExceptions_20210216163433.py | minefarmer/CompletePython | 6de46e7ee29d9e4eaada60352c193f552afd6f15 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/Python301/ObjectOrientatedProgramming/ErrorCatching/ErrorsExceptions_20210216163433.py | minefarmer/CompletePython | 6de46e7ee29d9e4eaada60352c193f552afd6f15 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/Python301/ObjectOrientatedProgramming/ErrorCatching/ErrorsExceptions_20210216163433.py | minefarmer/CompletePython | 6de46e7ee29d9e4eaada60352c193f552afd6f15 | [
"Unlicense"
] | null | null | null | try:
total is
except:
ffin dyh | 9.75 | 13 | 0.589744 | 6 | 39 | 3.833333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.358974 | 39 | 4 | 14 | 9.75 | 0.92 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8a2a1f8a844b444d7e53d968a9cec14ee47ac5f1 | 1,676 | py | Python | S4/S4 Library/simulation/cas/cas_stories_answer.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Library/simulation/cas/cas_stories_answer.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | S4/S4 Library/simulation/cas/cas_stories_answer.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | import services
import sims4
from aspirations.aspiration_tuning import AspirationTrack
from cas.cas_stories_trait_chooser import CasStoriesTraitChooser
from sims4.localization import TunableLocalizedStringFactory
from sims4.tuning.instances import HashedTunedInstanceMetaclass
from sims4.tuning.tunable import HasTunableReference, TunableList, TunableTuple, TunableVariant, Tunable, TunableReference
from sims4.tuning.tunable_base import ExportModes, GroupNames
from traits.traits import Trait
class CasStoriesAnswer(HasTunableReference, metaclass=HashedTunedInstanceMetaclass, manager=services.get_instance_manager(sims4.resources.Types.CAS_STORIES_ANSWER)):
INSTANCE_TUNABLES = {'text': TunableLocalizedStringFactory(description='\n The text of this answer.\n ', export_modes=ExportModes.ClientBinary, tuning_group=GroupNames.UI), 'weightings': TunableList(description='\n A list of objects to apply weightings to if this answer is \n selected. Weight is the weight that shoudld be added to the chance \n to receive this object. In the latter case a trait will be \n selected from the trait chooser based on its cumulative weighting \n throughout the CAS Stories survey.\n ', tunable=TunableTuple(weighted_object=TunableVariant(trait=Trait.TunableReference(), trait_chooser=CasStoriesTraitChooser.TunableReference(), aspiration_track=TunableReference(manager=services.get_instance_manager(sims4.resources.Types.ASPIRATION_TRACK)), default='trait'), weight=Tunable(tunable_type=float, default=0.0), export_class_name='CASAnswerWeightings'), export_modes=ExportModes.ClientBinary)}
| 128.923077 | 1,014 | 0.804893 | 192 | 1,676 | 6.911458 | 0.4375 | 0.027129 | 0.033911 | 0.033158 | 0.078372 | 0.078372 | 0.078372 | 0.078372 | 0 | 0 | 0 | 0.006156 | 0.127685 | 1,676 | 12 | 1,015 | 139.666667 | 0.901505 | 0 | 0 | 0 | 0 | 0.090909 | 0.274463 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.818182 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
8a359adba9f011835bf933e3f580bd2bc24d3001 | 192 | py | Python | app/errors/__init__.py | Island-Daoist/CS50-Project | ab7b22212bb371fbdc20b92aa4539e4c56d36d50 | [
"MIT"
] | null | null | null | app/errors/__init__.py | Island-Daoist/CS50-Project | ab7b22212bb371fbdc20b92aa4539e4c56d36d50 | [
"MIT"
] | null | null | null | app/errors/__init__.py | Island-Daoist/CS50-Project | ab7b22212bb371fbdc20b92aa4539e4c56d36d50 | [
"MIT"
] | null | null | null | """
Implement here.
"""
from flask import Blueprint
bp = Blueprint('errors', __name__)
# Module import located at bottom to avoid circular reference issues.
from app.errors import handlers | 17.454545 | 69 | 0.760417 | 25 | 192 | 5.68 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15625 | 192 | 11 | 70 | 17.454545 | 0.876543 | 0.4375 | 0 | 0 | 0 | 0 | 0.059406 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0.666667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 4 |
8a5aad1b1be32d3148a49df57587b9c473c80247 | 280 | py | Python | src/proficiency/math/herons_formula/herons.py | joeltio/proficiency | 68c52ffc79711aad94b607597d24a4a909a7cf47 | [
"MIT"
] | null | null | null | src/proficiency/math/herons_formula/herons.py | joeltio/proficiency | 68c52ffc79711aad94b607597d24a4a909a7cf47 | [
"MIT"
] | null | null | null | src/proficiency/math/herons_formula/herons.py | joeltio/proficiency | 68c52ffc79711aad94b607597d24a4a909a7cf47 | [
"MIT"
] | null | null | null | # Python 3
import sys
import math
def semiperimeter(a, b, c):
return (a + b + c)/2
def area_of_triangle(a, b, c):
s = semiperimeter(a, b, c)
return math.sqrt(s * (s - a) * (s - b) * (s - c))
a, b, c = [int(x) for x in sys.argv[1:]]
print(area_of_triangle(a, b, c))
| 20 | 53 | 0.571429 | 56 | 280 | 2.785714 | 0.428571 | 0.076923 | 0.115385 | 0.205128 | 0.5 | 0.217949 | 0 | 0 | 0 | 0 | 0 | 0.014085 | 0.239286 | 280 | 13 | 54 | 21.538462 | 0.71831 | 0.028571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.111111 | 0.666667 | 0.111111 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
8a5df2c71131d989815010a996c8549c86d7a84b | 1,485 | py | Python | src/commercetools/importapi/models/_abstract.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | 1 | 2021-04-07T20:01:30.000Z | 2021-04-07T20:01:30.000Z | src/commercetools/platform/models/_abstract.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | null | null | null | src/commercetools/platform/models/_abstract.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | null | null | null | # Generated file, please do not change!!!
class _BaseType:
def __eq__(self, other):
if other.__class__ is self.__class__:
return self.__values__() == other.__values__()
else:
return NotImplemented
def __ne__(self, other):
result = self.__eq__(other)
if result is NotImplemented:
return NotImplemented
else:
return not result
def __lt__(self, other):
if other.__class__ is self.__class__:
return self.__values__() < other.__values__()
else:
return NotImplemented
def __le__(self, other):
if other.__class__ is self.__class__:
return self.__values__() <= other.__values__()
else:
return NotImplemented
def __gt__(self, other):
if other.__class__ is self.__class__:
return self.__values__() > other.__values__()
else:
return NotImplemented
def __ge__(self, other):
if other.__class__ is self.__class__:
return self.__values__() >= other.__values__()
else:
return NotImplemented
def __values__(self):
return tuple(self.__dict__.values())
def __hash__(self):
return hash((self.__class__,) + self.__values__())
def __repr__(self):
return "%s(%s)" % (
self.__class__.__name__,
", ".join("%s=%r" % (k, v) for k, v in self.__dict__.items()),
)
| 28.018868 | 74 | 0.579125 | 154 | 1,485 | 4.642857 | 0.24026 | 0.088112 | 0.076923 | 0.111888 | 0.601399 | 0.601399 | 0.601399 | 0.601399 | 0.601399 | 0.601399 | 0 | 0 | 0.318519 | 1,485 | 52 | 75 | 28.557692 | 0.706522 | 0.026263 | 0 | 0.414634 | 1 | 0 | 0.009003 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.219512 | false | 0 | 0 | 0.073171 | 0.609756 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
8a925d441986dcbe1c9fb724dcef8ca556f88c0f | 171 | py | Python | alberto_zaranza_python/exemplo_tipos_de_dados.py | albertozaranza/lp220172vacation | c031f8f305a3b54536f1204ed3d8f97ef87acd4f | [
"MIT"
] | null | null | null | alberto_zaranza_python/exemplo_tipos_de_dados.py | albertozaranza/lp220172vacation | c031f8f305a3b54536f1204ed3d8f97ef87acd4f | [
"MIT"
] | null | null | null | alberto_zaranza_python/exemplo_tipos_de_dados.py | albertozaranza/lp220172vacation | c031f8f305a3b54536f1204ed3d8f97ef87acd4f | [
"MIT"
] | null | null | null | a = int(input("Digite um numero: "))
b = int(input("Digite outro numero: "))
c = str(input("Digite uma frase: "))
print(a , b)
a, b = b, a
print(a, b)
print(c, c.upper())
| 21.375 | 39 | 0.596491 | 32 | 171 | 3.1875 | 0.4375 | 0.323529 | 0.27451 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175439 | 171 | 7 | 40 | 24.428571 | 0.723404 | 0 | 0 | 0.285714 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 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 | 0 | 0 | 0 | 1 | 0 | 4 |
8a9cae0c0d9c2f95532c2fc8713e6e5ce10a2ba0 | 92 | py | Python | stripstream/pddl/__init__.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | stripstream/pddl/__init__.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | stripstream/pddl/__init__.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | """
This package contains the source for a PDDL representation of a STRIPStream problem.
""" | 30.666667 | 84 | 0.771739 | 13 | 92 | 5.461538 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152174 | 92 | 3 | 85 | 30.666667 | 0.910256 | 0.913043 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8ab199c3c2b997aeba40c8874ef806a8674f8b19 | 49 | py | Python | Flask-todolist-Sqlite3-master/venv/lib/python3.6/tokenize.py | IncredibleDraco/MyScholar | 272aafa33f7227d1bc0d937d046788cbabede453 | [
"Apache-2.0"
] | null | null | null | Flask-todolist-Sqlite3-master/venv/lib/python3.6/tokenize.py | IncredibleDraco/MyScholar | 272aafa33f7227d1bc0d937d046788cbabede453 | [
"Apache-2.0"
] | null | null | null | Flask-todolist-Sqlite3-master/venv/lib/python3.6/tokenize.py | IncredibleDraco/MyScholar | 272aafa33f7227d1bc0d937d046788cbabede453 | [
"Apache-2.0"
] | 1 | 2019-11-25T10:25:21.000Z | 2019-11-25T10:25:21.000Z | /home/sheldon/anaconda3/lib/python3.6/tokenize.py | 49 | 49 | 0.836735 | 8 | 49 | 5.125 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.061224 | 0 | 49 | 1 | 49 | 49 | 0.77551 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8ab327b9473fde260a466493ed16fedc6f046d04 | 52 | py | Python | server/launch/sample/main_machine/main_instance/experiment_javadummy/server_config.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 15 | 2015-03-12T12:15:41.000Z | 2021-12-20T17:53:24.000Z | server/launch/sample/main_machine/main_instance/experiment_javadummy/server_config.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 44 | 2015-01-07T09:22:05.000Z | 2017-01-31T22:44:21.000Z | server/launch/sample/main_machine/main_instance/experiment_javadummy/server_config.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 22 | 2015-01-13T13:55:48.000Z | 2021-12-16T17:07:00.000Z | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
| 13 | 28 | 0.519231 | 7 | 52 | 3.857143 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022222 | 0.134615 | 52 | 3 | 29 | 17.333333 | 0.577778 | 0.903846 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8ab6fe29396603a9e20c7274a282dc98997e891d | 67 | py | Python | common/colors.py | ShengyuH/PredateOverlap | 770c3063399f08b3836935212ab4c84d355b4704 | [
"MIT"
] | 223 | 2020-03-13T02:03:05.000Z | 2022-03-29T07:32:51.000Z | common/colors.py | ShengyuH/PredateOverlap | 770c3063399f08b3836935212ab4c84d355b4704 | [
"MIT"
] | 31 | 2021-05-10T12:39:19.000Z | 2022-03-27T03:07:45.000Z | common/colors.py | ShengyuH/PredateOverlap | 770c3063399f08b3836935212ab4c84d355b4704 | [
"MIT"
] | 48 | 2020-03-15T22:36:28.000Z | 2022-03-11T02:15:24.000Z | """Useful color codes"""
ORANGE = [239, 124, 0]
BLUE = [0, 61, 124] | 22.333333 | 24 | 0.58209 | 11 | 67 | 3.545455 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.236364 | 0.179104 | 67 | 3 | 25 | 22.333333 | 0.472727 | 0.268657 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8ac65de12b72ff72eb2194887d4bd25a173e77a1 | 71 | py | Python | termania/constants.py | techouse/termania-api | 20404a7eb30b7bc42183e8047b8f696eb7b881ac | [
"MIT"
] | null | null | null | termania/constants.py | techouse/termania-api | 20404a7eb30b7bc42183e8047b8f696eb7b881ac | [
"MIT"
] | null | null | null | termania/constants.py | techouse/termania-api | 20404a7eb30b7bc42183e8047b8f696eb7b881ac | [
"MIT"
] | null | null | null | """Termania.net API URI."""
BASE_URL = "https://api.termania.net/1.0/"
| 23.666667 | 42 | 0.647887 | 12 | 71 | 3.75 | 0.75 | 0.488889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030769 | 0.084507 | 71 | 2 | 43 | 35.5 | 0.661538 | 0.295775 | 0 | 0 | 0 | 0 | 0.659091 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
76f94975d1d84f5a5b07593bebd9301ca8860a8f | 9,273 | py | Python | ssda_nlp/xml_parser.py | slavesocieties/ssda-nlp | 8764d2f928ca0fe4e5737fbea4dcd518b8b804f6 | [
"MIT"
] | null | null | null | ssda_nlp/xml_parser.py | slavesocieties/ssda-nlp | 8764d2f928ca0fe4e5737fbea4dcd518b8b804f6 | [
"MIT"
] | 21 | 2021-02-23T22:31:04.000Z | 2022-01-27T22:51:18.000Z | ssda_nlp/xml_parser.py | slavesocieties/ssda-nlp | 8764d2f928ca0fe4e5737fbea4dcd518b8b804f6 | [
"MIT"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 12-ssda-xml-parser.ipynb (unless otherwise specified).
__all__ = ['parse_xml', 'parse_xml_v2', 'xml_v2_to_json', 'retrieve_volume_metadata']
# Cell
import pandas as pd
# Cell
def parse_xml(file_name):
master_xml = open(file_name,"r",encoding='utf-8')
vol_titls = []
vol_ids = []
entry_txts = []
entry_ids = []
fol_ids = []
curr_vol_titl = ""
curr_vol_id= ""
curr_fol_id = ""
curr_entry = ""
in_entry = False
for line in master_xml:
if (line.find('<') != -1) and (line.find('<', line.find('<') + 1) != -1):
line_content = line[line.find('>') + 1:line.find('<', line.find('<') + 1)]
elif line[len(line) - 2] == '-':
line_content = line[:len(line) - 2]
else:
line_content = line[:len(line) - 1] + ' '
if "<volumeTitle>" in line:
curr_vol_titl = line_content
#set current volume title
elif "<volumeIdentifier>" in line:
curr_vol_id = line_content
#set current volume identifier
elif "<itemIdentifier>" in line:
entry_id = 0
curr_fol_id = line_content
#set current folio id
elif "<entry>" in line:
entry_id += 1
in_entry = True
curr_entry = ""
#toggle in entry flag
elif in_entry and (not "</entry>" in line):
curr_entry += line_content
#add line to current entry
elif in_entry and ("</entry>" in line):
in_entry = False
#toggle entry flag, append all current variables to lists
vol_titls.append(curr_vol_titl)
vol_ids.append(curr_vol_id)
fol_ids.append(curr_fol_id)
entry_txts.append(curr_entry)
entry_ids.append(curr_fol_id + '-' + str(entry_id))
columns = {'vol_titl':vol_titls, 'vol_id':vol_ids, 'fol_id':fol_ids, 'text':entry_txts, 'entry_no':entry_ids}
df = pd.DataFrame(columns)
master_xml.close()
return df
# Cell
def parse_xml_v2(path_to_xml):
master_xml = open(path_to_xml,"r",encoding='utf-8')
vol_titls = []
vol_ids = []
entry_txts = []
entry_ids = []
fol_ids = []
curr_vol_titl = ""
curr_vol_id= ""
curr_fol_id = ""
curr_entry = ""
in_entry = False
in_partial_entry = False
for line in master_xml:
if "<volume" in line:
title_start = line.find('\"', line.find("title=")) + 1
title_end = line.find('\"', title_start)
curr_vol_titl = line[title_start:title_end]
id_start = line.find('\"', line.find("id=")) + 1
id_end = line.find('\"', id_start)
curr_vol_id = line[id_start:id_end]
elif "<image" in line:
entry_id = 0
id_start = line.find('\"', line.find("id=")) + 1
id_end = line.find('\"', id_start)
curr_fol_id = line[id_start:id_end]
elif ("<entry" in line) and in_partial_entry:
in_partial_entry = False
vol_titls.append(curr_vol_titl)
vol_ids.append(curr_vol_id)
fol_ids.append(str(int(curr_fol_id) - 1))
entry_txts.append(curr_entry)
entry_ids.append(str(int(curr_fol_id) - 1) + '-' + str(partial_id))
curr_entry = ''
in_entry = True
entry_id += 1
elif "<entry" in line:
entry_id += 1
in_entry = True
curr_entry = ""
elif "<partial id" in line:
in_partial_entry = True
entry_id += 1
partial_id = entry_id
curr_entry = ''
elif in_partial_entry and ("image" in line) or ("partial" in line):
continue
elif in_entry and ("</entry>" in line):
in_entry = False
vol_titls.append(curr_vol_titl)
vol_ids.append(curr_vol_id)
fol_ids.append(curr_fol_id)
entry_txts.append(curr_entry)
entry_ids.append(curr_fol_id + '-' + str(entry_id))
elif in_entry or in_partial_entry:
while line[0] == ' ':
line = line[1:]
if ((line[len(line) - 1] == '\n') or (line[len(line) - 1] == '\n')) and (line[len(line) - 2] == '-'):
curr_entry += line[:len(line) - 2]
elif line[len(line) - 1] == '-':
curr_entry += line[:len(line) - 1]
elif (line == '\n') or (line == '\n'):
continue
elif (line[len(line) - 1] == '\n') or (line[len(line) - 1] == '\n'):
curr_entry += line[:len(line) - 1] + ' '
else:
while line[len(line) - 1] == ' ':
line = line[:-1]
curr_entry += line
columns = {'vol_titl':vol_titls, 'vol_id':vol_ids, 'fol_id':fol_ids, 'text':entry_txts, 'entry_no':entry_ids}
df = pd.DataFrame(columns)
master_xml.close()
return df
# Cell
def xml_v2_to_json(path_to_xml):
master_xml = open(path_to_xml,"r",encoding='utf-8')
vol_titls = []
vol_ids = []
entry_txts = []
entry_ids = []
img_ids = []
img_types = []
img_num = []
curr_vol_titl = ""
curr_vol_id= ""
curr_img_id = ""
curr_entry = ""
curr_img_type = ""
curr_img_num = ""
in_entry = False
in_partial_entry = False
images = []
curr_img_dict = None
for line in master_xml:
if "<volume" in line:
title_start = line.find('\"', line.find("title=")) + 1
title_end = line.find('\"', title_start)
curr_vol_titl = line[title_start:title_end]
id_start = line.find('\"', line.find("id=")) + 1
id_end = line.find('\"', id_start)
curr_vol_id = line[id_start:id_end]
elif "<image" in line:
if curr_img_dict != None:
images.append(curr_img_dict)
entry_id = 0
id_start = line.find('\"', line.find("id=")) + 1
id_end = line.find('\"', id_start)
curr_img_id = line[id_start:id_end]
type_start = line.find('\"', line.find("type=")) + 1
type_end = line.find('\"', type_start)
curr_img_type = line[type_start:type_end]
if line.find("number=") == -1:
curr_img_num = None
else:
num_start = line.find('\"', line.find("number=")) + 1
num_end = line.find('\"', num_start)
curr_img_num = line[num_start:num_end]
curr_img_dict = {"id": curr_img_id, "type": curr_img_type, "number": curr_img_num, "entries": []}
elif ("<entry" in line) and in_partial_entry:
in_partial_entry = False
vol_titls.append(curr_vol_titl)
vol_ids.append(curr_vol_id)
img_ids.append(str(int(curr_img_id) - 1))
entry_txts.append(curr_entry)
entry_ids.append(str(int(curr_img_id) - 1) + '-' + str(partial_id))
curr_img_dict["entries"].append({"id": entry_id, "text": curr_entry})
curr_entry = ''
in_entry = True
entry_id += 1
elif "<entry" in line:
entry_id += 1
in_entry = True
curr_entry = ""
elif "<partial id" in line:
in_partial_entry = True
entry_id += 1
partial_id = entry_id
curr_entry = ''
elif in_partial_entry and ("image" in line) or ("partial" in line):
continue
elif in_entry and ("</entry>" in line):
in_entry = False
vol_titls.append(curr_vol_titl)
vol_ids.append(curr_vol_id)
img_ids.append(curr_img_id)
entry_txts.append(curr_entry)
entry_ids.append(curr_img_id + '-' + str(entry_id))
curr_img_dict["entries"].append({"id": entry_id, "text": curr_entry})
elif in_entry or in_partial_entry:
while line[0] == ' ':
line = line[1:]
if ((line[len(line) - 1] == '\n') or (line[len(line) - 1] == '\n')) and (line[len(line) - 2] == '-'):
curr_entry += line[:len(line) - 2]
elif line[len(line) - 1] == '-':
curr_entry += line[:len(line) - 1]
elif (line == '\n') or (line == '\n'):
continue
elif (line[len(line) - 1] == '\n') or (line[len(line) - 1] == '\n'):
curr_entry += line[:len(line) - 1] + ' '
else:
while line[len(line) - 1] == ' ':
line = line[:-1]
curr_entry += line
elif "</ssda" in line:
images.append(curr_img_dict)
master_xml.close()
return images
# Cell
def retrieve_volume_metadata(path_to_xml):
xml = open(path_to_xml,"r",encoding='utf-8')
volume_metadata = {}
metadata_fields = ["type", "country", "state", "city", "institution", "id", "title"]
for line in xml:
if "<volume" in line:
for field in metadata_fields:
volume_metadata[field] = line[line.find('=', line.find(field)) + 2:line.find('\"', line.find('=', line.find(field)) + 2)]
return volume_metadata | 36.222656 | 137 | 0.528739 | 1,205 | 9,273 | 3.779253 | 0.087137 | 0.063241 | 0.055556 | 0.044796 | 0.764822 | 0.701581 | 0.683136 | 0.66513 | 0.650198 | 0.64383 | 0 | 0.011093 | 0.329235 | 9,273 | 256 | 138 | 36.222656 | 0.721061 | 0.031813 | 0 | 0.745455 | 1 | 0 | 0.061454 | 0.002677 | 0 | 0 | 0 | 0 | 0 | 1 | 0.018182 | false | 0 | 0.004545 | 0 | 0.040909 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0a0c56d673b1872c21ea43fcbc87d8bb4727e8c4 | 184 | py | Python | flask_app/models/orders.py | Schneider-Alex/Barrel_Cru | c5a501dfd97af5c30287a3e771e86c13cc2d77dc | [
"MIT"
] | null | null | null | flask_app/models/orders.py | Schneider-Alex/Barrel_Cru | c5a501dfd97af5c30287a3e771e86c13cc2d77dc | [
"MIT"
] | null | null | null | flask_app/models/orders.py | Schneider-Alex/Barrel_Cru | c5a501dfd97af5c30287a3e771e86c13cc2d77dc | [
"MIT"
] | null | null | null | from flask_app.config.mysqlconnection import MySQLConnection, connectToMySQL
from flask import flash, session, request
from flask_app import app
class Order:
db ='Barrel_Cru'
| 26.285714 | 76 | 0.798913 | 24 | 184 | 6 | 0.625 | 0.1875 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152174 | 184 | 7 | 77 | 26.285714 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0.054054 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
0a24ee4705b6edbef985e50e8dcfe854ce1bcefe | 154 | py | Python | ch_05/task9.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | ch_05/task9.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | ch_05/task9.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
ph = float(input('Enter pH value: '))
if ph < 3.0:
print(ph, "is VERY acidic! Be careful.")
elif ph < 7.0:
print(ph, "is acidic")
| 17.111111 | 40 | 0.623377 | 29 | 154 | 3.310345 | 0.689655 | 0.125 | 0.166667 | 0.208333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031496 | 0.175325 | 154 | 8 | 41 | 19.25 | 0.724409 | 0.12987 | 0 | 0 | 0 | 0 | 0.393939 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.4 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0a4ec87c6d91e939ebe3cbca12a971fcd430e6c4 | 72 | py | Python | flask/Webapp/__init__.py | LvDunn/bilibili_leaderboard | 54304dd000fd7bfe28f0756d543a191ef0a6d3ad | [
"MIT"
] | 3 | 2019-05-23T01:43:09.000Z | 2020-04-07T06:00:19.000Z | flask/Webapp/__init__.py | LvDunn/bilibili_leaderboard | 54304dd000fd7bfe28f0756d543a191ef0a6d3ad | [
"MIT"
] | 1 | 2020-08-12T20:28:13.000Z | 2021-02-21T05:11:03.000Z | flask/Webapp/__init__.py | LyuDun/Flask_blog | 54304dd000fd7bfe28f0756d543a191ef0a6d3ad | [
"MIT"
] | 1 | 2019-12-31T07:56:16.000Z | 2019-12-31T07:56:16.000Z | from flask import Flask
app = Flask(__name__)
from Webapp import views
| 14.4 | 24 | 0.791667 | 11 | 72 | 4.818182 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 72 | 4 | 25 | 18 | 0.883333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
0a6fcd7cefbd00d54b5a23d81247f94cc70f60a2 | 103 | py | Python | test_hello.py | diacobac/ansible_class | 25bdc71789d4947ad98ef71f8ddfff848d06b822 | [
"Apache-2.0"
] | null | null | null | test_hello.py | diacobac/ansible_class | 25bdc71789d4947ad98ef71f8ddfff848d06b822 | [
"Apache-2.0"
] | null | null | null | test_hello.py | diacobac/ansible_class | 25bdc71789d4947ad98ef71f8ddfff848d06b822 | [
"Apache-2.0"
] | null | null | null | print "Hello World!"
print "Something Else"
print "I need some help"
for i in range (10):
print i
| 11.444444 | 24 | 0.679612 | 18 | 103 | 3.888889 | 0.722222 | 0.171429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025 | 0.223301 | 103 | 8 | 25 | 12.875 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0.407767 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.8 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
6a50b97cc740e3ae7b24f1965f7f699d7f2ac59e | 31,709 | py | Python | sdk/python/pulumi_azure_native/containerinstance/v20210701/container_group.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/containerinstance/v20210701/container_group.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/containerinstance/v20210701/container_group.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['ContainerGroupArgs', 'ContainerGroup']
@pulumi.input_type
class ContainerGroupArgs:
def __init__(__self__, *,
containers: pulumi.Input[Sequence[pulumi.Input['ContainerArgs']]],
os_type: pulumi.Input[Union[str, 'OperatingSystemTypes']],
resource_group_name: pulumi.Input[str],
container_group_name: Optional[pulumi.Input[str]] = None,
diagnostics: Optional[pulumi.Input['ContainerGroupDiagnosticsArgs']] = None,
dns_config: Optional[pulumi.Input['DnsConfigurationArgs']] = None,
encryption_properties: Optional[pulumi.Input['EncryptionPropertiesArgs']] = None,
identity: Optional[pulumi.Input['ContainerGroupIdentityArgs']] = None,
image_registry_credentials: Optional[pulumi.Input[Sequence[pulumi.Input['ImageRegistryCredentialArgs']]]] = None,
init_containers: Optional[pulumi.Input[Sequence[pulumi.Input['InitContainerDefinitionArgs']]]] = None,
ip_address: Optional[pulumi.Input['IpAddressArgs']] = None,
location: Optional[pulumi.Input[str]] = None,
restart_policy: Optional[pulumi.Input[Union[str, 'ContainerGroupRestartPolicy']]] = None,
sku: Optional[pulumi.Input[Union[str, 'ContainerGroupSku']]] = None,
subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input['ContainerGroupSubnetIdArgs']]]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
volumes: Optional[pulumi.Input[Sequence[pulumi.Input['VolumeArgs']]]] = None):
"""
The set of arguments for constructing a ContainerGroup resource.
:param pulumi.Input[Sequence[pulumi.Input['ContainerArgs']]] containers: The containers within the container group.
:param pulumi.Input[Union[str, 'OperatingSystemTypes']] os_type: The operating system type required by the containers in the container group.
:param pulumi.Input[str] resource_group_name: The name of the resource group.
:param pulumi.Input[str] container_group_name: The name of the container group.
:param pulumi.Input['ContainerGroupDiagnosticsArgs'] diagnostics: The diagnostic information for a container group.
:param pulumi.Input['DnsConfigurationArgs'] dns_config: The DNS config information for a container group.
:param pulumi.Input['EncryptionPropertiesArgs'] encryption_properties: The encryption properties for a container group.
:param pulumi.Input['ContainerGroupIdentityArgs'] identity: The identity of the container group, if configured.
:param pulumi.Input[Sequence[pulumi.Input['ImageRegistryCredentialArgs']]] image_registry_credentials: The image registry credentials by which the container group is created from.
:param pulumi.Input[Sequence[pulumi.Input['InitContainerDefinitionArgs']]] init_containers: The init containers for a container group.
:param pulumi.Input['IpAddressArgs'] ip_address: The IP address type of the container group.
:param pulumi.Input[str] location: The resource location.
:param pulumi.Input[Union[str, 'ContainerGroupRestartPolicy']] restart_policy: Restart policy for all containers within the container group.
- `Always` Always restart
- `OnFailure` Restart on failure
- `Never` Never restart
:param pulumi.Input[Union[str, 'ContainerGroupSku']] sku: The SKU for a container group.
:param pulumi.Input[Sequence[pulumi.Input['ContainerGroupSubnetIdArgs']]] subnet_ids: The subnet resource IDs for a container group.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: The resource tags.
:param pulumi.Input[Sequence[pulumi.Input['VolumeArgs']]] volumes: The list of volumes that can be mounted by containers in this container group.
"""
pulumi.set(__self__, "containers", containers)
pulumi.set(__self__, "os_type", os_type)
pulumi.set(__self__, "resource_group_name", resource_group_name)
if container_group_name is not None:
pulumi.set(__self__, "container_group_name", container_group_name)
if diagnostics is not None:
pulumi.set(__self__, "diagnostics", diagnostics)
if dns_config is not None:
pulumi.set(__self__, "dns_config", dns_config)
if encryption_properties is not None:
pulumi.set(__self__, "encryption_properties", encryption_properties)
if identity is not None:
pulumi.set(__self__, "identity", identity)
if image_registry_credentials is not None:
pulumi.set(__self__, "image_registry_credentials", image_registry_credentials)
if init_containers is not None:
pulumi.set(__self__, "init_containers", init_containers)
if ip_address is not None:
pulumi.set(__self__, "ip_address", ip_address)
if location is not None:
pulumi.set(__self__, "location", location)
if restart_policy is not None:
pulumi.set(__self__, "restart_policy", restart_policy)
if sku is not None:
pulumi.set(__self__, "sku", sku)
if subnet_ids is not None:
pulumi.set(__self__, "subnet_ids", subnet_ids)
if tags is not None:
pulumi.set(__self__, "tags", tags)
if volumes is not None:
pulumi.set(__self__, "volumes", volumes)
@property
@pulumi.getter
def containers(self) -> pulumi.Input[Sequence[pulumi.Input['ContainerArgs']]]:
"""
The containers within the container group.
"""
return pulumi.get(self, "containers")
@containers.setter
def containers(self, value: pulumi.Input[Sequence[pulumi.Input['ContainerArgs']]]):
pulumi.set(self, "containers", value)
@property
@pulumi.getter(name="osType")
def os_type(self) -> pulumi.Input[Union[str, 'OperatingSystemTypes']]:
"""
The operating system type required by the containers in the container group.
"""
return pulumi.get(self, "os_type")
@os_type.setter
def os_type(self, value: pulumi.Input[Union[str, 'OperatingSystemTypes']]):
pulumi.set(self, "os_type", value)
@property
@pulumi.getter(name="resourceGroupName")
def resource_group_name(self) -> pulumi.Input[str]:
"""
The name of the resource group.
"""
return pulumi.get(self, "resource_group_name")
@resource_group_name.setter
def resource_group_name(self, value: pulumi.Input[str]):
pulumi.set(self, "resource_group_name", value)
@property
@pulumi.getter(name="containerGroupName")
def container_group_name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the container group.
"""
return pulumi.get(self, "container_group_name")
@container_group_name.setter
def container_group_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "container_group_name", value)
@property
@pulumi.getter
def diagnostics(self) -> Optional[pulumi.Input['ContainerGroupDiagnosticsArgs']]:
"""
The diagnostic information for a container group.
"""
return pulumi.get(self, "diagnostics")
@diagnostics.setter
def diagnostics(self, value: Optional[pulumi.Input['ContainerGroupDiagnosticsArgs']]):
pulumi.set(self, "diagnostics", value)
@property
@pulumi.getter(name="dnsConfig")
def dns_config(self) -> Optional[pulumi.Input['DnsConfigurationArgs']]:
"""
The DNS config information for a container group.
"""
return pulumi.get(self, "dns_config")
@dns_config.setter
def dns_config(self, value: Optional[pulumi.Input['DnsConfigurationArgs']]):
pulumi.set(self, "dns_config", value)
@property
@pulumi.getter(name="encryptionProperties")
def encryption_properties(self) -> Optional[pulumi.Input['EncryptionPropertiesArgs']]:
"""
The encryption properties for a container group.
"""
return pulumi.get(self, "encryption_properties")
@encryption_properties.setter
def encryption_properties(self, value: Optional[pulumi.Input['EncryptionPropertiesArgs']]):
pulumi.set(self, "encryption_properties", value)
@property
@pulumi.getter
def identity(self) -> Optional[pulumi.Input['ContainerGroupIdentityArgs']]:
"""
The identity of the container group, if configured.
"""
return pulumi.get(self, "identity")
@identity.setter
def identity(self, value: Optional[pulumi.Input['ContainerGroupIdentityArgs']]):
pulumi.set(self, "identity", value)
@property
@pulumi.getter(name="imageRegistryCredentials")
def image_registry_credentials(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ImageRegistryCredentialArgs']]]]:
"""
The image registry credentials by which the container group is created from.
"""
return pulumi.get(self, "image_registry_credentials")
@image_registry_credentials.setter
def image_registry_credentials(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ImageRegistryCredentialArgs']]]]):
pulumi.set(self, "image_registry_credentials", value)
@property
@pulumi.getter(name="initContainers")
def init_containers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InitContainerDefinitionArgs']]]]:
"""
The init containers for a container group.
"""
return pulumi.get(self, "init_containers")
@init_containers.setter
def init_containers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['InitContainerDefinitionArgs']]]]):
pulumi.set(self, "init_containers", value)
@property
@pulumi.getter(name="ipAddress")
def ip_address(self) -> Optional[pulumi.Input['IpAddressArgs']]:
"""
The IP address type of the container group.
"""
return pulumi.get(self, "ip_address")
@ip_address.setter
def ip_address(self, value: Optional[pulumi.Input['IpAddressArgs']]):
pulumi.set(self, "ip_address", value)
@property
@pulumi.getter
def location(self) -> Optional[pulumi.Input[str]]:
"""
The resource location.
"""
return pulumi.get(self, "location")
@location.setter
def location(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "location", value)
@property
@pulumi.getter(name="restartPolicy")
def restart_policy(self) -> Optional[pulumi.Input[Union[str, 'ContainerGroupRestartPolicy']]]:
"""
Restart policy for all containers within the container group.
- `Always` Always restart
- `OnFailure` Restart on failure
- `Never` Never restart
"""
return pulumi.get(self, "restart_policy")
@restart_policy.setter
def restart_policy(self, value: Optional[pulumi.Input[Union[str, 'ContainerGroupRestartPolicy']]]):
pulumi.set(self, "restart_policy", value)
@property
@pulumi.getter
def sku(self) -> Optional[pulumi.Input[Union[str, 'ContainerGroupSku']]]:
"""
The SKU for a container group.
"""
return pulumi.get(self, "sku")
@sku.setter
def sku(self, value: Optional[pulumi.Input[Union[str, 'ContainerGroupSku']]]):
pulumi.set(self, "sku", value)
@property
@pulumi.getter(name="subnetIds")
def subnet_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ContainerGroupSubnetIdArgs']]]]:
"""
The subnet resource IDs for a container group.
"""
return pulumi.get(self, "subnet_ids")
@subnet_ids.setter
def subnet_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ContainerGroupSubnetIdArgs']]]]):
pulumi.set(self, "subnet_ids", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
The resource tags.
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "tags", value)
@property
@pulumi.getter
def volumes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['VolumeArgs']]]]:
"""
The list of volumes that can be mounted by containers in this container group.
"""
return pulumi.get(self, "volumes")
@volumes.setter
def volumes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['VolumeArgs']]]]):
pulumi.set(self, "volumes", value)
class ContainerGroup(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
container_group_name: Optional[pulumi.Input[str]] = None,
containers: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ContainerArgs']]]]] = None,
diagnostics: Optional[pulumi.Input[pulumi.InputType['ContainerGroupDiagnosticsArgs']]] = None,
dns_config: Optional[pulumi.Input[pulumi.InputType['DnsConfigurationArgs']]] = None,
encryption_properties: Optional[pulumi.Input[pulumi.InputType['EncryptionPropertiesArgs']]] = None,
identity: Optional[pulumi.Input[pulumi.InputType['ContainerGroupIdentityArgs']]] = None,
image_registry_credentials: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ImageRegistryCredentialArgs']]]]] = None,
init_containers: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['InitContainerDefinitionArgs']]]]] = None,
ip_address: Optional[pulumi.Input[pulumi.InputType['IpAddressArgs']]] = None,
location: Optional[pulumi.Input[str]] = None,
os_type: Optional[pulumi.Input[Union[str, 'OperatingSystemTypes']]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
restart_policy: Optional[pulumi.Input[Union[str, 'ContainerGroupRestartPolicy']]] = None,
sku: Optional[pulumi.Input[Union[str, 'ContainerGroupSku']]] = None,
subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ContainerGroupSubnetIdArgs']]]]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
volumes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VolumeArgs']]]]] = None,
__props__=None):
"""
A container group.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] container_group_name: The name of the container group.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ContainerArgs']]]] containers: The containers within the container group.
:param pulumi.Input[pulumi.InputType['ContainerGroupDiagnosticsArgs']] diagnostics: The diagnostic information for a container group.
:param pulumi.Input[pulumi.InputType['DnsConfigurationArgs']] dns_config: The DNS config information for a container group.
:param pulumi.Input[pulumi.InputType['EncryptionPropertiesArgs']] encryption_properties: The encryption properties for a container group.
:param pulumi.Input[pulumi.InputType['ContainerGroupIdentityArgs']] identity: The identity of the container group, if configured.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ImageRegistryCredentialArgs']]]] image_registry_credentials: The image registry credentials by which the container group is created from.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['InitContainerDefinitionArgs']]]] init_containers: The init containers for a container group.
:param pulumi.Input[pulumi.InputType['IpAddressArgs']] ip_address: The IP address type of the container group.
:param pulumi.Input[str] location: The resource location.
:param pulumi.Input[Union[str, 'OperatingSystemTypes']] os_type: The operating system type required by the containers in the container group.
:param pulumi.Input[str] resource_group_name: The name of the resource group.
:param pulumi.Input[Union[str, 'ContainerGroupRestartPolicy']] restart_policy: Restart policy for all containers within the container group.
- `Always` Always restart
- `OnFailure` Restart on failure
- `Never` Never restart
:param pulumi.Input[Union[str, 'ContainerGroupSku']] sku: The SKU for a container group.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ContainerGroupSubnetIdArgs']]]] subnet_ids: The subnet resource IDs for a container group.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: The resource tags.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VolumeArgs']]]] volumes: The list of volumes that can be mounted by containers in this container group.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: ContainerGroupArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
A container group.
:param str resource_name: The name of the resource.
:param ContainerGroupArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(ContainerGroupArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
container_group_name: Optional[pulumi.Input[str]] = None,
containers: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ContainerArgs']]]]] = None,
diagnostics: Optional[pulumi.Input[pulumi.InputType['ContainerGroupDiagnosticsArgs']]] = None,
dns_config: Optional[pulumi.Input[pulumi.InputType['DnsConfigurationArgs']]] = None,
encryption_properties: Optional[pulumi.Input[pulumi.InputType['EncryptionPropertiesArgs']]] = None,
identity: Optional[pulumi.Input[pulumi.InputType['ContainerGroupIdentityArgs']]] = None,
image_registry_credentials: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ImageRegistryCredentialArgs']]]]] = None,
init_containers: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['InitContainerDefinitionArgs']]]]] = None,
ip_address: Optional[pulumi.Input[pulumi.InputType['IpAddressArgs']]] = None,
location: Optional[pulumi.Input[str]] = None,
os_type: Optional[pulumi.Input[Union[str, 'OperatingSystemTypes']]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
restart_policy: Optional[pulumi.Input[Union[str, 'ContainerGroupRestartPolicy']]] = None,
sku: Optional[pulumi.Input[Union[str, 'ContainerGroupSku']]] = None,
subnet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ContainerGroupSubnetIdArgs']]]]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
volumes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VolumeArgs']]]]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = ContainerGroupArgs.__new__(ContainerGroupArgs)
__props__.__dict__["container_group_name"] = container_group_name
if containers is None and not opts.urn:
raise TypeError("Missing required property 'containers'")
__props__.__dict__["containers"] = containers
__props__.__dict__["diagnostics"] = diagnostics
__props__.__dict__["dns_config"] = dns_config
__props__.__dict__["encryption_properties"] = encryption_properties
__props__.__dict__["identity"] = identity
__props__.__dict__["image_registry_credentials"] = image_registry_credentials
__props__.__dict__["init_containers"] = init_containers
__props__.__dict__["ip_address"] = ip_address
__props__.__dict__["location"] = location
if os_type is None and not opts.urn:
raise TypeError("Missing required property 'os_type'")
__props__.__dict__["os_type"] = os_type
if resource_group_name is None and not opts.urn:
raise TypeError("Missing required property 'resource_group_name'")
__props__.__dict__["resource_group_name"] = resource_group_name
__props__.__dict__["restart_policy"] = restart_policy
__props__.__dict__["sku"] = sku
__props__.__dict__["subnet_ids"] = subnet_ids
__props__.__dict__["tags"] = tags
__props__.__dict__["volumes"] = volumes
__props__.__dict__["instance_view"] = None
__props__.__dict__["name"] = None
__props__.__dict__["provisioning_state"] = None
__props__.__dict__["type"] = None
alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="azure-nextgen:containerinstance/v20210701:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20170801preview:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20170801preview:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20171001preview:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20171001preview:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20171201preview:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20171201preview:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20180201preview:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20180201preview:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20180401:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20180401:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20180601:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20180601:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20180901:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20180901:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20181001:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20181001:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20191201:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20191201:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20201101:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20201101:ContainerGroup"), pulumi.Alias(type_="azure-native:containerinstance/v20210301:ContainerGroup"), pulumi.Alias(type_="azure-nextgen:containerinstance/v20210301:ContainerGroup")])
opts = pulumi.ResourceOptions.merge(opts, alias_opts)
super(ContainerGroup, __self__).__init__(
'azure-native:containerinstance/v20210701:ContainerGroup',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'ContainerGroup':
"""
Get an existing ContainerGroup resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = ContainerGroupArgs.__new__(ContainerGroupArgs)
__props__.__dict__["containers"] = None
__props__.__dict__["diagnostics"] = None
__props__.__dict__["dns_config"] = None
__props__.__dict__["encryption_properties"] = None
__props__.__dict__["identity"] = None
__props__.__dict__["image_registry_credentials"] = None
__props__.__dict__["init_containers"] = None
__props__.__dict__["instance_view"] = None
__props__.__dict__["ip_address"] = None
__props__.__dict__["location"] = None
__props__.__dict__["name"] = None
__props__.__dict__["os_type"] = None
__props__.__dict__["provisioning_state"] = None
__props__.__dict__["restart_policy"] = None
__props__.__dict__["sku"] = None
__props__.__dict__["subnet_ids"] = None
__props__.__dict__["tags"] = None
__props__.__dict__["type"] = None
__props__.__dict__["volumes"] = None
return ContainerGroup(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def containers(self) -> pulumi.Output[Sequence['outputs.ContainerResponse']]:
"""
The containers within the container group.
"""
return pulumi.get(self, "containers")
@property
@pulumi.getter
def diagnostics(self) -> pulumi.Output[Optional['outputs.ContainerGroupDiagnosticsResponse']]:
"""
The diagnostic information for a container group.
"""
return pulumi.get(self, "diagnostics")
@property
@pulumi.getter(name="dnsConfig")
def dns_config(self) -> pulumi.Output[Optional['outputs.DnsConfigurationResponse']]:
"""
The DNS config information for a container group.
"""
return pulumi.get(self, "dns_config")
@property
@pulumi.getter(name="encryptionProperties")
def encryption_properties(self) -> pulumi.Output[Optional['outputs.EncryptionPropertiesResponse']]:
"""
The encryption properties for a container group.
"""
return pulumi.get(self, "encryption_properties")
@property
@pulumi.getter
def identity(self) -> pulumi.Output[Optional['outputs.ContainerGroupIdentityResponse']]:
"""
The identity of the container group, if configured.
"""
return pulumi.get(self, "identity")
@property
@pulumi.getter(name="imageRegistryCredentials")
def image_registry_credentials(self) -> pulumi.Output[Optional[Sequence['outputs.ImageRegistryCredentialResponse']]]:
"""
The image registry credentials by which the container group is created from.
"""
return pulumi.get(self, "image_registry_credentials")
@property
@pulumi.getter(name="initContainers")
def init_containers(self) -> pulumi.Output[Optional[Sequence['outputs.InitContainerDefinitionResponse']]]:
"""
The init containers for a container group.
"""
return pulumi.get(self, "init_containers")
@property
@pulumi.getter(name="instanceView")
def instance_view(self) -> pulumi.Output['outputs.ContainerGroupResponseInstanceView']:
"""
The instance view of the container group. Only valid in response.
"""
return pulumi.get(self, "instance_view")
@property
@pulumi.getter(name="ipAddress")
def ip_address(self) -> pulumi.Output[Optional['outputs.IpAddressResponse']]:
"""
The IP address type of the container group.
"""
return pulumi.get(self, "ip_address")
@property
@pulumi.getter
def location(self) -> pulumi.Output[Optional[str]]:
"""
The resource location.
"""
return pulumi.get(self, "location")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
The resource name.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="osType")
def os_type(self) -> pulumi.Output[str]:
"""
The operating system type required by the containers in the container group.
"""
return pulumi.get(self, "os_type")
@property
@pulumi.getter(name="provisioningState")
def provisioning_state(self) -> pulumi.Output[str]:
"""
The provisioning state of the container group. This only appears in the response.
"""
return pulumi.get(self, "provisioning_state")
@property
@pulumi.getter(name="restartPolicy")
def restart_policy(self) -> pulumi.Output[Optional[str]]:
"""
Restart policy for all containers within the container group.
- `Always` Always restart
- `OnFailure` Restart on failure
- `Never` Never restart
"""
return pulumi.get(self, "restart_policy")
@property
@pulumi.getter
def sku(self) -> pulumi.Output[Optional[str]]:
"""
The SKU for a container group.
"""
return pulumi.get(self, "sku")
@property
@pulumi.getter(name="subnetIds")
def subnet_ids(self) -> pulumi.Output[Optional[Sequence['outputs.ContainerGroupSubnetIdResponse']]]:
"""
The subnet resource IDs for a container group.
"""
return pulumi.get(self, "subnet_ids")
@property
@pulumi.getter
def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
"""
The resource tags.
"""
return pulumi.get(self, "tags")
@property
@pulumi.getter
def type(self) -> pulumi.Output[str]:
"""
The resource type.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter
def volumes(self) -> pulumi.Output[Optional[Sequence['outputs.VolumeResponse']]]:
"""
The list of volumes that can be mounted by containers in this container group.
"""
return pulumi.get(self, "volumes")
| 50.492038 | 2,077 | 0.67555 | 3,314 | 31,709 | 6.22752 | 0.065178 | 0.087412 | 0.069968 | 0.033143 | 0.802161 | 0.730885 | 0.644733 | 0.506154 | 0.474319 | 0.427512 | 0 | 0.007728 | 0.212432 | 31,709 | 627 | 2,078 | 50.572568 | 0.818684 | 0.223186 | 0 | 0.418848 | 1 | 0 | 0.219314 | 0.13482 | 0 | 0 | 0 | 0 | 0 | 1 | 0.15445 | false | 0.002618 | 0.020942 | 0 | 0.277487 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
6a5ed0737cf0f82dd6850bbf450df3d407a92cf1 | 358 | py | Python | src/http_requests_viewer/templatetags/http_requests_viewer.py | tinnguyen18920/http-requests-viewer | 9fc725d0caffe851e566aedf68a2916349dab4c6 | [
"BSD-3-Clause"
] | null | null | null | src/http_requests_viewer/templatetags/http_requests_viewer.py | tinnguyen18920/http-requests-viewer | 9fc725d0caffe851e566aedf68a2916349dab4c6 | [
"BSD-3-Clause"
] | null | null | null | src/http_requests_viewer/templatetags/http_requests_viewer.py | tinnguyen18920/http-requests-viewer | 9fc725d0caffe851e566aedf68a2916349dab4c6 | [
"BSD-3-Clause"
] | 1 | 2021-05-19T04:13:42.000Z | 2021-05-19T04:13:42.000Z | from urllib.parse import urlparse, urljoin
from django import template
register = template.Library()
@register.filter
def hostname(url):
""" """
return urlparse(url).hostname
@register.filter
def path(url):
""" """
return urlparse(url).path
@register.filter
def clean_url(url):
""" """
return urljoin(url, urlparse(url).path) | 17.9 | 44 | 0.673184 | 43 | 358 | 5.581395 | 0.395349 | 0.175 | 0.2125 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184358 | 358 | 20 | 44 | 17.9 | 0.821918 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.166667 | 0 | 0.666667 | 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 | 0 | 1 | 0 | 0 | 4 |
6a81c9eb75660a684fd474a0681d4efd4ff10d5f | 34 | py | Python | urduhack/models/common/__init__.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 252 | 2018-08-20T16:16:45.000Z | 2022-03-04T07:03:58.000Z | urduhack/models/common/__init__.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 111 | 2019-01-21T11:39:45.000Z | 2021-09-30T07:26:50.000Z | urduhack/models/common/__init__.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 35 | 2019-02-09T14:29:36.000Z | 2022-01-09T10:02:56.000Z | # coding: utf8
"""Common Utils"""
| 11.333333 | 18 | 0.617647 | 4 | 34 | 5.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 0.147059 | 34 | 2 | 19 | 17 | 0.689655 | 0.764706 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
6a8f2cc6a73c92f92c3697aa9e93f33a83bf76ad | 370 | py | Python | solutions/python/find-missing-element.py | matthewvilhauer/code-problems | cd4b3bf62151824caf0d4cf1beff643b328aca91 | [
"MIT"
] | 1,461 | 2015-01-02T21:03:45.000Z | 2022-03-26T05:06:31.000Z | solutions/python/find-missing-element.py | Akash1507/interview-with-python | b5ce31c8bdca754a76762d2734dcf494a302e487 | [
"MIT"
] | 32 | 2015-01-07T00:53:12.000Z | 2020-04-19T14:53:45.000Z | solutions/python/find-missing-element.py | Akash1507/interview-with-python | b5ce31c8bdca754a76762d2734dcf494a302e487 | [
"MIT"
] | 520 | 2015-01-03T14:01:26.000Z | 2022-03-26T05:07:00.000Z | """finds the missing element in the shuffled list"""
def difference_set(orig, shuffled):
"""finds the missing element using a set."""
return set(orig).difference(set(shuffled)).pop()
def difference_iterative(orig, shuffled):
"""finds the missing element by iterating over the list"""
for x in orig:
if not x in shuffled:
return x
| 26.428571 | 62 | 0.67027 | 52 | 370 | 4.730769 | 0.442308 | 0.097561 | 0.182927 | 0.268293 | 0.276423 | 0.276423 | 0 | 0 | 0 | 0 | 0 | 0 | 0.224324 | 370 | 13 | 63 | 28.461538 | 0.857143 | 0.372973 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 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 | 0 | 1 | 0 | 0 | 4 |
6a978ad2ae8bbc74eded18a7de38e925911b2c13 | 111 | py | Python | ansq/http/__init__.py | lig/ansq | ef734e143a2f982f92616611b1c7b2d7f0c4cc92 | [
"MIT"
] | 14 | 2020-05-22T22:54:04.000Z | 2022-02-16T12:15:45.000Z | ansq/http/__init__.py | Ivashkaization/ansq | f89d0ad29fa067ab0169fdee2910aff58b65c790 | [
"MIT"
] | 31 | 2020-05-28T12:10:45.000Z | 2022-03-31T04:39:48.000Z | ansq/http/__init__.py | Ivashkaization/ansq | f89d0ad29fa067ab0169fdee2910aff58b65c790 | [
"MIT"
] | 7 | 2020-05-28T10:40:03.000Z | 2022-03-28T19:54:02.000Z | from .lookupd import NsqLookupd
from .writer import NSQDHTTPWriter
__all__ = ["NsqLookupd", "NSQDHTTPWriter"]
| 22.2 | 42 | 0.792793 | 11 | 111 | 7.636364 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117117 | 111 | 4 | 43 | 27.75 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0.216216 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
6acd761602722c04db90c43a119e3d79193ae711 | 204 | py | Python | pysrc/log.py | uuosio/ipyeos | 88d9f96954eabb38e9e5893ab6c0483aaa90140a | [
"MIT"
] | null | null | null | pysrc/log.py | uuosio/ipyeos | 88d9f96954eabb38e9e5893ab6c0483aaa90140a | [
"MIT"
] | null | null | null | pysrc/log.py | uuosio/ipyeos | 88d9f96954eabb38e9e5893ab6c0483aaa90140a | [
"MIT"
] | null | null | null | import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(levelname)s %(module)s %(lineno)d %(message)s')
def get_logger(name):
return logging.getLogger(name)
| 25.5 | 89 | 0.666667 | 26 | 204 | 5.192308 | 0.730769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.186275 | 204 | 7 | 90 | 29.142857 | 0.813253 | 0 | 0 | 0 | 0 | 0 | 0.289216 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0.2 | 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 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
6adcb3942bfab9495a7ab051e6196eec55f838ae | 1,983 | py | Python | Server APP/epl/footballdata/models.py | seanjohn85/Premier-League | 61c1406733e9c6fb282f8a4544a2f16cd6ff80a0 | [
"MIT"
] | null | null | null | Server APP/epl/footballdata/models.py | seanjohn85/Premier-League | 61c1406733e9c6fb282f8a4544a2f16cd6ff80a0 | [
"MIT"
] | null | null | null | Server APP/epl/footballdata/models.py | seanjohn85/Premier-League | 61c1406733e9c6fb282f8a4544a2f16cd6ff80a0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
import uuid # The uuid module
# Create your models here.
class Team(models.Model):
code = models.UUIDField(primary_key=True, default=uuid.uuid4)
name = models.CharField(max_length=80)
strength_defence_home = models.IntegerField(default=0)
strength_attack_home = models.IntegerField(default=0)
strength_overall_home = models.IntegerField(default=0)
strength_attack_away = models.IntegerField(default=0)
strength_defence_away = models.IntegerField(default=0)
strength_overall_away = models.IntegerField(default=0)
class Player(models.Model):
playerId = models.UUIDField(primary_key=True, default=uuid.uuid4)
teams = models.ForeignKey(Team, on_delete=models.CASCADE)
f_name = models.CharField(max_length=80)
l_name = models.CharField(max_length=80)
pos = models.CharField(max_length=20)
goals = models.IntegerField(default=0)
assits = models.IntegerField(default=0)
saves = models.IntegerField(default=0)
clean_sheets = models.IntegerField(default=0)
number = models.IntegerField(default=0)
goals_conceded = models.IntegerField(default=0)
own_goals = models.IntegerField(default=0)
penalties_saved = models.IntegerField(default=0)
photo = models.CharField(max_length=100)
penalties_missed = models.IntegerField(default=0)
yellow_cards = models.IntegerField(default=0)
red_cards = models.IntegerField(default=0)
influence = models.IntegerField(default=0)
creativity = models.IntegerField(default=0)
threat = models.IntegerField(default=0)
news = models.CharField(max_length=500) | 46.116279 | 84 | 0.643469 | 213 | 1,983 | 5.826291 | 0.338028 | 0.290089 | 0.402901 | 0.419017 | 0.443191 | 0.319098 | 0.143433 | 0.072522 | 0 | 0 | 0 | 0.025517 | 0.268785 | 1,983 | 43 | 85 | 46.116279 | 0.830345 | 0.031266 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.088235 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
6ae0d0a0f269dc7db2059744b9f30c62c8754342 | 60 | py | Python | gxb/__init__.py | zjhmale/gxb.py | 7bd352433916f5b92c34c2ec1c7092822243dd78 | [
"MIT"
] | null | null | null | gxb/__init__.py | zjhmale/gxb.py | 7bd352433916f5b92c34c2ec1c7092822243dd78 | [
"MIT"
] | null | null | null | gxb/__init__.py | zjhmale/gxb.py | 7bd352433916f5b92c34c2ec1c7092822243dd78 | [
"MIT"
] | null | null | null | """GXB API Python Wrapper
.. moduleauthor:: ZHENG JIHUI
"""
| 15 | 29 | 0.683333 | 7 | 60 | 5.857143 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 60 | 3 | 30 | 20 | 0.803922 | 0.866667 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
6ae2b3bd3a0737641f16a69ad276d358c435cc14 | 184 | py | Python | Day 10/docstrings.py | Dheer08/Python-Projects | 05d0e5e6613f924ab083e13f28a7a0446bd34434 | [
"MIT"
] | null | null | null | Day 10/docstrings.py | Dheer08/Python-Projects | 05d0e5e6613f924ab083e13f28a7a0446bd34434 | [
"MIT"
] | null | null | null | Day 10/docstrings.py | Dheer08/Python-Projects | 05d0e5e6613f924ab083e13f28a7a0446bd34434 | [
"MIT"
] | null | null | null | import math
def square_root(x):
"""
It gives the square root of a given number
"""
return math.sqrt(x)
square_root(10) # Hold your cursor for a while on function name | 23 | 64 | 0.673913 | 31 | 184 | 3.935484 | 0.774194 | 0.245902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014388 | 0.244565 | 184 | 8 | 64 | 23 | 0.863309 | 0.483696 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
0a812ac4988ac32e6a27d7922ce293f984099730 | 109 | py | Python | learning/PicoScope/picosdk-python-examples-master/picosdk-python-examples-master/picosdk/__init__.py | ColdMatter/PhotonBEC | c6bcf9bdefd267c8adde0d299cf5920b010c5022 | [
"MIT"
] | 20 | 2017-05-11T14:00:21.000Z | 2022-03-15T06:11:53.000Z | learning/PicoScope/picosdk-python-examples-master/picosdk-python-examples-master/picosdk/__init__.py | ColdMatter/PhotonBEC | c6bcf9bdefd267c8adde0d299cf5920b010c5022 | [
"MIT"
] | 13 | 2017-09-01T06:44:13.000Z | 2018-09-14T16:08:27.000Z | learning/PicoScope/picosdk-python-examples-master/picosdk-python-examples-master/picosdk/__init__.py | ColdMatter/PhotonBEC | c6bcf9bdefd267c8adde0d299cf5920b010c5022 | [
"MIT"
] | 17 | 2017-09-01T06:25:36.000Z | 2022-03-15T06:11:54.000Z | #
# Copyright (C) 2014-2017 Pico Technology Ltd. See LICENSE file for terms.
#
"""
Initialisation script.
""" | 18.166667 | 74 | 0.706422 | 14 | 109 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 0.155963 | 109 | 6 | 75 | 18.166667 | 0.75 | 0.880734 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0a81fe2c4e26aa2eb3b5a69c7f4e109fd1cf6552 | 30,001 | py | Python | slowfast/models/video_model_builder.py | Finspire13/SlowFast | 4ba356753dfbe04ec06b9aafb11d33ff17340170 | [
"Apache-2.0"
] | null | null | null | slowfast/models/video_model_builder.py | Finspire13/SlowFast | 4ba356753dfbe04ec06b9aafb11d33ff17340170 | [
"Apache-2.0"
] | null | null | null | slowfast/models/video_model_builder.py | Finspire13/SlowFast | 4ba356753dfbe04ec06b9aafb11d33ff17340170 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Video models."""
import math
import torch
import torch.nn as nn
import slowfast.utils.weight_init_helper as init_helper
from slowfast.models.batchnorm_helper import get_norm
from . import head_helper, resnet_helper, stem_helper
from .build import MODEL_REGISTRY
# Number of blocks for different stages given the model depth.
_MODEL_STAGE_DEPTH = {50: (3, 4, 6, 3), 101: (3, 4, 23, 3)}
# Basis of temporal kernel sizes for each of the stage.
_TEMPORAL_KERNEL_BASIS = {
"c2d": [
[[1]], # conv1 temporal kernel.
[[1]], # res2 temporal kernel.
[[1]], # res3 temporal kernel.
[[1]], # res4 temporal kernel.
[[1]], # res5 temporal kernel.
],
"c2d_nopool": [
[[1]], # conv1 temporal kernel.
[[1]], # res2 temporal kernel.
[[1]], # res3 temporal kernel.
[[1]], # res4 temporal kernel.
[[1]], # res5 temporal kernel.
],
"i3d": [
[[5]], # conv1 temporal kernel.
[[3]], # res2 temporal kernel.
[[3, 1]], # res3 temporal kernel.
[[3, 1]], # res4 temporal kernel.
[[1, 3]], # res5 temporal kernel.
],
"i3d_nopool": [
[[5]], # conv1 temporal kernel.
[[3]], # res2 temporal kernel.
[[3, 1]], # res3 temporal kernel.
[[3, 1]], # res4 temporal kernel.
[[1, 3]], # res5 temporal kernel.
],
"slow": [
[[1]], # conv1 temporal kernel.
[[1]], # res2 temporal kernel.
[[1]], # res3 temporal kernel.
[[3]], # res4 temporal kernel.
[[3]], # res5 temporal kernel.
],
"slowfast": [
[[1], [5]], # conv1 temporal kernel for slow and fast pathway.
[[1], [3]], # res2 temporal kernel for slow and fast pathway.
[[1], [3]], # res3 temporal kernel for slow and fast pathway.
[[3], [3]], # res4 temporal kernel for slow and fast pathway.
[[3], [3]], # res5 temporal kernel for slow and fast pathway.
],
"x3d": [
[[5]], # conv1 temporal kernels.
[[3]], # res2 temporal kernels.
[[3]], # res3 temporal kernels.
[[3]], # res4 temporal kernels.
[[3]], # res5 temporal kernels.
],
}
_POOL1 = {
"c2d": [[2, 1, 1]],
"c2d_nopool": [[1, 1, 1]],
"i3d": [[2, 1, 1]],
"i3d_nopool": [[1, 1, 1]],
"slow": [[1, 1, 1]],
"slowfast": [[1, 1, 1], [1, 1, 1]],
"x3d": [[1, 1, 1]],
}
class FuseFastToSlow(nn.Module):
"""
Fuses the information from the Fast pathway to the Slow pathway. Given the
tensors from Slow pathway and Fast pathway, fuse information from Fast to
Slow, then return the fused tensors from Slow and Fast pathway in order.
"""
def __init__(
self,
dim_in,
fusion_conv_channel_ratio,
fusion_kernel,
alpha,
eps=1e-5,
bn_mmt=0.1,
inplace_relu=True,
norm_module=nn.BatchNorm3d,
):
"""
Args:
dim_in (int): the channel dimension of the input.
fusion_conv_channel_ratio (int): channel ratio for the convolution
used to fuse from Fast pathway to Slow pathway.
fusion_kernel (int): kernel size of the convolution used to fuse
from Fast pathway to Slow pathway.
alpha (int): the frame rate ratio between the Fast and Slow pathway.
eps (float): epsilon for batch norm.
bn_mmt (float): momentum for batch norm. Noted that BN momentum in
PyTorch = 1 - BN momentum in Caffe2.
inplace_relu (bool): if True, calculate the relu on the original
input without allocating new memory.
norm_module (nn.Module): nn.Module for the normalization layer. The
default is nn.BatchNorm3d.
"""
super(FuseFastToSlow, self).__init__()
self.conv_f2s = nn.Conv3d(
dim_in,
dim_in * fusion_conv_channel_ratio,
kernel_size=[fusion_kernel, 1, 1],
stride=[alpha, 1, 1],
padding=[fusion_kernel // 2, 0, 0],
bias=False,
)
self.bn = norm_module(
num_features=dim_in * fusion_conv_channel_ratio,
eps=eps,
momentum=bn_mmt,
)
self.relu = nn.ReLU(inplace_relu)
def forward(self, x):
x_s = x[0]
x_f = x[1]
fuse = self.conv_f2s(x_f)
fuse = self.bn(fuse)
fuse = self.relu(fuse)
x_s_fuse = torch.cat([x_s, fuse], 1)
return [x_s_fuse, x_f]
@MODEL_REGISTRY.register()
class SlowFast(nn.Module):
"""
SlowFast model builder for SlowFast network.
Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He.
"SlowFast networks for video recognition."
https://arxiv.org/pdf/1812.03982.pdf
"""
def __init__(self, cfg):
"""
The `__init__` method of any subclass should also contain these
arguments.
Args:
cfg (CfgNode): model building configs, details are in the
comments of the config file.
"""
super(SlowFast, self).__init__()
self.norm_module = get_norm(cfg)
self.enable_detection = cfg.DETECTION.ENABLE
self.num_pathways = 2
self._construct_network(cfg)
init_helper.init_weights(
self, cfg.MODEL.FC_INIT_STD, cfg.RESNET.ZERO_INIT_FINAL_BN
)
def _construct_network(self, cfg):
"""
Builds a SlowFast model. The first pathway is the Slow pathway and the
second pathway is the Fast pathway.
Args:
cfg (CfgNode): model building configs, details are in the
comments of the config file.
"""
assert cfg.MODEL.ARCH in _POOL1.keys()
pool_size = _POOL1[cfg.MODEL.ARCH]
assert len({len(pool_size), self.num_pathways}) == 1
assert cfg.RESNET.DEPTH in _MODEL_STAGE_DEPTH.keys()
(d2, d3, d4, d5) = _MODEL_STAGE_DEPTH[cfg.RESNET.DEPTH]
num_groups = cfg.RESNET.NUM_GROUPS
width_per_group = cfg.RESNET.WIDTH_PER_GROUP
dim_inner = num_groups * width_per_group
out_dim_ratio = (
cfg.SLOWFAST.BETA_INV // cfg.SLOWFAST.FUSION_CONV_CHANNEL_RATIO
)
temp_kernel = _TEMPORAL_KERNEL_BASIS[cfg.MODEL.ARCH]
self.s1 = stem_helper.VideoModelStem(
dim_in=cfg.DATA.INPUT_CHANNEL_NUM,
dim_out=[width_per_group, width_per_group // cfg.SLOWFAST.BETA_INV],
kernel=[temp_kernel[0][0] + [7, 7], temp_kernel[0][1] + [7, 7]],
stride=[[1, 2, 2]] * 2,
padding=[
[temp_kernel[0][0][0] // 2, 3, 3],
[temp_kernel[0][1][0] // 2, 3, 3],
],
norm_module=self.norm_module,
)
self.s1_fuse = FuseFastToSlow(
width_per_group // cfg.SLOWFAST.BETA_INV,
cfg.SLOWFAST.FUSION_CONV_CHANNEL_RATIO,
cfg.SLOWFAST.FUSION_KERNEL_SZ,
cfg.SLOWFAST.ALPHA,
norm_module=self.norm_module,
)
self.s2 = resnet_helper.ResStage(
dim_in=[
width_per_group + width_per_group // out_dim_ratio,
width_per_group // cfg.SLOWFAST.BETA_INV,
],
dim_out=[
width_per_group * 4,
width_per_group * 4 // cfg.SLOWFAST.BETA_INV,
],
dim_inner=[dim_inner, dim_inner // cfg.SLOWFAST.BETA_INV],
temp_kernel_sizes=temp_kernel[1],
stride=cfg.RESNET.SPATIAL_STRIDES[0],
num_blocks=[d2] * 2,
num_groups=[num_groups] * 2,
num_block_temp_kernel=cfg.RESNET.NUM_BLOCK_TEMP_KERNEL[0],
nonlocal_inds=cfg.NONLOCAL.LOCATION[0],
nonlocal_group=cfg.NONLOCAL.GROUP[0],
nonlocal_pool=cfg.NONLOCAL.POOL[0],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
dilation=cfg.RESNET.SPATIAL_DILATIONS[0],
norm_module=self.norm_module,
)
self.s2_fuse = FuseFastToSlow(
width_per_group * 4 // cfg.SLOWFAST.BETA_INV,
cfg.SLOWFAST.FUSION_CONV_CHANNEL_RATIO,
cfg.SLOWFAST.FUSION_KERNEL_SZ,
cfg.SLOWFAST.ALPHA,
norm_module=self.norm_module,
)
for pathway in range(self.num_pathways):
pool = nn.MaxPool3d(
kernel_size=pool_size[pathway],
stride=pool_size[pathway],
padding=[0, 0, 0],
)
self.add_module("pathway{}_pool".format(pathway), pool)
self.s3 = resnet_helper.ResStage(
dim_in=[
width_per_group * 4 + width_per_group * 4 // out_dim_ratio,
width_per_group * 4 // cfg.SLOWFAST.BETA_INV,
],
dim_out=[
width_per_group * 8,
width_per_group * 8 // cfg.SLOWFAST.BETA_INV,
],
dim_inner=[dim_inner * 2, dim_inner * 2 // cfg.SLOWFAST.BETA_INV],
temp_kernel_sizes=temp_kernel[2],
stride=cfg.RESNET.SPATIAL_STRIDES[1],
num_blocks=[d3] * 2,
num_groups=[num_groups] * 2,
num_block_temp_kernel=cfg.RESNET.NUM_BLOCK_TEMP_KERNEL[1],
nonlocal_inds=cfg.NONLOCAL.LOCATION[1],
nonlocal_group=cfg.NONLOCAL.GROUP[1],
nonlocal_pool=cfg.NONLOCAL.POOL[1],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
dilation=cfg.RESNET.SPATIAL_DILATIONS[1],
norm_module=self.norm_module,
)
self.s3_fuse = FuseFastToSlow(
width_per_group * 8 // cfg.SLOWFAST.BETA_INV,
cfg.SLOWFAST.FUSION_CONV_CHANNEL_RATIO,
cfg.SLOWFAST.FUSION_KERNEL_SZ,
cfg.SLOWFAST.ALPHA,
norm_module=self.norm_module,
)
self.s4 = resnet_helper.ResStage(
dim_in=[
width_per_group * 8 + width_per_group * 8 // out_dim_ratio,
width_per_group * 8 // cfg.SLOWFAST.BETA_INV,
],
dim_out=[
width_per_group * 16,
width_per_group * 16 // cfg.SLOWFAST.BETA_INV,
],
dim_inner=[dim_inner * 4, dim_inner * 4 // cfg.SLOWFAST.BETA_INV],
temp_kernel_sizes=temp_kernel[3],
stride=cfg.RESNET.SPATIAL_STRIDES[2],
num_blocks=[d4] * 2,
num_groups=[num_groups] * 2,
num_block_temp_kernel=cfg.RESNET.NUM_BLOCK_TEMP_KERNEL[2],
nonlocal_inds=cfg.NONLOCAL.LOCATION[2],
nonlocal_group=cfg.NONLOCAL.GROUP[2],
nonlocal_pool=cfg.NONLOCAL.POOL[2],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
dilation=cfg.RESNET.SPATIAL_DILATIONS[2],
norm_module=self.norm_module,
)
self.s4_fuse = FuseFastToSlow(
width_per_group * 16 // cfg.SLOWFAST.BETA_INV,
cfg.SLOWFAST.FUSION_CONV_CHANNEL_RATIO,
cfg.SLOWFAST.FUSION_KERNEL_SZ,
cfg.SLOWFAST.ALPHA,
norm_module=self.norm_module,
)
self.s5 = resnet_helper.ResStage(
dim_in=[
width_per_group * 16 + width_per_group * 16 // out_dim_ratio,
width_per_group * 16 // cfg.SLOWFAST.BETA_INV,
],
dim_out=[
width_per_group * 32,
width_per_group * 32 // cfg.SLOWFAST.BETA_INV,
],
dim_inner=[dim_inner * 8, dim_inner * 8 // cfg.SLOWFAST.BETA_INV],
temp_kernel_sizes=temp_kernel[4],
stride=cfg.RESNET.SPATIAL_STRIDES[3],
num_blocks=[d5] * 2,
num_groups=[num_groups] * 2,
num_block_temp_kernel=cfg.RESNET.NUM_BLOCK_TEMP_KERNEL[3],
nonlocal_inds=cfg.NONLOCAL.LOCATION[3],
nonlocal_group=cfg.NONLOCAL.GROUP[3],
nonlocal_pool=cfg.NONLOCAL.POOL[3],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
dilation=cfg.RESNET.SPATIAL_DILATIONS[3],
norm_module=self.norm_module,
)
if cfg.DETECTION.ENABLE:
self.head = head_helper.ResNetRoIHead(
dim_in=[
width_per_group * 32,
width_per_group * 32 // cfg.SLOWFAST.BETA_INV,
],
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[
[
cfg.DATA.NUM_FRAMES
// cfg.SLOWFAST.ALPHA
// pool_size[0][0],
1,
1,
],
[cfg.DATA.NUM_FRAMES // pool_size[1][0], 1, 1],
],
resolution=[[cfg.DETECTION.ROI_XFORM_RESOLUTION] * 2] * 2,
scale_factor=[cfg.DETECTION.SPATIAL_SCALE_FACTOR] * 2,
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
aligned=cfg.DETECTION.ALIGNED,
)
else:
self.head = head_helper.ResNetBasicHead(
dim_in=[
width_per_group * 32,
width_per_group * 32 // cfg.SLOWFAST.BETA_INV,
],
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[None, None]
if cfg.MULTIGRID.SHORT_CYCLE
else [
[
cfg.DATA.NUM_FRAMES
// cfg.SLOWFAST.ALPHA
// pool_size[0][0],
cfg.DATA.TRAIN_CROP_SIZE // 32 // pool_size[0][1],
cfg.DATA.TRAIN_CROP_SIZE // 32 // pool_size[0][2],
],
[
cfg.DATA.NUM_FRAMES // pool_size[1][0],
cfg.DATA.TRAIN_CROP_SIZE // 32 // pool_size[1][1],
cfg.DATA.TRAIN_CROP_SIZE // 32 // pool_size[1][2],
],
], # None for AdaptiveAvgPool3d((1, 1, 1))
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
)
def forward(self, x, bboxes=None, extract_feature=False):
x = self.s1(x)
x = self.s1_fuse(x)
x = self.s2(x)
x = self.s2_fuse(x)
for pathway in range(self.num_pathways):
pool = getattr(self, "pathway{}_pool".format(pathway))
x[pathway] = pool(x[pathway])
x = self.s3(x)
x = self.s3_fuse(x)
x = self.s4(x)
x = self.s4_fuse(x)
x = self.s5(x)
# (Pdb) x[0].shape
# torch.Size([5, 2048, 8, 8, 8])
# (Pdb) x[1].shape
# torch.Size([5, 256, 32, 8, 8])
if not extract_feature:
if self.enable_detection:
x = self.head(x, bboxes)
else:
x = self.head(x)
else:
assert (
len(x) == self.num_pathways
), "Input tensor does not contain {} pathway".format(self.num_pathways)
pool_out = []
for pathway in range(self.num_pathways):
m = getattr(self.head, "pathway{}_avgpool".format(pathway))
pool_out.append(m(x[pathway]))
x = torch.cat(pool_out, 1)
# (N, C, T, H, W) -> (N, T, H, W, C).
x = x.permute((0, 2, 3, 4, 1))
# Perform dropout.
if hasattr(self, "dropout"):
x = self.dropout(x)
x = x.mean([1, 2, 3])
return x
@MODEL_REGISTRY.register()
class ResNet(nn.Module):
"""
ResNet model builder. It builds a ResNet like network backbone without
lateral connection (C2D, I3D, Slow).
Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He.
"SlowFast networks for video recognition."
https://arxiv.org/pdf/1812.03982.pdf
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He.
"Non-local neural networks."
https://arxiv.org/pdf/1711.07971.pdf
"""
def __init__(self, cfg):
"""
The `__init__` method of any subclass should also contain these
arguments.
Args:
cfg (CfgNode): model building configs, details are in the
comments of the config file.
"""
super(ResNet, self).__init__()
self.norm_module = get_norm(cfg)
self.enable_detection = cfg.DETECTION.ENABLE
self.num_pathways = 1
self._construct_network(cfg)
init_helper.init_weights(
self, cfg.MODEL.FC_INIT_STD, cfg.RESNET.ZERO_INIT_FINAL_BN
)
def _construct_network(self, cfg):
"""
Builds a single pathway ResNet model.
Args:
cfg (CfgNode): model building configs, details are in the
comments of the config file.
"""
assert cfg.MODEL.ARCH in _POOL1.keys()
pool_size = _POOL1[cfg.MODEL.ARCH]
assert len({len(pool_size), self.num_pathways}) == 1
assert cfg.RESNET.DEPTH in _MODEL_STAGE_DEPTH.keys()
(d2, d3, d4, d5) = _MODEL_STAGE_DEPTH[cfg.RESNET.DEPTH]
num_groups = cfg.RESNET.NUM_GROUPS
width_per_group = cfg.RESNET.WIDTH_PER_GROUP
dim_inner = num_groups * width_per_group
temp_kernel = _TEMPORAL_KERNEL_BASIS[cfg.MODEL.ARCH]
self.s1 = stem_helper.VideoModelStem(
dim_in=cfg.DATA.INPUT_CHANNEL_NUM,
dim_out=[width_per_group],
kernel=[temp_kernel[0][0] + [7, 7]],
stride=[[1, 2, 2]],
padding=[[temp_kernel[0][0][0] // 2, 3, 3]],
norm_module=self.norm_module,
)
self.s2 = resnet_helper.ResStage(
dim_in=[width_per_group],
dim_out=[width_per_group * 4],
dim_inner=[dim_inner],
temp_kernel_sizes=temp_kernel[1],
stride=cfg.RESNET.SPATIAL_STRIDES[0],
num_blocks=[d2],
num_groups=[num_groups],
num_block_temp_kernel=cfg.RESNET.NUM_BLOCK_TEMP_KERNEL[0],
nonlocal_inds=cfg.NONLOCAL.LOCATION[0],
nonlocal_group=cfg.NONLOCAL.GROUP[0],
nonlocal_pool=cfg.NONLOCAL.POOL[0],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
stride_1x1=cfg.RESNET.STRIDE_1X1,
inplace_relu=cfg.RESNET.INPLACE_RELU,
dilation=cfg.RESNET.SPATIAL_DILATIONS[0],
norm_module=self.norm_module,
)
for pathway in range(self.num_pathways):
pool = nn.MaxPool3d(
kernel_size=pool_size[pathway],
stride=pool_size[pathway],
padding=[0, 0, 0],
)
self.add_module("pathway{}_pool".format(pathway), pool)
self.s3 = resnet_helper.ResStage(
dim_in=[width_per_group * 4],
dim_out=[width_per_group * 8],
dim_inner=[dim_inner * 2],
temp_kernel_sizes=temp_kernel[2],
stride=cfg.RESNET.SPATIAL_STRIDES[1],
num_blocks=[d3],
num_groups=[num_groups],
num_block_temp_kernel=cfg.RESNET.NUM_BLOCK_TEMP_KERNEL[1],
nonlocal_inds=cfg.NONLOCAL.LOCATION[1],
nonlocal_group=cfg.NONLOCAL.GROUP[1],
nonlocal_pool=cfg.NONLOCAL.POOL[1],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
stride_1x1=cfg.RESNET.STRIDE_1X1,
inplace_relu=cfg.RESNET.INPLACE_RELU,
dilation=cfg.RESNET.SPATIAL_DILATIONS[1],
norm_module=self.norm_module,
)
self.s4 = resnet_helper.ResStage(
dim_in=[width_per_group * 8],
dim_out=[width_per_group * 16],
dim_inner=[dim_inner * 4],
temp_kernel_sizes=temp_kernel[3],
stride=cfg.RESNET.SPATIAL_STRIDES[2],
num_blocks=[d4],
num_groups=[num_groups],
num_block_temp_kernel=cfg.RESNET.NUM_BLOCK_TEMP_KERNEL[2],
nonlocal_inds=cfg.NONLOCAL.LOCATION[2],
nonlocal_group=cfg.NONLOCAL.GROUP[2],
nonlocal_pool=cfg.NONLOCAL.POOL[2],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
stride_1x1=cfg.RESNET.STRIDE_1X1,
inplace_relu=cfg.RESNET.INPLACE_RELU,
dilation=cfg.RESNET.SPATIAL_DILATIONS[2],
norm_module=self.norm_module,
)
self.s5 = resnet_helper.ResStage(
dim_in=[width_per_group * 16],
dim_out=[width_per_group * 32],
dim_inner=[dim_inner * 8],
temp_kernel_sizes=temp_kernel[4],
stride=cfg.RESNET.SPATIAL_STRIDES[3],
num_blocks=[d5],
num_groups=[num_groups],
num_block_temp_kernel=cfg.RESNET.NUM_BLOCK_TEMP_KERNEL[3],
nonlocal_inds=cfg.NONLOCAL.LOCATION[3],
nonlocal_group=cfg.NONLOCAL.GROUP[3],
nonlocal_pool=cfg.NONLOCAL.POOL[3],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
stride_1x1=cfg.RESNET.STRIDE_1X1,
inplace_relu=cfg.RESNET.INPLACE_RELU,
dilation=cfg.RESNET.SPATIAL_DILATIONS[3],
norm_module=self.norm_module,
)
if self.enable_detection:
self.head = head_helper.ResNetRoIHead(
dim_in=[width_per_group * 32],
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[[cfg.DATA.NUM_FRAMES // pool_size[0][0], 1, 1]],
resolution=[[cfg.DETECTION.ROI_XFORM_RESOLUTION] * 2],
scale_factor=[cfg.DETECTION.SPATIAL_SCALE_FACTOR],
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
aligned=cfg.DETECTION.ALIGNED,
)
else:
self.head = head_helper.ResNetBasicHead(
dim_in=[width_per_group * 32],
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[None, None]
if cfg.MULTIGRID.SHORT_CYCLE
else [
[
cfg.DATA.NUM_FRAMES // pool_size[0][0],
cfg.DATA.TRAIN_CROP_SIZE // 32 // pool_size[0][1],
cfg.DATA.TRAIN_CROP_SIZE // 32 // pool_size[0][2],
]
], # None for AdaptiveAvgPool3d((1, 1, 1))
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
)
def forward(self, x, bboxes=None, extract_feature=False):
x = self.s1(x)
x = self.s2(x)
for pathway in range(self.num_pathways):
pool = getattr(self, "pathway{}_pool".format(pathway))
x[pathway] = pool(x[pathway])
x = self.s3(x)
x = self.s4(x)
x = self.s5(x)
# (Pdb) x[0].shape
# torch.Size([5, 2048, 4, 8, 8])
if not extract_feature:
if self.enable_detection:
x = self.head(x, bboxes)
else:
x = self.head(x)
else:
assert (
len(x) == self.num_pathways
), "Input tensor does not contain {} pathway".format(self.num_pathways)
pool_out = []
for pathway in range(self.num_pathways):
m = getattr(self.head, "pathway{}_avgpool".format(pathway))
pool_out.append(m(x[pathway]))
x = torch.cat(pool_out, 1)
# (N, C, T, H, W) -> (N, T, H, W, C).
x = x.permute((0, 2, 3, 4, 1))
# Perform dropout.
if hasattr(self, "dropout"):
x = self.dropout(x)
x = x.mean([1, 2, 3])
return x
@MODEL_REGISTRY.register()
class X3D(nn.Module):
"""
X3D model builder. It builds a X3D network backbone, which is a ResNet.
Christoph Feichtenhofer.
"X3D: Expanding Architectures for Efficient Video Recognition."
https://arxiv.org/abs/2004.04730
"""
def __init__(self, cfg):
"""
The `__init__` method of any subclass should also contain these
arguments.
Args:
cfg (CfgNode): model building configs, details are in the
comments of the config file.
"""
super(X3D, self).__init__()
self.norm_module = get_norm(cfg)
self.enable_detection = cfg.DETECTION.ENABLE
self.num_pathways = 1
exp_stage = 2.0
self.dim_c1 = cfg.X3D.DIM_C1
self.dim_res2 = (
self._round_width(self.dim_c1, exp_stage, divisor=8)
if cfg.X3D.SCALE_RES2
else self.dim_c1
)
self.dim_res3 = self._round_width(self.dim_res2, exp_stage, divisor=8)
self.dim_res4 = self._round_width(self.dim_res3, exp_stage, divisor=8)
self.dim_res5 = self._round_width(self.dim_res4, exp_stage, divisor=8)
self.block_basis = [
# blocks, c, stride
[1, self.dim_res2, 2],
[2, self.dim_res3, 2],
[5, self.dim_res4, 2],
[3, self.dim_res5, 2],
]
self._construct_network(cfg)
init_helper.init_weights(
self, cfg.MODEL.FC_INIT_STD, cfg.RESNET.ZERO_INIT_FINAL_BN
)
def _round_width(self, width, multiplier, min_depth=8, divisor=8):
"""Round width of filters based on width multiplier."""
if not multiplier:
return width
width *= multiplier
min_depth = min_depth or divisor
new_filters = max(
min_depth, int(width + divisor / 2) // divisor * divisor
)
if new_filters < 0.9 * width:
new_filters += divisor
return int(new_filters)
def _round_repeats(self, repeats, multiplier):
"""Round number of layers based on depth multiplier."""
multiplier = multiplier
if not multiplier:
return repeats
return int(math.ceil(multiplier * repeats))
def _construct_network(self, cfg):
"""
Builds a single pathway X3D model.
Args:
cfg (CfgNode): model building configs, details are in the
comments of the config file.
"""
assert cfg.MODEL.ARCH in _POOL1.keys()
assert cfg.RESNET.DEPTH in _MODEL_STAGE_DEPTH.keys()
(d2, d3, d4, d5) = _MODEL_STAGE_DEPTH[cfg.RESNET.DEPTH]
num_groups = cfg.RESNET.NUM_GROUPS
width_per_group = cfg.RESNET.WIDTH_PER_GROUP
dim_inner = num_groups * width_per_group
w_mul = cfg.X3D.WIDTH_FACTOR
d_mul = cfg.X3D.DEPTH_FACTOR
dim_res1 = self._round_width(self.dim_c1, w_mul)
temp_kernel = _TEMPORAL_KERNEL_BASIS[cfg.MODEL.ARCH]
self.s1 = stem_helper.VideoModelStem(
dim_in=cfg.DATA.INPUT_CHANNEL_NUM,
dim_out=[dim_res1],
kernel=[temp_kernel[0][0] + [3, 3]],
stride=[[1, 2, 2]],
padding=[[temp_kernel[0][0][0] // 2, 1, 1]],
norm_module=self.norm_module,
stem_func_name="x3d_stem",
)
# blob_in = s1
dim_in = dim_res1
for stage, block in enumerate(self.block_basis):
dim_out = self._round_width(block[1], w_mul)
dim_inner = int(cfg.X3D.BOTTLENECK_FACTOR * dim_out)
n_rep = self._round_repeats(block[0], d_mul)
prefix = "s{}".format(
stage + 2
) # start w res2 to follow convention
s = resnet_helper.ResStage(
dim_in=[dim_in],
dim_out=[dim_out],
dim_inner=[dim_inner],
temp_kernel_sizes=temp_kernel[1],
stride=[block[2]],
num_blocks=[n_rep],
num_groups=[dim_inner]
if cfg.X3D.CHANNELWISE_3x3x3
else [num_groups],
num_block_temp_kernel=[n_rep],
nonlocal_inds=cfg.NONLOCAL.LOCATION[0],
nonlocal_group=cfg.NONLOCAL.GROUP[0],
nonlocal_pool=cfg.NONLOCAL.POOL[0],
instantiation=cfg.NONLOCAL.INSTANTIATION,
trans_func_name=cfg.RESNET.TRANS_FUNC,
stride_1x1=cfg.RESNET.STRIDE_1X1,
norm_module=self.norm_module,
dilation=cfg.RESNET.SPATIAL_DILATIONS[stage],
drop_connect_rate=cfg.MODEL.DROPCONNECT_RATE
* (stage + 2)
/ (len(self.block_basis) + 1),
)
dim_in = dim_out
self.add_module(prefix, s)
if self.enable_detection:
NotImplementedError
else:
spat_sz = int(math.ceil(cfg.DATA.TRAIN_CROP_SIZE / 32.0))
self.head = head_helper.X3DHead(
dim_in=dim_out,
dim_inner=dim_inner,
dim_out=cfg.X3D.DIM_C5,
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[cfg.DATA.NUM_FRAMES, spat_sz, spat_sz],
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
bn_lin5_on=cfg.X3D.BN_LIN5,
)
def forward(self, x, bboxes=None):
for module in self.children():
x = module(x)
return x
| 36.856265 | 83 | 0.551982 | 3,619 | 30,001 | 4.330202 | 0.096159 | 0.03331 | 0.041478 | 0.022972 | 0.777359 | 0.746474 | 0.716993 | 0.707038 | 0.688724 | 0.648714 | 0 | 0.03161 | 0.340955 | 30,001 | 813 | 84 | 36.901599 | 0.760975 | 0.147462 | 0 | 0.631579 | 0 | 0 | 0.011104 | 0 | 0 | 0 | 0 | 0 | 0.015949 | 1 | 0.020734 | false | 0 | 0.011164 | 0 | 0.051037 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0aa0657e314ac2828ad5de383fb2c85a260bf2d1 | 307 | py | Python | saleor/payment/gateways/mercadopago/utils.py | facundon/Cholitas-Backend | 4d73e0697a6b6fc61b82b72ff1c99b2eabe8f4c6 | [
"CC-BY-4.0"
] | null | null | null | saleor/payment/gateways/mercadopago/utils.py | facundon/Cholitas-Backend | 4d73e0697a6b6fc61b82b72ff1c99b2eabe8f4c6 | [
"CC-BY-4.0"
] | null | null | null | saleor/payment/gateways/mercadopago/utils.py | facundon/Cholitas-Backend | 4d73e0697a6b6fc61b82b72ff1c99b2eabe8f4c6 | [
"CC-BY-4.0"
] | null | null | null | from decimal import Decimal
def get_error_response(amount: Decimal, **additional_kwargs) -> dict:
"""Create a placeholder response for invalid or failed requests.
It is used to generate a failed transaction object.
"""
return {"is_success": False, "amount": amount, **additional_kwargs}
| 27.909091 | 71 | 0.726384 | 39 | 307 | 5.589744 | 0.74359 | 0.146789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179153 | 307 | 10 | 72 | 30.7 | 0.865079 | 0.371336 | 0 | 0 | 1 | 0 | 0.090395 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
0aa39b5c8f052c54b37a09b6f1710195cf5e9c03 | 125 | py | Python | vnegmas/backend/src/pyecharts/__init__.py | YueNing/vnegmas | e95adc56ee9aab8d6cd6f28cce04383e199dc2b8 | [
"MIT"
] | 3 | 2019-06-29T11:40:29.000Z | 2019-09-07T02:15:09.000Z | vnegmas/backend/src/pyecharts/__init__.py | YueNing/vnegmas | e95adc56ee9aab8d6cd6f28cce04383e199dc2b8 | [
"MIT"
] | null | null | null | vnegmas/backend/src/pyecharts/__init__.py | YueNing/vnegmas | e95adc56ee9aab8d6cd6f28cce04383e199dc2b8 | [
"MIT"
] | null | null | null | from . import charts, commons, components, datasets, options, render, scaffold
from ._version import __author__, __version__
| 41.666667 | 78 | 0.808 | 14 | 125 | 6.571429 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 125 | 2 | 79 | 62.5 | 0.836364 | 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 | 0 | 0 | 0 | 4 |
0aa7dd3be7ff0fdc821d4b9b882ac995d3ce4d29 | 50 | py | Python | python/8Kyu/No Loops 2 - You only need one.py | athasv/Codewars-data | 5e106466e709fd776f23585ad9f652d0d65b48d3 | [
"MIT"
] | null | null | null | python/8Kyu/No Loops 2 - You only need one.py | athasv/Codewars-data | 5e106466e709fd776f23585ad9f652d0d65b48d3 | [
"MIT"
] | null | null | null | python/8Kyu/No Loops 2 - You only need one.py | athasv/Codewars-data | 5e106466e709fd776f23585ad9f652d0d65b48d3 | [
"MIT"
] | null | null | null | def check(a, x):
return True if x in a else False | 25 | 33 | 0.7 | 12 | 50 | 2.916667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.22 | 50 | 2 | 33 | 25 | 0.897436 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 4 |
0ab2ec57fa7b635635215f227e623e12450ca796 | 173 | py | Python | mongodb_play/test_bottle.py | atishbits/101 | 4b4a8e56d82fe2706f065ded7877deebe8f6164f | [
"MIT"
] | 8 | 2015-06-07T13:25:48.000Z | 2022-03-22T23:14:50.000Z | mongodb_play/test_bottle.py | atishbits/101 | 4b4a8e56d82fe2706f065ded7877deebe8f6164f | [
"MIT"
] | 30 | 2016-01-29T01:36:41.000Z | 2018-09-19T07:01:22.000Z | mongodb_play/test_bottle.py | atishbits/101 | 4b4a8e56d82fe2706f065ded7877deebe8f6164f | [
"MIT"
] | 9 | 2021-03-27T23:45:03.000Z | 2022-03-29T19:00:50.000Z | from bottle import route, run, template
@route('/hello/<name>')
def index(name):
return template('<b>Hello {{name}}</b>!', name=name)
run(host='localhost', port=8080)
| 21.625 | 56 | 0.66474 | 25 | 173 | 4.6 | 0.64 | 0.156522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026316 | 0.121387 | 173 | 7 | 57 | 24.714286 | 0.730263 | 0 | 0 | 0 | 0 | 0 | 0.254335 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0.2 | 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 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
0ac9a71f01a3cc3e84ac20f8b44a9c99aac2568b | 158 | py | Python | core/views.py | MrEscape54/Django_Blueprint | 07238be5944d1ed2ad07bb11fbcb1f43c8f0c91c | [
"MIT"
] | null | null | null | core/views.py | MrEscape54/Django_Blueprint | 07238be5944d1ed2ad07bb11fbcb1f43c8f0c91c | [
"MIT"
] | 6 | 2021-03-19T02:12:55.000Z | 2022-01-13T02:39:00.000Z | core/views.py | MrEscape54/Django_Blueprint | 07238be5944d1ed2ad07bb11fbcb1f43c8f0c91c | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic import TemplateView
class IndexView(TemplateView):
template_name = "core/index.html"
| 19.75 | 45 | 0.778481 | 19 | 158 | 6.421053 | 0.789474 | 0.163934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151899 | 158 | 7 | 46 | 22.571429 | 0.910448 | 0 | 0 | 0 | 0 | 0 | 0.096154 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
0ad25a541dcad9fb5132097a7130144094bf3711 | 854 | py | Python | netbox/netbox/graphql/__init__.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | 1 | 2021-12-09T13:41:46.000Z | 2021-12-09T13:41:46.000Z | netbox/netbox/graphql/__init__.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | null | null | null | netbox/netbox/graphql/__init__.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | 1 | 2022-02-07T20:36:31.000Z | 2022-02-07T20:36:31.000Z | import graphene
from graphene_django.converter import convert_django_field
from taggit.managers import TaggableManager
from dcim.fields import MACAddressField, WWNField
from ipam.fields import IPAddressField, IPNetworkField
@convert_django_field.register(TaggableManager)
def convert_field_to_tags_list(field, registry=None):
"""
Register conversion handler for django-taggit's TaggableManager
"""
return graphene.List(graphene.String)
@convert_django_field.register(IPAddressField)
@convert_django_field.register(IPNetworkField)
@convert_django_field.register(MACAddressField)
@convert_django_field.register(WWNField)
def convert_field_to_string(field, registry=None):
# TODO: Update to use get_django_field_description under django_graphene v3.0
return graphene.String(description=field.help_text, required=not field.null)
| 35.583333 | 81 | 0.833724 | 106 | 854 | 6.481132 | 0.40566 | 0.112082 | 0.157205 | 0.189229 | 0.116448 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002594 | 0.09719 | 854 | 23 | 82 | 37.130435 | 0.888457 | 0.163934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043478 | 0 | 1 | 0.142857 | false | 0 | 0.357143 | 0.071429 | 0.642857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
0adff64f5e4f6a29c7a6d5cfef1e0b89a3b2f13e | 28 | py | Python | proselint/checks/typography/__init__.py | kerri-hicks/proselint | 12efe888042703ba409b51de660ed423622b2ad2 | [
"BSD-3-Clause"
] | 4,163 | 2015-10-03T07:37:21.000Z | 2022-03-31T03:52:32.000Z | proselint/checks/typography/__init__.py | kerri-hicks/proselint | 12efe888042703ba409b51de660ed423622b2ad2 | [
"BSD-3-Clause"
] | 878 | 2015-09-30T20:03:33.000Z | 2022-03-28T11:06:15.000Z | proselint/checks/typography/__init__.py | kerri-hicks/proselint | 12efe888042703ba409b51de660ed423622b2ad2 | [
"BSD-3-Clause"
] | 249 | 2015-10-04T12:21:27.000Z | 2022-02-28T22:13:11.000Z | """Advice on typography."""
| 14 | 27 | 0.642857 | 3 | 28 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107143 | 28 | 1 | 28 | 28 | 0.72 | 0.75 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
0aef59c2190f654caef9b4b097cac9bdc04084df | 201 | py | Python | caffeflow/errors.py | xmartlabs/caffe-tensorflow | 4618f89c8ae60cffbc0ffd991a8cb984acc3a164 | [
"MIT"
] | 1 | 2019-11-15T14:42:17.000Z | 2019-11-15T14:42:17.000Z | caffeflow/errors.py | xmartlabs/caffe-tensorflow | 4618f89c8ae60cffbc0ffd991a8cb984acc3a164 | [
"MIT"
] | null | null | null | caffeflow/errors.py | xmartlabs/caffe-tensorflow | 4618f89c8ae60cffbc0ffd991a8cb984acc3a164 | [
"MIT"
] | 16 | 2017-08-02T10:29:06.000Z | 2021-11-14T23:05:00.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import sys
class KaffeError(Exception):
pass
def print_stderr(msg):
sys.stderr.write('{}\n'.format(msg))
| 16.75 | 82 | 0.756219 | 26 | 201 | 5.538462 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139303 | 201 | 11 | 83 | 18.272727 | 0.83237 | 0 | 0 | 0 | 0 | 0 | 0.019901 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0.166667 | 0.333333 | 0 | 0.666667 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 4 |
7c0e2f53755a13097dec3fd6bdb3a3feaa1dde56 | 440 | py | Python | test/test_crunchbase.py | hackerlist/crunchbase | 07083b9221a7c40d02ed73bda213aed2394e2d72 | [
"Apache-2.0"
] | 6 | 2017-08-04T18:31:30.000Z | 2021-06-21T20:56:01.000Z | test/test_crunchbase.py | hackerlist/crunchbase | 07083b9221a7c40d02ed73bda213aed2394e2d72 | [
"Apache-2.0"
] | null | null | null | test/test_crunchbase.py | hackerlist/crunchbase | 07083b9221a7c40d02ed73bda213aed2394e2d72 | [
"Apache-2.0"
] | 1 | 2016-07-20T20:45:57.000Z | 2016-07-20T20:45:57.000Z | #-*- coding: utf-8 -*-
"""
crunchbase.test
~~~~~~~~~~~~~~~
Test cases for the crunchbase api
"""
import unittest
import os
from crunchbase import Crunchbase
TEST_API_KEY = 'dr66y8dsr72hct67pmd6xqqf'
class TestCrunchbase(unittest.TestCase):
def test_connection(self):
cb = Crunchbase(TEST_API_KEY)
def test_get_company(self):
cb = Crunchbase(TEST_API_KEY)
x = cb.company('crunchbase')
| 17.6 | 41 | 0.654545 | 50 | 440 | 5.58 | 0.5 | 0.200717 | 0.182796 | 0.215054 | 0.18638 | 0.18638 | 0 | 0 | 0 | 0 | 0 | 0.026163 | 0.218182 | 440 | 24 | 42 | 18.333333 | 0.784884 | 0.2 | 0 | 0.2 | 0 | 0 | 0.102719 | 0.072508 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.3 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
7c469b493070bf2a90ff9101666c249f84db7fff | 295 | py | Python | misc/keep-mouse-moving/move.py | alexhanl/utilities | 2d312cdc8231b62590436adb2f284885a2b67317 | [
"Apache-2.0"
] | null | null | null | misc/keep-mouse-moving/move.py | alexhanl/utilities | 2d312cdc8231b62590436adb2f284885a2b67317 | [
"Apache-2.0"
] | null | null | null | misc/keep-mouse-moving/move.py | alexhanl/utilities | 2d312cdc8231b62590436adb2f284885a2b67317 | [
"Apache-2.0"
] | null | null | null | import pyautogui, time
while True:
# pyautogui.moveRel(1, 1, duration=0)
# print(pyautogui.position())
# time.sleep(10)
# pyautogui.moveRel(-1, -1, duration=0)
# print(pyautogui.position())
# time.sleep(10)
pyautogui.click()
print('clicked')
time.sleep(60)
| 21.071429 | 43 | 0.627119 | 36 | 295 | 5.138889 | 0.444444 | 0.145946 | 0.183784 | 0.194595 | 0.697297 | 0.697297 | 0.697297 | 0.697297 | 0.697297 | 0.697297 | 0 | 0.051502 | 0.210169 | 295 | 13 | 44 | 22.692308 | 0.742489 | 0.538983 | 0 | 0 | 0 | 0 | 0.054264 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 0.2 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
7c5bdb761be486337931c886ae2af42746bc47f8 | 349 | py | Python | sleekxmpp/plugins/xep_0092/__init__.py | calendar42/SleekXMPP--XEP-0080- | d7bd5fd29f26a5d7de872a49ff63a353b8043e49 | [
"BSD-3-Clause"
] | 1 | 2019-04-12T12:20:12.000Z | 2019-04-12T12:20:12.000Z | sleekxmpp/plugins/xep_0092/__init__.py | vijayp/SleekXMPP | b2e7f57334d27f140f079213c2016615b7168742 | [
"BSD-3-Clause"
] | null | null | null | sleekxmpp/plugins/xep_0092/__init__.py | vijayp/SleekXMPP | b2e7f57334d27f140f079213c2016615b7168742 | [
"BSD-3-Clause"
] | 1 | 2020-05-06T18:46:53.000Z | 2020-05-06T18:46:53.000Z | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.plugins.xep_0092 import stanza
from sleekxmpp.plugins.xep_0092.stanza import Version
from sleekxmpp.plugins.xep_0092.version import xep_0092
| 29.083333 | 59 | 0.765043 | 52 | 349 | 5.057692 | 0.596154 | 0.106464 | 0.228137 | 0.262357 | 0.307985 | 0 | 0 | 0 | 0 | 0 | 0 | 0.068966 | 0.169054 | 349 | 11 | 60 | 31.727273 | 0.837931 | 0.47851 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
7c5cee0aadba6598aee00f2b6cb5a76cadbf0ead | 208,085 | py | Python | apps/oozie/src/oozie/tests.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 3 | 2018-01-29T14:16:02.000Z | 2019-02-05T21:33:05.000Z | apps/oozie/src/oozie/tests.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 1 | 2019-05-06T15:32:21.000Z | 2019-05-06T15:32:21.000Z | apps/oozie/src/oozie/tests.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 2 | 2019-12-05T17:24:36.000Z | 2021-11-22T21:21:32.000Z | #!/usr/bin/env python
## -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import logging
import re
import os
import StringIO
import shutil
import tempfile
import zipfile
from datetime import datetime
from itertools import chain
from nose.plugins.skip import SkipTest
from nose.tools import raises, assert_true, assert_false, assert_equal, assert_not_equal
from django.contrib.auth.models import User
from django.urls import reverse
from desktop.lib.django_test_util import make_logged_in_client
from desktop.lib.test_utils import grant_access, add_permission, add_to_group, reformat_json, reformat_xml
from desktop.models import Document, Document2
import desktop.views as views
from hadoop import cluster as originalCluster
from hadoop.pseudo_hdfs4 import is_live_cluster
from jobsub.models import OozieDesign, OozieMapreduceAction
from liboozie import oozie_api
from liboozie.conf import OOZIE_URL
from liboozie.oozie_api_tests import OozieServerProvider
from liboozie.types import WorkflowList, Workflow as OozieWorkflow, Coordinator as OozieCoordinator,\
Bundle as OozieBundle, CoordinatorList, WorkflowAction, BundleList
from oozie.conf import ENABLE_CRON_SCHEDULING, ENABLE_V2
from oozie.models import Dataset, Workflow, Node, Kill, Link, Job, Coordinator, History,\
find_parameters, NODE_TYPES, Bundle
from oozie.models2 import _get_hiveserver2_url
from oozie.utils import workflow_to_dict, model_to_dict, smart_path, contains_symlink, convert_to_server_timezone
from oozie.importlib.workflows import import_workflow
from oozie.importlib.jobdesigner import convert_jobsub_design
LOG = logging.getLogger(__name__)
_INITIALIZED = False
class MockOozieApi:
JSON_WORKFLOW_LIST = [{u'status': u'RUNNING', u'run': 0, u'startTime': u'Mon, 30 Jul 2012 22:35:48 GMT', u'appName': u'WordCount1', u'lastModTime': u'Mon, 30 Jul 2012 22:37:00 GMT', u'actions': [], u'acl': None, u'appPath': None, u'externalId': 'job_201208072118_0044', u'consoleUrl': u'http://runreal:11000/oozie?job=0000012-120725142744176-oozie-oozi-W', u'conf': None, u'parentId': None, u'createdTime': u'Mon, 30 Jul 2012 22:35:48 GMT', u'toString': u'Workflow id[0000012-120725142744176-oozie-oozi-W] status[SUCCEEDED]', u'endTime': u'Mon, 30 Jul 2012 22:37:00 GMT', u'id': u'0000012-120725142744176-oozie-oozi-W', u'group': None, u'user': u'test'},
{u'status': u'KILLED', u'run': 0, u'startTime': u'Mon, 30 Jul 2012 22:31:08 GMT', u'appName': u'WordCount2', u'lastModTime': u'Mon, 30 Jul 2012 22:32:20 GMT', u'actions': [], u'acl': None, u'appPath': None, u'externalId': '-', u'consoleUrl': u'http://runreal:11000/oozie?job=0000011-120725142744176-oozie-oozi-W', u'conf': None, u'parentId': None, u'createdTime': u'Mon, 30 Jul 2012 22:31:08 GMT', u'toString': u'Workflow id[0000011-120725142744176-oozie-oozi-W] status[SUCCEEDED]', u'endTime': u'Mon, 30 Jul 2012 22:32:20 GMT', u'id': u'0000011-120725142744176-oozie-oozi-W', u'group': None, u'user': u'test'},
{u'status': u'SUCCEEDED', u'run': 0, u'startTime': u'Mon, 30 Jul 2012 22:20:48 GMT', u'appName': u'WordCount3', u'lastModTime': u'Mon, 30 Jul 2012 22:22:00 GMT', u'actions': [], u'acl': None, u'appPath': None, u'externalId': '', u'consoleUrl': u'http://runreal:11000/oozie?job=0000009-120725142744176-oozie-oozi-W', u'conf': None, u'parentId': None, u'createdTime': u'Mon, 30 Jul 2012 22:20:48 GMT', u'toString': u'Workflow id[0000009-120725142744176-oozie-oozi-W] status[SUCCEEDED]', u'endTime': u'Mon, 30 Jul 2012 22:22:00 GMT', u'id': u'0000009-120725142744176-oozie-oozi-W', u'group': None, u'user': u'test'},
{u'status': u'SUCCEEDED', u'run': 0, u'startTime': u'Mon, 30 Jul 2012 22:16:58 GMT', u'appName': u'WordCount4', u'lastModTime': u'Mon, 30 Jul 2012 22:18:10 GMT', u'actions': [], u'acl': None, u'appPath': None, u'externalId': None, u'consoleUrl': u'http://runreal:11000/oozie?job=0000008-120725142744176-oozie-oozi-W', u'conf': None, u'parentId': None, u'createdTime': u'Mon, 30 Jul 2012 22:16:58 GMT', u'toString': u'Workflow id[0000008-120725142744176-oozie-oozi-W] status[SUCCEEDED]', u'endTime': u'Mon, 30 Jul 2012 22:18:10 GMT', u'id': u'0000008-120725142744176-oozie-oozi-W', u'group': None, u'user': u'test'},
{u'status': u'SUCCEEDED', u'run': 0, u'startTime': u'Fri, 24 Jul 2015 14:56:08 AEST', u'appName': u'WordCount5', u'lastModTime': u'Fri, 24 Jul 2015 14:57:17 AEST', u'actions': [], u'acl': None, u'appPath': None, u'externalId': None, u'consoleUrl': u'http://runreal:11000/oozie?job=0000008-120725142744176-oozie-oozi-W', u'conf': None, u'parentId': None, u'createdTime': u'Fri, 24 Jul 2015 14:56:08 AEST', u'toString': u'Workflow id[0000007-120725142744176-oozie-oozi-W] status[SUCCEEDED]', u'endTime': u'Fri, 24 Jul 2015 14:57:17 AEST', u'id': u'0000007-120725142744176-oozie-oozi-W', u'group': None, u'user': u'test'},
{u'status': u'RUNNING', u'run': 0, u'startTime': u'Mon, 30 Jul 2012 22:35:48 GMT', u'appName': u'WordCount1', u'lastModTime': u'Mon, 30 Jul 2012 22:37:00 GMT', u'actions': [], u'acl': None, u'appPath': None, u'externalId': 'job_201208072118_0044', u'consoleUrl': u'http://runreal:11000/oozie?job=0000006-120725142744176-oozie-oozi-W', u'conf': None, u'parentId': None, u'createdTime': u'Mon, 30 Jul 2012 22:35:48 GMT', u'toString': u'Workflow id[0000006-120725142744176-oozie-oozi-W] status[SUCCEEDED]', u'endTime': u'Mon, 30 Jul 2012 22:37:00 GMT', u'id': u'0000006-120725142744176-oozie-oozi-W', u'group': None, u'user': u'test'},
{u'status': u'RUNNING', u'run': 0, u'startTime': u'Mon, 30 Jul 2012 22:35:48 GMT', u'appName': u'TestUnicodeParam', u'lastModTime': u'Mon, 30 Jul 2012 22:37:00 GMT', u'actions': [], u'acl': None, u'appPath': None, u'externalId': 'job_201208072118_0044', u'consoleUrl': u'http://runreal:11000/oozie?job=0000005-120725142744176-oozie-oozi-W', u'conf': u'<property><name>unicode_param</name><value>�</value></property>', u'parentId': None, u'createdTime': u'Mon, 30 Jul 2012 22:35:48 GMT', u'toString': u'Workflow id[0000005-120725142744176-oozie-oozi-W] status[SUCCEEDED]', u'endTime': u'Mon, 30 Jul 2012 22:37:00 GMT', u'id': u'0000005-120725142744176-oozie-oozi-W', u'group': None, u'user': u'test'}]
WORKFLOW_IDS = [wf['id'] for wf in JSON_WORKFLOW_LIST]
WORKFLOW_DICT = dict([(wf['id'], wf) for wf in JSON_WORKFLOW_LIST])
JSON_ACTION_COORDINATOR_LIST = [
{u'status': u'SUCCEEDED', u'toString': u'WorkflowAction name[00000013-120706144403213-oozie-oozi-C@1] status[SUCCEEDED]', u'runConf': None, u'errorMessage': None, u'missingDependencies': u'', u'coordJobId': u'00000013-120706144403213-oozie-oozi-C', u'errorCode': None, u'actionNumber': 1, u'consoleUrl': None, u'nominalTime': u'Mon, 31 Dec 2012 16:00:00 PST', u'externalStatus': u'', u'createdConf': None, u'createdTime': u'Fri, 25 Jan 2013 10:53:39 PST', u'externalId': u'0000035-130124125317829-oozie-oozi-W', u'lastModifiedTime': u'Fri, 25 Jan 2013 10:53:51 PST', u'type': None, u'id': u'00000013-120706144403213-oozie-oozi-C@1', u'trackerUri': None},
{u'status': u'SUCCEEDED', u'toString': u'WorkflowAction name[00000013-120706144403213-oozie-oozi-C@2] status[SUCCEEDED]', u'runConf': None, u'errorMessage': None, u'missingDependencies': u'', u'coordJobId': u'00000013-120706144403213-oozie-oozi-C', u'errorCode': None, u'actionNumber': 2, u'consoleUrl': None, u'nominalTime': u'Tue, 01 Jan 2013 16:00:00 PST', u'externalStatus': u'', u'createdConf': None, u'createdTime': u'Fri, 25 Jan 2013 10:56:27 PST', u'externalId': u'0000038-130124125317829-oozie-oozi-W', u'lastModifiedTime': u'Fri, 25 Jan 2013 10:56:41 PST', u'type': None, u'id': u'00000013-120706144403213-oozie-oozi-C@2', u'trackerUri': None},
{u'status': u'SUCCEEDED', u'toString': u'WorkflowAction name[00000013-120706144403213-oozie-oozi-C@3] status[SUCCEEDED]', u'runConf': None, u'errorMessage': None, u'missingDependencies': u'', u'coordJobId': u'00000013-120706144403213-oozie-oozi-C', u'errorCode': None, u'actionNumber': 3, u'consoleUrl': None, u'nominalTime': u'Wed, 02 Jan 2013 16:00:00 PST', u'externalStatus': u'', u'createdConf': None, u'createdTime': u'Fri, 25 Jan 2013 08:59:38 PST', u'externalId': u'0000026-130124125317829-oozie-oozi-W', u'lastModifiedTime': u'Fri, 25 Jan 2013 09:00:05 PST', u'type': None, u'id': u'00000013-120706144403213-oozie-oozi-C@3', u'trackerUri': None},
{u'status': u'SUCCEEDED', u'toString': u'WorkflowAction name[00000013-120706144403213-oozie-oozi-C@4] status[SUCCEEDED]', u'runConf': None, u'errorMessage': None, u'missingDependencies': u'', u'coordJobId': u'00000013-120706144403213-oozie-oozi-C', u'errorCode': None, u'actionNumber': 4, u'consoleUrl': None, u'nominalTime': u'Thu, 03 Jan 2013 16:00:00 PST', u'externalStatus': u'', u'createdConf': None, u'createdTime': u'Fri, 25 Jan 2013 10:53:39 PST', u'externalId': u'0000037-130124125317829-oozie-oozi-W', u'lastModifiedTime': u'Fri, 25 Jan 2013 10:54:17 PST', u'type': None, u'id': u'00000013-120706144403213-oozie-oozi-C@4', u'trackerUri': None}
]
JSON_COORDINATOR_LIST = [{u'startTime': u'Sun, 01 Jul 2012 00:00:00 GMT', u'actions': [], u'frequency': 1, u'concurrency': 1, u'pauseTime': None, u'group': None, u'toString': u'Coornidator application id[0000041-120717205528122-oozie-oozi-C] status[RUNNING]', u'consoleUrl': None, u'mat_throttling': 0, u'status': u'RUNNING', u'conf': None, u'user': u'test', u'timeOut': 120, u'coordJobPath': u'hdfs://localhost:8020/user/test/demo2', u'timeUnit': u'DAY', u'coordJobId': u'0000041-120717205528122-oozie-oozi-C', u'coordJobName': u'DailyWordCount1', u'nextMaterializedTime': u'Wed, 04 Jul 2012 00:00:00 GMT', u'coordExternalId': None, u'acl': None, u'lastAction': u'Wed, 04 Jul 2012 00:00:00 GMT', u'executionPolicy': u'FIFO', u'timeZone': u'America/Los_Angeles', u'endTime': u'Wed, 04 Jul 2012 00:00:00 GMT'},
{u'startTime': u'Sun, 01 Jul 2012 00:00:00 GMT', u'actions': [], u'frequency': 1, u'concurrency': 1, u'pauseTime': None, u'group': None, u'toString': u'Coornidator application id[0000011-120706144403213-oozie-oozi-C] status[DONEWITHERROR]', u'consoleUrl': None, u'mat_throttling': 0, u'status': u'DONEWITHERROR', u'conf': None, u'user': u'test', u'timeOut': 120, u'coordJobPath': u'hdfs://localhost:8020/user/hue/jobsub/_romain_-design-2', u'timeUnit': u'DAY', u'coordJobId': u'0000011-120706144403213-oozie-oozi-C', u'coordJobName': u'DailyWordCount2', u'nextMaterializedTime': u'Thu, 05 Jul 2012 00:00:00 GMT', u'coordExternalId': None, u'acl': None, u'lastAction': u'Thu, 05 Jul 2012 00:00:00 GMT', u'executionPolicy': u'FIFO', u'timeZone': u'America/Los_Angeles', u'endTime': u'Wed, 04 Jul 2012 18:54:00 GMT'},
{u'startTime': u'Sun, 01 Jul 2012 00:00:00 GMT', u'actions': [], u'frequency': 1, u'concurrency': 1, u'pauseTime': None, u'group': None, u'toString': u'Coornidator application id[0000010-120706144403213-oozie-oozi-C] status[DONEWITHERROR]', u'consoleUrl': None, u'mat_throttling': 0, u'status': u'DONEWITHERROR', u'conf': None, u'user': u'test', u'timeOut': 120, u'coordJobPath': u'hdfs://localhost:8020/user/hue/jobsub/_romain_-design-2', u'timeUnit': u'DAY', u'coordJobId': u'0000010-120706144403213-oozie-oozi-C', u'coordJobName': u'DailyWordCount3', u'nextMaterializedTime': u'Thu, 05 Jul 2012 00:00:00 GMT', u'coordExternalId': None, u'acl': None, u'lastAction': u'Thu, 05 Jul 2012 00:00:00 GMT', u'executionPolicy': u'FIFO', u'timeZone': u'America/Los_Angeles', u'endTime': u'Wed, 04 Jul 2012 18:54:00 GMT'},
{u'startTime': u'Sun, 01 Jul 2012 00:00:00 GMT', u'actions': [], u'frequency': 1, u'concurrency': 1, u'pauseTime': None, u'group': None, u'toString': u'Coornidator application id[0000009-120706144403213-oozie-oozi-C] status[DONEWITHERROR]', u'consoleUrl': None, u'mat_throttling': 0, u'status': u'DONEWITHERROR', u'conf': None, u'user': u'test', u'timeOut': 120, u'coordJobPath': u'hdfs://localhost:8020/user/hue/jobsub/_romain_-design-2', u'timeUnit': u'DAY', u'coordJobId': u'0000009-120706144403213-oozie-oozi-C', u'coordJobName': u'DailyWordCount4', u'nextMaterializedTime': u'Thu, 05 Jul 2012 00:00:00 GMT', u'coordExternalId': None, u'acl': None, u'lastAction': u'Thu, 05 Jul 2012 00:00:00 GMT', u'executionPolicy': u'FIFO', u'timeZone': u'America/Los_Angeles', u'endTime': u'Wed, 04 Jul 2012 18:54:00 GMT'},
{u'startTime': u'Sun, 01 Jul 2012 00:00:00 GMT', u'actions': [], u'frequency': 1, u'concurrency': 1, u'pauseTime': None, u'group': None, u'toString': u'Coornidator application id[00000012-120706144403213-oozie-oozi-C] status[DONEWITHERROR]', u'consoleUrl': None, u'mat_throttling': 0, u'status': u'DONEWITHERROR', u'conf': None, u'user': u'test', u'timeOut': 120, u'coordJobPath': u'hdfs://localhost:8020/user/hue/jobsub/_romain_-design-2', u'timeUnit': u'DAY', u'coordJobId': u'0000009-120706144403213-oozie-oozi-C', u'coordJobName': u'DåilyWordCount5', u'nextMaterializedTime': u'Thu, 05 Jul 2012 00:00:00 GMT', u'coordExternalId': None, u'acl': None, u'lastAction': u'Thu, 05 Jul 2012 00:00:00 GMT', u'executionPolicy': u'FIFO', u'timeZone': u'America/Los_Angeles', u'endTime': u'Wed, 04 Jul 2012 18:54:00 GMT'},
{u'startTime': u'Sun, 01 Jul 2012 00:00:00 GMT', u'actions': JSON_ACTION_COORDINATOR_LIST, u'frequency': 1, u'concurrency': 1, u'pauseTime': None, u'group': None, u'toString': u'Coornidator application id[00000013-120706144403213-oozie-oozi-C] status[DONEWITHERROR]', u'consoleUrl': None, u'mat_throttling': 0, u'status': u'DONEWITHERROR', u'conf': None, u'user': u'test', u'timeOut': 120, u'coordJobPath': u'hdfs://localhost:8020/user/hue/jobsub/_romain_-design-2', u'timeUnit': u'DAY', u'coordJobId': u'00000013-120706144403213-oozie-oozi-C', u'coordJobName': u'DåilyWordCount6', u'nextMaterializedTime': u'Thu, 05 Jul 2012 00:00:00 GMT', u'coordExternalId': None, u'acl': None, u'lastAction': u'Thu, 05 Jul 2012 00:00:00 GMT', u'executionPolicy': u'FIFO', u'timeZone': u'America/Los_Angeles', u'endTime': u'Wed, 04 Jul 2012 18:54:00 GMT'}]
COORDINATOR_IDS = [coord['coordJobId'] for coord in JSON_COORDINATOR_LIST]
COORDINATOR_DICT = dict([(coord['coordJobId'], coord) for coord in JSON_COORDINATOR_LIST])
JSON_BUNDLE_LIST = [
{u'status': u'SUCCEEDED', u'toString': u'Bundle id[0000021-130210132208494-oozie-oozi-B] status[SUCCEEDED]', u'group': None, u'conf': u'<configuration>\r\n <property>\r\n <name>oozie.bundle.application.path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/workspaces/_romain_-oozie-22-1360636939.69</value>\r\n </property>\r\n <property>\r\n <name>user.name</name>\r\n <value>romain</value>\r\n </property>\r\n <property>\r\n <name>oozie.use.system.libpath</name>\r\n <value>true</value>\r\n </property>\r\n <property>\r\n <name>nameNode</name>\r\n <value>hdfs://localhost:8020</value>\r\n </property>\r\n <property>\r\n <name>wf_application_path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/deployments/_romain_-oozie-5-1360649203.07</value>\r\n </property>\r\n <property>\r\n <name>jobTracker</name>\r\n <value>localhost:8021</value>\r\n </property>\r\n <property>\r\n <name>hue-id-b</name>\r\n <value>22</value>\r\n </property>\r\n</configuration>', u'bundleJobName': u'MyBundle1', u'startTime': None, u'bundleCoordJobs': [], u'kickoffTime': u'Mon, 11 Feb 2013 08:33:00 PST', u'acl': None, u'bundleJobPath': u'hdfs://localhost:8020/user/hue/oozie/workspaces/_romain_-oozie-22-1360636939.69', u'createdTime': u'Mon, 11 Feb 2013 22:06:44 PST', u'timeOut': 0, u'consoleUrl': None, u'bundleExternalId': None, u'timeUnit': u'NONE', u'pauseTime': None, u'bundleJobId': u'0000021-130210132208494-oozie-oozi-B', u'endTime': None, u'user': u'test'},
{u'status': u'KILLED', u'toString': u'Bundle id[0000020-130210132208494-oozie-oozi-B] status[KILLED]', u'group': None, u'conf': u'<configuration>\r\n <property>\r\n <name>oozie.bundle.application.path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/workspaces/_romain_-oozie-22-1360636939.69</value>\r\n </property>\r\n <property>\r\n <name>user.name</name>\r\n <value>romain</value>\r\n </property>\r\n <property>\r\n <name>oozie.use.system.libpath</name>\r\n <value>true</value>\r\n </property>\r\n <property>\r\n <name>nameNode</name>\r\n <value>hdfs://localhost:8020</value>\r\n </property>\r\n <property>\r\n <name>wf_application_path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/deployments/_romain_-oozie-5-1360648977.2</value>\r\n </property>\r\n <property>\r\n <name>jobTracker</name>\r\n <value>localhost:8021</value>\r\n </property>\r\n <property>\r\n <name>hue-id-b</name>\r\n <value>22</value>\r\n </property>\r\n</configuration>', u'bundleJobName': u'MyBundle2', u'startTime': None, u'bundleCoordJobs': [], u'kickoffTime': u'Mon, 11 Feb 2013 08:33:00 PST', u'acl': None, u'bundleJobPath': u'hdfs://localhost:8020/user/hue/oozie/workspaces/_romain_-oozie-22-1360636939.69', u'createdTime': u'Mon, 11 Feb 2013 22:02:58 PST', u'timeOut': 0, u'consoleUrl': None, u'bundleExternalId': None, u'timeUnit': u'NONE', u'pauseTime': None, u'bundleJobId': u'0000020-130210132208494-oozie-oozi-B', u'endTime': None, u'user': u'test'},
{u'status': u'KILLED', u'toString': u'Bundle id[0000019-130210132208494-oozie-oozi-B] status[KILLED]', u'group': None, u'conf': u'<configuration>\r\n <property>\r\n <name>oozie.bundle.application.path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/workspaces/_romain_-oozie-22-1360636939.69</value>\r\n </property>\r\n <property>\r\n <name>user.name</name>\r\n <value>romain</value>\r\n </property>\r\n <property>\r\n <name>oozie.use.system.libpath</name>\r\n <value>true</value>\r\n </property>\r\n <property>\r\n <name>nameNode</name>\r\n <value>hdfs://localhost:8020</value>\r\n </property>\r\n <property>\r\n <name>wf_application_path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/deployments/_romain_-oozie-5-1360639372.41</value>\r\n </property>\r\n <property>\r\n <name>jobTracker</name>\r\n <value>localhost:8021</value>\r\n </property>\r\n <property>\r\n <name>hue-id-b</name>\r\n <value>22</value>\r\n </property>\r\n</configuration>', u'bundleJobName': u'MyBundle3', u'startTime': None, u'bundleCoordJobs': [], u'kickoffTime': u'Mon, 11 Feb 2013 08:33:00 PST', u'acl': None, u'bundleJobPath': u'hdfs://localhost:8020/user/hue/oozie/workspaces/_romain_-oozie-22-1360636939.69', u'createdTime': u'Mon, 11 Feb 2013 19:22:53 PST', u'timeOut': 0, u'consoleUrl': None, u'bundleExternalId': None, u'timeUnit': u'NONE', u'pauseTime': None, u'bundleJobId': u'0000019-130210132208494-oozie-oozi-B', u'endTime': None, u'user': u'test'}
]
BUNDLE_IDS = [bundle['bundleJobId'] for bundle in JSON_BUNDLE_LIST]
BUNDLE_DICT = dict([(bundle['bundleJobId'], bundle) for bundle in JSON_BUNDLE_LIST])
WORKFLOW_ACTION = {u'status': u'OK', u'retries': 0, u'transition': u'end', u'stats': None, u'startTime': u'Fri, 10 Aug 2012 05:24:21 GMT', u'toString': u'Action name[WordCount] status[OK]', u'cred': u'null', u'errorMessage': None, u'errorCode': None, u'consoleUrl': u'http://localhost:50030/jobdetails.jsp?jobid=job_201208072118_0044', u'externalId': u'job_201208072118_0044', u'externalStatus': u'SUCCEEDED', u'conf': u'<map-reduce xmlns="uri:oozie:workflow:0.4">\r\n <job-tracker>localhost:8021</job-tracker>\r\n <name-node>hdfs://localhost:8020</name-node>\r\n <configuration>\r\n <property>\r\n <name>mapred.mapper.regex</name>\r\n <value>dream</value>\r\n </property>\r\n <property>\r\n <name>mapred.input.dir</name>\r\n <value>/user/test/words/20120702</value>\r\n </property>\r\n <property>\r\n <name>mapred.output.dir</name>\r\n <value>/user/test/out/rrwords/20120702</value>\r\n </property>\r\n <property>\r\n <name>mapred.mapper.class</name>\r\n <value>org.apache.hadoop.mapred.lib.RegexMapper</value>\r\n </property>\r\n <property>\r\n <name>mapred.combiner.class</name>\r\n <value>org.apache.hadoop.mapred.lib.LongSumReducer</value>\r\n </property>\r\n <property>\r\n <name>mapred.reducer.class</name>\r\n <value>org.apache.hadoop.mapred.lib.LongSumReducer</value>\r\n </property>\r\n <property>\r\n <name>mapred.output.key.class</name>\r\n <value>org.apache.hadoop.io.Text</value>\r\n </property>\r\n <property>\r\n <name>mapred.output.value.class</name>\r\n <value>org.apache.hadoop.io.LongWritable</value>\r\n </property>\r\n </configuration>\r\n</map-reduce>', u'type': u'map-reduce', u'trackerUri': u'localhost:8021', u'externalChildIDs': None, u'endTime': u'Fri, 10 Aug 2012 05:24:38 GMT', u'data': None, u'id': u'0000012-120725142744176-oozie-oozi-W@WordCount', u'name': u'WordCount', u'externalChildIDs': u'job_201302280955_0018,job_201302280955_0019,job_201302280955_0020'}
JSON_ACTION_BUNDLE_LIST = [
{u'status': u'SUCCEEDED', u'toString': u'WorkflowAction name[0000000-130117135211239-oozie-oozi-C@1] status[SUCCEEDED]', u'runConf': None, u'errorMessage': None, u'missingDependencies': u'', u'coordJobId': u'0000000-130117135211239-oozie-oozi-C', u'errorCode': None, u'actionNumber': 1, u'consoleUrl': None, u'nominalTime': u'Mon, 31 Dec 2012 16:00:00 PST', u'externalStatus': u'', u'createdConf': None, u'createdTime': u'Fri, 25 Jan 2013 10:53:39 PST', u'externalId': u'0000035-130124125317829-oozie-oozi-W', u'lastModifiedTime': u'Fri, 25 Jan 2013 10:53:51 PST', u'type': None, u'id': u'0000000-130117135211239-oozie-oozi-C@1', u'trackerUri': None},
{u'status': u'SUCCEEDED', u'toString': u'WorkflowAction name[0000000-130117135211239-oozie-oozi-C@2] status[SUCCEEDED]', u'runConf': None, u'errorMessage': None, u'missingDependencies': u'', u'coordJobId': u'0000000-130117135211239-oozie-oozi-C', u'errorCode': None, u'actionNumber': 2, u'consoleUrl': None, u'nominalTime': u'Tue, 01 Jan 2013 16:00:00 PST', u'externalStatus': u'', u'createdConf': None, u'createdTime': u'Fri, 25 Jan 2013 10:56:27 PST', u'externalId': u'0000038-130124125317829-oozie-oozi-W', u'lastModifiedTime': u'Fri, 25 Jan 2013 10:56:41 PST', u'type': None, u'id': u'0000000-130117135211239-oozie-oozi-C@2', u'trackerUri': None},
{u'status': u'SUCCEEDED', u'toString': u'WorkflowAction name[0000000-130117135211239-oozie-oozi-C@3] status[SUCCEEDED]', u'runConf': None, u'errorMessage': None, u'missingDependencies': u'', u'coordJobId': u'0000000-130117135211239-oozie-oozi-C', u'errorCode': None, u'actionNumber': 3, u'consoleUrl': None, u'nominalTime': u'Wed, 02 Jan 2013 16:00:00 PST', u'externalStatus': u'', u'createdConf': None, u'createdTime': u'Fri, 25 Jan 2013 08:59:38 PST', u'externalId': u'0000026-130124125317829-oozie-oozi-W', u'lastModifiedTime': u'Fri, 25 Jan 2013 09:00:05 PST', u'type': None, u'id': u'0000000-130117135211239-oozie-oozi-C@3', u'trackerUri': None},
{u'status': u'SUCCEEDED', u'toString': u'WorkflowAction name[0000000-130117135211239-oozie-oozi-C@4] status[SUCCEEDED]', u'runConf': None, u'errorMessage': None, u'missingDependencies': u'', u'coordJobId': u'0000000-130117135211239-oozie-oozi-C', u'errorCode': None, u'actionNumber': 4, u'consoleUrl': None, u'nominalTime': u'Thu, 03 Jan 2013 16:00:00 PST', u'externalStatus': u'', u'createdConf': None, u'createdTime': u'Fri, 25 Jan 2013 10:53:39 PST', u'externalId': u'0000037-130124125317829-oozie-oozi-W', u'lastModifiedTime': u'Fri, 25 Jan 2013 10:54:17 PST', u'type': None, u'id': u'0000000-130117135211239-oozie-oozi-C@4', u'trackerUri': None}
]
BUNDLE_ACTION = {u'startTime': u'Mon, 31 Dec 2012 16:00:00 PST', u'actions': [], u'frequency': 1, u'concurrency': 1, u'pauseTime': None, u'group': None, u'toString': u'Coordinator application id[0000022-130210132208494-oozie-oozi-C] status[SUCCEEDED]', u'consoleUrl': None, u'mat_throttling': 12, u'status': u'SUCCEEDED', u'conf': u'<configuration>\r\n <property>\r\n <name>oozie.coord.application.path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/deployments/_romain_-oozie-6-1360649203.56</value>\r\n </property>\r\n <property>\r\n <name>oozie.bundle.application.path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/workspaces/_romain_-oozie-22-1360636939.69</value>\r\n </property>\r\n <property>\r\n <name>market</name>\r\n <value>France</value>\r\n </property>\r\n <property>\r\n <name>user.name</name>\r\n <value>romain</value>\r\n </property>\r\n <property>\r\n <name>oozie.use.system.libpath</name>\r\n <value>true</value>\r\n </property>\r\n <property>\r\n <name>oozie.bundle.id</name>\r\n <value>0000021-130210132208494-oozie-oozi-B</value>\r\n </property>\r\n <property>\r\n <name>nameNode</name>\r\n <value>hdfs://localhost:8020</value>\r\n </property>\r\n <property>\r\n <name>wf_application_path</name>\r\n <value>hdfs://localhost:8020/user/hue/oozie/deployments/_romain_-oozie-5-1360649203.07</value>\r\n </property>\r\n <property>\r\n <name>jobTracker</name>\r\n <value>localhost:8021</value>\r\n </property>\r\n <property>\r\n <name>hue-id-b</name>\r\n <value>22</value>\r\n </property>\r\n</configuration>', u'user': u'romain', u'timeOut': 120, u'coordJobPath': u'hdfs://localhost:8020/user/hue/oozie/deployments/_romain_-oozie-6-1360649203.56', u'timeUnit': u'DAY', u'coordJobId': u'0000022-130210132208494-oozie-oozi-C', u'coordJobName': u'DailySleep', u'nextMaterializedTime': u'Fri, 04 Jan 2013 16:00:00 PST', u'coordExternalId': None, u'acl': None, u'lastAction': u'Fri, 04 Jan 2013 16:00:00 PST', u'executionPolicy': u'FIFO', u'timeZone': u'America/Los_Angeles', u'endTime': u'Fri, 04 Jan 2013 16:00:00 PST'}
WORKFLOWS_SLAS = [
{u'actualDuration': 68406, u'appType': u'WORKFLOW_JOB', u'appName': u'Forks', u'actualStart': u'Fri, 06 Dec 2013 14:01:53 PST', u'jobStatus': u'SUCCEEDED', u'id': u'0000002-131206135002457-oozie-oozi-W', u'expectedDuration': 1800000, u'nominalTime': u'Mon, 17 Jun 2013 17:01:00 PDT', u'slaStatus': u'MISS', u'lastModified': u'Fri, 06 Dec 2013 14:03:05 PST', u'actualEnd': u'Fri, 06 Dec 2013 14:03:01 PST', u'expectedEnd': u'Mon, 17 Jun 2013 17:31:00 PDT', u'expectedStart': u'Mon, 17 Jun 2013 17:11:00 PDT', u'user': u'romain'}
]
def __init__(self, *args, **kwargs):
self.api_version = 'v2'
def setuser(self, user):
pass
@property
def security_enabled(self):
return False
def submit_job(self, properties):
return 'ONE-OOZIE-ID-W'
def get_workflows(self, **kwargs):
workflows = MockOozieApi.JSON_WORKFLOW_LIST
user_filters = [val for key, val in kwargs['filters'] if key == 'user']
if user_filters:
workflows = filter(lambda wf: wf['user'] == user_filters[0], workflows)
return WorkflowList(self, {'offset': 0, 'total': 5, 'workflows': workflows})
def get_coordinators(self, **kwargs):
coordinatorjobs = MockOozieApi.JSON_COORDINATOR_LIST
user_filters = [val for key, val in kwargs['filters'] if key == 'user']
if user_filters:
coordinatorjobs = filter(lambda coord: coord['user'] == user_filters[0], coordinatorjobs)
return CoordinatorList(self, {'offset': 0, 'total': 5, 'coordinatorjobs': coordinatorjobs})
def get_bundles(self, **kwargs):
bundlejobs = MockOozieApi.JSON_BUNDLE_LIST
user_filters = [val for key, val in kwargs['filters'] if key == 'user']
if user_filters:
bundlejobs = filter(lambda coord: coord['user'] == user_filters[0], bundlejobs)
return BundleList(self, {'offset': 0, 'total': 4, 'bundlejobs': bundlejobs})
def get_job(self, job_id):
if job_id in MockOozieApi.WORKFLOW_DICT:
return OozieWorkflow(self, MockOozieApi.WORKFLOW_DICT[job_id])
else:
return OozieWorkflow(self, {'id': job_id, 'actions': []})
def get_coordinator(self, job_id, **kwargs):
if job_id in MockOozieApi.COORDINATOR_DICT:
return OozieCoordinator(self, MockOozieApi.COORDINATOR_DICT[job_id])
else:
return OozieCoordinator(self, {'id': job_id, 'actions': []})
def get_bundle(self, job_id):
return OozieBundle(self, MockOozieApi.JSON_BUNDLE_LIST[0])
def get_action(self, action_id):
return WorkflowAction(MockOozieApi.WORKFLOW_ACTION)
def job_control(self, job_id, action, parameters=None):
return 'Done'
def get_job_definition(self, jobid):
if jobid == MockOozieApi.WORKFLOW_IDS[0]:
return """<workflow-app name="MapReduce" xmlns="uri:oozie:workflow:0.4">
<start to="Sleep"/>
<action name="Sleep">
<map-reduce>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.reduce.tasks</name>
<value>1</value>
</property>
<property>
<name>sleep.job.reduce.sleep.time</name>
<value>${REDUCER_SLEEP_TIME}</value>
</property>
</configuration>
</map-reduce>
<ok to="end"/>
<error to="kill"/>
</action>
<kill name="kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>"""
else:
return """<workflow-app name="MapReduce" xmlns="uri:oozie:workflow:0.4">BAD</workflow-app>"""
def get_job_log(self, jobid, logfilter=None):
rows = {}
rows['INFO'] = '2013-01-08 16:28:06,487 INFO ActionStartXCommand:539 - USER[romain] GROUP[-] TOKEN[] APP[MapReduce] JOB[0000002-130108101138395-oozie-oozi-W] ACTION[0000002-130108101138395-oozie-oozi-W@:start:] Start action [0000002-130108101138395-oozie-oozi-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]'
rows['DEBUG'] = '2013-01-08 16:28:06,487 DEBUG ActionStartXCommand:539 - USER[romain] GROUP[-] TOKEN[] APP[MapReduce] JOB[0000002-130108101138395-oozie-oozi-W] ACTION[0000002-130108101138395-oozie-oozi-W@:start:] Start action [0000002-130108101138395-oozie-oozi-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]'
rows['ERROR'] = '2013-01-08 16:28:06,487 ERROR ActionStartXCommand:539 - USER[romain] GROUP[-] TOKEN[] APP[MapReduce] JOB[0000002-130108101138395-oozie-oozi-W] ACTION[0000002-130108101138395-oozie-oozi-W@:start:] Start action [0000002-130108101138395-oozie-oozi-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]'
filterMap = {}
for key, val in logfilter:
filterMap[key] = val
if 'loglevel' in filterMap:
row = rows.get(filterMap['loglevel'])
if 'text' in filterMap:
row = '' if filterMap['text'] not in row else row
if 'limit' in filterMap:
row = ((row + '\n') * int(filterMap['limit'])).strip()
return row
def get_oozie_slas(self, **kwargs):
return MockOozieApi.WORKFLOWS_SLAS
def get_configuration(self):
oozie_credentialclasses = """
hbase=org.apache.oozie.action.hadoop.HbaseCredentials,
hcat=org.apache.oozie.action.hadoop.HCatCredentials,
hive2=org.apache.oozie.action.hadoop.Hive2Credentials
"""
return {
'oozie.credentials.credentialclasses': oozie_credentialclasses
}
def get_job_status(self, job_id):
return {'status': "RUNNING"}
class MockFs():
def __init__(self, logical_name=None):
self.fs_defaultfs = 'hdfs://curacao:8020'
self.logical_name = logical_name if logical_name else ''
self.DEFAULT_USER = 'test'
def setuser(self, user):
pass
def join(self, path1, path2):
return path1 + path2
def do_as_user(self, username, fn, *args, **kwargs):
return ''
def read(self, length=1024*1024):
return 'data'
def exists(self, path):
return True
def mkdir(self):
pass
def chmod(self):
pass
def stats(self, path):
class MockWebHdfsStat(object):
def __init__(self):
self.isDir = True
return MockWebHdfsStat()
class OozieMockBase(object):
def setUp(self):
# Beware: Monkey patch Oozie/LibOozie with Mock API
if not hasattr(oozie_api, 'OriginalOozieApi'):
oozie_api.OriginalOozieApi = oozie_api.OozieApi
if not hasattr(Workflow.objects, 'original_check_workspace'):
Workflow.objects.original_check_workspace = Workflow.objects.check_workspace
Workflow.objects.check_workspace = lambda a, b: None
oozie_api.OozieApi = MockOozieApi
oozie_api._api_cache = None
self.c = make_logged_in_client(is_superuser=False)
grant_access("test", "test", "oozie")
add_to_group("test")
self.user = User.objects.get(username='test')
self.wf = create_workflow(self.c, self.user)
self.original_fs = originalCluster.FS_CACHE["default"]
originalCluster.FS_CACHE["default"] = MockFs()
def tearDown(self):
oozie_api.OozieApi = oozie_api.OriginalOozieApi
if originalCluster.FS_CACHE is None:
originalCluster.FS_CACHE = {}
originalCluster.FS_CACHE["default"] = self.original_fs
Workflow.objects.check_workspace = Workflow.objects.original_check_workspace
oozie_api._api_cache = None
History.objects.all().delete()
for coordinator in Coordinator.objects.all():
coordinator.delete(skip_trash=True)
for bundle in Bundle.objects.all():
bundle.delete(skip_trash=True)
def setup_simple_workflow(self):
""" Creates a linear workflow """
Link.objects.filter(parent__workflow=self.wf).delete()
Link(parent=self.wf.start, child=self.wf.end, name="related").save()
action1 = add_node(self.wf, 'action-name-1', 'mapreduce', [self.wf.start], {
'description': '',
'files': '[]',
'jar_path': '/user/hue/oozie/examples/lib/hadoop-examples.jar',
'job_properties': '[{"name":"sleep","value":"${SLEEP}"}]',
'prepares': '[{"value":"${output}","type":"delete"},{"value":"/test","type":"mkdir"}]',
'archives': '[]',
})
action2 = add_node(self.wf, 'action-name-2', 'mapreduce', [action1], {
'description': '',
'files': '[]',
'jar_path': '/user/hue/oozie/examples/lib/hadoop-examples.jar',
'job_properties': '[{"name":"sleep","value":"${SLEEP}"}]',
'prepares': '[{"value":"${output}","type":"delete"},{"value":"/test","type":"mkdir"}]',
'archives': '[]',
})
action3 = add_node(self.wf, 'action-name-3', 'mapreduce', [action2], {
'description': '',
'files': '[]',
'jar_path': '/user/hue/oozie/examples/lib/hadoop-examples.jar',
'job_properties': '[{"name":"sleep","value":"${SLEEP}"}]',
'prepares': '[{"value":"${output}","type":"delete"},{"value":"/test","type":"mkdir"}]',
'archives': '[]',
})
Link(parent=action3, child=self.wf.end, name="ok").save()
def setup_forking_workflow(self):
Link.objects.filter(parent__workflow=self.wf).delete()
Link(parent=self.wf.start, child=self.wf.end, name="related").save()
fork1 = add_node(self.wf, 'fork-name-1', 'fork', [self.wf.start])
action1 = add_node(self.wf, 'action-name-1', 'mapreduce', [fork1])
action2 = add_node(self.wf, 'action-name-2', 'mapreduce', [fork1])
join1 = add_node(self.wf, 'join-name-1', 'join', [action1, action2])
Link(parent=fork1, child=join1, name="related").save()
action3 = add_node(self.wf, 'action-name-3', 'mapreduce', [join1])
Link(parent=action3, child=self.wf.end, name="ok").save()
def create_noop_workflow(self, name='noop-test'):
Node.objects.filter(workflow__name=name).delete()
Workflow.objects.filter(name=name).delete()
if Document.objects.get_docs(self.user, Workflow).filter(name=name).exists():
for doc in Document.objects.get_docs(self.user, Workflow).filter(name=name):
if doc.content_object:
self.c.post(reverse('oozie:delete_workflow') + '?skip_trash=true', {'job_selection': [doc.content_object.id]}, follow=True)
else:
doc.delete()
wf = Workflow.objects.new_workflow(self.user)
wf.name = name
wf.save()
wf.start.workflow = wf
wf.end.workflow = wf
wf.start.save()
wf.end.save()
Document.objects.link(wf, owner=wf.owner, name=wf.name, description=wf.description)
Kill.objects.create(name='kill', workflow=wf, node_type=Kill.node_type)
Link.objects.create(parent=wf.start, child=wf.end, name='related')
Link.objects.create(parent=wf.start, child=wf.end, name="to")
return wf
class OozieBase(OozieServerProvider):
requires_hadoop = True
def setUp(self):
OozieServerProvider.setup_class()
self.c = make_logged_in_client(is_superuser=False)
self.user = User.objects.get(username="test")
grant_access("test", "test", "oozie")
add_to_group("test")
self.cluster = OozieServerProvider.cluster
self.install_examples()
def install_examples(self):
global _INITIALIZED
if _INITIALIZED:
return
reset = ENABLE_V2.set_for_testing(True) # Somewhere this is reseted
try:
self.c.post(reverse('oozie:install_examples'))
finally:
reset()
self.cluster.fs.do_as_user('test', self.cluster.fs.create_home_dir, '/user/test')
_INITIALIZED = True
def setup_simple_workflow(self):
""" Creates a linear workflow """
Link.objects.filter(parent__workflow=self.wf).delete()
Link(parent=self.wf.start, child=self.wf.end, name="related").save()
action1 = add_node(self.wf, 'action-name-1', 'mapreduce', [self.wf.start], {
'description': '',
'files': '[]',
'jar_path': '/user/hue/oozie/examples/lib/hadoop-examples.jar',
'job_properties': '[{"name":"sleep","value":"${SLEEP}"}]',
'prepares': '[{"value":"${output}","type":"delete"},{"value":"/test","type":"mkdir"}]',
'archives': '[]',
})
action2 = add_node(self.wf, 'action-name-2', 'mapreduce', [action1], {
'description': '',
'files': '[]',
'jar_path': '/user/hue/oozie/examples/lib/hadoop-examples.jar',
'job_properties': '[{"name":"sleep","value":"${SLEEP}"}]',
'prepares': '[{"value":"${output}","type":"delete"},{"value":"/test","type":"mkdir"}]',
'archives': '[]',
})
action3 = add_node(self.wf, 'action-name-3', 'mapreduce', [action2], {
'description': '',
'files': '[]',
'jar_path': '/user/hue/oozie/examples/lib/hadoop-examples.jar',
'job_properties': '[{"name":"sleep","value":"${SLEEP}"}]',
'prepares': '[{"value":"${output}","type":"delete"},{"value":"/test","type":"mkdir"}]',
'archives': '[]',
})
Link(parent=action3, child=self.wf.end, name="ok").save()
def setup_forking_workflow(self):
""" Creates a workflow with a fork """
Link.objects.filter(parent__workflow=self.wf).delete()
Link(parent=self.wf.start, child=self.wf.end, name="related").save()
fork1 = add_node(self.wf, 'fork-name-1', 'fork', [self.wf.start])
action1 = add_node(self.wf, 'action-name-1', 'mapreduce', [fork1])
action2 = add_node(self.wf, 'action-name-2', 'mapreduce', [fork1])
join1 = add_node(self.wf, 'join-name-1', 'join', [action1, action2])
Link(parent=fork1, child=join1, name="related").save()
action3 = add_node(self.wf, 'action-name-3', 'mapreduce', [join1])
Link(parent=action3, child=self.wf.end, name="ok").save()
class TestAPI(OozieMockBase):
def setUp(self):
OozieMockBase.setUp(self)
self.wf = Workflow.objects.get(name='wf-name-1', managed=True)
def test_workflow_save(self):
if is_live_cluster():
raise SkipTest('HUE-2897: Skipping because DB may not support unicode')
self.setup_simple_workflow()
workflow_dict = workflow_to_dict(self.wf)
workflow_json = json.dumps(workflow_dict)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json})
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(0, test_response_json_object['status'])
# Change property and save
workflow_dict = workflow_to_dict(self.wf)
workflow_dict['description'] = 'Le workflow est testé. 한국어/조선말'
workflow_json = json.dumps(workflow_dict)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json})
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(0, test_response_json_object['status'])
wf = Workflow.objects.get(id=self.wf.id)
assert_equal(u'Le workflow est testé. 한국어/조선말', wf.description)
assert_equal(self.wf.name, wf.name)
# Change node and save
workflow_dict = workflow_to_dict(self.wf)
workflow_dict['nodes'][2]['name'] = 'new-name'
node_id = workflow_dict['nodes'][2]['id']
workflow_json = json.dumps(workflow_dict)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json})
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(0, test_response_json_object['status'])
node = Node.objects.get(id=node_id)
assert_equal('new-name', node.name)
def test_workflow_save_fail(self):
self.setup_simple_workflow()
# Bad workflow name
workflow_dict = workflow_to_dict(self.wf)
del workflow_dict['name']
workflow_json = json.dumps(workflow_dict)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert_equal(400, response.status_code)
# Bad node name
workflow_dict = workflow_to_dict(self.wf)
del workflow_dict['nodes'][2]['name']
workflow_json = json.dumps(workflow_dict)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert_equal(400, response.status_code)
# Bad control node name should still go through
workflow_dict = workflow_to_dict(self.wf)
del workflow_dict['nodes'][0]['name']
workflow_json = json.dumps(workflow_dict)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert_equal(200, response.status_code)
def test_workflow_add_subworkflow_node(self):
wf = self.create_noop_workflow()
try:
subworkflow_name = "subworkflow-1"
subworkflow_id = "subworkflow:1"
subworkflow_json = """{
"description": "",
"workflow": %(workflow)d,
"child_links": [
{
"comment": "",
"name": "ok",
"parent": "%(id)s",
"child": %(end)d
},
{
"comment": "",
"name": "error",
"parent": "%(id)s",
"child": %(kill)d
}
],
"node_type": "subworkflow",
"sub_workflow": %(subworkflow)d,
"job_properties": "[]",
"name": "%(name)s",
"id": "%(id)s",
"propagate_configuration": true
}"""
subworkflow_json = subworkflow_json % {
'workflow': wf.id,
'subworkflow': self.wf.id,
'end': wf.end.id,
'kill': Kill.objects.get(workflow=wf).id,
'name': subworkflow_name,
'id': subworkflow_id
}
workflow_dict = workflow_to_dict(wf)
workflow_dict['nodes'].append(json.loads(subworkflow_json))
workflow_dict['nodes'][0]['child_links'][1]['child'] = subworkflow_id
del workflow_dict['nodes'][0]['child_links'][1]['id']
workflow_json = json.dumps(workflow_dict)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': wf.pk}), data={'workflow': workflow_json})
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(0, test_response_json_object['status'], workflow_json)
finally:
wf.delete(skip_trash=True)
def test_workflow_add_mapreduce_node(self):
wf = self.create_noop_workflow()
try:
node_name = "mr-1"
node_id = "mapreduce:1"
node_json = """{
"description": "",
"workflow": %(workflow)d,
"child_links": [
{
"comment": "",
"name": "ok",
"parent": "%(id)s",
"child": %(end)d
},
{
"comment": "",
"name": "error",
"parent": "%(id)s",
"child": %(kill)d
}
],
"node_type": "mapreduce",
"jar_path": "test",
"job_properties": "[]",
"files": "[]",
"archives": "[]",
"prepares": "[]",
"name": "%(name)s",
"id": "%(id)s"
}"""
node_json = node_json % {
'workflow': wf.id,
'end': wf.end.id,
'kill': Kill.objects.get(workflow=wf).id,
'name': node_name,
'id': node_id
}
workflow_dict = workflow_to_dict(wf)
workflow_dict['nodes'].append(json.loads(node_json))
workflow_dict['nodes'][0]['child_links'][1]['child'] = node_id
del workflow_dict['nodes'][0]['child_links'][1]['id']
workflow_json = json.dumps(workflow_dict)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': wf.pk}), data={'workflow': workflow_json})
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(0, test_response_json_object['status'], workflow_json)
finally:
wf.delete(skip_trash=True)
def test_workflow(self):
response = self.c.get(reverse('oozie:workflow', kwargs={'workflow': self.wf.pk}))
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(0, test_response_json_object['status'])
def test_workflow_fail(self):
import oozie.views.api
old_method = oozie.views.api._workflow
def exception_method(*args, **kwargs):
logging.error( 'here' )
raise Exception("arg")
oozie.views.api._workflow = exception_method
try:
response = self.c.get(reverse('oozie:workflow', kwargs={'workflow': self.wf.pk}))
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(1, test_response_json_object['status'], test_response_json_object)
assert_equal('arg', test_response_json_object['message'], test_response_json_object)
assert_equal({}, test_response_json_object['details'], test_response_json_object)
finally:
oozie.views.api._workflow = old_method
def test_workflow_validate_node(self):
data = {"files":"[\"hive-site.xml\"]","job_xml":"hive-site.xml","description":"Show databases","workflow":17,"child_links":[{"comment":"","name":"ok","id":106,"parent":76,"child":74},{"comment":"","name":"error","id":107,"parent":76,"child":73}],"job_properties":"[{\"name\":\"oozie.hive.defaults\",\"value\":\"hive-site.xml\"}]","node_type":"hive","params":"[{\"value\":\"INPUT=/user/hue/oozie/workspaces/data\",\"type\":\"param\"}]","archives":"[]","node_ptr":76,"prepares":"[]","script_path":"hive.sql","id":76,"name":"Hive"}
response = self.c.post(reverse('oozie:workflow_validate_node', kwargs={'workflow': self.wf.pk, 'node_type': 'hive'}), data={'node': json.dumps(data)}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(0, test_response_json_object['status'])
assert_true('name' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['name']), test_response_json_object['data'])
assert_true('description' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['description']), test_response_json_object['data'])
assert_true('script_path' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['script_path']), test_response_json_object['data'])
assert_true('job_xml' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['job_xml']), test_response_json_object['data'])
assert_true('job_properties' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['job_properties']), test_response_json_object['data'])
assert_true('files' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['files']), test_response_json_object['data'])
assert_true('params' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['params']), test_response_json_object['data'])
assert_true('prepares' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['prepares']), test_response_json_object['data'])
assert_true('archives' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['archives']), test_response_json_object['data'])
def test_workflow_validate_node_fail(self):
# Empty files field
data = {"job_xml":"hive-site.xml","description":"Show databases","workflow":17,"child_links":[{"comment":"","name":"ok","id":106,"parent":76,"child":74},{"comment":"","name":"error","id":107,"parent":76,"child":73}],"job_properties":"[{\"name\":\"oozie.hive.defaults\",\"value\":\"hive-site.xml\"}]","node_type":"hive","params":"[{\"value\":\"INPUT=/user/hue/oozie/workspaces/data\",\"type\":\"param\"}]","archives":"[]","node_ptr":76,"prepares":"[]","script_path":"hive.sql","id":76,"name":"Hive"}
response = self.c.post(reverse('oozie:workflow_validate_node', kwargs={'workflow': self.wf.pk, 'node_type': 'hive'}), data={'node': json.dumps(data)}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(-1, test_response_json_object['status'])
assert_true('name' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['name']), test_response_json_object['data'])
assert_true('description' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['description']), test_response_json_object['data'])
assert_true('script_path' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['script_path']), test_response_json_object['data'])
assert_true('job_xml' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['job_xml']), test_response_json_object['data'])
assert_true('job_properties' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['job_properties']), test_response_json_object['data'])
assert_true('files' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(1, len(test_response_json_object['data']['files']), test_response_json_object['data'])
assert_true('params' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['params']), test_response_json_object['data'])
assert_true('prepares' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['prepares']), test_response_json_object['data'])
assert_true('archives' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['archives']), test_response_json_object['data'])
# Empty script path
data = {"files":"[\"hive-site.xml\"]","job_xml":"hive-site.xml","description":"Show databases","workflow":17,"child_links":[{"comment":"","name":"ok","id":106,"parent":76,"child":74},{"comment":"","name":"error","id":107,"parent":76,"child":73}],"job_properties":"[{\"name\":\"oozie.hive.defaults\",\"value\":\"hive-site.xml\"}]","node_type":"hive","params":"[{\"value\":\"INPUT=/user/hue/oozie/workspaces/data\",\"type\":\"param\"}]","archives":"[]","node_ptr":76,"prepares":"[]","script_path":"","id":76,"name":"Hive"}
response = self.c.post(reverse('oozie:workflow_validate_node', kwargs={'workflow': self.wf.pk, 'node_type': 'hive'}), data={'node': json.dumps(data)}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(-1, test_response_json_object['status'])
assert_true('name' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['name']), test_response_json_object['data'])
assert_true('description' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['description']), test_response_json_object['data'])
assert_true('script_path' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(1, len(test_response_json_object['data']['script_path']), test_response_json_object['data'])
assert_true('job_xml' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['job_xml']), test_response_json_object['data'])
assert_true('job_properties' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['job_properties']), test_response_json_object['data'])
assert_true('files' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['files']), test_response_json_object['data'])
assert_true('params' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['params']), test_response_json_object['data'])
assert_true('prepares' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['prepares']), test_response_json_object['data'])
assert_true('archives' in test_response_json_object['data'], test_response_json_object['data'])
assert_equal(0, len(test_response_json_object['data']['archives']), test_response_json_object['data'])
def test_workflows(self):
response = self.c.get(reverse('oozie:workflows') + "?managed=true", HTTP_X_REQUESTED_WITH='XMLHttpRequest')
response_json_dict = json.loads(response.content)
assert_equal(0, response_json_dict['status'])
assert_equal(1, len(response_json_dict['data']['workflows']))
response = self.c.get(reverse('oozie:workflows') + "?managed=false", HTTP_X_REQUESTED_WITH='XMLHttpRequest')
response_json_dict = json.loads(response.content)
assert_equal(0, response_json_dict['status'])
assert_equal(0, len(response_json_dict['data']['workflows']))
def test_workflows_fail(self):
# Insert an exception
import oozie.utils
old_method = oozie.utils.model_to_dict
def exception_method(*args, **kwargs):
raise Exception("arg")
oozie.utils.model_to_dict = exception_method
try:
response = self.c.post(reverse('oozie:workflows') + "?managed=true", HTTP_X_REQUESTED_WITH='XMLHttpRequest')
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(1, test_response_json_object['status'], test_response_json_object)
assert_equal("Must be GET request.", test_response_json_object['message'], test_response_json_object)
assert_equal({}, test_response_json_object['details'], test_response_json_object)
finally:
oozie.utils.model_to_dict = old_method
def test_workflow_actions(self):
response = self.c.get(reverse('oozie:workflow_actions', kwargs={'workflow': self.wf.pk}), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
response_json_dict = json.loads(response.content)
assert_equal(0, response_json_dict['status'])
assert_equal(0, len(response_json_dict['data']['actions']))
self.setup_simple_workflow()
response = self.c.get(reverse('oozie:workflow_actions', kwargs={'workflow': self.wf.pk}), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
response_json_dict = json.loads(response.content)
assert_equal(0, response_json_dict['status'])
assert_equal(3, len(response_json_dict['data']['actions']))
def test_workflow_actions_fail(self):
# Insert an exception
import oozie.utils
old_method = oozie.utils.model_to_dict
def exception_method(*args, **kwargs):
raise Exception("arg")
oozie.utils.model_to_dict = exception_method
try:
response = self.c.post(reverse('oozie:workflow_actions', kwargs={'workflow': self.wf.pk}), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(1, test_response_json_object['status'], test_response_json_object)
assert_equal("Must be GET request.", test_response_json_object['message'], test_response_json_object)
assert_equal({}, test_response_json_object['details'], test_response_json_object)
finally:
oozie.utils.model_to_dict = old_method
def test_autocomplete(self):
response = self.c.get(reverse('oozie:autocomplete_properties'))
test_response_json = response.content
assert_true('mapred.input.dir' in test_response_json)
class TestApiPermissionsWithOozie(OozieBase):
def setUp(self):
raise SkipTest # Need to move to v2
OozieBase.setUp(self)
# When updating wf, update wf_json as well!
self.wf = Workflow.objects.get(name='MapReduce', managed=True).clone(self.cluster.fs, self.user)
def test_workflow_save(self):
# Share
self.wf.is_shared = True
self.wf.save()
Workflow.objects.check_workspace(self.wf, self.cluster.fs)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
grant_access("not_me", "test", "oozie")
workflow_dict = workflow_to_dict(self.wf)
workflow_json = json.dumps(workflow_dict)
response = client_not_me.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert_equal(401, response.status_code, response.status_code)
response = self.c.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(200, response.status_code, response)
assert_equal(0, test_response_json_object['status'])
def test_workflow_save_fail(self):
# Unshare
self.wf.is_shared = False
self.wf.save()
Workflow.objects.check_workspace(self.wf, self.cluster.fs)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
grant_access("not_me", "test", "oozie")
workflow_dict = workflow_to_dict(self.wf)
del workflow_dict['name']
workflow_json = json.dumps(workflow_dict)
response = client_not_me.post(reverse('oozie:workflow_save', kwargs={'workflow': self.wf.pk}), data={'workflow': workflow_json}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert_equal(401, response.status_code, response)
def test_workflow(self):
# Share
self.wf.is_shared = True
self.wf.doc.get().share_to_default()
self.wf.save()
Workflow.objects.check_workspace(self.wf, self.cluster.fs)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='default', recreate=True)
grant_access("not_me", "test", "oozie")
response = client_not_me.get(reverse('oozie:workflow', kwargs={'workflow': self.wf.pk}), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
test_response_json = response.content
test_response_json_object = json.loads(test_response_json)
assert_equal(200, response.status_code, response)
assert_equal(0, test_response_json_object['status'])
def test_workflow_fail(self):
# Unshare
self.wf.is_shared = False
self.wf.save()
Workflow.objects.check_workspace(self.wf, self.cluster.fs)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
grant_access("not_me", "test", "oozie")
response = client_not_me.get(reverse('oozie:workflow', kwargs={'workflow': self.wf.pk}), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert_equal(401, response.status_code)
class TestEditor(OozieMockBase):
def setUp(self):
super(TestEditor, self).setUp()
self.setup_simple_workflow()
def test_workflow_name(self):
try:
workflow_dict = WORKFLOW_DICT.copy()
workflow_count = Document.objects.available_docs(Workflow, self.user).count()
workflow_dict['name'][0] = 'bad workflow name'
response = self.c.post(reverse('oozie:create_workflow'), workflow_dict, follow=True)
assert_equal(200, response.status_code)
assert_equal(workflow_count, Document.objects.available_docs(Workflow, self.user).count(), response)
workflow_dict['name'][0] = 'good-workflow-name'
response = self.c.post(reverse('oozie:create_workflow'), workflow_dict, follow=True)
assert_equal(200, response.status_code)
assert_equal(workflow_count + 1, Document.objects.available_docs(Workflow, self.user).count(), response)
finally:
name = 'bad workflow name'
if Workflow.objects.filter(name=name).exists():
Node.objects.filter(workflow__name=name).delete()
Workflow.objects.filter(name=name).delete()
name = 'good-workflow-name'
if Workflow.objects.filter(name=name).exists():
Node.objects.filter(workflow__name=name).delete()
Workflow.objects.filter(name=name).delete()
def test_find_parameters(self):
data = json.dumps({'sla': [
{'key': 'enabled', 'value': True},
{'key': 'nominal-time', 'value': '${time}'},]}
)
jobs = [Job(name="$a"),
Job(name="foo ${b} $$"),
Job(name="${foo}", description="xxx ${food}", data=data)]
result = [find_parameters(job, ['name', 'description', 'sla']) for job in jobs]
assert_equal(set(["b", "foo", "food", "time"]), reduce(lambda x, y: x | set(y), result, set()))
def test_find_all_parameters(self):
self.wf.data = json.dumps({'sla': [
{'key': 'enabled', 'value': False},
{'key': 'nominal-time', 'value': '${time}'},]}
)
assert_equal([{'name': u'output', 'value': u''}, {'name': u'SLEEP', 'value': ''}, {'name': u'market', 'value': u'US'}],
self.wf.find_all_parameters())
self.wf.data = json.dumps({'sla': [
{'key': 'enabled', 'value': True},
{'key': 'nominal-time', 'value': '${time}'},]}
)
assert_equal([{'name': u'output', 'value': u''}, {'name': u'SLEEP', 'value': ''}, {'name': u'market', 'value': u'US'}, {'name': u'time', 'value': u''}],
self.wf.find_all_parameters())
def test_workflow_has_cycle(self):
action1 = Node.objects.get(workflow=self.wf, name='action-name-1')
action3 = Node.objects.get(workflow=self.wf, name='action-name-3')
assert_false(self.wf.has_cycle())
ok = action3.get_link('ok')
ok.child = action1
ok.save()
assert_true(self.wf.has_cycle())
def test_workflow_gen_xml(self):
assert_equal(
'<workflow-app name="wf-name-1" xmlns="uri:oozie:workflow:0.4">\n'
' <global>\n'
' <job-xml>jobconf.xml</job-xml>\n'
' <configuration>\n'
' <property>\n'
' <name>sleep-all</name>\n'
' <value>${SLEEP}</value>\n'
' </property>\n'
' </configuration>\n'
' </global>\n'
' <start to="action-name-1"/>\n'
' <action name="action-name-1">\n'
' <map-reduce>\n'
' <job-tracker>${jobTracker}</job-tracker>\n'
' <name-node>${nameNode}</name-node>\n'
' <prepare>\n'
' <delete path="${nameNode}${output}"/>\n'
' <mkdir path="${nameNode}/test"/>\n'
' </prepare>\n'
' <configuration>\n'
' <property>\n'
' <name>sleep</name>\n'
' <value>${SLEEP}</value>\n'
' </property>\n'
' </configuration>\n'
' </map-reduce>\n'
' <ok to="action-name-2"/>\n'
' <error to="kill"/>\n'
' </action>\n'
' <action name="action-name-2">\n'
' <map-reduce>\n'
' <job-tracker>${jobTracker}</job-tracker>\n'
' <name-node>${nameNode}</name-node>\n'
' <prepare>\n'
' <delete path="${nameNode}${output}"/>\n'
' <mkdir path="${nameNode}/test"/>\n'
' </prepare>\n'
' <configuration>\n'
' <property>\n'
' <name>sleep</name>\n'
' <value>${SLEEP}</value>\n'
' </property>\n'
' </configuration>\n'
' </map-reduce>\n'
' <ok to="action-name-3"/>\n'
' <error to="kill"/>\n'
' </action>\n'
' <action name="action-name-3">\n'
' <map-reduce>\n'
' <job-tracker>${jobTracker}</job-tracker>\n'
' <name-node>${nameNode}</name-node>\n'
' <prepare>\n'
' <delete path="${nameNode}${output}"/>\n'
' <mkdir path="${nameNode}/test"/>\n'
' </prepare>\n'
' <configuration>\n'
' <property>\n'
' <name>sleep</name>\n'
' <value>${SLEEP}</value>\n'
' </property>\n'
' </configuration>\n'
' </map-reduce>\n'
' <ok to="end"/>\n'
' <error to="kill"/>\n'
' </action>\n'
' <kill name="kill">\n'
' <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>\n'
' </kill>\n'
' <end name="end"/>\n'
'</workflow-app>'.split(), self.wf.to_xml({'output': '/path'}).split())
def test_workflow_java_gen_xml(self):
self.wf.node_set.filter(name='action-name-1').delete()
action1 = add_node(self.wf, 'action-name-1', 'java', [self.wf.start], {
u'name': 'MyTeragen',
"description":"Generate N number of records",
"main_class":"org.apache.hadoop.examples.terasort.TeraGen",
"args":"1000 ${output_dir}/teragen",
"files":'["my_file","my_file2"]',
"job_xml":"",
"java_opts":"-Dexample-property=natty",
"jar_path":"/user/hue/oozie/workspaces/lib/hadoop-examples.jar",
"prepares":'[{"value":"/test","type":"mkdir"}]',
"archives":'[{"dummy":"","name":"my_archive"},{"dummy":"","name":"my_archive2"}]',
"capture_output": True,
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml({'output_dir': '/path'})
assert_true("""
<action name="MyTeragen">
<java>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<mkdir path="${nameNode}/test"/>
</prepare>
<main-class>org.apache.hadoop.examples.terasort.TeraGen</main-class>
<java-opts>-Dexample-property=natty</java-opts>
<arg>1000</arg>
<arg>${output_dir}/teragen</arg>
<file>my_file#my_file</file>
<file>my_file2#my_file2</file>
<archive>my_archive#my_archive</archive>
<archive>my_archive2#my_archive2</archive>
<capture-output/>
</java>
<ok to="end"/>
<error to="kill"/>
</action>""" in xml, xml)
def test_workflow_streaming_gen_xml(self):
self.wf.node_set.filter(name='action-name-1').delete()
action1 = add_node(self.wf, 'action-name-1', 'streaming', [self.wf.start], {
u'name': 'MyStreaming',
"description": "Generate N number of records",
"main_class": "org.apache.hadoop.examples.terasort.TeraGen",
"mapper": "MyMapper",
"reducer": "MyReducer",
"files": '["my_file"]',
"archives":'[{"dummy":"","name":"my_archive"}]',
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml()
assert_true("""
<action name="MyStreaming">
<map-reduce>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<streaming>
<mapper>MyMapper</mapper>
<reducer>MyReducer</reducer>
</streaming>
<file>my_file#my_file</file>
<archive>my_archive#my_archive</archive>
</map-reduce>
<ok to="end"/>
<error to="kill"/>
</action>""" in xml, xml)
def test_workflow_shell_gen_xml(self):
self.wf.node_set.filter(name='action-name-1').delete()
action1 = add_node(self.wf, 'action-name-1', 'shell', [self.wf.start], {
u'job_xml': 'my-job.xml',
u'files': '["hello.py"]',
u'name': 'Shell',
u'job_properties': '[]',
u'capture_output': True,
u'command': 'hello.py',
u'archives': '[]',
u'prepares': '[]',
u'params': '[{"value":"World!","type":"argument"}]',
u'description': 'Execute a Python script printing its arguments'
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml()
assert_true("""
<shell xmlns="uri:oozie:shell-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>my-job.xml</job-xml>
<exec>hello.py</exec>
<argument>World!</argument>
<file>hello.py#hello.py</file>
<capture-output/>
</shell>""" in xml, xml)
action1.capture_output = False
action1.save()
xml = self.wf.to_xml()
assert_true("""
<shell xmlns="uri:oozie:shell-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>my-job.xml</job-xml>
<exec>hello.py</exec>
<argument>World!</argument>
<file>hello.py#hello.py</file>
</shell>""" in xml, xml)
def test_workflow_fs_gen_xml(self):
self.wf.node_set.filter(name='action-name-1').delete()
action1 = add_node(self.wf, 'action-name-1', 'fs', [self.wf.start], {
u'name': 'MyFs',
u'description': 'Execute a Fs action that manage files',
u'deletes': '[{"name":"/to/delete"},{"name":"to/delete2"}]',
u'mkdirs': '[{"name":"/to/mkdir"},{"name":"${mkdir2}"}]',
u'moves': '[{"source":"/to/move/source","destination":"/to/move/destination"},{"source":"/to/move/source2","destination":"/to/move/destination2"}]',
u'chmods': '[{"path":"/to/chmod","recursive":true,"permissions":"-rwxrw-rw-"},{"path":"/to/chmod2","recursive":false,"permissions":"755"}]',
u'touchzs': '[{"name":"/to/touchz"},{"name":"/to/touchz2"}]'
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml({'mkdir2': '/path'})
assert_true("""
<action name="MyFs">
<fs>
<delete path='${nameNode}/to/delete'/>
<delete path='${nameNode}/user/${wf:user()}/to/delete2'/>
<mkdir path='${nameNode}/to/mkdir'/>
<mkdir path='${nameNode}${mkdir2}'/>
<move source='${nameNode}/to/move/source' target='${nameNode}/to/move/destination'/>
<move source='${nameNode}/to/move/source2' target='${nameNode}/to/move/destination2'/>
<chmod path='${nameNode}/to/chmod' permissions='-rwxrw-rw-' dir-files='true'/>
<chmod path='${nameNode}/to/chmod2' permissions='755' dir-files='false'/>
<touchz path='${nameNode}/to/touchz'/>
<touchz path='${nameNode}/to/touchz2'/>
</fs>
<ok to="end"/>
<error to="kill"/>
</action>""" in xml, xml)
def test_workflow_email_gen_xml(self):
self.wf.node_set.filter(name='action-name-1').delete()
action1 = add_node(self.wf, 'action-name-1', 'email', [self.wf.start], {
u'name': 'MyEmail',
u'description': 'Execute an Email action',
u'to': 'hue@hue.org,django@python.org',
u'cc': '',
u'subject': 'My subject',
u'body': 'My body'
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml()
assert_true("""
<action name="MyEmail">
<email xmlns="uri:oozie:email-action:0.1">
<to>hue@hue.org,django@python.org</to>
<subject>My subject</subject>
<body>My body</body>
</email>
<ok to="end"/>
<error to="kill"/>
</action>""" in xml, xml)
action1.cc = 'lambda@python.org'
action1.save()
xml = self.wf.to_xml()
assert_true("""
<action name="MyEmail">
<email xmlns="uri:oozie:email-action:0.1">
<to>hue@hue.org,django@python.org</to>
<cc>lambda@python.org</cc>
<subject>My subject</subject>
<body>My body</body>
</email>
<ok to="end"/>
<error to="kill"/>
</action>""" in xml, xml)
def test_workflow_subworkflow_gen_xml(self):
self.wf.node_set.filter(name='action-name-1').delete()
wf_dict = WORKFLOW_DICT.copy()
wf_dict['name'] = [u'wf-name-2']
wf2 = create_workflow(self.c, self.user, wf_dict)
action1 = add_node(self.wf, 'action-name-1', 'subworkflow', [self.wf.start], {
u'name': 'MySubworkflow',
u'description': 'Execute a subworkflow action',
u'sub_workflow': wf2,
u'propagate_configuration': True,
u'job_properties': '[{"value":"World!","name":"argument"}]'
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml()
assert_true(re.search(
'<sub-workflow>\W+'
'<app-path>\${nameNode}/user/hue/oozie/workspaces/_test_-oozie-(.+?)</app-path>\W+'
'<propagate-configuration/>\W+'
'<configuration>\W+'
'<property>\W+'
'<name>argument</name>\W+'
'<value>World!</value>\W+'
'</property>\W+'
'</configuration>\W+'
'</sub-workflow>', xml, re.MULTILINE), xml)
wf2.delete(skip_trash=True)
def test_workflow_flatten_list(self):
if is_live_cluster():
raise SkipTest('HUE-2899: Needs to make results in a consistent order')
assert_equal('[<Start: start>, <Mapreduce: action-name-1>, <Mapreduce: action-name-2>, <Mapreduce: action-name-3>, '
'<Kill: kill>, <End: end>]',
str(self.wf.node_list))
# 1 2
# 3
self.setup_forking_workflow()
assert_equal('[<Start: start>, <Fork: fork-name-1>, <Mapreduce: action-name-1>, <Mapreduce: action-name-2>, '
'<Join: join-name-1>, <Mapreduce: action-name-3>, <Kill: kill>, <End: end>]',
str(self.wf.node_list))
def test_workflow_generic_gen_xml(self):
self.wf.node_set.filter(name='action-name-1').delete()
action1 = add_node(self.wf, 'action-name-1', 'generic', [self.wf.start], {
u'name': 'Generic',
u'description': 'Execute a Generic email action',
u'xml': """
<email xmlns="uri:oozie:email-action:0.1">
<to>hue@hue.org,django@python.org</to>
<subject>My subject</subject>
<body>My body</body>
</email>""",
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml()
assert_true("""
<action name="Generic">
<email xmlns="uri:oozie:email-action:0.1">
<to>hue@hue.org,django@python.org</to>
<subject>My subject</subject>
<body>My body</body>
</email>
<ok to="end"/>
<error to="kill"/>
</action>""" in xml, xml)
def test_workflow_hive_gen_xml(self):
self.wf.node_set.filter(name='action-name-1').delete()
action1 = add_node(self.wf, 'action-name-1', 'hive', [self.wf.start], {
u'job_xml': 'my-job.xml',
u'files': '["hello.py"]',
u'name': 'MyHive',
u'job_properties': '[]',
u'script_path': 'hello.sql',
u'archives': '[]',
u'prepares': '[]',
u'params': '[{"value":"World!","type":"argument"}]',
u'description': ''
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml()
assert_true("""
<workflow-app name="wf-name-1" xmlns="uri:oozie:workflow:0.4">
<global>
<job-xml>jobconf.xml</job-xml>
<configuration>
<property>
<name>sleep-all</name>
<value>${SLEEP}</value>
</property>
</configuration>
</global>
<start to="MyHive"/>
<action name="MyHive">
<hive xmlns="uri:oozie:hive-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>my-job.xml</job-xml>
<script>hello.sql</script>
<argument>World!</argument>
<file>hello.py#hello.py</file>
</hive>
<ok to="end"/>
<error to="kill"/>
</action>
<kill name="kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>""" in xml, xml)
import beeswax
from beeswax.tests import hive_site_xml
tmpdir = tempfile.mkdtemp()
saved = None
try:
# We just replace the Beeswax conf variable
class Getter(object):
def get(self):
return tmpdir
xml = hive_site_xml(is_local=False, use_sasl=True, kerberos_principal='hive/_HOST@test.com')
file(os.path.join(tmpdir, 'hive-site.xml'), 'w').write(xml)
beeswax.hive_site.reset()
saved = beeswax.conf.HIVE_CONF_DIR
beeswax.conf.HIVE_CONF_DIR = Getter()
action1 = Node.objects.get(workflow=self.wf, name='MyHive')
action1.credentials = [{'name': 'hcat', 'value': True}, {'name': 'hbase', 'value': False}, {'name': 'hive2', 'value': True}]
action1.save()
xml = self.wf.to_xml(mapping={
'credentials': {
'hcat': {
'xml_name': 'hcat',
'properties': [
('hcat.metastore.uri', 'thrift://hue-koh-chang:9999'),
('hcat.metastore.principal', 'hive')
]
},
'hive2': {
'xml_name': 'hive2',
'properties': [
('hive2.jdbc.url', 'jdbc:hive2://hue-koh-chang:8888'),
('hive2.server.principal', 'hive')
]
}
}
}
)
assert_true("""
<workflow-app name="wf-name-1" xmlns="uri:oozie:workflow:0.4">
<global>
<job-xml>jobconf.xml</job-xml>
<configuration>
<property>
<name>sleep-all</name>
<value>${SLEEP}</value>
</property>
</configuration>
</global>
<credentials>
<credential name="hcat" type="hcat">
<property>
<name>hcat.metastore.uri</name>
<value>thrift://hue-koh-chang:9999</value>
</property>
<property>
<name>hcat.metastore.principal</name>
<value>hive</value>
</property>
</credential>
<credential name="hive2" type="hive2">
<property>
<name>hive2.jdbc.url</name>
<value>jdbc:hive2://hue-koh-chang:8888</value>
</property>
<property>
<name>hive2.server.principal</name>
<value>hive</value>
</property>
</credential>
</credentials>
<start to="MyHive"/>
<action name="MyHive" cred="hcat,hive2">
<hive xmlns="uri:oozie:hive-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>my-job.xml</job-xml>
<script>hello.sql</script>
<argument>World!</argument>
<file>hello.py#hello.py</file>
</hive>
<ok to="end"/>
<error to="kill"/>
</action>
<kill name="kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>""" in xml, xml)
# Test when no credentials are checked
action1.credentials = [{'name': 'hcat', 'value': False}, {'name': 'hbase', 'value': False}, {'name': 'hive2', 'value': False}]
action1.save()
xml = self.wf.to_xml()
assert_true("""
<workflow-app name="wf-name-1" xmlns="uri:oozie:workflow:0.4">
<global>
<job-xml>jobconf.xml</job-xml>
<configuration>
<property>
<name>sleep-all</name>
<value>${SLEEP}</value>
</property>
</configuration>
</global>
<start to="MyHive"/>
<action name="MyHive">
<hive xmlns="uri:oozie:hive-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>my-job.xml</job-xml>
<script>hello.sql</script>
<argument>World!</argument>
<file>hello.py#hello.py</file>
</hive>
<ok to="end"/>
<error to="kill"/>
</action>
<kill name="kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>""" in xml, xml)
finally:
beeswax.hive_site.reset()
if saved is not None:
beeswax.conf.HIVE_CONF_DIR = saved
shutil.rmtree(tmpdir)
self.wf.node_set.filter(name='action-name-1').delete()
def test_workflow_gen_workflow_sla(self):
xml = self.wf.to_xml({'output': '/path'})
assert_false('<sla' in xml, xml)
assert_false('xmlns="uri:oozie:workflow:0.5"' in xml, xml)
assert_false('xmlns:sla="uri:oozie:sla:0.2"' in xml, xml)
sla = self.wf.sla
sla[0]['value'] = True
sla[1]['value'] = 'now' # nominal-time
sla[3]['value'] = '${ 10 * MINUTES}' # should-end
self.wf.sla = sla
self.wf.save()
xml = self.wf.to_xml({'output': '/path'})
assert_true('xmlns="uri:oozie:workflow:0.5"' in xml, xml)
assert_true('xmlns:sla="uri:oozie:sla:0.2"' in xml, xml)
assert_true("""<end name="end"/>
<sla:info>
<sla:nominal-time>now</sla:nominal-time>
<sla:should-end>${ 10 * MINUTES}</sla:should-end>
</sla:info>
</workflow-app>""" in xml, xml)
def test_workflow_gen_action_sla(self):
xml = self.wf.to_xml({'output': '/path'})
assert_false('<sla' in xml, xml)
assert_false('xmlns="uri:oozie:workflow:0.5"' in xml, xml)
assert_false('xmlns:sla="uri:oozie:sla:0.2"' in xml, xml)
self.wf.node_set.filter(name='action-name-1').delete()
action1 = add_node(self.wf, 'action-name-1', 'hive', [self.wf.start], {
u'job_xml': 'my-job.xml',
u'files': '["hello.py"]',
u'name': 'MyHive',
u'job_properties': '[]',
u'script_path': 'hello.sql',
u'archives': '[]',
u'prepares': '[]',
u'params': '[{"value":"World!","type":"argument"}]',
u'description': ''
})
Link(parent=action1, child=self.wf.end, name="ok").save()
xml = self.wf.to_xml()
sla = action1.sla
sla[0]['value'] = True
sla[1]['value'] = 'now' # nominal-time
sla[3]['value'] = '${ 10 * MINUTES}' # should-end
action1.sla = sla
action1.save()
xml = self.wf.to_xml({'output': '/path'})
assert_true('xmlns="uri:oozie:workflow:0.5"' in xml, xml)
assert_true('xmlns:sla="uri:oozie:sla:0.2"' in xml, xml)
assert_true("""<error to="kill"/>
<sla:info>
<sla:nominal-time>now</sla:nominal-time>
<sla:should-end>${ 10 * MINUTES}</sla:should-end>
</sla:info>
</action>""" in xml, xml)
def test_create_coordinator(self):
create_coordinator(self.wf, self.c, self.user)
def test_clone_coordinator(self):
#@TODO@ Prakash fix this test
raise SkipTest
coord = create_coordinator(self.wf, self.c, self.user)
coordinator_count = Document.objects.available_docs(Coordinator, self.user).count()
response = self.c.post(reverse('oozie:clone_coordinator', args=[coord.id]), {}, follow=True)
coord2 = Coordinator.objects.latest('id')
assert_not_equal(coord.id, coord2.id)
assert_equal(coordinator_count + 1, Document.objects.available_docs(Coordinator, self.user).count(), response)
assert_equal(coord.dataset_set.count(), coord2.dataset_set.count())
assert_equal(coord.datainput_set.count(), coord2.datainput_set.count())
assert_equal(coord.dataoutput_set.count(), coord2.dataoutput_set.count())
ds_ids = set(coord.dataset_set.values_list('id', flat=True))
for node in coord2.dataset_set.all():
assert_false(node.id in ds_ids)
data_input_ids = set(coord.datainput_set.values_list('id', flat=True))
for node in coord2.datainput_set.all():
assert_false(node.id in data_input_ids)
data_output_ids = set(coord.dataoutput_set.values_list('id', flat=True))
for node in coord2.dataoutput_set.all():
assert_false(node.id in data_output_ids)
assert_not_equal(coord.deployment_dir, coord2.deployment_dir)
assert_not_equal('', coord2.deployment_dir)
# Bulk delete
response = self.c.post(reverse('oozie:delete_coordinator'), {'job_selection': [coord.id, coord2.id]}, follow=True)
assert_equal(coordinator_count - 1, Document.objects.available_docs(Coordinator, self.user).count(), response)
def test_coordinator_workflow_access_permissions(self):
raise SkipTest
self.wf.is_shared = True
self.wf.save()
# Login as someone else not superuser
client_another_me = make_logged_in_client(username='another_me', is_superuser=False, groupname='test')
grant_access("another_me", "test", "oozie")
coord = create_coordinator(self.wf, client_another_me, self.user)
response = client_another_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_true('Editor' in response.content, response.content)
assert_true('Save coordinator' in response.content, response.content)
# Check can schedule a non personal/shared workflow
workflow_select = '%s</option>' % self.wf
response = client_another_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_true(workflow_select in response.content, response.content)
self.wf.is_shared = False
self.wf.save()
response = client_another_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_false(workflow_select in response.content, response.content)
self.wf.is_shared = True
self.wf.save()
# Edit
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_another_me.post(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_true(workflow_select in response.content, response.content)
assert_true('Save coordinator' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_another_me.post(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_true('This field is required' in response.content, response.content)
assert_false(workflow_select in response.content, response.content)
assert_true('Save coordinator' in response.content, response.content)
finally:
finish()
def test_coordinator_gen_xml(self):
coord = create_coordinator(self.wf, self.c, self.user)
finish = ENABLE_CRON_SCHEDULING.set_for_testing(False)
try:
assert_true(
"""<controls>
<timeout>100</timeout>
<concurrency>3</concurrency>
<execution>FIFO</execution>
<throttle>10</throttle>
</controls>
<action>
<workflow>
<app-path>${wf_application_path}</app-path>
<configuration>
<property>
<name>username</name>
<value>${coord:user()}</value>
</property>
<property>
<name>SLEEP</name>
<value>1000</value>
</property>
<property>
<name>market</name>
<value>US</value>
</property>
</configuration>
</workflow>
</action>
</coordinator-app>""" in coord.to_xml(), coord.to_xml())
finally:
finish()
assert_true(
"""<controls>
<timeout>100</timeout>
<concurrency>3</concurrency>
<execution>FIFO</execution>
<throttle>10</throttle>
</controls>
<action>
<workflow>
<app-path>${wf_application_path}</app-path>
<configuration>
<property>
<name>username</name>
<value>${coord:user()}</value>
</property>
<property>
<name>SLEEP</name>
<value>1000</value>
</property>
<property>
<name>market</name>
<value>US</value>
</property>
</configuration>
</workflow>
</action>
</coordinator-app>""" in coord.to_xml(), coord.to_xml())
def test_coordinator_gen_sla(self):
coord = create_coordinator(self.wf, self.c, self.user)
xml = coord.to_xml()
assert_false('<sla' in xml, xml)
assert_false('xmlns="uri:oozie:coordinator:0.4"' in xml, xml)
assert_false('xmlns:sla="uri:oozie:sla:0.2"' in xml, xml)
sla = coord.sla
sla[0]['value'] = True
sla[1]['value'] = 'now' # nominal-time
sla[3]['value'] = '${ 10 * MINUTES}' # should-end
coord.sla = sla
coord.save()
xml = coord.to_xml()
assert_true('xmlns="uri:oozie:coordinator:0.4"' in xml, xml)
assert_true('xmlns:sla="uri:oozie:sla:0.2"' in xml, xml)
assert_true("""</workflow>
<sla:info>
<sla:nominal-time>now</sla:nominal-time>
<sla:should-end>${ 10 * MINUTES}</sla:should-end>
</sla:info>
</action>""" in xml, xml)
def test_coordinator_with_data_input_gen_xml(self):
coord = create_coordinator(self.wf, self.c, self.user)
create_dataset(coord, self.c)
create_coordinator_data(coord, self.c)
self.c.post(reverse('oozie:create_coordinator_dataset', args=[coord.id]), {
u'create-name': [u'MyDataset2'], u'create-frequency_number': [u'1'], u'create-frequency_unit': [u'days'],
u'create-uri': [u's3n://a-server/data/out/${YEAR}${MONTH}${DAY}'],
u'create-instance_choice': [u'single'],
u'instance_start': [u'-1'],
u'create-advanced_start_instance': [u'0'],
u'create-advanced_end_instance': [u'0'],
u'create-start_0': [u'07/01/2012'], u'create-start_1': [u'12:00 AM'],
u'create-timezone': [u'America/Los_Angeles'], u'create-done_flag': [u''],
u'create-description': [u'']})
dataset = Dataset.objects.filter(coordinator=coord).order_by('-id')[0]
self.c.post(reverse('oozie:create_coordinator_data', args=[coord.id, 'output']),
{u'output-name': [u'output_dir'], u'output-dataset': [dataset.id]})
assert_true(
"""<uri-template>s3n://a-server/data/out/${YEAR}${MONTH}${DAY}</uri-template>
<done-flag></done-flag>
</dataset>
</datasets>
<input-events>
<data-in name="input_dir" dataset="MyDataset">
<start-instance>
${coord:current(-1)}
</start-instance>
<end-instance>
${coord:current(1)}
</end-instance>
</data-in>
</input-events>
<output-events>
<data-out name="output_dir" dataset="MyDataset2">
<instance>${coord:current(0)}</instance>
</data-out>
</output-events>
<action>
<workflow>
<app-path>${wf_application_path}</app-path>
<configuration>
<property>
<name>input_dir</name>
<value>${coord:dataIn('input_dir')}</value>
</property>
<property>
<name>output_dir</name>
<value>${coord:dataOut('output_dir')}</value>
</property>
<property>
<name>username</name>
<value>${coord:user()}</value>
</property>
<property>
<name>SLEEP</name>
<value>1000</value>
</property>
<property>
<name>market</name>
<value>US</value>
</property>
</configuration>
</workflow>
</action>
</coordinator-app>""" in coord.to_xml(), coord.to_xml())
def test_create_coordinator_dataset(self):
coord = create_coordinator(self.wf, self.c, self.user)
create_dataset(coord, self.c)
def test_edit_coordinator_dataset(self):
coord = create_coordinator(self.wf, self.c, self.user)
create_dataset(coord, self.c)
dataset = Dataset.objects.get(coordinator=coord)
response = self.c.post(reverse('oozie:edit_coordinator_dataset', args=[dataset.id]), {
u'edit-name': [u'MyDataset'], u'edit-frequency_number': [u'1'], u'edit-frequency_unit': [u'days'],
u'edit-uri': [u'/data/${YEAR}${MONTH}${DAY}'],
u'edit-start_0': [u'07/01/2012'], u'edit-start_1': [u'12:00 AM'],
u'edit-instance_choice': [u'range'],
u'edit-advanced_start_instance': [u'-1'],
u'edit-advanced_end_instance': [u'${coord:current(1)}'],
u'edit-start_0': [u'07/01/2012'], u'edit-start_1': [u'12:00 AM'],
u'edit-timezone': [u'America/Los_Angeles'], u'edit-done_flag': [u''],
u'edit-description': [u'']}, follow=True)
data = json.loads(response.content)
assert_equal(0, data['status'], data['status'])
def test_create_coordinator_input_data(self):
coord = create_coordinator(self.wf, self.c, self.user)
create_dataset(coord, self.c)
create_coordinator_data(coord, self.c)
def test_install_examples(self):
self.c.post(reverse('oozie:install_examples'))
def test_workflow_prepare(self):
action1 = Node.objects.get(workflow=self.wf, name='action-name-1').get_full_node()
action1.prepares = json.dumps([
{"type": "delete","value": "${output}"},
{"type": "delete","value": "out"},
{"type": "delete","value": "/user/test/out"},
{"type": "delete","value": "hdfs://localhost:8020/user/test/out"}])
action1.save()
xml = self.wf.to_xml({'output': '/path'})
assert_true('<delete path="${nameNode}${output}"/>' in xml, xml)
assert_true('<delete path="${nameNode}/user/${wf:user()}/out"/>' in xml, xml)
assert_true('<delete path="${nameNode}/user/test/out"/>' in xml, xml)
assert_true('<delete path="hdfs://localhost:8020/user/test/out"/>' in xml, xml)
def test_get_workflow_parameters(self):
assert_equal([{'name': u'output', 'value': ''}, {'name': u'SLEEP', 'value': ''}, {'name': u'market', 'value': u'US'}],
self.wf.find_all_parameters())
def test_get_coordinator_parameters(self):
coord = create_coordinator(self.wf, self.c, self.user)
create_dataset(coord, self.c)
create_coordinator_data(coord, self.c)
assert_equal([{'name': u'output', 'value': ''}, {'name': u'market', 'value': u'US'}],
coord.find_all_parameters())
def test_workflow_data_binds(self):
response = self.c.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
assert_equal(1, response.content.count('checked: is_shared'), response.content)
assert_true('checked: capture_output' in response.content, response.content)
def test_xss_escape_js(self):
hacked = '[{"name":"oozie.use.system.libpath","value":"true"}, {"name": "123\\"><script>alert(1)</script>", "value": "\'hacked\'"}]'
escaped = '[{"name": "oozie.use.system.libpath", "value": "true"}, {"name": "123\\"\\u003e\\u003cscript\\u003ealert(1)\\u003c/script\\u003e", "value": "\'hacked\'"}]'
self.wf.job_properties = hacked
self.wf.parameters = hacked
assert_equal(escaped, self.wf._escapejs_parameters_list(hacked))
assert_equal(escaped, self.wf.job_properties_escapejs)
assert_equal(escaped, self.wf.parameters_escapejs)
def test_xss_html_escaping(self):
data = WORKFLOW_DICT.copy()
data['description'] = [u'"><script>alert(1);</script>']
self.wf = create_workflow(self.c, self.user, workflow_dict=data)
resp = self.c.get('/oozie/list_workflows/')
assert_false('"><script>alert(1);</script>' in resp.content, resp.content)
assert_true('"><script>alert(1);</script>' in resp.content, resp.content)
def test_submit_workflow(self):
# Check param popup
response = self.c.get(reverse('oozie:submit_workflow', args=[self.wf.id]))
assert_equal([{'name': u'output', 'value': ''},
{'name': u'SLEEP', 'value': ''},
{'name': u'market', 'value': u'US'}
],
response.context[0]['params_form'].initial)
def test_submit_coordinator(self):
coord = create_coordinator(self.wf, self.c, self.user)
# Check param popup, SLEEP is set by coordinator so not shown in the popup
response = self.c.get(reverse('oozie:submit_coordinator', args=[coord.id]))
assert_equal([{'name': u'output', 'value': ''},
{'name': u'market', 'value': u'US'}
],
response.context[0]['params_form'].initial)
def test_trash_workflow(self):
previous_trashed = Document.objects.trashed_docs(Workflow, self.user).count()
previous_available = Document.objects.available_docs(Workflow, self.user).count()
response = self.c.post(reverse('oozie:delete_workflow'), {'job_selection': [self.wf.id]}, follow=True)
assert_equal(200, response.status_code, response)
assert_equal(previous_trashed + 1, Document.objects.trashed_docs(Workflow, self.user).count())
assert_equal(previous_available - 1, Document.objects.available_docs(Workflow, self.user).count())
def test_workflow_export(self):
response = self.c.get(reverse('oozie:export_workflow', args=[self.wf.id]))
zfile = zipfile.ZipFile(StringIO.StringIO(response.content))
assert_true('workflow.xml' in zfile.namelist(), 'workflow.xml not in response')
assert_true('workflow-metadata.json' in zfile.namelist(), 'workflow-metadata.json not in response')
assert_equal(2, len(zfile.namelist()))
workflow_xml = reformat_xml("""<workflow-app name="wf-name-1" xmlns="uri:oozie:workflow:0.4">
<global>
<job-xml>jobconf.xml</job-xml>
<configuration>
<property>
<name>sleep-all</name>
<value>${SLEEP}</value>
</property>
</configuration>
</global>
<start to="action-name-1"/>
<action name="action-name-1">
<map-reduce>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}${output}"/>
<mkdir path="${nameNode}/test"/>
</prepare>
<configuration>
<property>
<name>sleep</name>
<value>${SLEEP}</value>
</property>
</configuration>
</map-reduce>
<ok to="action-name-2"/>
<error to="kill"/>
</action>
<action name="action-name-2">
<map-reduce>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}${output}"/>
<mkdir path="${nameNode}/test"/>
</prepare>
<configuration>
<property>
<name>sleep</name>
<value>${SLEEP}</value>
</property>
</configuration>
</map-reduce>
<ok to="action-name-3"/>
<error to="kill"/>
</action>
<action name="action-name-3">
<map-reduce>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}${output}"/>
<mkdir path="${nameNode}/test"/>
</prepare>
<configuration>
<property>
<name>sleep</name>
<value>${SLEEP}</value>
</property>
</configuration>
</map-reduce>
<ok to="end"/>
<error to="kill"/>
</action>
<kill name="kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>""")
workflow_metadata_json = reformat_json("""{
"attributes": {
"deployment_dir": "/user/hue/oozie/workspaces/_test_-oozie-13-1383539302.62",
"description": ""
},
"nodes": {
"action-name-1": {
"attributes": {
"jar_path": "/user/hue/oozie/examples/lib/hadoop-examples.jar"
}
},
"action-name-2": {
"attributes": {
"jar_path": "/user/hue/oozie/examples/lib/hadoop-examples.jar"
}
},
"action-name-3": {
"attributes": {
"jar_path": "/user/hue/oozie/examples/lib/hadoop-examples.jar"
}
}
},
"version": "0.0.1"
}""")
result_workflow_metadata_json = reformat_json(zfile.read('workflow-metadata.json'))
workflow_metadata_json = synchronize_workflow_attributes(workflow_metadata_json, result_workflow_metadata_json)
assert_equal(workflow_xml, reformat_xml(zfile.read('workflow.xml')))
assert_equal(workflow_metadata_json, result_workflow_metadata_json)
class TestEditorBundle(OozieMockBase):
def setUp(self):
super(TestEditorBundle, self).setUp()
self.setup_simple_workflow()
def test_create_bundle(self):
create_bundle(self.c, self.user)
def test_clone_bundle(self):
#@TODO@ Prakash fix this test
raise SkipTest
bundle = create_bundle(self.c, self.user)
bundle_count = Document.objects.available_docs(Bundle, self.user).count()
response = self.c.post(reverse('oozie:clone_bundle', args=[bundle.id]), {}, follow=True)
bundle2 = Bundle.objects.latest('id')
assert_not_equal(bundle.id, bundle2.id)
assert_equal(bundle_count + 1, Document.objects.available_docs(Bundle, self.user).count(), response)
coord_ids = set(bundle.coordinators.values_list('id', flat=True))
coord2_ids = set(bundle2.coordinators.values_list('id', flat=True))
if coord_ids or coord2_ids:
assert_not_equal(coord_ids, coord2_ids)
assert_not_equal(bundle.deployment_dir, bundle2.deployment_dir)
assert_not_equal('', bundle2.deployment_dir)
# Bulk delete
response = self.c.post(reverse('oozie:delete_bundle'), {'job_selection': [bundle.id, bundle2.id]}, follow=True)
assert_equal(bundle_count - 1, Document.objects.available_docs(Bundle, self.user).count(), response)
def test_delete_bundle(self):
bundle = create_bundle(self.c, self.user)
bundle_count = Document.objects.available_docs(Bundle, self.user).count()
response = self.c.post(reverse('oozie:delete_bundle'), {'job_selection': [bundle.id]}, follow=True)
assert_equal(bundle_count - 1, Document.objects.available_docs(Bundle, self.user).count(), response)
def test_bundle_gen_xml(self):
raise SkipTest()
bundle = create_bundle(self.c, self.user)
assert_true(
"""<bundle-app name="MyBundle"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns="uri:oozie:coordinator:0.2">
<parameters>
<property>
<name>market</name>
<value>US,France</value>
</property>
</parameters>
<controls>
<kick-off-time>2012-07-01T00:00Z</kick-off-time>
</controls>
</bundle-app>
""" in bundle.to_xml(), bundle.to_xml())
def test_create_bundled_coordinator(self):
raise SkipTest()
bundle = create_bundle(self.c, self.user)
coord = create_coordinator(self.wf, self.c, self.user)
post = {
u'name': [u'test2'], u'kick_off_time_0': [u'02/12/2013'], u'kick_off_time_1': [u'05:05 PM'],
u'create-bundled-coordinator-parameters': [u'[{"name":"market","value":"US"}]'],
u'schema_version': [u'uri:oozie:bundle:0.2', u'uri:oozie:bundle:0.2'], u'coordinators-MAX_NUM_FORMS': [u'0'],
u'coordinators-INITIAL_FORMS': [u'0'],
u'parameters': [u'[{"name":"oozie.use.system.libpath","value":"true"}]'], u'coordinators-TOTAL_FORMS': [u'0'],
u'description': [u'ss']
}
response = self.c.get(reverse('oozie:create_bundled_coordinator', args=[bundle.id]))
assert_true('Add coordinator' in response.content, response.content)
response = self.c.post(reverse('oozie:create_bundled_coordinator', args=[bundle.id]), post, follow=True)
assert_true('This field is required' in response.content, response.content)
post['create-bundled-coordinator-coordinator'] = ['%s' % coord.id]
response = self.c.post(reverse('oozie:create_bundled_coordinator', args=[bundle.id]), post, follow=True)
assert_true('Coordinators' in response.content, response.content)
xml = bundle.to_xml({
'wf_%s_dir' % self.wf.id: '/deployment_path_wf',
'coord_%s_dir' % coord.id: '/deployment_path_coord'
})
assert_true(
"""<bundle-app name="MyBundle"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns="uri:oozie:coordinator:0.2">
<parameters>
<property>
<name>market</name>
<value>US,France</value>
</property>
</parameters>
<controls>
<kick-off-time>2012-07-01T00:00Z</kick-off-time>
</controls>
<coordinator name='MyCoord-1' >
<app-path>${nameNode}/deployment_path_coord</app-path>
<configuration>
<property>
<name>wf_application_path</name>
<value>/deployment_path_wf</value>
</property>
<property>
<name>market</name>
<value>US</value>
</property>
</configuration>
</coordinator>
</bundle-app>""" in xml, xml)
class TestImportWorkflow04(OozieMockBase):
def setUp(self):
super(TestImportWorkflow04, self).setUp()
self.setup_simple_workflow()
@raises(RuntimeError)
def test_import_workflow_namespace_error(self):
"""
Validates import for most basic workflow with an error.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-basic-namespace-missing.xml')
contents = f.read()
f.close()
# Should throw PopupException
import_workflow(workflow, contents)
def test_import_workflow_basic(self):
raise SkipTest()
"""
Validates import for most basic workflow: start and end.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-basic.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(2, len(Node.objects.filter(workflow=workflow)))
assert_equal(2, len(Link.objects.filter(parent__workflow=workflow)))
assert_equal('done', Node.objects.get(workflow=workflow, node_type='end').name)
assert_equal('uri:oozie:workflow:0.4', workflow.schema_version)
workflow.delete(skip_trash=True)
def test_import_workflow_credentials(self):
"""
Validates import for workflow with credentials.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-credentials.xml')
import_workflow(workflow, f.read())
f.close()
credentials = Node.objects.get(workflow=workflow, node_type='hive').credentials
assert_equal(1, len(credentials))
assert_equal('hcat', credentials[0]['name'])
assert_equal(True, credentials[0]['value'])
workflow.delete(skip_trash=True)
def test_import_workflow_basic_global_config(self):
raise SkipTest()
"""
Validates import for basic workflow: start, end, and global configuration.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-basic-global-config.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
assert_equal('done', Node.objects.get(workflow=workflow, node_type='end').name)
assert_equal('uri:oozie:workflow:0.4', workflow.schema_version)
assert_equal('job1.xml', workflow.job_xml)
assert_equal('[{"name": "mapred.job.queue.name", "value": "${queueName}"}]', workflow.job_properties)
workflow.delete(skip_trash=True)
def test_import_workflow_decision(self):
"""
Validates import for decision node: link comments (conditions), default link, decision end.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-decision.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(12, len(Node.objects.filter(workflow=workflow)))
assert_equal(21, len(Link.objects.filter(parent__workflow=workflow)))
assert_equal(1, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='decision', comment='${1 gt 2}', name='start')))
assert_equal(1, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='decision', comment='', name='start')))
assert_equal(1, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='decision', name='default')))
assert_equal(1, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='decision', child__node_type='decisionend', name='related')))
workflow.delete(skip_trash=True)
def test_import_workflow_decision_complex(self):
if is_live_cluster():
raise SkipTest()
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-decision-complex.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(14, len(Node.objects.filter(workflow=workflow)))
assert_equal(27, len(Link.objects.filter(parent__workflow=workflow)))
assert_equal(3, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='decision', comment='${ 1 gt 2 }', name='start')))
assert_equal(0, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='decision', comment='', name='start')))
assert_equal(3, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='decision', name='default')))
assert_equal(3, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='decision', child__node_type='decisionend', name='related')))
workflow.delete(skip_trash=True)
def test_import_workflow_distcp(self):
"""
Validates import for distcp node: params.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-distcp.0.1.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
assert_equal('[{"type":"arg","value":"-overwrite"},{"type":"arg","value":"-m"},{"type":"arg","value":"${MAP_NUMBER}"},{"type":"arg","value":"/user/hue/oozie/workspaces/data"},{"type":"arg","value":"${OUTPUT}"}]', Node.objects.get(workflow=workflow, node_type='distcp').get_full_node().params)
workflow.delete(skip_trash=True)
def test_import_workflow_forks(self):
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-forks.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(12, len(Node.objects.filter(workflow=workflow)))
assert_equal(20, len(Link.objects.filter(parent__workflow=workflow)))
assert_equal(6, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='fork')))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='fork', name='start')))
assert_equal(2, len(Link.objects.filter(parent__workflow=workflow, parent__node_type='fork', child__node_type='join', name='related')))
workflow.delete(skip_trash=True)
def test_import_workflow_mapreduce(self):
"""
Validates import for mapreduce node: job_properties.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-mapreduce.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
assert_equal('[{"name":"mapred.reduce.tasks","value":"1"},{"name":"mapred.mapper.class","value":"org.apache.hadoop.examples.SleepJob"},{"name":"mapred.reducer.class","value":"org.apache.hadoop.examples.SleepJob"},{"name":"mapred.mapoutput.key.class","value":"org.apache.hadoop.io.IntWritable"},{"name":"mapred.mapoutput.value.class","value":"org.apache.hadoop.io.NullWritable"},{"name":"mapred.output.format.class","value":"org.apache.hadoop.mapred.lib.NullOutputFormat"},{"name":"mapred.input.format.class","value":"org.apache.hadoop.examples.SleepJob$SleepInputFormat"},{"name":"mapred.partitioner.class","value":"org.apache.hadoop.examples.SleepJob"},{"name":"mapred.speculative.execution","value":"false"},{"name":"sleep.job.map.sleep.time","value":"0"},{"name":"sleep.job.reduce.sleep.time","value":"1"}]', Node.objects.get(workflow=workflow, node_type='mapreduce').get_full_node().job_properties)
workflow.delete(skip_trash=True)
def test_import_workflow_pig(self):
"""
Validates import for pig node: params.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-pig.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
node = Node.objects.get(workflow=workflow, node_type='pig').get_full_node()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
assert_equal('aggregate.pig', node.script_path)
assert_equal('[{"type":"param","value":"KEY=VALUE"},{"type":"argument","value":"-param"},{"type":"argument","value":"INPUT=/user/hue/oozie/workspaces/data"},{"type":"argument","value":"-param"},{"type":"argument","value":"OUTPUT=${output}"}]', node.params)
workflow.delete(skip_trash=True)
def test_import_workflow_sqoop(self):
"""
Validates import for sqoop node: script_path, files.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-sqoop.0.2.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
node = Node.objects.get(workflow=workflow, node_type='sqoop').get_full_node()
assert_equal('["db.hsqldb.properties#db.hsqldb.properties","db.hsqldb.script#db.hsqldb.script"]', node.files)
assert_equal('import --connect jdbc:hsqldb:file:db.hsqldb --table TT --target-dir ${output} -m 1', node.script_path)
assert_equal('[{"type":"arg","value":"My invalid arg"},{"type":"arg","value":"My invalid arg 2"}]', node.params)
workflow.delete(skip_trash=True)
def test_import_workflow_ssh(self):
"""
Validates import for ssh node: params.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-ssh.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
node = Node.objects.get(workflow=workflow, node_type='ssh').get_full_node()
assert_equal('${user}@${host}', node.host)
assert_equal('ls', node.command)
assert_equal('[{"type":"args","value":"-l"}]', node.params)
workflow.delete(skip_trash=True)
def test_import_workflow_java(self):
"""
Validates import for java node: main_class, args.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-java.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(5, len(Node.objects.filter(workflow=workflow)))
assert_equal(6, len(Link.objects.filter(parent__workflow=workflow)))
java_nodes = Node.objects.filter(workflow=workflow, node_type='java').order_by('name')
tera_gen_node = java_nodes[0].get_full_node()
tera_sort_node = java_nodes[1].get_full_node()
assert_equal('org.apache.hadoop.examples.terasort.TeraGen', tera_gen_node.main_class)
assert_equal('${records} ${output_dir}/teragen', tera_gen_node.args)
assert_equal('org.apache.hadoop.examples.terasort.TeraSort', tera_sort_node.main_class)
assert_equal('-Dmapred.reduce.tasks=${terasort_reducers} ${output_dir}/teragen ${output_dir}/terasort', tera_sort_node.args)
assert_true(tera_gen_node.capture_output)
assert_false(tera_sort_node.capture_output)
workflow.delete(skip_trash=True)
def test_import_workflow_shell(self):
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-shell.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(5, len(Node.objects.filter(workflow=workflow)))
assert_equal(6, len(Link.objects.filter(parent__workflow=workflow)))
shell_nodes = Node.objects.filter(workflow=workflow, node_type='shell').order_by('name')
shell_1_node = shell_nodes[0].get_full_node()
shell_2_node = shell_nodes[1].get_full_node()
assert_equal('shell-1', shell_1_node.name)
assert_equal('shell-2', shell_2_node.name)
assert_equal('my-job.xml', shell_1_node.job_xml)
assert_equal('hello.py', shell_1_node.command)
assert_equal('[{"type":"argument","value":"World!"}]', shell_1_node.params)
assert_true(shell_1_node.capture_output)
assert_false(shell_2_node.capture_output)
workflow.delete(skip_trash=True)
def test_import_workflow_fs(self):
"""
Validates import for fs node: chmods, deletes, mkdirs, moves, touchzs.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-fs.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
node = Node.objects.get(workflow=workflow, node_type='fs').get_full_node()
assert_equal('[{"path":"${nameNode}${output}/testfs/renamed","permissions":"700","recursive":"false"}]', node.chmods)
assert_equal('[{"name":"${nameNode}${output}/testfs"}]', node.deletes)
assert_equal('[{"name":"${nameNode}${output}/testfs"},{"name":"${nameNode}${output}/testfs/source"}]', node.mkdirs)
assert_equal('[{"source":"${nameNode}${output}/testfs/source","destination":"${nameNode}${output}/testfs/renamed"}]', node.moves)
assert_equal('[{"name":"${nameNode}${output}/testfs/new_file"}]', node.touchzs)
workflow.delete(skip_trash=True)
def test_import_workflow_email(self):
"""
Validates import for email node: to, css, subject, body.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-email.0.1.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
node = Node.objects.get(workflow=workflow, node_type='email').get_full_node()
assert_equal('example@example.org', node.to)
assert_equal('', node.cc)
assert_equal('I love', node.subject)
assert_equal('Hue', node.body)
workflow.delete(skip_trash=True)
def test_import_workflow_generic(self):
"""
Validates import for generic node: xml.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-generic.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
node = Node.objects.get(workflow=workflow, node_type='generic').get_full_node()
assert_equal("<bleh test=\"test\">\n <test>test</test>\n </bleh>", node.xml)
workflow.delete(skip_trash=True)
def test_import_workflow_multi_kill_node(self):
"""
Validates import for multiple kill nodes: xml.
Kill nodes should be skipped and a single kill node should be created.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-java-multiple-kill.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal('kill', Kill.objects.get(workflow=workflow).name)
assert_equal(5, len(Node.objects.filter(workflow=workflow)))
assert_equal(6, len(Link.objects.filter(parent__workflow=workflow)))
nodes = [Node.objects.filter(workflow=workflow, node_type='java')[0].get_full_node(),
Node.objects.filter(workflow=workflow, node_type='java')[1].get_full_node()]
assert_equal('org.apache.hadoop.examples.terasort.TeraGen', nodes[0].main_class)
assert_equal('${records} ${output_dir}/teragen', nodes[0].args)
assert_equal('org.apache.hadoop.examples.terasort.TeraSort', nodes[1].main_class)
assert_equal('-Dmapred.reduce.tasks=${terasort_reducers} ${output_dir}/teragen ${output_dir}/terasort', nodes[1].args)
assert_true(nodes[0].capture_output)
assert_false(nodes[1].capture_output)
workflow.delete(skip_trash=True)
def test_import_workflow_different_error_link(self):
"""
Validates import with error link to end: main_class, args.
If an error link cannot be resolved, default to 'kill' node.
"""
if is_live_cluster():
raise SkipTest('HUE-2899: Needs to make results in a consistent order')
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-java-different-error-links.xml')
import_workflow(workflow, f.read())
f.close()
workflow.save()
assert_equal(5, len(Node.objects.filter(workflow=workflow)))
assert_equal(6, len(Link.objects.filter(parent__workflow=workflow)))
nodes = [Node.objects.filter(workflow=workflow, node_type='java')[0].get_full_node(),
Node.objects.filter(workflow=workflow, node_type='java')[1].get_full_node()]
assert_equal('org.apache.hadoop.examples.terasort.TeraGen', nodes[0].main_class)
assert_equal('${records} ${output_dir}/teragen', nodes[0].args)
assert_equal('org.apache.hadoop.examples.terasort.TeraSort', nodes[1].main_class)
assert_equal('-Dmapred.reduce.tasks=${terasort_reducers} ${output_dir}/teragen ${output_dir}/terasort', nodes[1].args)
assert_true(nodes[0].capture_output)
assert_false(nodes[1].capture_output)
assert_equal(1, len(Link.objects.filter(parent__workflow=workflow).filter(parent__name='TeraGenWorkflow').filter(name='error').filter(child__node_type='java')))
assert_equal(1, len(Link.objects.filter(parent__workflow=workflow).filter(parent__name='TeraSort').filter(name='error').filter(child__node_type='kill')))
workflow.delete(skip_trash=True)
class TestImportCoordinator02(OozieMockBase):
def setUp(self):
super(TestImportCoordinator02, self).setUp()
self.setup_simple_workflow()
def test_import_coordinator_simple(self):
raise SkipTest
coordinator_count = Document.objects.available_docs(Coordinator, self.user).count()
# Create
filename = os.path.abspath(os.path.dirname(__file__) + "/test_data/coordinators/0.2/test-basic.xml")
fh = open(filename)
response = self.c.post(reverse('oozie:import_coordinator'), {
'name': ['test_coordinator'],
'workflow': Workflow.objects.get(name='wf-name-1').pk,
'definition_file': [fh],
'description': ['test description']
}, follow=True)
fh.close()
assert_equal(coordinator_count + 1, Document.objects.available_docs(Coordinator, self.user).count(), response)
coordinator = Coordinator.objects.get(name='test_coordinator')
assert_equal('[{"name":"oozie.use.system.libpath","value":"true"}]', coordinator.parameters)
assert_equal('uri:oozie:coordinator:0.2', coordinator.schema_version)
assert_equal('test description', coordinator.description)
assert_equal(datetime.strptime('2013-06-03T00:00Z', '%Y-%m-%dT%H:%MZ'), coordinator.start)
assert_equal(datetime.strptime('2013-06-05T00:00Z', '%Y-%m-%dT%H:%MZ'), coordinator.end)
assert_equal('America/Los_Angeles', coordinator.timezone)
assert_equal('days', coordinator.frequency_unit)
assert_equal(1, coordinator.frequency_number)
assert_equal(None, coordinator.timeout)
assert_equal(None, coordinator.concurrency)
assert_false(coordinator.execution) # coordinator.execution can be None or empty string
assert_equal(None, coordinator.throttle)
assert_not_equal(None, coordinator.deployment_dir)
class TestPermissions(OozieBase):
def setUp(self):
super(TestPermissions, self).setUp()
self.wf = create_workflow(self.c, self.user)
self.setup_simple_workflow()
def tearDown(self):
try:
self.wf.delete(skip_trash=True)
except:
LOG.exception('failed to tear down tests')
def test_workflow_permissions(self):
raise SkipTest
response = self.c.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
assert_true('Editor' in response.content, response.content)
assert_true('Save' in response.content, response.content)
assert_false(self.wf.is_shared)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
grant_access("not_me", "test", "oozie")
# List
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:list_workflows'))
assert_false('wf-name-1' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:list_workflows'))
assert_false('wf-name-1' in response.content, response.content)
finally:
finish()
# View
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
# Share it !
self.wf = Workflow.objects.get(name='wf-name-1', managed=True)
self.wf.is_shared = True
self.wf.save()
Workflow.objects.check_workspace(self.wf, self.cluster.fs)
# List
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:list_workflows'))
assert_equal(200, response.status_code)
assert_true('wf-name-1' in response.content, response.content)
finally:
finish()
# View
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
assert_false('Permission denied' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
# Submit
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:submit_workflow', args=[self.wf.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(True)
try:
try:
response = client_not_me.post(reverse('oozie:submit_workflow', args=[self.wf.id]))
assert_false('Permission denied' in response.content, response.content)
except IOError:
pass
finally:
finish()
# Move to trash
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:delete_workflow'), {'job_selection': [self.wf.id]})
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
response = self.c.post(reverse('oozie:delete_workflow'), {'job_selection': [self.wf.id]}, follow=True)
assert_equal(200, response.status_code)
# Trash
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:list_trashed_workflows'))
assert_false(self.wf.name in response.content, response.content)
finally:
finish()
response = self.c.get(reverse('oozie:list_trashed_workflows'))
assert_true(self.wf.name in response.content, response.content)
# Restore
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:restore_workflow'), {'job_selection': [self.wf.id]})
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
response = self.c.post(reverse('oozie:restore_workflow'), {'job_selection': [self.wf.id]}, follow=True)
assert_equal(200, response.status_code)
def test_coordinator_permissions(self):
raise SkipTest
coord = create_coordinator(self.wf, self.c, self.user)
response = self.c.get(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_true('Editor' in response.content, response.content)
assert_true('Save coordinator' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
grant_access("not_me", "test", "oozie")
# List
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:list_coordinators'))
assert_false('MyCoord' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:list_coordinators'))
assert_false('MyCoord' in response.content, response.content)
finally:
finish()
# View
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_false('MyCoord' in response.content, response.content)
finally:
finish()
# Share it !
wf = Workflow.objects.get(id=coord.workflow.id, managed=True)
wf.is_shared = True
wf.save()
Workflow.objects.check_workspace(wf, self.cluster.fs)
post = COORDINATOR_DICT.copy()
post.update({
u'datainput_set-TOTAL_FORMS': [u'0'], u'datainput_set-INITIAL_FORMS': [u'0'], u'dataset_set-INITIAL_FORMS': [u'0'],
u'dataoutput_set-INITIAL_FORMS': [u'0'], u'datainput_set-MAX_NUM_FORMS': [u'0'], u'output-MAX_NUM_FORMS': [u''],
u'output-INITIAL_FORMS': [u'0'], u'dataoutput_set-TOTAL_FORMS': [u'0'], u'input-TOTAL_FORMS': [u'0'],
u'dataset_set-MAX_NUM_FORMS': [u'0'], u'dataoutput_set-MAX_NUM_FORMS': [u'0'], u'input-MAX_NUM_FORMS': [u''],
u'dataset_set-TOTAL_FORMS': [u'0'], u'input-INITIAL_FORMS': [u'0'], u'output-TOTAL_FORMS': [u'0']})
post['is_shared'] = [u'on']
post['workflow'] = coord.workflow.id
self.c.post(reverse('oozie:edit_coordinator', args=[coord.id]), post)
coord = Coordinator.objects.get(id=coord.id)
assert_true(coord.is_shared)
# List
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:list_coordinators'))
assert_equal(200, response.status_code)
assert_true('MyCoord' in response.content, response.content)
finally:
finish()
# View
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_false('Permission denied' in response.content, response.content)
assert_false('Save coordinator' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
# Edit
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.post(reverse('oozie:edit_coordinator', args=[coord.id]))
assert_false('MyCoord' in response.content, response.content)
assert_true('Not allowed' in response.content, response.content)
finally:
finish()
# Submit
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:submit_coordinator', args=[coord.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(True)
try:
try:
response = client_not_me.post(reverse('oozie:submit_coordinator', args=[coord.id]))
assert_false('Permission denied' in response.content, response.content)
except IOError:
pass
finally:
finish()
# Move to trash
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:delete_coordinator'), {'job_selection': [coord.id]})
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
response = self.c.post(reverse('oozie:delete_coordinator'), {'job_selection': [coord.id]}, follow=True)
assert_equal(200, response.status_code)
# List trash
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:list_trashed_coordinators'))
assert_true(coord.name in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
response = client_not_me.get(reverse('oozie:list_trashed_coordinators'))
assert_false(coord.name in response.content, response.content)
# Restore
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:restore_coordinator'), {'job_selection': [coord.id]})
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
response = self.c.post(reverse('oozie:restore_coordinator'), {'job_selection': [coord.id]}, follow=True)
assert_equal(200, response.status_code)
def test_bundle_permissions(self):
raise SkipTest
bundle = create_bundle(self.c, self.user)
response = self.c.get(reverse('oozie:edit_bundle', args=[bundle.id]))
assert_true('Editor' in response.content, response.content)
assert_true('MyBundle' in response.content, response.content)
assert_true('Save' in response.content, response.content)
assert_false(bundle.is_shared)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
grant_access("not_me", "test", "oozie")
# List
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:list_bundles'))
assert_false('MyBundle' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:list_bundles'))
assert_false('MyBundle' in response.content, response.content)
finally:
finish()
# View
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:edit_bundle', args=[bundle.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:edit_bundle', args=[bundle.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
# Share it !
bundle.is_shared = True
bundle.save()
# List
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:list_bundles'))
assert_equal(200, response.status_code)
assert_true('MyBundle' in response.content, response.content)
finally:
finish()
# View
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:edit_bundle', args=[bundle.id]))
assert_false('Permission denied' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.get(reverse('oozie:edit_bundle', args=[bundle.id]))
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
# Submit
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:submit_bundle', args=[bundle.id]),{
u'form-MAX_NUM_FORMS': [u''], u'form-INITIAL_FORMS': [u'0'], u'form-TOTAL_FORMS': [u'0']
})
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(True)
try:
try:
response = client_not_me.post(reverse('oozie:submit_bundle', args=[bundle.id]), {
u'form-MAX_NUM_FORMS': [u''], u'form-INITIAL_FORMS': [u'0'], u'form-TOTAL_FORMS': [u'0']
})
assert_false('Permission denied' in response.content, response.content)
except IOError:
pass
finally:
finish()
# Delete
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:delete_bundle'), {'job_selection': [bundle.id]})
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
response = self.c.post(reverse('oozie:delete_bundle'), {'job_selection': [bundle.id]}, follow=True)
assert_equal(200, response.status_code)
# List trash
finish = SHARE_JOBS.set_for_testing(True)
try:
response = client_not_me.get(reverse('oozie:list_trashed_bundles'))
assert_true(bundle.name in response.content, response.content)
finally:
finish()
finish = SHARE_JOBS.set_for_testing(False)
response = client_not_me.get(reverse('oozie:list_trashed_bundles'))
assert_false(bundle.name in response.content, response.content)
# Restore
finish = SHARE_JOBS.set_for_testing(False)
try:
response = client_not_me.post(reverse('oozie:restore_bundle'), {'job_selection': [bundle.id]})
assert_true('Permission denied' in response.content, response.content)
finally:
finish()
response = self.c.post(reverse('oozie:restore_bundle'), {'job_selection': [bundle.id]}, follow=True)
assert_equal(200, response.status_code)
class TestEditorWithOozie(OozieBase):
def setUp(self):
OozieBase.setUp(self)
self.c = make_logged_in_client()
self.wf = create_workflow(self.c, self.user)
self.setup_simple_workflow()
def tearDown(self):
try:
self.wf.delete(skip_trash=True)
except:
LOG.exception('failed to tear down tests')
def test_create_workflow(self):
dir_stat = self.cluster.fs.stats(self.wf.deployment_dir)
assert_equal('test', dir_stat.user)
assert_equal('hue', dir_stat.group)
assert_equal('40711', '%o' % dir_stat.mode)
def test_clone_workflow(self):
raise SkipTest
workflow_count = Document.objects.available_docs(Workflow, self.user).count()
response = self.c.post(reverse('oozie:clone_workflow', args=[self.wf.id]), {}, follow=True)
assert_equal(workflow_count + 1, Document.objects.available_docs(Workflow, self.user).count(), response)
wf2 = Workflow.objects.latest('id')
assert_not_equal(self.wf.id, wf2.id)
assert_equal(self.wf.node_set.count(), wf2.node_set.count())
node_ids = set(self.wf.node_set.values_list('id', flat=True))
for node in wf2.node_set.all():
assert_false(node.id in node_ids)
assert_not_equal(self.wf.deployment_dir, wf2.deployment_dir)
assert_not_equal('', wf2.deployment_dir)
# Bulk delete
response = self.c.post(reverse('oozie:delete_workflow'), {'job_selection': [self.wf.id, wf2.id]}, follow=True)
assert_equal(workflow_count - 1, Document.objects.available_docs(Workflow, self.user).count(), response)
def test_import_workflow(self):
raise SkipTest
workflow_count = Document.objects.available_docs(Workflow, self.user).count()
# Create
filename = os.path.abspath(os.path.dirname(__file__) + "/test_data/workflows/0.4/test-mapreduce.xml")
fh = open(filename)
response = self.c.post(reverse('oozie:import_workflow'), {
'job_xml': [''],
'name': ['test_workflow'],
'parameters': ['[{"name":"oozie.use.system.libpath","value":"true"}]'],
'deployment_dir': [''],
'job_properties': ['[]'],
'schema_version': ['0.4'],
'definition_file': [fh],
'description': ['']
}, follow=True)
fh.close()
assert_equal(workflow_count + 1, Document.objects.available_docs(Workflow, self.user).count(), response)
def test_delete_workflow(self):
previous_trashed = Document.objects.trashed_docs(Workflow, self.user).count()
previous_available = Document.objects.available_docs(Workflow, self.user).count()
response = self.c.post(reverse('oozie:delete_workflow') + "?skip_trash=true", {'job_selection': [self.wf.id]}, follow=True)
assert_equal(200, response.status_code, response)
assert_equal(previous_trashed, Document.objects.trashed_docs(Workflow, self.user).count())
assert_equal(previous_available - 1, Document.objects.available_docs(Workflow, self.user).count())
class TestImportWorkflow04WithOozie(OozieBase):
def setUp(self):
OozieBase.setUp(self)
self.c = make_logged_in_client()
self.wf = create_workflow(self.c, self.user)
self.setup_simple_workflow()
# in order to reference examples in Subworkflow, must be owned by current user.
Workflow.objects.update(owner=self.user)
def tearDown(self):
self.wf.delete(skip_trash=True)
def test_import_workflow_subworkflow(self):
"""
Validates import for subworkflow node: propagate_configuration.
"""
workflow = Workflow.objects.new_workflow(self.user)
workflow.save()
f = open('apps/oozie/src/oozie/test_data/workflows/0.4/test-subworkflow.xml')
import_workflow(workflow, f.read(), None, self.cluster.fs)
f.close()
workflow.save()
assert_equal(4, len(Node.objects.filter(workflow=workflow)))
assert_equal(4, len(Link.objects.filter(parent__workflow=workflow)))
node = Node.objects.get(workflow=workflow, node_type='subworkflow').get_full_node()
assert_equal(True, node.propagate_configuration)
workflow.delete(skip_trash=True)
class TestOozieSubmissions(OozieBase):
def test_submit_hiveserver2_action(self):
wf_uuid = "c1c3cba9-edec-fb6f-a526-9f80b66fe993"
wf = Document2.objects.get(uuid=wf_uuid)
wf.data.replace('hive2://localhost:10000/default', _get_hiveserver2_url())
wf.save()
# Somewhere we delete those by mistake
doc = Document.objects.link(wf, owner=wf.owner, name=wf.name, description=wf.description, extra='workflow2')
doc.share_to_default()
response = self.c.post(reverse('oozie:editor_submit_workflow', kwargs={'doc_id': wf.id}),
data={
u'form-0-name': [u'oozie.use.system.libpath'],
u'form-MAX_NUM_FORMS': [u'1000'],
u'form-TOTAL_FORMS': [u'1'],
u'form-INITIAL_FORMS': [u'1'],
u'form-0-value': [u'True']
},
follow=True)
job = OozieServerProvider.wait_until_completion(response.context[0]['oozie_workflow'].id)
assert_true(job.status in ('SUCCEEDED', 'KILLED'), job.status) # Dies for some cluster setup reason
def test_submit_spark_action(self):
wf_uuid = "2d667ab2-70f9-c2bf-0726-abe84fa7130d"
wf = Document2.objects.get(uuid=wf_uuid)
# Somewhere we delete those by mistake
doc = Document.objects.link(wf, owner=wf.owner, name=wf.name, description=wf.description, extra='workflow2')
doc.share_to_default()
response = self.c.post(reverse('oozie:editor_submit_workflow', kwargs={'doc_id': wf.id}),
data={
u'form-0-name': [u'oozie.use.system.libpath'],
u'form-MAX_NUM_FORMS': [u'1000'],
u'form-1-name': [u'input'],
u'form-TOTAL_FORMS': [u'3'],
u'form-1-value': [u'/user/hue/oozie/workspaces/data/sonnets.txt'],
u'form-2-name': [u'output'],
u'form-INITIAL_FORMS': [u'3'],
u'form-2-value': [u'here'],
u'form-0-value': [u'True']
},
follow=True)
job = OozieServerProvider.wait_until_completion(response.context[0]['oozie_workflow'].id)
assert_true(job.status in ('SUCCEEDED', 'KILLED'), job.status) # Dies for some cluster setup reason
def test_oozie_page(self):
if is_live_cluster():
raise SkipTest('HUE-2898: Skipping test until it can be debugged')
response = self.c.get(reverse('oozie:list_oozie_info'))
assert_true('version' in response.content, response.content)
assert_true('NORMAL' in response.content, response.content)
assert_true('variables' in response.content, response.content)
assert_true('timers' in response.content, response.content)
assert_true('counters' in response.content, response.content)
assert_true('ownMinTime' in response.content, response.content)
assert_true('oozie.base.url' in response.content, response.content)
def test_imported_workflow_submission(self):
# Workflow owned by "temp_user"
workflow_docs = '"[\\n{\\n \\"pk\\": 50012, \\n \\"model\\": \\"desktop.document2\\", \\n \\"fields\\": {\\n \\"search\\": null, \\n \\"uuid\\": \\"c3f7f992-4a64-407b-86c4-da630f6b51a5\\", \\n \\"extra\\": \\"\\", \\n \\"type\\": \\"oozie-workflow2\\", \\n \\"description\\": \\"\\", \\n \\"is_history\\": false, \\n \\"parent_directory\\": [\\n \\"098ec28d-23b5-42b6-b4c3-be0b0da63832\\", \\n 1, \\n false\\n ], \\n \\"is_managed\\": false, \\n \\"last_modified\\": \\"2016-10-28T17:50:54.006\\", \\n \\"version\\": 1, \\n \\"owner\\": [\\n \\"temp_user\\"\\n ], \\n \\"dependencies\\": [], \\n \\"data\\": \\"{\\\\\\"layout\\\\\\": [{\\\\\\"oozieRows\\\\\\": [{\\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"enableOozieDropOnSide\\\\\\": true, \\\\\\"enableOozieDrop\\\\\\": false, \\\\\\"widgets\\\\\\": [{\\\\\\"status\\\\\\": \\\\\\"\\\\\\", \\\\\\"logsURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"name\\\\\\": \\\\\\"Shell\\\\\\", \\\\\\"widgetType\\\\\\": \\\\\\"shell-widget\\\\\\", \\\\\\"oozieMovable\\\\\\": true, \\\\\\"ooziePropertiesExpanded\\\\\\": false, \\\\\\"externalIdUrl\\\\\\": \\\\\\"\\\\\\", \\\\\\"properties\\\\\\": {}, \\\\\\"isLoading\\\\\\": true, \\\\\\"offset\\\\\\": 0, \\\\\\"actionURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"progress\\\\\\": 0, \\\\\\"klass\\\\\\": \\\\\\"card card-widget span12\\\\\\", \\\\\\"oozieExpanded\\\\\\": false, \\\\\\"id\\\\\\": \\\\\\"f5f910c1-97ee-f7c0-1de4-048fbfbfce20\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"id\\\\\\": \\\\\\"1929b048-b8a3-ad10-5aff-488c1f2808f8\\\\\\", \\\\\\"columns\\\\\\": []}], \\\\\\"rows\\\\\\": [{\\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"enableOozieDropOnSide\\\\\\": true, \\\\\\"enableOozieDrop\\\\\\": false, \\\\\\"widgets\\\\\\": [{\\\\\\"status\\\\\\": \\\\\\"\\\\\\", \\\\\\"logsURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"name\\\\\\": \\\\\\"Start\\\\\\", \\\\\\"widgetType\\\\\\": \\\\\\"start-widget\\\\\\", \\\\\\"oozieMovable\\\\\\": false, \\\\\\"ooziePropertiesExpanded\\\\\\": false, \\\\\\"externalIdUrl\\\\\\": \\\\\\"\\\\\\", \\\\\\"properties\\\\\\": {}, \\\\\\"isLoading\\\\\\": true, \\\\\\"offset\\\\\\": 0, \\\\\\"actionURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"progress\\\\\\": 0, \\\\\\"klass\\\\\\": \\\\\\"card card-widget span12\\\\\\", \\\\\\"oozieExpanded\\\\\\": false, \\\\\\"id\\\\\\": \\\\\\"3f107997-04cc-8733-60a9-a4bb62cebffc\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"id\\\\\\": \\\\\\"981a811d-2383-31d0-a5f0-e0eee44876f1\\\\\\", \\\\\\"columns\\\\\\": []}, {\\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"enableOozieDropOnSide\\\\\\": true, \\\\\\"enableOozieDrop\\\\\\": false, \\\\\\"widgets\\\\\\": [{\\\\\\"status\\\\\\": \\\\\\"\\\\\\", \\\\\\"logsURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"name\\\\\\": \\\\\\"Shell\\\\\\", \\\\\\"widgetType\\\\\\": \\\\\\"shell-widget\\\\\\", \\\\\\"oozieMovable\\\\\\": true, \\\\\\"ooziePropertiesExpanded\\\\\\": false, \\\\\\"externalIdUrl\\\\\\": \\\\\\"\\\\\\", \\\\\\"properties\\\\\\": {}, \\\\\\"isLoading\\\\\\": true, \\\\\\"offset\\\\\\": 0, \\\\\\"actionURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"progress\\\\\\": 0, \\\\\\"klass\\\\\\": \\\\\\"card card-widget span12\\\\\\", \\\\\\"oozieExpanded\\\\\\": false, \\\\\\"id\\\\\\": \\\\\\"f5f910c1-97ee-f7c0-1de4-048fbfbfce20\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"id\\\\\\": \\\\\\"1929b048-b8a3-ad10-5aff-488c1f2808f8\\\\\\", \\\\\\"columns\\\\\\": []}, {\\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"enableOozieDropOnSide\\\\\\": true, \\\\\\"enableOozieDrop\\\\\\": false, \\\\\\"widgets\\\\\\": [{\\\\\\"status\\\\\\": \\\\\\"\\\\\\", \\\\\\"logsURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"name\\\\\\": \\\\\\"End\\\\\\", \\\\\\"widgetType\\\\\\": \\\\\\"end-widget\\\\\\", \\\\\\"oozieMovable\\\\\\": false, \\\\\\"ooziePropertiesExpanded\\\\\\": false, \\\\\\"externalIdUrl\\\\\\": \\\\\\"\\\\\\", \\\\\\"properties\\\\\\": {}, \\\\\\"isLoading\\\\\\": true, \\\\\\"offset\\\\\\": 0, \\\\\\"actionURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"progress\\\\\\": 0, \\\\\\"klass\\\\\\": \\\\\\"card card-widget span12\\\\\\", \\\\\\"oozieExpanded\\\\\\": false, \\\\\\"id\\\\\\": \\\\\\"33430f0f-ebfa-c3ec-f237-3e77efa03d0a\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"id\\\\\\": \\\\\\"8fc98b1d-5a92-bf1e-1bd6-380b311b8f98\\\\\\", \\\\\\"columns\\\\\\": []}, {\\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"enableOozieDropOnSide\\\\\\": true, \\\\\\"enableOozieDrop\\\\\\": false, \\\\\\"widgets\\\\\\": [{\\\\\\"status\\\\\\": \\\\\\"\\\\\\", \\\\\\"logsURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"name\\\\\\": \\\\\\"Kill\\\\\\", \\\\\\"widgetType\\\\\\": \\\\\\"kill-widget\\\\\\", \\\\\\"oozieMovable\\\\\\": true, \\\\\\"ooziePropertiesExpanded\\\\\\": false, \\\\\\"externalIdUrl\\\\\\": \\\\\\"\\\\\\", \\\\\\"properties\\\\\\": {}, \\\\\\"isLoading\\\\\\": true, \\\\\\"offset\\\\\\": 0, \\\\\\"actionURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"progress\\\\\\": 0, \\\\\\"klass\\\\\\": \\\\\\"card card-widget span12\\\\\\", \\\\\\"oozieExpanded\\\\\\": false, \\\\\\"id\\\\\\": \\\\\\"17c9c895-5a16-7443-bb81-f34b30b21548\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"id\\\\\\": \\\\\\"0a5ba4b8-3179-c50c-1203-e313aa13a4d1\\\\\\", \\\\\\"columns\\\\\\": []}], \\\\\\"oozieEndRow\\\\\\": {\\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"enableOozieDropOnSide\\\\\\": true, \\\\\\"enableOozieDrop\\\\\\": false, \\\\\\"widgets\\\\\\": [{\\\\\\"status\\\\\\": \\\\\\"\\\\\\", \\\\\\"logsURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"name\\\\\\": \\\\\\"End\\\\\\", \\\\\\"widgetType\\\\\\": \\\\\\"end-widget\\\\\\", \\\\\\"oozieMovable\\\\\\": false, \\\\\\"ooziePropertiesExpanded\\\\\\": false, \\\\\\"externalIdUrl\\\\\\": \\\\\\"\\\\\\", \\\\\\"properties\\\\\\": {}, \\\\\\"isLoading\\\\\\": true, \\\\\\"offset\\\\\\": 0, \\\\\\"actionURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"progress\\\\\\": 0, \\\\\\"klass\\\\\\": \\\\\\"card card-widget span12\\\\\\", \\\\\\"oozieExpanded\\\\\\": false, \\\\\\"id\\\\\\": \\\\\\"33430f0f-ebfa-c3ec-f237-3e77efa03d0a\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"id\\\\\\": \\\\\\"8fc98b1d-5a92-bf1e-1bd6-380b311b8f98\\\\\\", \\\\\\"columns\\\\\\": []}, \\\\\\"oozieKillRow\\\\\\": {\\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"enableOozieDropOnSide\\\\\\": true, \\\\\\"enableOozieDrop\\\\\\": false, \\\\\\"widgets\\\\\\": [{\\\\\\"status\\\\\\": \\\\\\"\\\\\\", \\\\\\"logsURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"name\\\\\\": \\\\\\"Kill\\\\\\", \\\\\\"widgetType\\\\\\": \\\\\\"kill-widget\\\\\\", \\\\\\"oozieMovable\\\\\\": true, \\\\\\"ooziePropertiesExpanded\\\\\\": false, \\\\\\"externalIdUrl\\\\\\": \\\\\\"\\\\\\", \\\\\\"properties\\\\\\": {}, \\\\\\"isLoading\\\\\\": true, \\\\\\"offset\\\\\\": 0, \\\\\\"actionURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"progress\\\\\\": 0, \\\\\\"klass\\\\\\": \\\\\\"card card-widget span12\\\\\\", \\\\\\"oozieExpanded\\\\\\": false, \\\\\\"id\\\\\\": \\\\\\"17c9c895-5a16-7443-bb81-f34b30b21548\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"id\\\\\\": \\\\\\"0a5ba4b8-3179-c50c-1203-e313aa13a4d1\\\\\\", \\\\\\"columns\\\\\\": []}, \\\\\\"enableOozieDropOnAfter\\\\\\": true, \\\\\\"oozieStartRow\\\\\\": {\\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"enableOozieDropOnSide\\\\\\": true, \\\\\\"enableOozieDrop\\\\\\": false, \\\\\\"widgets\\\\\\": [{\\\\\\"status\\\\\\": \\\\\\"\\\\\\", \\\\\\"logsURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"name\\\\\\": \\\\\\"Start\\\\\\", \\\\\\"widgetType\\\\\\": \\\\\\"start-widget\\\\\\", \\\\\\"oozieMovable\\\\\\": false, \\\\\\"ooziePropertiesExpanded\\\\\\": false, \\\\\\"externalIdUrl\\\\\\": \\\\\\"\\\\\\", \\\\\\"properties\\\\\\": {}, \\\\\\"isLoading\\\\\\": true, \\\\\\"offset\\\\\\": 0, \\\\\\"actionURL\\\\\\": \\\\\\"\\\\\\", \\\\\\"progress\\\\\\": 0, \\\\\\"klass\\\\\\": \\\\\\"card card-widget span12\\\\\\", \\\\\\"oozieExpanded\\\\\\": false, \\\\\\"id\\\\\\": \\\\\\"3f107997-04cc-8733-60a9-a4bb62cebffc\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"id\\\\\\": \\\\\\"981a811d-2383-31d0-a5f0-e0eee44876f1\\\\\\", \\\\\\"columns\\\\\\": []}, \\\\\\"klass\\\\\\": \\\\\\"card card-home card-column span12\\\\\\", \\\\\\"enableOozieDropOnBefore\\\\\\": true, \\\\\\"drops\\\\\\": [\\\\\\"temp\\\\\\"], \\\\\\"id\\\\\\": \\\\\\"656fca35-ebb7-7ba6-6774-5bc22dcc9340\\\\\\", \\\\\\"size\\\\\\": 12}], \\\\\\"workflow\\\\\\": {\\\\\\"properties\\\\\\": {\\\\\\"job_xml\\\\\\": \\\\\\"\\\\\\", \\\\\\"description\\\\\\": \\\\\\"\\\\\\", \\\\\\"parameters\\\\\\": [{\\\\\\"name\\\\\\": \\\\\\"oozie.use.system.libpath\\\\\\", \\\\\\"value\\\\\\": true}], \\\\\\"sla_enabled\\\\\\": false, \\\\\\"deployment_dir\\\\\\": \\\\\\"/user/hue/oozie/workspaces/hue-oozie-1477697614.12\\\\\\", \\\\\\"schema_version\\\\\\": \\\\\\"uri:oozie:workflow:0.5\\\\\\", \\\\\\"sla\\\\\\": [{\\\\\\"value\\\\\\": false, \\\\\\"key\\\\\\": \\\\\\"enabled\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"${nominal_time}\\\\\\", \\\\\\"key\\\\\\": \\\\\\"nominal-time\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"should-start\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"${30 * MINUTES}\\\\\\", \\\\\\"key\\\\\\": \\\\\\"should-end\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"max-duration\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"alert-events\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"alert-contact\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"notification-msg\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"upstream-apps\\\\\\"}], \\\\\\"show_arrows\\\\\\": true, \\\\\\"wf1_id\\\\\\": null, \\\\\\"properties\\\\\\": []}, \\\\\\"name\\\\\\": \\\\\\"example-wf\\\\\\", \\\\\\"versions\\\\\\": [\\\\\\"uri:oozie:workflow:0.4\\\\\\", \\\\\\"uri:oozie:workflow:0.4.5\\\\\\", \\\\\\"uri:oozie:workflow:0.5\\\\\\"], \\\\\\"isDirty\\\\\\": true, \\\\\\"movedNode\\\\\\": null, \\\\\\"linkMapping\\\\\\": {\\\\\\"f5f910c1-97ee-f7c0-1de4-048fbfbfce20\\\\\\": [\\\\\\"33430f0f-ebfa-c3ec-f237-3e77efa03d0a\\\\\\"], \\\\\\"33430f0f-ebfa-c3ec-f237-3e77efa03d0a\\\\\\": [], \\\\\\"3f107997-04cc-8733-60a9-a4bb62cebffc\\\\\\": [\\\\\\"f5f910c1-97ee-f7c0-1de4-048fbfbfce20\\\\\\"], \\\\\\"17c9c895-5a16-7443-bb81-f34b30b21548\\\\\\": []}, \\\\\\"nodeIds\\\\\\": [\\\\\\"3f107997-04cc-8733-60a9-a4bb62cebffc\\\\\\", \\\\\\"33430f0f-ebfa-c3ec-f237-3e77efa03d0a\\\\\\", \\\\\\"17c9c895-5a16-7443-bb81-f34b30b21548\\\\\\", \\\\\\"f5f910c1-97ee-f7c0-1de4-048fbfbfce20\\\\\\"], \\\\\\"nodes\\\\\\": [{\\\\\\"properties\\\\\\": {}, \\\\\\"name\\\\\\": \\\\\\"Start\\\\\\", \\\\\\"children\\\\\\": [{\\\\\\"to\\\\\\": \\\\\\"f5f910c1-97ee-f7c0-1de4-048fbfbfce20\\\\\\"}], \\\\\\"actionParametersFetched\\\\\\": false, \\\\\\"type\\\\\\": \\\\\\"start-widget\\\\\\", \\\\\\"id\\\\\\": \\\\\\"3f107997-04cc-8733-60a9-a4bb62cebffc\\\\\\", \\\\\\"actionParameters\\\\\\": []}, {\\\\\\"properties\\\\\\": {}, \\\\\\"name\\\\\\": \\\\\\"End\\\\\\", \\\\\\"children\\\\\\": [], \\\\\\"actionParametersFetched\\\\\\": false, \\\\\\"type\\\\\\": \\\\\\"end-widget\\\\\\", \\\\\\"id\\\\\\": \\\\\\"33430f0f-ebfa-c3ec-f237-3e77efa03d0a\\\\\\", \\\\\\"actionParameters\\\\\\": []}, {\\\\\\"properties\\\\\\": {\\\\\\"body\\\\\\": \\\\\\"\\\\\\", \\\\\\"cc\\\\\\": \\\\\\"\\\\\\", \\\\\\"to\\\\\\": \\\\\\"\\\\\\", \\\\\\"enableMail\\\\\\": false, \\\\\\"message\\\\\\": \\\\\\"Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]\\\\\\", \\\\\\"subject\\\\\\": \\\\\\"\\\\\\"}, \\\\\\"name\\\\\\": \\\\\\"Kill\\\\\\", \\\\\\"children\\\\\\": [], \\\\\\"actionParametersFetched\\\\\\": false, \\\\\\"type\\\\\\": \\\\\\"kill-widget\\\\\\", \\\\\\"id\\\\\\": \\\\\\"17c9c895-5a16-7443-bb81-f34b30b21548\\\\\\", \\\\\\"actionParameters\\\\\\": []}, {\\\\\\"properties\\\\\\": {\\\\\\"files\\\\\\": [], \\\\\\"job_xml\\\\\\": \\\\\\"\\\\\\", \\\\\\"retry_interval\\\\\\": [], \\\\\\"retry_max\\\\\\": [], \\\\\\"job_properties\\\\\\": [], \\\\\\"capture_output\\\\\\": true, \\\\\\"shell_command\\\\\\": \\\\\\"ls\\\\\\", \\\\\\"arguments\\\\\\": [], \\\\\\"prepares\\\\\\": [], \\\\\\"credentials\\\\\\": [], \\\\\\"env_var\\\\\\": [], \\\\\\"sla\\\\\\": [{\\\\\\"value\\\\\\": false, \\\\\\"key\\\\\\": \\\\\\"enabled\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"${nominal_time}\\\\\\", \\\\\\"key\\\\\\": \\\\\\"nominal-time\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"should-start\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"${30 * MINUTES}\\\\\\", \\\\\\"key\\\\\\": \\\\\\"should-end\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"max-duration\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"alert-events\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"alert-contact\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"notification-msg\\\\\\"}, {\\\\\\"value\\\\\\": \\\\\\"\\\\\\", \\\\\\"key\\\\\\": \\\\\\"upstream-apps\\\\\\"}], \\\\\\"archives\\\\\\": []}, \\\\\\"name\\\\\\": \\\\\\"shell-f5f9\\\\\\", \\\\\\"children\\\\\\": [{\\\\\\"to\\\\\\": \\\\\\"33430f0f-ebfa-c3ec-f237-3e77efa03d0a\\\\\\"}, {\\\\\\"error\\\\\\": \\\\\\"17c9c895-5a16-7443-bb81-f34b30b21548\\\\\\"}], \\\\\\"actionParametersFetched\\\\\\": false, \\\\\\"type\\\\\\": \\\\\\"shell-widget\\\\\\", \\\\\\"id\\\\\\": \\\\\\"f5f910c1-97ee-f7c0-1de4-048fbfbfce20\\\\\\", \\\\\\"actionParameters\\\\\\": []}], \\\\\\"id\\\\\\": null, \\\\\\"nodeNamesMapping\\\\\\": {\\\\\\"f5f910c1-97ee-f7c0-1de4-048fbfbfce20\\\\\\": \\\\\\"shell-f5f9\\\\\\", \\\\\\"33430f0f-ebfa-c3ec-f237-3e77efa03d0a\\\\\\": \\\\\\"End\\\\\\", \\\\\\"3f107997-04cc-8733-60a9-a4bb62cebffc\\\\\\": \\\\\\"Start\\\\\\", \\\\\\"17c9c895-5a16-7443-bb81-f34b30b21548\\\\\\": \\\\\\"Kill\\\\\\"}, \\\\\\"uuid\\\\\\": \\\\\\"4a471e2a-0993-651b-a9f7-4e7724e4a01a\\\\\\"}}\\", \\n \\"name\\": \\"example-wf\\"\\n }\\n}\\n]\\n"'
response = self.c.post('/desktop/api2/doc/import/', {'documents': workflow_docs})
data = json.loads(response.content)
assert_true('message' in data, data)
assert_true('Installed 1 object' in data['message'], data)
wf_docs = Document2.objects.filter(name='example-wf')
assert_equal(1, wf_docs.count()) # Successfully imported by 'test' user
response = self.c.post(reverse('oozie:editor_submit_workflow', kwargs={'doc_id': wf_docs[0].id}),
data={
u'form-0-name': [u'oozie.use.system.libpath'],
u'form-MAX_NUM_FORMS': [u'1000'],
u'form-TOTAL_FORMS': [u'1'],
u'form-INITIAL_FORMS': [u'1'],
u'form-0-value': [u'True']
},
follow=True)
job = OozieServerProvider.wait_until_completion(response.context[0]['oozie_workflow'].id)
assert_true(job.status in ('SUCCEEDED', 'KILLED'), job.status)
class TestDashboardWithOozie(OozieBase):
def setUp(self):
super(TestDashboardWithOozie, self).setUp()
self.c = make_logged_in_client()
self.wf = create_workflow(self.c, self.user)
self.setup_simple_workflow()
def tearDown(self):
try:
self.wf.delete(skip_trash=True)
except:
LOG.exception('failed to tear down tests')
def test_submit_external_workflow(self):
# Check popup and reading workflow.xml and job.properties
oozie_xml = self.wf.to_xml({'output': '/path'})
deployment_dir = self.cluster.fs.mktemp(prefix='test_submit_external_workflow')
application_path = deployment_dir + '/workflow.xml'
self.cluster.fs.create(application_path, data=oozie_xml)
response = self.c.get(reverse('oozie:submit_external_job', kwargs={'application_path': application_path}))
assert_equal([{'name': 'SLEEP', 'value': ''}, {'name': 'output', 'value': ''}],
response.context[0]['params_form'].initial)
oozie_properties = """
#
# Licensed to the Hue
#
nameNode=hdfs://localhost:8020
jobTracker=localhost:8021
my_prop_not_filtered=10
"""
self.cluster.fs.create(deployment_dir + '/job.properties', data=oozie_properties)
response = self.c.get(reverse('oozie:submit_external_job', kwargs={'application_path': application_path}))
assert_equal([{'name': 'SLEEP', 'value': ''}, {'name': 'my_prop_not_filtered', 'value': '10'}, {'name': 'output', 'value': ''}],
response.context[0]['params_form'].initial)
# Submit, just check if submittion worked
response = self.c.post(reverse('oozie:submit_external_job', kwargs={'application_path': application_path}), {
u'form-MAX_NUM_FORMS': [u''],
u'form-TOTAL_FORMS': [u'3'],
u'form-INITIAL_FORMS': [u'3'],
u'form-0-name': [u'SLEEP'],
u'form-0-value': [u'ilovesleep'],
u'form-1-name': [u'my_prop_not_filtered'],
u'form-1-value': [u'10'],
u'form-2-name': [u'output'],
u'form-2-value': [u'/path/output'],
}, follow=True)
assert_true('oozie_workflow' in response.context[0]._data.keys(), response.content)
wf_id = response.context[0]._data['oozie_workflow'].id
# Check if response contains log data
response = self.c.get(reverse('oozie:get_oozie_job_log', args=[response.context[0]._data['oozie_workflow'].id]) + "?format=json&limit=100&loglevel=INFO&recent=2h:30m")
data = json.loads(response.content)
assert_true(len(data['log'].split('\n')) <= 100)
assert_equal('RUNNING', data['status'])
assert_true("INFO" in data['log'])
# Clean-up
response = self.c.post(reverse('oozie:manage_oozie_jobs', args=[wf_id, 'kill']))
data = json.loads(response.content)
assert_equal(0, data.get('status'), data)
def test_oozie_not_running_message(self):
raise SkipTest # Not reseting the oozie url for some reason
finish = OOZIE_URL.set_for_testing('http://not_localhost:11000/bad')
try:
response = self.c.get(reverse('oozie:list_oozie_workflows'))
assert_true('The Oozie server is not running' in response.content, response.content)
finally:
finish()
def test_httppool(self):
# With http pool the http connection is reused and so new connection count is 0
superuser_client = make_logged_in_client(is_superuser=True)
start_log = "--START HTTP POOL TEST--"
LOG.warn(start_log)
superuser_client.get(reverse('oozie:list_oozie_workflows'))
superuser_client.get(reverse('oozie:list_oozie_workflows') + "?format=json")
superuser_client.get(reverse('oozie:list_oozie_workflows') + "?format=json&status=RUNNING&status=PREP&status=SUSPENDED")
superuser_client.get(reverse('oozie:list_oozie_workflows') + "?format=json&status=KILLED&status=FAILED")
end_log = "--END HTTP POOL TEST--"
LOG.warn(end_log)
response = superuser_client.get(reverse(views.log_view))
s1 = response._container[0].index(start_log)
e1 = response._container[0].index(end_log)
c1 = response._container[0][e1:s1].count('Starting new HTTP')
assert_equal(c1, 0)
class TestDashboard(OozieMockBase):
def test_manage_workflow_dashboard(self):
# Display of buttons happens in js now
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]), {}, follow=True)
assert_true(('%s/kill' % MockOozieApi.WORKFLOW_IDS[0]) in response.content, response.content)
assert_true(('rerun_oozie_job/%s' % MockOozieApi.WORKFLOW_IDS[0]) in response.content, response.content)
assert_true(('%s/suspend' % MockOozieApi.WORKFLOW_IDS[0]) in response.content, response.content)
assert_true(('%s/resume' % MockOozieApi.WORKFLOW_IDS[0]) in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[1]]), {}, follow=True)
assert_true(('%s/kill' % MockOozieApi.WORKFLOW_IDS[1]) in response.content, response.content)
assert_true(('rerun_oozie_job/%s' % MockOozieApi.WORKFLOW_IDS[1]) in response.content, response.content)
def test_manage_coordinator_dashboard(self):
# Display of buttons happens in js now
response = self.c.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[0]]), {}, follow=True)
assert_true(('%s/kill' % MockOozieApi.COORDINATOR_IDS[0]) in response.content, response.content)
assert_true(('rerun_oozie_coord/%s' % MockOozieApi.COORDINATOR_IDS[0]) in response.content, response.content)
assert_true(('%s/suspend' % MockOozieApi.COORDINATOR_IDS[0]) in response.content, response.content)
assert_true(('%s/resume' % MockOozieApi.COORDINATOR_IDS[0]) in response.content, response.content)
# Test log filtering
url = reverse('oozie:get_oozie_job_log', args=[MockOozieApi.COORDINATOR_IDS[0]])
assert_true(url in response.content, response.content)
response = self.c.get(url + "?format=json&limit=100&loglevel=INFO&text=MapReduce")
data = json.loads(response.content)
assert_true(len(data['log'].split('\n')) <= 100)
assert_equal('RUNNING', data['status'])
assert_true("INFO" in data['log'])
def test_manage_bundles_dashboard(self):
# Display of buttons happens in js now
response = self.c.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]), {}, follow=True)
assert_true(('%s/kill' % MockOozieApi.BUNDLE_IDS[0]) in response.content, response.content)
assert_true(('rerun_oozie_bundle/%s' % MockOozieApi.BUNDLE_IDS[0]) in response.content, response.content)
assert_true(('%s/suspend' % MockOozieApi.BUNDLE_IDS[0]) in response.content, response.content)
assert_true(('%s/resume' % MockOozieApi.BUNDLE_IDS[0]) in response.content, response.content)
def test_rerun_coordinator(self):
response = self.c.get(reverse('oozie:rerun_oozie_coord', args=[MockOozieApi.WORKFLOW_IDS[0], '/path']))
assert_true('Rerun' in response.content, response.content)
def test_sync_coord_workflow(self):
wf_doc = save_temp_workflow(MockOozieApi.JSON_WORKFLOW_LIST[5], self.user)
reset = ENABLE_V2.set_for_testing(True)
try:
response = self.c.get(reverse('oozie:sync_coord_workflow', args=[MockOozieApi.WORKFLOW_IDS[5]]))
assert_equal([{'name':'Dryrun', 'value': False}, {'name':'ls_arg', 'value': '-l'}], response.context[0]['params_form'].initial)
finally:
wf_doc.delete()
reset()
def test_rerun_coordinator_permissions(self):
post_data = {
u'form-MAX_NUM_FORMS': [u''],
u'nocleanup': [u'on'],
u'refresh': [u'on'],
u'form-TOTAL_FORMS': [u'0'],
u'actions': [u'1'],
u'form-INITIAL_FORMS': [u'0']
}
response = self.c.post(reverse('oozie:rerun_oozie_coord', args=[MockOozieApi.COORDINATOR_IDS[0], '/path']), post_data)
assert_false('Permission denied' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
grant_access("not_me", "test", "oozie")
response = client_not_me.post(reverse('oozie:rerun_oozie_coord', args=[MockOozieApi.COORDINATOR_IDS[0], '/path']), post_data)
assert_true('Permission denied' in response.content, response.content)
def test_rerun_bundle(self):
response = self.c.get(reverse('oozie:rerun_oozie_coord', args=[MockOozieApi.WORKFLOW_IDS[0], '/path']))
assert_true('Rerun' in response.content, response.content)
def test_rerun_bundle_permissions(self):
post_data = {
u'end_1': [u'01:55 PM'],
u'end_0': [u'03/02/2013'],
u'refresh': [u'on'],
u'nocleanup': [u'on'],
u'start_0': [u'02/27/2013'],
u'start_1': [u'01:55 PM'],
u'coordinators': [u'DailySleep'],
u'form-MAX_NUM_FORMS': [u''],
u'form-TOTAL_FORMS': [u'3'],
u'form-INITIAL_FORMS': [u'3'],
u'form-0-name': [u'oozie.use.system.libpath'],
u'form-0-value': [u'true'],
u'form-1-name': [u'hue-id-b'],
u'form-1-value': [u'22'],
u'form-2-name': [u'oozie.bundle.application.path'],
u'form-2-value': [u'hdfs://localhost:8020/path'],
}
response = self.c.post(reverse('oozie:rerun_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0], '/path']), post_data)
assert_false('Permission denied' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
grant_access("not_me", "test", "oozie")
response = client_not_me.post(reverse('oozie:rerun_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0], '/path']), post_data)
assert_true('Permission denied' in response.content, response.content)
def test_list_workflows(self):
response = self.c.get(reverse('oozie:list_oozie_workflows'))
assert_true('Running' in response.content, response.content)
assert_true('Completed' in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_workflows') + "?format=json")
assert_true(len(json.loads(response.content)['jobs']) == 0)
response = self.c.get(reverse('oozie:list_oozie_workflows') + "?format=json&status=RUNNING&status=PREP&status=SUSPENDED")
for wf_id in MockOozieApi.WORKFLOW_IDS:
assert_true(wf_id in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_workflows') + "?format=json&status=KILLED&status=FAILED")
for wf_id in MockOozieApi.WORKFLOW_IDS:
assert_true(wf_id in response.content, response.content)
def test_list_coordinators(self):
response = self.c.get(reverse('oozie:list_oozie_coordinators'))
assert_true('Running' in response.content, response.content)
assert_true('Completed' in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_coordinators') + "?format=json")
assert_true(len(json.loads(response.content)['jobs']) == 0)
response = self.c.get(reverse('oozie:list_oozie_coordinators') + "?format=json&status=RUNNING&status=PREP&status=SUSPENDED")
for coord_id in MockOozieApi.COORDINATOR_IDS:
assert_true(coord_id in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_coordinators') + "?format=json&status=KILLED&status=FAILED&status=DONEWITHERROR")
for coord_id in MockOozieApi.COORDINATOR_IDS:
assert_true(coord_id in response.content, response.content)
def test_list_bundles(self):
response = self.c.get(reverse('oozie:list_oozie_bundles'))
assert_true('Running' in response.content, response.content)
assert_true('Completed' in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_bundles') + "?format=json&status=RUNNING")
for coord_id in MockOozieApi.BUNDLE_IDS:
assert_true(coord_id in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_bundles') + "?format=json&status=SUCCEEDED")
for coord_id in MockOozieApi.BUNDLE_IDS:
assert_true(coord_id in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_bundles') + "?format=json&status=KILLED")
for coord_id in MockOozieApi.BUNDLE_IDS:
assert_true(coord_id in response.content, response.content)
def test_list_workflow(self):
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]))
assert_true('Workflow WordCount1' in response.content, response.content)
assert_true('Workflow' in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]) + '?coordinator_job_id=%s' % MockOozieApi.COORDINATOR_IDS[0])
assert_true('Workflow WordCount1' in response.content, response.content)
assert_true('Workflow' in response.content, response.content)
assert_true('DailyWordCount1' in response.content, response.content)
assert_true('Coordinator' in response.content, response.content)
# Test for unicode character '�' rendering
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[6]]))
assert_false('UnicodeEncodeError' in response.content, response.content)
assert_true('TestUnicodeParam' in response.content, response.content)
def test_list_workflow_action(self):
response = self.c.get(reverse('oozie:list_oozie_workflow_action', args=['XXX']))
assert_true('Action WordCount' in response.content, response.content)
assert_true('job_201302280955_0018' in response.content, response.content)
assert_true('job_201302280955_0019' in response.content, response.content)
assert_true('job_201302280955_0020' in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_workflow_action', args=['XXX']) + '?coordinator_job_id=%s&bundle_job_id=%s' % (MockOozieApi.COORDINATOR_IDS[0], MockOozieApi.BUNDLE_IDS[0]))
assert_true('Bundle' in response.content, response.content)
assert_true('MyBundle1' in response.content, response.content)
assert_true('Coordinator' in response.content, response.content)
assert_true('DailyWordCount1' in response.content, response.content)
assert_true('Workflow' in response.content, response.content)
assert_true('WordCount1' in response.content, response.content)
def test_list_coordinator(self):
response = self.c.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[4]]))
assert_true(u'Coordinator DåilyWordCount5' in response.content.decode('utf-8', 'replace'), response.content.decode('utf-8', 'replace'))
assert_true('Workflow' in response.content, response.content)
# Test action list
response = self.c.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[5]]) + "?format=json&offset=1")
assert_true('00000013-120706144403213-oozie-oozi-C@1' in response.content, response.content)
assert_true('00000013-120706144403213-oozie-oozi-C@2' in response.content, response.content)
assert_true('00000013-120706144403213-oozie-oozi-C@3' in response.content, response.content)
assert_true('00000013-120706144403213-oozie-oozi-C@4' in response.content, response.content)
def test_list_bundle(self):
response = self.c.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]))
assert_true('Bundle MyBundle1' in response.content, response.content)
assert_true('Coordinators' in response.content, response.content)
def test_workflow_timezones(self):
job = MockOozieApi.get_job(MockOozieApi(), '0000007-120725142744176-oozie-oozi-W')
assert_equal(job.appName, 'WordCount5')
def test_manage_oozie_jobs(self):
try:
self.c.get(reverse('oozie:manage_oozie_jobs', args=[MockOozieApi.COORDINATOR_IDS[0], 'kill']))
assert False
except:
LOG.exception('failed to get oozie job')
response = self.c.post(reverse('oozie:manage_oozie_jobs', args=[MockOozieApi.COORDINATOR_IDS[0], 'kill']))
data = json.loads(response.content)
assert_equal(0, data['status'])
response = self.c.post(reverse('oozie:manage_oozie_jobs', args=[MockOozieApi.COORDINATOR_IDS[0], 'suspend']))
data = json.loads(response.content)
assert_equal(0, data['status'])
response = self.c.post(reverse('oozie:manage_oozie_jobs', args=[MockOozieApi.COORDINATOR_IDS[0], 'resume']))
data = json.loads(response.content)
assert_equal(0, data['status'])
params = {'actions': '1 2 3'}
response = self.c.post(reverse('oozie:manage_oozie_jobs', args=[MockOozieApi.COORDINATOR_IDS[0], 'ignore']), params)
data = json.loads(response.content)
assert_equal(0, data['status'])
params = {'end_time': u'Mon, 30 Jul 2012 22:35:48 GMT', 'pause_time': u'Mon, 30 Jul 2012 22:35:48 GMT',
'concurrency': '1', 'clear_pause_time': 'True'}
response = self.c.post(reverse('oozie:manage_oozie_jobs', args=[MockOozieApi.COORDINATOR_IDS[0], 'change']), params)
data = json.loads(response.content)
assert_equal(0, data['status'])
def test_workflows_permissions(self):
response = self.c.get(reverse('oozie:list_oozie_workflows') + '?format=json&status=SUCCEEDED')
assert_true('WordCount1' in response.content, response.content)
# Rerun
response = self.c.get(reverse('oozie:rerun_oozie_job', kwargs={'job_id': MockOozieApi.WORKFLOW_IDS[0],
'app_path': MockOozieApi.JSON_WORKFLOW_LIST[0]['appPath']}))
assert_false('Permission denied.' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
grant_access("not_me", "not_me", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_workflows') + '?format=json&status=SUCCEEDED')
assert_false('WordCount1' in response.content, response.content)
# Rerun
response = client_not_me.get(reverse('oozie:rerun_oozie_job', kwargs={'job_id': MockOozieApi.WORKFLOW_IDS[0],
'app_path': MockOozieApi.JSON_WORKFLOW_LIST[0]['appPath']}))
assert_true('Permission denied.' in response.content, response.content)
# Add read only access
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_workflows')+"?format=json&status=SUCCEEDED")
assert_true('WordCount1' in response.content, response.content)
# Rerun
response = client_not_me.get(reverse('oozie:rerun_oozie_job', kwargs={'job_id': MockOozieApi.WORKFLOW_IDS[0],
'app_path': MockOozieApi.JSON_WORKFLOW_LIST[0]['appPath']}))
assert_true('Permission denied.' in response.content, response.content)
def test_workflow_permissions(self):
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]))
assert_true('WordCount1' in response.content, response.content)
assert_false('Permission denied' in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_workflow_action', args=['XXX']))
assert_false('Permission denied' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
grant_access("not_me", "not_me", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]))
assert_true('Permission denied' in response.content, response.content)
response = client_not_me.get(reverse('oozie:list_oozie_workflow_action', args=['XXX']))
assert_true('Permission denied' in response.content, response.content)
# Add read only access
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]))
assert_false('Permission denied' in response.content, response.content)
def test_coordinators_permissions(self):
response = self.c.get(reverse('oozie:list_oozie_coordinators')+"?format=json&status=SUCCEEDED")
assert_true('DailyWordCount1' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
grant_access("not_me", "not_me", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_coordinators')+"?format=json&status=SUCCEEDED")
assert_false('DailyWordCount1' in response.content, response.content)
# Add read only access
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_coordinators')+"?format=json&status=SUCCEEDED")
assert_true('DailyWordCount1' in response.content, response.content)
def test_coordinator_permissions(self):
response = self.c.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[0]]))
assert_true('DailyWordCount1' in response.content, response.content)
assert_false('Permission denied' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
grant_access("not_me", "not_me", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[0]]))
assert_true('Permission denied' in response.content, response.content)
# Add read only access
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[0]]))
assert_false('Permission denied' in response.content, response.content)
def test_bundles_permissions(self):
response = self.c.get(reverse('oozie:list_oozie_bundles') + "?format=json&status=SUCCEEDED")
assert_true('MyBundle1' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
grant_access("not_me", "not_me", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_bundles')+"?format=json&status=SUCCEEDED")
assert_false('MyBundle1' in response.content, response.content)
# Add read only access
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_bundles')+"?format=json&status=SUCCEEDED")
assert_true('MyBundle1' in response.content, response.content)
def test_bundle_permissions(self):
response = self.c.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]))
assert_true('MyBundle1' in response.content, response.content)
assert_false('Permission denied' in response.content, response.content)
# Login as someone else
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
grant_access("not_me", "not_me", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]))
assert_true('Permission denied' in response.content, response.content)
# Add read only access
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
response = client_not_me.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]))
assert_false('Permission denied' in response.content, response.content)
def test_good_workflow_status_graph(self):
finish = ENABLE_V2.set_for_testing(False)
try:
workflow_count = Document.objects.available_docs(Workflow, self.user).count()
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]), {})
assert_true(response.context[1]._data['workflow_graph'])
assert_equal(Document.objects.available_docs(Workflow, self.user).count(), workflow_count)
finally:
finish()
def test_bad_workflow_status_graph(self):
finish = ENABLE_V2.set_for_testing(False)
try:
workflow_count = Document.objects.available_docs(Workflow, self.user).count()
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[1]]), {})
assert_true(response.context[1]['workflow_graph'] is None)
assert_equal(Document.objects.available_docs(Workflow, self.user).count(), workflow_count)
except:
LOG.exception('failed to test workflow status graph')
finish()
def test_list_oozie_sla(self):
response = self.c.get(reverse('oozie:list_oozie_sla'))
assert_true('Oozie Dashboard' in response.content, response.content)
response = self.c.get(reverse('oozie:list_oozie_sla') + "?format=json")
for sla in MockOozieApi.WORKFLOWS_SLAS:
assert_equal({"oozie_slas": []}, json.loads(response.content), response.content)
response = self.c.post(reverse('oozie:list_oozie_sla') + "?format=json", {'job_name': 'kochang'})
for sla in MockOozieApi.WORKFLOWS_SLAS:
assert_true('MISS' in response.content, response.content)
class GeneralTestsWithOozie(OozieBase):
def setUp(self):
OozieBase.setUp(self)
def test_import_jobsub_actions(self):
design = OozieDesign(owner=self.user, name="test")
action = OozieMapreduceAction(jar_path='/tmp/test.jar')
action.action_type = OozieMapreduceAction.ACTION_TYPE
action.save()
design.root_action = action
design.save()
try:
# There should be 3 from examples
action = convert_jobsub_design(design)
assert_equal(design.name, action.name)
assert_equal(design.description, action.description)
assert_equal(OozieMapreduceAction.ACTION_TYPE, action.node_type)
finally:
OozieDesign.objects.all().delete()
OozieMapreduceAction.objects.all().delete()
class TestUtils(OozieMockBase):
def setUp(self):
OozieMockBase.setUp(self)
# When updating wf, update wf_json as well!
self.wf = Document.objects.get_docs(self.user, Workflow).get(name='wf-name-1').content_object
def test_workflow_to_dict(self):
workflow_dict = workflow_to_dict(self.wf)
# Test properties
assert_true('job_xml' in workflow_dict, workflow_dict)
assert_true('is_shared' in workflow_dict, workflow_dict)
assert_true('end' in workflow_dict, workflow_dict)
assert_true('description' in workflow_dict, workflow_dict)
assert_true('parameters' in workflow_dict, workflow_dict)
assert_true('is_single' in workflow_dict, workflow_dict)
assert_true('deployment_dir' in workflow_dict, workflow_dict)
assert_true('schema_version' in workflow_dict, workflow_dict)
assert_true('job_properties' in workflow_dict, workflow_dict)
assert_true('start' in workflow_dict, workflow_dict)
assert_true('nodes' in workflow_dict, workflow_dict)
assert_true('id' in workflow_dict, workflow_dict)
assert_true('name' in workflow_dict, workflow_dict)
# Check links
for node in workflow_dict['nodes']:
assert_true('child_links' in node, node)
for link in node['child_links']:
assert_true('name' in link, link)
assert_true('comment' in link, link)
assert_true('parent' in link, link)
assert_true('child' in link, link)
def test_model_to_dict(self):
node_dict = model_to_dict(self.wf.node_set.filter(node_type='start')[0])
# Test properties
assert_true('id' in node_dict)
assert_true('name' in node_dict)
assert_true('description' in node_dict)
assert_true('node_type' in node_dict)
assert_true('workflow' in node_dict)
def test_smart_path(self):
assert_equal('${nameNode}/user/${wf:user()}/out', smart_path('out', {'output': '/path/out'}))
assert_equal('${nameNode}/path', smart_path('/path', {'output': '/path/out'}))
assert_equal('${nameNode}/path', smart_path('/path', {}))
assert_equal('${nameNode}${output}', smart_path('${output}', {'output': '/path/out'}))
assert_equal('hdfs://nn${output}', smart_path('hdfs://nn${output}', {'output': '/path/out'}))
assert_equal('${output}', smart_path('${output}', {}))
assert_equal('${output}', smart_path('${output}', {'output': 'hdfs://nn/path/out'}))
assert_equal('${output}', smart_path('${output}', {'output': '${path}'}))
assert_equal('${output_dir}', smart_path('${output_dir}', {'output': '/path/out', 'output_dir': 'hdfs://nn/path/out'}))
assert_equal('${nameNode}/user/${wf:user()}/out', smart_path(' out', {'output': '/path/out'}))
assert_equal('${nameNode}/user/${wf:user()}/out', smart_path(' out ', {'output': '/path/out'}))
assert_equal('hdfs://nn${output}', smart_path(' hdfs://nn${output}', {'output': '/path/out'}))
assert_equal('hdfs://nn${output}', smart_path(' hdfs://nn${output} ', {'output': '/path/out'}))
assert_equal('${output}', smart_path('${output}', None))
def test_contains_symlink(self):
assert_false(contains_symlink('out', {'output': '/path/out'}))
assert_true(contains_symlink('out#out', {'output': '/path/out'}))
assert_false(contains_symlink('${output}', {'output': '/path/out'}))
assert_true(contains_symlink('hdfs://nn${output}', {'output': '/path/out#out'}))
assert_false(contains_symlink('hdfs://nn${output}', {'output': '/path/out'}))
assert_true(contains_symlink('hdfs://nn#${output}', {'output': 'output'}))
assert_false(contains_symlink('${output}', {}))
assert_false(contains_symlink('${output}', {'output': '${path}'}))
assert_true(contains_symlink('${output_dir}', {'output': '/path/out', 'output_dir': 'hdfs://nn/path/out#out'}))
def test_convert_to_server_timezone(self):
# To UTC
assert_equal(convert_to_server_timezone('2015-07-01T10:10', local_tz='America/Los_Angeles', server_tz='UTC', user='test'), u'2015-07-01T17:10Z')
assert_equal(convert_to_server_timezone('2015-07-01T10:10', local_tz='Europe/Paris', server_tz='UTC', user='test'), u'2015-07-01T08:10Z')
# To GMT(+/-)####
assert_equal(convert_to_server_timezone('2015-07-01T10:10', local_tz='Asia/Jayapura', server_tz='GMT+0800', user='test'), u'2015-07-01T09:10+0800')
assert_equal(convert_to_server_timezone('2015-07-01T10:10', local_tz='Australia/LHI', server_tz='GMT-0530', user='test'), u'2015-06-30T18:10-0530')
# Previously created coordinators might have 'Z' appended, we consider them as UTC local time
assert_equal(convert_to_server_timezone('2015-07-01T10:10Z', local_tz='America/Los_Angeles', server_tz='UTC', user='test'), u'2015-07-01T10:10Z')
assert_equal(convert_to_server_timezone('2015-07-01T10:10Z', local_tz='Asia/Jayapura', server_tz='GMT+0800', user='test'), u'2015-07-01T18:10+0800')
assert_equal(convert_to_server_timezone('2015-07-01T10:10Z', local_tz='Australia/LHI', server_tz='GMT-0530', user='test'), u'2015-07-01T04:40-0530')
# Utils
WORKFLOW_DICT = {
u'deployment_dir': [u''], u'name': [u'wf-name-1'], u'description': [u''],
u'schema_version': [u'uri:oozie:workflow:0.4'],
u'parameters': [u'[{"name":"market","value":"US"}]'],
u'job_xml': [u'jobconf.xml'],
u'job_properties': [u'[{"name":"sleep-all","value":"${SLEEP}"}]']
}
COORDINATOR_DICT = {
u'name': [u'MyCoord'], u'description': [u'Description of my coordinator'],
u'workflow': [u'1'],
u'frequency_number': [u'1'], u'frequency_unit': [u'days'],
u'start_0': [u'07/01/2012'], u'start_1': [u'12:00 AM'],
u'end_0': [u'07/04/2012'], u'end_1': [u'12:00 AM'],
u'timezone': [u'America/Los_Angeles'],
u'parameters': [u'[{"name":"market","value":"US"}]'],
u'job_properties': [u'[{"name":"username","value":"${coord:user()}"},{"name":"SLEEP","value":"1000"}]'],
u'timeout': [u'100'],
u'concurrency': [u'3'],
u'execution': [u'FIFO'],
u'throttle': [u'10'],
u'schema_version': [u'uri:oozie:coordinator:0.2'],
u'cron_frequency': [u'0 0 * * *'],
u'isAdvancedCron': [u'on'],
}
BUNDLE_DICT = {
u'name': [u'MyBundle'], u'description': [u'Description of my bundle'],
u'parameters': [u'[{"name":"market","value":"US,France"}]'],
u'kick_off_time_0': [u'07/01/2012'], u'kick_off_time_1': [u'12:00 AM'],
u'schema_version': [u'uri:oozie:coordinator:0.2']
}
def add_node(workflow, name, node_type, parents, attrs={}):
"""
create a node of type node_type and associate the listed parents.
"""
NodeClass = NODE_TYPES[node_type]
node = NodeClass(workflow=workflow, node_type=node_type, name=name)
for attr in attrs:
setattr(node, attr, attrs[attr])
node.save()
# Add parent
# If skipped, remember to preserve order: regular links first, then error link
if parents:
for parent in parents:
name = 'ok'
if parent.node_type == 'start' or parent.node_type == 'join':
name = 'to'
elif parent.node_type == 'fork' or parent.node_type == 'decision':
name = 'start'
link = Link(parent=parent, child=node, name=name)
link.save()
# Create error link
if node_type != 'fork' and node_type != 'decision' and node_type != 'join':
link = Link(parent=node, child=Kill.objects.get(name='kill', workflow=workflow), name="error")
link.save()
return node
def create_workflow(client, user, workflow_dict=WORKFLOW_DICT):
name = str(workflow_dict['name'][0])
# If not infinite looping
Node.objects.filter(workflow__name=name).delete()
# Leaking here for some reason
for doc in list(chain(Document.objects.get_docs(user, Workflow).filter(name=name, extra=''),
Document.objects.filter(name='mapreduce1', owner__username='jobsub_test').all(),
Document.objects.filter(name='sleep_job-copy', owner__username='jobsub_test').all())):
if doc.content_object:
client.post(reverse('oozie:delete_workflow') + '?skip_trash=true', {'job_selection': [doc.content_object.id]}, follow=True)
else:
doc.delete()
workflow_count = Document.objects.available_docs(Workflow, user).count()
response = client.get(reverse('oozie:create_workflow'))
assert_equal(workflow_count, Document.objects.available_docs(Workflow, user).count(), response)
response = client.post(reverse('oozie:create_workflow'), workflow_dict, follow=True)
assert_equal(200, response.status_code)
assert_equal(workflow_count + 1, Document.objects.available_docs(Workflow, user).count())
wf = Document.objects.get_docs(user, Workflow).get(name=name, extra='').content_object
assert_not_equal('', wf.deployment_dir)
assert_true(wf.managed)
return wf
def create_coordinator(workflow, client, user):
name = str(COORDINATOR_DICT['name'][0])
if Document.objects.get_docs(user, Coordinator).filter(name=name).exists():
for doc in Document.objects.get_docs(user, Coordinator).filter(name=name):
if doc.content_object:
client.post(reverse('oozie:delete_coordinator') + '?skip_trash=true', {'job_selection': [doc.content_object.id]}, follow=True)
else:
doc.delete()
coord_count = Document.objects.available_docs(Coordinator, user).count()
response = client.get(reverse('oozie:create_coordinator'))
assert_equal(coord_count, Document.objects.available_docs(Coordinator, user).count(), response)
post = COORDINATOR_DICT.copy()
post['coordinatorworkflow'] = workflow.id
response = client.post(reverse('oozie:create_coordinator'), post)
assert_equal(coord_count + 1, Document.objects.available_docs(Coordinator, user).count(), response)
return Document.objects.available_docs(Coordinator, user).get(name=name).content_object
def create_bundle(client, user):
name = str(BUNDLE_DICT['name'][0])
if Document.objects.get_docs(user, Bundle).filter(name=name).exists():
for doc in Document.objects.get_docs(user, Bundle).filter(name=name):
if doc.content_object:
client.post(reverse('oozie:delete_bundle') + '?skip_trash=true', {'job_selection': [doc.content_object.id]}, follow=True)
else:
doc.delete()
bundle_count = Document.objects.available_docs(Bundle, user).count()
response = client.get(reverse('oozie:create_bundle'))
assert_equal(bundle_count, Document.objects.available_docs(Bundle, user).count(), response)
post = BUNDLE_DICT.copy()
response = client.post(reverse('oozie:create_bundle'), post)
assert_equal(bundle_count + 1, Document.objects.available_docs(Bundle, user).count(), response)
return Document.objects.available_docs(Bundle, user).get(name=name).content_object
def create_dataset(coord, client):
response = client.post(reverse('oozie:create_coordinator_dataset', args=[coord.id]), {
u'create-name': [u'MyDataset'], u'create-frequency_number': [u'1'], u'create-frequency_unit': [u'days'],
u'create-uri': [u'/data/${YEAR}${MONTH}${DAY}'],
u'create-instance_choice': [u'range'],
u'create-advanced_start_instance': [u'-1'],
u'create-advanced_end_instance': [u'${coord:current(1)}'],
u'create-start_0': [u'07/01/2012'], u'create-start_1': [u'12:00 AM'],
u'create-timezone': [u'America/Los_Angeles'], u'create-done_flag': [u''],
u'create-description': [u'']})
data = json.loads(response.content)
assert_equal(0, data['status'], data['data'])
def create_coordinator_data(coord, client):
dataset = Dataset.objects.get(coordinator=coord)
response = client.post(reverse('oozie:create_coordinator_data', args=[coord.id, 'input']),
{u'input-name': [u'input_dir'], u'input-dataset': [dataset.id]})
data = json.loads(response.content)
assert_equal(0, data['status'], data['data'])
def synchronize_workflow_attributes(workflow_json, correct_workflow_json):
if isinstance(workflow_json, basestring):
workflow_dict = json.loads(workflow_json)
else:
workflow_dict = workflow_json
if isinstance(correct_workflow_json, basestring):
correct_workflow_dict = json.loads(correct_workflow_json)
else:
correct_workflow_dict = correct_workflow_json
if 'attributes' in workflow_dict and 'attributes' in correct_workflow_dict:
workflow_dict['attributes']['deployment_dir'] = correct_workflow_dict['attributes']['deployment_dir']
return reformat_json(workflow_dict)
def save_temp_workflow(wf, user):
data = json.dumps({
'layout': [{
"size":12, "rows":[
{"widgets":[{"size":12, "name":"Start", "id":"3f107997-04cc-8733-60a9-a4bb62cebffc", "widgetType":"start-widget", "properties":{}, "offset":0, "isLoading":False, "klass":"card card-widget span12"}]},
{"widgets":[{"size":12, "name":"Shell", "id":"3f107997-04cc-8733-60a9-a4bb62cebabc", "widgetType":"shell-widget", "properties":{}, "offset":0, "isLoading":False, "klass":"card card-widget span12"}]},
{"widgets":[{"size":12, "name":"End", "id":"33430f0f-ebfa-c3ec-f237-3e77efa03d0a", "widgetType":"end-widget", "properties":{}, "offset":0, "isLoading":False, "klass":"card card-widget span12"}]},
{"widgets":[{"size":12, "name":"Kill", "id":"17c9c895-5a16-7443-bb81-f34b30b21548", "widgetType":"kill-widget", "properties":{}, "offset":0, "isLoading":False, "klass":"card card-widget span12"}]}
],
"drops":[ "temp"],
"klass":"card card-home card-column span12"
}],
'workflow': {
"id": None,
"uuid": None,
"name": "My Workflow",
"properties": {
"deployment_dir": "",
"description": "",
"job_xml": "",
"sla_enabled": False,
"schema_version": "uri:oozie:workflow:0.5",
"properties": [],
"parameters": [{'name':'Dryrun', 'value': False}, {'name':'ls_arg', 'value': '-l'}],
"sla": [
{'key': 'enabled', 'value': False}, # Always first element
{'key': 'nominal-time', 'value': '${nominal_time}'},
{'key': 'should-start', 'value': ''},
{'key': 'should-end', 'value': '${30 * MINUTES}'},
{'key': 'max-duration', 'value': ''},
{'key': 'alert-events', 'value': ''},
{'key': 'alert-contact', 'value': ''},
{'key': 'notification-msg', 'value': ''},
{'key': 'upstream-apps', 'value': ''},
],
"show_arrows": True,
"wf1_id": None
},
"nodes":[
{"id":"3f107997-04cc-8733-60a9-a4bb62cebffc","name":"Start","type":"start-widget","properties":{},"children":[{'to': '3f107997-04cc-8733-60a9-a4bb62cebabc'}]},
{"id":"3f107997-04cc-8733-60a9-a4bb62cebabc","name":"shell-fc94","type":"shell-widget","properties":{'archives': [], 'arguments': [], 'capture_output': True, 'credentials': [], 'env_var': [], 'files': [], 'job_properties': [], 'job_xml': u'', 'prepares': [], 'retry_interval': [], 'retry_max': [], 'shell_command': 'ls', 'sla': []},"children":[{'to': '33430f0f-ebfa-c3ec-f237-3e77efa03d0a'}]},
{"id":"33430f0f-ebfa-c3ec-f237-3e77efa03d0a","name":"End","type":"end-widget","properties":{},"children":[]},
{"id":"17c9c895-5a16-7443-bb81-f34b30b21548","name":"Kill","type":"kill-widget","properties":{'message': 'Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]'},"children":[]}
]
}
})
workflow_doc = Document2.objects.create(name='test', type='oozie-workflow2', owner=user, data=data)
Document.objects.link(workflow_doc, owner=workflow_doc.owner, name=workflow_doc.name, description=workflow_doc.description, extra='workflow2')
wf[u'conf'] = u'<configuration><property><name>hue-id-w</name><value>' + str(workflow_doc.id) + u'</value></property></configuration>'
return workflow_doc
| 51.076338 | 13,870 | 0.646659 | 26,610 | 208,085 | 4.895641 | 0.048365 | 0.040876 | 0.02223 | 0.036385 | 0.794025 | 0.755076 | 0.726866 | 0.690895 | 0.667306 | 0.644938 | 0.00001 | 0.037637 | 0.161093 | 208,085 | 4,073 | 13,871 | 51.088878 | 0.708628 | 0.022106 | 0 | 0.562706 | 0 | 0.019802 | 0.406389 | 0.183269 | 0 | 0 | 0 | 0.000491 | 0.192409 | 1 | 0.062376 | false | 0.00231 | 0.029373 | 0.00396 | 0.113861 | 0.00033 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
7ca30a8485818a98a5be22578dc2913c6c206c6b | 1,025 | py | Python | src/compas_fab_pychoreo/backend_features/frame_variant_generator.py | yijiangh/compas_fab_pychoreo | 42a03c85331f6bab9383e162c62b099a34593d5f | [
"MIT"
] | 1 | 2022-01-14T02:19:50.000Z | 2022-01-14T02:19:50.000Z | src/compas_fab_pychoreo/backend_features/frame_variant_generator.py | yijiangh/compas_fab_pychoreo | 42a03c85331f6bab9383e162c62b099a34593d5f | [
"MIT"
] | 2 | 2020-09-17T14:12:56.000Z | 2022-01-28T13:29:21.000Z | src/compas_fab_pychoreo/backend_features/frame_variant_generator.py | yijiangh/compas_fab_pychoreo | 42a03c85331f6bab9383e162c62b099a34593d5f | [
"MIT"
] | null | null | null | from abc import ABCMeta
from abc import abstractmethod
class FrameVariantGenerator(object):
"""Interface for a Planner's frame variation generation feature. Any implementation of
``FrameVariantGenerator`` must define the method ``generate_frame_variant``.
The ``__call__`` magic method allows an instance of an implementation of
``FrameVariantGenerator`` to be treated as its ``generate_frame_variant`` method.
See <https://docs.python.org/3/reference/datamodel.html#object.__call__> and
<https://en.wikipedia.org/wiki/Function_object#In_Python>.
"""
__metaclass__ = ABCMeta
def __call__(self, frame, options=None):
return self.generate_frame_variant(frame)
@abstractmethod
def generate_frame_variant(self, frame, options=None):
"""....
Parameters
----------
frame : :class:`compas.geometry.Frame`
TODO
Yield
-----
frame
frame variantion
"""
raise NotImplementedError()
| 31.060606 | 91 | 0.665366 | 109 | 1,025 | 6.018349 | 0.59633 | 0.079268 | 0.121951 | 0.060976 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001266 | 0.229268 | 1,025 | 32 | 92 | 32.03125 | 0.829114 | 0.555122 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03125 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.111111 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
7cbf8ae013a40b309ead33a425a761a54de1eaa4 | 266 | py | Python | mmdet/models/bbox_heads/__init__.py | XDUNZC/mmdetection_coco | 366777bdd40cd5d92a1e165bf20e6e062913f875 | [
"Apache-2.0"
] | null | null | null | mmdet/models/bbox_heads/__init__.py | XDUNZC/mmdetection_coco | 366777bdd40cd5d92a1e165bf20e6e062913f875 | [
"Apache-2.0"
] | null | null | null | mmdet/models/bbox_heads/__init__.py | XDUNZC/mmdetection_coco | 366777bdd40cd5d92a1e165bf20e6e062913f875 | [
"Apache-2.0"
] | null | null | null | from .bbox_head import BBoxHead
from .convfc_bbox_head import ConvFCBBoxHead, SharedFCBBoxHead, FeatureHead
from .double_bbox_head import DoubleConvFCBBoxHead
__all__ = [
'BBoxHead', 'ConvFCBBoxHead', 'SharedFCBBoxHead', 'DoubleConvFCBBoxHead', 'FeatureHead'
]
| 33.25 | 91 | 0.81203 | 25 | 266 | 8.28 | 0.48 | 0.115942 | 0.202899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 266 | 7 | 92 | 38 | 0.869748 | 0 | 0 | 0 | 0 | 0 | 0.259399 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
7cd629c04e096678ac56f3b8fad90dbd6a8baa04 | 59 | py | Python | opfython/utils/__init__.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 26 | 2018-04-24T20:16:18.000Z | 2022-03-09T14:03:28.000Z | opfython/utils/__init__.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 4 | 2020-12-26T14:57:18.000Z | 2022-03-30T02:34:18.000Z | opfython/utils/__init__.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 16 | 2019-05-20T15:41:56.000Z | 2022-03-23T17:59:53.000Z | """An utility package for all common opfython modules.
"""
| 19.666667 | 54 | 0.728814 | 8 | 59 | 5.375 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152542 | 59 | 2 | 55 | 29.5 | 0.86 | 0.864407 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
7cfa9c26b22bb74ba1fa52a749d368fdfa1707b4 | 165 | py | Python | examples/pywapi-yahoo-example.py | billmeyer/pywapi-0.3.8 | f7ce3246dfbf2a07c051d9ae4245016c9ba54a0e | [
"MIT"
] | 1 | 2016-07-30T20:45:53.000Z | 2016-07-30T20:45:53.000Z | examples/pywapi-yahoo-example.py | billmeyer/pywapi-0.3.8 | f7ce3246dfbf2a07c051d9ae4245016c9ba54a0e | [
"MIT"
] | 13 | 2016-04-09T17:47:18.000Z | 2016-04-09T17:47:18.000Z | examples/pywapi-yahoo-example.py | billmeyer/pywapi-0.3.8 | f7ce3246dfbf2a07c051d9ae4245016c9ba54a0e | [
"MIT"
] | 1 | 2020-05-24T19:10:39.000Z | 2020-05-24T19:10:39.000Z | #!/usr/bin/env python
import pywapi
import pprint
pp = pprint.PrettyPrinter(indent=4)
result = pywapi.get_weather_from_yahoo('10001', 'metric')
pp.pprint(result)
| 16.5 | 57 | 0.763636 | 24 | 165 | 5.125 | 0.75 | 0.130081 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040541 | 0.10303 | 165 | 9 | 58 | 18.333333 | 0.790541 | 0.121212 | 0 | 0 | 0 | 0 | 0.076923 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0.6 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 4 |
6b1e315ab28a556774fcf18425377db79a32c459 | 97 | py | Python | onlineclass/apps.py | ssoumyajit/imgapi2 | b2129f1d35d55e093a3d96272686ac25ea2cf7bb | [
"MIT"
] | null | null | null | onlineclass/apps.py | ssoumyajit/imgapi2 | b2129f1d35d55e093a3d96272686ac25ea2cf7bb | [
"MIT"
] | null | null | null | onlineclass/apps.py | ssoumyajit/imgapi2 | b2129f1d35d55e093a3d96272686ac25ea2cf7bb | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class OnlineclassConfig(AppConfig):
name = 'onlineclass'
| 16.166667 | 35 | 0.773196 | 10 | 97 | 7.5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154639 | 97 | 5 | 36 | 19.4 | 0.914634 | 0 | 0 | 0 | 0 | 0 | 0.113402 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
6b26f277e6150281a82a76cb47d648a74b2f254e | 496 | py | Python | home/hairygael/GESTURES/beforehappy.py | rv8flyboy/pyrobotlab | 4e04fb751614a5cb6044ea15dcfcf885db8be65a | [
"Apache-2.0"
] | 63 | 2015-02-03T18:49:43.000Z | 2022-03-29T03:52:24.000Z | home/hairygael/GESTURES/beforehappy.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 16 | 2016-01-26T19:13:29.000Z | 2018-11-25T21:20:51.000Z | home/hairygael/GESTURES/beforehappy.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 151 | 2015-01-03T18:55:54.000Z | 2022-03-04T07:04:23.000Z | def beforehappy():
i01.setHandSpeed("left", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
i01.setHandSpeed("right", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
i01.setArmSpeed("right", 0.85, 0.85, 0.85, 1.0)
i01.setArmSpeed("left", 1.0, 1.0, 1.0, 1.0)
i01.setHeadSpeed(0.65, 0.65)
i01.moveHead(84,88)
i01.moveArm("left",5,82,36,11)
i01.moveArm("right",74,112,61,29)
i01.moveHand("left",0,88,135,94,96,90)
i01.moveHand("right",81,79,118,47,0,90)
| 38.153846 | 63 | 0.542339 | 96 | 496 | 2.802083 | 0.34375 | 0.126394 | 0.144981 | 0.193309 | 0.182156 | 0.182156 | 0.182156 | 0.182156 | 0.182156 | 0.111524 | 0 | 0.295812 | 0.229839 | 496 | 12 | 64 | 41.333333 | 0.408377 | 0 | 0 | 0 | 0 | 0 | 0.072727 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | true | 0 | 0 | 0 | 0.090909 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
6b4249890070025375cb208e8f4daa9bc502c67f | 102 | py | Python | tests/wasp1/AllAnswerSets/choice_4.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/wasp1/AllAnswerSets/choice_4.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/wasp1/AllAnswerSets/choice_4.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
a v b :- w(X).
w(1) v w(2).
"""
output = """
{a, w(1)}
{a, w(2)}
{b, w(1)}
{b, w(2)}
"""
| 8.5 | 14 | 0.323529 | 24 | 102 | 1.375 | 0.375 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.077922 | 0.245098 | 102 | 11 | 15 | 9.272727 | 0.350649 | 0 | 0 | 0.2 | 0 | 0 | 0.686275 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8611d9874186cd0dc8e6d4d9e7b4c61e44069051 | 254 | py | Python | common/mylog.py | emaste-r/doctor_spider | 7527fb3010dbe1f52f4455d512080a094a62fa7b | [
"MIT"
] | null | null | null | common/mylog.py | emaste-r/doctor_spider | 7527fb3010dbe1f52f4455d512080a094a62fa7b | [
"MIT"
] | null | null | null | common/mylog.py | emaste-r/doctor_spider | 7527fb3010dbe1f52f4455d512080a094a62fa7b | [
"MIT"
] | null | null | null | # coding=utf-8
# # 导入配置
# cur_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
# logger_conf_path = os.path.join(cur_dir, './conf/logger.conf')
# fileConfig(logger_conf_path)
#
# # 全局logger
# logger = logging.getLogger("spiderLogger")
| 25.4 | 72 | 0.724409 | 36 | 254 | 4.833333 | 0.527778 | 0.137931 | 0.149425 | 0.172414 | 0.183908 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004367 | 0.098425 | 254 | 9 | 73 | 28.222222 | 0.755459 | 0.92126 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
861fd0b7aa63b523e71037b733ab0fa2df457fb3 | 175 | py | Python | class_0604/class_1.py | diaosi168/Test-demo | e09ca45a7cd1b898da13ef07ab3ac0598c7fafe1 | [
"Apache-2.0"
] | null | null | null | class_0604/class_1.py | diaosi168/Test-demo | e09ca45a7cd1b898da13ef07ab3ac0598c7fafe1 | [
"Apache-2.0"
] | null | null | null | class_0604/class_1.py | diaosi168/Test-demo | e09ca45a7cd1b898da13ef07ab3ac0598c7fafe1 | [
"Apache-2.0"
] | null | null | null | str_1='hello pyhton'
print(str_1[1],(str_1[4]))
print(str_1)
print(str_1[1:5])
print(str_1[2:])
print(str_1[4])
print(str_1*2)
print('hello\npyhton')
print(r'hello\npyhton')
| 15.909091 | 26 | 0.702857 | 38 | 175 | 3.026316 | 0.263158 | 0.278261 | 0.469565 | 0.173913 | 0.426087 | 0.243478 | 0 | 0 | 0 | 0 | 0 | 0.091463 | 0.062857 | 175 | 10 | 27 | 17.5 | 0.609756 | 0 | 0 | 0 | 0 | 0 | 0.218391 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.888889 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
863fe9745d29339c9e66a0731c6a20bf186376aa | 239 | py | Python | 12_module_basic/16_controller/moda.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | 12_module_basic/16_controller/moda.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | 12_module_basic/16_controller/moda.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | from mod import *
print(v)
print(f())
print(MyClass)
try:
print(_v)
except Exception:
print(Exception)
try:
print(_f())
except Exception:
print(Exception)
try:
print(_MyClass)
except Exception:
print(Exception)
| 11.380952 | 20 | 0.669456 | 30 | 239 | 5.233333 | 0.333333 | 0.152866 | 0.382166 | 0.55414 | 0.471338 | 0.471338 | 0 | 0 | 0 | 0 | 0 | 0 | 0.209205 | 239 | 20 | 21 | 11.95 | 0.830688 | 0 | 0 | 0.5625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.0625 | 0 | 0.0625 | 0.5625 | 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 | 0 | 0 | 0 | 1 | 0 | 4 |
8663c99dbcafd8cce30dbe3079becda778e29e3b | 3,848 | py | Python | tests/indicators/test_macd.py | huxuan/slothstock | 24795be790fc741908c7d0a21bf40ec88b689496 | [
"MIT"
] | 4 | 2020-03-11T16:32:22.000Z | 2021-12-19T14:37:49.000Z | tests/indicators/test_macd.py | huxuan/slothstock | 24795be790fc741908c7d0a21bf40ec88b689496 | [
"MIT"
] | null | null | null | tests/indicators/test_macd.py | huxuan/slothstock | 24795be790fc741908c7d0a21bf40ec88b689496 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unittests for MACD.
File: test_macd.py
Author: huxuan
Email: i(at)huxuan.org
"""
from datetime import datetime
import unittest
from slothstock.indicators import MACD
from slothstock.providers import XueQiu
class TestMACD(unittest.TestCase):
"""Unittests for MACD."""
def test_death(self):
"""Test for death."""
res = XueQiu.kline('000001.SH', 'day', datetime(2020, 1, 16))
macd = MACD(res.close)
self.assertTrue(macd.death)
macd = MACD(res.close[:-1])
self.assertFalse(macd.death)
def test_golden(self):
"""Test for golden."""
res = XueQiu.kline('000001.SH', 'day', datetime(2020, 2, 17))
macd = MACD(res.close)
self.assertTrue(macd.golden)
macd = MACD(res.close[:-1])
self.assertFalse(macd.golden)
def test_negative_positive_when_death(self):
"""Test for negative and positive when death cross."""
res = XueQiu.kline('000001.SH', 'day', datetime(2020, 2, 3))
macd = MACD(res.close)
self.assertTrue(macd.negative)
self.assertFalse(macd.positive)
macd = MACD(res.close[:-1])
self.assertFalse(macd.negative)
self.assertTrue(macd.positive)
def test_negative_positive_when_golden(self):
"""Test for negative and positive when golden cross."""
res = XueQiu.kline('000001.SH', 'day', datetime(2020, 2, 24))
macd = MACD(res.close)
self.assertFalse(macd.negative)
self.assertTrue(macd.positive)
macd = MACD(res.close[:-1])
self.assertTrue(macd.negative)
self.assertFalse(macd.positive)
def test_narrow_expand_when_narrow_in_golden(self):
"""Test for narrow and expand when just narrow in golden cross."""
res = XueQiu.kline('000001.SH', 'day', datetime(2020, 2, 25))
macd = MACD(res.close)
self.assertTrue(macd.narrow)
self.assertFalse(macd.expand)
macd = MACD(res.close[:-1])
self.assertFalse(macd.narrow)
self.assertTrue(macd.expand)
def test_narrow_expand_when_narrow_in_death(self):
"""Test for narrow and expand when just narrow in death cross."""
res = XueQiu.kline('000001.SH', 'day', datetime(2020, 2, 6))
macd = MACD(res.close)
self.assertTrue(macd.narrow)
self.assertFalse(macd.expand)
macd = MACD(res.close[:-1])
self.assertFalse(macd.narrow)
self.assertTrue(macd.expand)
def test_narrow_expand_when_cross_in_golden(self):
"""Test for narrow and expand when just cross in golden cross."""
res = XueQiu.kline('000001.SH', 'day', datetime(2020, 2, 17))
macd = MACD(res.close)
self.assertFalse(macd.narrow)
self.assertTrue(macd.expand)
macd = MACD(res.close[:-1])
self.assertTrue(macd.narrow)
self.assertFalse(macd.expand)
def test_narrow_expand_when_cross_in_death(self):
"""Test for narrow and expand when just cross in death cross."""
res = XueQiu.kline('000001.SH', 'day', datetime(2020, 1, 16))
macd = MACD(res.close)
self.assertFalse(macd.narrow)
self.assertTrue(macd.expand)
macd = MACD(res.close[:-1])
self.assertTrue(macd.narrow)
self.assertFalse(macd.expand)
def test_will_top_divergence(self):
"""Test for will_top_divergence property."""
res = XueQiu.kline('000016.SH', 'day', datetime(2019, 10, 21))
macd = MACD(res.close)
self.assertTrue(macd.will_top_divergence)
def test_will_bottom_divergence(self):
"""Test for will_bottom_divergence property."""
res = XueQiu.kline('000016.SH', 'week', datetime(2019, 1, 11))
macd = MACD(res.close)
self.assertTrue(macd.will_bottom_divergence)
| 35.962617 | 74 | 0.635655 | 496 | 3,848 | 4.832661 | 0.143145 | 0.060075 | 0.082603 | 0.12015 | 0.818523 | 0.775136 | 0.775136 | 0.673759 | 0.509387 | 0.49854 | 0 | 0.046606 | 0.230509 | 3,848 | 106 | 75 | 36.301887 | 0.762918 | 0.154106 | 0 | 0.630137 | 0 | 0 | 0.037919 | 0 | 0 | 0 | 0 | 0 | 0.410959 | 1 | 0.136986 | false | 0 | 0.054795 | 0 | 0.205479 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
867267cbcf540b4755cf64c72c28bd3e0aefc03f | 293,343 | py | Python | dialogflow_v2beta1/proto/intent_pb2.py | gertventer1970/dialogflow-python-client-v2 | e78b0e6765f94fb9ecbbc72c9fc30ce7245703e2 | [
"Apache-2.0"
] | 1 | 2020-10-14T07:43:19.000Z | 2020-10-14T07:43:19.000Z | dialogflow_v2beta1/proto/intent_pb2.py | everydaycodings/dialogflow-python-client-v2 | c1c925d94726f49e549870e087ad79ee491056e2 | [
"Apache-2.0"
] | null | null | null | dialogflow_v2beta1/proto/intent_pb2.py | everydaycodings/dialogflow-python-client-v2 | c1c925d94726f49e549870e087ad79ee491056e2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/dialogflow_v2beta1/proto/intent.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
from google.api import client_pb2 as google_dot_api_dot_client__pb2
from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2
from google.api import resource_pb2 as google_dot_api_dot_resource__pb2
from dialogflow_v2beta1.proto import (
audio_config_pb2 as google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_audio__config__pb2,
)
from dialogflow_v2beta1.proto import (
context_pb2 as google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_context__pb2,
)
from google.longrunning import (
operations_pb2 as google_dot_longrunning_dot_operations__pb2,
)
from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name="google/cloud/dialogflow_v2beta1/proto/intent.proto",
package="google.cloud.dialogflow.v2beta1",
syntax="proto3",
serialized_options=b"\n#com.google.cloud.dialogflow.v2beta1B\013IntentProtoP\001ZIgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow\370\001\001\242\002\002DF\252\002\037Google.Cloud.Dialogflow.V2beta1",
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n2google/cloud/dialogflow_v2beta1/proto/intent.proto\x12\x1fgoogle.cloud.dialogflow.v2beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x38google/cloud/dialogflow_v2beta1/proto/audio_config.proto\x1a\x33google/cloud/dialogflow_v2beta1/proto/context.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto"\xfdN\n\x06Intent\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12P\n\rwebhook_state\x18\x06 \x01(\x0e\x32\x34.google.cloud.dialogflow.v2beta1.Intent.WebhookStateB\x03\xe0\x41\x01\x12\x15\n\x08priority\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x18\n\x0bis_fallback\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\nml_enabled\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x18\n\x0bml_disabled\x18\x13 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x65nd_interaction\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12 \n\x13input_context_names\x18\x07 \x03(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x65vents\x18\x08 \x03(\tB\x03\xe0\x41\x01\x12U\n\x10training_phrases\x18\t \x03(\x0b\x32\x36.google.cloud.dialogflow.v2beta1.Intent.TrainingPhraseB\x03\xe0\x41\x01\x12\x13\n\x06\x61\x63tion\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x46\n\x0foutput_contexts\x18\x0b \x03(\x0b\x32(.google.cloud.dialogflow.v2beta1.ContextB\x03\xe0\x41\x01\x12\x1b\n\x0ereset_contexts\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12J\n\nparameters\x18\r \x03(\x0b\x32\x31.google.cloud.dialogflow.v2beta1.Intent.ParameterB\x03\xe0\x41\x01\x12\x41\n\x08messages\x18\x0e \x03(\x0b\x32/.google.cloud.dialogflow.v2beta1.Intent.Message\x12\x61\n\x1a\x64\x65\x66\x61ult_response_platforms\x18\x0f \x03(\x0e\x32\x38.google.cloud.dialogflow.v2beta1.Intent.Message.PlatformB\x03\xe0\x41\x01\x12&\n\x19root_followup_intent_name\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12(\n\x1bparent_followup_intent_name\x18\x11 \x01(\tB\x03\xe0\x41\x01\x12]\n\x14\x66ollowup_intent_info\x18\x12 \x03(\x0b\x32:.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfoB\x03\xe0\x41\x03\x1a\xec\x02\n\x0eTrainingPhrase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12N\n\x04type\x18\x02 \x01(\x0e\x32;.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.TypeB\x03\xe0\x41\x02\x12O\n\x05parts\x18\x03 \x03(\x0b\x32;.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.PartB\x03\xe0\x41\x02\x12\x1e\n\x11times_added_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x1aN\n\x04Part\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x13\n\x0b\x65ntity_type\x18\x02 \x01(\t\x12\r\n\x05\x61lias\x18\x03 \x01(\t\x12\x14\n\x0cuser_defined\x18\x04 \x01(\x08";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45XAMPLE\x10\x01\x12\x10\n\x08TEMPLATE\x10\x02\x1a\x02\x08\x01\x1a\xac\x01\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x15\n\rdefault_value\x18\x04 \x01(\t\x12 \n\x18\x65ntity_type_display_name\x18\x05 \x01(\t\x12\x11\n\tmandatory\x18\x06 \x01(\x08\x12\x0f\n\x07prompts\x18\x07 \x03(\t\x12\x0f\n\x07is_list\x18\x08 \x01(\x08\x1a\xc2@\n\x07Message\x12\x44\n\x04text\x18\x01 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2beta1.Intent.Message.TextH\x00\x12\x46\n\x05image\x18\x02 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2beta1.Intent.Message.ImageH\x00\x12U\n\rquick_replies\x18\x03 \x01(\x0b\x32<.google.cloud.dialogflow.v2beta1.Intent.Message.QuickRepliesH\x00\x12\x44\n\x04\x63\x61rd\x18\x04 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2beta1.Intent.Message.CardH\x00\x12*\n\x07payload\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12[\n\x10simple_responses\x18\x07 \x01(\x0b\x32?.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponsesH\x00\x12O\n\nbasic_card\x18\x08 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCardH\x00\x12R\n\x0bsuggestions\x18\t \x01(\x0b\x32;.google.cloud.dialogflow.v2beta1.Intent.Message.SuggestionsH\x00\x12`\n\x13link_out_suggestion\x18\n \x01(\x0b\x32\x41.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestionH\x00\x12Q\n\x0blist_select\x18\x0b \x01(\x0b\x32:.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelectH\x00\x12Y\n\x0f\x63\x61rousel_select\x18\x0c \x01(\x0b\x32>.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelectH\x00\x12\x62\n\x14telephony_play_audio\x18\r \x01(\x0b\x32\x42.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudioH\x00\x12p\n\x1btelephony_synthesize_speech\x18\x0e \x01(\x0b\x32I.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeechH\x00\x12h\n\x17telephony_transfer_call\x18\x0f \x01(\x0b\x32\x45.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCallH\x00\x12K\n\x08rbm_text\x18\x12 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2beta1.Intent.Message.RbmTextH\x00\x12\x65\n\x18rbm_standalone_rich_card\x18\x13 \x01(\x0b\x32\x41.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCardH\x00\x12\x61\n\x16rbm_carousel_rich_card\x18\x14 \x01(\x0b\x32?.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCardH\x00\x12\x62\n\x14\x62rowse_carousel_card\x18\x16 \x01(\x0b\x32\x42.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCardH\x00\x12O\n\ntable_card\x18\x17 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardH\x00\x12U\n\rmedia_content\x18\x18 \x01(\x0b\x32<.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContentH\x00\x12O\n\x08platform\x18\x06 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2beta1.Intent.Message.PlatformB\x03\xe0\x41\x01\x1a\x14\n\x04Text\x12\x0c\n\x04text\x18\x01 \x03(\t\x1a\x36\n\x05Image\x12\x11\n\timage_uri\x18\x01 \x01(\t\x12\x1a\n\x12\x61\x63\x63\x65ssibility_text\x18\x02 \x01(\t\x1a\x34\n\x0cQuickReplies\x12\r\n\x05title\x18\x01 \x01(\t\x12\x15\n\rquick_replies\x18\x02 \x03(\t\x1a\xb2\x01\n\x04\x43\x61rd\x12\r\n\x05title\x18\x01 \x01(\t\x12\x10\n\x08subtitle\x18\x02 \x01(\t\x12\x11\n\timage_uri\x18\x03 \x01(\t\x12L\n\x07\x62uttons\x18\x04 \x03(\x0b\x32;.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button\x1a(\n\x06\x42utton\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x10\n\x08postback\x18\x02 \x01(\t\x1aL\n\x0eSimpleResponse\x12\x16\n\x0etext_to_speech\x18\x01 \x01(\t\x12\x0c\n\x04ssml\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_text\x18\x03 \x01(\t\x1ak\n\x0fSimpleResponses\x12X\n\x10simple_responses\x18\x01 \x03(\x0b\x32>.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse\x1a\xfe\x02\n\tBasicCard\x12\r\n\x05title\x18\x01 \x01(\t\x12\x10\n\x08subtitle\x18\x02 \x01(\t\x12\x16\n\x0e\x66ormatted_text\x18\x03 \x01(\t\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2beta1.Intent.Message.Image\x12Q\n\x07\x62uttons\x18\x05 \x03(\x0b\x32@.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button\x1a\x9e\x01\n\x06\x42utton\x12\r\n\x05title\x18\x01 \x01(\t\x12g\n\x0fopen_uri_action\x18\x02 \x01(\x0b\x32N.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction\x1a\x1c\n\rOpenUriAction\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a\x1b\n\nSuggestion\x12\r\n\x05title\x18\x01 \x01(\t\x1a^\n\x0bSuggestions\x12O\n\x0bsuggestions\x18\x01 \x03(\x0b\x32:.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion\x1a:\n\x11LinkOutSuggestion\x12\x18\n\x10\x64\x65stination_name\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x1a\xc3\x02\n\nListSelect\x12\r\n\x05title\x18\x01 \x01(\t\x12N\n\x05items\x18\x02 \x03(\x0b\x32?.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item\x12\x15\n\x08subtitle\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\xbe\x01\n\x04Item\x12L\n\x04info\x18\x01 \x01(\x0b\x32>.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo\x12\r\n\x05title\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2beta1.Intent.Message.Image\x1a\xa5\x02\n\x0e\x43\x61rouselSelect\x12R\n\x05items\x18\x01 \x03(\x0b\x32\x43.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item\x1a\xbe\x01\n\x04Item\x12L\n\x04info\x18\x01 \x01(\x0b\x32>.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo\x12\r\n\x05title\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2beta1.Intent.Message.Image\x1a/\n\x0eSelectItemInfo\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x10\n\x08synonyms\x18\x02 \x03(\t\x1a\'\n\x12TelephonyPlayAudio\x12\x11\n\taudio_uri\x18\x01 \x01(\t\x1a\x45\n\x19TelephonySynthesizeSpeech\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x08\n\x06source\x1a-\n\x15TelephonyTransferCall\x12\x14\n\x0cphone_number\x18\x01 \x01(\t\x1an\n\x07RbmText\x12\x0c\n\x04text\x18\x01 \x01(\t\x12U\n\x0erbm_suggestion\x18\x02 \x03(\x0b\x32=.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion\x1a\x87\x02\n\x0fRbmCarouselCard\x12]\n\ncard_width\x18\x01 \x01(\x0e\x32I.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth\x12U\n\rcard_contents\x18\x02 \x03(\x0b\x32>.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent">\n\tCardWidth\x12\x1a\n\x16\x43\x41RD_WIDTH_UNSPECIFIED\x10\x00\x12\t\n\x05SMALL\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x1a\x82\x04\n\x11RbmStandaloneCard\x12k\n\x10\x63\x61rd_orientation\x18\x01 \x01(\x0e\x32Q.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation\x12|\n\x19thumbnail_image_alignment\x18\x02 \x01(\x0e\x32Y.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment\x12T\n\x0c\x63\x61rd_content\x18\x03 \x01(\x0b\x32>.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent"Q\n\x0f\x43\x61rdOrientation\x12 \n\x1c\x43\x41RD_ORIENTATION_UNSPECIFIED\x10\x00\x12\x0e\n\nHORIZONTAL\x10\x01\x12\x0c\n\x08VERTICAL\x10\x02"Y\n\x17ThumbnailImageAlignment\x12)\n%THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED\x10\x00\x12\x08\n\x04LEFT\x10\x01\x12\t\n\x05RIGHT\x10\x02\x1a\xb9\x03\n\x0eRbmCardContent\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12V\n\x05media\x18\x03 \x01(\x0b\x32G.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia\x12R\n\x0bsuggestions\x18\x04 \x03(\x0b\x32=.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion\x1a\xd6\x01\n\x08RbmMedia\x12\x10\n\x08\x66ile_uri\x18\x01 \x01(\t\x12\x15\n\rthumbnail_uri\x18\x02 \x01(\t\x12^\n\x06height\x18\x03 \x01(\x0e\x32N.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height"A\n\x06Height\x12\x16\n\x12HEIGHT_UNSPECIFIED\x10\x00\x12\t\n\x05SHORT\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04TALL\x10\x03\x1a\xc7\x01\n\rRbmSuggestion\x12R\n\x05reply\x18\x01 \x01(\x0b\x32\x41.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReplyH\x00\x12T\n\x06\x61\x63tion\x18\x02 \x01(\x0b\x32\x42.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedActionH\x00\x42\x0c\n\nsuggestion\x1a\x38\n\x11RbmSuggestedReply\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x15\n\rpostback_data\x18\x02 \x01(\t\x1a\x9b\x04\n\x12RbmSuggestedAction\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x15\n\rpostback_data\x18\x02 \x01(\t\x12i\n\x04\x64ial\x18\x03 \x01(\x0b\x32Y.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDialH\x00\x12p\n\x08open_url\x18\x04 \x01(\x0b\x32\\.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUriH\x00\x12|\n\x0eshare_location\x18\x05 \x01(\x0b\x32\x62.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocationH\x00\x1a.\n\x16RbmSuggestedActionDial\x12\x14\n\x0cphone_number\x18\x01 \x01(\t\x1a(\n\x19RbmSuggestedActionOpenUri\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a!\n\x1fRbmSuggestedActionShareLocationB\x08\n\x06\x61\x63tion\x1a\x8e\x04\n\x0cMediaContent\x12\x62\n\nmedia_type\x18\x01 \x01(\x0e\x32N.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType\x12g\n\rmedia_objects\x18\x02 \x03(\x0b\x32P.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject\x1a\xeb\x01\n\x13ResponseMediaObject\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12L\n\x0blarge_image\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2beta1.Intent.Message.ImageH\x00\x12\x45\n\x04icon\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2beta1.Intent.Message.ImageH\x00\x12\x13\n\x0b\x63ontent_url\x18\x05 \x01(\tB\x07\n\x05image"C\n\x11ResponseMediaType\x12#\n\x1fRESPONSE_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x1a\x80\x07\n\x12\x42rowseCarouselCard\x12h\n\x05items\x18\x01 \x03(\x0b\x32Y.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem\x12u\n\x15image_display_options\x18\x02 \x01(\x0e\x32V.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions\x1a\x90\x04\n\x16\x42rowseCarouselCardItem\x12\x80\x01\n\x0fopen_uri_action\x18\x01 \x01(\x0b\x32g.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction\x12\r\n\x05title\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2beta1.Intent.Message.Image\x12\x0e\n\x06\x66ooter\x18\x05 \x01(\t\x1a\xf8\x01\n\rOpenUrlAction\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x8a\x01\n\rurl_type_hint\x18\x03 \x01(\x0e\x32s.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint"M\n\x0bUrlTypeHint\x12\x1d\n\x19URL_TYPE_HINT_UNSPECIFIED\x10\x00\x12\x0e\n\nAMP_ACTION\x10\x01\x12\x0f\n\x0b\x41MP_CONTENT\x10\x02"v\n\x13ImageDisplayOptions\x12%\n!IMAGE_DISPLAY_OPTIONS_UNSPECIFIED\x10\x00\x12\x08\n\x04GRAY\x10\x01\x12\t\n\x05WHITE\x10\x02\x12\x0b\n\x07\x43ROPPED\x10\x03\x12\x16\n\x12\x42LURRED_BACKGROUND\x10\x04\x1a\xee\x02\n\tTableCard\x12\r\n\x05title\x18\x01 \x01(\t\x12\x10\n\x08subtitle\x18\x02 \x01(\t\x12\x44\n\x05image\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2beta1.Intent.Message.Image\x12[\n\x11\x63olumn_properties\x18\x04 \x03(\x0b\x32@.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties\x12J\n\x04rows\x18\x05 \x03(\x0b\x32<.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow\x12Q\n\x07\x62uttons\x18\x06 \x03(\x0b\x32@.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button\x1a\xfa\x01\n\x10\x43olumnProperties\x12\x0e\n\x06header\x18\x01 \x01(\t\x12r\n\x14horizontal_alignment\x18\x02 \x01(\x0e\x32T.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment"b\n\x13HorizontalAlignment\x12$\n HORIZONTAL_ALIGNMENT_UNSPECIFIED\x10\x00\x12\x0b\n\x07LEADING\x10\x01\x12\n\n\x06\x43\x45NTER\x10\x02\x12\x0c\n\x08TRAILING\x10\x03\x1as\n\x0cTableCardRow\x12L\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32=.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell\x12\x15\n\rdivider_after\x18\x02 \x01(\x08\x1a\x1d\n\rTableCardCell\x12\x0c\n\x04text\x18\x01 \x01(\t"\xaf\x01\n\x08Platform\x12\x18\n\x14PLATFORM_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x46\x41\x43\x45\x42OOK\x10\x01\x12\t\n\x05SLACK\x10\x02\x12\x0c\n\x08TELEGRAM\x10\x03\x12\x07\n\x03KIK\x10\x04\x12\t\n\x05SKYPE\x10\x05\x12\x08\n\x04LINE\x10\x06\x12\t\n\x05VIBER\x10\x07\x12\x15\n\x11\x41\x43TIONS_ON_GOOGLE\x10\x08\x12\r\n\tTELEPHONY\x10\n\x12\x13\n\x0fGOOGLE_HANGOUTS\x10\x0b\x42\t\n\x07message\x1aW\n\x12\x46ollowupIntentInfo\x12\x1c\n\x14\x66ollowup_intent_name\x18\x01 \x01(\t\x12#\n\x1bparent_followup_intent_name\x18\x02 \x01(\t"t\n\x0cWebhookState\x12\x1d\n\x19WEBHOOK_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15WEBHOOK_STATE_ENABLED\x10\x01\x12*\n&WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING\x10\x02:\x91\x01\xea\x41\x8d\x01\n dialogflow.googleapis.com/Intent\x12)projects/{project}/agent/intents/{intent}\x12>projects/{project}/locations/{location}/agent/intents/{intent}"\xd3\x01\n\x12ListIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\x12 dialogflow.googleapis.com/Intent\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x03 \x01(\x0e\x32+.google.cloud.dialogflow.v2beta1.IntentView\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t"h\n\x13ListIntentsResponse\x12\x38\n\x07intents\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2beta1.Intent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xa8\x01\n\x10GetIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n dialogflow.googleapis.com/Intent\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x03 \x01(\x0e\x32+.google.cloud.dialogflow.v2beta1.IntentView"\xeb\x01\n\x13\x43reateIntentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\x12 dialogflow.googleapis.com/Intent\x12<\n\x06intent\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2beta1.IntentB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x04 \x01(\x0e\x32+.google.cloud.dialogflow.v2beta1.IntentView"\xe2\x01\n\x13UpdateIntentRequest\x12<\n\x06intent\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2beta1.IntentB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12@\n\x0bintent_view\x18\x04 \x01(\x0e\x32+.google.cloud.dialogflow.v2beta1.IntentView"M\n\x13\x44\x65leteIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n dialogflow.googleapis.com/Intent"\xdd\x02\n\x19\x42\x61tchUpdateIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\x12 dialogflow.googleapis.com/Intent\x12\x1a\n\x10intent_batch_uri\x18\x02 \x01(\tH\x00\x12K\n\x13intent_batch_inline\x18\x03 \x01(\x0b\x32,.google.cloud.dialogflow.v2beta1.IntentBatchH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12/\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12@\n\x0bintent_view\x18\x06 \x01(\x0e\x32+.google.cloud.dialogflow.v2beta1.IntentViewB\x0e\n\x0cintent_batch"V\n\x1a\x42\x61tchUpdateIntentsResponse\x12\x38\n\x07intents\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2beta1.Intent"\x94\x01\n\x19\x42\x61tchDeleteIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\x12 dialogflow.googleapis.com/Intent\x12=\n\x07intents\x18\x02 \x03(\x0b\x32\'.google.cloud.dialogflow.v2beta1.IntentB\x03\xe0\x41\x02"G\n\x0bIntentBatch\x12\x38\n\x07intents\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2beta1.Intent*?\n\nIntentView\x12\x1b\n\x17INTENT_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10INTENT_VIEW_FULL\x10\x01\x32\xe3\x10\n\x07Intents\x12\x87\x02\n\x0bListIntents\x12\x33.google.cloud.dialogflow.v2beta1.ListIntentsRequest\x1a\x34.google.cloud.dialogflow.v2beta1.ListIntentsResponse"\x8c\x01\x82\xd3\xe4\x93\x02\x66\x12*/v2beta1/{parent=projects/*/agent}/intentsZ8\x12\x36/v2beta1/{parent=projects/*/locations/*/agent}/intents\xda\x41\x06parent\xda\x41\x14parent,language_code\x12\xf2\x01\n\tGetIntent\x12\x31.google.cloud.dialogflow.v2beta1.GetIntentRequest\x1a\'.google.cloud.dialogflow.v2beta1.Intent"\x88\x01\x82\xd3\xe4\x93\x02\x66\x12*/v2beta1/{name=projects/*/agent/intents/*}Z8\x12\x36/v2beta1/{name=projects/*/locations/*/agent/intents/*}\xda\x41\x04name\xda\x41\x12name,language_code\x12\x9a\x02\n\x0c\x43reateIntent\x12\x34.google.cloud.dialogflow.v2beta1.CreateIntentRequest\x1a\'.google.cloud.dialogflow.v2beta1.Intent"\xaa\x01\x82\xd3\xe4\x93\x02v"*/v2beta1/{parent=projects/*/agent}/intents:\x06intentZ@"6/v2beta1/{parent=projects/*/locations/*/agent}/intents:\x06intent\xda\x41\rparent,intent\xda\x41\x1bparent,intent,language_code\x12\xd3\x02\n\x0cUpdateIntent\x12\x34.google.cloud.dialogflow.v2beta1.UpdateIntentRequest\x1a\'.google.cloud.dialogflow.v2beta1.Intent"\xe3\x01\x82\xd3\xe4\x93\x02\x84\x01\x32\x31/v2beta1/{intent.name=projects/*/agent/intents/*}:\x06intentZG2=/v2beta1/{intent.name=projects/*/locations/*/agent/intents/*}:\x06intent\xda\x41\x12intent,update_mask\xda\x41\x06intent\xda\x41\x14intent,language_code\xda\x41 intent,language_code,update_mask\x12\xd1\x01\n\x0c\x44\x65leteIntent\x12\x34.google.cloud.dialogflow.v2beta1.DeleteIntentRequest\x1a\x16.google.protobuf.Empty"s\x82\xd3\xe4\x93\x02\x66**/v2beta1/{name=projects/*/agent/intents/*}Z8*6/v2beta1/{name=projects/*/locations/*/agent/intents/*}\xda\x41\x04name\x12\xd4\x02\n\x12\x42\x61tchUpdateIntents\x12:.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest\x1a\x1d.google.longrunning.Operation"\xe2\x01\x82\xd3\xe4\x93\x02\x84\x01"6/v2beta1/{parent=projects/*/agent}/intents:batchUpdate:\x01*ZG"B/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchUpdate:\x01*\xca\x41T\n:google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse\x12\x16google.protobuf.Struct\x12\xc0\x02\n\x12\x42\x61tchDeleteIntents\x12:.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest\x1a\x1d.google.longrunning.Operation"\xce\x01\x82\xd3\xe4\x93\x02\x84\x01"6/v2beta1/{parent=projects/*/agent}/intents:batchDelete:\x01*ZG"B/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchDelete:\x01*\xda\x41\x0eparent,intents\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xa9\x01\n#com.google.cloud.dialogflow.v2beta1B\x0bIntentProtoP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1fGoogle.Cloud.Dialogflow.V2beta1b\x06proto3',
dependencies=[
google_dot_api_dot_annotations__pb2.DESCRIPTOR,
google_dot_api_dot_client__pb2.DESCRIPTOR,
google_dot_api_dot_field__behavior__pb2.DESCRIPTOR,
google_dot_api_dot_resource__pb2.DESCRIPTOR,
google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_audio__config__pb2.DESCRIPTOR,
google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_context__pb2.DESCRIPTOR,
google_dot_longrunning_dot_operations__pb2.DESCRIPTOR,
google_dot_protobuf_dot_duration__pb2.DESCRIPTOR,
google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,
google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR,
google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,
],
)
_INTENTVIEW = _descriptor.EnumDescriptor(
name="IntentView",
full_name="google.cloud.dialogflow.v2beta1.IntentView",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="INTENT_VIEW_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="INTENT_VIEW_FULL",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=12288,
serialized_end=12351,
)
_sym_db.RegisterEnumDescriptor(_INTENTVIEW)
IntentView = enum_type_wrapper.EnumTypeWrapper(_INTENTVIEW)
INTENT_VIEW_UNSPECIFIED = 0
INTENT_VIEW_FULL = 1
_INTENT_TRAININGPHRASE_TYPE = _descriptor.EnumDescriptor(
name="Type",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="TYPE_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="EXAMPLE",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="TEMPLATE",
index=2,
number=2,
serialized_options=b"\010\001",
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=1735,
serialized_end=1794,
)
_sym_db.RegisterEnumDescriptor(_INTENT_TRAININGPHRASE_TYPE)
_INTENT_MESSAGE_RBMCAROUSELCARD_CARDWIDTH = _descriptor.EnumDescriptor(
name="CardWidth",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="CARD_WIDTH_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="SMALL",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="MEDIUM",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=6018,
serialized_end=6080,
)
_sym_db.RegisterEnumDescriptor(_INTENT_MESSAGE_RBMCAROUSELCARD_CARDWIDTH)
_INTENT_MESSAGE_RBMSTANDALONECARD_CARDORIENTATION = _descriptor.EnumDescriptor(
name="CardOrientation",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="CARD_ORIENTATION_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="HORIZONTAL",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="VERTICAL",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=6425,
serialized_end=6506,
)
_sym_db.RegisterEnumDescriptor(_INTENT_MESSAGE_RBMSTANDALONECARD_CARDORIENTATION)
_INTENT_MESSAGE_RBMSTANDALONECARD_THUMBNAILIMAGEALIGNMENT = _descriptor.EnumDescriptor(
name="ThumbnailImageAlignment",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="LEFT",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="RIGHT",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=6508,
serialized_end=6597,
)
_sym_db.RegisterEnumDescriptor(
_INTENT_MESSAGE_RBMSTANDALONECARD_THUMBNAILIMAGEALIGNMENT
)
_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA_HEIGHT = _descriptor.EnumDescriptor(
name="Height",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="HEIGHT_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="SHORT",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="MEDIUM",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="TALL",
index=3,
number=3,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=6976,
serialized_end=7041,
)
_sym_db.RegisterEnumDescriptor(_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA_HEIGHT)
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIATYPE = _descriptor.EnumDescriptor(
name="ResponseMediaType",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="RESPONSE_MEDIA_TYPE_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="AUDIO",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=8305,
serialized_end=8372,
)
_sym_db.RegisterEnumDescriptor(_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIATYPE)
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION_URLTYPEHINT = _descriptor.EnumDescriptor(
name="UrlTypeHint",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="URL_TYPE_HINT_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="AMP_ACTION",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="AMP_CONTENT",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=9074,
serialized_end=9151,
)
_sym_db.RegisterEnumDescriptor(
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION_URLTYPEHINT
)
_INTENT_MESSAGE_BROWSECAROUSELCARD_IMAGEDISPLAYOPTIONS = _descriptor.EnumDescriptor(
name="ImageDisplayOptions",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="IMAGE_DISPLAY_OPTIONS_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="GRAY",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="WHITE",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="CROPPED",
index=3,
number=3,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="BLURRED_BACKGROUND",
index=4,
number=4,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=9153,
serialized_end=9271,
)
_sym_db.RegisterEnumDescriptor(_INTENT_MESSAGE_BROWSECAROUSELCARD_IMAGEDISPLAYOPTIONS)
_INTENT_MESSAGE_COLUMNPROPERTIES_HORIZONTALALIGNMENT = _descriptor.EnumDescriptor(
name="HorizontalAlignment",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="HORIZONTAL_ALIGNMENT_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="LEADING",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="CENTER",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="TRAILING",
index=3,
number=3,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=9795,
serialized_end=9893,
)
_sym_db.RegisterEnumDescriptor(_INTENT_MESSAGE_COLUMNPROPERTIES_HORIZONTALALIGNMENT)
_INTENT_MESSAGE_PLATFORM = _descriptor.EnumDescriptor(
name="Platform",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Platform",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="PLATFORM_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="FACEBOOK",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="SLACK",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="TELEGRAM",
index=3,
number=3,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="KIK",
index=4,
number=4,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="SKYPE",
index=5,
number=5,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="LINE",
index=6,
number=6,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="VIBER",
index=7,
number=7,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="ACTIONS_ON_GOOGLE",
index=8,
number=8,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="TELEPHONY",
index=9,
number=10,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="GOOGLE_HANGOUTS",
index=10,
number=11,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=10044,
serialized_end=10219,
)
_sym_db.RegisterEnumDescriptor(_INTENT_MESSAGE_PLATFORM)
_INTENT_WEBHOOKSTATE = _descriptor.EnumDescriptor(
name="WebhookState",
full_name="google.cloud.dialogflow.v2beta1.Intent.WebhookState",
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name="WEBHOOK_STATE_UNSPECIFIED",
index=0,
number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="WEBHOOK_STATE_ENABLED",
index=1,
number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.EnumValueDescriptor(
name="WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING",
index=2,
number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key,
),
],
containing_type=None,
serialized_options=None,
serialized_start=10321,
serialized_end=10437,
)
_sym_db.RegisterEnumDescriptor(_INTENT_WEBHOOKSTATE)
_INTENT_TRAININGPHRASE_PART = _descriptor.Descriptor(
name="Part",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.text",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="entity_type",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.entity_type",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="alias",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.alias",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="user_defined",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.user_defined",
index=3,
number=4,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=1655,
serialized_end=1733,
)
_INTENT_TRAININGPHRASE = _descriptor.Descriptor(
name="TrainingPhrase",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="name",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="type",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.type",
index=1,
number=2,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\002",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="parts",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.parts",
index=2,
number=3,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\002",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="times_added_count",
full_name="google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.times_added_count",
index=3,
number=4,
type=5,
cpp_type=1,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_INTENT_TRAININGPHRASE_PART],
enum_types=[_INTENT_TRAININGPHRASE_TYPE],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=1430,
serialized_end=1794,
)
_INTENT_PARAMETER = _descriptor.Descriptor(
name="Parameter",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="name",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter.name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="display_name",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter.display_name",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="value",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter.value",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="default_value",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter.default_value",
index=3,
number=4,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="entity_type_display_name",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter.entity_type_display_name",
index=4,
number=5,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="mandatory",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter.mandatory",
index=5,
number=6,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="prompts",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter.prompts",
index=6,
number=7,
type=9,
cpp_type=9,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="is_list",
full_name="google.cloud.dialogflow.v2beta1.Intent.Parameter.is_list",
index=7,
number=8,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=1797,
serialized_end=1969,
)
_INTENT_MESSAGE_TEXT = _descriptor.Descriptor(
name="Text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Text",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Text.text",
index=0,
number=1,
type=9,
cpp_type=9,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=3804,
serialized_end=3824,
)
_INTENT_MESSAGE_IMAGE = _descriptor.Descriptor(
name="Image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Image",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="image_uri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Image.image_uri",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="accessibility_text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Image.accessibility_text",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=3826,
serialized_end=3880,
)
_INTENT_MESSAGE_QUICKREPLIES = _descriptor.Descriptor(
name="QuickReplies",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.title",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="quick_replies",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.quick_replies",
index=1,
number=2,
type=9,
cpp_type=9,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=3882,
serialized_end=3934,
)
_INTENT_MESSAGE_CARD_BUTTON = _descriptor.Descriptor(
name="Button",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.text",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="postback",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.postback",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4075,
serialized_end=4115,
)
_INTENT_MESSAGE_CARD = _descriptor.Descriptor(
name="Card",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Card",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Card.title",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="subtitle",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Card.subtitle",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="image_uri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Card.image_uri",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="buttons",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Card.buttons",
index=3,
number=4,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_INTENT_MESSAGE_CARD_BUTTON],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=3937,
serialized_end=4115,
)
_INTENT_MESSAGE_SIMPLERESPONSE = _descriptor.Descriptor(
name="SimpleResponse",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text_to_speech",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.text_to_speech",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="ssml",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.ssml",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="display_text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.display_text",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4117,
serialized_end=4193,
)
_INTENT_MESSAGE_SIMPLERESPONSES = _descriptor.Descriptor(
name="SimpleResponses",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="simple_responses",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.simple_responses",
index=0,
number=1,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4195,
serialized_end=4302,
)
_INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION = _descriptor.Descriptor(
name="OpenUriAction",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="uri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.uri",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4659,
serialized_end=4687,
)
_INTENT_MESSAGE_BASICCARD_BUTTON = _descriptor.Descriptor(
name="Button",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.title",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="open_uri_action",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.open_uri_action",
index=1,
number=2,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4529,
serialized_end=4687,
)
_INTENT_MESSAGE_BASICCARD = _descriptor.Descriptor(
name="BasicCard",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.title",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="subtitle",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.subtitle",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="formatted_text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.formatted_text",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.image",
index=3,
number=4,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="buttons",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.buttons",
index=4,
number=5,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_INTENT_MESSAGE_BASICCARD_BUTTON],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4305,
serialized_end=4687,
)
_INTENT_MESSAGE_SUGGESTION = _descriptor.Descriptor(
name="Suggestion",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.title",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4689,
serialized_end=4716,
)
_INTENT_MESSAGE_SUGGESTIONS = _descriptor.Descriptor(
name="Suggestions",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="suggestions",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.suggestions",
index=0,
number=1,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4718,
serialized_end=4812,
)
_INTENT_MESSAGE_LINKOUTSUGGESTION = _descriptor.Descriptor(
name="LinkOutSuggestion",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="destination_name",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.destination_name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="uri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.uri",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4814,
serialized_end=4872,
)
_INTENT_MESSAGE_LISTSELECT_ITEM = _descriptor.Descriptor(
name="Item",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="info",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.info",
index=0,
number=1,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.title",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="description",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.description",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.image",
index=3,
number=4,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=5008,
serialized_end=5198,
)
_INTENT_MESSAGE_LISTSELECT = _descriptor.Descriptor(
name="ListSelect",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.title",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="items",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.items",
index=1,
number=2,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="subtitle",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.subtitle",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_INTENT_MESSAGE_LISTSELECT_ITEM],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=4875,
serialized_end=5198,
)
_INTENT_MESSAGE_CAROUSELSELECT_ITEM = _descriptor.Descriptor(
name="Item",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="info",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.info",
index=0,
number=1,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.title",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="description",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.description",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.image",
index=3,
number=4,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=5008,
serialized_end=5198,
)
_INTENT_MESSAGE_CAROUSELSELECT = _descriptor.Descriptor(
name="CarouselSelect",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="items",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.items",
index=0,
number=1,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[_INTENT_MESSAGE_CAROUSELSELECT_ITEM],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=5201,
serialized_end=5494,
)
_INTENT_MESSAGE_SELECTITEMINFO = _descriptor.Descriptor(
name="SelectItemInfo",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="key",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.key",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="synonyms",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.synonyms",
index=1,
number=2,
type=9,
cpp_type=9,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=5496,
serialized_end=5543,
)
_INTENT_MESSAGE_TELEPHONYPLAYAUDIO = _descriptor.Descriptor(
name="TelephonyPlayAudio",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="audio_uri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.audio_uri",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=5545,
serialized_end=5584,
)
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH = _descriptor.Descriptor(
name="TelephonySynthesizeSpeech",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.text",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="ssml",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.ssml",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name="source",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.source",
index=0,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[],
)
],
serialized_start=5586,
serialized_end=5655,
)
_INTENT_MESSAGE_TELEPHONYTRANSFERCALL = _descriptor.Descriptor(
name="TelephonyTransferCall",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="phone_number",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.phone_number",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=5657,
serialized_end=5702,
)
_INTENT_MESSAGE_RBMTEXT = _descriptor.Descriptor(
name="RbmText",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmText",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.text",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="rbm_suggestion",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.rbm_suggestion",
index=1,
number=2,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=5704,
serialized_end=5814,
)
_INTENT_MESSAGE_RBMCAROUSELCARD = _descriptor.Descriptor(
name="RbmCarouselCard",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="card_width",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.card_width",
index=0,
number=1,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="card_contents",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.card_contents",
index=1,
number=2,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[_INTENT_MESSAGE_RBMCAROUSELCARD_CARDWIDTH],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=5817,
serialized_end=6080,
)
_INTENT_MESSAGE_RBMSTANDALONECARD = _descriptor.Descriptor(
name="RbmStandaloneCard",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="card_orientation",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.card_orientation",
index=0,
number=1,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="thumbnail_image_alignment",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.thumbnail_image_alignment",
index=1,
number=2,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="card_content",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.card_content",
index=2,
number=3,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[
_INTENT_MESSAGE_RBMSTANDALONECARD_CARDORIENTATION,
_INTENT_MESSAGE_RBMSTANDALONECARD_THUMBNAILIMAGEALIGNMENT,
],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=6083,
serialized_end=6597,
)
_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA = _descriptor.Descriptor(
name="RbmMedia",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="file_uri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.file_uri",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="thumbnail_uri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.thumbnail_uri",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="height",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.height",
index=2,
number=3,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA_HEIGHT],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=6827,
serialized_end=7041,
)
_INTENT_MESSAGE_RBMCARDCONTENT = _descriptor.Descriptor(
name="RbmCardContent",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.title",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="description",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.description",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="media",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.media",
index=2,
number=3,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="suggestions",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.suggestions",
index=3,
number=4,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=6600,
serialized_end=7041,
)
_INTENT_MESSAGE_RBMSUGGESTION = _descriptor.Descriptor(
name="RbmSuggestion",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="reply",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.reply",
index=0,
number=1,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="action",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.action",
index=1,
number=2,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name="suggestion",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.suggestion",
index=0,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[],
)
],
serialized_start=7044,
serialized_end=7243,
)
_INTENT_MESSAGE_RBMSUGGESTEDREPLY = _descriptor.Descriptor(
name="RbmSuggestedReply",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.text",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="postback_data",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.postback_data",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=7245,
serialized_end=7301,
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONDIAL = _descriptor.Descriptor(
name="RbmSuggestedActionDial",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="phone_number",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.phone_number",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=7710,
serialized_end=7756,
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONOPENURI = _descriptor.Descriptor(
name="RbmSuggestedActionOpenUri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="uri",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.uri",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=7758,
serialized_end=7798,
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONSHARELOCATION = _descriptor.Descriptor(
name="RbmSuggestedActionShareLocation",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=7800,
serialized_end=7833,
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION = _descriptor.Descriptor(
name="RbmSuggestedAction",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.text",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="postback_data",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.postback_data",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="dial",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.dial",
index=2,
number=3,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="open_url",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.open_url",
index=3,
number=4,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="share_location",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.share_location",
index=4,
number=5,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONDIAL,
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONOPENURI,
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONSHARELOCATION,
],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name="action",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.action",
index=0,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[],
)
],
serialized_start=7304,
serialized_end=7843,
)
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT = _descriptor.Descriptor(
name="ResponseMediaObject",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="name",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="description",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.description",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="large_image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.large_image",
index=2,
number=3,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="icon",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.icon",
index=3,
number=4,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="content_url",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.content_url",
index=4,
number=5,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name="image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.image",
index=0,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[],
)
],
serialized_start=8068,
serialized_end=8303,
)
_INTENT_MESSAGE_MEDIACONTENT = _descriptor.Descriptor(
name="MediaContent",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="media_type",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.media_type",
index=0,
number=1,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="media_objects",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.media_objects",
index=1,
number=2,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT],
enum_types=[_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIATYPE],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=7846,
serialized_end=8372,
)
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION = _descriptor.Descriptor(
name="OpenUrlAction",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="url",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.url",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="url_type_hint",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.url_type_hint",
index=1,
number=3,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION_URLTYPEHINT
],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=8903,
serialized_end=9151,
)
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM = _descriptor.Descriptor(
name="BrowseCarouselCardItem",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="open_uri_action",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.open_uri_action",
index=0,
number=1,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.title",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="description",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.description",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.image",
index=3,
number=4,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="footer",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.footer",
index=4,
number=5,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION
],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=8623,
serialized_end=9151,
)
_INTENT_MESSAGE_BROWSECAROUSELCARD = _descriptor.Descriptor(
name="BrowseCarouselCard",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="items",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.items",
index=0,
number=1,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="image_display_options",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.image_display_options",
index=1,
number=2,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM],
enum_types=[_INTENT_MESSAGE_BROWSECAROUSELCARD_IMAGEDISPLAYOPTIONS],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=8375,
serialized_end=9271,
)
_INTENT_MESSAGE_TABLECARD = _descriptor.Descriptor(
name="TableCard",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCard",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="title",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.title",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="subtitle",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.subtitle",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.image",
index=2,
number=3,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="column_properties",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.column_properties",
index=3,
number=4,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="rows",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.rows",
index=4,
number=5,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="buttons",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.buttons",
index=5,
number=6,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=9274,
serialized_end=9640,
)
_INTENT_MESSAGE_COLUMNPROPERTIES = _descriptor.Descriptor(
name="ColumnProperties",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="header",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.header",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="horizontal_alignment",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.horizontal_alignment",
index=1,
number=2,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[_INTENT_MESSAGE_COLUMNPROPERTIES_HORIZONTALALIGNMENT],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=9643,
serialized_end=9893,
)
_INTENT_MESSAGE_TABLECARDROW = _descriptor.Descriptor(
name="TableCardRow",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="cells",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.cells",
index=0,
number=1,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="divider_after",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.divider_after",
index=1,
number=2,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=9895,
serialized_end=10010,
)
_INTENT_MESSAGE_TABLECARDCELL = _descriptor.Descriptor(
name="TableCardCell",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.text",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=10012,
serialized_end=10041,
)
_INTENT_MESSAGE = _descriptor.Descriptor(
name="Message",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.text",
index=0,
number=1,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="image",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.image",
index=1,
number=2,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="quick_replies",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.quick_replies",
index=2,
number=3,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="card",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.card",
index=3,
number=4,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="payload",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.payload",
index=4,
number=5,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="simple_responses",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.simple_responses",
index=5,
number=7,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="basic_card",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.basic_card",
index=6,
number=8,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="suggestions",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.suggestions",
index=7,
number=9,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="link_out_suggestion",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.link_out_suggestion",
index=8,
number=10,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="list_select",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.list_select",
index=9,
number=11,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="carousel_select",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.carousel_select",
index=10,
number=12,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="telephony_play_audio",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.telephony_play_audio",
index=11,
number=13,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="telephony_synthesize_speech",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.telephony_synthesize_speech",
index=12,
number=14,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="telephony_transfer_call",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.telephony_transfer_call",
index=13,
number=15,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="rbm_text",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.rbm_text",
index=14,
number=18,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="rbm_standalone_rich_card",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.rbm_standalone_rich_card",
index=15,
number=19,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="rbm_carousel_rich_card",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.rbm_carousel_rich_card",
index=16,
number=20,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="browse_carousel_card",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.browse_carousel_card",
index=17,
number=22,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="table_card",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.table_card",
index=18,
number=23,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="media_content",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.media_content",
index=19,
number=24,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="platform",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.platform",
index=20,
number=6,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[
_INTENT_MESSAGE_TEXT,
_INTENT_MESSAGE_IMAGE,
_INTENT_MESSAGE_QUICKREPLIES,
_INTENT_MESSAGE_CARD,
_INTENT_MESSAGE_SIMPLERESPONSE,
_INTENT_MESSAGE_SIMPLERESPONSES,
_INTENT_MESSAGE_BASICCARD,
_INTENT_MESSAGE_SUGGESTION,
_INTENT_MESSAGE_SUGGESTIONS,
_INTENT_MESSAGE_LINKOUTSUGGESTION,
_INTENT_MESSAGE_LISTSELECT,
_INTENT_MESSAGE_CAROUSELSELECT,
_INTENT_MESSAGE_SELECTITEMINFO,
_INTENT_MESSAGE_TELEPHONYPLAYAUDIO,
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH,
_INTENT_MESSAGE_TELEPHONYTRANSFERCALL,
_INTENT_MESSAGE_RBMTEXT,
_INTENT_MESSAGE_RBMCAROUSELCARD,
_INTENT_MESSAGE_RBMSTANDALONECARD,
_INTENT_MESSAGE_RBMCARDCONTENT,
_INTENT_MESSAGE_RBMSUGGESTION,
_INTENT_MESSAGE_RBMSUGGESTEDREPLY,
_INTENT_MESSAGE_RBMSUGGESTEDACTION,
_INTENT_MESSAGE_MEDIACONTENT,
_INTENT_MESSAGE_BROWSECAROUSELCARD,
_INTENT_MESSAGE_TABLECARD,
_INTENT_MESSAGE_COLUMNPROPERTIES,
_INTENT_MESSAGE_TABLECARDROW,
_INTENT_MESSAGE_TABLECARDCELL,
],
enum_types=[_INTENT_MESSAGE_PLATFORM],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name="message",
full_name="google.cloud.dialogflow.v2beta1.Intent.Message.message",
index=0,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[],
)
],
serialized_start=1972,
serialized_end=10230,
)
_INTENT_FOLLOWUPINTENTINFO = _descriptor.Descriptor(
name="FollowupIntentInfo",
full_name="google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="followup_intent_name",
full_name="google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.followup_intent_name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="parent_followup_intent_name",
full_name="google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.parent_followup_intent_name",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=10232,
serialized_end=10319,
)
_INTENT = _descriptor.Descriptor(
name="Intent",
full_name="google.cloud.dialogflow.v2beta1.Intent",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="name",
full_name="google.cloud.dialogflow.v2beta1.Intent.name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="display_name",
full_name="google.cloud.dialogflow.v2beta1.Intent.display_name",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\002",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="webhook_state",
full_name="google.cloud.dialogflow.v2beta1.Intent.webhook_state",
index=2,
number=6,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="priority",
full_name="google.cloud.dialogflow.v2beta1.Intent.priority",
index=3,
number=3,
type=5,
cpp_type=1,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="is_fallback",
full_name="google.cloud.dialogflow.v2beta1.Intent.is_fallback",
index=4,
number=4,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="ml_enabled",
full_name="google.cloud.dialogflow.v2beta1.Intent.ml_enabled",
index=5,
number=5,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\030\001\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="ml_disabled",
full_name="google.cloud.dialogflow.v2beta1.Intent.ml_disabled",
index=6,
number=19,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="end_interaction",
full_name="google.cloud.dialogflow.v2beta1.Intent.end_interaction",
index=7,
number=21,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="input_context_names",
full_name="google.cloud.dialogflow.v2beta1.Intent.input_context_names",
index=8,
number=7,
type=9,
cpp_type=9,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="events",
full_name="google.cloud.dialogflow.v2beta1.Intent.events",
index=9,
number=8,
type=9,
cpp_type=9,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="training_phrases",
full_name="google.cloud.dialogflow.v2beta1.Intent.training_phrases",
index=10,
number=9,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="action",
full_name="google.cloud.dialogflow.v2beta1.Intent.action",
index=11,
number=10,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="output_contexts",
full_name="google.cloud.dialogflow.v2beta1.Intent.output_contexts",
index=12,
number=11,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="reset_contexts",
full_name="google.cloud.dialogflow.v2beta1.Intent.reset_contexts",
index=13,
number=12,
type=8,
cpp_type=7,
label=1,
has_default_value=False,
default_value=False,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="parameters",
full_name="google.cloud.dialogflow.v2beta1.Intent.parameters",
index=14,
number=13,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="messages",
full_name="google.cloud.dialogflow.v2beta1.Intent.messages",
index=15,
number=14,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="default_response_platforms",
full_name="google.cloud.dialogflow.v2beta1.Intent.default_response_platforms",
index=16,
number=15,
type=14,
cpp_type=8,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="root_followup_intent_name",
full_name="google.cloud.dialogflow.v2beta1.Intent.root_followup_intent_name",
index=17,
number=16,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\003",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="parent_followup_intent_name",
full_name="google.cloud.dialogflow.v2beta1.Intent.parent_followup_intent_name",
index=18,
number=17,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="followup_intent_info",
full_name="google.cloud.dialogflow.v2beta1.Intent.followup_intent_info",
index=19,
number=18,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\003",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[
_INTENT_TRAININGPHRASE,
_INTENT_PARAMETER,
_INTENT_MESSAGE,
_INTENT_FOLLOWUPINTENTINFO,
],
enum_types=[_INTENT_WEBHOOKSTATE],
serialized_options=b"\352A\215\001\n dialogflow.googleapis.com/Intent\022)projects/{project}/agent/intents/{intent}\022>projects/{project}/locations/{location}/agent/intents/{intent}",
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=476,
serialized_end=10585,
)
_LISTINTENTSREQUEST = _descriptor.Descriptor(
name="ListIntentsRequest",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsRequest",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="parent",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsRequest.parent",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b'\340A\002\372A"\022 dialogflow.googleapis.com/Intent',
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="language_code",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsRequest.language_code",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intent_view",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsRequest.intent_view",
index=2,
number=3,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="page_size",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsRequest.page_size",
index=3,
number=4,
type=5,
cpp_type=1,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="page_token",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsRequest.page_token",
index=4,
number=5,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=10588,
serialized_end=10799,
)
_LISTINTENTSRESPONSE = _descriptor.Descriptor(
name="ListIntentsResponse",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsResponse",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="intents",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsResponse.intents",
index=0,
number=1,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="next_page_token",
full_name="google.cloud.dialogflow.v2beta1.ListIntentsResponse.next_page_token",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=10801,
serialized_end=10905,
)
_GETINTENTREQUEST = _descriptor.Descriptor(
name="GetIntentRequest",
full_name="google.cloud.dialogflow.v2beta1.GetIntentRequest",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="name",
full_name="google.cloud.dialogflow.v2beta1.GetIntentRequest.name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b'\340A\002\372A"\n dialogflow.googleapis.com/Intent',
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="language_code",
full_name="google.cloud.dialogflow.v2beta1.GetIntentRequest.language_code",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intent_view",
full_name="google.cloud.dialogflow.v2beta1.GetIntentRequest.intent_view",
index=2,
number=3,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=10908,
serialized_end=11076,
)
_CREATEINTENTREQUEST = _descriptor.Descriptor(
name="CreateIntentRequest",
full_name="google.cloud.dialogflow.v2beta1.CreateIntentRequest",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="parent",
full_name="google.cloud.dialogflow.v2beta1.CreateIntentRequest.parent",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b'\340A\002\372A"\022 dialogflow.googleapis.com/Intent',
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intent",
full_name="google.cloud.dialogflow.v2beta1.CreateIntentRequest.intent",
index=1,
number=2,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\002",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="language_code",
full_name="google.cloud.dialogflow.v2beta1.CreateIntentRequest.language_code",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intent_view",
full_name="google.cloud.dialogflow.v2beta1.CreateIntentRequest.intent_view",
index=3,
number=4,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=11079,
serialized_end=11314,
)
_UPDATEINTENTREQUEST = _descriptor.Descriptor(
name="UpdateIntentRequest",
full_name="google.cloud.dialogflow.v2beta1.UpdateIntentRequest",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="intent",
full_name="google.cloud.dialogflow.v2beta1.UpdateIntentRequest.intent",
index=0,
number=1,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\002",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="language_code",
full_name="google.cloud.dialogflow.v2beta1.UpdateIntentRequest.language_code",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="update_mask",
full_name="google.cloud.dialogflow.v2beta1.UpdateIntentRequest.update_mask",
index=2,
number=3,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intent_view",
full_name="google.cloud.dialogflow.v2beta1.UpdateIntentRequest.intent_view",
index=3,
number=4,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=11317,
serialized_end=11543,
)
_DELETEINTENTREQUEST = _descriptor.Descriptor(
name="DeleteIntentRequest",
full_name="google.cloud.dialogflow.v2beta1.DeleteIntentRequest",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="name",
full_name="google.cloud.dialogflow.v2beta1.DeleteIntentRequest.name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b'\340A\002\372A"\n dialogflow.googleapis.com/Intent',
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=11545,
serialized_end=11622,
)
_BATCHUPDATEINTENTSREQUEST = _descriptor.Descriptor(
name="BatchUpdateIntentsRequest",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="parent",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.parent",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b'\340A\002\372A"\022 dialogflow.googleapis.com/Intent',
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intent_batch_uri",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.intent_batch_uri",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intent_batch_inline",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.intent_batch_inline",
index=2,
number=3,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="language_code",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.language_code",
index=3,
number=4,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\001",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="update_mask",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.update_mask",
index=4,
number=5,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intent_view",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.intent_view",
index=5,
number=6,
type=14,
cpp_type=8,
label=1,
has_default_value=False,
default_value=0,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name="intent_batch",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.intent_batch",
index=0,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[],
)
],
serialized_start=11625,
serialized_end=11974,
)
_BATCHUPDATEINTENTSRESPONSE = _descriptor.Descriptor(
name="BatchUpdateIntentsResponse",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="intents",
full_name="google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.intents",
index=0,
number=1,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=11976,
serialized_end=12062,
)
_BATCHDELETEINTENTSREQUEST = _descriptor.Descriptor(
name="BatchDeleteIntentsRequest",
full_name="google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="parent",
full_name="google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.parent",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b'\340A\002\372A"\022 dialogflow.googleapis.com/Intent',
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="intents",
full_name="google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.intents",
index=1,
number=2,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\002",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=12065,
serialized_end=12213,
)
_INTENTBATCH = _descriptor.Descriptor(
name="IntentBatch",
full_name="google.cloud.dialogflow.v2beta1.IntentBatch",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="intents",
full_name="google.cloud.dialogflow.v2beta1.IntentBatch.intents",
index=0,
number=1,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
)
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=12215,
serialized_end=12286,
)
_INTENT_TRAININGPHRASE_PART.containing_type = _INTENT_TRAININGPHRASE
_INTENT_TRAININGPHRASE.fields_by_name["type"].enum_type = _INTENT_TRAININGPHRASE_TYPE
_INTENT_TRAININGPHRASE.fields_by_name[
"parts"
].message_type = _INTENT_TRAININGPHRASE_PART
_INTENT_TRAININGPHRASE.containing_type = _INTENT
_INTENT_TRAININGPHRASE_TYPE.containing_type = _INTENT_TRAININGPHRASE
_INTENT_PARAMETER.containing_type = _INTENT
_INTENT_MESSAGE_TEXT.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_IMAGE.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_QUICKREPLIES.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_CARD_BUTTON.containing_type = _INTENT_MESSAGE_CARD
_INTENT_MESSAGE_CARD.fields_by_name[
"buttons"
].message_type = _INTENT_MESSAGE_CARD_BUTTON
_INTENT_MESSAGE_CARD.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_SIMPLERESPONSE.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_SIMPLERESPONSES.fields_by_name[
"simple_responses"
].message_type = _INTENT_MESSAGE_SIMPLERESPONSE
_INTENT_MESSAGE_SIMPLERESPONSES.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION.containing_type = (
_INTENT_MESSAGE_BASICCARD_BUTTON
)
_INTENT_MESSAGE_BASICCARD_BUTTON.fields_by_name[
"open_uri_action"
].message_type = _INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION
_INTENT_MESSAGE_BASICCARD_BUTTON.containing_type = _INTENT_MESSAGE_BASICCARD
_INTENT_MESSAGE_BASICCARD.fields_by_name["image"].message_type = _INTENT_MESSAGE_IMAGE
_INTENT_MESSAGE_BASICCARD.fields_by_name[
"buttons"
].message_type = _INTENT_MESSAGE_BASICCARD_BUTTON
_INTENT_MESSAGE_BASICCARD.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_SUGGESTION.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_SUGGESTIONS.fields_by_name[
"suggestions"
].message_type = _INTENT_MESSAGE_SUGGESTION
_INTENT_MESSAGE_SUGGESTIONS.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_LINKOUTSUGGESTION.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_LISTSELECT_ITEM.fields_by_name[
"info"
].message_type = _INTENT_MESSAGE_SELECTITEMINFO
_INTENT_MESSAGE_LISTSELECT_ITEM.fields_by_name[
"image"
].message_type = _INTENT_MESSAGE_IMAGE
_INTENT_MESSAGE_LISTSELECT_ITEM.containing_type = _INTENT_MESSAGE_LISTSELECT
_INTENT_MESSAGE_LISTSELECT.fields_by_name[
"items"
].message_type = _INTENT_MESSAGE_LISTSELECT_ITEM
_INTENT_MESSAGE_LISTSELECT.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_CAROUSELSELECT_ITEM.fields_by_name[
"info"
].message_type = _INTENT_MESSAGE_SELECTITEMINFO
_INTENT_MESSAGE_CAROUSELSELECT_ITEM.fields_by_name[
"image"
].message_type = _INTENT_MESSAGE_IMAGE
_INTENT_MESSAGE_CAROUSELSELECT_ITEM.containing_type = _INTENT_MESSAGE_CAROUSELSELECT
_INTENT_MESSAGE_CAROUSELSELECT.fields_by_name[
"items"
].message_type = _INTENT_MESSAGE_CAROUSELSELECT_ITEM
_INTENT_MESSAGE_CAROUSELSELECT.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_SELECTITEMINFO.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_TELEPHONYPLAYAUDIO.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.oneofs_by_name["source"].fields.append(
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.fields_by_name["text"]
)
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.fields_by_name[
"text"
].containing_oneof = _INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.oneofs_by_name["source"]
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.oneofs_by_name["source"].fields.append(
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.fields_by_name["ssml"]
)
_INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.fields_by_name[
"ssml"
].containing_oneof = _INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH.oneofs_by_name["source"]
_INTENT_MESSAGE_TELEPHONYTRANSFERCALL.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_RBMTEXT.fields_by_name[
"rbm_suggestion"
].message_type = _INTENT_MESSAGE_RBMSUGGESTION
_INTENT_MESSAGE_RBMTEXT.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_RBMCAROUSELCARD.fields_by_name[
"card_width"
].enum_type = _INTENT_MESSAGE_RBMCAROUSELCARD_CARDWIDTH
_INTENT_MESSAGE_RBMCAROUSELCARD.fields_by_name[
"card_contents"
].message_type = _INTENT_MESSAGE_RBMCARDCONTENT
_INTENT_MESSAGE_RBMCAROUSELCARD.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_RBMCAROUSELCARD_CARDWIDTH.containing_type = (
_INTENT_MESSAGE_RBMCAROUSELCARD
)
_INTENT_MESSAGE_RBMSTANDALONECARD.fields_by_name[
"card_orientation"
].enum_type = _INTENT_MESSAGE_RBMSTANDALONECARD_CARDORIENTATION
_INTENT_MESSAGE_RBMSTANDALONECARD.fields_by_name[
"thumbnail_image_alignment"
].enum_type = _INTENT_MESSAGE_RBMSTANDALONECARD_THUMBNAILIMAGEALIGNMENT
_INTENT_MESSAGE_RBMSTANDALONECARD.fields_by_name[
"card_content"
].message_type = _INTENT_MESSAGE_RBMCARDCONTENT
_INTENT_MESSAGE_RBMSTANDALONECARD.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_RBMSTANDALONECARD_CARDORIENTATION.containing_type = (
_INTENT_MESSAGE_RBMSTANDALONECARD
)
_INTENT_MESSAGE_RBMSTANDALONECARD_THUMBNAILIMAGEALIGNMENT.containing_type = (
_INTENT_MESSAGE_RBMSTANDALONECARD
)
_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA.fields_by_name[
"height"
].enum_type = _INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA_HEIGHT
_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA.containing_type = _INTENT_MESSAGE_RBMCARDCONTENT
_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA_HEIGHT.containing_type = (
_INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA
)
_INTENT_MESSAGE_RBMCARDCONTENT.fields_by_name[
"media"
].message_type = _INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA
_INTENT_MESSAGE_RBMCARDCONTENT.fields_by_name[
"suggestions"
].message_type = _INTENT_MESSAGE_RBMSUGGESTION
_INTENT_MESSAGE_RBMCARDCONTENT.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_RBMSUGGESTION.fields_by_name[
"reply"
].message_type = _INTENT_MESSAGE_RBMSUGGESTEDREPLY
_INTENT_MESSAGE_RBMSUGGESTION.fields_by_name[
"action"
].message_type = _INTENT_MESSAGE_RBMSUGGESTEDACTION
_INTENT_MESSAGE_RBMSUGGESTION.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_RBMSUGGESTION.oneofs_by_name["suggestion"].fields.append(
_INTENT_MESSAGE_RBMSUGGESTION.fields_by_name["reply"]
)
_INTENT_MESSAGE_RBMSUGGESTION.fields_by_name[
"reply"
].containing_oneof = _INTENT_MESSAGE_RBMSUGGESTION.oneofs_by_name["suggestion"]
_INTENT_MESSAGE_RBMSUGGESTION.oneofs_by_name["suggestion"].fields.append(
_INTENT_MESSAGE_RBMSUGGESTION.fields_by_name["action"]
)
_INTENT_MESSAGE_RBMSUGGESTION.fields_by_name[
"action"
].containing_oneof = _INTENT_MESSAGE_RBMSUGGESTION.oneofs_by_name["suggestion"]
_INTENT_MESSAGE_RBMSUGGESTEDREPLY.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONDIAL.containing_type = (
_INTENT_MESSAGE_RBMSUGGESTEDACTION
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONOPENURI.containing_type = (
_INTENT_MESSAGE_RBMSUGGESTEDACTION
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONSHARELOCATION.containing_type = (
_INTENT_MESSAGE_RBMSUGGESTEDACTION
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name[
"dial"
].message_type = _INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONDIAL
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name[
"open_url"
].message_type = _INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONOPENURI
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name[
"share_location"
].message_type = _INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONSHARELOCATION
_INTENT_MESSAGE_RBMSUGGESTEDACTION.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_RBMSUGGESTEDACTION.oneofs_by_name["action"].fields.append(
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name["dial"]
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name[
"dial"
].containing_oneof = _INTENT_MESSAGE_RBMSUGGESTEDACTION.oneofs_by_name["action"]
_INTENT_MESSAGE_RBMSUGGESTEDACTION.oneofs_by_name["action"].fields.append(
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name["open_url"]
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name[
"open_url"
].containing_oneof = _INTENT_MESSAGE_RBMSUGGESTEDACTION.oneofs_by_name["action"]
_INTENT_MESSAGE_RBMSUGGESTEDACTION.oneofs_by_name["action"].fields.append(
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name["share_location"]
)
_INTENT_MESSAGE_RBMSUGGESTEDACTION.fields_by_name[
"share_location"
].containing_oneof = _INTENT_MESSAGE_RBMSUGGESTEDACTION.oneofs_by_name["action"]
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.fields_by_name[
"large_image"
].message_type = _INTENT_MESSAGE_IMAGE
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.fields_by_name[
"icon"
].message_type = _INTENT_MESSAGE_IMAGE
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.containing_type = (
_INTENT_MESSAGE_MEDIACONTENT
)
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.oneofs_by_name["image"].fields.append(
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.fields_by_name["large_image"]
)
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.fields_by_name[
"large_image"
].containing_oneof = _INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.oneofs_by_name[
"image"
]
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.oneofs_by_name["image"].fields.append(
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.fields_by_name["icon"]
)
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.fields_by_name[
"icon"
].containing_oneof = _INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT.oneofs_by_name[
"image"
]
_INTENT_MESSAGE_MEDIACONTENT.fields_by_name[
"media_type"
].enum_type = _INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIATYPE
_INTENT_MESSAGE_MEDIACONTENT.fields_by_name[
"media_objects"
].message_type = _INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT
_INTENT_MESSAGE_MEDIACONTENT.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIATYPE.containing_type = (
_INTENT_MESSAGE_MEDIACONTENT
)
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION.fields_by_name[
"url_type_hint"
].enum_type = (
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION_URLTYPEHINT
)
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION.containing_type = (
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM
)
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION_URLTYPEHINT.containing_type = (
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION
)
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM.fields_by_name[
"open_uri_action"
].message_type = _INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM.fields_by_name[
"image"
].message_type = _INTENT_MESSAGE_IMAGE
_INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM.containing_type = (
_INTENT_MESSAGE_BROWSECAROUSELCARD
)
_INTENT_MESSAGE_BROWSECAROUSELCARD.fields_by_name[
"items"
].message_type = _INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM
_INTENT_MESSAGE_BROWSECAROUSELCARD.fields_by_name[
"image_display_options"
].enum_type = _INTENT_MESSAGE_BROWSECAROUSELCARD_IMAGEDISPLAYOPTIONS
_INTENT_MESSAGE_BROWSECAROUSELCARD.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_BROWSECAROUSELCARD_IMAGEDISPLAYOPTIONS.containing_type = (
_INTENT_MESSAGE_BROWSECAROUSELCARD
)
_INTENT_MESSAGE_TABLECARD.fields_by_name["image"].message_type = _INTENT_MESSAGE_IMAGE
_INTENT_MESSAGE_TABLECARD.fields_by_name[
"column_properties"
].message_type = _INTENT_MESSAGE_COLUMNPROPERTIES
_INTENT_MESSAGE_TABLECARD.fields_by_name[
"rows"
].message_type = _INTENT_MESSAGE_TABLECARDROW
_INTENT_MESSAGE_TABLECARD.fields_by_name[
"buttons"
].message_type = _INTENT_MESSAGE_BASICCARD_BUTTON
_INTENT_MESSAGE_TABLECARD.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_COLUMNPROPERTIES.fields_by_name[
"horizontal_alignment"
].enum_type = _INTENT_MESSAGE_COLUMNPROPERTIES_HORIZONTALALIGNMENT
_INTENT_MESSAGE_COLUMNPROPERTIES.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_COLUMNPROPERTIES_HORIZONTALALIGNMENT.containing_type = (
_INTENT_MESSAGE_COLUMNPROPERTIES
)
_INTENT_MESSAGE_TABLECARDROW.fields_by_name[
"cells"
].message_type = _INTENT_MESSAGE_TABLECARDCELL
_INTENT_MESSAGE_TABLECARDROW.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE_TABLECARDCELL.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE.fields_by_name["text"].message_type = _INTENT_MESSAGE_TEXT
_INTENT_MESSAGE.fields_by_name["image"].message_type = _INTENT_MESSAGE_IMAGE
_INTENT_MESSAGE.fields_by_name[
"quick_replies"
].message_type = _INTENT_MESSAGE_QUICKREPLIES
_INTENT_MESSAGE.fields_by_name["card"].message_type = _INTENT_MESSAGE_CARD
_INTENT_MESSAGE.fields_by_name[
"payload"
].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT
_INTENT_MESSAGE.fields_by_name[
"simple_responses"
].message_type = _INTENT_MESSAGE_SIMPLERESPONSES
_INTENT_MESSAGE.fields_by_name["basic_card"].message_type = _INTENT_MESSAGE_BASICCARD
_INTENT_MESSAGE.fields_by_name["suggestions"].message_type = _INTENT_MESSAGE_SUGGESTIONS
_INTENT_MESSAGE.fields_by_name[
"link_out_suggestion"
].message_type = _INTENT_MESSAGE_LINKOUTSUGGESTION
_INTENT_MESSAGE.fields_by_name["list_select"].message_type = _INTENT_MESSAGE_LISTSELECT
_INTENT_MESSAGE.fields_by_name[
"carousel_select"
].message_type = _INTENT_MESSAGE_CAROUSELSELECT
_INTENT_MESSAGE.fields_by_name[
"telephony_play_audio"
].message_type = _INTENT_MESSAGE_TELEPHONYPLAYAUDIO
_INTENT_MESSAGE.fields_by_name[
"telephony_synthesize_speech"
].message_type = _INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH
_INTENT_MESSAGE.fields_by_name[
"telephony_transfer_call"
].message_type = _INTENT_MESSAGE_TELEPHONYTRANSFERCALL
_INTENT_MESSAGE.fields_by_name["rbm_text"].message_type = _INTENT_MESSAGE_RBMTEXT
_INTENT_MESSAGE.fields_by_name[
"rbm_standalone_rich_card"
].message_type = _INTENT_MESSAGE_RBMSTANDALONECARD
_INTENT_MESSAGE.fields_by_name[
"rbm_carousel_rich_card"
].message_type = _INTENT_MESSAGE_RBMCAROUSELCARD
_INTENT_MESSAGE.fields_by_name[
"browse_carousel_card"
].message_type = _INTENT_MESSAGE_BROWSECAROUSELCARD
_INTENT_MESSAGE.fields_by_name["table_card"].message_type = _INTENT_MESSAGE_TABLECARD
_INTENT_MESSAGE.fields_by_name[
"media_content"
].message_type = _INTENT_MESSAGE_MEDIACONTENT
_INTENT_MESSAGE.fields_by_name["platform"].enum_type = _INTENT_MESSAGE_PLATFORM
_INTENT_MESSAGE.containing_type = _INTENT
_INTENT_MESSAGE_PLATFORM.containing_type = _INTENT_MESSAGE
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["text"]
)
_INTENT_MESSAGE.fields_by_name[
"text"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["image"]
)
_INTENT_MESSAGE.fields_by_name[
"image"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["quick_replies"]
)
_INTENT_MESSAGE.fields_by_name[
"quick_replies"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["card"]
)
_INTENT_MESSAGE.fields_by_name[
"card"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["payload"]
)
_INTENT_MESSAGE.fields_by_name[
"payload"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["simple_responses"]
)
_INTENT_MESSAGE.fields_by_name[
"simple_responses"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["basic_card"]
)
_INTENT_MESSAGE.fields_by_name[
"basic_card"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["suggestions"]
)
_INTENT_MESSAGE.fields_by_name[
"suggestions"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["link_out_suggestion"]
)
_INTENT_MESSAGE.fields_by_name[
"link_out_suggestion"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["list_select"]
)
_INTENT_MESSAGE.fields_by_name[
"list_select"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["carousel_select"]
)
_INTENT_MESSAGE.fields_by_name[
"carousel_select"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["telephony_play_audio"]
)
_INTENT_MESSAGE.fields_by_name[
"telephony_play_audio"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["telephony_synthesize_speech"]
)
_INTENT_MESSAGE.fields_by_name[
"telephony_synthesize_speech"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["telephony_transfer_call"]
)
_INTENT_MESSAGE.fields_by_name[
"telephony_transfer_call"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["rbm_text"]
)
_INTENT_MESSAGE.fields_by_name[
"rbm_text"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["rbm_standalone_rich_card"]
)
_INTENT_MESSAGE.fields_by_name[
"rbm_standalone_rich_card"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["rbm_carousel_rich_card"]
)
_INTENT_MESSAGE.fields_by_name[
"rbm_carousel_rich_card"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["browse_carousel_card"]
)
_INTENT_MESSAGE.fields_by_name[
"browse_carousel_card"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["table_card"]
)
_INTENT_MESSAGE.fields_by_name[
"table_card"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_MESSAGE.oneofs_by_name["message"].fields.append(
_INTENT_MESSAGE.fields_by_name["media_content"]
)
_INTENT_MESSAGE.fields_by_name[
"media_content"
].containing_oneof = _INTENT_MESSAGE.oneofs_by_name["message"]
_INTENT_FOLLOWUPINTENTINFO.containing_type = _INTENT
_INTENT.fields_by_name["webhook_state"].enum_type = _INTENT_WEBHOOKSTATE
_INTENT.fields_by_name["training_phrases"].message_type = _INTENT_TRAININGPHRASE
_INTENT.fields_by_name[
"output_contexts"
].message_type = (
google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_context__pb2._CONTEXT
)
_INTENT.fields_by_name["parameters"].message_type = _INTENT_PARAMETER
_INTENT.fields_by_name["messages"].message_type = _INTENT_MESSAGE
_INTENT.fields_by_name[
"default_response_platforms"
].enum_type = _INTENT_MESSAGE_PLATFORM
_INTENT.fields_by_name["followup_intent_info"].message_type = _INTENT_FOLLOWUPINTENTINFO
_INTENT_WEBHOOKSTATE.containing_type = _INTENT
_LISTINTENTSREQUEST.fields_by_name["intent_view"].enum_type = _INTENTVIEW
_LISTINTENTSRESPONSE.fields_by_name["intents"].message_type = _INTENT
_GETINTENTREQUEST.fields_by_name["intent_view"].enum_type = _INTENTVIEW
_CREATEINTENTREQUEST.fields_by_name["intent"].message_type = _INTENT
_CREATEINTENTREQUEST.fields_by_name["intent_view"].enum_type = _INTENTVIEW
_UPDATEINTENTREQUEST.fields_by_name["intent"].message_type = _INTENT
_UPDATEINTENTREQUEST.fields_by_name[
"update_mask"
].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK
_UPDATEINTENTREQUEST.fields_by_name["intent_view"].enum_type = _INTENTVIEW
_BATCHUPDATEINTENTSREQUEST.fields_by_name[
"intent_batch_inline"
].message_type = _INTENTBATCH
_BATCHUPDATEINTENTSREQUEST.fields_by_name[
"update_mask"
].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK
_BATCHUPDATEINTENTSREQUEST.fields_by_name["intent_view"].enum_type = _INTENTVIEW
_BATCHUPDATEINTENTSREQUEST.oneofs_by_name["intent_batch"].fields.append(
_BATCHUPDATEINTENTSREQUEST.fields_by_name["intent_batch_uri"]
)
_BATCHUPDATEINTENTSREQUEST.fields_by_name[
"intent_batch_uri"
].containing_oneof = _BATCHUPDATEINTENTSREQUEST.oneofs_by_name["intent_batch"]
_BATCHUPDATEINTENTSREQUEST.oneofs_by_name["intent_batch"].fields.append(
_BATCHUPDATEINTENTSREQUEST.fields_by_name["intent_batch_inline"]
)
_BATCHUPDATEINTENTSREQUEST.fields_by_name[
"intent_batch_inline"
].containing_oneof = _BATCHUPDATEINTENTSREQUEST.oneofs_by_name["intent_batch"]
_BATCHUPDATEINTENTSRESPONSE.fields_by_name["intents"].message_type = _INTENT
_BATCHDELETEINTENTSREQUEST.fields_by_name["intents"].message_type = _INTENT
_INTENTBATCH.fields_by_name["intents"].message_type = _INTENT
DESCRIPTOR.message_types_by_name["Intent"] = _INTENT
DESCRIPTOR.message_types_by_name["ListIntentsRequest"] = _LISTINTENTSREQUEST
DESCRIPTOR.message_types_by_name["ListIntentsResponse"] = _LISTINTENTSRESPONSE
DESCRIPTOR.message_types_by_name["GetIntentRequest"] = _GETINTENTREQUEST
DESCRIPTOR.message_types_by_name["CreateIntentRequest"] = _CREATEINTENTREQUEST
DESCRIPTOR.message_types_by_name["UpdateIntentRequest"] = _UPDATEINTENTREQUEST
DESCRIPTOR.message_types_by_name["DeleteIntentRequest"] = _DELETEINTENTREQUEST
DESCRIPTOR.message_types_by_name[
"BatchUpdateIntentsRequest"
] = _BATCHUPDATEINTENTSREQUEST
DESCRIPTOR.message_types_by_name[
"BatchUpdateIntentsResponse"
] = _BATCHUPDATEINTENTSRESPONSE
DESCRIPTOR.message_types_by_name[
"BatchDeleteIntentsRequest"
] = _BATCHDELETEINTENTSREQUEST
DESCRIPTOR.message_types_by_name["IntentBatch"] = _INTENTBATCH
DESCRIPTOR.enum_types_by_name["IntentView"] = _INTENTVIEW
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Intent = _reflection.GeneratedProtocolMessageType(
"Intent",
(_message.Message,),
{
"TrainingPhrase": _reflection.GeneratedProtocolMessageType(
"TrainingPhrase",
(_message.Message,),
{
"Part": _reflection.GeneratedProtocolMessageType(
"Part",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_TRAININGPHRASE_PART,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Represents a part of a training phrase.
Attributes:
text:
Required. The text for this part.
entity_type:
Optional. The entity type name prefixed with ``@``. This field
is required for annotated parts of the training phrase.
alias:
Optional. The parameter name for the value extracted from the
annotated part of the example. This field is required for
annotated parts of the training phrase.
user_defined:
Optional. Indicates whether the text was manually annotated.
This field is set to true when the Dialogflow Console is used
to manually annotate the part. When creating an annotated part
with the API, you must set this to true.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part)
},
),
"DESCRIPTOR": _INTENT_TRAININGPHRASE,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Represents an example that the agent is trained on.
Attributes:
name:
Output only. The unique identifier of this training phrase.
type:
Required. The type of the training phrase.
parts:
Required. The ordered list of training phrase parts. The parts
are concatenated in order to form the training phrase. Note:
The API does not automatically annotate training phrases like
the Dialogflow Console does. Note: Do not forget to include
whitespace at part boundaries, so the training phrase is well
formatted when the parts are concatenated. If the training
phrase does not need to be annotated with parameters, you just
need a single part with only the [Part.text][google.cloud.dial
ogflow.v2beta1.Intent.TrainingPhrase.Part.text] field set. If
you want to annotate the training phrase, you must create
multiple parts, where the fields of each part are populated in
one of two ways: - ``Part.text`` is set to a part of the
phrase that has no parameters. - ``Part.text`` is set to a
part of the phrase that you want to annotate, and the
``entity_type``, ``alias``, and ``user_defined`` fields are
all set.
times_added_count:
Optional. Indicates how many times this example was added to
the intent. Each time a developer adds an existing sample by
editing an intent or training, this counter is increased.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase)
},
),
"Parameter": _reflection.GeneratedProtocolMessageType(
"Parameter",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_PARAMETER,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Represents intent parameters.
Attributes:
name:
The unique identifier of this parameter.
display_name:
Required. The name of the parameter.
value:
Optional. The definition of the parameter value. It can be: -
a constant string, - a parameter value defined as
``$parameter_name``, - an original parameter value defined as
``$parameter_name.original``, - a parameter value from some
context defined as ``#context_name.parameter_name``.
default_value:
Optional. The default value to use when the ``value`` yields
an empty result. Default values can be extracted from contexts
by using the following syntax:
``#context_name.parameter_name``.
entity_type_display_name:
Optional. The name of the entity type, prefixed with ``@``,
that describes values of the parameter. If the parameter is
required, this must be provided.
mandatory:
Optional. Indicates whether the parameter is required. That
is, whether the intent cannot be completed without collecting
the parameter value.
prompts:
Optional. The collection of prompts that the agent can present
to the user in order to collect a value for the parameter.
is_list:
Optional. Indicates whether the parameter represents a list of
values.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Parameter)
},
),
"Message": _reflection.GeneratedProtocolMessageType(
"Message",
(_message.Message,),
{
"Text": _reflection.GeneratedProtocolMessageType(
"Text",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_TEXT,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The text response message.
Attributes:
text:
Optional. The collection of the agent’s responses.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.Text)
},
),
"Image": _reflection.GeneratedProtocolMessageType(
"Image",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_IMAGE,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The image response message.
Attributes:
image_uri:
Optional. The public URI to an image file.
accessibility_text:
A text description of the image to be used for accessibility,
e.g., screen readers. Required if image_uri is set for
CarouselSelect.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.Image)
},
),
"QuickReplies": _reflection.GeneratedProtocolMessageType(
"QuickReplies",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_QUICKREPLIES,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The quick replies response message.
Attributes:
title:
Optional. The title of the collection of quick replies.
quick_replies:
Optional. The collection of quick replies.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies)
},
),
"Card": _reflection.GeneratedProtocolMessageType(
"Card",
(_message.Message,),
{
"Button": _reflection.GeneratedProtocolMessageType(
"Button",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_CARD_BUTTON,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Optional. Contains information about a button.
Attributes:
text:
Optional. The text to show on the button.
postback:
Optional. The text to send back to the Dialogflow API or a URI
to open.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_CARD,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The card response message.
Attributes:
title:
Optional. The title of the card.
subtitle:
Optional. The subtitle of the card.
image_uri:
Optional. The public URI to an image file for the card.
buttons:
Optional. The collection of card buttons.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.Card)
},
),
"SimpleResponse": _reflection.GeneratedProtocolMessageType(
"SimpleResponse",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_SIMPLERESPONSE,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The simple response message containing speech or text.
Attributes:
text_to_speech:
One of text_to_speech or ssml must be provided. The plain text
of the speech output. Mutually exclusive with ssml.
ssml:
One of text_to_speech or ssml must be provided. Structured
spoken response to the user in the SSML format. Mutually
exclusive with text_to_speech.
display_text:
Optional. The text to display.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse)
},
),
"SimpleResponses": _reflection.GeneratedProtocolMessageType(
"SimpleResponses",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_SIMPLERESPONSES,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The collection of simple response candidates. This message in
``QueryResult.fulfillment_messages`` and
``WebhookResponse.fulfillment_messages`` should contain only one
``SimpleResponse``.
Attributes:
simple_responses:
Required. The list of simple responses.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses)
},
),
"BasicCard": _reflection.GeneratedProtocolMessageType(
"BasicCard",
(_message.Message,),
{
"Button": _reflection.GeneratedProtocolMessageType(
"Button",
(_message.Message,),
{
"OpenUriAction": _reflection.GeneratedProtocolMessageType(
"OpenUriAction",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Opens the given URI.
Attributes:
uri:
Required. The HTTP or HTTPS scheme URI.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_BASICCARD_BUTTON,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The button object that appears at the bottom of a card.
Attributes:
title:
Required. The title of the button.
open_uri_action:
Required. Action to take when a user taps on the button.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_BASICCARD,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The basic card message. Useful for displaying information.
Attributes:
title:
Optional. The title of the card.
subtitle:
Optional. The subtitle of the card.
formatted_text:
Required, unless image is present. The body text of the card.
image:
Optional. The image for the card.
buttons:
Optional. The collection of card buttons.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard)
},
),
"Suggestion": _reflection.GeneratedProtocolMessageType(
"Suggestion",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_SUGGESTION,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The suggestion chip message that the user can tap to quickly post a
reply to the conversation.
Attributes:
title:
Required. The text shown the in the suggestion chip.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion)
},
),
"Suggestions": _reflection.GeneratedProtocolMessageType(
"Suggestions",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_SUGGESTIONS,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The collection of suggestions.
Attributes:
suggestions:
Required. The list of suggested replies.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions)
},
),
"LinkOutSuggestion": _reflection.GeneratedProtocolMessageType(
"LinkOutSuggestion",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_LINKOUTSUGGESTION,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The suggestion chip message that allows the user to jump out to the
app or website associated with this agent.
Attributes:
destination_name:
Required. The name of the app or site this chip is linking to.
uri:
Required. The URI of the app or site to open when the user
taps the suggestion chip.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion)
},
),
"ListSelect": _reflection.GeneratedProtocolMessageType(
"ListSelect",
(_message.Message,),
{
"Item": _reflection.GeneratedProtocolMessageType(
"Item",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_LISTSELECT_ITEM,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """An item in the list.
Attributes:
info:
Required. Additional information about this option.
title:
Required. The title of the list item.
description:
Optional. The main text describing the item.
image:
Optional. The image to display.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_LISTSELECT,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The card for presenting a list of options to select from.
Attributes:
title:
Optional. The overall title of the list.
items:
Required. List items.
subtitle:
Optional. Subtitle of the list.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect)
},
),
"CarouselSelect": _reflection.GeneratedProtocolMessageType(
"CarouselSelect",
(_message.Message,),
{
"Item": _reflection.GeneratedProtocolMessageType(
"Item",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_CAROUSELSELECT_ITEM,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """An item in the carousel.
Attributes:
info:
Required. Additional info about the option item.
title:
Required. Title of the carousel item.
description:
Optional. The body text of the card.
image:
Optional. The image to display.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_CAROUSELSELECT,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The card for presenting a carousel of options to select from.
Attributes:
items:
Required. Carousel items.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect)
},
),
"SelectItemInfo": _reflection.GeneratedProtocolMessageType(
"SelectItemInfo",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_SELECTITEMINFO,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Additional info about the select item for when it is triggered in a
dialog.
Attributes:
key:
Required. A unique key that will be sent back to the agent if
this response is given.
synonyms:
Optional. A list of synonyms that can also be used to trigger
this item in dialog.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo)
},
),
"TelephonyPlayAudio": _reflection.GeneratedProtocolMessageType(
"TelephonyPlayAudio",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_TELEPHONYPLAYAUDIO,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Plays audio from a file in Telephony Gateway.
Attributes:
audio_uri:
Required. URI to a Google Cloud Storage object containing the
audio to play, e.g., “gs://bucket/object”. The object must
contain a single channel (mono) of linear PCM audio (2 bytes /
sample) at 8kHz. This object must be readable by the
``service-<Project Number>@gcp-sa-
dialogflow.iam.gserviceaccount.com`` service account where is
the number of the Telephony Gateway project (usually the same
as the Dialogflow agent project). If the Google Cloud Storage
bucket is in the Telephony Gateway project, this permission is
added by default when enabling the Dialogflow V2 API. For
audio from other sources, consider using the
``TelephonySynthesizeSpeech`` message with SSML.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio)
},
),
"TelephonySynthesizeSpeech": _reflection.GeneratedProtocolMessageType(
"TelephonySynthesizeSpeech",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_TELEPHONYSYNTHESIZESPEECH,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Synthesizes speech and plays back the synthesized audio to the caller
in Telephony Gateway. Telephony Gateway takes the synthesizer
settings from ``DetectIntentResponse.output_audio_config`` which can
either be set at request-level or can come from the agent-level
synthesizer config.
Attributes:
source:
Required. The source to be synthesized.
text:
The raw text to be synthesized.
ssml:
The SSML to be synthesized. For more information, see `SSML
<https://developers.google.com/actions/reference/ssml>`__.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech)
},
),
"TelephonyTransferCall": _reflection.GeneratedProtocolMessageType(
"TelephonyTransferCall",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_TELEPHONYTRANSFERCALL,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Transfers the call in Telephony Gateway.
Attributes:
phone_number:
Required. The phone number to transfer the call to in `E.164
format <https://en.wikipedia.org/wiki/E.164>`__. We currently
only allow transferring to US numbers (+1xxxyyyzzzz).
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall)
},
),
"RbmText": _reflection.GeneratedProtocolMessageType(
"RbmText",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMTEXT,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Rich Business Messaging (RBM) text response with suggestions.
Attributes:
text:
Required. Text sent and displayed to the user.
rbm_suggestion:
Optional. One or more suggestions to show to the user.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmText)
},
),
"RbmCarouselCard": _reflection.GeneratedProtocolMessageType(
"RbmCarouselCard",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMCAROUSELCARD,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Carousel Rich Business Messaging (RBM) rich card. Rich cards allow
you to respond to users with more vivid content, e.g. with media and
suggestions. If you want to show a single card with more control over
the layout, please use [RbmStandaloneCard][google.cloud.dialogflow.v2b
eta1.Intent.Message.RbmStandaloneCard] instead.
Attributes:
card_width:
Required. The width of the cards in the carousel.
card_contents:
Required. The cards in the carousel. A carousel must have at
least 2 cards and at most 10.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard)
},
),
"RbmStandaloneCard": _reflection.GeneratedProtocolMessageType(
"RbmStandaloneCard",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMSTANDALONECARD,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Standalone Rich Business Messaging (RBM) rich card. Rich cards allow
you to respond to users with more vivid content, e.g. with media and
suggestions. You can group multiple rich cards into one using [RbmCar
ouselCard][google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselC
ard] but carousel cards will give you less control over the card
layout.
Attributes:
card_orientation:
Required. Orientation of the card.
thumbnail_image_alignment:
Required if orientation is horizontal. Image preview alignment
for standalone cards with horizontal layout.
card_content:
Required. Card content.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard)
},
),
"RbmCardContent": _reflection.GeneratedProtocolMessageType(
"RbmCardContent",
(_message.Message,),
{
"RbmMedia": _reflection.GeneratedProtocolMessageType(
"RbmMedia",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMCARDCONTENT_RBMMEDIA,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Rich Business Messaging (RBM) Media displayed in Cards The following
media-types are currently supported: Image Types - image/jpeg -
image/jpg’ - image/gif - image/png Video Types - video/h263 -
video/m4v - video/mp4 - video/mpeg - video/mpeg4 - video/webm
Attributes:
file_uri:
Required. Publicly reachable URI of the file. The RBM platform
determines the MIME type of the file from the content-type
field in the HTTP headers when the platform fetches the file.
The content-type field must be present and accurate in the
HTTP response from the URL.
thumbnail_uri:
Optional. Publicly reachable URI of the thumbnail.If you don’t
provide a thumbnail URI, the RBM platform displays a blank
placeholder thumbnail until the user’s device downloads the
file. Depending on the user’s setting, the file may not
download automatically and may require the user to tap a
download button.
height:
Required for cards with vertical orientation. The height of
the media within a rich card with a vertical layout. For a
standalone card with horizontal layout, height is not
customizable, and this field is ignored.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_RBMCARDCONTENT,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Rich Business Messaging (RBM) Card content
Attributes:
title:
Optional. Title of the card (at most 200 bytes). At least one
of the title, description or media must be set.
description:
Optional. Description of the card (at most 2000 bytes). At
least one of the title, description or media must be set.
media:
Optional. However at least one of the title, description or
media must be set. Media (image, GIF or a video) to include in
the card.
suggestions:
Optional. List of suggestions to include in the card.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent)
},
),
"RbmSuggestion": _reflection.GeneratedProtocolMessageType(
"RbmSuggestion",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMSUGGESTION,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Rich Business Messaging (RBM) suggestion. Suggestions allow user to
easily select/click a predefined response or perform an action (like
opening a web uri).
Attributes:
suggestion:
Predefined suggested response or action for user to choose
reply:
Predefined replies for user to select instead of typing
action:
Predefined client side actions that user can choose
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion)
},
),
"RbmSuggestedReply": _reflection.GeneratedProtocolMessageType(
"RbmSuggestedReply",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMSUGGESTEDREPLY,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Rich Business Messaging (RBM) suggested reply that the user can click
instead of typing in their own response.
Attributes:
text:
Suggested reply text.
postback_data:
Opaque payload that the Dialogflow receives in a user event
when the user taps the suggested reply. This data will be also
forwarded to webhook to allow performing custom business
logic.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply)
},
),
"RbmSuggestedAction": _reflection.GeneratedProtocolMessageType(
"RbmSuggestedAction",
(_message.Message,),
{
"RbmSuggestedActionDial": _reflection.GeneratedProtocolMessageType(
"RbmSuggestedActionDial",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONDIAL,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Opens the user’s default dialer app with the specified phone number
but does not dial automatically.
Attributes:
phone_number:
Required. The phone number to fill in the default dialer app.
This field should be in `E.164
<https://en.wikipedia.org/wiki/E.164>`__ format. An example of
a correctly formatted phone number: +15556767888.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial)
},
),
"RbmSuggestedActionOpenUri": _reflection.GeneratedProtocolMessageType(
"RbmSuggestedActionOpenUri",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONOPENURI,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Opens the user’s default web browser app to the specified uri If the
user has an app installed that is registered as the default handler
for the URL, then this app will be opened instead, and its icon will
be used in the suggested action UI.
Attributes:
uri:
Required. The uri to open on the user device
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri)
},
),
"RbmSuggestedActionShareLocation": _reflection.GeneratedProtocolMessageType(
"RbmSuggestedActionShareLocation",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_RBMSUGGESTEDACTION_RBMSUGGESTEDACTIONSHARELOCATION,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Opens the device’s location chooser so the user can pick a location to
send back to the agent.""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_RBMSUGGESTEDACTION,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Rich Business Messaging (RBM) suggested client-side action that the
user can choose from the card.
Attributes:
text:
Text to display alongside the action.
postback_data:
Opaque payload that the Dialogflow receives in a user event
when the user taps the suggested action. This data will be
also forwarded to webhook to allow performing custom business
logic.
action:
Action that needs to be triggered.
dial:
Suggested client side action: Dial a phone number
open_url:
Suggested client side action: Open a URI on device
share_location:
Suggested client side action: Share user location
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction)
},
),
"MediaContent": _reflection.GeneratedProtocolMessageType(
"MediaContent",
(_message.Message,),
{
"ResponseMediaObject": _reflection.GeneratedProtocolMessageType(
"ResponseMediaObject",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_MEDIACONTENT_RESPONSEMEDIAOBJECT,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Response media object for media content card.
Attributes:
name:
Required. Name of media card.
description:
Optional. Description of media card.
image:
Image to show with the media card.
large_image:
Optional. Image to display above media content.
icon:
Optional. Icon to display above media content.
content_url:
Required. Url where the media is stored.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_MEDIACONTENT,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The media content card for Actions on Google.
Attributes:
media_type:
Optional. What type of media is the content (ie “audio”).
media_objects:
Required. List of media objects.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent)
},
),
"BrowseCarouselCard": _reflection.GeneratedProtocolMessageType(
"BrowseCarouselCard",
(_message.Message,),
{
"BrowseCarouselCardItem": _reflection.GeneratedProtocolMessageType(
"BrowseCarouselCardItem",
(_message.Message,),
{
"OpenUrlAction": _reflection.GeneratedProtocolMessageType(
"OpenUrlAction",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM_OPENURLACTION,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Actions on Google action to open a given url.
Attributes:
url:
Required. URL
url_type_hint:
Optional. Specifies the type of viewer that is used when
opening the URL. Defaults to opening via web browser.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_BROWSECAROUSELCARD_BROWSECAROUSELCARDITEM,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Browsing carousel tile
Attributes:
open_uri_action:
Required. Action to present to the user.
title:
Required. Title of the carousel item. Maximum of two lines of
text.
description:
Optional. Description of the carousel item. Maximum of four
lines of text.
image:
Optional. Hero image for the carousel item.
footer:
Optional. Text that appears at the bottom of the Browse
Carousel Card. Maximum of one line of text.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem)
},
),
"DESCRIPTOR": _INTENT_MESSAGE_BROWSECAROUSELCARD,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Browse Carousel Card for Actions on Google. https://developers.google.
com/actions/assistant/responses#browsing_carousel
Attributes:
items:
Required. List of items in the Browse Carousel Card. Minimum
of two items, maximum of ten.
image_display_options:
Optional. Settings for displaying the image. Applies to every
image in [items][google.cloud.dialogflow.v2beta1.Intent.Messag
e.BrowseCarouselCard.items].
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard)
},
),
"TableCard": _reflection.GeneratedProtocolMessageType(
"TableCard",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_TABLECARD,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Table card for Actions on Google.
Attributes:
title:
Required. Title of the card.
subtitle:
Optional. Subtitle to the title.
image:
Optional. Image which should be displayed on the card.
column_properties:
Optional. Display properties for the columns in this table.
rows:
Optional. Rows in this table of data.
buttons:
Optional. List of buttons for the card.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.TableCard)
},
),
"ColumnProperties": _reflection.GeneratedProtocolMessageType(
"ColumnProperties",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_COLUMNPROPERTIES,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Column properties for
[TableCard][google.cloud.dialogflow.v2beta1.Intent.Message.TableCard].
Attributes:
header:
Required. Column heading.
horizontal_alignment:
Optional. Defines text alignment for all cells in this column.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties)
},
),
"TableCardRow": _reflection.GeneratedProtocolMessageType(
"TableCardRow",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_TABLECARDROW,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Row of
[TableCard][google.cloud.dialogflow.v2beta1.Intent.Message.TableCard].
Attributes:
cells:
Optional. List of cells that make up this row.
divider_after:
Optional. Whether to add a visual divider after this row.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow)
},
),
"TableCardCell": _reflection.GeneratedProtocolMessageType(
"TableCardCell",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_MESSAGE_TABLECARDCELL,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Cell of [TableCardRow][google.cloud.dialogflow.v2beta1.Intent.Message.
TableCardRow].
Attributes:
text:
Required. Text in this cell.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell)
},
),
"DESCRIPTOR": _INTENT_MESSAGE,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Corresponds to the ``Response`` field in the Dialogflow console.
Attributes:
message:
Required. The rich response message.
text:
Returns a text response.
image:
Displays an image.
quick_replies:
Displays quick replies.
card:
Displays a card.
payload:
A custom platform-specific response.
simple_responses:
Returns a voice or text-only response for Actions on Google.
basic_card:
Displays a basic card for Actions on Google.
suggestions:
Displays suggestion chips for Actions on Google.
link_out_suggestion:
Displays a link out suggestion chip for Actions on Google.
list_select:
Displays a list card for Actions on Google.
carousel_select:
Displays a carousel card for Actions on Google.
telephony_play_audio:
Plays audio from a file in Telephony Gateway.
telephony_synthesize_speech:
Synthesizes speech in Telephony Gateway.
telephony_transfer_call:
Transfers the call in Telephony Gateway.
rbm_text:
Rich Business Messaging (RBM) text response. RBM allows
businesses to send enriched and branded versions of SMS. See
https://jibe.google.com/business-messaging.
rbm_standalone_rich_card:
Standalone Rich Business Messaging (RBM) rich card response.
rbm_carousel_rich_card:
Rich Business Messaging (RBM) carousel rich card response.
browse_carousel_card:
Browse carousel card for Actions on Google.
table_card:
Table card for Actions on Google.
media_content:
The media content card for Actions on Google.
platform:
Optional. The platform that this message is intended for.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.Message)
},
),
"FollowupIntentInfo": _reflection.GeneratedProtocolMessageType(
"FollowupIntentInfo",
(_message.Message,),
{
"DESCRIPTOR": _INTENT_FOLLOWUPINTENTINFO,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """Represents a single followup intent in the chain.
Attributes:
followup_intent_name:
The unique identifier of the followup intent. Format:
``projects/<Project ID>/agent/intents/<Intent ID>``.
parent_followup_intent_name:
The unique identifier of the followup intent’s parent. Format:
``projects/<Project ID>/agent/intents/<Intent ID>``.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo)
},
),
"DESCRIPTOR": _INTENT,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """An intent categorizes an end-user’s intention for one conversation
turn. For each agent, you define many intents, where your combined
intents can handle a complete conversation. When an end-user writes or
says something, referred to as an end-user expression or end-user
input, Dialogflow matches the end-user input to the best intent in
your agent. Matching an intent is also known as intent classification.
For more information, see the `intent guide
<https://cloud.google.com/dialogflow/docs/intents-overview>`__.
Attributes:
name:
Optional. The unique identifier of this intent. Required for [
Intents.UpdateIntent][google.cloud.dialogflow.v2beta1.Intents.
UpdateIntent] and [Intents.BatchUpdateIntents][google.cloud.di
alogflow.v2beta1.Intents.BatchUpdateIntents] methods. Format:
``projects/<Project ID>/agent/intents/<Intent ID>``.
display_name:
Required. The name of this intent.
webhook_state:
Optional. Indicates whether webhooks are enabled for the
intent.
priority:
Optional. The priority of this intent. Higher numbers
represent higher priorities. - If the supplied value is
unspecified or 0, the service translates the value to
500,000, which corresponds to the ``Normal`` priority in the
console. - If the supplied value is negative, the intent is
ignored in runtime detect intent requests.
is_fallback:
Optional. Indicates whether this is a fallback intent.
ml_enabled:
Optional. Indicates whether Machine Learning is enabled for
the intent. Note: If ``ml_enabled`` setting is set to false,
then this intent is not taken into account during inference in
``ML ONLY`` match mode. Also, auto-markup in the UI is turned
off. DEPRECATED! Please use ``ml_disabled`` field instead.
NOTE: If both ``ml_enabled`` and ``ml_disabled`` are either
not set or false, then the default value is determined as
follows: - Before April 15th, 2018 the default is: ml_enabled
= false / ml_disabled = true. - After April 15th, 2018 the
default is: ml_enabled = true / ml_disabled = false.
ml_disabled:
Optional. Indicates whether Machine Learning is disabled for
the intent. Note: If ``ml_disabled`` setting is set to true,
then this intent is not taken into account during inference in
``ML ONLY`` match mode. Also, auto-markup in the UI is turned
off.
end_interaction:
Optional. Indicates that this intent ends an interaction. Some
integrations (e.g., Actions on Google or Dialogflow phone
gateway) use this information to close interaction with an end
user. Default is false.
input_context_names:
Optional. The list of context names required for this intent
to be triggered. Format: ``projects/<Project
ID>/agent/sessions/-/contexts/<Context ID>``.
events:
Optional. The collection of event names that trigger the
intent. If the collection of input contexts is not empty, all
of the contexts must be present in the active user session for
an event to trigger this intent. Event names are limited to
150 characters.
training_phrases:
Optional. The collection of examples that the agent is trained
on.
action:
Optional. The name of the action associated with the intent.
Note: The action name must not contain whitespaces.
output_contexts:
Optional. The collection of contexts that are activated when
the intent is matched. Context messages in this collection
should not set the parameters field. Setting the
``lifespan_count`` to 0 will reset the context when the intent
is matched. Format: ``projects/<Project
ID>/agent/sessions/-/contexts/<Context ID>``.
reset_contexts:
Optional. Indicates whether to delete all contexts in the
current session when this intent is matched.
parameters:
Optional. The collection of parameters associated with the
intent.
messages:
Optional. The collection of rich messages corresponding to the
``Response`` field in the Dialogflow console.
default_response_platforms:
Optional. The list of platforms for which the first responses
will be copied from the messages in PLATFORM_UNSPECIFIED
(i.e. default platform).
root_followup_intent_name:
Output only. The unique identifier of the root intent in the
chain of followup intents. It identifies the correct followup
intents chain for this intent. Format: ``projects/<Project
ID>/agent/intents/<Intent ID>``.
parent_followup_intent_name:
Optional. The unique identifier of the parent intent in the
chain of followup intents. You can set this field when
creating an intent, for example with [CreateIntent][google.clo
ud.dialogflow.v2beta1.Intents.CreateIntent] or [BatchUpdateInt
ents][google.cloud.dialogflow.v2beta1.Intents.BatchUpdateInten
ts], in order to make this intent a followup intent. It
identifies the parent followup intent. Format:
``projects/<Project ID>/agent/intents/<Intent ID>``.
followup_intent_info:
Output only. Information about all followup intents that have
this intent as a direct or indirect parent. We populate this
field only in the output.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Intent)
},
)
_sym_db.RegisterMessage(Intent)
_sym_db.RegisterMessage(Intent.TrainingPhrase)
_sym_db.RegisterMessage(Intent.TrainingPhrase.Part)
_sym_db.RegisterMessage(Intent.Parameter)
_sym_db.RegisterMessage(Intent.Message)
_sym_db.RegisterMessage(Intent.Message.Text)
_sym_db.RegisterMessage(Intent.Message.Image)
_sym_db.RegisterMessage(Intent.Message.QuickReplies)
_sym_db.RegisterMessage(Intent.Message.Card)
_sym_db.RegisterMessage(Intent.Message.Card.Button)
_sym_db.RegisterMessage(Intent.Message.SimpleResponse)
_sym_db.RegisterMessage(Intent.Message.SimpleResponses)
_sym_db.RegisterMessage(Intent.Message.BasicCard)
_sym_db.RegisterMessage(Intent.Message.BasicCard.Button)
_sym_db.RegisterMessage(Intent.Message.BasicCard.Button.OpenUriAction)
_sym_db.RegisterMessage(Intent.Message.Suggestion)
_sym_db.RegisterMessage(Intent.Message.Suggestions)
_sym_db.RegisterMessage(Intent.Message.LinkOutSuggestion)
_sym_db.RegisterMessage(Intent.Message.ListSelect)
_sym_db.RegisterMessage(Intent.Message.ListSelect.Item)
_sym_db.RegisterMessage(Intent.Message.CarouselSelect)
_sym_db.RegisterMessage(Intent.Message.CarouselSelect.Item)
_sym_db.RegisterMessage(Intent.Message.SelectItemInfo)
_sym_db.RegisterMessage(Intent.Message.TelephonyPlayAudio)
_sym_db.RegisterMessage(Intent.Message.TelephonySynthesizeSpeech)
_sym_db.RegisterMessage(Intent.Message.TelephonyTransferCall)
_sym_db.RegisterMessage(Intent.Message.RbmText)
_sym_db.RegisterMessage(Intent.Message.RbmCarouselCard)
_sym_db.RegisterMessage(Intent.Message.RbmStandaloneCard)
_sym_db.RegisterMessage(Intent.Message.RbmCardContent)
_sym_db.RegisterMessage(Intent.Message.RbmCardContent.RbmMedia)
_sym_db.RegisterMessage(Intent.Message.RbmSuggestion)
_sym_db.RegisterMessage(Intent.Message.RbmSuggestedReply)
_sym_db.RegisterMessage(Intent.Message.RbmSuggestedAction)
_sym_db.RegisterMessage(Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial)
_sym_db.RegisterMessage(Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri)
_sym_db.RegisterMessage(
Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation
)
_sym_db.RegisterMessage(Intent.Message.MediaContent)
_sym_db.RegisterMessage(Intent.Message.MediaContent.ResponseMediaObject)
_sym_db.RegisterMessage(Intent.Message.BrowseCarouselCard)
_sym_db.RegisterMessage(Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem)
_sym_db.RegisterMessage(
Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction
)
_sym_db.RegisterMessage(Intent.Message.TableCard)
_sym_db.RegisterMessage(Intent.Message.ColumnProperties)
_sym_db.RegisterMessage(Intent.Message.TableCardRow)
_sym_db.RegisterMessage(Intent.Message.TableCardCell)
_sym_db.RegisterMessage(Intent.FollowupIntentInfo)
ListIntentsRequest = _reflection.GeneratedProtocolMessageType(
"ListIntentsRequest",
(_message.Message,),
{
"DESCRIPTOR": _LISTINTENTSREQUEST,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The request message for [Intents.ListIntents][google.cloud.dialogflow.
v2beta1.Intents.ListIntents].
Attributes:
parent:
Required. The agent to list all intents from. Format:
``projects/<Project ID>/agent``.
language_code:
Optional. The language used to access language-specific data.
If not specified, the agent’s default language is used. For
more information, see `Multilingual intent and entity data
<https://cloud.google.com/dialogflow/docs/agents-
multilingual#intent-entity>`__.
intent_view:
Optional. The resource view to apply to the returned intent.
page_size:
Optional. The maximum number of items to return in a single
page. By default 100 and at most 1000.
page_token:
Optional. The next_page_token value returned from a previous
list request.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.ListIntentsRequest)
},
)
_sym_db.RegisterMessage(ListIntentsRequest)
ListIntentsResponse = _reflection.GeneratedProtocolMessageType(
"ListIntentsResponse",
(_message.Message,),
{
"DESCRIPTOR": _LISTINTENTSRESPONSE,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The response message for [Intents.ListIntents][google.cloud.dialogflow
.v2beta1.Intents.ListIntents].
Attributes:
intents:
The list of agent intents. There will be a maximum number of
items returned based on the page_size field in the request.
next_page_token:
Token to retrieve the next page of results, or empty if there
are no more results in the list.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.ListIntentsResponse)
},
)
_sym_db.RegisterMessage(ListIntentsResponse)
GetIntentRequest = _reflection.GeneratedProtocolMessageType(
"GetIntentRequest",
(_message.Message,),
{
"DESCRIPTOR": _GETINTENTREQUEST,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The request message for [Intents.GetIntent][google.cloud.dialogflow.v2
beta1.Intents.GetIntent].
Attributes:
name:
Required. The name of the intent. Format: ``projects/<Project
ID>/agent/intents/<Intent ID>``.
language_code:
Optional. The language used to access language-specific data.
If not specified, the agent’s default language is used. For
more information, see `Multilingual intent and entity data
<https://cloud.google.com/dialogflow/docs/agents-
multilingual#intent-entity>`__.
intent_view:
Optional. The resource view to apply to the returned intent.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.GetIntentRequest)
},
)
_sym_db.RegisterMessage(GetIntentRequest)
CreateIntentRequest = _reflection.GeneratedProtocolMessageType(
"CreateIntentRequest",
(_message.Message,),
{
"DESCRIPTOR": _CREATEINTENTREQUEST,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The request message for [Intents.CreateIntent][google.cloud.dialogflow
.v2beta1.Intents.CreateIntent].
Attributes:
parent:
Required. The agent to create a intent for. Format:
``projects/<Project ID>/agent``.
intent:
Required. The intent to create.
language_code:
Optional. The language used to access language-specific data.
If not specified, the agent’s default language is used. For
more information, see `Multilingual intent and entity data
<https://cloud.google.com/dialogflow/docs/agents-
multilingual#intent-entity>`__.
intent_view:
Optional. The resource view to apply to the returned intent.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.CreateIntentRequest)
},
)
_sym_db.RegisterMessage(CreateIntentRequest)
UpdateIntentRequest = _reflection.GeneratedProtocolMessageType(
"UpdateIntentRequest",
(_message.Message,),
{
"DESCRIPTOR": _UPDATEINTENTREQUEST,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The request message for [Intents.UpdateIntent][google.cloud.dialogflow
.v2beta1.Intents.UpdateIntent].
Attributes:
intent:
Required. The intent to update.
language_code:
Optional. The language used to access language-specific data.
If not specified, the agent’s default language is used. For
more information, see `Multilingual intent and entity data
<https://cloud.google.com/dialogflow/docs/agents-
multilingual#intent-entity>`__.
update_mask:
Optional. The mask to control which fields get updated.
intent_view:
Optional. The resource view to apply to the returned intent.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.UpdateIntentRequest)
},
)
_sym_db.RegisterMessage(UpdateIntentRequest)
DeleteIntentRequest = _reflection.GeneratedProtocolMessageType(
"DeleteIntentRequest",
(_message.Message,),
{
"DESCRIPTOR": _DELETEINTENTREQUEST,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The request message for [Intents.DeleteIntent][google.cloud.dialogflow
.v2beta1.Intents.DeleteIntent].
Attributes:
name:
Required. The name of the intent to delete. If this intent has
direct or indirect followup intents, we also delete them.
Format: ``projects/<Project ID>/agent/intents/<Intent ID>``.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.DeleteIntentRequest)
},
)
_sym_db.RegisterMessage(DeleteIntentRequest)
BatchUpdateIntentsRequest = _reflection.GeneratedProtocolMessageType(
"BatchUpdateIntentsRequest",
(_message.Message,),
{
"DESCRIPTOR": _BATCHUPDATEINTENTSREQUEST,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The request message for [Intents.BatchUpdateIntents][google.cloud.dial
ogflow.v2beta1.Intents.BatchUpdateIntents].
Attributes:
parent:
Required. The name of the agent to update or create intents
in. Format: ``projects/<Project ID>/agent``.
intent_batch:
Required. The source of the intent batch. For each intent in
the batch: - If ``name`` is specified, we update an existing
intent. - If ``name`` is not specified, we create a new
intent.
intent_batch_uri:
The URI to a Google Cloud Storage file containing intents to
update or create. The file format can either be a serialized
proto (of IntentBatch type) or JSON object. Note: The URI must
start with “gs://”.
intent_batch_inline:
The collection of intents to update or create.
language_code:
Optional. The language used to access language-specific data.
If not specified, the agent’s default language is used. For
more information, see `Multilingual intent and entity data
<https://cloud.google.com/dialogflow/docs/agents-
multilingual#intent-entity>`__.
update_mask:
Optional. The mask to control which fields get updated.
intent_view:
Optional. The resource view to apply to the returned intent.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest)
},
)
_sym_db.RegisterMessage(BatchUpdateIntentsRequest)
BatchUpdateIntentsResponse = _reflection.GeneratedProtocolMessageType(
"BatchUpdateIntentsResponse",
(_message.Message,),
{
"DESCRIPTOR": _BATCHUPDATEINTENTSRESPONSE,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The response message for [Intents.BatchUpdateIntents][google.cloud.dia
logflow.v2beta1.Intents.BatchUpdateIntents].
Attributes:
intents:
The collection of updated or created intents.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse)
},
)
_sym_db.RegisterMessage(BatchUpdateIntentsResponse)
BatchDeleteIntentsRequest = _reflection.GeneratedProtocolMessageType(
"BatchDeleteIntentsRequest",
(_message.Message,),
{
"DESCRIPTOR": _BATCHDELETEINTENTSREQUEST,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """The request message for [Intents.BatchDeleteIntents][google.cloud.dial
ogflow.v2beta1.Intents.BatchDeleteIntents].
Attributes:
parent:
Required. The name of the agent to delete all entities types
for. Format: ``projects/<Project ID>/agent``.
intents:
Required. The collection of intents to delete. Only intent
``name`` must be filled in.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest)
},
)
_sym_db.RegisterMessage(BatchDeleteIntentsRequest)
IntentBatch = _reflection.GeneratedProtocolMessageType(
"IntentBatch",
(_message.Message,),
{
"DESCRIPTOR": _INTENTBATCH,
"__module__": "google.cloud.dialogflow_v2beta1.proto.intent_pb2",
"__doc__": """This message is a wrapper around a collection of intents.
Attributes:
intents:
A collection of intents.
""",
# @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.IntentBatch)
},
)
_sym_db.RegisterMessage(IntentBatch)
DESCRIPTOR._options = None
_INTENT_TRAININGPHRASE_TYPE.values_by_name["TEMPLATE"]._options = None
_INTENT_TRAININGPHRASE.fields_by_name["type"]._options = None
_INTENT_TRAININGPHRASE.fields_by_name["parts"]._options = None
_INTENT_TRAININGPHRASE.fields_by_name["times_added_count"]._options = None
_INTENT_MESSAGE_LISTSELECT.fields_by_name["subtitle"]._options = None
_INTENT_MESSAGE.fields_by_name["platform"]._options = None
_INTENT.fields_by_name["name"]._options = None
_INTENT.fields_by_name["display_name"]._options = None
_INTENT.fields_by_name["webhook_state"]._options = None
_INTENT.fields_by_name["priority"]._options = None
_INTENT.fields_by_name["is_fallback"]._options = None
_INTENT.fields_by_name["ml_enabled"]._options = None
_INTENT.fields_by_name["ml_disabled"]._options = None
_INTENT.fields_by_name["end_interaction"]._options = None
_INTENT.fields_by_name["input_context_names"]._options = None
_INTENT.fields_by_name["events"]._options = None
_INTENT.fields_by_name["training_phrases"]._options = None
_INTENT.fields_by_name["action"]._options = None
_INTENT.fields_by_name["output_contexts"]._options = None
_INTENT.fields_by_name["reset_contexts"]._options = None
_INTENT.fields_by_name["parameters"]._options = None
_INTENT.fields_by_name["default_response_platforms"]._options = None
_INTENT.fields_by_name["root_followup_intent_name"]._options = None
_INTENT.fields_by_name["parent_followup_intent_name"]._options = None
_INTENT.fields_by_name["followup_intent_info"]._options = None
_INTENT._options = None
_LISTINTENTSREQUEST.fields_by_name["parent"]._options = None
_LISTINTENTSREQUEST.fields_by_name["language_code"]._options = None
_GETINTENTREQUEST.fields_by_name["name"]._options = None
_GETINTENTREQUEST.fields_by_name["language_code"]._options = None
_CREATEINTENTREQUEST.fields_by_name["parent"]._options = None
_CREATEINTENTREQUEST.fields_by_name["intent"]._options = None
_CREATEINTENTREQUEST.fields_by_name["language_code"]._options = None
_UPDATEINTENTREQUEST.fields_by_name["intent"]._options = None
_UPDATEINTENTREQUEST.fields_by_name["language_code"]._options = None
_DELETEINTENTREQUEST.fields_by_name["name"]._options = None
_BATCHUPDATEINTENTSREQUEST.fields_by_name["parent"]._options = None
_BATCHUPDATEINTENTSREQUEST.fields_by_name["language_code"]._options = None
_BATCHDELETEINTENTSREQUEST.fields_by_name["parent"]._options = None
_BATCHDELETEINTENTSREQUEST.fields_by_name["intents"]._options = None
_INTENTS = _descriptor.ServiceDescriptor(
name="Intents",
full_name="google.cloud.dialogflow.v2beta1.Intents",
file=DESCRIPTOR,
index=0,
serialized_options=b"\312A\031dialogflow.googleapis.com\322AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow",
create_key=_descriptor._internal_create_key,
serialized_start=12354,
serialized_end=14501,
methods=[
_descriptor.MethodDescriptor(
name="ListIntents",
full_name="google.cloud.dialogflow.v2beta1.Intents.ListIntents",
index=0,
containing_service=None,
input_type=_LISTINTENTSREQUEST,
output_type=_LISTINTENTSRESPONSE,
serialized_options=b"\202\323\344\223\002f\022*/v2beta1/{parent=projects/*/agent}/intentsZ8\0226/v2beta1/{parent=projects/*/locations/*/agent}/intents\332A\006parent\332A\024parent,language_code",
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name="GetIntent",
full_name="google.cloud.dialogflow.v2beta1.Intents.GetIntent",
index=1,
containing_service=None,
input_type=_GETINTENTREQUEST,
output_type=_INTENT,
serialized_options=b"\202\323\344\223\002f\022*/v2beta1/{name=projects/*/agent/intents/*}Z8\0226/v2beta1/{name=projects/*/locations/*/agent/intents/*}\332A\004name\332A\022name,language_code",
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name="CreateIntent",
full_name="google.cloud.dialogflow.v2beta1.Intents.CreateIntent",
index=2,
containing_service=None,
input_type=_CREATEINTENTREQUEST,
output_type=_INTENT,
serialized_options=b'\202\323\344\223\002v"*/v2beta1/{parent=projects/*/agent}/intents:\006intentZ@"6/v2beta1/{parent=projects/*/locations/*/agent}/intents:\006intent\332A\rparent,intent\332A\033parent,intent,language_code',
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name="UpdateIntent",
full_name="google.cloud.dialogflow.v2beta1.Intents.UpdateIntent",
index=3,
containing_service=None,
input_type=_UPDATEINTENTREQUEST,
output_type=_INTENT,
serialized_options=b"\202\323\344\223\002\204\00121/v2beta1/{intent.name=projects/*/agent/intents/*}:\006intentZG2=/v2beta1/{intent.name=projects/*/locations/*/agent/intents/*}:\006intent\332A\022intent,update_mask\332A\006intent\332A\024intent,language_code\332A intent,language_code,update_mask",
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name="DeleteIntent",
full_name="google.cloud.dialogflow.v2beta1.Intents.DeleteIntent",
index=4,
containing_service=None,
input_type=_DELETEINTENTREQUEST,
output_type=google_dot_protobuf_dot_empty__pb2._EMPTY,
serialized_options=b"\202\323\344\223\002f**/v2beta1/{name=projects/*/agent/intents/*}Z8*6/v2beta1/{name=projects/*/locations/*/agent/intents/*}\332A\004name",
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name="BatchUpdateIntents",
full_name="google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntents",
index=5,
containing_service=None,
input_type=_BATCHUPDATEINTENTSREQUEST,
output_type=google_dot_longrunning_dot_operations__pb2._OPERATION,
serialized_options=b'\202\323\344\223\002\204\001"6/v2beta1/{parent=projects/*/agent}/intents:batchUpdate:\001*ZG"B/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchUpdate:\001*\312AT\n:google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse\022\026google.protobuf.Struct',
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name="BatchDeleteIntents",
full_name="google.cloud.dialogflow.v2beta1.Intents.BatchDeleteIntents",
index=6,
containing_service=None,
input_type=_BATCHDELETEINTENTSREQUEST,
output_type=google_dot_longrunning_dot_operations__pb2._OPERATION,
serialized_options=b'\202\323\344\223\002\204\001"6/v2beta1/{parent=projects/*/agent}/intents:batchDelete:\001*ZG"B/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchDelete:\001*\332A\016parent,intents\312A/\n\025google.protobuf.Empty\022\026google.protobuf.Struct',
create_key=_descriptor._internal_create_key,
),
],
)
_sym_db.RegisterServiceDescriptor(_INTENTS)
DESCRIPTOR.services_by_name["Intents"] = _INTENTS
# @@protoc_insertion_point(module_scope)
| 39.1124 | 21,583 | 0.628732 | 29,757 | 293,343 | 5.891185 | 0.048022 | 0.061254 | 0.062623 | 0.078583 | 0.783114 | 0.738973 | 0.686624 | 0.642204 | 0.610665 | 0.557118 | 0 | 0.0362 | 0.280075 | 293,343 | 7,499 | 21,584 | 39.117616 | 0.793896 | 0.020355 | 0 | 0.716151 | 1 | 0.004124 | 0.292588 | 0.147589 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.002199 | 0 | 0.002199 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
867a626da4bbc18d401598b6f188faad656b4821 | 228 | py | Python | pagina/admin.py | jffc-dev/Python-Django-Tecshop | c26ab6da20eca0483b900d253eacc37d2e8b1f26 | [
"MIT"
] | null | null | null | pagina/admin.py | jffc-dev/Python-Django-Tecshop | c26ab6da20eca0483b900d253eacc37d2e8b1f26 | [
"MIT"
] | null | null | null | pagina/admin.py | jffc-dev/Python-Django-Tecshop | c26ab6da20eca0483b900d253eacc37d2e8b1f26 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Banner,Slide, Plantilla
# Register your models here.
admin.site.register(Banner)
admin.site.register(Slide)
admin.site.register(Plantilla)
admin.site.site_header = 'TECSHOP' | 25.333333 | 43 | 0.807018 | 32 | 228 | 5.71875 | 0.46875 | 0.196721 | 0.278689 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.092105 | 228 | 9 | 44 | 25.333333 | 0.884058 | 0.114035 | 0 | 0 | 0 | 0 | 0.034826 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
867ab8202d0a5a5438471c19f86e146fd5b1e729 | 73 | py | Python | prml/linear/_regression.py | jinmang2/PRML | 8f8270cbae986c607f3cc6f89afefd58fa69fadd | [
"MIT"
] | 11,017 | 2017-07-03T03:06:25.000Z | 2022-03-30T18:47:20.000Z | prml/linear/_regression.py | jinmang2/PRML | 8f8270cbae986c607f3cc6f89afefd58fa69fadd | [
"MIT"
] | 21 | 2017-08-13T01:35:41.000Z | 2022-03-21T06:25:09.000Z | prml/linear/_regression.py | jinmang2/PRML | 8f8270cbae986c607f3cc6f89afefd58fa69fadd | [
"MIT"
] | 3,417 | 2017-07-05T12:55:52.000Z | 2022-03-30T18:47:27.000Z | class Regression(object):
"""Base class for regressors."""
pass
| 14.6 | 36 | 0.643836 | 8 | 73 | 5.875 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.219178 | 73 | 4 | 37 | 18.25 | 0.824561 | 0.356164 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
8691df68f7446a9866ca30581c70e34a5f5b78dd | 141 | py | Python | project euler solutions/Problem_048.py | helq/old_code | a432faf1b340cb379190a2f2b11b997b02d1cd8d | [
"CC0-1.0"
] | null | null | null | project euler solutions/Problem_048.py | helq/old_code | a432faf1b340cb379190a2f2b11b997b02d1cd8d | [
"CC0-1.0"
] | 4 | 2020-03-10T19:20:21.000Z | 2021-06-07T15:39:48.000Z | project euler solutions/Problem_048.py | helq/old_code | a432faf1b340cb379190a2f2b11b997b02d1cd8d | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
eval_serie = 0
for i in range(1,1001):
eval_serie += i ** i
print str(eval_serie)[-10:]
| 15.666667 | 27 | 0.602837 | 25 | 141 | 3.28 | 0.76 | 0.329268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.087719 | 0.191489 | 141 | 8 | 28 | 17.625 | 0.631579 | 0.304965 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
86a9a788a710383c571b3f2623252cff48bed8e2 | 151 | py | Python | src/glusterfstools/cli/__init__.py | aravindavk/glusterfs-tools | 414908f67463372d88ee37afbebad9aaf55732d1 | [
"BSD-3-Clause"
] | 3 | 2016-05-03T05:57:38.000Z | 2018-03-23T18:16:14.000Z | src/glusterfstools/cli/__init__.py | aravindavk/glusterfs-tools | 414908f67463372d88ee37afbebad9aaf55732d1 | [
"BSD-3-Clause"
] | null | null | null | src/glusterfstools/cli/__init__.py | aravindavk/glusterfs-tools | 414908f67463372d88ee37afbebad9aaf55732d1 | [
"BSD-3-Clause"
] | 2 | 2022-02-21T20:35:55.000Z | 2022-02-21T20:36:18.000Z | # -*- coding: utf-8 -*-
"""
glusterfstools.cli
:copyright: (c) 2013, 2014 by Aravinda VK
:license: BSD, see LICENSE for more details.
"""
| 18.875 | 48 | 0.602649 | 19 | 151 | 4.789474 | 0.947368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.077586 | 0.231788 | 151 | 7 | 49 | 21.571429 | 0.706897 | 0.854305 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
86bcb044d70008edeec95382d98cfb297ef4b962 | 1,665 | py | Python | python/phonenumbers/data/region_LV.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:54.000Z | 2021-03-08T18:59:40.000Z | python/phonenumbers/data/region_LV.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/data/region_LV.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 1 | 2018-11-10T03:47:34.000Z | 2018-11-10T03:47:34.000Z | """Auto-generated file, do not edit by hand. LV metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_LV = PhoneMetadata(id='LV', country_code=371, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2689]\\d{7}', possible_number_pattern='\\d{8}'),
fixed_line=PhoneNumberDesc(national_number_pattern='6[3-8]\\d{6}', possible_number_pattern='\\d{8}', example_number='63123456'),
mobile=PhoneNumberDesc(national_number_pattern='2\\d{7}', possible_number_pattern='\\d{8}', example_number='21234567'),
toll_free=PhoneNumberDesc(national_number_pattern='80\\d{6}', possible_number_pattern='\\d{8}', example_number='80123456'),
premium_rate=PhoneNumberDesc(national_number_pattern='90\\d{6}', possible_number_pattern='\\d{8}', example_number='90123456'),
shared_cost=PhoneNumberDesc(national_number_pattern='81\\d{6}', possible_number_pattern='\\d{8}', example_number='81123456'),
personal_number=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
voip=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
pager=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
uan=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
voicemail=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
no_international_dialling=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
number_format=[NumberFormat(pattern='([2689]\\d)(\\d{3})(\\d{3})', format=u'\\1 \\2 \\3')],
mobile_number_portable_region=True)
| 87.631579 | 132 | 0.771772 | 211 | 1,665 | 5.763033 | 0.322275 | 0.256579 | 0.286184 | 0.355263 | 0.477796 | 0.477796 | 0.477796 | 0.425987 | 0.425987 | 0 | 0 | 0.05148 | 0.066667 | 1,665 | 18 | 133 | 92.5 | 0.731017 | 0.031832 | 0 | 0 | 1 | 0 | 0.122665 | 0.016812 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.0625 | 0 | 0.0625 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
8116c2783ecfaf3566ee3c904473da03d536e33b | 106 | py | Python | 3_text/code/sys_stdin_readline_enumerate.py | lluxury/P_U_S_A | 1eb9d1fef74f9ce3618ae950f5223f598510be84 | [
"MIT"
] | null | null | null | 3_text/code/sys_stdin_readline_enumerate.py | lluxury/P_U_S_A | 1eb9d1fef74f9ce3618ae950f5223f598510be84 | [
"MIT"
] | null | null | null | 3_text/code/sys_stdin_readline_enumerate.py | lluxury/P_U_S_A | 1eb9d1fef74f9ce3618ae950f5223f598510be84 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
for i, line in enumerate(sys.stdin):
print "%s: %s" % (i, line)
# | 11.777778 | 36 | 0.59434 | 18 | 106 | 3.5 | 0.777778 | 0.15873 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216981 | 106 | 9 | 37 | 11.777778 | 0.759036 | 0.188679 | 0 | 0 | 0 | 0 | 0.070588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.333333 | null | null | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
811da885d4d0f9e824be2ff3ef720300600131b5 | 21 | py | Python | runway/cfngin/hooks/ssm/__init__.py | avosper-intellaegis/runway | 757d4e7db269ec16479b044ac82a69f25fa2a450 | [
"Apache-2.0"
] | 134 | 2018-02-26T21:35:23.000Z | 2022-03-03T00:30:27.000Z | runway/cfngin/hooks/ssm/__init__.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 937 | 2018-03-08T22:04:35.000Z | 2022-03-30T12:21:47.000Z | runway/cfngin/hooks/ssm/__init__.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 70 | 2018-02-26T23:48:11.000Z | 2022-03-02T18:44:30.000Z | """AWS SSM hooks."""
| 10.5 | 20 | 0.52381 | 3 | 21 | 3.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 21 | 1 | 21 | 21 | 0.611111 | 0.666667 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
812819e351351043b11225cca784089573d8973c | 2,787 | py | Python | moments/LD/Demographics1D.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | moments/LD/Demographics1D.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | moments/LD/Demographics1D.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from moments.LD import Demography
from moments.LD.LDstats_mod import LDstats
def snm(params=None, rho=None, theta=0.001, pop_ids=None):
"""
Equilibrium neutral model
rho: population-scaled recombination rate (4Nr), given as scalar or list of rhos
theta: population-scaled mutation rate (4Nu)
"""
Y = Demography.equilibrium(rho=rho, theta=theta)
Y = LDstats(Y, num_pops=1, pop_ids=pop_ids)
return Y
def two_epoch(params, rho=None, theta=0.001, pop_ids=None):
"""
Two epoch model
params: = (nu,T), where nu is the new population size, integrated for time T
rho: population-scaled recombination rate (4Nr), given as scalar or list of rhos
theta: population-scaled mutation rate (4Nu)
"""
nu,T = params
Y = Demography.equilibrium(rho=rho, theta=theta)
Y = LDstats(Y, num_pops=1, pop_ids=pop_ids)
Y.integrate([nu], T, rho=rho, theta=theta)
return Y
def three_epoch(params, rho=None, theta=0.001, pop_ids=None):
"""
Three epoch model
params: = (nu1,nu2,T1,T2), where nus are the population size, integrated
for times T1 and T2
rho: population-scaled recombination rate (4Nr), given as scalar or list of rhos
theta: population-scaled mutation rate (4Nu)
"""
nu1,nu2,T1,T2 = params
Y = Demography.equilibrium(rho=rho, theta=theta)
Y = LDstats(Y, num_pops=1, pop_ids=pop_ids)
Y.integrate([nu1], T1, rho=rho, theta=theta)
Y.integrate([nu2], T2, rho=rho, theta=theta)
return Y
def growth(params, order=2, rho=0, theta=0.001, pop_ids=None):
"""
Exponential growth (or decay) model
params: = (nuF,T), nu F is the final population size after time T (starting from nu=1)
rho: population-scaled recombination rate (4Nr), given as scalar or list of rhos
theta: population-scaled mutation rate (4Nu)
"""
nuF,T = params
Y = Demography.equilibrium(rho=rho, theta=theta)
Y = LDstats(Y, num_pops=1, pop_ids=pop_ids)
nu_func = lambda t: [np.exp( np.log(nuF) *t/T)]
Y.integrate(nu_func, T, rho=rho, theta=theta)
return Y
def bottlegrowth(params, ns=200, rho=0, theta=0.001, pop_ids=None):
"""
Exponential growth (or decay) model after size change
params: = (nuB,nuF,T), nu F is the final population size after time T,
starting from instantaneous population size change of nuB
rho: population-scaled recombination rate (4Nr), given as scalar or list of rhos
theta: population-scaled mutation rate (4Nu)
"""
nuB,nuF,T = params
Y = Demography.equilibrium(rho=rho, theta=theta)
Y = LDstats(Y, num_pops=1, pop_ids=pop_ids)
nu_func = lambda t: [nuB * np.exp( np.log(nuF/nuB) *t/T)]
Y.integrate(nu_func, T, rho=rho, theta=theta)
return Y
| 39.253521 | 90 | 0.673843 | 441 | 2,787 | 4.197279 | 0.188209 | 0.048622 | 0.059427 | 0.08644 | 0.76013 | 0.736899 | 0.736899 | 0.722853 | 0.692599 | 0.692599 | 0 | 0.025443 | 0.210262 | 2,787 | 70 | 91 | 39.814286 | 0.815538 | 0.426624 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.147059 | false | 0 | 0.088235 | 0 | 0.382353 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d498f1877825d6ce7b7b4ae755fed0d8e705d6c5 | 42,591 | py | Python | mplh5canvas/base_page.py | HoverHell/mplh5canvas | 0deeb8414f04641afe854fdc08d4504cdf185944 | [
"BSD-3-Clause"
] | null | null | null | mplh5canvas/base_page.py | HoverHell/mplh5canvas | 0deeb8414f04641afe854fdc08d4504cdf185944 | [
"BSD-3-Clause"
] | null | null | null | mplh5canvas/base_page.py | HoverHell/mplh5canvas | 0deeb8414f04641afe854fdc08d4504cdf185944 | [
"BSD-3-Clause"
] | null | null | null | """Avert your eyes :) A whole stack of HTML masquerading as Python. Aargh..
Anyway, we define a few strings (long strings) that hold the HTML served up at various points in
our backend.
Copyright (c) 2010-2013, SKA South Africa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of SKA South Africa nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
thumb_html = """<html>
<head>
<script>
var thumbnail_ports = new Array();
var native_w = new Array();
var native_h = new Array();
function resize_canvas(id, width, height)
{
// do nothing :)
}
</script>
</head>
<body topmargin='0'>
<!--thumbnail_body-->
</body>
</html>
"""
thumb_inner = """
<canvas draggable="true" id='thumbnail_<id>' style="height: 48px; width: 64px; border: 1px solid grey;">
<script>
function gen_thumb<id> () {
var ax_bb = new Array();
var ax_datalim = new Array();
thumbnail_ports[<id>] = <!--thumbnail_port-->;
var el = document.getElementById('thumbnail_<id>');
var id = <id>;
el.setAttribute('draggable', 'true');
el.addEventListener('dragstart', function (e) {
e.dataTransfer.effectAllowed = 'copy'; // only dropEffect='copy' will be dropable
e.dataTransfer.setData('Text', <id>); // required otherwise doesn't work
}, false);
var c_t_<id> = document.getElementById('thumbnail_<id>').getContext('2d');
c_t_<id>.scale(document.getElementById('thumbnail_<id>').width/<!--width-->, document.getElementById('thumbnail_<id>').height/<!--height-->);
var thumbnail_content_<id> = "<!--thumbnail_content-->";
eval(thumbnail_content_<id>);
frame_header();
top.plot_if_possible(<!--thumbnail_port-->);
}
gen_thumb<id>();
</script>
</canvas>
"""
base_html = """<!DOCTYPE html>
<html>
<head>
<title>HTML 5 Matplotlib Canvas</title>
<style type="text/css">
body
{
font-family: sans-serif;
}
h1
{
font-size: 1.2em;
font-weight: bold;
}
</style>
</head>
<body onmouseup="outSize();" onselectstart="return false" onload="connect_manager();">
<!-- Static images used on this page. B64 encoded to avoid seperate path loading... -->
<!-- base64 inline images shock! Page is not served from a standard webserver, hence the malarky... -->
<img style='display: none;' id="button_close" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAPzSURBVDiNfZV/TNR1GMdf38/3TuBukHCAgMdxwBJisMMfEZPUtaGxcrFqSVY6kmYO+6NWW+VaK9vcWrlqS5p/iDZna1ZTtv5wWsM0CmZNhUPFkx93hyCdXxCuu+Pu+/1y/YF86YB6tuePz/PZ8/o8n/fz2fOR1u4+HGeBmWTBoxUOHi7MZLXdht1uQwJuj4xzdWSCTs9fXOzxoukzC1MxLQwU52XweeNGUkfGMPUOoP/aheYfAyA3fwV2Zx6Pu4oIPuni9aMX6B8ZT8iX5ioUksTuOhcNVYXQ2obW5110ekIlJQXwcj3fdPVz5GwPM/F4IvDVOhcNOSnEjpwGVf1fmGFmM+bGpzgZiHL4zFUAxNw1n68qInL0NLqmoguJlIYtxDPS0CUSPJ5mxbK9Di0eJ9I3yHjjezxbsZLivIxZoEkWHGzcSPR4G5qmoskSqa88g/WJDaS/2wS2NDQBmoCZB6wsf3MnlroarNs2E3L3MT0WILj3Iz5+cT0mWSBqyh1YRu4Q9njRJbBu3YSlpnJWp+wMbG83QUYaWixG+p4GzM48AFK3bsK2fy+qgMnOKyzrvk5NuQPTGqcN3TOILs3KMnm+i5S1ZSQ5cg1o9hs70UMRklc5DfmmPUOMfnkCVcyuY7904ardjFjtsDHtG0EXoAtQIxFuf3aUqH90XvuVKxJgEc8QvfXNhBUFVQZVhmDPDVz2dESBPZPwnTFDJ01ALBLh2q53CF2/taix04PDdD/dTPiugiowfPLmAIWOLExx4uhIxCXJSPr7+i1igXGQ5cVPRZbRzCZUISWExf184R1WMNuzjWcR9A4TVsap/P4Q1lWFi3jJjlxWn2pBXpmdUGFSWREDvgDisk9hmSMPXUBk8h5To6Os++4QqQ8VG5DQoJ+pGwPG2uK0s+6HFmR7tqGhxVXC1eEJxOUhBXNRAZqAcc8g9hfqSS2dhwX7vVx4bg8XG/Zwr/emEbc67RQ0bTMqtG6opts/gehw+4jl5JDitBMMBHB/9TUD37YZsPbtzQQVhdDUFOdfeo2J+1D/jz9x5ZMWVAHLH6lElJXS4fYh56zZ+sGfAwEadmym/+QpNF1juL0DSZK49OGnhBSFGQEzAtRYFO+Zn4nrOpf2H0SPzyBZkqhq/YK3jv+OMhWeHw67tlTwWFKYP/btR5+OLu7uEiYnJ7HuwPu0Ry20nu2Z7fLc5rFzbtqjFmrbTmCrqkzo4FJuq6qktu0E7VELx865jUOkhRO7OC+DAzvWE+m7wd3OTgLX+lA8sx22PVhEVlkJmdXVpJSUsu/4b/89YP9tJllQU+6gwpFORX46xflZAPT7A/T4J+jxTdDh9i35BfwDr1enT5ZTWAsAAAAASUVORK5CYII=" />
<img style='display: none;' id="button_close_over" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAPpSURBVDiNfZVdbJNVGMd/57wt68e6jXXrurXrysCVbc6ADBDRhJiISIyLGiEQQ4hTQiY3akz0bnoraDSC4QbjhYmJH8TECyUaFogYPmLG5GNsbF3XfeDat1/vum5r375eDF5WRniS5+L8c57/85z/ec5zxKZDJw0eMKOok4leQ6gR9DujJBOTALhr/Fgb1mG4gzjq1yOk8mAolgeBXGKKZN8ptla6ea7Gx4bHt9NaVQvAzXSMG1qcv6f6uT5xkWJHF8LhLokXZoWGQfrfMxRuXeD45p1s8wRWZF9uA7MqR9UhNE87s+42QAAg721ID/xOe3yE87sPssUbQJc80tsr3JwMbmVHMYl3IWImkveOmR+6wBdPvYjVYkGXAvvenRjVFeiCEjcqnDj27aJgGOjhKfZfuUNTbgq7mF8iNIo6ib5TfLbtBSxWCwVF4HrrVZy7n2X1R93grqAgoSChWOmk6v0DOHZtx7nnebLXbqEn07x2Jcpm6xQCUBw1Tb0duRiH2rdgCHC9tAPXzqeXsjnt2Da2kv3nBoW0Rs17Byl7bEnbspYghtNG+uxFHHOLaI01/LfajaUYD/OMtxFd3NWy7yL2TW2UBeqX2sBTjefdA+jZHLaWoKnV/PAY0199R/7uLQQm4/jXgNRnwrTV1pti53M5Jj//hoXotBls9dWVkOWGx7je1cOcqpJXIK+AU83Q7JLIVGKK5ppaU6eChMVcjhtvfkj25u0V7TIfnmDglR7m4ip5iemWeApvbTkWMNCFQAphBs3evM1iLAHKypeAolCwWshLUYpLid3uQFZW+xhOxc220CITzKkJNvx4HGfLmhV8tkA9G0+fQPF5SirMN9aizYO0NbQwpCXQJeTSKTLT03T+cBxX61qTJBuOkhkcNdeOoJ/On06g+D2mhqzzE51XkJa6Zq4mYhQkJIbD+Pd34Vp/n0wbiXDu9cOc33uY1PUhE3cG/TR17zEr5MkOxtMFpMMbIqzrDCZjaLEY177+ltHvfzHJzu7rQVNVspkMfW8cIXmXNPrrH/R/eoK8BKWtGdrbGIgkURo6X+6lKsD4dD8hbQFDGEyc/QshBJc/PkpWVSlKKErILy4Q+e1PDF3n8ifH0I0ihs1Kfe8HfHluklR28f60caUHaU2O0BmZQRZXjMiHmlxlpeFIN5esXn6+NA4sm4daZYgxhwPhixEaDGNPZB5JVh5aS+M7b3MuOs/py1ETXzZgBTPWAFnpxb69DvdshoqZGDKRwlBTCGCV14OzqZHyDU9QFmrlWF+EaGy2JJF42BcgBfjKizSUw5oqC75aF3abnXTOIJoVjKfzXA0n0B8izf+Xmac2etmdhAAAAABJRU5ErkJggg==" />
<img style='display: none;' id="button_max" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAN+SURBVDiNfZVbTJtlHMZ/3wGwVBhIWbGxjDMbwnAC0bCDuiWiS3YhlybsZsmmxuiNd8aIBO/MrrxZ4qJREy92pU6NyYynThonDGLHqSml5UxpCy2Utt/3fp8XbKWlxSf5J1/+h+f/vG/ePJ/UdfWGyQGoisyFZxvoaLXT2lhNXdURAIKRGDO+EKMPlvl9Yh5dGAdHkQ4SHnfaGHrrAmuPpXkgx5gXOyyIBABOpZQ6xUqbUc7R3SLe//QOvuVIYUJZknijv4e+s018rvuY0WN527PRqpZzWWngu1+m+fKHcQxzT5f6qOHqa92c6H2SD3fG0BDID/PdxdXUqBYAwiLFSGoNAK+IMMQWAy82cRn44vb9fcIWp41XzjYzFP8bHYGUpeRMiZ1TJdUATKejuBNLAEREEr8W43Zslt9e6OfPsQC+5QiqqsgMv3merxMedD2ZUZaBuX/xpmkwlwjh1zbZFKlM/t3oHa5fe4krQ9+inuusI6Tu4N0K5SjLYsl8RvQEE/EFgJzF7i0/k/Z2TrfXona22pnR1pGEXvDytey8YSBr6YJ9ruQcHY0OpNHAkvmjNEkwFeWU1cG5I00PhZnERYpmiw1bkRWATX2Xse2lHKJbG+Pc2pjgpNXBkOUiav3RSlYDYWTTwKZYeLrUXlABQIVq4XxFU05uNDaPrKWZ3VqgpaEK1TRMEBqSaYAhDiU7DJLQkbUUkqyACerceoSnisoI7oaJJGO4o16SQssMtJc7sRWX7R1ZSzC+NZ9DGNheRdbStJU7mV3ZQJ3ybVDbXMni9hrfL44w7PkmZ+Bm99u8XPMMANOxBQbc1/NUKkCn1cG0L4w8MbNOfbEdSdfxRQPIWjonst8hpplXfxS9jx9nai6M7PIEqaKSmuIykrvxvEbJ2CeUTKMg2XMVDbSUHOOuJ4isC4MPbvzB684+rIaJoqVyQjKzCfPrVsPk445rfPSZC10YKI6uS4PR+C6lxUX0n+zCtehG6GkkQyAZAk1oTEXmGFkZx70ygTfsy9QsksJwzzuMjsb59X5gb2m2fQ30tfPqmWMMuj/hn9V///e5dNd0MPj8e/zkCvDVz56MfeUZbKPjCQav9OKLz3Jv7R6ToVm8YT8AzVX1tFW30GPvobGshcGbfx1usNlQFZnT7bW01Vdyor6SZseefXmXQ0z5o0z6o9z1BAv+Av4D2HLBnnU1sUYAAAAASUVORK5CYII=" />
<img style='display: none;' id="button_max_over" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANnSURBVDiNhZXLbxtVFMZ/cz22M0mTOK7jR4lD4qRNrZaQqEFRJQQSiLJoQWIFLNghFgiBRP8FlohF6aYLBBJCLAKIBQukSixI2gaJhlSlJTQPbNcxiTNJPI4T2/O6LNranjgSR7rS6Nzzffc7Z865Vzn33jXJYZMOUl/moJSjtJ3BWM8A0D80Sjh2EqElUMIpUEQbVD3sENUt1m58RWhihMgbkwxNXCKUTgFQeZBlfylLfWEVe+UeMv4ibjDkwStPFCpSUs/Nkl+5yXNXLhM9P952eqvV7meoXPsZUx3E8A+3E9Yzv1LrKjJ95WN8HcFGwFSgn7iqAbDt1LlV32yyWjbmN7Ps/eNnw441UxbVLdZXbnDxl8/x+X3g2A3M88EYk8F+AJbMXeYP1gHYdepkrDL51+K8/nWOyq5Fxfaj4jqszX3J+U/fx68KsC1vbtL1fGerOhnTQHeqDffNC8e5OLfPXC6E6mw9IHx2kPjUaXCc9mLJZhPs2FUWyjkAWv/vRghKyQBJQ0GtGTlir6ZRWtJsNbvFL10HYZlHxuVjPk4VVFRDXyOdnkY4NpNdJ3ihd/SxMMmBazIc7GuAzmhRvh9520M0oy8yo9+h2CF4OaGhGoUskVQCYdtEfBpnOmNHKgAIqRovhUY9vtvlDMIyKSoWT0e6UaUExbFQhAT3iBr+jymOjbDqCASapqGGB4YwVvKETw2wUyvze2mNil1rAM72JIkEugEoWQcsGhkPYbaygbBMBkUf25aLGkmMUVkpEBmJc71wm0/+/NYD+GLqAy7EJwBYKj/knfnP2lT6gLGuMBsbDoJjA5TuFVBsm6yRR1imZ3n7ULbtP1nngikeFqsI9fgIZqGK/lcWfa/YFqi4TUJFukeSPROIMxYY4o9VHRVFQPIVdn+6hXoJpO9Q0WUrocRn1T37AeHn8uCbXJ35G9txH82yGwxhypOkFnJkxyu4ojkdPy5f587mfQAK+1uexg4IPx+l3uK3uwbZzfKjQ5sXrCRKgcSxHZaG8mx3VNqK32rp3hQfnn6X+bt7/DC7inw8oi0XrEKRpzio9jO9HaXWW0HXttCVErpbAuBER5Th7iTjfc8y2p3m6nfLDWUNlqOeAKFAsgcSfYJk1M9gpIdOrZOdmsu/JcgV6yyu6diOexjKf/dLl8SuHWsnAAAAAElFTkSuQmCC" />
<img style='display: none;' id="button_resize" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAOhSURBVDiNfZVLTFxVGMd/99zLMMy0PGZ4F6bA8Ia+tY0lscZGqZFFk+60gQWG7mriWppqWxcmmlTdNLE1ttW40Jq4MEpqQmOpxjYoQkEYec2Y4TUMDJnXfc24GB0GmPaf/Hf3/M7/fN+535GO9F1Lsk2KLOhod9FaX067u4L6ikIAZpZCTMwsMjLpZ2jMi2Emti9F2g50Vzp459zLLCctTEVhLmLii5oAVNtkauwyjTYokzQuXBtg2h/MDhSSRPcrh+k60cbteZ3JDWPH7plqylc4uzeH7wbHuP3D7ySSqVzK/x90nzrE/meaufxnGN0E8VQceIIml0Mqrx9poUeCz74fBv5b5650pJJNhnm+1MJpl5VjTgWXFSwJE8nI7oV1lbfuBzj5XAvuSkcqoSIL3u17ia8mIxhxA2eO4FX3rnSSZBICMZOFiM5C2OCeL8KgN8psSCOspZry5mCAD3tP0vveNygd7S5WVAnPShQJWNhQgU2gJEGJTabEJhNWI9x4uEzMSG4eD/h1NsR4i52OdhdKm7uM6aCGZKQ6ubgez1qzX7xhznzhQTUSCKDYphCIbjbu/nyEfbWliLbacnzBGMIwEYbJ0nqc5I6bCfvL8yjNSSJrOp01dj49XYOs6WmP+jZo3luGaKgoZHE1ijAMhGGgx3XWYvoOoN0i8+D8AXoOOrn5WhP7ym0ITU97yheicU8RApKgm0gZnl2OAvCzZ42YZm6BfnCmAYss4bDn4FRAqDpC1ZFUA0gi/vavU7U7J30VAsEowzPrDI4H6P7kES9cGtoCzVSTIzedsLU4l6l/gojxuSVcRbkIwyQaVnk0scy3Q17e+Pg3jIiKf2GDC18+zgpsLLama3ig0s5f88uI0ekl6kryEKbB9PwaiZjGY08APaIiNJ0Xmx1cOdueFdhQmpdOeLyhkIm5FcTQmBfHboXaYht+f2hLoZ25gr5TbqLx7P+1u3wXQtM5VldI4x47Q2NeFMNM0H/9J94/18n1r0eJZ9RrQ9Xp6b8LgLPASn11AfVV+dRXF+CuKiDfqmBPJrjSe4i3b9zFMBOb06an8yCuIif9Hz3YAn2arBaZS+eP411b5fMf/wAyhsqtgRG8wVXuXO3iaJNzy9Gz+WiTkztXu/AGV7k1MJLeJOuAvdh9gumZNR4O+xmfWsEzu5pqQq2T1sYSnj1cibuuiIs37z15wGYq/QS4immpLqGhOjWaPL4gE74Vxr2BJz4B/wKrEccDtJ7HywAAAABJRU5ErkJggg==" />
<img style='display: none;' id="button_resize_over" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAOaSURBVDiNfZRLbBtVGIW/uTO2JxkTv52keTZOSBy1oRIVqEARgoqHuinqAlGhdIO6RIJFxQY2iAWLIlWwAAmxABGxqITEgk15BKEQqZQCah4iIS11EqdxjV8Zj+15eFhU2HFs8Utnc6X/3POfe/8jPXzhY5cD5dYdiqklKvktjOI2lUwKAH/vKFp4ADU4iH9gGknIB1tRDh5UcmlSi3OEp2YYeuYUocljBMeSABRurVLaWKKwdI3ijTl6ki8gtGhLv9RQ6LrsLn1HYfM3HnvzMvGZE22376+99T/YmruECI5Rj0wDUivh7s2ryGqdJy5eRvap/0vWsMYy2f36I8ySxV7XYQDEf2MWU79z8o33eXa0hzPDKo9GFIZV8NYdJLsz/qm6bB6fRZOK+Fzjvodu3SG18AVPvv4eHqEQ8QhOJ/xNFS5kKw47ZYsd3ebHzTLzKYPbRRPdrANgTLzI4+mrrDkJlGJqiWhimr6p4+A47JRqQJNQkiDWLRPrltFrZT79JUPFdpvjAXlPL3pgkJheRVRymwwePdEY426h2tGvxZTO2c/XqBkmwrSIKy7CtBq45xsg1O0iqrktYqNJhO0gbIfdQhW37WfCTF8XcY+LbFo8N6rxyZlRZNNqoOD2EH/AgyhnU0T7xxC2jbBtrKpFvmK1EWpemZ9fe4jzxyJ8dm6So33dLQrzNR/9AS9CckGynBbcztx/sZ/W81RMp4X00tkJvLJEWPMQUUDUrAZUnw+hxYbIp9YaHmZzBjduFZhfyTL74XWeemehhXR/TYZ9DYX9coU9x4vQoiMUN/9E2A6GXuP6aoavFlK8+sE17HKN9E6Jt+eWOxI+GFUbHo5oDjkDRFd0mOzfNxGOzcadPPWKyfJ6FqtcQ5gWT0+FefeVIx0JJ+JdDYXJGGR0B6EdSqLn0uTurJJOF1uMjvgEF55PYFTtjoSJPj/CtBgPOIzFvazdNVAkIaMdOc1fi18iQi8hSc0AKtUszr/1LQCRgMr4UIDxwR7GhwIkBgP0qAqqbTN7MsyVXzM4dbcZDkp2GdmokhWP4NKec53Ko0i8fCpEybX5fjkLNLcHOzqNJxwk6V8kKOVaRu+ERFTi4rk4Jdfhh5Vs45J9ASuh+xPYbj/J0DaWpVPUNUqGl4IuIwHRkOBQr5eJw36GR/xcuXGPnQOr2pbYVambFXecmFYlGnGZ1qAvqKCqPkqWh1xNYkO3+GZ+G6fevqP/AuWCyZZYcPwAAAAAAElFTkSuQmCC" />
<img style='display: none;' id="button_home" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANvSURBVDiNjZVdTJtVGMd/79tauvLZFoaAfJQP040CUmYmA0TishCTGXXJIjEmxk2vjd5suzC7WmI0eqdRkwW3C40X6p2JJBKJjBgWt0ExE6G23cqg3Whrx1ffc87rRUs3GApP8r865/zO85Xn0bre/txkm1ktOj2+Op5uLsfvcfNElRsNiMYSTIcTTPy5xNhUGCHV9qdo24FN1S4+eauPkrUlrLEgcnkBmVwCwFJWicVVjahs5r6jkne+GGMuem9noK5pnB5sZ6i3ESZ/QCyFHrqlgZn9V7PaQNexuGvQDr3I17/O8+WPU6jcuaW66/h5gNOD7bzaaifz8yXkP8uYZpZhahaKn38NbPsw4lGKBoYo7D2BWk2zNvYNHZ1tOFwVTM4uAqBvhjnU28j6+HdII4NUKisTivpPYqv1UtR9HFtzJ2bOE6UU63dCLF88y0v+KpqqXVmg1aLz0aleMhPfIzIGQpKTRnHfCewe32bclPS9gmYvBGB9MUx69gZrsQXSl9/ngzeOYLXoWHt8dThSUVaiwS3JdT37Mo4n/dtKqGPbX5v1UEgMka1y6o+rlEcD9Pjq0DvqnajFIFKSV+nhFyhqfeaRltiEAljd1RjCzCszc4WOeie63+NiPbaQz1tJ1wCl/v6dYQ9Zqf857C2dGFJhSEV6foaO+jL0hpoKVuN3EBKKfUdwdw/uCgPQC+x4z3yGvaEVQ5ik/p7FU1ORrbKUJtI0WY0vEPr2U+Tayq5AUwqunz/Fxv0VDKEQuXzqwdtxHnM9jhQm6XCQ+O8TyI313YFKcTdwjWRoDkOYFNS0ELwdR78WWsZWUYVUio3VFWLTk/le280282dIhaPxADciSfSpcAJLZQNCQTI0T2ZD7AkGbKlyYXsvU+EE+nggguGuw1FVTyoawRCKvfkHhlAYQlF2sAvd0854IIIupOLMV1eoPHYSoXQMYbJXoiFMlKWAg+99yNlLEwipHkybN4/5GChOcPXCu+hWK1qugf/bTKRhcOjcx4ymnVz8KQDkhgPA8MgMo2knR4dHKGk8wEoy9b8q9ng5OjzCaNrJ8MhM/psdB+yF17tZ++s6d3/7hfjNAPfmbgLgbvZS4fVRfriffS1Pce7yBPMLy1v8fgQID1ZAW52TttpSmmr3AzB/K8b0rRTTkQTjgciOK+Bfa+a4GLtdYmQAAAAASUVORK5CYII=" />
<img style='display: none;' id="button_home_over" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANtSURBVDiNjZXdT9tVGMc/59fS/aAvvJettALDAnMYFTTbVGTTGHWJibpsiTOaqIm36oWJd+4/WPRiaqL/gGYX3umlGDSZOnWQiGy8tJXCaPtrKRRafufFi0IHjAhP8tycPOdzvs9znvMcMfzel4Y9ZrSimJyEwjw6N4uTSSOAcKSLhsgAMhjDF46DsPZuxbt3YcNJ44x/zemuFp4djPFo91OciLYD8M+iw99phxupW0xN3aTc8xLabtq1X9QUGkNh8gfk3DjX3n6BM32xHVECTDVMeH1gWUymlvl0fI6V0ACOPw4IADyR4ZevADgT3zNoZrj+wUW62psxpsowwkPwuTfAV4+bWSBw7nX8T1+gPRTgrL9IvpijpARFQvdS3nDSqLmf+eyTt6jzWiitt5RZNI5ewhcbwBfrR7ubmC2lWmt0Ls3FugWWK4Kcp411fQTLaEX2p6+4+ubzeC0vUrHlguDIBeyewe28CY28hrD9AJSXEqxO/4UqZHnF3OZUcBFLgHclOclwJMTjxzvvKQNannmVhr6h3TcmLHzham21VLiyGt8q8/RSYNovsdzMDCP9UZSi5o2nzhM4efq+ltiGAnhbI7jS1DxaXiIaAEvnZnkodhSlNUprQsPnaBwa3R+2wxqHzmLHH8NVGldp/CWHniaBVXQWOR5uQyoIDj5J65kXD4QBWEdsBj7+HLv7JK40eIo5jrUGsIyhqs4Y1jNp5r+5htooHQg0SvLnlXeprJVwpUZKjW3bWC3hGHeWCihpWE3Mkrn5C6pSPhioNdnJPyjM38GVhs1QB6sVsHxH+7i97KC0prJeYnni11qvHWTb9XOVho4HSK15sHzhXm6lHaSGwvwMmxV5KBiw65bFg8MkVhSWHY4zV/YwfTfPykISV2oOpw9cqXGlxhONY7oeZiJRwEJYqPh5vp1eZr0scaXhsERXGqSoo+nyh3wxtoDSpvqWjd1MsfkEN+oMQ9kprl8aRewz63abQVpejl1+n7Gk5N9stTNq87AY7GOuvgETjtI//zv1hez/4vy9A/S88xFjSZfvfluore8YsIK73hhrVgf1Qx20ljIEMyk8+Qwmn0EAvo5OGmI9NAw+gS/+CFd/TJPKru06SOz3BVgCIgFNp9/Q3SiItAWx622KG4ZUyUNyRTGRyKP0/cX+DwdjpAeUBIzPAAAAAElFTkSuQmCC" />
<img style='display: none;' id="button_pan" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAPLSURBVDiNfZVdbFRFGIafmfO7p2Xtj+y2lP7xY5u2glEhhhBBYqQixVCjlya900QTSOCKGEkM8UYTEky84M54aUgshGjSgBjEGAmxtJC2CC1LS9vddlv25+zuObtnvICulq58yXs388w733x5R1ChlFIG8E7Ozb7h+/5ey7I3A/heYUo3zGt2KPQTcF4I4T+9V1SA9bjZ7OBMLBaN3b0bis/NicV4HID6SIRIQ4Nq27Il19TSsmg7zkEhxM2KQKWUzOdyn3sF78jQ4IXww9iDSubLtaGlmTff7UubpnHaDoVOCiGCVUA3656cmYodv3ThZ6foFwHo3NbN9FSMTCpdEaobOvsO9rob21tOh5zQCQC5ck2v4B29fOGSExQFUhjous2+vv109HQjhbFGBBrx6QW+PXXGcTPZj5RSPQBSKWW4GffHX85fDquSRAoTKUyE0h/3RGi8/X4fL722AylMchmf+xMz/PX7KJNj0ywnspz98mydm3HPKaUMCRyYvT8bTTxMrnIgeAJEoz7yPM/V1BBpaOT13r0sxzMYMoQubHRhc+9WjPHhiQhwQObd/O65WMJZcabrdtnl49eSlIoBj5IZGpobae9s5/BAPwPHBtBkqKzb1yfCeTe/W/e90r6lRFpIYWA7Fh98fIjRP8e48esIKlBYlo1u6LRubX7SAkF1OEzVumo0YZcfaOZuQniF4h5p2eYLjxZcpDDxcopsOkf3jk48VxEEAdt2dVEVdmhsjdLYGqV2fQ279r+KEHKVw/lYCss2OySAFAYaj3Vv5AGaJvnw+GE0XfvfORRo5R6uCED6heJE3fp6pDSR0mTk2hRBoLCrrGcOtu8Fqxw2tTfhF4rjUjf0S3XRGiUx8fOCsT8e8tvg6DNhAJMj82jCLqt58wZlmMYVaTnG1fUbarNSGizN5hHYDH0/yuTo/DOBd24kVjnseKU1ZTnGVQlcjLbVztU31JJOlNCFjVQWP3x9ndRiriJsYTpNOl4s925T10Y2vdgQBy5KIYQfqjIO7+zdtKxr/55YyEiGvhuvCPz7xkJ5nWVX897RnUm7yugXQvjlcCi4xc8mh5PHBr+5HS56AQBSE7z8VhMASoFSChRMDidZms+hm5JDn3Sl2rfXfWU5+hfwVHx5udKJgls6cv7MnbrpscoJs1IbO9fR9+nWpOVop82QdmpNfP0H3FPIls7FbmUiU8Op8PykKxYf5AGob7aJtjuqbXs41dJdHbeqtH4hxKqRWAN8AjWAA14u2F30gj2GJTsA/EIwrpvyihmSV4GLlb6AfwCPPIOQNBOBtgAAAABJRU5ErkJggg==" />
<img style='display: none;' id="button_pan_over" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEAwAABAMBtJq7BgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAPVSURBVDiNfZVNTFxVFMf/9777Pu59D2bKDAMzzhSZwcGREmz7wBgiVWO0qWMbN8avEnVR6YIaTOzCFTtduNTFGBcmBtO4oCsILogL40LMtEqjRGwpHYEB5iNQeDPM53MxYaR8neQk772c+7v/c97N/xIcHjKAC4LzfllmLxYKxTClRHI6nAmX2zVTrlQnhBA34/F4af9CcgjslKooP4RDoZaucNjp9/mo1+MBAKxnMlhPp5FMp0ub29sbXp8vOj4+PnMUkBJCrjfoxscfvPGWM9TeLh+hHgCwlknj9/m5gi70byKnuq6Njo5WAYDtqfkk0hEevvL2+82yXGP5TvoBACuJpQNAr9uHlqZWdS5x92pmLWUAeA8A6G6bhtCHh9694lMVAUpkUCKjb6Affef66+/703q4AzXHaD6/8+bw0PCZXYUyk9jY0DtXnaqsH1BCQNFtnkHbE22YvDGBYqGI1GoaqeQ6CvkCAEASkspDfCIWi52kAC4EAyGjMxjR9yuATQAQuDwuuDwu2BWKS5dfh5XNg0EFIxoY0UDyMmiRtWZWMoMUgNkd7tEoUUCJAsY07D4DBIQQ7ORKKJcq4KIBgZAf5sAz+HzsM0iU19POUShMO88ISG8k1N1MSe1HXBx8BZVyBZNj06hWAFlh0A0Dqqbg7HOnAQCGwwFhcEhEq4+mkmMQDfppRiXpbHsgLO8Cs2ub6Ohugz8YwPZmHv6QF80+FwCgq7cTABC9/FJtdpTXgWWLwHGi8TEG27YpZEioAe/+8S86utswEO2FxCiOC7ZHISEEnHNQiUm3lpLLJUoVUKpgLfEQycUMZJWBSkcDS8XyIzNsdDVCgrpEhRAziysLKQoFFAoSf2Ux9e1vsG37WHULs0lIRKtnk9cJBvU2FULE7yfnc5TK2N4oo5ijWJjNYvr72WOB87dWH1HYGmyCrutT1Ov1Tmatla3E8qK1lSrXz9YvN+/h75nkkcB7tzL12uaAA/6wK2m0SN/ReDxeEjofnL5zI1uw7P93JRyTX8+hWjnYeiqxhe1MrVZWBMxLvh2D86hpmqW620Sj0eut4skPH7dfDtI9nhF51gPdqcC2Adg2bBtIL1tI/LkByoCeVxsr7oD+Ve+5yEfAHrcxTfOLB/cfYJVPXWvNveCSC24NAOZ/3Tq05aaAwNMXhaVx/mVPX8enu98PGOzIyEiXoTvGjHKgWcn7PCTXyKpW7QCrzgp0TxXudmmnpUNbc7nFa8HO4J296w9zbMRiMblQKJzXVNHLlYbnuVCf4pqQVFn/Rwj+84kW/pNlWT+apnngCvgP+TAum4t9Kv4AAAAASUVORK5CYII=" />
"""
base_html_decoration = """
<span id='title'>
<h1>HTML 5 Canvas Matplotlib Backend</h1>
</span>
<table width="100%" border=0 cellspacing=2 cellpadding=2 style="margin-bottom: 0; position: absolute; left: 8px; top: 38px;">
<tr>
<td style="height: 50px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid grey;">
<iframe name='thumbnails' id='thumbnails' style='border: none; height: 54px; padding-top: 3px;' width="100%">
<!--thumbnails-->
</iframe>
</td>
<td width=200>
<table cellspacing=5 border=0>
<tr>
<td>
<div onclick="set_layout(1);" style="cursor: pointer; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid grey; height: 22px; width: 40px;"></div>
</td>
<td>
<table onclick="set_layout(2);" cellpadding=1 cellspacing=0 border=0 style='cursor: pointer;'>
<tr>
<td>
<div style="-moz-border-radius: 5px; border-radius: 5px; border: 1px solid grey; height: 20px; width: 20px;"></div>
</td>
<td>
<div style="-moz-border-radius: 5px; border-radius: 5px; border: 1px solid grey; height: 20px; width: 20px;"></div>
</td>
</tr>
</table>
</td>
<td>
<table onclick="set_layout(4);" cellpadding=1 cellspacing=0 border=0 style='cursor: pointer;'>
<tr>
<td>
<div style="-moz-border-radius: 5px; border-radius: 5px; border: 1px solid grey; height: 10px; width: 20px;"></div>
<td>
<div style="-moz-border-radius: 5px; border-radius: 5px; border: 1px solid grey; height: 10px; width: 20px;"></div>
</tr>
<tr>
<td>
<div style="-moz-border-radius: 5px; border-radius: 5px; border: 1px solid grey; height: 10px; width: 20px;"></div>
<td>
<div style="-moz-border-radius: 5px; border-radius: 5px; border: 1px solid grey; height: 10px; width: 20px;"></div>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
"""
base_html_canvii = """
<span id='plot_canvii'>
<span id='plot_canvas_0' style='position: <!--canvas_position-->; top: <!--canvas_top-->px; left: <!--canvas_left-->px;'>
<canvas ondragover="onDragOver(event);" ondrop="onDrop(event, 0);" style="border: 1px solid grey;" id="canvas_0" width="640" height="480" onmouseup="releaseCanvas(event,0);">
</canvas>
<div id='button_menu_0' style="-moz-border-radius-bottomleft: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; border-bottom-right-radius: 5px; background: #336699; border: solid 1px grey; top: -1px; position: relative; width: 640px; height: 20px;">
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr width="100%">
<td width="24" style='padding-left: 2px; padding-right: 10px;'><img onclick='close_plot(0);' onmouseover='this.src=button_close_over.src' onmouseout='this.src=button_close.src' style='cursor: pointer;' id='cb' src=''/><script>document.getElementById('cb').src=document.getElementById('button_close').src</script>
<td width="60%" onmousedown="clickMove(event,0);" style="cursor: move;"><span id="status_0" style='color: white;'>Disconnected</span>
<td width="35%" onmousedown="clickMove(event,0);" style="cursor: move;"><span onclick='change_cursor_info(0);' id='cursor_info_0' style='color: white;'>Cursor</span>
<td width="24" style="text-align: right; padding-left: 5px;"><img onclick='pan_toggle(0);' ondragstart="return false;" style="cursor: pointer;" id="pb" src="" /><script>document.getElementById('pb').src = document.getElementById('button_pan').src</script>
<td width="24" style="text-align: right; padding-left: 5px;"><img onclick='go_home(0);' ondragstart="return false;" onmouseover='this.src=button_home_over.src' onmouseout='this.src=button_home.src' onclick="maximise(0);" style="cursor: pointer;" id="hb" src="" /><script>document.getElementById('hb').src = document.getElementById('button_home').src</script>
<td width="24" style="text-align: right; padding-left: 5px; padding-right: 5px;"><img ondragstart="return false;" onmouseover='this.src=button_max_over.src' onmouseout='this.src=button_max.src' onclick="maximise(0);" style="cursor: pointer;" id="mb" src="" /> <script>document.getElementById('mb').src = document.getElementById('button_max').src</script>
<td width="24" style="text-align: right; padding-right: 5px;" onmousedown="clickSize(event,0);"><img border=0 onmouseover='this.src=button_resize_over.src' onmouseout='this.src=button_resize.src' ondragstart="return false;" style="cursor: se-resize;" id="rb" src="" /> <script>document.getElementById('rb').src = document.getElementById('button_resize').src</script>
</tr>
</table>
</div>
<div style='cursor: crosshair; height: 0px; width: 0px; border: none; position: absolute;' id='limit_div_0_0'
onmousemove="slideCanvas(event,0);"
onmouseup="releaseCanvas(event,0);" ondragover="onDragOver(event);" ondrop="onDrop(event,0);">
</div>
<div id='zoom_div_0' style='height: 0px; width: 0px; border: 1px dashed grey; position: absolute; left: 0px; top: 0px;'
onmousemove="slideCanvas(event,0);" onmouseup="releaseCanvas(event,0);">
</div>
</span>
</span>
<div style='position: absolute; display: none; border: 2px dashed grey;' id='resize_div'></div>
<script type="text/javascript">
var sockets = new Array();
// holds the collection of sockets for this page
var contexts = new Array();
// holds the contexts for this page
var canvii = new Array();
var last_frames = new Array();
var last_id = 0;
var base_span = document.getElementById('plot_canvas_0');
var ztop = 0;
var base_port = 4567;
var management_socket = null;
var canvas_errors = new Array();
var free_frames = new Array();
free_frames[0] = 0;
free_frames[1] = 0;
free_frames[2] = 0;
free_frames[3] = 0;
function plot_if_possible(port) {
// are we plotting this frame ?
for (var i=0; i<last_id+1;i++) { if (free_frames[i] == port) return;}
// if we have an empty / stopped canvas then plot this up
for (var i=0; i<last_id+1;i++) {
if (free_frames[i] == 0) {
start_plotting(i, port);
break;
}
}
}
var layouts = new Array();
layouts[1] = [10, 105, 800, 600];
layouts[2] = [10, 105, 640, 480, 660, 105, 640, 480];
layouts[4] = [10, 105, 453, 340, 477, 105, 453, 340, 10, 474, 453, 340, 477, 474, 453, 340];
function set_layout(t) {
for (var i=last_id;i<t-1;i++) {
add_canvas();
} // make sure we have enough canvii lurking
try {
for (var i=0;i<thumbnails.thumbnail_ports.length;i++) { plot_if_possible(thumbnails.thumbnail_ports[i]);}
} catch (err) {canvas_errors.push("set_layout(" + t + "): " + err);}
// see if this gives use any more plotting opportunities
for (var i=t;i<last_id+1;i++) {
document.getElementById("plot_canvas_" + i).style.display = "none";
stop_plotting(i);
} // make sure non used canvii are inactive and not visible
for (var i=0;i<t;i++) {
var plc = document.getElementById("plot_canvas_" + i);
plc.style.left = layouts[t][i*4] + "px";
plc.style.top = layouts[t][i*4 + 1] + "px";
do_resize(i,layouts[t][i*4 + 2],layouts[t][i*4 + 3]);
plc.style.display = "inline";
// in case we have any data for this canvas..
}
// see if this gives use any more plotting opportunities
}
function maximise(id) {
var w = document.width * 0.98 - document.getElementById('plot_canvas_' + id).offsetLeft;
var h = document.height * 0.98 - document.getElementById('plot_canvas_' + id).offsetTop - 20;
resize = id;
do_resize(id, w, h);
resize = -1;
}
function add_canvas() {
last_id += 1;
var sp = document.getElementById('plot_canvas_0').cloneNode();
sp.id = "plot_canvas_" + last_id;
var t = document.getElementById('plot_canvas_0').innerHTML;
t = t.replace(/0\)/g,last_id + ")");
t = t.replace(/\_0\"/g,"_" + last_id + '"');
sp.innerHTML = t
document.getElementById('plot_canvii').appendChild(sp);
// position new plot
var pc = document.getElementById('plot_canvas_' + last_id);
if (last_id % 2 == 0) {
pc.style.top = 100 + ((last_id / 2) * 530) + "px";
pc.style.left = "10px";
}
else {
pc.style.top = 100 + (((last_id - 1)/2) * 530) + "px";
pc.style.left = "660px";
}
document.getElementById('status_' + last_id).innerText = "Disconnected"
canvii[last_id] = document.getElementById('canvas_' + last_id);
contexts[last_id] = canvii[last_id].getContext('2d');
if (!(last_id in ldiv)) {
ldiv[last_id] = new Array();
ldiv[last_id][0] = document.getElementById('limit_div_0_' + last_id);
ldiv[last_id][0].addEventListener('mousedown', function (e) {wrapClickCanvas(e,this);}, false);
frame_counter[last_id] = 0;
frame_start[last_id] = 0;
cursor_info[last_id] = 0;
}
zdiv[last_id] = document.getElementById('zoom_div_' + last_id);
}
var ax_bb = new Array();
var ax_datalim = new Array();
cursor_info = new Array();
cursor_info[0] = 0;
frame_counter = new Array();
frame_counter[0] = 0;
frame_start = new Array();
frame_start[0] = 0;
function change_cursor_info(id) {
document.getElementById('cursor_info_' + id).innerText = "";
cursor_info[id] += 1;
if (cursor_info[id] > 1) cursor_info[id] = 0;
}
function exec_user_cmd(id, cmd_str) {
var ret_str = "";
try {
ret_str = eval(cmd_str);
} catch(err) { ret_str = "user command failed: " + err;}
if (id in sockets) {
try {
sockets[id].send("<user_cmd_ret args='" + ret_str + "'>");
} catch (err) { alert('error returning output of user cmd:' + err); }
}
}
function draw_frame(id) {
try {
if (frame_counter[id] == 0) { frame_start[id] = new Date().getTime();}
var c = contexts[id];
//if (id in sockets) ldiv[id][0].style.display = "inline";
//else ldiv[id][0].style.display = "none";
// when in client mode we cannot zoom anyway...
for (var i=0; i < ldiv[id].length; i++) ldiv[id][i].style.display= "none";
// hide any existing limit divs...
ax_bb = new Array();
ax_datalim = new Array();
eval(last_frames[id]);
frame_header();
// execute the header. This will perform initial setup that is required (such as images) and then run frame_body..
// we need a zoom limit div per axes
for (var i=0; i < ax_bb.length; i++) {
if (!(i in ldiv[id])) {
var nid = 'limit_div_' + i + '_' + id;
var ndiv = ldiv[id][0].cloneNode();
ndiv.id = nid;
// fix the id
ndiv.removeEventListener('mousedown');
ndiv.addEventListener('mousedown', function (e) {wrapClickCanvas(e,this);}, false);
document.getElementById('plot_canvas_' + id).appendChild(ndiv);
ldiv[id][i] = document.getElementById('limit_div_' + i + '_' + id);
} // we need a limit div for this axes
ldiv[id][i].style.display = "inline";
ldiv[id][i].style.left = canvii[id].offsetLeft + ax_bb[i][0] + "px";
ldiv[id][i].style.top = canvii[id].offsetTop + ax_bb[i][1] + "px";
ldiv[id][i].style.width = ax_bb[i][4] - ax_bb[i][0] + "px";
ldiv[id][i].style.height = ax_bb[i][3] - ax_bb[i][1] + "px";
frame_counter[id] += 1;
if (frame_counter[id] > 30) {
fps = (frame_counter[0] / (new Date().getTime() - frame_start[id]) * 1000);
if (cursor_info[id] == 1) document.getElementById('cursor_info_' + id).innerText = "FPS:" + fps;
frame_counter[id] = 0;
}
}
} catch (err) {canvas_errors.push("draw_frame(" + id + "): " + err);}
}
var last_manage = "";
var server_port = <!--server_port-->;
function connect_manager() {
if (management_socket) management_socket.close()
management_socket = new WebSocket('ws://<!--server_ip-->:' + (server_port+1) + '/');
management_socket.onmessage = function(e) {
last_manage = e.data;
eval(e.data);
} // end of function(e)
management_socket.onopen = function(e) {
management_socket.send("update");
<!--requested_layout-->
}
}
function update_thumbnails() {
try {
document.getElementById('thumbnails').src = "http://<!--server_ip-->:" + server_port + "/thumbs";
} catch (err) { canvas_errors.push("failed to issue update thumbnails"); }
}
function start_plotting(id, port) {
free_frames[id] = port;
//if (!(id in sockets)) {
sockets[id] = new WebSocket('ws://<!--server_ip-->:' + port + '/');
document.getElementById('status_' + id).innerText = "Connecting to port " + port + "..."
sockets[id].onmessage = function(e) {
document.getElementById('status_' + id).innerText = "Connected"
if (e.data.indexOf("/*exec_user_cmd*/") == 0) {
exec_user_cmd(id, e.data);
} else {
last_frames[id] = e.data;
draw_frame(id);
}
} // end of function(e)
//} // end of if id in sockets
}
var allow_resize = true;
function resize_canvas(id, width, height) {
if (allow_resize) {
if (id >= 0) {
canvii[id].width = width;
document.getElementById("button_menu_" + id).style.width = width + "px";
canvii[id].height = height;
}
}
}
function stop_plotting(id) {
free_frames[id] = 0;
if (id in sockets) {
sockets[id].onmessage = function(e) {};
// reset the handler so that the buffer behind this socket does not polute new plots
sockets[id].close();
sockets.pop(id);
last_frames[id] = "";
document.getElementById('status_' + id).innerText = "Disconnected";
}
}
// create the contexts for our canvii
canvii[0] = document.getElementById('canvas_0');
contexts[0] = canvii[0].getContext('2d');
var zdiv = new Array();
zdiv[0] = document.getElementById('zoom_div_0');
var ldiv = new Array();
ldiv[0] = new Array();
ldiv[0][0] = document.getElementById('limit_div_0_0');
ldiv[0][0].addEventListener('mousedown', function (e) {clickCanvas(e, 0, 0);}, false);
// this style of event listener is an issue in Firefox 3.7. Will need to fix at some stage...
var native_w = new Array();
var native_h = new Array();
var zdraw = -1;
var resize = -1;
var move = -1;
var startX = 0;
var startY = 0;
var stopX = 0;
var stopY = 0;
var rStartX = 0;
var rStartY = 0;
var mStartX = 0;
var mStartY = 0;
var pan_mode = false;
var top_e = null;
function wrapClickCanvas(e, ref) {
var p = ref.id.split("_");
// extract the figure and axes ids
clickCanvas(e, p[3], p[2]);
}
function handle_user_event(arg_string, id) {
if (id in sockets) {
try {
sockets[id].send("<user_event args='" + id + "," + arg_string + "'>");
} catch (err) {}
}
}
function handle_click(e, id) {
if (id in sockets) {
try {
var pc = document.getElementById('plot_canvas_' + id);
sockets[id].send("<click args='" + (e.pageX - pc.offsetLeft) + "," + (canvii[id].clientHeight - (e.pageY - pc.offsetTop)) + "," + (e.button + 1) + "'>");
// we need coords based on 0,0 in bottom left corner...
} catch (err) {}
}
}
var top_e = null;
function clickCanvas(e,id,axes) {
//alert("Clicked canvas for id " + id + " and axes " + axes);
if (!e) var e = window.event;
// e.button: 0 is left, 1 is middle, 2 is right.
if ((e.button == 0) && (e.shiftKey == false) && (pan_mode == false)) {
top_e = e;
if (id > -1) zoom_canvas_id = id;
var cnv = document.getElementById('plot_canvas_' + id);
zdraw = axes;
zdiv[id].style.width = 0;
zdiv[id].style.height = 0;
zdiv[id].style.top = (e.pageY - (cnv.offsetTop + cnv.offsetParent.offsetTop)) + "px";
zdiv[id].style.left = (e.pageX - (cnv.offsetLeft + cnv.offsetParent.offsetLeft)) + "px";
zdiv[id].style.display = "inline";
// position the start of the zoom reticule
}
else {
if (id > -1) pan_canvas_id = id;
pdraw = axes;
//zoomButtonDown = true;
}
startX = e.pageX;
startY = e.pageY;
pause = true;
return false;
}
function clickMove(e,id) {
move = id;
mStartY = (e.pageY - document.getElementById('plot_canvas_' + id).offsetTop);
mStartX = (e.pageX - document.getElementById('plot_canvas_' + id).offsetLeft);
ztop += 1;
document.getElementById('plot_canvas_' + id).style.setProperty('z-index',ztop);
}
function clickSize(e,id) {
var cr = document.getElementById('resize_div');
resize = id;
rStartX = e.pageX;
rStartY = e.pageY;
document.getElementById('status_0').innerText = "Click size at " + rStartX + "," + rStartY;
var pcs = document.getElementById('plot_canvas_' + id);
cr.style.top = pcs.style.top;
cr.style.left = pcs.style.left;
cr.style.width = (pcs.clientWidth - 2) + "px";
cr.style.height = (pcs.clientHeight - 4) + "px";
cr.style.display = "inline";
return false;
}
function slideSize(e) {
if (resize > -1) {
var cr = document.getElementById('resize_div');
//resize_canvas(resize, (cw + (e.pageX - rStartX)), (ch + (e.pageY - rStartY)));
cr.style.width = (e.pageX - cr.offsetLeft) + "px";
cr.style.height = (e.pageY - cr.offsetTop) + "px";
document.getElementById('status_0').innerText = "Slide size to " + (e.pageX - rStartX) + "," + (e.pageY - rStartY);
}
else if (move > -1) {
var plc = document.getElementById('plot_canvas_' + move);
plc.style.top = (e.pageY - mStartY) + "px";
plc.style.left = (e.pageX - mStartX) + "px";
}
return false;
}
function do_resize(id, w, h) {
if (id in sockets) {
try {
sockets[id].send("<resize args='" + w + "," + h + "'>");
} catch (err) {}
}
else {
var xScale = w / native_w[id];
var yScale = h / native_h[id];
resize_canvas(id, w, h);
// no figure active for this canvas so do a purely client side resize
allow_resize = false;
canvii[id].width = canvii[id].width;
// clear the canvas and reset scale factor before client size redraw
document.getElementById('status_' + id).innerText = "Client side resize mode";
contexts[id].scale(xScale, yScale);
// needs to be done after resize_canvas, but this loses canvii[id].width/height so extra vars needed
draw_frame(id);
// the frame we draw may contain resize commands. Ignore these in client only mode hence the bracketing allow_resize directives.
allow_resize = true;
}
}
function outSize() {
if (resize > -1) {
var cr = document.getElementById('resize_div');
do_resize(resize, cr.clientWidth, cr.clientHeight - 20);
cr.style.display = "none";
}
resize = -1;
move = -1;
zdraw = -1;
pdraw = -1;
// make sure we kill everything on mouse up
}
function close_plot(id) {
sockets[id].send("<close args=''>");
stop_plotting(id);
canvii[id].width = canvii[id].width;
}
function pan_toggle(id) {
pan_mode = !pan_mode;
if (!pan_mode) document.getElementById('pb').src = document.getElementById('button_pan').src;
else document.getElementById('pb').src = document.getElementById('button_pan_over').src;
}
function go_home(id) {
sockets[id].send("<home args=''>");
}
var zoom_canvas_id = 0;
var pan_canvas_id = 0;
function onDragOver(e) {
if (e.preventDefault) e.preventDefault();
this.className = 'over';
e.dataTransfer.dropEffect = 'copy';
return false;
}
function onDrop(e, id)
{
if (e.preventDefault) { e.preventDefault(); }
// stop Firefox triggering a page change event
top_e = e;
var dt= e.dataTransfer;
console.log(dt);
var el_id = e.dataTransfer.getData('Text');
stop_plotting(id);
start_plotting(id, thumbnails.thumbnail_ports[el_id]);
return false;
}
function conv_coords(id, pixelCoord, xdir) {
var atop = 0;
var aleft = 0;
if (document.getElementById("anchor_div") != null) {
an = document.getElementById("anchor_div");
atop = an.offsetTop;
aleft = an.offsetLeft;
}
var plc = document.getElementById("plot_canvas_" + id);
if (xdir) {
return pixelCoord - (plc.offsetLeft + aleft);
} else {
return canvii[id].height - (pixelCoord - (plc.offsetTop + atop));
}
} // convert from canvas pixels to mpl pixels
function calc_coords(id, axes) {
var mplStartX = conv_coords(id, startX, true);
var mplStartY = conv_coords(id, startY, false);
var mplStopX = conv_coords(id, stopX, true);
var mplStopY = conv_coords(id, stopY, false);
return axes + "," + mplStartX + "," + mplStopY + "," + mplStopX + "," + mplStartY;
} // calculate the coordinates of the bounding box given by the canvas and the axes
function do_pan(id, axes) {
sockets[id].send("<pan args='" + calc_coords(id,axes) + "'>");
}
function zoom_in(id, axes) {
sockets[id].send("<zoom args='" + calc_coords(id,axes) + "'>");
startX=stopX=startY=stopY=0;
zdiv[id].style.width="0px";
zdiv[id].style.height="0px";
zdiv[id].style.display = "none";
}
function releaseCanvas(e,id) {
if (!e) var e = window.event;
top_e = e;
stopX = e.pageX;
stopY = e.pageY;
if (zdraw > -1 && ((stopX-startX)>5) && ((stopY-startY)>5)) { zoom_in(zoom_canvas_id, zdraw);}
else if (zdraw == -1 && (Math.abs(stopX-startX)>5) || (Math.abs(stopY-startY)>5)) {
do_pan(pan_canvas_id, pdraw);
}
else {
// not in zdraw (or zoomed areas less than 5x5) so normal click
handle_click(e,id);
zdiv[id].style.display = "none";
}
zdraw = -1;
pdraw = -1;
pause = false;
return false;
}
function slideCanvas(e,id,axes) {
if (!e) var e = window.event;
if (zdraw > -1) {
zdiv[id].style.width = e.pageX - startX + "px";
zdiv[id].style.height = e.pageY - startY + "px";
}
if (cursor_info[id] == 0) {
var dataX = Number.NaN;
var dataY = Number.NaN;
for (var i=0; i < ax_bb.length; i++) {
ax_width = ax_bb[i][4] - ax_bb[i][0];
ax_height = ax_bb[i][3] - ax_bb[i][1];
if ((ax_width == 0.0) || (ax_height == 0.0)) {
continue;
}
var pixX = conv_coords(id, e.pageX, true);
var pixY = conv_coords(id, e.pageY, false);
var relX = (pixX - ax_bb[i][0] - canvii[id].offsetLeft) / ax_width;
var relY = (pixY - ax_bb[i][1] - canvii[id].offsetTop) / ax_height;
// Remember that HTML y increases from top to bottom while data ylim goes other way
if ((relX >= 0.0) && (relX <= 1.0) && (relY >= 0.0) && (relY <= 1.0)) {
// Check if cursor is above current axes (this should be true anyway due to div!)
data_width = ax_datalim[i][1] - ax_datalim[i][0];
data_height = ax_datalim[i][3] - ax_datalim[i][2];
dataX = relX * data_width + ax_datalim[i][0];
dataY = relY * data_height + ax_datalim[i][2];
break;
} else {
dataX = Number.NaN;
dataY = Number.NaN;
}
}
var cursor_str = "";
if (!isNaN(dataX) && !isNaN(dataY)) {
cursor_str = "Cursor: " + dataX.toString().substr(0, 6) + ", " + dataY.toString().substr(0, 6);
}
document.getElementById('cursor_info_' + id).innerText = cursor_str;
}
return false;
}
document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = slideSize;
</script>
</body>
</html>
"""
| 60.412766 | 1,601 | 0.737034 | 4,193 | 42,591 | 7.389936 | 0.2373 | 0.0426 | 0.015104 | 0.017556 | 0.183728 | 0.131672 | 0.098432 | 0.073001 | 0.057348 | 0.040922 | 0 | 0.071619 | 0.145665 | 42,591 | 704 | 1,602 | 60.49858 | 0.779949 | 0.039022 | 0 | 0.221003 | 0 | 0.112853 | 0.997019 | 0.511339 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0.015674 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d4a590477a7cfa0caa94a33e9bda7b00657da679 | 17 | py | Python | opt3001/__init__.py | perryrh0dan/opt3001 | 518c8ddf818a7549f78992c5b652bc73633b85bf | [
"MIT"
] | 3 | 2020-05-09T12:14:45.000Z | 2022-02-27T07:29:23.000Z | opt3001/__init__.py | perryrh0dan/opt3001 | 518c8ddf818a7549f78992c5b652bc73633b85bf | [
"MIT"
] | null | null | null | opt3001/__init__.py | perryrh0dan/opt3001 | 518c8ddf818a7549f78992c5b652bc73633b85bf | [
"MIT"
] | null | null | null | name = "opt3001"
| 8.5 | 16 | 0.647059 | 2 | 17 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 0.176471 | 17 | 1 | 17 | 17 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0.411765 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.