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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6cb9e6c071a5a464e99a9be0e1427a6bdae314a5 | 141 | py | Python | anubis-py/test.py | tcramer217/Anubis | 14ab534ac149fb0da7f07832a8b22c9feafe2ce9 | [
"Apache-2.0"
] | 1 | 2022-02-02T20:19:38.000Z | 2022-02-02T20:19:38.000Z | anubis-py/test.py | tcramer217/Anubis | 14ab534ac149fb0da7f07832a8b22c9feafe2ce9 | [
"Apache-2.0"
] | null | null | null | anubis-py/test.py | tcramer217/Anubis | 14ab534ac149fb0da7f07832a8b22c9feafe2ce9 | [
"Apache-2.0"
] | null | null | null | import time
print("PIR Module And LED Test (CMD+C to exit)")
print("Ready...")
print("The time is:")
print(time.localtime())
print("Done!")
| 17.625 | 48 | 0.673759 | 23 | 141 | 4.130435 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.120567 | 141 | 7 | 49 | 20.142857 | 0.766129 | 0 | 0 | 0 | 0 | 0 | 0.453901 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0.833333 | 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 |
6ccbbb94804a3030d5bea897b60de3463026ec4b | 635 | py | Python | test_circles.py | mnansary/python-tutorials | c057459ffe691b6f8471fb40fee3ae1647867e10 | [
"MIT"
] | null | null | null | test_circles.py | mnansary/python-tutorials | c057459ffe691b6f8471fb40fee3ae1647867e10 | [
"MIT"
] | null | null | null | test_circles.py | mnansary/python-tutorials | c057459ffe691b6f8471fb40fee3ae1647867e10 | [
"MIT"
] | null | null | null | import unittest
from circles import circle_area
from math import pi
class TestCircleArea(unittest.TestCase):
def area_test(self):
self.assertAlmostEqual(circle_area(0),0)
self.assertAlmostEqual(circle_area(1),0)
self.assertAlmostEqual(circle_area(1.5),pi*1.5**2)
'''
class TestCir(unittest.TestCase):
def test_value(self):
self.assertRaises(ValueError,cir_area,-2)
def test_type(self):
self.assertRaises(TypeError,cir_area,2+9j)
self.assertRaises(TypeError,cir_area,'random')
self.assertRaises(TypeError,cir_area,True)
''' | 24.423077 | 58 | 0.667717 | 78 | 635 | 5.294872 | 0.371795 | 0.096852 | 0.196126 | 0.225182 | 0.392252 | 0.159806 | 0 | 0 | 0 | 0 | 0 | 0.024292 | 0.222047 | 635 | 26 | 59 | 24.423077 | 0.811741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.625 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
6cdc850ecee2c1661b0be1c7aa244894912e0929 | 63 | py | Python | pynncml/power_law/__init__.py | haihabi/PyNNcml | 808892da798913928fbc219cbb5f9e41156d9d49 | [
"MIT"
] | 4 | 2020-06-28T22:52:19.000Z | 2021-10-31T10:19:51.000Z | pynncml/power_law/__init__.py | haihabi/PyNNcml | 808892da798913928fbc219cbb5f9e41156d9d49 | [
"MIT"
] | null | null | null | pynncml/power_law/__init__.py | haihabi/PyNNcml | 808892da798913928fbc219cbb5f9e41156d9d49 | [
"MIT"
] | 4 | 2020-06-28T22:52:24.000Z | 2021-11-04T00:28:42.000Z | from pynncml.power_law.pl_module import PowerLaw, PowerLawType
| 31.5 | 62 | 0.873016 | 9 | 63 | 5.888889 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.079365 | 63 | 1 | 63 | 63 | 0.913793 | 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 |
9f0c6bb1373cdc76aa00177ce8fd773503be1df5 | 10,032 | py | Python | losantrest/auth.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 5 | 2016-06-16T20:18:11.000Z | 2022-03-09T11:41:59.000Z | losantrest/auth.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 4 | 2021-07-13T06:09:16.000Z | 2022-03-07T14:24:49.000Z | losantrest/auth.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 6 | 2016-11-18T03:19:17.000Z | 2022-03-09T11:41:47.000Z | """
The MIT License (MIT)
Copyright (c) 2021 Losant IoT, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import json
""" Module for Losant API Auth wrapper class """
# pylint: disable=C0301
class Auth(object):
""" Class containing all the actions for the Auth Resource """
def __init__(self, client):
self.client = client
def authenticate_device(self, **kwargs):
"""
Authenticates a device using the provided credentials.
Authentication:
No api access token is required to call this action.
Parameters:
* {hash} credentials - Device authentication credentials (https://api.losant.com/#/definitions/deviceCredentials)
* {string} losantdomain - Domain scope of request (rarely needed)
* {boolean} _actions - Return resource actions in response
* {boolean} _links - Return resource link in response
* {boolean} _embedded - Return embedded resources in response
Responses:
* 200 - Successful authentication. The included api access token by default has the scope 'all.Device'. (https://api.losant.com/#/definitions/authedDevice)
Errors:
* 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
* 401 - Unauthorized error if authentication fails (https://api.losant.com/#/definitions/error)
"""
query_params = {"_actions": "false", "_links": "true", "_embedded": "true"}
path_params = {}
headers = {}
body = None
if "credentials" in kwargs:
body = kwargs["credentials"]
if "losantdomain" in kwargs:
headers["losantdomain"] = kwargs["losantdomain"]
if "_actions" in kwargs:
query_params["_actions"] = kwargs["_actions"]
if "_links" in kwargs:
query_params["_links"] = kwargs["_links"]
if "_embedded" in kwargs:
query_params["_embedded"] = kwargs["_embedded"]
path = "/auth/device".format(**path_params)
return self.client.request("POST", path, params=query_params, headers=headers, body=body)
def authenticate_user(self, **kwargs):
"""
Authenticates a user using the provided credentials.
Authentication:
No api access token is required to call this action.
Parameters:
* {hash} credentials - User authentication credentials (https://api.losant.com/#/definitions/userCredentials)
* {string} losantdomain - Domain scope of request (rarely needed)
* {boolean} _actions - Return resource actions in response
* {boolean} _links - Return resource link in response
* {boolean} _embedded - Return embedded resources in response
Responses:
* 200 - Successful authentication. The included api access token has the scope 'all.User'. (https://api.losant.com/#/definitions/authedUser)
Errors:
* 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
* 401 - Unauthorized error if authentication fails (https://api.losant.com/#/definitions/error)
"""
query_params = {"_actions": "false", "_links": "true", "_embedded": "true"}
path_params = {}
headers = {}
body = None
if "credentials" in kwargs:
body = kwargs["credentials"]
if "losantdomain" in kwargs:
headers["losantdomain"] = kwargs["losantdomain"]
if "_actions" in kwargs:
query_params["_actions"] = kwargs["_actions"]
if "_links" in kwargs:
query_params["_links"] = kwargs["_links"]
if "_embedded" in kwargs:
query_params["_embedded"] = kwargs["_embedded"]
path = "/auth/user".format(**path_params)
return self.client.request("POST", path, params=query_params, headers=headers, body=body)
def authenticate_user_github(self, **kwargs):
"""
Authenticates a user via GitHub OAuth.
Authentication:
No api access token is required to call this action.
Parameters:
* {hash} oauth - User authentication credentials (access token) (https://api.losant.com/#/definitions/githubLogin)
* {string} losantdomain - Domain scope of request (rarely needed)
* {boolean} _actions - Return resource actions in response
* {boolean} _links - Return resource link in response
* {boolean} _embedded - Return embedded resources in response
Responses:
* 200 - Successful authentication. The included api access token has the scope 'all.User'. (https://api.losant.com/#/definitions/authedUser)
Errors:
* 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
* 401 - Unauthorized error if authentication fails (https://api.losant.com/#/definitions/error)
"""
query_params = {"_actions": "false", "_links": "true", "_embedded": "true"}
path_params = {}
headers = {}
body = None
if "oauth" in kwargs:
body = kwargs["oauth"]
if "losantdomain" in kwargs:
headers["losantdomain"] = kwargs["losantdomain"]
if "_actions" in kwargs:
query_params["_actions"] = kwargs["_actions"]
if "_links" in kwargs:
query_params["_links"] = kwargs["_links"]
if "_embedded" in kwargs:
query_params["_embedded"] = kwargs["_embedded"]
path = "/auth/user/github".format(**path_params)
return self.client.request("POST", path, params=query_params, headers=headers, body=body)
def authenticate_user_saml(self, **kwargs):
"""
Authenticates a user via a SAML response.
Authentication:
No api access token is required to call this action.
Parameters:
* {hash} saml - Encoded SAML response from an IDP for a user. (https://api.losant.com/#/definitions/samlResponse)
* {string} losantdomain - Domain scope of request (rarely needed)
* {boolean} _actions - Return resource actions in response
* {boolean} _links - Return resource link in response
* {boolean} _embedded - Return embedded resources in response
Responses:
* 200 - Successful authentication. The included api access token has the scope 'all.User'. (https://api.losant.com/#/definitions/authedUser)
Errors:
* 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
* 401 - Unauthorized error if authentication fails (https://api.losant.com/#/definitions/error)
"""
query_params = {"_actions": "false", "_links": "true", "_embedded": "true"}
path_params = {}
headers = {}
body = None
if "saml" in kwargs:
body = kwargs["saml"]
if "losantdomain" in kwargs:
headers["losantdomain"] = kwargs["losantdomain"]
if "_actions" in kwargs:
query_params["_actions"] = kwargs["_actions"]
if "_links" in kwargs:
query_params["_links"] = kwargs["_links"]
if "_embedded" in kwargs:
query_params["_embedded"] = kwargs["_embedded"]
path = "/auth/user/saml".format(**path_params)
return self.client.request("POST", path, params=query_params, headers=headers, body=body)
def sso_domain(self, **kwargs):
"""
Checks email domain for SSO configuration.
Authentication:
No api access token is required to call this action.
Parameters:
* {string} email - The email address associated with the user login
* {string} losantdomain - Domain scope of request (rarely needed)
* {boolean} _actions - Return resource actions in response
* {boolean} _links - Return resource link in response
* {boolean} _embedded - Return embedded resources in response
Responses:
* 200 - Successful finding SSO for domain. Returns SSO request URL and type. (https://api.losant.com/#/definitions/ssoRequest)
* 204 - No domain associated with an SSO configuration
Errors:
* 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
"""
query_params = {"_actions": "false", "_links": "true", "_embedded": "true"}
path_params = {}
headers = {}
body = None
if "email" in kwargs:
query_params["email"] = kwargs["email"]
if "losantdomain" in kwargs:
headers["losantdomain"] = kwargs["losantdomain"]
if "_actions" in kwargs:
query_params["_actions"] = kwargs["_actions"]
if "_links" in kwargs:
query_params["_links"] = kwargs["_links"]
if "_embedded" in kwargs:
query_params["_embedded"] = kwargs["_embedded"]
path = "/auth/ssoDomain".format(**path_params)
return self.client.request("GET", path, params=query_params, headers=headers, body=body)
| 40.615385 | 164 | 0.640251 | 1,122 | 10,032 | 5.615865 | 0.175579 | 0.04539 | 0.039994 | 0.048564 | 0.742263 | 0.724488 | 0.70957 | 0.686558 | 0.679733 | 0.679733 | 0 | 0.007085 | 0.254286 | 10,032 | 246 | 165 | 40.780488 | 0.835182 | 0.520734 | 0 | 0.764045 | 0 | 0 | 0.211679 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.067416 | false | 0 | 0.011236 | 0 | 0.146067 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
9f0f9627fbc1c2affc5e8e3c8806d6af01c94033 | 775 | py | Python | tests/cs/test_uploads.py | allenmichael/pyTenable | 8372cfdf3ced99de50227f6fbb37d6db2b26291e | [
"MIT"
] | null | null | null | tests/cs/test_uploads.py | allenmichael/pyTenable | 8372cfdf3ced99de50227f6fbb37d6db2b26291e | [
"MIT"
] | null | null | null | tests/cs/test_uploads.py | allenmichael/pyTenable | 8372cfdf3ced99de50227f6fbb37d6db2b26291e | [
"MIT"
] | null | null | null | from tenable.errors import *
from ..checker import check, single
import pytest
def test_uploads_docker_push_name_typeerror(api):
with pytest.raises(TypeError):
api.uploads.docker_push(1)
def test_uploads_docker_push_tag_typeerror(api):
with pytest.raises(TypeError):
api.uploads.docker_push('example', tag=1)
def test_uploads_docker_push_cs_name_typeerror(api):
with pytest.raises(TypeError):
api.uploads.docker_push('example', tag='latest', cs_name=1)
def test_uploads_docker_push_cs_tag_typeerror(api):
with pytest.raises(TypeError):
api.uploads.docker_push('example', tag='latest', cs_tag=1)
@pytest.mark.skip(reason="Can't VCR because of docker.")
def test_uploads_docker_push(api, image_id):
single(image_id, str) | 33.695652 | 67 | 0.757419 | 115 | 775 | 4.817391 | 0.295652 | 0.211191 | 0.276173 | 0.180505 | 0.749097 | 0.662455 | 0.617329 | 0.519856 | 0.519856 | 0.519856 | 0 | 0.005944 | 0.131613 | 775 | 23 | 68 | 33.695652 | 0.817236 | 0 | 0 | 0.222222 | 0 | 0 | 0.078608 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.166667 | 0 | 0.444444 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
9f1924240f390f71e0b60ed1d848f8ac639ea14b | 204 | py | Python | algorithms/hashtable/dictionary_hash.py | rwietter/codebase | 7466a958c27720aff84c14b39a2f9e6031ddd49c | [
"MIT"
] | null | null | null | algorithms/hashtable/dictionary_hash.py | rwietter/codebase | 7466a958c27720aff84c14b39a2f9e6031ddd49c | [
"MIT"
] | null | null | null | algorithms/hashtable/dictionary_hash.py | rwietter/codebase | 7466a958c27720aff84c14b39a2f9e6031ddd49c | [
"MIT"
] | null | null | null | voted = {}
def check_voter(name):
if voted.get(name):
print "kick them out"
else:
voted[name] = True
print "let them vote!"
check_voter('Tom')
print voted
check_voter('Tom')
| 15.692308 | 27 | 0.607843 | 29 | 204 | 4.172414 | 0.551724 | 0.247934 | 0.214876 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.259804 | 204 | 12 | 28 | 17 | 0.801325 | 0 | 0 | 0.2 | 0 | 0 | 0.171875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.3 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
9f2642def530d5dec73ed08fe191422219647df2 | 101,367 | py | Python | nova/api/openstack/compute/legacy_v2/servers.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/legacy_v2/servers.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/legacy_v2/servers.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | 2 | 2017-07-20T17:31:34.000Z | 2020-07-24T02:42:19.000Z | begin_unit
comment|'# Copyright 2010 OpenStack Foundation'
nl|'\n'
comment|'# Copyright 2011 Piston Cloud Computing, Inc'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'# License for the specific language governing permissions and limitations'
nl|'\n'
comment|'# under the License.'
nl|'\n'
nl|'\n'
name|'import'
name|'base64'
newline|'\n'
name|'import'
name|'re'
newline|'\n'
name|'import'
name|'sys'
newline|'\n'
nl|'\n'
name|'from'
name|'oslo_log'
name|'import'
name|'log'
name|'as'
name|'logging'
newline|'\n'
name|'import'
name|'oslo_messaging'
name|'as'
name|'messaging'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'netutils'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'strutils'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'timeutils'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'uuidutils'
newline|'\n'
name|'import'
name|'six'
newline|'\n'
name|'import'
name|'webob'
newline|'\n'
name|'from'
name|'webob'
name|'import'
name|'exc'
newline|'\n'
nl|'\n'
name|'from'
name|'nova'
op|'.'
name|'api'
op|'.'
name|'openstack'
name|'import'
name|'common'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'api'
op|'.'
name|'openstack'
op|'.'
name|'compute'
op|'.'
name|'views'
name|'import'
name|'servers'
name|'as'
name|'views_servers'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'api'
op|'.'
name|'openstack'
name|'import'
name|'wsgi'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'block_device'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'compute'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'compute'
name|'import'
name|'flavors'
newline|'\n'
name|'import'
name|'nova'
op|'.'
name|'conf'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'exception'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'i18n'
name|'import'
name|'_'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'objects'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'policy'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'utils'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|variable|CONF
name|'CONF'
op|'='
name|'nova'
op|'.'
name|'conf'
op|'.'
name|'CONF'
newline|'\n'
nl|'\n'
DECL|variable|LOG
name|'LOG'
op|'='
name|'logging'
op|'.'
name|'getLogger'
op|'('
name|'__name__'
op|')'
newline|'\n'
nl|'\n'
DECL|variable|CREATE_EXCEPTIONS
name|'CREATE_EXCEPTIONS'
op|'='
op|'{'
nl|'\n'
name|'exception'
op|'.'
name|'InvalidMetadataSize'
op|':'
name|'exc'
op|'.'
name|'HTTPRequestEntityTooLarge'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNotFound'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'FlavorNotFound'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'KeypairNotFound'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ConfigDriveInvalidValue'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNotActive'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'FlavorDiskTooSmall'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'FlavorMemoryTooSmall'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'NetworkNotFound'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'PortNotFound'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'FixedIpAlreadyInUse'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'SecurityGroupNotFound'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'InstanceUserDataTooLarge'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'InstanceUserDataMalformed'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNUMATopologyIncomplete'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNUMATopologyForbidden'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNUMATopologyAsymmetric'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNUMATopologyCPUOutOfRange'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNUMATopologyCPUDuplicates'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNUMATopologyCPUsUnassigned'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ImageNUMATopologyMemoryOutOfRange'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'PortInUse'
op|':'
name|'exc'
op|'.'
name|'HTTPConflict'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'InstanceExists'
op|':'
name|'exc'
op|'.'
name|'HTTPConflict'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'NoUniqueMatch'
op|':'
name|'exc'
op|'.'
name|'HTTPConflict'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'Invalid'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'InstanceGroupNotFound'
op|':'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|','
nl|'\n'
op|'}'
newline|'\n'
nl|'\n'
DECL|variable|CREATE_EXCEPTIONS_MSGS
name|'CREATE_EXCEPTIONS_MSGS'
op|'='
op|'{'
nl|'\n'
name|'exception'
op|'.'
name|'ImageNotFound'
op|':'
name|'_'
op|'('
string|'"Can not find requested image"'
op|')'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'FlavorNotFound'
op|':'
name|'_'
op|'('
string|'"Invalid flavorRef provided."'
op|')'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'KeypairNotFound'
op|':'
name|'_'
op|'('
string|'"Invalid key_name provided."'
op|')'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'ConfigDriveInvalidValue'
op|':'
name|'_'
op|'('
string|'"Invalid config_drive provided."'
op|')'
op|','
nl|'\n'
op|'}'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|Controller
name|'class'
name|'Controller'
op|'('
name|'wsgi'
op|'.'
name|'Controller'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""The Server API base controller class for the OpenStack API."""'
newline|'\n'
nl|'\n'
DECL|variable|_view_builder_class
name|'_view_builder_class'
op|'='
name|'views_servers'
op|'.'
name|'ViewBuilder'
newline|'\n'
nl|'\n'
op|'@'
name|'staticmethod'
newline|'\n'
DECL|member|_add_location
name|'def'
name|'_add_location'
op|'('
name|'robj'
op|')'
op|':'
newline|'\n'
comment|'# Just in case...'
nl|'\n'
indent|' '
name|'if'
string|"'server'"
name|'not'
name|'in'
name|'robj'
op|'.'
name|'obj'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'robj'
newline|'\n'
nl|'\n'
dedent|''
name|'link'
op|'='
op|'['
name|'l'
name|'for'
name|'l'
name|'in'
name|'robj'
op|'.'
name|'obj'
op|'['
string|"'server'"
op|']'
op|'['
string|"'links'"
op|']'
name|'if'
name|'l'
op|'['
string|"'rel'"
op|']'
op|'=='
string|"'self'"
op|']'
newline|'\n'
name|'if'
name|'link'
op|':'
newline|'\n'
indent|' '
name|'robj'
op|'['
string|"'Location'"
op|']'
op|'='
name|'utils'
op|'.'
name|'utf8'
op|'('
name|'link'
op|'['
number|'0'
op|']'
op|'['
string|"'href'"
op|']'
op|')'
newline|'\n'
nl|'\n'
comment|'# Convenience return'
nl|'\n'
dedent|''
name|'return'
name|'robj'
newline|'\n'
nl|'\n'
DECL|member|__init__
dedent|''
name|'def'
name|'__init__'
op|'('
name|'self'
op|','
name|'ext_mgr'
op|'='
name|'None'
op|','
op|'**'
name|'kwargs'
op|')'
op|':'
newline|'\n'
indent|' '
name|'super'
op|'('
name|'Controller'
op|','
name|'self'
op|')'
op|'.'
name|'__init__'
op|'('
op|'**'
name|'kwargs'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'compute_api'
op|'='
name|'compute'
op|'.'
name|'API'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'ext_mgr'
op|'='
name|'ext_mgr'
newline|'\n'
nl|'\n'
DECL|member|index
dedent|''
name|'def'
name|'index'
op|'('
name|'self'
op|','
name|'req'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Returns a list of server names and ids for a given user."""'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'servers'
op|'='
name|'self'
op|'.'
name|'_get_servers'
op|'('
name|'req'
op|','
name|'is_detail'
op|'='
name|'False'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'Invalid'
name|'as'
name|'err'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'err'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'servers'
newline|'\n'
nl|'\n'
DECL|member|detail
dedent|''
name|'def'
name|'detail'
op|'('
name|'self'
op|','
name|'req'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Returns a list of server details for a given user."""'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'servers'
op|'='
name|'self'
op|'.'
name|'_get_servers'
op|'('
name|'req'
op|','
name|'is_detail'
op|'='
name|'True'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'Invalid'
name|'as'
name|'err'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'err'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'servers'
newline|'\n'
nl|'\n'
DECL|member|_get_servers
dedent|''
name|'def'
name|'_get_servers'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'is_detail'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Returns a list of servers, based on any search options specified."""'
newline|'\n'
nl|'\n'
name|'search_opts'
op|'='
op|'{'
op|'}'
newline|'\n'
name|'search_opts'
op|'.'
name|'update'
op|'('
name|'req'
op|'.'
name|'GET'
op|')'
newline|'\n'
nl|'\n'
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'remove_invalid_options'
op|'('
name|'context'
op|','
name|'search_opts'
op|','
nl|'\n'
name|'self'
op|'.'
name|'_get_server_search_options'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
comment|"# Verify search by 'status' contains a valid status."
nl|'\n'
comment|'# Convert it to filter by vm_state or task_state for compute_api.'
nl|'\n'
name|'search_opts'
op|'.'
name|'pop'
op|'('
string|"'status'"
op|','
name|'None'
op|')'
newline|'\n'
name|'if'
string|"'status'"
name|'in'
name|'req'
op|'.'
name|'GET'
op|'.'
name|'keys'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'statuses'
op|'='
name|'req'
op|'.'
name|'GET'
op|'.'
name|'getall'
op|'('
string|"'status'"
op|')'
newline|'\n'
name|'states'
op|'='
name|'common'
op|'.'
name|'task_and_vm_state_from_status'
op|'('
name|'statuses'
op|')'
newline|'\n'
name|'vm_state'
op|','
name|'task_state'
op|'='
name|'states'
newline|'\n'
name|'if'
name|'not'
name|'vm_state'
name|'and'
name|'not'
name|'task_state'
op|':'
newline|'\n'
indent|' '
name|'return'
op|'{'
string|"'servers'"
op|':'
op|'['
op|']'
op|'}'
newline|'\n'
dedent|''
name|'search_opts'
op|'['
string|"'vm_state'"
op|']'
op|'='
name|'vm_state'
newline|'\n'
comment|"# When we search by vm state, task state will return 'default'."
nl|'\n'
comment|"# So we don't need task_state search_opt."
nl|'\n'
name|'if'
string|"'default'"
name|'not'
name|'in'
name|'task_state'
op|':'
newline|'\n'
indent|' '
name|'search_opts'
op|'['
string|"'task_state'"
op|']'
op|'='
name|'task_state'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'if'
string|"'changes-since'"
name|'in'
name|'search_opts'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'parsed'
op|'='
name|'timeutils'
op|'.'
name|'parse_isotime'
op|'('
name|'search_opts'
op|'['
string|"'changes-since'"
op|']'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'ValueError'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|"'Invalid changes-since value'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'search_opts'
op|'['
string|"'changes-since'"
op|']'
op|'='
name|'parsed'
newline|'\n'
nl|'\n'
comment|"# By default, compute's get_all() will return deleted instances."
nl|'\n'
comment|"# If an admin hasn't specified a 'deleted' search option, we need"
nl|'\n'
comment|'# to filter out deleted instances by setting the filter ourselves.'
nl|'\n'
comment|"# ... Unless 'changes-since' is specified, because 'changes-since'"
nl|'\n'
comment|'# should return recently deleted images according to the API spec.'
nl|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'deleted'"
name|'not'
name|'in'
name|'search_opts'
op|':'
newline|'\n'
indent|' '
name|'if'
string|"'changes-since'"
name|'not'
name|'in'
name|'search_opts'
op|':'
newline|'\n'
comment|"# No 'changes-since', so we only want non-deleted servers"
nl|'\n'
indent|' '
name|'search_opts'
op|'['
string|"'deleted'"
op|']'
op|'='
name|'False'
newline|'\n'
dedent|''
dedent|''
name|'else'
op|':'
newline|'\n'
comment|'# Convert deleted filter value to a valid boolean.'
nl|'\n'
comment|'# Return non-deleted servers if an invalid value'
nl|'\n'
comment|'# is passed with deleted filter.'
nl|'\n'
indent|' '
name|'search_opts'
op|'['
string|"'deleted'"
op|']'
op|'='
name|'strutils'
op|'.'
name|'bool_from_string'
op|'('
nl|'\n'
name|'search_opts'
op|'['
string|"'deleted'"
op|']'
op|','
name|'default'
op|'='
name|'False'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'search_opts'
op|'.'
name|'get'
op|'('
string|'"vm_state"'
op|')'
op|'=='
op|'['
string|"'deleted'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'context'
op|'.'
name|'is_admin'
op|':'
newline|'\n'
indent|' '
name|'search_opts'
op|'['
string|"'deleted'"
op|']'
op|'='
name|'True'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Only administrators may list deleted instances"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPForbidden'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'all_tenants'
op|'='
name|'common'
op|'.'
name|'is_all_tenants'
op|'('
name|'search_opts'
op|')'
newline|'\n'
comment|'# use the boolean from here on out so remove the entry from search_opts'
nl|'\n'
comment|"# if it's present"
nl|'\n'
name|'search_opts'
op|'.'
name|'pop'
op|'('
string|"'all_tenants'"
op|','
name|'None'
op|')'
newline|'\n'
nl|'\n'
name|'elevated'
op|'='
name|'None'
newline|'\n'
name|'if'
name|'all_tenants'
op|':'
newline|'\n'
indent|' '
name|'policy'
op|'.'
name|'enforce'
op|'('
name|'context'
op|','
string|"'compute:get_all_tenants'"
op|','
nl|'\n'
op|'{'
string|"'project_id'"
op|':'
name|'context'
op|'.'
name|'project_id'
op|','
nl|'\n'
string|"'user_id'"
op|':'
name|'context'
op|'.'
name|'user_id'
op|'}'
op|')'
newline|'\n'
name|'elevated'
op|'='
name|'context'
op|'.'
name|'elevated'
op|'('
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'context'
op|'.'
name|'project_id'
op|':'
newline|'\n'
indent|' '
name|'search_opts'
op|'['
string|"'project_id'"
op|']'
op|'='
name|'context'
op|'.'
name|'project_id'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'search_opts'
op|'['
string|"'user_id'"
op|']'
op|'='
name|'context'
op|'.'
name|'user_id'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'limit'
op|','
name|'marker'
op|'='
name|'common'
op|'.'
name|'get_limit_and_marker'
op|'('
name|'req'
op|')'
newline|'\n'
comment|'# Sorting by multiple keys and directions is conditionally enabled'
nl|'\n'
name|'sort_keys'
op|','
name|'sort_dirs'
op|'='
name|'None'
op|','
name|'None'
newline|'\n'
name|'if'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-server-sort-keys'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'sort_keys'
op|','
name|'sort_dirs'
op|'='
name|'common'
op|'.'
name|'get_sort_params'
op|'('
name|'req'
op|'.'
name|'params'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'expected_attrs'
op|'='
name|'None'
newline|'\n'
name|'if'
name|'is_detail'
op|':'
newline|'\n'
comment|'# merge our expected attrs with what the view builder needs for'
nl|'\n'
comment|'# showing details'
nl|'\n'
indent|' '
name|'expected_attrs'
op|'='
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'get_show_expected_attrs'
op|'('
nl|'\n'
name|'expected_attrs'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'try'
op|':'
newline|'\n'
indent|' '
name|'instance_list'
op|'='
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'get_all'
op|'('
name|'elevated'
name|'or'
name|'context'
op|','
nl|'\n'
name|'search_opts'
op|'='
name|'search_opts'
op|','
name|'limit'
op|'='
name|'limit'
op|','
name|'marker'
op|'='
name|'marker'
op|','
nl|'\n'
name|'want_objects'
op|'='
name|'True'
op|','
name|'expected_attrs'
op|'='
name|'expected_attrs'
op|','
nl|'\n'
name|'sort_keys'
op|'='
name|'sort_keys'
op|','
name|'sort_dirs'
op|'='
name|'sort_dirs'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'MarkerNotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|"'marker [%s] not found'"
op|')'
op|'%'
name|'marker'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'FlavorNotFound'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Flavor \'%s\' could not be found"'
op|','
name|'search_opts'
op|'['
string|"'flavor'"
op|']'
op|')'
newline|'\n'
name|'instance_list'
op|'='
name|'objects'
op|'.'
name|'InstanceList'
op|'('
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'is_detail'
op|':'
newline|'\n'
indent|' '
name|'instance_list'
op|'.'
name|'_context'
op|'='
name|'context'
newline|'\n'
name|'instance_list'
op|'.'
name|'fill_faults'
op|'('
op|')'
newline|'\n'
name|'response'
op|'='
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'detail'
op|'('
name|'req'
op|','
name|'instance_list'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'response'
op|'='
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'index'
op|'('
name|'req'
op|','
name|'instance_list'
op|')'
newline|'\n'
dedent|''
name|'req'
op|'.'
name|'cache_db_instances'
op|'('
name|'instance_list'
op|')'
newline|'\n'
name|'return'
name|'response'
newline|'\n'
nl|'\n'
DECL|member|_get_server
dedent|''
name|'def'
name|'_get_server'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'req'
op|','
name|'instance_uuid'
op|','
name|'is_detail'
op|'='
name|'False'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Utility function for looking up an instance by uuid.\n\n :param context: request context for auth\n :param req: HTTP request. The instance is cached in this request.\n :param instance_uuid: UUID of the server instance to get\n :param is_detail: True if you plan on showing the details of the\n instance in the response, False otherwise.\n """'
newline|'\n'
name|'expected_attrs'
op|'='
op|'['
string|"'flavor'"
op|']'
newline|'\n'
name|'if'
name|'is_detail'
op|':'
newline|'\n'
indent|' '
name|'expected_attrs'
op|'='
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'get_show_expected_attrs'
op|'('
nl|'\n'
name|'expected_attrs'
op|')'
newline|'\n'
dedent|''
name|'instance'
op|'='
name|'common'
op|'.'
name|'get_instance'
op|'('
name|'self'
op|'.'
name|'compute_api'
op|','
name|'context'
op|','
nl|'\n'
name|'instance_uuid'
op|','
nl|'\n'
name|'expected_attrs'
op|'='
name|'expected_attrs'
op|')'
newline|'\n'
name|'req'
op|'.'
name|'cache_db_instance'
op|'('
name|'instance'
op|')'
newline|'\n'
name|'return'
name|'instance'
newline|'\n'
nl|'\n'
DECL|member|_check_string_length
dedent|''
name|'def'
name|'_check_string_length'
op|'('
name|'self'
op|','
name|'value'
op|','
name|'name'
op|','
name|'max_length'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'isinstance'
op|'('
name|'value'
op|','
name|'six'
op|'.'
name|'string_types'
op|')'
op|':'
newline|'\n'
indent|' '
name|'value'
op|'='
name|'value'
op|'.'
name|'strip'
op|'('
op|')'
newline|'\n'
dedent|''
name|'utils'
op|'.'
name|'check_string_length'
op|'('
name|'value'
op|','
name|'name'
op|','
name|'min_length'
op|'='
number|'1'
op|','
nl|'\n'
name|'max_length'
op|'='
name|'max_length'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InvalidInput'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_validate_server_name
dedent|''
dedent|''
name|'def'
name|'_validate_server_name'
op|'('
name|'self'
op|','
name|'value'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_check_string_length'
op|'('
name|'value'
op|','
string|"'Server name'"
op|','
name|'max_length'
op|'='
number|'255'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_get_injected_files
dedent|''
name|'def'
name|'_get_injected_files'
op|'('
name|'self'
op|','
name|'personality'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Create a list of injected files from the personality attribute.\n\n At this time, injected_files must be formatted as a list of\n (file_path, file_content) pairs for compatibility with the\n underlying compute service.\n """'
newline|'\n'
name|'injected_files'
op|'='
op|'['
op|']'
newline|'\n'
nl|'\n'
name|'for'
name|'item'
name|'in'
name|'personality'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'path'
op|'='
name|'item'
op|'['
string|"'path'"
op|']'
newline|'\n'
name|'contents'
op|'='
name|'item'
op|'['
string|"'contents'"
op|']'
newline|'\n'
dedent|''
name|'except'
name|'KeyError'
name|'as'
name|'key'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'Bad personality format: missing %s'"
op|')'
op|'%'
name|'key'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'TypeError'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'Bad personality format'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
dedent|''
name|'if'
name|'self'
op|'.'
name|'_decode_base64'
op|'('
name|'contents'
op|')'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'Personality content for %s cannot be decoded'"
op|')'
op|'%'
name|'path'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
dedent|''
name|'injected_files'
op|'.'
name|'append'
op|'('
op|'('
name|'path'
op|','
name|'contents'
op|')'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'injected_files'
newline|'\n'
nl|'\n'
DECL|member|_get_requested_networks
dedent|''
name|'def'
name|'_get_requested_networks'
op|'('
name|'self'
op|','
name|'requested_networks'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Create a list of requested networks from the networks attribute."""'
newline|'\n'
name|'networks'
op|'='
op|'['
op|']'
newline|'\n'
name|'network_uuids'
op|'='
op|'['
op|']'
newline|'\n'
name|'for'
name|'network'
name|'in'
name|'requested_networks'
op|':'
newline|'\n'
indent|' '
name|'request'
op|'='
name|'objects'
op|'.'
name|'NetworkRequest'
op|'('
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'request'
op|'.'
name|'port_id'
op|'='
name|'network'
op|'.'
name|'get'
op|'('
string|"'port'"
op|','
name|'None'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'ValueError'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Bad port format: port uuid is "'
nl|'\n'
string|'"not in proper format "'
nl|'\n'
string|'"(%s)"'
op|')'
op|'%'
name|'network'
op|'.'
name|'get'
op|'('
string|"'port'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'if'
name|'request'
op|'.'
name|'port_id'
op|':'
newline|'\n'
indent|' '
name|'request'
op|'.'
name|'network_id'
op|'='
name|'None'
newline|'\n'
name|'if'
name|'not'
name|'utils'
op|'.'
name|'is_neutron'
op|'('
op|')'
op|':'
newline|'\n'
comment|'# port parameter is only for neutron v2.0'
nl|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Unknown argument : port"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'request'
op|'.'
name|'network_id'
op|'='
name|'network'
op|'['
string|"'uuid'"
op|']'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
op|'('
name|'not'
name|'request'
op|'.'
name|'port_id'
name|'and'
name|'not'
nl|'\n'
name|'uuidutils'
op|'.'
name|'is_uuid_like'
op|'('
name|'request'
op|'.'
name|'network_id'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'br_uuid'
op|'='
name|'request'
op|'.'
name|'network_id'
op|'.'
name|'split'
op|'('
string|"'-'"
op|','
number|'1'
op|')'
op|'['
op|'-'
number|'1'
op|']'
newline|'\n'
name|'if'
name|'not'
name|'uuidutils'
op|'.'
name|'is_uuid_like'
op|'('
name|'br_uuid'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Bad networks format: network uuid is "'
nl|'\n'
string|'"not in proper format "'
nl|'\n'
string|'"(%s)"'
op|')'
op|'%'
name|'request'
op|'.'
name|'network_id'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
comment|'# fixed IP address is optional'
nl|'\n'
comment|'# if the fixed IP address is not provided then'
nl|'\n'
comment|'# it will use one of the available IP address from the network'
nl|'\n'
dedent|''
dedent|''
name|'try'
op|':'
newline|'\n'
indent|' '
name|'request'
op|'.'
name|'address'
op|'='
name|'network'
op|'.'
name|'get'
op|'('
string|"'fixed_ip'"
op|','
name|'None'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'ValueError'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
op|'('
name|'_'
op|'('
string|'"Invalid fixed IP address (%s)"'
op|')'
op|'%'
nl|'\n'
name|'network'
op|'.'
name|'get'
op|'('
string|"'fixed_ip'"
op|')'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
comment|'# duplicate networks are allowed only for neutron v2.0'
nl|'\n'
dedent|''
name|'if'
op|'('
name|'not'
name|'utils'
op|'.'
name|'is_neutron'
op|'('
op|')'
name|'and'
name|'request'
op|'.'
name|'network_id'
name|'and'
nl|'\n'
name|'request'
op|'.'
name|'network_id'
name|'in'
name|'network_uuids'
op|')'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
op|'('
name|'_'
op|'('
string|'"Duplicate networks"'
nl|'\n'
string|'" (%s) are not allowed"'
op|')'
op|'%'
nl|'\n'
name|'request'
op|'.'
name|'network_id'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
dedent|''
name|'network_uuids'
op|'.'
name|'append'
op|'('
name|'request'
op|'.'
name|'network_id'
op|')'
newline|'\n'
name|'networks'
op|'.'
name|'append'
op|'('
name|'request'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'KeyError'
name|'as'
name|'key'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'Bad network format: missing %s'"
op|')'
op|'%'
name|'key'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'TypeError'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'Bad networks format'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'return'
name|'objects'
op|'.'
name|'NetworkRequestList'
op|'('
name|'objects'
op|'='
name|'networks'
op|')'
newline|'\n'
nl|'\n'
comment|'# NOTE(vish): Without this regex, b64decode will happily'
nl|'\n'
comment|'# ignore illegal bytes in the base64 encoded'
nl|'\n'
comment|'# data.'
nl|'\n'
DECL|variable|B64_REGEX
dedent|''
name|'B64_REGEX'
op|'='
name|'re'
op|'.'
name|'compile'
op|'('
string|"'^(?:[A-Za-z0-9+\\/]{4})*'"
nl|'\n'
string|"'(?:[A-Za-z0-9+\\/]{2}=='"
nl|'\n'
string|"'|[A-Za-z0-9+\\/]{3}=)?$'"
op|')'
newline|'\n'
nl|'\n'
DECL|member|_decode_base64
name|'def'
name|'_decode_base64'
op|'('
name|'self'
op|','
name|'data'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'isinstance'
op|'('
name|'data'
op|','
name|'six'
op|'.'
name|'binary_type'
op|')'
name|'and'
name|'hasattr'
op|'('
name|'data'
op|','
string|'"decode"'
op|')'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'data'
op|'='
name|'data'
op|'.'
name|'decode'
op|'('
string|'"utf-8"'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'UnicodeDecodeError'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'None'
newline|'\n'
dedent|''
dedent|''
name|'data'
op|'='
name|'re'
op|'.'
name|'sub'
op|'('
string|"r'\\s'"
op|','
string|"''"
op|','
name|'data'
op|')'
newline|'\n'
name|'if'
name|'not'
name|'self'
op|'.'
name|'B64_REGEX'
op|'.'
name|'match'
op|'('
name|'data'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'None'
newline|'\n'
dedent|''
name|'try'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'base64'
op|'.'
name|'b64decode'
op|'('
name|'data'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'TypeError'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'None'
newline|'\n'
nl|'\n'
DECL|member|_validate_access_ipv4
dedent|''
dedent|''
name|'def'
name|'_validate_access_ipv4'
op|'('
name|'self'
op|','
name|'address'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'netutils'
op|'.'
name|'is_valid_ipv4'
op|'('
name|'address'
op|')'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'accessIPv4 is not proper IPv4 format'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_validate_access_ipv6
dedent|''
dedent|''
name|'def'
name|'_validate_access_ipv6'
op|'('
name|'self'
op|','
name|'address'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'netutils'
op|'.'
name|'is_valid_ipv6'
op|'('
name|'address'
op|')'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'accessIPv6 is not proper IPv6 format'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
nl|'\n'
DECL|member|show
dedent|''
dedent|''
name|'def'
name|'show'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Returns server details by server id."""'
newline|'\n'
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'id'
op|','
name|'is_detail'
op|'='
name|'True'
op|')'
newline|'\n'
name|'return'
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'show'
op|'('
name|'req'
op|','
name|'instance'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_extract
dedent|''
name|'def'
name|'_extract'
op|'('
name|'self'
op|','
name|'server_dict'
op|','
name|'ext_name'
op|','
name|'key'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
name|'ext_name'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'server_dict'
op|'.'
name|'get'
op|'('
name|'key'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'None'
newline|'\n'
nl|'\n'
DECL|member|_validate_user_data
dedent|''
name|'def'
name|'_validate_user_data'
op|'('
name|'self'
op|','
name|'user_data'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'user_data'
name|'and'
name|'self'
op|'.'
name|'_decode_base64'
op|'('
name|'user_data'
op|')'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'Userdata content cannot be decoded'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'user_data'
newline|'\n'
nl|'\n'
DECL|member|_extract_bdm
dedent|''
name|'def'
name|'_extract_bdm'
op|'('
name|'self'
op|','
name|'server_dict'
op|','
name|'image_uuid_specified'
op|')'
op|':'
newline|'\n'
indent|' '
name|'legacy_bdm'
op|'='
name|'True'
newline|'\n'
name|'block_device_mapping_v2'
op|'='
name|'None'
newline|'\n'
name|'if'
name|'not'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-volumes'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'legacy_bdm'
op|','
name|'None'
newline|'\n'
dedent|''
name|'block_device_mapping'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'block_device_mapping'"
op|','
op|'['
op|']'
op|')'
newline|'\n'
name|'if'
name|'not'
name|'isinstance'
op|'('
name|'block_device_mapping'
op|','
name|'list'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|"'block_device_mapping must be a list'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'for'
name|'bdm'
name|'in'
name|'block_device_mapping'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'block_device'
op|'.'
name|'validate_device_name'
op|'('
name|'bdm'
op|'.'
name|'get'
op|'('
string|'"device_name"'
op|')'
op|')'
newline|'\n'
name|'block_device'
op|'.'
name|'validate_and_default_volume_size'
op|'('
name|'bdm'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InvalidBDMFormat'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'delete_on_termination'"
name|'in'
name|'bdm'
op|':'
newline|'\n'
indent|' '
name|'bdm'
op|'['
string|"'delete_on_termination'"
op|']'
op|'='
name|'strutils'
op|'.'
name|'bool_from_string'
op|'('
nl|'\n'
name|'bdm'
op|'['
string|"'delete_on_termination'"
op|']'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'if'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-block-device-mapping-v2-boot'"
op|')'
op|':'
newline|'\n'
comment|'# Consider the new data format for block device mapping'
nl|'\n'
indent|' '
name|'block_device_mapping_v2'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
nl|'\n'
string|"'block_device_mapping_v2'"
op|','
op|'['
op|']'
op|')'
newline|'\n'
comment|'# NOTE (ndipanov): Disable usage of both legacy and new'
nl|'\n'
comment|'# block device format in the same request'
nl|'\n'
name|'if'
name|'block_device_mapping'
name|'and'
name|'block_device_mapping_v2'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'Using different block_device_mapping syntaxes '"
nl|'\n'
string|"'is not allowed in the same request.'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'not'
name|'isinstance'
op|'('
name|'block_device_mapping_v2'
op|','
name|'list'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|"'block_device_mapping_v2 must be a list'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
comment|'# Assume legacy format'
nl|'\n'
dedent|''
name|'legacy_bdm'
op|'='
name|'not'
name|'bool'
op|'('
name|'block_device_mapping_v2'
op|')'
newline|'\n'
nl|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'block_device_mapping_v2'
op|'='
op|'['
nl|'\n'
name|'block_device'
op|'.'
name|'BlockDeviceDict'
op|'.'
name|'from_api'
op|'('
name|'bdm_dict'
op|','
nl|'\n'
name|'image_uuid_specified'
op|')'
nl|'\n'
name|'for'
name|'bdm_dict'
name|'in'
name|'block_device_mapping_v2'
op|']'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InvalidBDMFormat'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'bdm'
op|'='
op|'('
name|'block_device_mapping'
name|'or'
name|'block_device_mapping_v2'
op|')'
newline|'\n'
name|'return'
name|'legacy_bdm'
op|','
name|'bdm'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'staticmethod'
newline|'\n'
DECL|member|_resolve_exception
name|'def'
name|'_resolve_exception'
op|'('
name|'matches'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""We want the most specific exception class."""'
newline|'\n'
name|'while'
name|'len'
op|'('
name|'matches'
op|')'
op|'>'
number|'1'
op|':'
newline|'\n'
indent|' '
name|'first'
op|'='
name|'matches'
op|'['
number|'0'
op|']'
newline|'\n'
name|'second'
op|'='
name|'matches'
op|'['
number|'1'
op|']'
newline|'\n'
name|'if'
name|'issubclass'
op|'('
name|'first'
op|','
name|'second'
op|')'
op|':'
newline|'\n'
indent|' '
name|'del'
name|'matches'
op|'['
number|'1'
op|']'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'del'
name|'matches'
op|'['
number|'0'
op|']'
newline|'\n'
dedent|''
dedent|''
name|'return'
name|'matches'
op|'['
number|'0'
op|']'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'staticmethod'
newline|'\n'
DECL|member|_handle_create_exception
name|'def'
name|'_handle_create_exception'
op|'('
op|'*'
name|'exc_info'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""The `CREATE_EXCEPTIONS` dict containing the relationships between\n the nova exceptions and the webob exception classes to be raised is\n defined at the top of this file.\n """'
newline|'\n'
name|'error'
op|'='
name|'exc_info'
op|'['
number|'1'
op|']'
newline|'\n'
name|'err_cls'
op|'='
name|'error'
op|'.'
name|'__class__'
newline|'\n'
name|'cls_to_raise'
op|'='
name|'CREATE_EXCEPTIONS'
op|'.'
name|'get'
op|'('
name|'err_cls'
op|')'
newline|'\n'
name|'if'
name|'cls_to_raise'
name|'is'
name|'None'
op|':'
newline|'\n'
comment|'# The error is a subclass of one of the dict keys'
nl|'\n'
indent|' '
name|'to_raise'
op|'='
op|'['
name|'val'
name|'for'
name|'key'
op|','
name|'val'
name|'in'
name|'CREATE_EXCEPTIONS'
op|'.'
name|'items'
op|'('
op|')'
nl|'\n'
name|'if'
name|'isinstance'
op|'('
name|'error'
op|','
name|'key'
op|')'
op|']'
newline|'\n'
name|'if'
name|'len'
op|'('
name|'to_raise'
op|')'
op|'>'
number|'1'
op|':'
newline|'\n'
indent|' '
name|'cls_to_raise'
op|'='
name|'Controller'
op|'.'
name|'_resolve_exception'
op|'('
name|'to_raise'
op|')'
newline|'\n'
dedent|''
name|'elif'
name|'not'
name|'to_raise'
op|':'
newline|'\n'
comment|'# Not any of the expected exceptions, so re-raise'
nl|'\n'
indent|' '
name|'six'
op|'.'
name|'reraise'
op|'('
op|'*'
name|'exc_info'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'cls_to_raise'
op|'='
name|'to_raise'
op|'['
number|'0'
op|']'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'for'
name|'key'
op|','
name|'val'
name|'in'
name|'CREATE_EXCEPTIONS_MSGS'
op|'.'
name|'items'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'isinstance'
op|'('
name|'error'
op|','
name|'key'
op|')'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'cls_to_raise'
op|'('
name|'explanation'
op|'='
name|'CREATE_EXCEPTIONS_MSGS'
op|'['
name|'key'
op|']'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'raise'
name|'cls_to_raise'
op|'('
name|'explanation'
op|'='
name|'error'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_determine_requested_networks
dedent|''
name|'def'
name|'_determine_requested_networks'
op|'('
name|'self'
op|','
name|'server_dict'
op|')'
op|':'
newline|'\n'
indent|' '
name|'requested_networks'
op|'='
name|'None'
newline|'\n'
name|'if'
op|'('
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-networks'"
op|')'
nl|'\n'
name|'or'
name|'utils'
op|'.'
name|'is_neutron'
op|'('
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'requested_networks'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'networks'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'requested_networks'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'isinstance'
op|'('
name|'requested_networks'
op|','
name|'list'
op|')'
op|':'
newline|'\n'
indent|' '
name|'expl'
op|'='
name|'_'
op|'('
string|"'Bad networks format'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'expl'
op|')'
newline|'\n'
dedent|''
name|'requested_networks'
op|'='
name|'self'
op|'.'
name|'_get_requested_networks'
op|'('
nl|'\n'
name|'requested_networks'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'requested_networks'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'202'
op|')'
newline|'\n'
DECL|member|create
name|'def'
name|'create'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Creates a new server for a given user."""'
newline|'\n'
name|'if'
name|'not'
name|'self'
op|'.'
name|'is_valid_body'
op|'('
name|'body'
op|','
string|"'server'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPUnprocessableEntity'
op|'('
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'server_dict'
op|'='
name|'body'
op|'['
string|"'server'"
op|']'
newline|'\n'
name|'password'
op|'='
name|'self'
op|'.'
name|'_get_server_admin_password'
op|'('
name|'server_dict'
op|')'
newline|'\n'
nl|'\n'
name|'if'
string|"'name'"
name|'not'
name|'in'
name|'server_dict'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Server name is not defined"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'name'
op|'='
name|'server_dict'
op|'['
string|"'name'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'_validate_server_name'
op|'('
name|'name'
op|')'
newline|'\n'
name|'name'
op|'='
name|'name'
op|'.'
name|'strip'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'image_uuid'
op|'='
name|'self'
op|'.'
name|'_image_from_req_data'
op|'('
name|'body'
op|')'
newline|'\n'
nl|'\n'
name|'personality'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'personality'"
op|')'
newline|'\n'
name|'config_drive'
op|'='
name|'None'
newline|'\n'
name|'if'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-config-drive'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'config_drive'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'config_drive'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'injected_files'
op|'='
op|'['
op|']'
newline|'\n'
name|'if'
name|'personality'
op|':'
newline|'\n'
indent|' '
name|'injected_files'
op|'='
name|'self'
op|'.'
name|'_get_injected_files'
op|'('
name|'personality'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'sg_names'
op|'='
op|'['
op|']'
newline|'\n'
name|'if'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-security-groups'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'security_groups'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'security_groups'"
op|')'
newline|'\n'
name|'if'
name|'security_groups'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'sg_names'
op|'='
op|'['
name|'sg'
op|'['
string|"'name'"
op|']'
name|'for'
name|'sg'
name|'in'
name|'security_groups'
nl|'\n'
name|'if'
name|'sg'
op|'.'
name|'get'
op|'('
string|"'name'"
op|')'
op|']'
newline|'\n'
dedent|''
name|'except'
name|'AttributeError'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Invalid input for field/attribute %(path)s."'
nl|'\n'
string|'" Value: %(value)s. %(message)s"'
op|')'
op|'%'
op|'{'
nl|'\n'
string|"'path'"
op|':'
string|"'security_groups'"
op|','
nl|'\n'
string|"'value'"
op|':'
name|'security_groups'
op|','
nl|'\n'
string|"'message'"
op|':'
string|"''"
nl|'\n'
op|'}'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
dedent|''
dedent|''
name|'if'
name|'not'
name|'sg_names'
op|':'
newline|'\n'
indent|' '
name|'sg_names'
op|'.'
name|'append'
op|'('
string|"'default'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'sg_names'
op|'='
name|'list'
op|'('
name|'set'
op|'('
name|'sg_names'
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'requested_networks'
op|'='
name|'self'
op|'.'
name|'_determine_requested_networks'
op|'('
name|'server_dict'
op|')'
newline|'\n'
nl|'\n'
op|'('
name|'access_ip_v4'
op|','
op|')'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'accessIPv4'"
op|')'
op|','
newline|'\n'
name|'if'
name|'access_ip_v4'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_validate_access_ipv4'
op|'('
name|'access_ip_v4'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'('
name|'access_ip_v6'
op|','
op|')'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'accessIPv6'"
op|')'
op|','
newline|'\n'
name|'if'
name|'access_ip_v6'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_validate_access_ipv6'
op|'('
name|'access_ip_v6'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'flavor_id'
op|'='
name|'self'
op|'.'
name|'_flavor_id_from_req_data'
op|'('
name|'body'
op|')'
newline|'\n'
nl|'\n'
comment|'# optional openstack extensions:'
nl|'\n'
name|'key_name'
op|'='
name|'self'
op|'.'
name|'_extract'
op|'('
name|'server_dict'
op|','
string|"'os-keypairs'"
op|','
string|"'key_name'"
op|')'
newline|'\n'
name|'availability_zone'
op|'='
name|'self'
op|'.'
name|'_extract'
op|'('
name|'server_dict'
op|','
string|"'os-availability-zone'"
op|','
nl|'\n'
string|"'availability_zone'"
op|')'
newline|'\n'
name|'user_data'
op|'='
name|'self'
op|'.'
name|'_extract'
op|'('
name|'server_dict'
op|','
string|"'os-user-data'"
op|','
string|"'user_data'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'_validate_user_data'
op|'('
name|'user_data'
op|')'
newline|'\n'
nl|'\n'
name|'image_uuid_specified'
op|'='
name|'bool'
op|'('
name|'image_uuid'
op|')'
newline|'\n'
name|'legacy_bdm'
op|','
name|'block_device_mapping'
op|'='
name|'self'
op|'.'
name|'_extract_bdm'
op|'('
name|'server_dict'
op|','
nl|'\n'
name|'image_uuid_specified'
op|')'
newline|'\n'
nl|'\n'
name|'ret_resv_id'
op|'='
name|'False'
newline|'\n'
comment|'# min_count and max_count are optional. If they exist, they may come'
nl|'\n'
comment|'# in as strings. Verify that they are valid integers and > 0.'
nl|'\n'
comment|"# Also, we want to default 'min_count' to 1, and default"
nl|'\n'
comment|"# 'max_count' to be 'min_count'."
nl|'\n'
name|'min_count'
op|'='
number|'1'
newline|'\n'
name|'max_count'
op|'='
number|'1'
newline|'\n'
name|'if'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-multiple-create'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'ret_resv_id'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'return_reservation_id'"
op|','
name|'False'
op|')'
newline|'\n'
name|'min_count'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'min_count'"
op|','
number|'1'
op|')'
newline|'\n'
name|'max_count'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'max_count'"
op|','
name|'min_count'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'try'
op|':'
newline|'\n'
indent|' '
name|'min_count'
op|'='
name|'utils'
op|'.'
name|'validate_integer'
op|'('
nl|'\n'
name|'min_count'
op|','
string|'"min_count"'
op|','
name|'min_value'
op|'='
number|'1'
op|')'
newline|'\n'
name|'max_count'
op|'='
name|'utils'
op|'.'
name|'validate_integer'
op|'('
nl|'\n'
name|'max_count'
op|','
string|'"max_count"'
op|','
name|'min_value'
op|'='
number|'1'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InvalidInput'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'min_count'
op|'>'
name|'max_count'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|"'min_count must be <= max_count'"
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'auto_disk_config'
op|'='
name|'False'
newline|'\n'
name|'if'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'OS-DCF'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'auto_disk_config'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'auto_disk_config'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'scheduler_hints'
op|'='
op|'{'
op|'}'
newline|'\n'
name|'if'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'OS-SCH-HNT'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'scheduler_hints'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'scheduler_hints'"
op|','
op|'{'
op|'}'
op|')'
newline|'\n'
dedent|''
name|'parse_az'
op|'='
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'parse_availability_zone'
newline|'\n'
name|'availability_zone'
op|','
name|'host'
op|','
name|'node'
op|'='
name|'parse_az'
op|'('
name|'context'
op|','
name|'availability_zone'
op|')'
newline|'\n'
nl|'\n'
name|'check_server_group_quota'
op|'='
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
nl|'\n'
string|"'os-server-group-quotas'"
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'_get_inst_type'
op|'='
name|'flavors'
op|'.'
name|'get_flavor_by_flavor_id'
newline|'\n'
name|'inst_type'
op|'='
name|'_get_inst_type'
op|'('
name|'flavor_id'
op|','
name|'ctxt'
op|'='
name|'context'
op|','
nl|'\n'
name|'read_deleted'
op|'='
string|'"no"'
op|')'
newline|'\n'
nl|'\n'
op|'('
name|'instances'
op|','
name|'resv_id'
op|')'
op|'='
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'create'
op|'('
name|'context'
op|','
nl|'\n'
name|'inst_type'
op|','
nl|'\n'
name|'image_uuid'
op|','
nl|'\n'
name|'display_name'
op|'='
name|'name'
op|','
nl|'\n'
name|'display_description'
op|'='
name|'name'
op|','
nl|'\n'
name|'key_name'
op|'='
name|'key_name'
op|','
nl|'\n'
name|'metadata'
op|'='
name|'server_dict'
op|'.'
name|'get'
op|'('
string|"'metadata'"
op|','
op|'{'
op|'}'
op|')'
op|','
nl|'\n'
name|'access_ip_v4'
op|'='
name|'access_ip_v4'
op|','
nl|'\n'
name|'access_ip_v6'
op|'='
name|'access_ip_v6'
op|','
nl|'\n'
name|'injected_files'
op|'='
name|'injected_files'
op|','
nl|'\n'
name|'admin_password'
op|'='
name|'password'
op|','
nl|'\n'
name|'min_count'
op|'='
name|'min_count'
op|','
nl|'\n'
name|'max_count'
op|'='
name|'max_count'
op|','
nl|'\n'
name|'requested_networks'
op|'='
name|'requested_networks'
op|','
nl|'\n'
name|'security_group'
op|'='
name|'sg_names'
op|','
nl|'\n'
name|'user_data'
op|'='
name|'user_data'
op|','
nl|'\n'
name|'availability_zone'
op|'='
name|'availability_zone'
op|','
nl|'\n'
name|'forced_host'
op|'='
name|'host'
op|','
name|'forced_node'
op|'='
name|'node'
op|','
nl|'\n'
name|'config_drive'
op|'='
name|'config_drive'
op|','
nl|'\n'
name|'block_device_mapping'
op|'='
name|'block_device_mapping'
op|','
nl|'\n'
name|'auto_disk_config'
op|'='
name|'auto_disk_config'
op|','
nl|'\n'
name|'scheduler_hints'
op|'='
name|'scheduler_hints'
op|','
nl|'\n'
name|'legacy_bdm'
op|'='
name|'legacy_bdm'
op|','
nl|'\n'
name|'check_server_group_quota'
op|'='
name|'check_server_group_quota'
op|')'
newline|'\n'
dedent|''
name|'except'
op|'('
name|'exception'
op|'.'
name|'QuotaError'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'PortLimitExceeded'
op|')'
name|'as'
name|'error'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPForbidden'
op|'('
nl|'\n'
name|'explanation'
op|'='
name|'error'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'messaging'
op|'.'
name|'RemoteError'
name|'as'
name|'err'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
string|'"%(err_type)s: %(err_msg)s"'
op|'%'
op|'{'
string|"'err_type'"
op|':'
name|'err'
op|'.'
name|'exc_type'
op|','
nl|'\n'
string|"'err_msg'"
op|':'
name|'err'
op|'.'
name|'value'
op|'}'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'UnicodeDecodeError'
name|'as'
name|'error'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
string|'"UnicodeError: %s"'
op|'%'
name|'error'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'Exception'
op|':'
newline|'\n'
comment|'# The remaining cases can be handled in a standard fashion.'
nl|'\n'
indent|' '
name|'self'
op|'.'
name|'_handle_create_exception'
op|'('
op|'*'
name|'sys'
op|'.'
name|'exc_info'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
comment|'# If the caller wanted a reservation_id, return it'
nl|'\n'
dedent|''
name|'if'
name|'ret_resv_id'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'wsgi'
op|'.'
name|'ResponseObject'
op|'('
op|'{'
string|"'reservation_id'"
op|':'
name|'resv_id'
op|'}'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'req'
op|'.'
name|'cache_db_instances'
op|'('
name|'instances'
op|')'
newline|'\n'
name|'server'
op|'='
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'create'
op|'('
name|'req'
op|','
name|'instances'
op|'['
number|'0'
op|']'
op|')'
newline|'\n'
nl|'\n'
name|'if'
name|'CONF'
op|'.'
name|'enable_instance_password'
op|':'
newline|'\n'
indent|' '
name|'server'
op|'['
string|"'server'"
op|']'
op|'['
string|"'adminPass'"
op|']'
op|'='
name|'password'
newline|'\n'
nl|'\n'
dedent|''
name|'robj'
op|'='
name|'wsgi'
op|'.'
name|'ResponseObject'
op|'('
name|'server'
op|')'
newline|'\n'
nl|'\n'
name|'return'
name|'self'
op|'.'
name|'_add_location'
op|'('
name|'robj'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_delete
dedent|''
name|'def'
name|'_delete'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'req'
op|','
name|'instance_uuid'
op|')'
op|':'
newline|'\n'
indent|' '
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'instance_uuid'
op|')'
newline|'\n'
name|'if'
name|'CONF'
op|'.'
name|'reclaim_instance_interval'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'soft_delete'
op|'('
name|'context'
op|','
name|'instance'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
op|':'
newline|'\n'
comment|'# Note(yufang521247): instance which has never been active'
nl|'\n'
comment|'# is not allowed to be soft_deleted. Thus we have to call'
nl|'\n'
comment|'# delete() to clean up the instance.'
nl|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'delete'
op|'('
name|'context'
op|','
name|'instance'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'delete'
op|'('
name|'context'
op|','
name|'instance'
op|')'
newline|'\n'
nl|'\n'
DECL|member|update
dedent|''
dedent|''
name|'def'
name|'update'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Update server then pass on to version-specific controller."""'
newline|'\n'
name|'if'
name|'not'
name|'self'
op|'.'
name|'is_valid_body'
op|'('
name|'body'
op|','
string|"'server'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPUnprocessableEntity'
op|'('
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'ctxt'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'update_dict'
op|'='
op|'{'
op|'}'
newline|'\n'
nl|'\n'
name|'if'
string|"'name'"
name|'in'
name|'body'
op|'['
string|"'server'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'name'
op|'='
name|'body'
op|'['
string|"'server'"
op|']'
op|'['
string|"'name'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'_validate_server_name'
op|'('
name|'name'
op|')'
newline|'\n'
name|'update_dict'
op|'['
string|"'display_name'"
op|']'
op|'='
name|'name'
op|'.'
name|'strip'
op|'('
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'accessIPv4'"
name|'in'
name|'body'
op|'['
string|"'server'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'access_ipv4'
op|'='
name|'body'
op|'['
string|"'server'"
op|']'
op|'['
string|"'accessIPv4'"
op|']'
newline|'\n'
name|'if'
name|'access_ipv4'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_validate_access_ipv4'
op|'('
name|'access_ipv4'
op|')'
newline|'\n'
dedent|''
name|'update_dict'
op|'['
string|"'access_ip_v4'"
op|']'
op|'='
op|'('
nl|'\n'
name|'access_ipv4'
name|'and'
name|'access_ipv4'
op|'.'
name|'strip'
op|'('
op|')'
name|'or'
name|'None'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'accessIPv6'"
name|'in'
name|'body'
op|'['
string|"'server'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'access_ipv6'
op|'='
name|'body'
op|'['
string|"'server'"
op|']'
op|'['
string|"'accessIPv6'"
op|']'
newline|'\n'
name|'if'
name|'access_ipv6'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_validate_access_ipv6'
op|'('
name|'access_ipv6'
op|')'
newline|'\n'
dedent|''
name|'update_dict'
op|'['
string|"'access_ip_v6'"
op|']'
op|'='
op|'('
nl|'\n'
name|'access_ipv6'
name|'and'
name|'access_ipv6'
op|'.'
name|'strip'
op|'('
op|')'
name|'or'
name|'None'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'auto_disk_config'"
name|'in'
name|'body'
op|'['
string|"'server'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'auto_disk_config'
op|'='
name|'strutils'
op|'.'
name|'bool_from_string'
op|'('
nl|'\n'
name|'body'
op|'['
string|"'server'"
op|']'
op|'['
string|"'auto_disk_config'"
op|']'
op|')'
newline|'\n'
name|'update_dict'
op|'['
string|"'auto_disk_config'"
op|']'
op|'='
name|'auto_disk_config'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'hostId'"
name|'in'
name|'body'
op|'['
string|"'server'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"HostId cannot be updated."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'personality'"
name|'in'
name|'body'
op|'['
string|"'server'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Personality cannot be updated."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'ctxt'
op|','
name|'req'
op|','
name|'id'
op|','
name|'is_detail'
op|'='
name|'True'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'policy'
op|'.'
name|'enforce'
op|'('
name|'ctxt'
op|','
string|"'compute:update'"
op|','
name|'instance'
op|')'
newline|'\n'
name|'instance'
op|'.'
name|'update'
op|'('
name|'update_dict'
op|')'
newline|'\n'
comment|'# Note instance.save can throw a NotFound exception'
nl|'\n'
name|'instance'
op|'.'
name|'save'
op|'('
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'NotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Instance could not be found"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPNotFound'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'return'
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'show'
op|'('
name|'req'
op|','
name|'instance'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'204'
op|')'
newline|'\n'
op|'@'
name|'wsgi'
op|'.'
name|'action'
op|'('
string|"'confirmResize'"
op|')'
newline|'\n'
DECL|member|_action_confirm_resize
name|'def'
name|'_action_confirm_resize'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'id'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'confirm_resize'
op|'('
name|'context'
op|','
name|'instance'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'MigrationNotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Instance has not been resized."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceIsLocked'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPConflict'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
name|'as'
name|'state_error'
op|':'
newline|'\n'
indent|' '
name|'common'
op|'.'
name|'raise_http_conflict_for_instance_invalid_state'
op|'('
name|'state_error'
op|','
nl|'\n'
string|"'confirmResize'"
op|','
name|'id'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'202'
op|')'
newline|'\n'
op|'@'
name|'wsgi'
op|'.'
name|'action'
op|'('
string|"'revertResize'"
op|')'
newline|'\n'
DECL|member|_action_revert_resize
name|'def'
name|'_action_revert_resize'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'id'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'revert_resize'
op|'('
name|'context'
op|','
name|'instance'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'MigrationNotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Instance has not been resized."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'FlavorNotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Flavor used by the instance could not be found."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceIsLocked'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPConflict'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
name|'as'
name|'state_error'
op|':'
newline|'\n'
indent|' '
name|'common'
op|'.'
name|'raise_http_conflict_for_instance_invalid_state'
op|'('
name|'state_error'
op|','
nl|'\n'
string|"'revertResize'"
op|','
name|'id'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'webob'
op|'.'
name|'Response'
op|'('
name|'status_int'
op|'='
number|'202'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'202'
op|')'
newline|'\n'
op|'@'
name|'wsgi'
op|'.'
name|'action'
op|'('
string|"'reboot'"
op|')'
newline|'\n'
DECL|member|_action_reboot
name|'def'
name|'_action_reboot'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
string|"'reboot'"
name|'in'
name|'body'
name|'and'
string|"'type'"
name|'in'
name|'body'
op|'['
string|"'reboot'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'isinstance'
op|'('
name|'body'
op|'['
string|"'reboot'"
op|']'
op|'['
string|"'type'"
op|']'
op|','
name|'six'
op|'.'
name|'string_types'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Argument \'type\' for reboot must be a string"'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'error'
op|'('
name|'msg'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'valid_reboot_types'
op|'='
op|'['
string|"'HARD'"
op|','
string|"'SOFT'"
op|']'
newline|'\n'
name|'reboot_type'
op|'='
name|'body'
op|'['
string|"'reboot'"
op|']'
op|'['
string|"'type'"
op|']'
op|'.'
name|'upper'
op|'('
op|')'
newline|'\n'
name|'if'
name|'not'
name|'valid_reboot_types'
op|'.'
name|'count'
op|'('
name|'reboot_type'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Argument \'type\' for reboot is not HARD or SOFT"'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'error'
op|'('
name|'msg'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Missing argument \'type\' for reboot"'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'error'
op|'('
name|'msg'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'id'
op|')'
newline|'\n'
nl|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'reboot'
op|'('
name|'context'
op|','
name|'instance'
op|','
name|'reboot_type'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceIsLocked'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPConflict'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
name|'as'
name|'state_error'
op|':'
newline|'\n'
indent|' '
name|'common'
op|'.'
name|'raise_http_conflict_for_instance_invalid_state'
op|'('
name|'state_error'
op|','
nl|'\n'
string|"'reboot'"
op|','
name|'id'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'webob'
op|'.'
name|'Response'
op|'('
name|'status_int'
op|'='
number|'202'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_resize
dedent|''
name|'def'
name|'_resize'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'instance_id'
op|','
name|'flavor_id'
op|','
op|'**'
name|'kwargs'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Begin the resize process with given instance/flavor."""'
newline|'\n'
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|'"nova.context"'
op|']'
newline|'\n'
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'instance_id'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'resize'
op|'('
name|'context'
op|','
name|'instance'
op|','
name|'flavor_id'
op|','
op|'**'
name|'kwargs'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'QuotaError'
name|'as'
name|'error'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPForbidden'
op|'('
nl|'\n'
name|'explanation'
op|'='
name|'error'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'FlavorNotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Unable to locate requested flavor."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'CannotResizeToSameFlavor'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Resize requires a flavor change."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'CannotResizeDisk'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceIsLocked'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPConflict'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
name|'as'
name|'state_error'
op|':'
newline|'\n'
indent|' '
name|'common'
op|'.'
name|'raise_http_conflict_for_instance_invalid_state'
op|'('
name|'state_error'
op|','
nl|'\n'
string|"'resize'"
op|','
name|'instance_id'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'ImageNotAuthorized'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"You are not authorized to access the image "'
nl|'\n'
string|'"the instance was started with."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPUnauthorized'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'ImageNotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Image that the instance was started "'
nl|'\n'
string|'"with could not be found."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
op|'('
name|'exception'
op|'.'
name|'NoValidHost'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'AutoDiskConfigDisabledByImage'
op|')'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'Invalid'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Invalid instance image."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'return'
name|'webob'
op|'.'
name|'Response'
op|'('
name|'status_int'
op|'='
number|'202'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'204'
op|')'
newline|'\n'
DECL|member|delete
name|'def'
name|'delete'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Destroys a server."""'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_delete'
op|'('
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
op|','
name|'req'
op|','
name|'id'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'NotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Instance could not be found"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPNotFound'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceIsLocked'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPConflict'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
name|'as'
name|'state_error'
op|':'
newline|'\n'
indent|' '
name|'common'
op|'.'
name|'raise_http_conflict_for_instance_invalid_state'
op|'('
name|'state_error'
op|','
nl|'\n'
string|"'delete'"
op|','
name|'id'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_image_ref_from_req_data
dedent|''
dedent|''
name|'def'
name|'_image_ref_from_req_data'
op|'('
name|'self'
op|','
name|'data'
op|')'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'six'
op|'.'
name|'text_type'
op|'('
name|'data'
op|'['
string|"'server'"
op|']'
op|'['
string|"'imageRef'"
op|']'
op|')'
newline|'\n'
dedent|''
name|'except'
op|'('
name|'TypeError'
op|','
name|'KeyError'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Missing imageRef attribute"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_image_from_req_data
dedent|''
dedent|''
name|'def'
name|'_image_from_req_data'
op|'('
name|'self'
op|','
name|'data'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get image data from the request or raise appropriate\n exceptions\n\n If no image is supplied - checks to see if there is\n block devices set and proper extesions loaded.\n """'
newline|'\n'
name|'image_ref'
op|'='
name|'data'
op|'['
string|"'server'"
op|']'
op|'.'
name|'get'
op|'('
string|"'imageRef'"
op|')'
newline|'\n'
name|'bdm'
op|'='
name|'data'
op|'['
string|"'server'"
op|']'
op|'.'
name|'get'
op|'('
string|"'block_device_mapping'"
op|')'
newline|'\n'
name|'bdm_v2'
op|'='
name|'data'
op|'['
string|"'server'"
op|']'
op|'.'
name|'get'
op|'('
string|"'block_device_mapping_v2'"
op|')'
newline|'\n'
nl|'\n'
name|'if'
op|'('
name|'not'
name|'image_ref'
name|'and'
op|'('
nl|'\n'
op|'('
name|'bdm'
name|'and'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-volumes'"
op|')'
op|')'
name|'or'
nl|'\n'
op|'('
name|'bdm_v2'
name|'and'
nl|'\n'
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-block-device-mapping-v2-boot'"
op|')'
op|')'
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"''"
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'image_href'
op|'='
name|'self'
op|'.'
name|'_image_ref_from_req_data'
op|'('
name|'data'
op|')'
newline|'\n'
name|'image_uuid'
op|'='
name|'common'
op|'.'
name|'image_uuid_from_href'
op|'('
name|'image_href'
op|','
string|"'imageRef'"
op|')'
newline|'\n'
name|'return'
name|'image_uuid'
newline|'\n'
nl|'\n'
DECL|member|_flavor_id_from_req_data
dedent|''
dedent|''
name|'def'
name|'_flavor_id_from_req_data'
op|'('
name|'self'
op|','
name|'data'
op|')'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'flavor_ref'
op|'='
name|'data'
op|'['
string|"'server'"
op|']'
op|'['
string|"'flavorRef'"
op|']'
newline|'\n'
dedent|''
name|'except'
op|'('
name|'TypeError'
op|','
name|'KeyError'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Missing flavorRef attribute"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'try'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'common'
op|'.'
name|'get_id_from_href'
op|'('
name|'flavor_ref'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'ValueError'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Invalid flavorRef provided."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'202'
op|')'
newline|'\n'
op|'@'
name|'wsgi'
op|'.'
name|'action'
op|'('
string|"'changePassword'"
op|')'
newline|'\n'
DECL|member|_action_change_password
name|'def'
name|'_action_change_password'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'if'
op|'('
name|'not'
name|'body'
op|'.'
name|'get'
op|'('
string|"'changePassword'"
op|')'
nl|'\n'
name|'or'
string|"'adminPass'"
name|'not'
name|'in'
name|'body'
op|'['
string|"'changePassword'"
op|']'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"No adminPass was specified"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'password'
op|'='
name|'self'
op|'.'
name|'_get_server_admin_password'
op|'('
name|'body'
op|'['
string|"'changePassword'"
op|']'
op|')'
newline|'\n'
nl|'\n'
name|'server'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'id'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'set_admin_password'
op|'('
name|'context'
op|','
name|'server'
op|','
name|'password'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstancePasswordSetFailed'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPConflict'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'common'
op|'.'
name|'raise_http_conflict_for_instance_invalid_state'
op|'('
nl|'\n'
name|'e'
op|','
string|"'changePassword'"
op|','
name|'id'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'NotImplementedError'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Unable to set password on instance"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPNotImplemented'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'webob'
op|'.'
name|'Response'
op|'('
name|'status_int'
op|'='
number|'202'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_validate_metadata
dedent|''
name|'def'
name|'_validate_metadata'
op|'('
name|'self'
op|','
name|'metadata'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Ensure that we can work with the metadata given."""'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'six'
op|'.'
name|'iteritems'
op|'('
name|'metadata'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'AttributeError'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Unable to parse metadata key/value pairs."'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
name|'msg'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'202'
op|')'
newline|'\n'
op|'@'
name|'wsgi'
op|'.'
name|'action'
op|'('
string|"'resize'"
op|')'
newline|'\n'
DECL|member|_action_resize
name|'def'
name|'_action_resize'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Resizes a given instance to the flavor size requested."""'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'flavor_ref'
op|'='
name|'str'
op|'('
name|'body'
op|'['
string|'"resize"'
op|']'
op|'['
string|'"flavorRef"'
op|']'
op|')'
newline|'\n'
name|'if'
name|'not'
name|'flavor_ref'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Resize request has invalid \'flavorRef\' attribute."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'except'
op|'('
name|'KeyError'
op|','
name|'TypeError'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Resize requests require \'flavorRef\' attribute."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'kwargs'
op|'='
op|'{'
op|'}'
newline|'\n'
name|'if'
string|"'auto_disk_config'"
name|'in'
name|'body'
op|'['
string|"'resize'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'kwargs'
op|'['
string|"'auto_disk_config'"
op|']'
op|'='
name|'body'
op|'['
string|"'resize'"
op|']'
op|'['
string|"'auto_disk_config'"
op|']'
newline|'\n'
nl|'\n'
dedent|''
name|'return'
name|'self'
op|'.'
name|'_resize'
op|'('
name|'req'
op|','
name|'id'
op|','
name|'flavor_ref'
op|','
op|'**'
name|'kwargs'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'202'
op|')'
newline|'\n'
op|'@'
name|'wsgi'
op|'.'
name|'action'
op|'('
string|"'rebuild'"
op|')'
newline|'\n'
DECL|member|_action_rebuild
name|'def'
name|'_action_rebuild'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Rebuild an instance with the given attributes."""'
newline|'\n'
name|'body'
op|'='
name|'body'
op|'['
string|"'rebuild'"
op|']'
newline|'\n'
nl|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'image_href'
op|'='
name|'body'
op|'['
string|'"imageRef"'
op|']'
newline|'\n'
dedent|''
name|'except'
op|'('
name|'KeyError'
op|','
name|'TypeError'
op|')'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Could not parse imageRef from request."'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'image_href'
op|'='
name|'common'
op|'.'
name|'image_uuid_from_href'
op|'('
name|'image_href'
op|','
string|"'imageRef'"
op|')'
newline|'\n'
nl|'\n'
name|'password'
op|'='
name|'self'
op|'.'
name|'_get_server_admin_password'
op|'('
name|'body'
op|')'
newline|'\n'
nl|'\n'
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'id'
op|')'
newline|'\n'
nl|'\n'
name|'attr_map'
op|'='
op|'{'
nl|'\n'
string|"'personality'"
op|':'
string|"'files_to_inject'"
op|','
nl|'\n'
string|"'name'"
op|':'
string|"'display_name'"
op|','
nl|'\n'
string|"'accessIPv4'"
op|':'
string|"'access_ip_v4'"
op|','
nl|'\n'
string|"'accessIPv6'"
op|':'
string|"'access_ip_v6'"
op|','
nl|'\n'
string|"'metadata'"
op|':'
string|"'metadata'"
op|','
nl|'\n'
string|"'auto_disk_config'"
op|':'
string|"'auto_disk_config'"
op|','
nl|'\n'
op|'}'
newline|'\n'
nl|'\n'
name|'kwargs'
op|'='
op|'{'
op|'}'
newline|'\n'
nl|'\n'
comment|'# take the preserve_ephemeral value into account only when the'
nl|'\n'
comment|'# corresponding extension is active'
nl|'\n'
name|'if'
op|'('
name|'self'
op|'.'
name|'ext_mgr'
op|'.'
name|'is_loaded'
op|'('
string|"'os-preserve-ephemeral-rebuild'"
op|')'
nl|'\n'
name|'and'
string|"'preserve_ephemeral'"
name|'in'
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
name|'kwargs'
op|'['
string|"'preserve_ephemeral'"
op|']'
op|'='
name|'strutils'
op|'.'
name|'bool_from_string'
op|'('
nl|'\n'
name|'body'
op|'['
string|"'preserve_ephemeral'"
op|']'
op|','
name|'strict'
op|'='
name|'True'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'accessIPv4'"
name|'in'
name|'body'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_validate_access_ipv4'
op|'('
name|'body'
op|'['
string|"'accessIPv4'"
op|']'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'accessIPv6'"
name|'in'
name|'body'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_validate_access_ipv6'
op|'('
name|'body'
op|'['
string|"'accessIPv6'"
op|']'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
string|"'name'"
name|'in'
name|'body'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_validate_server_name'
op|'('
name|'body'
op|'['
string|"'name'"
op|']'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'for'
name|'request_attribute'
op|','
name|'instance_attribute'
name|'in'
name|'attr_map'
op|'.'
name|'items'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'kwargs'
op|'['
name|'instance_attribute'
op|']'
op|'='
name|'body'
op|'['
name|'request_attribute'
op|']'
newline|'\n'
dedent|''
name|'except'
op|'('
name|'KeyError'
op|','
name|'TypeError'
op|')'
op|':'
newline|'\n'
indent|' '
name|'pass'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'self'
op|'.'
name|'_validate_metadata'
op|'('
name|'kwargs'
op|'.'
name|'get'
op|'('
string|"'metadata'"
op|','
op|'{'
op|'}'
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'if'
string|"'files_to_inject'"
name|'in'
name|'kwargs'
op|':'
newline|'\n'
indent|' '
name|'personality'
op|'='
name|'kwargs'
op|'.'
name|'pop'
op|'('
string|"'files_to_inject'"
op|')'
newline|'\n'
name|'files_to_inject'
op|'='
name|'self'
op|'.'
name|'_get_injected_files'
op|'('
name|'personality'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'files_to_inject'
op|'='
name|'None'
newline|'\n'
nl|'\n'
dedent|''
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'rebuild'
op|'('
name|'context'
op|','
nl|'\n'
name|'instance'
op|','
nl|'\n'
name|'image_href'
op|','
nl|'\n'
name|'password'
op|','
nl|'\n'
name|'files_to_inject'
op|'='
name|'files_to_inject'
op|','
nl|'\n'
op|'**'
name|'kwargs'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceIsLocked'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPConflict'
op|'('
name|'explanation'
op|'='
name|'e'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
name|'as'
name|'state_error'
op|':'
newline|'\n'
indent|' '
name|'common'
op|'.'
name|'raise_http_conflict_for_instance_invalid_state'
op|'('
name|'state_error'
op|','
nl|'\n'
string|"'rebuild'"
op|','
name|'id'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceNotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Instance could not be found"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPNotFound'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InvalidMetadataSize'
name|'as'
name|'error'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPRequestEntityTooLarge'
op|'('
nl|'\n'
name|'explanation'
op|'='
name|'error'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'ImageNotFound'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Cannot find image for rebuild"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'QuotaError'
name|'as'
name|'error'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPForbidden'
op|'('
name|'explanation'
op|'='
name|'error'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
dedent|''
name|'except'
op|'('
name|'exception'
op|'.'
name|'ImageNotActive'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'FlavorDiskTooSmall'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'FlavorMemoryTooSmall'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'InvalidMetadata'
op|','
nl|'\n'
name|'exception'
op|'.'
name|'AutoDiskConfigDisabledByImage'
op|')'
name|'as'
name|'error'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'error'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'id'
op|','
name|'is_detail'
op|'='
name|'True'
op|')'
newline|'\n'
nl|'\n'
name|'view'
op|'='
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'show'
op|'('
name|'req'
op|','
name|'instance'
op|')'
newline|'\n'
nl|'\n'
comment|"# Add on the adminPass attribute since the view doesn't do it"
nl|'\n'
comment|'# unless instance passwords are disabled'
nl|'\n'
name|'if'
name|'CONF'
op|'.'
name|'enable_instance_password'
op|':'
newline|'\n'
indent|' '
name|'view'
op|'['
string|"'server'"
op|']'
op|'['
string|"'adminPass'"
op|']'
op|'='
name|'password'
newline|'\n'
nl|'\n'
dedent|''
name|'robj'
op|'='
name|'wsgi'
op|'.'
name|'ResponseObject'
op|'('
name|'view'
op|')'
newline|'\n'
name|'return'
name|'self'
op|'.'
name|'_add_location'
op|'('
name|'robj'
op|')'
newline|'\n'
nl|'\n'
dedent|''
op|'@'
name|'wsgi'
op|'.'
name|'response'
op|'('
number|'202'
op|')'
newline|'\n'
op|'@'
name|'wsgi'
op|'.'
name|'action'
op|'('
string|"'createImage'"
op|')'
newline|'\n'
op|'@'
name|'common'
op|'.'
name|'check_snapshots_enabled'
newline|'\n'
DECL|member|_action_create_image
name|'def'
name|'_action_create_image'
op|'('
name|'self'
op|','
name|'req'
op|','
name|'id'
op|','
name|'body'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Snapshot a server instance."""'
newline|'\n'
name|'context'
op|'='
name|'req'
op|'.'
name|'environ'
op|'['
string|"'nova.context'"
op|']'
newline|'\n'
name|'entity'
op|'='
name|'body'
op|'.'
name|'get'
op|'('
string|'"createImage"'
op|','
op|'{'
op|'}'
op|')'
newline|'\n'
nl|'\n'
name|'image_name'
op|'='
name|'entity'
op|'.'
name|'get'
op|'('
string|'"name"'
op|')'
newline|'\n'
nl|'\n'
name|'if'
name|'not'
name|'image_name'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"createImage entity requires name attribute"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'props'
op|'='
op|'{'
op|'}'
newline|'\n'
name|'metadata'
op|'='
name|'entity'
op|'.'
name|'get'
op|'('
string|"'metadata'"
op|','
op|'{'
op|'}'
op|')'
newline|'\n'
name|'common'
op|'.'
name|'check_img_metadata_properties_quota'
op|'('
name|'context'
op|','
name|'metadata'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'props'
op|'.'
name|'update'
op|'('
name|'metadata'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'ValueError'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|'"Invalid metadata"'
op|')'
newline|'\n'
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'instance'
op|'='
name|'self'
op|'.'
name|'_get_server'
op|'('
name|'context'
op|','
name|'req'
op|','
name|'id'
op|')'
newline|'\n'
nl|'\n'
name|'bdms'
op|'='
name|'objects'
op|'.'
name|'BlockDeviceMappingList'
op|'.'
name|'get_by_instance_uuid'
op|'('
nl|'\n'
name|'context'
op|','
name|'instance'
op|'.'
name|'uuid'
op|')'
newline|'\n'
nl|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'is_volume_backed_instance'
op|'('
name|'context'
op|','
name|'instance'
op|','
nl|'\n'
name|'bdms'
op|')'
op|':'
newline|'\n'
indent|' '
name|'policy'
op|'.'
name|'enforce'
op|'('
name|'context'
op|','
nl|'\n'
string|"'compute:snapshot_volume_backed'"
op|','
nl|'\n'
op|'{'
string|"'project_id'"
op|':'
name|'context'
op|'.'
name|'project_id'
op|','
nl|'\n'
string|"'user_id'"
op|':'
name|'context'
op|'.'
name|'user_id'
op|'}'
op|')'
newline|'\n'
name|'image'
op|'='
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'snapshot_volume_backed'
op|'('
nl|'\n'
name|'context'
op|','
nl|'\n'
name|'instance'
op|','
nl|'\n'
name|'image_name'
op|','
nl|'\n'
name|'extra_properties'
op|'='
name|'props'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'image'
op|'='
name|'self'
op|'.'
name|'compute_api'
op|'.'
name|'snapshot'
op|'('
name|'context'
op|','
nl|'\n'
name|'instance'
op|','
nl|'\n'
name|'image_name'
op|','
nl|'\n'
name|'extra_properties'
op|'='
name|'props'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'except'
name|'exception'
op|'.'
name|'InstanceInvalidState'
name|'as'
name|'state_error'
op|':'
newline|'\n'
indent|' '
name|'common'
op|'.'
name|'raise_http_conflict_for_instance_invalid_state'
op|'('
name|'state_error'
op|','
nl|'\n'
string|"'createImage'"
op|','
name|'id'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'exception'
op|'.'
name|'Invalid'
name|'as'
name|'err'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'err'
op|'.'
name|'format_message'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
comment|'# build location of newly-created image entity'
nl|'\n'
dedent|''
name|'image_id'
op|'='
name|'str'
op|'('
name|'image'
op|'['
string|"'id'"
op|']'
op|')'
newline|'\n'
name|'url_prefix'
op|'='
name|'self'
op|'.'
name|'_view_builder'
op|'.'
name|'_update_glance_link_prefix'
op|'('
nl|'\n'
name|'req'
op|'.'
name|'application_url'
op|')'
newline|'\n'
name|'image_ref'
op|'='
name|'common'
op|'.'
name|'url_join'
op|'('
name|'url_prefix'
op|','
nl|'\n'
name|'context'
op|'.'
name|'project_id'
op|','
nl|'\n'
string|"'images'"
op|','
nl|'\n'
name|'image_id'
op|')'
newline|'\n'
nl|'\n'
name|'resp'
op|'='
name|'webob'
op|'.'
name|'Response'
op|'('
name|'status_int'
op|'='
number|'202'
op|')'
newline|'\n'
name|'resp'
op|'.'
name|'headers'
op|'['
string|"'Location'"
op|']'
op|'='
name|'image_ref'
newline|'\n'
name|'return'
name|'resp'
newline|'\n'
nl|'\n'
DECL|member|_get_server_admin_password
dedent|''
name|'def'
name|'_get_server_admin_password'
op|'('
name|'self'
op|','
name|'server'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Determine the admin password for a server on creation."""'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'password'
op|'='
name|'server'
op|'['
string|"'adminPass'"
op|']'
newline|'\n'
name|'self'
op|'.'
name|'_validate_admin_password'
op|'('
name|'password'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'KeyError'
op|':'
newline|'\n'
indent|' '
name|'password'
op|'='
name|'utils'
op|'.'
name|'generate_password'
op|'('
op|')'
newline|'\n'
dedent|''
name|'except'
name|'ValueError'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exc'
op|'.'
name|'HTTPBadRequest'
op|'('
name|'explanation'
op|'='
name|'_'
op|'('
string|'"Invalid adminPass"'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'return'
name|'password'
newline|'\n'
nl|'\n'
DECL|member|_validate_admin_password
dedent|''
name|'def'
name|'_validate_admin_password'
op|'('
name|'self'
op|','
name|'password'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'isinstance'
op|'('
name|'password'
op|','
name|'six'
op|'.'
name|'string_types'
op|')'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'ValueError'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|_get_server_search_options
dedent|''
dedent|''
name|'def'
name|'_get_server_search_options'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Return server search options allowed by non-admin."""'
newline|'\n'
name|'return'
op|'('
string|"'reservation_id'"
op|','
string|"'name'"
op|','
string|"'status'"
op|','
string|"'image'"
op|','
string|"'flavor'"
op|','
nl|'\n'
string|"'ip'"
op|','
string|"'changes-since'"
op|','
string|"'all_tenants'"
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|create_resource
dedent|''
dedent|''
name|'def'
name|'create_resource'
op|'('
name|'ext_mgr'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'wsgi'
op|'.'
name|'Resource'
op|'('
name|'Controller'
op|'('
name|'ext_mgr'
op|')'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|remove_invalid_options
dedent|''
name|'def'
name|'remove_invalid_options'
op|'('
name|'context'
op|','
name|'search_options'
op|','
name|'allowed_search_options'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Remove search options that are not valid for non-admin API/context."""'
newline|'\n'
name|'if'
name|'context'
op|'.'
name|'is_admin'
op|':'
newline|'\n'
comment|'# Only remove parameters for sorting and pagination'
nl|'\n'
indent|' '
name|'for'
name|'key'
name|'in'
op|'('
string|"'sort_key'"
op|','
string|"'sort_dir'"
op|','
string|"'limit'"
op|','
string|"'marker'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'search_options'
op|'.'
name|'pop'
op|'('
name|'key'
op|','
name|'None'
op|')'
newline|'\n'
dedent|''
name|'return'
newline|'\n'
comment|'# Otherwise, strip out all unknown options'
nl|'\n'
dedent|''
name|'unknown_options'
op|'='
op|'['
name|'opt'
name|'for'
name|'opt'
name|'in'
name|'search_options'
nl|'\n'
name|'if'
name|'opt'
name|'not'
name|'in'
name|'allowed_search_options'
op|']'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Removing options \'%s\' from query"'
op|','
nl|'\n'
string|'", "'
op|'.'
name|'join'
op|'('
name|'unknown_options'
op|')'
op|')'
newline|'\n'
name|'for'
name|'opt'
name|'in'
name|'unknown_options'
op|':'
newline|'\n'
indent|' '
name|'search_options'
op|'.'
name|'pop'
op|'('
name|'opt'
op|','
name|'None'
op|')'
newline|'\n'
dedent|''
dedent|''
endmarker|''
end_unit
| 12.914639 | 400 | 0.596772 | 14,403 | 101,367 | 4.112963 | 0.045616 | 0.148888 | 0.107699 | 0.064822 | 0.824271 | 0.757474 | 0.699455 | 0.64098 | 0.595435 | 0.536488 | 0 | 0.002152 | 0.120029 | 101,367 | 7,848 | 401 | 12.916284 | 0.661962 | 0 | 0 | 0.949286 | 0 | 0.00051 | 0.393008 | 0.029586 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.006116 | 0.003058 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
9f3bec59246f39d23fc74a06ec7433a7f6844edb | 388 | py | Python | examples/example_safe.py | u8sand/simple_commandify | b066a98fadd3d265edb0cd19f27cbf27047a3e2f | [
"MIT"
] | null | null | null | examples/example_safe.py | u8sand/simple_commandify | b066a98fadd3d265edb0cd19f27cbf27047a3e2f | [
"MIT"
] | null | null | null | examples/example_safe.py | u8sand/simple_commandify | b066a98fadd3d265edb0cd19f27cbf27047a3e2f | [
"MIT"
] | null | null | null | from typing import List
def adder(*V: List[float]) -> float:
''' Compute the sum of a set of values
'''
return sum(V)
def product(*V: List[float]) -> float:
''' Compute the product of a set of values.
'''
import functools
return functools.reduce(lambda acc, val: acc * val, V, 1)
if __name__ == '__main__':
import simple_commandify; simple_commandify.inject(globals())
| 24.25 | 63 | 0.677835 | 57 | 388 | 4.438596 | 0.526316 | 0.039526 | 0.079051 | 0.118577 | 0.3083 | 0.197628 | 0 | 0 | 0 | 0 | 0 | 0.003175 | 0.188144 | 388 | 15 | 64 | 25.866667 | 0.8 | 0.198454 | 0 | 0 | 0 | 0 | 0.027119 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.375 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
9f4e0f38f5c577ceb277e524fdd329463c7b5f65 | 5,082 | py | Python | application/config.py | LucasAntognoni/JWT_Security_Tests | dc35b562c096c220cc12c3a71b83c76e2c995acf | [
"MIT"
] | null | null | null | application/config.py | LucasAntognoni/JWT_Security_Tests | dc35b562c096c220cc12c3a71b83c76e2c995acf | [
"MIT"
] | null | null | null | application/config.py | LucasAntognoni/JWT_Security_Tests | dc35b562c096c220cc12c3a71b83c76e2c995acf | [
"MIT"
] | null | null | null | """
+-----------------+------------------------------------------------------------------------+
| **Version** | 0.1 |
+-----------------+------------------------------------------------------------------------+
| **Start** | 27 Nov 2018 |
+-----------------+------------------------------------------------------------------------+
| **Platform** | Unix |
+-----------------+------------------------------------------------------------------------+
| **Authors** | Lucas Antognoni |
+-----------------+------------------------------------------------------------------------+
| **Description** | Security Tests for JWT authentication |
+-----------------+------------------------------------------------------------------------+
| **Modifications** |
+-----------------+-----------+------------------------------------------------------------+
| **Date** | **Author** | **Modification** |
+-----------------+------------------------------------------------------------------------+
| 27 Nov 2018 | Lucas Antognoni | Base application structure |
+-----------------+------------------------------------------------------------------------+
| 27 Nov 2018 | Lucas Antognoni | Organizing application structure |
+-----------------+------------------------------------------------------------------------+
| 27 Nov 2018 | Lucas Antognoni | JWT tools |
+-----------------+------------------------------------------------------------------------+
| 27 Nov 2018 | Lucas Antognoni | Started tests development |
+-----------------+------------------------------------------------------------------------+
| 28 Nov 2018 | Lucas Antognoni | None & claims tests and started RSA to HMAC attack |
+-----------------+------------------------------------------------------------------------+
| 29 Nov 2018 | Lucas Antognoni | Finished all tests and started code documentation |
+-----------------+------------------------------------------------------------------------+
| 29 Nov 2018 | Lucas Antognoni | Upgrading tests robustness |
+-----------------+------------------------------------------------------------------------+
| 29 Nov 2018 | Lucas Antognoni | Started documentation with Sphinx |
+-----------------+------------------------------------------------------------------------+
| 03 Dec 2018 | Lucas Antognoni | Finished documentation |
+-----------------+------------------------------------------------------------------------+
Implementation
==============
"""
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
from datetime import timedelta
class Config:
JWT_ALGORITHM = 'RS256'
JWT_TOKEN_LOCATION = 'headers'
JWT_HEADER_NAME = 'Authorization'
JWT_HEADER_TYPE = 'Bearer'
JWT_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----\nMIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgHuPWRxAWbRQRij4/tWmfstd5gFL\nO3Er2QrwoqEb2W98oOnLcyhxxdVDKhXtcnr1/H1WsTXS6aFNYk+9U8TIzmKtczKk\nWKYttzc28kNOX+Ia+mOSB7ENYu1xA3FY9tKNS7PD/SOhKGEYcYzWbvX8Eiy8oGcb\n3/Yy7MnpmOFO1PF/AgMBAAE=\n-----END PUBLIC KEY-----'
JWT_PRIVATE_KEY = '-----BEGIN RSA PRIVATE KEY-----\nMIICWgIBAAKBgHuPWRxAWbRQRij4/tWmfstd5gFLO3Er2QrwoqEb2W98oOnLcyhx\nxdVDKhXtcnr1/H1WsTXS6aFNYk+9U8TIzmKtczKkWKYttzc28kNOX+Ia+mOSB7EN\nYu1xA3FY9tKNS7PD/SOhKGEYcYzWbvX8Eiy8oGcb3/Yy7MnpmOFO1PF/AgMBAAEC\ngYBsO+WTGct6Z9cNjQ+tl2r6OgaAm6Y2PHKjYqcS+ZI+Vq2eHtmBVCg3592114mw\nrEnAgXA59ccxxNeZgf8fIcem6aj+xzXZoPXDiRw9EPSmQEYAjEVCq40uvt+Tl+j+\n7OOND5FF2V2Y89mxUUmiO6xLrkjb2NqN86KEOC/VgbDaAQJBAN2CnpP4YZN7dijJ\nNyRV+UKLc+MO5hq02yBXvnwEYG1xYXinr4ZX4eqsTbWT6AH8BGFDNq+hI8fKYOHz\nr72FEXUCQQCOzHAsrlHqE1m/P9oEty8aKZTYnR01rWIsE4AZwGZTWw/awKq16WMh\n1+q+s7nC8Lzt90H3j7OIUGUzXTZ74QSjAkASzlAgR+og106Ez/B6iUIMQEKqeE1Y\n3xnreQeXB9gX8pRP5gyk3zky70X5sID2CitlBovSBWBAShJHnKTC9lUxAkA0Bo3T\n6YrUkko/YH8I+siBaqbdKJjMxqee0Vf5idx+AA5Nr6ZCco54dRcEdax3NohO1qfF\nDyjkwA2u4gYIqhmrAkB2ESXa2QD/rrD4r9FFT1YPYjmLi27lkqxe24fOKTsdGqvj\nqGfEkU9AWx6AJN0H/1sMhkpMkXvLplLN+opoF/Id\n-----END RSA PRIVATE KEY-----'
JWT_ACCESS_TOKEN_EXPIRES = timedelta(seconds=2)
JWT_REFRESH_TOKEN_EXPIRES = timedelta(hours=2)
# @staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
class TestingConfig(Config):
TESTING = True
class ProductionConfig(Config):
DEBUG = False
TESTING = False
config = dict(development=DevelopmentConfig,
testing=TestingConfig,
production=ProductionConfig,
default=DevelopmentConfig)
| 60.5 | 920 | 0.434671 | 262 | 5,082 | 8.343511 | 0.580153 | 0.064044 | 0.074108 | 0.076853 | 0.098353 | 0.039341 | 0.039341 | 0 | 0 | 0 | 0 | 0.054774 | 0.202479 | 5,082 | 83 | 921 | 61.228916 | 0.484579 | 0.613144 | 0 | 0 | 0 | 0.08 | 0.614402 | 0.558733 | 0 | 0 | 0 | 0 | 0 | 1 | 0.04 | false | 0.04 | 0.08 | 0 | 0.76 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
9f4e2d6cba2923378a15a234a0a15fde3d52e860 | 183 | py | Python | src/models/__init__.py | jacksonlli/learn-hippo | 7695d22e73c334b6d9df7e35cb6e30855db187fe | [
"MIT"
] | 13 | 2020-12-06T02:31:02.000Z | 2022-02-16T16:20:31.000Z | src/models/__init__.py | jacksonlli/learn-hippo | 7695d22e73c334b6d9df7e35cb6e30855db187fe | [
"MIT"
] | 1 | 2021-09-19T20:55:32.000Z | 2021-09-19T20:55:32.000Z | src/models/__init__.py | jacksonlli/learn-hippo | 7695d22e73c334b6d9df7e35cb6e30855db187fe | [
"MIT"
] | 3 | 2020-12-24T00:52:43.000Z | 2021-12-15T02:12:15.000Z | # agents
from .LCALSTM import LCALSTM
from .LCALSTM_after import LCALSTM_after
from .A2C import A2C_linear, A2C
from ._rl_helpers import compute_returns, get_reward, compute_a2c_loss
| 30.5 | 70 | 0.84153 | 28 | 183 | 5.178571 | 0.5 | 0.151724 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024691 | 0.114754 | 183 | 5 | 71 | 36.6 | 0.87037 | 0.032787 | 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 |
9f625cea81862620b03e4eb49a90321af8e9b4ab | 301 | py | Python | metashare/repository/templatetags/script_suppressed.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | 1 | 2017-07-10T08:15:07.000Z | 2017-07-10T08:15:07.000Z | metashare/repository/templatetags/script_suppressed.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | null | null | null | metashare/repository/templatetags/script_suppressed.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | 1 | 2018-07-03T07:55:56.000Z | 2018-07-03T07:55:56.000Z | from django import template
from metashare.bcp47.iana import get_suppressed_script_description
register = template.Library()
@register.filter("script_suppressed")
def script_suppressed(input):
return get_suppressed_script_description(input)
register.tag('script_suppressed', script_suppressed) | 27.363636 | 66 | 0.840532 | 36 | 301 | 6.75 | 0.5 | 0.263374 | 0.156379 | 0.246914 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007246 | 0.083056 | 301 | 11 | 67 | 27.363636 | 0.873188 | 0 | 0 | 0 | 0 | 0 | 0.112583 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0.142857 | 0.571429 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
9f6f3aba2357df7f77097598f79c63764079ce0e | 142 | py | Python | account/apps.py | andriidem308/django_02 | 6d9f624271d28ea6f53517e6144fa6b9d76598e5 | [
"MIT"
] | null | null | null | account/apps.py | andriidem308/django_02 | 6d9f624271d28ea6f53517e6144fa6b9d76598e5 | [
"MIT"
] | 1 | 2021-05-15T18:28:26.000Z | 2021-05-15T18:28:26.000Z | account/apps.py | andriidem308/django_02 | 6d9f624271d28ea6f53517e6144fa6b9d76598e5 | [
"MIT"
] | null | null | null | """Account Apps."""
from django.apps import AppConfig
class AccountConfig(AppConfig):
"""Config Account Class."""
name = 'account'
| 15.777778 | 33 | 0.676056 | 15 | 142 | 6.4 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176056 | 142 | 8 | 34 | 17.75 | 0.820513 | 0.246479 | 0 | 0 | 0 | 0 | 0.072917 | 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 |
9fc6f048cd0b009ec3d68ffc0861c831802f0240 | 158 | py | Python | exercicios025.py | Capcode98/exercicios-PYTHON3-MUNDO1 | c3d186dba25274a72ec347320e2376ac8f8f9b1f | [
"MIT"
] | null | null | null | exercicios025.py | Capcode98/exercicios-PYTHON3-MUNDO1 | c3d186dba25274a72ec347320e2376ac8f8f9b1f | [
"MIT"
] | null | null | null | exercicios025.py | Capcode98/exercicios-PYTHON3-MUNDO1 | c3d186dba25274a72ec347320e2376ac8f8f9b1f | [
"MIT"
] | null | null | null | n = input('digite seu nome completo:')
if n.find('Silva') == -1:
print('seu nome nao possui "Silva" nele')
else:
print('seu nome possui "Silva" nele') | 31.6 | 45 | 0.639241 | 25 | 158 | 4.04 | 0.6 | 0.207921 | 0.237624 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007752 | 0.183544 | 158 | 5 | 46 | 31.6 | 0.775194 | 0 | 0 | 0 | 0 | 0 | 0.566038 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 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 |
9fcdb33e28eab2d2c45243cdb7417350a368b69a | 65 | py | Python | Python/1 pengenalan python/2 komentar dan operasi matematika/2 komentar lebih dari satu baris.py | ekovegeance-com/tree | 7a429d0f35c5a71769820177f60d22e7231b4e40 | [
"Apache-2.0"
] | 3 | 2020-12-21T13:01:35.000Z | 2020-12-27T08:25:57.000Z | Python/1 pengenalan python/2 komentar dan operasi matematika/2 komentar lebih dari satu baris.py | ekovegeance-com/tree | 7a429d0f35c5a71769820177f60d22e7231b4e40 | [
"Apache-2.0"
] | 2 | 2020-12-05T23:26:16.000Z | 2020-12-27T10:21:47.000Z | Python/1 pengenalan python/2 komentar dan operasi matematika/2 komentar lebih dari satu baris.py | faizH3/faiz | c6a38717b91db8f76a0c4c4fd3168eb3ce8123ef | [
"Apache-2.0"
] | 3 | 2021-07-27T19:05:40.000Z | 2021-11-08T09:03:23.000Z | '''
seratus
dua
puluh
sembilan
juta
tiga
puluh
sembilan
ribu
'''
| 5.416667 | 8 | 0.738462 | 9 | 65 | 5.333333 | 0.777778 | 0.541667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.169231 | 65 | 11 | 9 | 5.909091 | 0.888889 | 0.861538 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4ca0a2e2a2ae08c108eb04f23b25f73d15665f7d | 1,041 | py | Python | tabular_benchmarks/interface.py | josepsmartinez/nas_benchmarks | da4e21a7179d7a54a7baddfbbd0156ab46bae4bf | [
"BSD-3-Clause"
] | null | null | null | tabular_benchmarks/interface.py | josepsmartinez/nas_benchmarks | da4e21a7179d7a54a7baddfbbd0156ab46bae4bf | [
"BSD-3-Clause"
] | null | null | null | tabular_benchmarks/interface.py | josepsmartinez/nas_benchmarks | da4e21a7179d7a54a7baddfbbd0156ab46bae4bf | [
"BSD-3-Clause"
] | null | null | null | import ConfigSpace
import numpy as np
class TabularNasBenchmark(object):
def __init__(self, seed=42):
self.seed = seed
self.reset_tracker()
@staticmethod
def get_configuration_space(seed=None):
raise NotImplementedError()
def get_best_configuration(self):
raise NotImplementedError()
def get_benchmark_budget(self):
raise NotImplementedError()
def objective_function(self, config):
raise NotImplementedError()
def objective_function_learning_curve(self, config):
raise NotImplementedError()
def objective_function_deterministic(self, config, idx=0):
raise NotImplementedError()
def objective_function_test(self, config):
raise NotImplementedError()
def get_results(self):
raise NotImplementedError()
def reset_tracker(self):
self.rng = np.random.RandomState(self.seed)
def __enter__(self):
self.reset_tracker()
return self
def __exit__(self):
self.reset_tracker()
| 23.659091 | 62 | 0.68684 | 108 | 1,041 | 6.333333 | 0.37963 | 0.280702 | 0.315789 | 0.210526 | 0.340643 | 0.157895 | 0.157895 | 0 | 0 | 0 | 0 | 0.003759 | 0.233429 | 1,041 | 43 | 63 | 24.209302 | 0.853383 | 0 | 0 | 0.366667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.066667 | 0 | 0.533333 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4cbfe60a07a462fb41ea12cd29bda8eb5108e222 | 189 | py | Python | todo_app/serializers.py | birnesh/todo | d99b5be125399647594cdd03562d26cf544d12f9 | [
"MIT"
] | null | null | null | todo_app/serializers.py | birnesh/todo | d99b5be125399647594cdd03562d26cf544d12f9 | [
"MIT"
] | null | null | null | todo_app/serializers.py | birnesh/todo | d99b5be125399647594cdd03562d26cf544d12f9 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from todo_app import models
class TodoSerializer(serializers.ModelSerializer):
class Meta:
model = models.Todo
fields = '__all__' | 27 | 50 | 0.746032 | 21 | 189 | 6.428571 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.201058 | 189 | 7 | 51 | 27 | 0.89404 | 0 | 0 | 0 | 0 | 0 | 0.036842 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 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 |
4cea0ed6394c68ae0600a436cde22cdca14dcee3 | 644 | py | Python | src/lucrum/algo/__init__.py | achmand/ari5123_assignment | 7038aa829d2b4b4a531ee168b204357609fb3207 | [
"MIT"
] | 8 | 2020-01-09T05:40:35.000Z | 2022-01-10T18:20:13.000Z | src/lucrum/algo/__init__.py | achmand/ari5123_assignment | 7038aa829d2b4b4a531ee168b204357609fb3207 | [
"MIT"
] | null | null | null | src/lucrum/algo/__init__.py | achmand/ari5123_assignment | 7038aa829d2b4b4a531ee168b204357609fb3207 | [
"MIT"
] | 3 | 2019-07-12T06:19:01.000Z | 2021-12-11T00:18:31.000Z | #from .emacrossover import (EMACrossoverAlgo)
from .macrossover import (MACrossoverAlgo) # moving average crossover strategy
from .rsisimple import (SimpleRsiAlgo) # simple rsi strategy
from .buynhold import (BuyHoldStrategy) # buy and hold strategy
from .mlalgo import (XgbBoostAlgo, RandomForestAlgo, LogRegAlgo) # ml/ai strategies
from .williamrsimple import(SimpleWilliamRAlgo) # william R strategy
from .combinedta import(CombinedTaAlgo) # combination of all indicators
from .natr import (RsiNatrAlgo) # strategies with a volatility measure
from .finstats import(dist_moments, sharpe_ratio) # finance functions
| 64.4 | 84 | 0.784161 | 69 | 644 | 7.289855 | 0.710145 | 0.095427 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153727 | 644 | 9 | 85 | 71.555556 | 0.922936 | 0.381988 | 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 |
4cf243511f4fa9d1bfb28df03b2e11f7ea5244f5 | 618 | py | Python | core/src/zeit/content/article/edit/newslettersignup.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 5 | 2019-05-16T09:51:29.000Z | 2021-05-31T09:30:03.000Z | core/src/zeit/content/article/edit/newslettersignup.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 107 | 2019-05-24T12:19:02.000Z | 2022-03-23T15:05:56.000Z | core/src/zeit/content/article/edit/newslettersignup.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 3 | 2020-08-14T11:01:17.000Z | 2022-01-08T17:32:19.000Z | from zeit.cms.i18n import MessageFactory as _
import grokcore.component as grok
import zeit.content.article.edit.block
import zeit.content.article.edit.interfaces
import zeit.content.modules.newslettersignup
@grok.implementer(zeit.content.article.edit.interfaces.INewsletterSignup)
class NewsletterSignup(
zeit.content.modules.newslettersignup.NewsletterSignup,
zeit.content.article.edit.block.Block):
type = 'newslettersignup'
class NewsletterSignupBlockFactory(
zeit.content.article.edit.block.BlockFactory):
produces = NewsletterSignup
title = _('Newsletter Signup block')
| 29.428571 | 73 | 0.789644 | 66 | 618 | 7.363636 | 0.409091 | 0.158436 | 0.185185 | 0.226337 | 0.323045 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003697 | 0.124595 | 618 | 20 | 74 | 30.9 | 0.89464 | 0 | 0 | 0 | 0 | 0 | 0.063107 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.357143 | 0 | 0.714286 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
9818017691b02ca682ad425b71a544eda01e6eae | 1,223 | py | Python | env/Lib/site-packages/OpenGL/raw/GLES2/EXT/semaphore_win32.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/raw/GLES2/EXT/semaphore_win32.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/raw/GLES2/EXT/semaphore_win32.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GLES2_EXT_semaphore_win32'
def _f( function ):
return _p.createFunction( function,_p.PLATFORM.GLES2,'GLES2_EXT_semaphore_win32',error_checker=_errors._error_checker)
GL_D3D12_FENCE_VALUE_EXT=_C('GL_D3D12_FENCE_VALUE_EXT',0x9595)
GL_DEVICE_LUID_EXT=_C('GL_DEVICE_LUID_EXT',0x9599)
GL_DEVICE_NODE_MASK_EXT=_C('GL_DEVICE_NODE_MASK_EXT',0x959A)
GL_HANDLE_TYPE_D3D12_FENCE_EXT=_C('GL_HANDLE_TYPE_D3D12_FENCE_EXT',0x9594)
GL_HANDLE_TYPE_OPAQUE_WIN32_EXT=_C('GL_HANDLE_TYPE_OPAQUE_WIN32_EXT',0x9587)
GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT=_C('GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT',0x9588)
GL_LUID_SIZE_EXT=_C('GL_LUID_SIZE_EXT',8)
@_f
@_p.types(None,_cs.GLuint,_cs.GLenum,ctypes.c_void_p)
def glImportSemaphoreWin32HandleEXT(semaphore,handleType,handle):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLenum,ctypes.c_void_p)
def glImportSemaphoreWin32NameEXT(semaphore,handleType,name):pass
| 45.296296 | 122 | 0.843827 | 201 | 1,223 | 4.631841 | 0.348259 | 0.030075 | 0.045113 | 0.077336 | 0.428571 | 0.264232 | 0.182599 | 0.090226 | 0.090226 | 0.090226 | 0 | 0.055798 | 0.062142 | 1,223 | 26 | 123 | 47.038462 | 0.755885 | 0.081766 | 0 | 0.181818 | 1 | 0 | 0.203405 | 0.172939 | 0 | 0 | 0.032258 | 0 | 0 | 1 | 0.136364 | false | 0.090909 | 0.363636 | 0.045455 | 0.545455 | 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 |
e21d1084607b751449b5b300dd5f6df65015ef89 | 105 | py | Python | pgbouncer/datadog_checks/pgbouncer/__init__.py | chotiwat/integrations-core | 57a4437790cafcb769e120aa64d84aaecbf6a414 | [
"BSD-3-Clause"
] | 2 | 2019-04-03T17:21:38.000Z | 2020-02-04T16:28:05.000Z | pgbouncer/datadog_checks/pgbouncer/__init__.py | chotiwat/integrations-core | 57a4437790cafcb769e120aa64d84aaecbf6a414 | [
"BSD-3-Clause"
] | 10 | 2018-02-27T19:06:07.000Z | 2021-08-30T03:23:26.000Z | pgbouncer/datadog_checks/pgbouncer/__init__.py | chotiwat/integrations-core | 57a4437790cafcb769e120aa64d84aaecbf6a414 | [
"BSD-3-Clause"
] | 6 | 2018-01-09T21:37:20.000Z | 2020-05-26T09:28:09.000Z | from . import pgbouncer
PgBouncer = pgbouncer.PgBouncer
__version__ = "1.1.0"
__all__ = ['pgbouncer']
| 13.125 | 31 | 0.72381 | 12 | 105 | 5.666667 | 0.583333 | 0.794118 | 0.794118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033708 | 0.152381 | 105 | 7 | 32 | 15 | 0.730337 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 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 |
e24a6f718cd9c26ad4a9cde7210d56c9a3b63e50 | 188 | py | Python | text/letter/texture/__init__.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/letter/texture/__init__.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/letter/texture/__init__.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | """
*Character Texture*
A character texture type applies additional glyph transforms.
"""
from .._geometric import
class CharacterTexture(
CharacterGeometric,
):
pass
| 11.75 | 63 | 0.702128 | 17 | 188 | 7.705882 | 0.882353 | 0.244275 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.218085 | 188 | 15 | 64 | 12.533333 | 0.891156 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.2 | 0.2 | null | null | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
2c4929ad9fcdcce7ba66898bf697a08b54e65903 | 89 | py | Python | codes/graph/split_information.py | NilLau/NilLau.github.io | e55768be0be4d6549b24c702554c11e64958d4c7 | [
"MIT"
] | null | null | null | codes/graph/split_information.py | NilLau/NilLau.github.io | e55768be0be4d6549b24c702554c11e64958d4c7 | [
"MIT"
] | 6 | 2019-06-20T10:05:10.000Z | 2019-07-08T04:53:01.000Z | codes/graph/split_information.py | 117ami/117ami.github.io | e55768be0be4d6549b24c702554c11e64958d4c7 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0.1, 1, 0.01)
y = -
| 14.833333 | 32 | 0.651685 | 18 | 89 | 3.222222 | 0.722222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 0.224719 | 89 | 5 | 33 | 17.8 | 0.753623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.5 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
2c59654a98772a5628d67fcc1ec2a7a021802336 | 304 | py | Python | model/decode_heads/unet/__init__.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | model/decode_heads/unet/__init__.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | model/decode_heads/unet/__init__.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | '''
Author: Liu Xin
Date: 2021-11-30 15:15:28
LastEditors: Liu Xin
LastEditTime: 2021-11-30 20:09:35
Description: file content
FilePath: /CVMI_Sementic_Segmentation/model/decode_heads/unet/__init__.py
'''
from model.decode_heads.unet.unet import Unet
from model.decode_heads.unet.enc_unet import EncUnet
| 27.636364 | 73 | 0.805921 | 50 | 304 | 4.7 | 0.62 | 0.140426 | 0.204255 | 0.255319 | 0.204255 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101083 | 0.088816 | 304 | 10 | 74 | 30.4 | 0.747292 | 0.644737 | 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 |
2cbcb3b2126689479dddaf94661619d83cbe8171 | 33 | py | Python | grortir/test/externals/pyswarm/__init__.py | wojtekPi/grortir | 0ef8b495527a4f3861e5df5db756d0ee3ed4aa6f | [
"MIT"
] | null | null | null | grortir/test/externals/pyswarm/__init__.py | wojtekPi/grortir | 0ef8b495527a4f3861e5df5db756d0ee3ed4aa6f | [
"MIT"
] | null | null | null | grortir/test/externals/pyswarm/__init__.py | wojtekPi/grortir | 0ef8b495527a4f3861e5df5db756d0ee3ed4aa6f | [
"MIT"
] | null | null | null | """Package for tests pyswarm."""
| 16.5 | 32 | 0.666667 | 4 | 33 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 33 | 1 | 33 | 33 | 0.758621 | 0.787879 | 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 |
2cbe952b2a9b2a8c49f81ad9bb8035bd93e7e39b | 203 | py | Python | ge_sm/common/secrets.py | girleffect/ge-sm | 8cf8d9d060b1ca299fd05b9ae2307410a4fb9d2a | [
"BSD-3-Clause"
] | null | null | null | ge_sm/common/secrets.py | girleffect/ge-sm | 8cf8d9d060b1ca299fd05b9ae2307410a4fb9d2a | [
"BSD-3-Clause"
] | 1 | 2021-02-08T20:33:47.000Z | 2021-02-08T20:33:47.000Z | ge_sm/common/secrets.py | girleffect/ge-sm | 8cf8d9d060b1ca299fd05b9ae2307410a4fb9d2a | [
"BSD-3-Clause"
] | null | null | null | import os
# redshift cluster
rs_pwd = os.environ.setdefault('REDSHIFT_PWD', '****')
rs_dsn = os.environ.setdefault('REDSHIFT_DSN', '****')
rs_usr = os.environ.setdefault('REDSHIFT_USR', 'dataplatform')
| 29 | 62 | 0.719212 | 26 | 203 | 5.384615 | 0.423077 | 0.192857 | 0.407143 | 0.578571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08867 | 203 | 6 | 63 | 33.833333 | 0.756757 | 0.078818 | 0 | 0 | 0 | 0 | 0.302703 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 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 | 0 | 0 | 4 |
2cc5916f1d9b5707fdb83d347b394775312325fa | 229 | py | Python | asynciox/coroutinex.py | relax-space/coroutine-first | 0cdf078b8bd57e6a13961930888f8c0c4bd6c5a6 | [
"Apache-2.0"
] | null | null | null | asynciox/coroutinex.py | relax-space/coroutine-first | 0cdf078b8bd57e6a13961930888f8c0c4bd6c5a6 | [
"Apache-2.0"
] | null | null | null | asynciox/coroutinex.py | relax-space/coroutine-first | 0cdf078b8bd57e6a13961930888f8c0c4bd6c5a6 | [
"Apache-2.0"
] | null | null | null | from asynciox.typex import CoroutineType, GeneratorType
_COROUTINE_TYPES = (GeneratorType, CoroutineType)
def iscoroutine(obj):
"""Return True if obj is a coroutine object."""
return isinstance(obj, _COROUTINE_TYPES)
| 22.9 | 55 | 0.768559 | 26 | 229 | 6.615385 | 0.692308 | 0.162791 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148472 | 229 | 9 | 56 | 25.444444 | 0.882051 | 0.179039 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 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 |
e2c5b5ab0a3c7cd6b9a2edb021c1b36b6bcd85cb | 62 | py | Python | script.py | mdpanna/python-zip-crack | f522300b41cd51cf13d4e4504933ddb1e5072425 | [
"MIT"
] | null | null | null | script.py | mdpanna/python-zip-crack | f522300b41cd51cf13d4e4504933ddb1e5072425 | [
"MIT"
] | null | null | null | script.py | mdpanna/python-zip-crack | f522300b41cd51cf13d4e4504933ddb1e5072425 | [
"MIT"
] | null | null | null | # this is my script
# python zip crack
print('hello world')
| 12.4 | 20 | 0.693548 | 10 | 62 | 4.3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.209677 | 62 | 4 | 21 | 15.5 | 0.877551 | 0.564516 | 0 | 0 | 0 | 0 | 0.458333 | 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 |
e2e1c4c32838cb031522f54b039837036b6fbbe0 | 11,152 | py | Python | core/recc/database/postgresql/query/views.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | 3 | 2021-06-20T02:24:10.000Z | 2022-01-26T23:55:33.000Z | core/recc/database/postgresql/query/views.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | core/recc/database/postgresql/query/views.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from recc.variables.database import (
TABLE_INFO,
TABLE_USER,
# TABLE_GROUP,
# TABLE_PROJECT,
# TABLE_TASK,
# TABLE_LAYOUT,
# TABLE_WIDGET,
# TABLE_GROUP_MEMBER,
VIEW_INFO_DB_VERSION,
VIEW_USER_ADMIN,
VIEW_USER_ADMIN_COUNT,
# VIEW_USER_GROUP,
# VIEW_USER_PROJECT,
# VIEW_USER_TASK,
# VIEW_USER_LAYOUT,
# VIEW_USER_WIDGET,
# VIEW_GROUP_PROJECT,
# VIEW_GROUP_TASK,
# VIEW_GROUP_LAYOUT,
# VIEW_GROUP_WIDGET,
# VIEW_PROJECT_TASK,
# VIEW_PROJECT_LAYOUT,
# VIEW_PROJECT_WIDGET,
# VIEW_LAYOUT_WIDGET,
INFO_KEY_RECC_DB_VERSION,
)
CREATE_VIEW_INFO_DB_VERSION = f"""
CREATE OR REPLACE VIEW {VIEW_INFO_DB_VERSION}
AS SELECT
value AS version
FROM
{TABLE_INFO}
WHERE
key LIKE '{INFO_KEY_RECC_DB_VERSION}';
"""
CREATE_VIEW_USER_ADMIN = f"""
CREATE OR REPLACE VIEW {VIEW_USER_ADMIN}
AS SELECT
uid, username, email
FROM
{TABLE_USER}
WHERE
is_admin=TRUE;
"""
CREATE_VIEW_USER_ADMIN_COUNT = f"""
CREATE OR REPLACE VIEW {VIEW_USER_ADMIN_COUNT}
AS SELECT
count(uid) AS count
FROM
{TABLE_USER}
WHERE
is_admin=TRUE;
"""
# CREATE_VIEW_USER_GROUP = f"""
# CREATE OR REPLACE VIEW {VIEW_USER_GROUP}
# AS SELECT
# u.uid AS u_uid,
# u.username AS u_name,
# u.email AS u_email,
# g.uid AS g_uid,
# g.slug AS g_slug,
# g.description AS g_description,
# g.extra AS g_extra,
# g.created_at AS g_created_at,
# g.updated_at AS g_updated_at
# FROM
# {TABLE_USER} u
# INNER JOIN {TABLE_GROUP_MEMBER} gm ON gm.user_uid=u.uid
# INNER JOIN {TABLE_GROUP} g ON g.uid=gm.group_uid;
# """
#
# CREATE_VIEW_USER_PROJECT = f"""
# CREATE OR REPLACE VIEW {VIEW_USER_PROJECT}
# AS SELECT
# u.uid AS u_uid,
# u.username AS u_name,
# u.email AS u_email,
# g.uid AS g_uid,
# g.name AS g_name,
# p.uid AS p_uid,
# p.name AS p_name,
# p.description AS p_description,
# p.extra AS p_extra,
# p.created_at AS p_created_at,
# p.updated_at AS p_updated_at
# FROM
# {TABLE_USER} u
# INNER JOIN {TABLE_GROUP_MEMBER} gm ON gm.user_uid=u.uid
# INNER JOIN {TABLE_GROUP} g ON g.uid=gm.group_uid
# INNER JOIN {TABLE_PROJECT} p ON p.group_uid=g.uid;
# """
#
# CREATE_VIEW_USER_TASK = f"""
# CREATE OR REPLACE VIEW {VIEW_USER_TASK}
# AS SELECT
# u.uid AS u_uid,
# u.username AS u_name,
# u.email AS u_email,
# g.uid AS g_uid,
# g.name AS g_name,
# p.uid AS p_uid,
# p.name AS p_name,
# t.uid AS t_uid,
# t.name AS t_name,
# t.description AS t_description,
# t.extra AS t_extra,
# t.created_at AS t_created_at,
# t.updated_at AS t_updated_at
# FROM
# {TABLE_USER} u
# INNER JOIN {TABLE_GROUP_MEMBER} gm ON gm.user_uid=u.uid
# INNER JOIN {TABLE_GROUP} g ON g.uid=gm.group_uid
# INNER JOIN {TABLE_PROJECT} p ON p.group_uid=g.uid
# INNER JOIN {TABLE_TASK} t ON t.project_uid=p.uid;
# """
#
# CREATE_VIEW_USER_LAYOUT = f"""
# CREATE OR REPLACE VIEW {VIEW_USER_LAYOUT}
# AS SELECT
# u.uid AS u_uid,
# u.username AS u_name,
# u.email AS u_email,
# g.uid AS g_uid,
# g.name AS g_name,
# p.uid AS p_uid,
# p.name AS p_name,
# l.uid AS l_uid,
# l.name AS l_name,
# l.description AS l_description,
# l.extra AS l_extra,
# l.created_at AS l_created_at,
# l.updated_at AS l_updated_at
# FROM
# {TABLE_USER} u
# INNER JOIN {TABLE_GROUP_MEMBER} gm ON gm.user_uid=u.uid
# INNER JOIN {TABLE_GROUP} g ON g.uid=gm.group_uid
# INNER JOIN {TABLE_PROJECT} p ON p.group_uid=g.uid
# INNER JOIN {TABLE_LAYOUT} l ON l.project_uid=p.uid;
# """
#
# CREATE_VIEW_USER_WIDGET = f"""
# CREATE OR REPLACE VIEW {VIEW_USER_WIDGET}
# AS SELECT
# u.uid AS u_uid,
# u.username AS u_name,
# u.email AS u_email,
# g.uid AS g_uid,
# g.name AS g_name,
# p.uid AS p_uid,
# p.name AS p_name,
# l.uid AS l_uid,
# l.name AS l_name,
# w.uid AS w_uid,
# w.name AS w_name,
# w.description AS w_description,
# w.extra AS w_extra,
# w.type_name AS w_type_name,
# w.pos_x1 AS w_pos_x1,
# w.pos_y1 AS w_pos_y1,
# w.pos_x2 AS w_pos_x2,
# w.pos_y2 AS w_pos_y2,
# w.z_order AS w_z_order,
# w.created_at AS w_created_at,
# w.updated_at AS w_updated_at
# FROM
# {TABLE_USER} u
# INNER JOIN {TABLE_GROUP_MEMBER} gm ON gm.user_uid=u.uid
# INNER JOIN {TABLE_GROUP} g ON g.uid=gm.group_uid
# INNER JOIN {TABLE_PROJECT} p ON p.group_uid=g.uid
# INNER JOIN {TABLE_LAYOUT} l ON l.project_uid=p.uid
# INNER JOIN {TABLE_WIDGET} w ON w.layout_uid=l.uid;
# """
#
# CREATE_VIEW_GROUP_PROJECT = f"""
# CREATE OR REPLACE VIEW {VIEW_GROUP_PROJECT}
# AS SELECT
# g.uid AS g_uid,
# g.name AS g_name,
# p.uid AS p_uid,
# p.name AS p_name,
# p.description AS p_description,
# p.extra AS p_extra,
# p.created_at AS p_created_at,
# p.updated_at AS p_updated_at
# FROM
# {TABLE_GROUP} g
# INNER JOIN {TABLE_PROJECT} p ON p.group_uid=g.uid;
# """
#
# CREATE_VIEW_GROUP_TASK = f"""
# CREATE OR REPLACE VIEW {VIEW_GROUP_TASK}
# AS SELECT
# g.uid AS g_uid,
# g.name AS g_name,
# p.uid AS p_uid,
# p.name AS p_name,
# t.uid AS t_uid,
# t.name AS t_name,
# t.description AS t_description,
# t.extra AS t_extra,
# t.created_at AS t_created_at,
# t.updated_at AS t_updated_at
# FROM
# {TABLE_GROUP} g
# INNER JOIN {TABLE_PROJECT} p ON p.group_uid=g.uid
# INNER JOIN {TABLE_TASK} t ON t.project_uid=p.uid;
# """
#
# CREATE_VIEW_GROUP_LAYOUT = f"""
# CREATE OR REPLACE VIEW {VIEW_GROUP_LAYOUT}
# AS SELECT
# g.uid AS g_uid,
# g.name AS g_name,
# p.uid AS p_uid,
# p.name AS p_name,
# l.uid AS l_uid,
# l.name AS l_name,
# l.description AS l_description,
# l.extra AS l_extra,
# l.created_at AS l_created_at,
# l.updated_at AS l_updated_at
# FROM
# {TABLE_GROUP} g
# INNER JOIN {TABLE_PROJECT} p ON p.group_uid=g.uid
# INNER JOIN {TABLE_LAYOUT} l ON l.project_uid=p.uid;
# """
#
# CREATE_VIEW_GROUP_WIDGET = f"""
# CREATE OR REPLACE VIEW {VIEW_GROUP_WIDGET}
# AS SELECT
# g.uid AS g_uid,
# g.name AS g_name,
# p.uid AS p_uid,
# p.name AS p_name,
# l.uid AS l_uid,
# l.name AS l_name,
# w.uid AS w_uid,
# w.name AS w_name,
# w.description AS w_description,
# w.extra AS w_extra,
# w.type_name AS w_type_name,
# w.pos_x1 AS w_pos_x1,
# w.pos_y1 AS w_pos_y1,
# w.pos_x2 AS w_pos_x2,
# w.pos_y2 AS w_pos_y2,
# w.z_order AS w_z_order,
# w.created_at AS w_created_at,
# w.updated_at AS w_updated_at
# FROM
# {TABLE_GROUP} g
# INNER JOIN {TABLE_PROJECT} p ON p.group_uid=g.uid
# INNER JOIN {TABLE_LAYOUT} l ON l.project_uid=p.uid
# INNER JOIN {TABLE_WIDGET} w ON w.layout_uid=l.uid;
# """
#
# CREATE_VIEW_PROJECT_TASK = f"""
# CREATE OR REPLACE VIEW {VIEW_PROJECT_TASK}
# AS SELECT
# p.uid AS p_uid,
# p.name AS p_name,
# t.uid AS t_uid,
# t.name AS t_name,
# t.description AS t_description,
# t.extra AS t_extra,
# t.created_at AS t_created_at,
# t.updated_at AS t_updated_at
# FROM
# {TABLE_PROJECT} p
# INNER JOIN {TABLE_TASK} t ON t.project_uid=p.uid;
# """
#
# CREATE_VIEW_PROJECT_LAYOUT = f"""
# CREATE OR REPLACE VIEW {VIEW_PROJECT_LAYOUT}
# AS SELECT
# p.uid AS p_uid,
# p.name AS p_name,
# l.uid AS l_uid,
# l.name AS l_name,
# l.description AS l_description,
# l.extra AS l_extra,
# l.created_at AS l_created_at,
# l.updated_at AS l_updated_at
# FROM
# {TABLE_PROJECT} p
# INNER JOIN {TABLE_LAYOUT} l ON l.project_uid=p.uid;
# """
#
# CREATE_VIEW_PROJECT_WIDGET = f"""
# CREATE OR REPLACE VIEW {VIEW_PROJECT_WIDGET}
# AS SELECT
# p.uid AS p_uid,
# p.name AS p_name,
# l.uid AS l_uid,
# l.name AS l_name,
# w.uid AS w_uid,
# w.name AS w_name,
# w.description AS w_description,
# w.extra AS w_extra,
# w.type_name AS w_type_name,
# w.pos_x1 AS w_pos_x1,
# w.pos_y1 AS w_pos_y1,
# w.pos_x2 AS w_pos_x2,
# w.pos_y2 AS w_pos_y2,
# w.z_order AS w_z_order,
# w.created_at AS w_created_at,
# w.updated_at AS w_updated_at
# FROM
# {TABLE_PROJECT} p
# INNER JOIN {TABLE_LAYOUT} l ON l.project_uid=p.uid
# INNER JOIN {TABLE_WIDGET} w ON w.layout_uid=l.uid;
# """
#
# CREATE_VIEW_LAYOUT_WIDGET = f"""
# CREATE OR REPLACE VIEW {VIEW_LAYOUT_WIDGET}
# AS SELECT
# l.uid AS l_uid,
# l.name AS l_name,
# w.uid AS w_uid,
# w.name AS w_name,
# w.description AS w_description,
# w.extra AS w_extra,
# w.type_name AS w_type_name,
# w.pos_x1 AS w_pos_x1,
# w.pos_y1 AS w_pos_y1,
# w.pos_x2 AS w_pos_x2,
# w.pos_y2 AS w_pos_y2,
# w.z_order AS w_z_order,
# w.created_at AS w_created_at,
# w.updated_at AS w_updated_at
# FROM
# {TABLE_LAYOUT} l
# INNER JOIN {TABLE_WIDGET} w ON w.layout_uid=l.uid;
# """
CREATE_VIEWS = (
CREATE_VIEW_INFO_DB_VERSION,
CREATE_VIEW_USER_ADMIN,
CREATE_VIEW_USER_ADMIN_COUNT,
# CREATE_VIEW_USER_GROUP,
# CREATE_VIEW_USER_PROJECT,
# CREATE_VIEW_USER_TASK,
# CREATE_VIEW_USER_LAYOUT,
# CREATE_VIEW_USER_WIDGET,
# CREATE_VIEW_GROUP_PROJECT,
# CREATE_VIEW_GROUP_TASK,
# CREATE_VIEW_GROUP_LAYOUT,
# CREATE_VIEW_GROUP_WIDGET,
# CREATE_VIEW_PROJECT_TASK,
# CREATE_VIEW_PROJECT_LAYOUT,
# CREATE_VIEW_PROJECT_WIDGET,
# CREATE_VIEW_LAYOUT_WIDGET,
)
DROP_VIEW_INFO_VERSION = f"DROP VIEW IF EXISTS {VIEW_INFO_DB_VERSION};"
DROP_VIEW_USER_ADMIN = f"DROP VIEW IF EXISTS {VIEW_USER_ADMIN};"
DROP_VIEW_USER_ADMIN_COUNT = f"DROP VIEW IF EXISTS {VIEW_USER_ADMIN_COUNT};"
# DROP_VIEW_USER_GROUP = f"DROP VIEW IF EXISTS {VIEW_USER_GROUP};"
# DROP_VIEW_USER_PROJECT = f"DROP VIEW IF EXISTS {VIEW_USER_PROJECT};"
# DROP_VIEW_USER_TASK = f"DROP VIEW IF EXISTS {VIEW_USER_TASK};"
# DROP_VIEW_USER_LAYOUT = f"DROP VIEW IF EXISTS {VIEW_USER_LAYOUT};"
# DROP_VIEW_USER_WIDGET = f"DROP VIEW IF EXISTS {VIEW_USER_WIDGET};"
# DROP_VIEW_GROUP_PROJECT = f"DROP VIEW IF EXISTS {VIEW_GROUP_PROJECT};"
# DROP_VIEW_GROUP_TASK = f"DROP VIEW IF EXISTS {VIEW_GROUP_TASK};"
# DROP_VIEW_GROUP_LAYOUT = f"DROP VIEW IF EXISTS {VIEW_GROUP_LAYOUT};"
# DROP_VIEW_GROUP_WIDGET = f"DROP VIEW IF EXISTS {VIEW_GROUP_WIDGET};"
# DROP_VIEW_PROJECT_TASK = f"DROP VIEW IF EXISTS {VIEW_PROJECT_TASK};"
# DROP_VIEW_PROJECT_LAYOUT = f"DROP VIEW IF EXISTS {VIEW_PROJECT_LAYOUT};"
# DROP_VIEW_PROJECT_WIDGET = f"DROP VIEW IF EXISTS {VIEW_PROJECT_WIDGET};"
# DROP_VIEW_LAYOUT_WIDGET = f"DROP VIEW IF EXISTS {VIEW_LAYOUT_WIDGET};"
DROP_VIEWS = (
DROP_VIEW_INFO_VERSION,
DROP_VIEW_USER_ADMIN,
DROP_VIEW_USER_ADMIN_COUNT,
# DROP_VIEW_USER_GROUP,
# DROP_VIEW_USER_PROJECT,
# DROP_VIEW_USER_TASK,
# DROP_VIEW_USER_LAYOUT,
# DROP_VIEW_USER_WIDGET,
# DROP_VIEW_GROUP_PROJECT,
# DROP_VIEW_GROUP_TASK,
# DROP_VIEW_GROUP_LAYOUT,
# DROP_VIEW_GROUP_WIDGET,
# DROP_VIEW_PROJECT_TASK,
# DROP_VIEW_PROJECT_LAYOUT,
# DROP_VIEW_PROJECT_WIDGET,
# DROP_VIEW_LAYOUT_WIDGET,
)
| 28.161616 | 76 | 0.669835 | 1,966 | 11,152 | 3.46236 | 0.033571 | 0.057588 | 0.063758 | 0.044954 | 0.847363 | 0.83326 | 0.821213 | 0.617306 | 0.584692 | 0.583517 | 0 | 0.003819 | 0.225072 | 11,152 | 395 | 77 | 28.232911 | 0.783846 | 0.821915 | 0 | 0.333333 | 0 | 0 | 0.32017 | 0.073512 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.020833 | 0 | 0.020833 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e2f30e11652f7f220d44090eef76e338ae43a2d1 | 333 | py | Python | nodeodm_proxy/urls.py | IS-AgroSmart/MVP | b347e7c846a9a29584a6baee0b825381d5bc62a3 | [
"CNRI-Python"
] | null | null | null | nodeodm_proxy/urls.py | IS-AgroSmart/MVP | b347e7c846a9a29584a6baee0b825381d5bc62a3 | [
"CNRI-Python"
] | 140 | 2020-01-21T15:42:29.000Z | 2021-08-21T18:04:19.000Z | nodeodm_proxy/urls.py | IS-AgroSmart/MVP | b347e7c846a9a29584a6baee0b825381d5bc62a3 | [
"CNRI-Python"
] | 1 | 2019-12-13T21:47:57.000Z | 2019-12-13T21:47:57.000Z | from django.urls import path
from nodeodm_proxy import views
urlpatterns = [
path('task/<uuid:uuid>/info', views.task_info, name="nodeodm_proxy_task_info"),
path('task/<uuid:uuid>/output', views.task_output, name="nodeodm_proxy_task_output"),
path('task/cancel', views.cancel_task, name="nodeodm_proxy_task_cancel"),
]
| 33.3 | 89 | 0.750751 | 48 | 333 | 4.9375 | 0.3125 | 0.202532 | 0.202532 | 0.253165 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105105 | 333 | 9 | 90 | 37 | 0.795302 | 0 | 0 | 0 | 0 | 0 | 0.384384 | 0.351351 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e2f810f9dbff5b678d398ea5184d86602606fcff | 20,470 | py | Python | ztp/migrations/0002_initial_data.py | amigne/ZosTeroPs | d76023faa0cba8ff3f01018ca252969df86dcf60 | [
"MIT"
] | 4 | 2021-03-18T12:29:10.000Z | 2022-01-26T10:03:12.000Z | ztp/migrations/0002_initial_data.py | amigne/ZosTeroPs | d76023faa0cba8ff3f01018ca252969df86dcf60 | [
"MIT"
] | 7 | 2021-02-06T09:13:57.000Z | 2021-03-19T21:09:59.000Z | ztp/migrations/0002_initial_data.py | amigne/ZosTeroPs | d76023faa0cba8ff3f01018ca252969df86dcf60 | [
"MIT"
] | null | null | null | from django.db import migrations
def populate_ztp_scripts(apps, schema_editor):
pass
# ZtpScript = apps.get_model('ztp', 'ZtpScript')
# ztp_script = ZtpScript(
# name='ios-xe.py',
# accept_query_string=False,
# description='Cisco IOS XE ZTP bootstrap script. Based on the work of Tim Dorssers.',
# template='""" Zero-Touch Provisioning Script\nThis script downloads and installs software, performs stack renumbering, applies\na configuration template with $-based placeholders for variable substitutions\nand can execute commands upon script completion, such as smart licensing\nregistration. A simple web server can be used to serve the script and software\nto the device and standard syslog server can be used for script monitoring.\nFinally, a DHCP server configured for option 67 is required.\n\nAdapt the SYSLOG, JSON and DATA constants to your needs.\n\nSupported platforms, software versions and other details can be found at:\nhttps://cs.co/ztp_provisioning\n\nAuthor: Tim Dorssers\nVersion: 1.1\n"""\n\nimport os\nimport re\nimport cli\nimport sys\nimport json\nimport time\nimport base64\nfrom string import Template\nfrom xml.dom import minidom\ntry:\n from urlparse import urljoin\nexcept ImportError:\n from urllib.parse import urljoin\n\n##### CONSTANTS ################################################################\n\nSYSLOG = \'{{ SYSLOG }}\' # Syslog IP address string, empty string disables syslog\nLOGAPI = \'{{ LOGAPI }}\' # URL to log API, empty string disables\n\n# JSON is a string with URL of the JSON encoded DATA object as specified below.\n# Empty string disables downloading of external device data.\nJSON = \'{{ JSON }}\'\n\n# DATA is a list of dicts that defines device data. To specify device defaults,\n# omit the key named \'stack\' from one dict. Empty list disables the internal\n# data of the script. Valid keys and values are:\n# \'stack\' : dict with target switch number as key and serial number as value\n# \'version\' : string with target version used to determine if upgrade is needed\n# \'base_url\': string with base URL to optionally join with install/config URL\n# \'install\' : string with URL of target IOS to download\n# \'config\' : string with URL of configuration template to download\n# \'subst\' : dict with keys that match the placeholders in the template\n# \'cli\' : string of final IOS commands, or Python if within {% templatetag openvariable %}...{% templatetag closevariable %}\n# \'save\' : boolean to indicate to save configuration at script completion\n# \'template\': string holding configuration template with $-based placeholders\nDATA = []\n\n##### GLOBALS ##################################################################\n\nztp = dict(logbuf=\'\')\n\n##### CLASSES ##################################################################\n\nclass Stack():\n """ Object with matching device data. Provides attribute-like access """\n def __init__(self, data, serials):\n """ Initializes object with data and serials """\n # absence of stack key indicates defaults dict\n self.defaults = next((dct for dct in data if not \'stack\' in dct), {})\n # find dict with at least one common serial number in stack dict\n self.stack_dict = next((dct for dct in data if \'stack\' in dct\n and len(set(dct[\'stack\'].values())\n & set(serials.values()))), {})\n\n def __getattr__(self, name):\n """ x.__getattr__(y) <==> x.y """\n return self.stack_dict.get(name, self.defaults.get(name, None))\n\n##### FUNCTIONS ################################################################\n\ndef log(severity, message):\n """ Sends string representation of message to stdout and IOS logging """\n ztp[\'logbuf\'] += \'\\n\' + str(message)\n print(\'\\n%s\' % str(message))\n sys.stdout.flush() # force writing everything in the buffer to the terminal\n if SYSLOG:\n for line in str(message).splitlines():\n cli.execute(\'send log %d "%s"\' % (severity, line))\n\ndef get_serials():\n """ Returns a dict with switch number as key and serial number as value """\n inventory = cli.execute(\'show inventory | format\') # xml formatted output\n doc = minidom.parseString(inventory)\n serials = {}\n for node in doc.getElementsByTagName(\'InventoryEntry\'):\n chassis = node.getElementsByTagName(\'ChassisName\')[0]\n # non-stackable\n if chassis.firstChild.data == \'"Chassis"\':\n serials[0] = node.getElementsByTagName(\'SN\')[0].firstChild.data\n\n # stackable\n match = re.match(\'"Switch ([0-9])"\', chassis.firstChild.data)\n if match:\n unit = int(match.group(1))\n serials[unit] = node.getElementsByTagName(\'SN\')[0].firstChild.data\n\n return serials\n\ndef is_iosxe_package(url):\n """ Returns True if the given file is an IOS XE package """\n info = cli.execute(\'show file information %s\' % url)\n # log error message if any and terminate script in case of failure\n match = re.match(\'^(%Error .*)\', info)\n if match:\n log(3, match.group(1))\n shutdown(save=False, abnormal=True)\n\n return bool(re.search(\'IFS|NOVA|IOSXE_PACKAGE\', info))\n\ndef get_version():\n """ Returns a string with the IOS version """\n version = cli.execute(\'show version\')\n # extract version string\n match = re.search(\'Version ([A-Za-z0-9.:()]+)\', version)\n # remove leading zeros from numbers\n ver_str = re.sub(r\'\\b0+(\\d)\', r\'\\1\', match.group(1)) if match else \'unknown\'\n # extract boot string\n match = re.search(\'System image file is "(.*)"\', version)\n # check if the device started in bundle mode\n ver_str += \' bundle\' if match and is_iosxe_package(match.group(1)) else \'\'\n return ver_str\n\ndef upload(**kwargs):\n """ Adds given named arguments to dict and sends data to log API """\n ztp.update(kwargs)\n if LOGAPI:\n try:\n with open(\'/bootflash/temp.json\', \'w\') as outfile:\n json.dump(ztp, outfile)\n except (IOError, ValueError) as e:\n log(3, e)\n return\n\n for retry in range(3):\n log(6, \'Storing %s...\' % LOGAPI)\n result = cli.execute(\'copy temp.json %s\' % LOGAPI)\n # log error message in case of failure\n match = re.search(\'^(%Error .*)\', result, re.MULTILINE)\n if match:\n log(3, match.group(1))\n else:\n break\n\n try:\n os.remove(\'/bootflash/temp.json\')\n except OSError as e:\n log(3, e)\n\ndef shutdown(save=False, abnormal=False):\n """ Cleansup and saves config if needed and terminates script """\n if save:\n log(6, \'Saving configuration upon script termination\')\n\n # store script state to LOGAPI if specified\n upload(status=\'Failed\' if abnormal else \'Finished\')\n\n if SYSLOG:\n cli.configure(\'\'\'no logging host %s\n no logging discriminator ztp\'\'\' % SYSLOG)\n\n if save:\n cli.execute(\'copy running-config startup-config\')\n\n # terminate script with exit status\n sys.exit(int(abnormal))\n\ndef renumber_stack(stack, serials):\n """ Returns True if stack is renumbered or False otherwise """\n if stack is None:\n return False\n\n # get current switch number and priorities as list of tuples\n switch = cli.execute(\'show switch\')\n match = re.findall(\'(\\d)\\s+\\S+\\s+\\S+\\s+(\\d+)\', switch)\n # renumber switches\n renumber = False\n for old_num in serials:\n # lookup new switch number\n new_num = next((n for n in stack if serials[old_num] == stack[n]), None)\n if new_num and old_num != int(new_num):\n renumber = True\n # renumber switch and log error message in case of failure\n try:\n cli.execute(\'switch {} renumber {}\'.format(old_num, new_num))\n log(6, \'Renumbered switch {} to {}\'.format(old_num, new_num))\n except cli.CLISyntaxError as e:\n log(3, e)\n shutdown(save=False, abnormal=True) # terminate script\n\n if new_num:\n # calculate new switch priority\n new_prio = 16 - int(new_num)\n # lookup current switch priority\n old_prio = next((p for n, p in match if int(n) == old_num), 1)\n if int(old_prio) != new_prio:\n # check if top switch is not active\n if switch.find(\'*{}\'.format(sorted(serials.keys())[0])) == -1:\n renumber = True\n\n # set switch priority and log error message in case of failure\n try:\n cli.execute(\'switch %s priority %d\' % (old_num, new_prio))\n log(6, \'Switch %s priority set to %d\' % (old_num, new_prio))\n except cli.CLISyntaxError as e:\n log(3, e)\n shutdown(save=False, abnormal=True) # terminate script\n\n if renumber:\n for num in serials.keys():\n # to prevent recovery from backup nvram\n try:\n cli.execute(\'delete flash-%s:nvram_config*\' % num)\n except cli.CLISyntaxError as e:\n pass\n\n return renumber\n\ndef install(target, is_chassis):\n """ Returns True if install script is configured or False otherwise """\n # remove leading zeros from required version numbers and compare\n if (target.version is None or target.install is None\n or ztp[\'version\'] == re.sub(r\'\\b0+(\\d)\', r\'\\1\', target.version.strip())):\n return False\n\n install_url = urljoin(target.base_url, target.install)\n # terminate script in case of invalid file\n log(6, \'Checking %s\' % install_url)\n if not is_iosxe_package(install_url):\n log(3, \'%s is not valid image file\' % install_url)\n shutdown(save=False, abnormal=True)\n\n # change boot mode if device is in bundle mode\n if \'bundle\' in ztp[\'version\']:\n fs = \'bootflash:\' if is_chassis else \'flash:\'\n log(6, \'Changing the Boot Mode\')\n cli.configure(\'\'\'no boot system\n boot system {}packages.conf\'\'\'.format(fs))\n cli.execute(\'write memory\')\n cli.execute(\'write erase\')\n # install command needs confirmation on changed boot config\n confirm_bm = \'\'\'pattern "\\[y\\/n\\]|#"\n action 5.3 cli command "y"\'\'\'\n else:\n confirm_bm = \'\'\n\n # Configure EEM applet for interactive command execution\n cli.configure(\'\'\'event manager applet upgrade\n event none maxrun 900\n action 1.0 cli command "enable"\n action 2.0 syslog msg "Removing inactive images..."\n action 3.0 cli command "install remove inactive" pattern "\\[y\\/n\\]|#"\n action 3.1 cli command "y"\n action 4.0 syslog msg "Downloading and installing image..."\n action 5.0 cli command "install add file %s activate commit" pattern "\\[y\\/n\\/q\\]|#"\n action 5.1 cli command "n" pattern "\\[y\\/n\\]|#"\n action 5.2 cli command "y" %s\n action 6.0 syslog msg "Reloading stack..."\n action 7.0 reload\'\'\' % (install_url, confirm_bm))\n return True\n\ndef autoupgrade():\n """ Returns True if autoupgrade script is configured or False otherwise """\n switch = cli.execute(\'show switch\')\n # look for a switch in version mismatch state\n if switch.find(\'V-Mismatch\') > -1:\n # Workaround to execute interactive marked commands from guestshell\n cli.configure(\'\'\'event manager applet upgrade\n event none maxrun 600\n action 1.0 cli command "enable"\n action 2.0 cli command "request platform software package install autoupgrade"\n action 3.0 syslog msg "Reloading stack..."\n action 4.0 reload\'\'\')\n return True\n else:\n return False\n\ndef parse_hex(fmt):\n """ Converts the hex/text format of the IOS more command to string """\n match = re.findall(\'\\S{8}: +(\\S{8} +\\S{8} +\\S{8} +\\S{8})\', fmt)\n parts = [base64.b16decode(re.sub(\' |X\', \'\', line)) for line in match]\n return \'\'.join(parts) if match else fmt\n\ndef download(file_url):\n """ Returns file contents or empty string in case of failure """\n if file_url:\n for retry in range(3):\n log(6, \'Downloading %s...\' % file_url)\n result = cli.execute(\'more %s\' % file_url)\n # log error message in case of failure\n match = re.match(\'^(%Error .*)\', result)\n if match:\n log(3, match.group(1))\n else:\n break\n\n # extract file contents from output\n match = re.search(\'^Loading %s (.*)\' % file_url, result, re.DOTALL)\n return parse_hex(match.group(1)) if match else \'\'\n else:\n return \'\'\n\ndef apply_config(target):\n """ Returns True if configuration template is applied successfully """\n cfg_url = urljoin(target.base_url, target.config) if target.config else None\n\n # remove keyword \'end\' from downloaded configuration\n conf = re.sub(\'^\\s*end\\s*$\', \'\', download(cfg_url), flags=re.MULTILINE)\n if target.template:\n conf += \'\\n\' + target.template if len(conf) else target.template\n\n if len(conf) == 0:\n return False\n\n # build configuration from template by $-based substitutions\n if target.subst:\n conf = Template(conf).safe_substitute(target.subst)\n\n # apply configuration and log error message in case of failure\n try:\n cli.configure(conf)\n except cli.CLIConfigurationError as e:\n log(3, \'Failed configurations:\\n\' + \'\\n\'.join(map(str, e.failed)))\n shutdown(save=False, abnormal=True) # terminate script\n else:\n return True\n\ndef blue_beacon(sw_nums):\n """ Turns on blue beacon of given switch number list, if supported """\n for num in sw_nums:\n # up to and including 16.8.x\n try:\n cli.cli(\'configure terminal ; hw-module beacon on switch %d\' % num)\n except (cli.errors.cli_syntax_error, cli.errors.cli_exec_error):\n pass\n # from 16.9.x onwards\n try:\n cli.execute(\'hw-module beacon slot %d on\' % num)\n except cli.CLISyntaxError:\n pass\n\n log(6, \'Switch %d beacon LED turned on\' % num)\n\ndef final_cli(command):\n """ Returns True if given command string is executed succesfully """\n success = False\n if command is not None:\n success = True\n for cmd in command.splitlines():\n # look for python expressions within {% templatetag openvariable %}...{% templatetag closevariable %}\n match = re.search(\'{% templatetag openvariable %}(.*?){% templatetag closevariable %}\', cmd)\n if match:\n try:\n result = eval(match.group(1)) # evaluate expression\n except Exception as e:\n log(3, \'Final command failure: %s\' % e)\n success = False\n continue\n else:\n if result is None:\n continue\n\n # replace expression with result\n cmd = cmd.replace(match.group(0), str(result))\n\n try:\n output = cli.execute(cmd) # execute command\n except cli.CLISyntaxError as e:\n log(3, \'Final command failure: %s\' % e)\n success = False\n else:\n # append command output to cli item of global dict ztp\n fmt = \'{}{:-^60.54}\\n\\n{}\\n\\n\'\n ztp[\'cli\'] = fmt.format(ztp.get(\'cli\', \'\'), cmd, output)\n\n return success\n\ndef main():\n # setup IOS syslog for our own messages if server IP is specified\n if SYSLOG:\n cli.configure(\'\'\'logging discriminator ztp msg-body includes Message from|HA_EM|INSTALL\n logging host %s discriminator ztp\'\'\' % SYSLOG)\n time.sleep(2)\n\n # show script name\n log(6, \'*** Running %s ***\' % os.path.basename(sys.argv[0]))\n # get platform serial numers and software version\n serials = get_serials()\n log(6, \'Platform serial number(s): %s\' % \', \'.join(serials.values()))\n ztp[\'version\'] = get_version()\n log(6, \'Platform software version: %s\' % ztp[\'version\'])\n # load JSON formatted data if URL is specified and concatenate it to DATA\n json_str = download(JSON)\n try:\n data = DATA + json.loads(json_str) if len(json_str) else DATA\n except ValueError as e:\n log(3, e)\n shutdown(save=False, abnormal=True) # malformed data; terminate script\n\n # lookup stack in dataset, if not found turn on beacon\n target = Stack(data, serials)\n if target.stack is None:\n log(4, \'% Stack not found in dataset\')\n blue_beacon(serials.keys())\n ztp[\'serial\'] = serials[sorted(serials.keys())[0]]\n else:\n ztp[\'serial\'] = target.stack[sorted(target.stack.keys())[0]]\n # check if all specified switches are found, turn on beacon if not\n missing = set(target.stack.values()) - set(serials.values())\n if len(missing):\n log(4, \'Missing switch(es): %s\' % \', \'.join(missing))\n blue_beacon(serials.keys())\n\n # check if all found switches are specified, turn on beacon if not\n extra = set(serials.values()) - set(target.stack.values())\n if len(extra):\n log(4, \'Extra switch(es): %s\' % \', \'.join(extra))\n blue_beacon(serials.keys())\n\n is_chassis = bool(0 in serials)\n # first, check version and install software if needed\n if install(target, is_chassis):\n log(6, \'Software upgrade starting asynchronously...\')\n upload(status=\'Upgrading\')\n cli.execute(\'event manager run upgrade\')\n else:\n # second, check v-mismatch and perform autoupgrade if needed\n if not is_chassis and autoupgrade():\n log(6, \'V-Mismatch detected, upgrade starting asynchronously...\')\n upload(status=\'Upgrading\')\n cli.execute(\'event manager run upgrade\')\n else:\n log(6, \'No software upgrade required\')\n # third, check switch numbering and renumber stack if needed\n if not is_chassis and renumber_stack(target.stack, serials):\n log(6, \'Stack renumbered, reloading stack...\')\n upload(status=\'Renumbered\')\n cli.execute(\'reload\')\n else:\n log(6, \'No need to renumber stack\')\n # fourth, apply configuration template if specified\n if apply_config(target):\n log(6, \'Configuration template applied successfully\')\n # fifth, execute final cli if specified\n if final_cli(target.cli):\n log(6, \'Final command(s) executed successfully\')\n\n # cleanup after step 4 or 5 and save config if specified\n log(6, \'End of workflow reached\')\n shutdown(save=target.save, abnormal=False)\n\nif __name__ == "__main__":\n main()')
# ztp_script.save()
#
# ZtpParameter = apps.get_model('ztp', 'ZtpParameter')
# ztp_parameter = ZtpParameter(
# ztpScript=ztp_script,
# name='SYSLOG',
# value='10.0.0.1',
# )
# ztp_parameter.save()
# ztp_parameter = ZtpParameter(
# ztpScript=ztp_script,
# name='LOGAPI',
# value='http://10.0.0.1:8080/log',
# )
# ztp_parameter.save()
# ztp_parameter = ZtpParameter(
# ztpScript=ztp_script,
# name='JSON',
# value='http://10.0.0.1:8080/data',
# )
# ztp_parameter.save()
class Migration(migrations.Migration):
dependencies = [
('ztp', '0001_initial'),
]
operations = [
migrations.RunPython(populate_ztp_scripts),
]
| 476.046512 | 19,367 | 0.60171 | 2,899 | 20,470 | 4.204898 | 0.185236 | 0.007711 | 0.007793 | 0.004594 | 0.235603 | 0.199016 | 0.163905 | 0.131829 | 0.10927 | 0.09639 | 0 | 0.010271 | 0.243723 | 20,470 | 42 | 19,368 | 487.380952 | 0.777146 | 0.961309 | 0 | 0 | 0 | 0 | 0.037037 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0.1 | 0.1 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
39081d2f1836539a591f46d30abeb732a66f2c04 | 247 | py | Python | tests/app2/admin.py | baffolobill/django-modeladmin-reorder | cb65a0dfb6696b94e2177817050e5a3e9bc58268 | [
"BSD-3-Clause"
] | null | null | null | tests/app2/admin.py | baffolobill/django-modeladmin-reorder | cb65a0dfb6696b94e2177817050e5a3e9bc58268 | [
"BSD-3-Clause"
] | 1 | 2018-07-18T14:52:24.000Z | 2018-07-18T14:52:24.000Z | tests/app2/admin.py | baffolobill/django-modeladmin-reorder | cb65a0dfb6696b94e2177817050e5a3e9bc58268 | [
"BSD-3-Clause"
] | 1 | 2018-08-12T15:02:30.000Z | 2018-08-12T15:02:30.000Z | from django.contrib import admin
from tests.app2.models import App2Model1, App2Model2
@admin.register(App2Model1)
class App2Model1Admin(admin.ModelAdmin):
pass
@admin.register(App2Model2)
class App2Model2Admin(admin.ModelAdmin):
pass
| 17.642857 | 52 | 0.797571 | 28 | 247 | 7.035714 | 0.571429 | 0.13198 | 0.192893 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.059908 | 0.121457 | 247 | 13 | 53 | 19 | 0.847926 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.25 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
391c6726e0b083e3341efa2a8ed06186ffd6c685 | 199 | py | Python | interface/resource/css/test.py | mccolm-robotics/ClaverInteractiveMessageBoard | a63f338c4ee791f9dbf9c2791d1dc8e6326d32f2 | [
"MIT"
] | 1 | 2020-05-22T18:45:12.000Z | 2020-05-22T18:45:12.000Z | interface/resource/css/test.py | mccolm-robotics/ClaverInteractiveMessageBoard | a63f338c4ee791f9dbf9c2791d1dc8e6326d32f2 | [
"MIT"
] | null | null | null | interface/resource/css/test.py | mccolm-robotics/ClaverInteractiveMessageBoard | a63f338c4ee791f9dbf9c2791d1dc8e6326d32f2 | [
"MIT"
] | null | null | null | import os
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
RES_FOLDER = "/home/godvalve/PycharmProjects/Claver-Interactive-Message-Board/interface/resource/button_images/"
print(RES_FOLDER) | 33.166667 | 112 | 0.824121 | 27 | 199 | 5.777778 | 0.777778 | 0.076923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050251 | 199 | 6 | 113 | 33.166667 | 0.825397 | 0 | 0 | 0 | 0 | 0.25 | 0.485 | 0.485 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
39531c1554f6498499106e61b76a76a8decbd79e | 380 | py | Python | tests/asp/cautious/choice.example2.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/cautious/choice.example2.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/cautious/choice.example2.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
3 2 2 3 1 0 4
2 5 2 0 1 2 3
1 1 2 1 5 4
2 6 2 0 2 2 3
1 1 2 0 6 4
1 4 0 0
3 3 7 8 9 1 0 10
2 11 3 0 1 7 8 9
1 1 2 1 11 10
2 12 3 0 2 7 8 9
1 1 2 0 12 10
1 10 0 0
1 13 1 0 8
1 14 1 0 7
1 15 1 0 7
1 16 1 1 15
1 17 1 0 13
1 18 3 0 13 16 14
1 1 2 1 18 2
1 1 2 1 17 3
0
16 p
3 e
13 g
9 a
14 h
17 r
8 b
18 s
2 d
15 l
7 c
0
B+
0
B-
1
0
1
"""
output = """
{r, p, g, b, e}
"""
| 8.444444 | 17 | 0.510526 | 158 | 380 | 1.227848 | 0.202532 | 0.072165 | 0.092784 | 0.082474 | 0.113402 | 0.061856 | 0 | 0 | 0 | 0 | 0 | 0.763889 | 0.431579 | 380 | 44 | 18 | 8.636364 | 0.134259 | 0 | 0 | 0.045455 | 0 | 0 | 0.918421 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
395426653ec7cf79ff7f59ff00ac4e7964db1b8a | 264 | py | Python | es6code/js_sources.py | joeedh/cserver | 1261a9c2a7d4cc768e71fefba33a4542648fa7fe | [
"Apache-2.0"
] | null | null | null | es6code/js_sources.py | joeedh/cserver | 1261a9c2a7d4cc768e71fefba33a4542648fa7fe | [
"Apache-2.0"
] | null | null | null | es6code/js_sources.py | joeedh/cserver | 1261a9c2a7d4cc768e71fefba33a4542648fa7fe | [
"Apache-2.0"
] | 1 | 2018-02-26T16:24:43.000Z | 2018-02-26T16:24:43.000Z | js_targets = {
"netlib.js" : [
"../../src/core/typesystem.js",
"../../src/util/utils.js",
"../../src/util/workerutils.js",
"../../src/util/strutils.js",
"../../src/core/ajax.js",
"src/cserver-netutils.js"
]
}
target_path = "../site/js" | 22 | 36 | 0.522727 | 32 | 264 | 4.25 | 0.5 | 0.220588 | 0.198529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170455 | 264 | 12 | 37 | 22 | 0.621005 | 0 | 0 | 0 | 0 | 0 | 0.641509 | 0.569811 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 |
1a45203c3628a9210a485d38f4731507420eb6cf | 90 | py | Python | special_k/serializers/__init__.py | namoopsoo/special_k | 816ad200e8608d862e20971dc2bc4d2724aaf0bc | [
"Apache-2.0"
] | null | null | null | special_k/serializers/__init__.py | namoopsoo/special_k | 816ad200e8608d862e20971dc2bc4d2724aaf0bc | [
"Apache-2.0"
] | null | null | null | special_k/serializers/__init__.py | namoopsoo/special_k | 816ad200e8608d862e20971dc2bc4d2724aaf0bc | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-present Kensho Technologies, LLC.
from .registry import REGISTRY # noqa
| 30 | 50 | 0.788889 | 11 | 90 | 6.454545 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051948 | 0.144444 | 90 | 2 | 51 | 45 | 0.87013 | 0.588889 | 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 |
1a5e3f8f2014aeca023511c6ceec27f2bbe6e0e8 | 56 | py | Python | cloudmesh-exercises/cloudmesh-shell-1.py | cybertraining-dsc/fa19-516-170 | 8746be5a89d897a155468303308efb71ce7ba849 | [
"Apache-2.0"
] | null | null | null | cloudmesh-exercises/cloudmesh-shell-1.py | cybertraining-dsc/fa19-516-170 | 8746be5a89d897a155468303308efb71ce7ba849 | [
"Apache-2.0"
] | null | null | null | cloudmesh-exercises/cloudmesh-shell-1.py | cybertraining-dsc/fa19-516-170 | 8746be5a89d897a155468303308efb71ce7ba849 | [
"Apache-2.0"
] | 1 | 2019-09-06T17:27:32.000Z | 2019-09-06T17:27:32.000Z | # fa19-516-170 E.Cloudmesh.Shell.1
# run cms in terminal | 28 | 34 | 0.75 | 11 | 56 | 3.818182 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183673 | 0.125 | 56 | 2 | 35 | 28 | 0.673469 | 0.928571 | 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 |
1a783bd27a2680518dcb11b92e2b4f762528cf4b | 91 | py | Python | anandpatel.py | devtechnocode/fossotober | 69757bcac06e0f9795f1ec00dec67610c09ed163 | [
"MIT"
] | null | null | null | anandpatel.py | devtechnocode/fossotober | 69757bcac06e0f9795f1ec00dec67610c09ed163 | [
"MIT"
] | null | null | null | anandpatel.py | devtechnocode/fossotober | 69757bcac06e0f9795f1ec00dec67610c09ed163 | [
"MIT"
] | null | null | null | print ("ANAND PATEL")
print ("AM.EN.U4CSE19206")
print ("S1 CSE")
print ("marvel rockzz")
| 15.166667 | 26 | 0.67033 | 13 | 91 | 4.692308 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088608 | 0.131868 | 91 | 5 | 27 | 18.2 | 0.683544 | 0 | 0 | 0 | 0 | 0 | 0.511111 | 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 |
1a814d524c4965b3f7a0c82c3d8c96db70e0b8f4 | 79 | py | Python | Task/Conditional-structures/Python/conditional-structures-3.py | LaudateCorpus1/RosettaCodeData | 9ad63ea473a958506c041077f1d810c0c7c8c18d | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Conditional-structures/Python/conditional-structures-3.py | seanwallawalla-forks/RosettaCodeData | 9ad63ea473a958506c041077f1d810c0c7c8c18d | [
"Info-ZIP"
] | null | null | null | Task/Conditional-structures/Python/conditional-structures-3.py | seanwallawalla-forks/RosettaCodeData | 9ad63ea473a958506c041077f1d810c0c7c8c18d | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | >>> secret='foo'
>>> print 'got it' if secret=='foo' else 'try again'
'got it'
| 19.75 | 52 | 0.594937 | 13 | 79 | 3.615385 | 0.692308 | 0.382979 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164557 | 79 | 3 | 53 | 26.333333 | 0.712121 | 0 | 0 | 0 | 0 | 0 | 0.341772 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.333333 | 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 |
1aa6bc47a8645be4383b9dd4b7874a5c391c1684 | 187 | py | Python | setup.py | leuder/interest_rate | a3ab37e93a2db21745f6c7da3257688d2fd3cd6c | [
"MIT"
] | null | null | null | setup.py | leuder/interest_rate | a3ab37e93a2db21745f6c7da3257688d2fd3cd6c | [
"MIT"
] | null | null | null | setup.py | leuder/interest_rate | a3ab37e93a2db21745f6c7da3257688d2fd3cd6c | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='pynterest_rate',
version='0.0.0.dev1',
description='Calculate future value',
packages=['pynterest_rate'],
zip_safe=False) | 26.714286 | 43 | 0.684492 | 23 | 187 | 5.434783 | 0.782609 | 0.208 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026316 | 0.187166 | 187 | 7 | 44 | 26.714286 | 0.796053 | 0 | 0 | 0 | 0 | 0 | 0.319149 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
46d95e9834590aed2a4578632c20b4b1cd8a9008 | 741 | py | Python | automon/tests/unit/test_runner.py | TheShellLand/automonisaur | b5f304a44449b8664c93d8a8a3c3cf2d73aa0ce9 | [
"MIT"
] | 2 | 2021-09-15T18:35:44.000Z | 2022-01-18T05:36:54.000Z | automon/tests/unit/test_runner.py | TheShellLand/automonisaur | b5f304a44449b8664c93d8a8a3c3cf2d73aa0ce9 | [
"MIT"
] | 16 | 2021-08-29T22:51:53.000Z | 2022-03-09T16:08:19.000Z | automon/tests/unit/test_runner.py | TheShellLand/automonisaur | b5f304a44449b8664c93d8a8a3c3cf2d73aa0ce9 | [
"MIT"
] | null | null | null | import unittest
from automon.helpers.runner import *
class RunTest(unittest.TestCase):
r = Run()
def test_Run(self):
self.assertTrue(Run)
self.assertFalse(Run())
def test_set_command(self):
self.assertTrue(self.r.set_command('which'))
self.assertFalse(self.r.set_command(''))
def test_which(self):
self.assertTrue(self.r.which('which'))
self.assertFalse(self.r.which(''))
def test_run_command(self):
self.assertTrue(self.r.run_command('id'))
self.assertFalse(self.r.run_command('false'))
def test_run(self):
self.assertTrue(self.r.run('id'))
self.assertFalse(self.r.run('false'))
if __name__ == '__main__':
unittest.main()
| 23.15625 | 53 | 0.639676 | 96 | 741 | 4.739583 | 0.25 | 0.087912 | 0.197802 | 0.193407 | 0.549451 | 0.389011 | 0 | 0 | 0 | 0 | 0 | 0 | 0.207827 | 741 | 31 | 54 | 23.903226 | 0.775128 | 0 | 0 | 0 | 0 | 0 | 0.043185 | 0 | 0 | 0 | 0 | 0 | 0.47619 | 1 | 0.238095 | false | 0 | 0.095238 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
46dcfdfec1dd6958798acb1afe6d934f1132e8dd | 21 | py | Python | tests/__init__.py | weather-balloon/lib-py-parse-bom-stations | a8610cbf6b36b456d38b39a03495c8cbb2ddcdb0 | [
"BSD-2-Clause"
] | null | null | null | tests/__init__.py | weather-balloon/lib-py-parse-bom-stations | a8610cbf6b36b456d38b39a03495c8cbb2ddcdb0 | [
"BSD-2-Clause"
] | 5 | 2019-10-02T23:47:04.000Z | 2021-06-02T00:15:09.000Z | tests/__init__.py | weather-balloon/lib-py-parse-bom-stations | a8610cbf6b36b456d38b39a03495c8cbb2ddcdb0 | [
"BSD-2-Clause"
] | null | null | null | """ Testing code """
| 10.5 | 20 | 0.52381 | 2 | 21 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.190476 | 21 | 1 | 21 | 21 | 0.647059 | 0.571429 | 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 |
46df5701f4b9ee36464c4542d6877be479cb3e99 | 331 | py | Python | Sorting/bubble_sort.py | karanS08/DSA-in-python | 17f6139b77f19acb04eaa85bfc6c22543f881143 | [
"BSD-2-Clause"
] | null | null | null | Sorting/bubble_sort.py | karanS08/DSA-in-python | 17f6139b77f19acb04eaa85bfc6c22543f881143 | [
"BSD-2-Clause"
] | null | null | null | Sorting/bubble_sort.py | karanS08/DSA-in-python | 17f6139b77f19acb04eaa85bfc6c22543f881143 | [
"BSD-2-Clause"
] | null | null | null | def bubblesort(elements):
for n in range(len(elements)-1, 0, -1):
for i in range(n):
if elements[i] > elements[i + 1]:
elements[i], elements[i + 1] = elements[i + 1], elements[i]
elements = [9,3,6,11,77,2,33,43,34,90]
print("Unsorted list is,")
print( elements)
bubblesort(elements)
print("Sorted Array is, ")
print(elements)
| 25.461538 | 61 | 0.670695 | 58 | 331 | 3.827586 | 0.482759 | 0.243243 | 0.22973 | 0.243243 | 0.292793 | 0.292793 | 0.211712 | 0 | 0 | 0 | 0 | 0.077193 | 0.138973 | 331 | 12 | 62 | 27.583333 | 0.701754 | 0 | 0 | 0.181818 | 0 | 0 | 0.102719 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.363636 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
46edb8fcaeb2d1e35bfaf978683c3c9ee4c53863 | 217 | py | Python | Blog/my/admin.py | MY-Lancer/Blog01 | b0b563797891ca19ed67e67d2cb3663514c8e434 | [
"MIT"
] | null | null | null | Blog/my/admin.py | MY-Lancer/Blog01 | b0b563797891ca19ed67e67d2cb3663514c8e434 | [
"MIT"
] | null | null | null | Blog/my/admin.py | MY-Lancer/Blog01 | b0b563797891ca19ed67e67d2cb3663514c8e434 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
#注册模型类
from my.models import *
#注册文章标签类
admin.site.register(ArticleCategory)
#注册文章类
admin.site.register(Article)
#注册评论类
admin.site.register(Comment)
| 13.5625 | 36 | 0.78341 | 29 | 217 | 5.862069 | 0.62069 | 0.158824 | 0.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119816 | 217 | 15 | 37 | 14.466667 | 0.890052 | 0.221198 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
46f76794f58dc3915226250b29105f6a71e4c978 | 1,256 | py | Python | cosmos/galaxies/profile/models/profiles/guild/base.py | MrFreemanser/Bot | b17e0ddf95ea475da38f8e270affd6c5709b2cb1 | [
"MIT"
] | null | null | null | cosmos/galaxies/profile/models/profiles/guild/base.py | MrFreemanser/Bot | b17e0ddf95ea475da38f8e270affd6c5709b2cb1 | [
"MIT"
] | null | null | null | cosmos/galaxies/profile/models/profiles/guild/base.py | MrFreemanser/Bot | b17e0ddf95ea475da38f8e270affd6c5709b2cb1 | [
"MIT"
] | null | null | null | from ..base import ProfileModelsBase
from cosmos import exceptions
from abc import abstractmethod
class GuildMemberProfileBase(ProfileModelsBase):
def __str__(self):
return self.member.__str__()
# TODO: Add a special dunder method which returns attribute from self.member if its not found in self.
@property
@abstractmethod
def profile(self):
raise NotImplementedError
@property
@abstractmethod
def guild_id(self):
raise NotImplementedError
@property
def guild(self):
if not (_ := self.profile.plugin.bot.get_guild(self.guild_id)):
raise exceptions.GuildNotFoundError(self.guild_id, self.id)
return _
@abstractmethod
async def fetch_guild_profile(self):
raise NotImplementedError
@property
def member(self):
return self.guild.get_member(self.id)
@property
def plugin(self):
return self.profile.plugin
@property
def collection(self):
return self.profile.collection
@property
def id(self):
return self.profile.id
@property
def is_prime(self):
return self.profile.is_prime
@property
def guild_filter(self):
return f"guilds.{self.guild_id}"
| 22.035088 | 106 | 0.672771 | 144 | 1,256 | 5.722222 | 0.326389 | 0.084951 | 0.101942 | 0.101942 | 0.15534 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.251592 | 1,256 | 56 | 107 | 22.428571 | 0.876596 | 0.079618 | 0 | 0.375 | 0 | 0 | 0.019064 | 0.019064 | 0 | 0 | 0 | 0.017857 | 0 | 1 | 0.25 | false | 0 | 0.075 | 0.175 | 0.55 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
2006cc950e0157808d8b6cd00558e0a826f7860e | 55 | py | Python | Data_structure_and_alogirthm_in_python_by_Michael_Goodrich/ch1/Creativity/C-1.19.py | katamit/dataStructure_practices | 22cc543a1c8e09116ebbcdde6be0d641e2c6090c | [
"MIT"
] | null | null | null | Data_structure_and_alogirthm_in_python_by_Michael_Goodrich/ch1/Creativity/C-1.19.py | katamit/dataStructure_practices | 22cc543a1c8e09116ebbcdde6be0d641e2c6090c | [
"MIT"
] | null | null | null | Data_structure_and_alogirthm_in_python_by_Michael_Goodrich/ch1/Creativity/C-1.19.py | katamit/dataStructure_practices | 22cc543a1c8e09116ebbcdde6be0d641e2c6090c | [
"MIT"
] | null | null | null | # coding: utf-8
print([chr(x) for x in range(97,123)])
| 18.333333 | 38 | 0.636364 | 12 | 55 | 2.916667 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12766 | 0.145455 | 55 | 2 | 39 | 27.5 | 0.617021 | 0.236364 | 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 |
200727745fb6766a86b1f41c06b71b028546ec48 | 119 | py | Python | apps.py | hawkli-1994/django-db-introspection | fe6e7012a139bad100cbf86fae738a3a66c94347 | [
"MIT"
] | 69 | 2018-01-13T08:59:40.000Z | 2018-04-12T05:50:26.000Z | apps.py | hawkli-1994/django-db-introspection | fe6e7012a139bad100cbf86fae738a3a66c94347 | [
"MIT"
] | null | null | null | apps.py | hawkli-1994/django-db-introspection | fe6e7012a139bad100cbf86fae738a3a66c94347 | [
"MIT"
] | 3 | 2018-01-13T10:35:04.000Z | 2018-04-20T06:41:14.000Z | from django.apps import AppConfig
class DjangoDbIntrospectionConfig(AppConfig):
name = 'django_db_introspection'
| 19.833333 | 45 | 0.815126 | 12 | 119 | 7.916667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12605 | 119 | 5 | 46 | 23.8 | 0.913462 | 0 | 0 | 0 | 0 | 0 | 0.193277 | 0.193277 | 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 |
201896b3f8f8b60bbcc87a9a3092470a58e3c7b0 | 141 | py | Python | inverse/__init__.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | null | null | null | inverse/__init__.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | 25 | 2020-03-26T11:16:58.000Z | 2020-09-10T18:31:52.000Z | inverse/__init__.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | null | null | null | from .schwarzschild import *
from .kerr import *
from .qmetric import *
__all__ = ['InverseSchwarzschild', 'InverseKerr', 'InverseQMetric']
| 23.5 | 67 | 0.751773 | 13 | 141 | 7.846154 | 0.692308 | 0.196078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12766 | 141 | 5 | 68 | 28.2 | 0.829268 | 0 | 0 | 0 | 0 | 0 | 0.319149 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
201af9261f0989b521aaf39abc8d46c16f7f58d7 | 16 | py | Python | yolox/backbones/__init__.py | EighteenSprings/PP_YOLOX | 48cff5203d55c98b96c9a6f89da26ff098f4bb91 | [
"Apache-2.0"
] | null | null | null | yolox/backbones/__init__.py | EighteenSprings/PP_YOLOX | 48cff5203d55c98b96c9a6f89da26ff098f4bb91 | [
"Apache-2.0"
] | null | null | null | yolox/backbones/__init__.py | EighteenSprings/PP_YOLOX | 48cff5203d55c98b96c9a6f89da26ff098f4bb91 | [
"Apache-2.0"
] | null | null | null | """
backbone
""" | 5.333333 | 8 | 0.5 | 1 | 16 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 16 | 3 | 9 | 5.333333 | 0.571429 | 0.5 | 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 |
202d4f5003230e723a1a57093b4b1f1a385219f9 | 88 | py | Python | empyres/core/phase/__init__.py | waigore/empyres4x | aa3bbf94ea0bca280152e92d485d5825a4b352ca | [
"Apache-2.0"
] | null | null | null | empyres/core/phase/__init__.py | waigore/empyres4x | aa3bbf94ea0bca280152e92d485d5825a4b352ca | [
"Apache-2.0"
] | null | null | null | empyres/core/phase/__init__.py | waigore/empyres4x | aa3bbf94ea0bca280152e92d485d5825a4b352ca | [
"Apache-2.0"
] | null | null | null | from .common import *
from .phase import (
gamePhaseNames,
getGamePhaseByName
)
| 14.666667 | 22 | 0.715909 | 8 | 88 | 7.875 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.215909 | 88 | 5 | 23 | 17.6 | 0.913043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 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 |
20339d0472027ef181f1f3323b33f3bad0ad46fe | 264 | py | Python | avaliacoes/api/viewsets.py | alexandresillva/django_rest_framework | 396203c0e9400fed8d7cead98b166da8cf5675f1 | [
"MIT"
] | null | null | null | avaliacoes/api/viewsets.py | alexandresillva/django_rest_framework | 396203c0e9400fed8d7cead98b166da8cf5675f1 | [
"MIT"
] | null | null | null | avaliacoes/api/viewsets.py | alexandresillva/django_rest_framework | 396203c0e9400fed8d7cead98b166da8cf5675f1 | [
"MIT"
] | null | null | null | from rest_framework.viewsets import ModelViewSet
from avaliacoes.models import Avaliacao
from .serializers import AvaliacaoSerializer
class AvaliacaoViewSet(ModelViewSet):
queryset = Avaliacao.objects.all()
serializer_class = AvaliacaoSerializer
| 29.333333 | 49 | 0.810606 | 25 | 264 | 8.48 | 0.68 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.143939 | 264 | 8 | 50 | 33 | 0.938053 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 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 |
645fdb718f25afa2f099b9725c88c1793bd14b44 | 100 | py | Python | python/apsis/exc.py | alexhsamuel/apsis | 7a038a39e5002637b60f73147728b4cc53692da3 | [
"BSD-3-Clause"
] | 1 | 2021-06-03T15:35:31.000Z | 2021-06-03T15:35:31.000Z | python/apsis/exc.py | alexhsamuel/apsis | 7a038a39e5002637b60f73147728b4cc53692da3 | [
"BSD-3-Clause"
] | 93 | 2018-08-17T20:32:09.000Z | 2022-03-23T17:34:37.000Z | python/apsis/exc.py | alexhsamuel/apsis | 7a038a39e5002637b60f73147728b4cc53692da3 | [
"BSD-3-Clause"
] | null | null | null | class ConditionError(RuntimeError):
"""
An error in specification of a condition.
"""
| 14.285714 | 45 | 0.65 | 10 | 100 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 100 | 6 | 46 | 16.666667 | 0.866667 | 0.41 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
64869a03d1e5c6eb767b2698bd09b5e585cd0ee2 | 20 | py | Python | water/__init__.py | truher/water | b821ee42de4f7f978aa50071e4b5029f2265b4c8 | [
"MIT"
] | null | null | null | water/__init__.py | truher/water | b821ee42de4f7f978aa50071e4b5029f2265b4c8 | [
"MIT"
] | 18 | 2021-05-02T21:34:11.000Z | 2021-05-23T00:54:59.000Z | water/__init__.py | truher/water | b821ee42de4f7f978aa50071e4b5029f2265b4c8 | [
"MIT"
] | null | null | null | """water package"""
| 10 | 19 | 0.6 | 2 | 20 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 20 | 1 | 20 | 20 | 0.666667 | 0.65 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
649fe1d53cf1ec6310809f827f8e9cf1f6788acf | 83,392 | py | Python | space_api/proto/server_pb2.py | AliabbasMerchant/space-api-python | e5f047d567540d503be7fe72e82f2b198e48b5f9 | [
"Apache-2.0"
] | 8 | 2019-04-02T06:06:45.000Z | 2019-11-12T16:53:26.000Z | space_api/proto/server_pb2.py | SaiprasadDuduka/space-api-python | 278ad650fa5579089a7ff465dbe74ec5469940ae | [
"Apache-2.0"
] | 28 | 2019-03-25T11:35:07.000Z | 2020-05-11T05:10:00.000Z | space_api/proto/server_pb2.py | SaiprasadDuduka/space-api-python | 278ad650fa5579089a7ff465dbe74ec5469940ae | [
"Apache-2.0"
] | 4 | 2019-03-22T17:09:22.000Z | 2019-10-24T17:10:43.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: server.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
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()
DESCRIPTOR = _descriptor.FileDescriptor(
name='server.proto',
package='proto',
syntax='proto3',
serialized_options=_b('\n\037com.spaceuptech.space_api.protoB\017SpaceCloudProtoP\001'),
serialized_pb=_b('\n\x0cserver.proto\x12\x05proto\"O\n\rCreateRequest\x12\x10\n\x08\x64ocument\x18\x01 \x01(\x0c\x12\x11\n\toperation\x18\x02 \x01(\t\x12\x19\n\x04meta\x18\x03 \x01(\x0b\x32\x0b.proto.Meta\"n\n\x0bReadRequest\x12\x0c\n\x04\x66ind\x18\x01 \x01(\x0c\x12\x11\n\toperation\x18\x02 \x01(\t\x12#\n\x07options\x18\x03 \x01(\x0b\x32\x12.proto.ReadOptions\x12\x19\n\x04meta\x18\x04 \x01(\x0b\x32\x0b.proto.Meta\"\xf4\x01\n\x0bReadOptions\x12.\n\x06select\x18\x01 \x03(\x0b\x32\x1e.proto.ReadOptions.SelectEntry\x12*\n\x04sort\x18\x02 \x03(\x0b\x32\x1c.proto.ReadOptions.SortEntry\x12\x0c\n\x04skip\x18\x03 \x01(\x03\x12\r\n\x05limit\x18\x04 \x01(\x03\x12\x10\n\x08\x64istinct\x18\x05 \x01(\t\x1a-\n\x0bSelectEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a+\n\tSortEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"[\n\rUpdateRequest\x12\x0c\n\x04\x66ind\x18\x01 \x01(\x0c\x12\x11\n\toperation\x18\x02 \x01(\t\x12\x0e\n\x06update\x18\x03 \x01(\x0c\x12\x19\n\x04meta\x18\x04 \x01(\x0b\x32\x0b.proto.Meta\"K\n\rDeleteRequest\x12\x0c\n\x04\x66ind\x18\x01 \x01(\x0c\x12\x11\n\toperation\x18\x02 \x01(\t\x12\x19\n\x04meta\x18\x03 \x01(\x0b\x32\x0b.proto.Meta\"R\n\x10\x41ggregateRequest\x12\x10\n\x08pipeline\x18\x01 \x01(\x0c\x12\x11\n\toperation\x18\x02 \x01(\t\x12\x19\n\x04meta\x18\x03 \x01(\x0b\x32\x0b.proto.Meta\"9\n\x08Response\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\x0e\n\x06result\x18\x03 \x01(\x0c\"C\n\x04Meta\x12\x0f\n\x07project\x18\x01 \x01(\t\x12\x0e\n\x06\x64\x62Type\x18\x02 \x01(\t\x12\x0b\n\x03\x63ol\x18\x03 \x01(\t\x12\r\n\x05token\x18\x04 \x01(\t\"j\n\nAllRequest\x12\x0b\n\x03\x63ol\x18\x01 \x01(\t\x12\x10\n\x08\x64ocument\x18\x02 \x01(\x0c\x12\x11\n\toperation\x18\x03 \x01(\t\x12\x0c\n\x04\x66ind\x18\x04 \x01(\x0c\x12\x0e\n\x06update\x18\x05 \x01(\x0c\x12\x0c\n\x04type\x18\x06 \x01(\t\"R\n\x0c\x42\x61tchRequest\x12\'\n\x0c\x62\x61tchrequest\x18\x01 \x03(\x0b\x32\x11.proto.AllRequest\x12\x19\n\x04meta\x18\x02 \x01(\x0b\x32\x0b.proto.Meta\"v\n\x10\x46unctionsRequest\x12\x0e\n\x06params\x18\x01 \x01(\x0c\x12\x0f\n\x07timeout\x18\x02 \x01(\x03\x12\x0f\n\x07service\x18\x03 \x01(\t\x12\x10\n\x08\x66unction\x18\x04 \x01(\t\x12\r\n\x05token\x18\x05 \x01(\t\x12\x0f\n\x07project\x18\x06 \x01(\t\"\x9c\x01\n\x10\x46unctionsPayload\x12\x0c\n\x04\x61uth\x18\x01 \x01(\x0c\x12\x0e\n\x06params\x18\x02 \x01(\x0c\x12\x0f\n\x07service\x18\x03 \x01(\t\x12\x10\n\x08\x66unction\x18\x04 \x01(\t\x12\x0c\n\x04type\x18\x05 \x01(\t\x12\n\n\x02id\x18\x06 \x01(\t\x12\r\n\x05\x65rror\x18\x07 \x01(\t\x12\x0f\n\x07project\x18\x08 \x01(\t\x12\r\n\x05token\x18\t \x01(\t\"{\n\x08\x46\x65\x65\x64\x44\x61ta\x12\x0f\n\x07queryId\x18\x01 \x01(\t\x12\r\n\x05\x64ocId\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\r\n\x05group\x18\x04 \x01(\t\x12\x0e\n\x06\x64\x62Type\x18\x05 \x01(\t\x12\x0f\n\x07payload\x18\x06 \x01(\x0c\x12\x11\n\ttimeStamp\x18\x07 \x01(\x03\"\x8a\x01\n\x0fRealTimeRequest\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0e\n\x06\x64\x62Type\x18\x02 \x01(\t\x12\x0f\n\x07project\x18\x03 \x01(\t\x12\r\n\x05group\x18\x04 \x01(\t\x12\x0c\n\x04type\x18\x05 \x01(\t\x12\n\n\x02id\x18\x06 \x01(\t\x12\r\n\x05where\x18\x07 \x01(\x0c\x12\x0f\n\x07options\x18\x08 \x01(\x0c\"l\n\x10RealTimeResponse\x12\r\n\x05group\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0b\n\x03\x61\x63k\x18\x03 \x01(\x08\x12\r\n\x05\x65rror\x18\x04 \x01(\t\x12!\n\x08\x66\x65\x65\x64\x44\x61ta\x18\x05 \x03(\x0b\x32\x0f.proto.FeedData\"7\n\x0eProfileRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x19\n\x04meta\x18\x02 \x01(\x0b\x32\x0b.proto.Meta\",\n\x0fProfilesRequest\x12\x19\n\x04meta\x18\x01 \x01(\x0b\x32\x0b.proto.Meta\"j\n\x12\x45\x64itProfileRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05\x65mail\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x10\n\x08password\x18\x04 \x01(\t\x12\x19\n\x04meta\x18\x05 \x01(\x0b\x32\x0b.proto.Meta\"K\n\rSignInRequest\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\x12\x19\n\x04meta\x18\x03 \x01(\x0b\x32\x0b.proto.Meta\"g\n\rSignUpRequest\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08password\x18\x03 \x01(\t\x12\x0c\n\x04role\x18\x04 \x01(\t\x12\x19\n\x04meta\x18\x05 \x01(\x0b\x32\x0b.proto.Meta\"L\n\x13\x43reateFolderRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x19\n\x04meta\x18\x03 \x01(\x0b\x32\x0b.proto.Meta\";\n\x10ListFilesRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x19\n\x04meta\x18\x02 \x01(\x0b\x32\x0b.proto.Meta\"<\n\x11\x44\x65leteFileRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x19\n\x04meta\x18\x02 \x01(\x0b\x32\x0b.proto.Meta\">\n\x13\x44ownloadFileRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x19\n\x04meta\x18\x02 \x01(\x0b\x32\x0b.proto.Meta\"[\n\x11UploadFileRequest\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x12\x19\n\x04meta\x18\x04 \x01(\x0b\x32\x0b.proto.Meta\"=\n\x0b\x46ilePayload\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\"O\n\x14PubsubPublishRequest\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\x0b\n\x03msg\x18\x02 \x01(\x0c\x12\x19\n\x04meta\x18\x03 \x01(\x0b\x32\x0b.proto.Meta\"r\n\x16PubsubSubscribeRequest\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\r\n\x05queue\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\r\n\x05token\x18\x04 \x01(\t\x12\x0f\n\x07project\x18\x05 \x01(\t\x12\n\n\x02id\x18\x06 \x01(\t\"Y\n\x11PubsubMsgResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\x05\x12\r\n\x05\x65rror\x18\x04 \x01(\t\x12\x0b\n\x03msg\x18\x05 \x01(\x0c\x32\xce\t\n\nSpaceCloud\x12\x31\n\x06\x43reate\x12\x14.proto.CreateRequest\x1a\x0f.proto.Response\"\x00\x12-\n\x04Read\x12\x12.proto.ReadRequest\x1a\x0f.proto.Response\"\x00\x12\x31\n\x06Update\x12\x14.proto.UpdateRequest\x1a\x0f.proto.Response\"\x00\x12\x31\n\x06\x44\x65lete\x12\x14.proto.DeleteRequest\x1a\x0f.proto.Response\"\x00\x12\x37\n\tAggregate\x12\x17.proto.AggregateRequest\x1a\x0f.proto.Response\"\x00\x12/\n\x05\x42\x61tch\x12\x13.proto.BatchRequest\x1a\x0f.proto.Response\"\x00\x12\x32\n\x04\x43\x61ll\x12\x17.proto.FunctionsRequest\x1a\x0f.proto.Response\"\x00\x12\x41\n\x08RealTime\x12\x16.proto.RealTimeRequest\x1a\x17.proto.RealTimeResponse\"\x00(\x01\x30\x01\x12\x41\n\x07Service\x12\x17.proto.FunctionsPayload\x1a\x17.proto.FunctionsPayload\"\x00(\x01\x30\x01\x12\x33\n\x07Profile\x12\x15.proto.ProfileRequest\x1a\x0f.proto.Response\"\x00\x12\x35\n\x08Profiles\x12\x16.proto.ProfilesRequest\x1a\x0f.proto.Response\"\x00\x12;\n\x0b\x45\x64itProfile\x12\x19.proto.EditProfileRequest\x1a\x0f.proto.Response\"\x00\x12\x31\n\x06SignIn\x12\x14.proto.SignInRequest\x1a\x0f.proto.Response\"\x00\x12\x31\n\x06SignUp\x12\x14.proto.SignUpRequest\x1a\x0f.proto.Response\"\x00\x12=\n\x0c\x43reateFolder\x12\x1a.proto.CreateFolderRequest\x1a\x0f.proto.Response\"\x00\x12\x37\n\tListFiles\x12\x17.proto.ListFilesRequest\x1a\x0f.proto.Response\"\x00\x12\x39\n\nDeleteFile\x12\x18.proto.DeleteFileRequest\x1a\x0f.proto.Response\"\x00\x12;\n\nUploadFile\x12\x18.proto.UploadFileRequest\x1a\x0f.proto.Response\"\x00(\x01\x12\x42\n\x0c\x44ownloadFile\x12\x1a.proto.DownloadFileRequest\x1a\x12.proto.FilePayload\"\x00\x30\x01\x12?\n\rPubsubPublish\x12\x1b.proto.PubsubPublishRequest\x1a\x0f.proto.Response\"\x00\x12P\n\x0fPubsubSubscribe\x12\x1d.proto.PubsubSubscribeRequest\x1a\x18.proto.PubsubMsgResponse\"\x00(\x01\x30\x01\x42\x34\n\x1f\x63om.spaceuptech.space_api.protoB\x0fSpaceCloudProtoP\x01\x62\x06proto3')
)
_CREATEREQUEST = _descriptor.Descriptor(
name='CreateRequest',
full_name='proto.CreateRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='document', full_name='proto.CreateRequest.document', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='operation', full_name='proto.CreateRequest.operation', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.CreateRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=23,
serialized_end=102,
)
_READREQUEST = _descriptor.Descriptor(
name='ReadRequest',
full_name='proto.ReadRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='find', full_name='proto.ReadRequest.find', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='operation', full_name='proto.ReadRequest.operation', 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),
_descriptor.FieldDescriptor(
name='options', full_name='proto.ReadRequest.options', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.ReadRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=104,
serialized_end=214,
)
_READOPTIONS_SELECTENTRY = _descriptor.Descriptor(
name='SelectEntry',
full_name='proto.ReadOptions.SelectEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='proto.ReadOptions.SelectEntry.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),
_descriptor.FieldDescriptor(
name='value', full_name='proto.ReadOptions.SelectEntry.value', index=1,
number=2, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=_b('8\001'),
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=371,
serialized_end=416,
)
_READOPTIONS_SORTENTRY = _descriptor.Descriptor(
name='SortEntry',
full_name='proto.ReadOptions.SortEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='proto.ReadOptions.SortEntry.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),
_descriptor.FieldDescriptor(
name='value', full_name='proto.ReadOptions.SortEntry.value', index=1,
number=2, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=_b('8\001'),
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=418,
serialized_end=461,
)
_READOPTIONS = _descriptor.Descriptor(
name='ReadOptions',
full_name='proto.ReadOptions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='select', full_name='proto.ReadOptions.select', 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),
_descriptor.FieldDescriptor(
name='sort', full_name='proto.ReadOptions.sort', 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),
_descriptor.FieldDescriptor(
name='skip', full_name='proto.ReadOptions.skip', index=2,
number=3, type=3, cpp_type=2, 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),
_descriptor.FieldDescriptor(
name='limit', full_name='proto.ReadOptions.limit', index=3,
number=4, type=3, cpp_type=2, 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),
_descriptor.FieldDescriptor(
name='distinct', full_name='proto.ReadOptions.distinct', 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),
],
extensions=[
],
nested_types=[_READOPTIONS_SELECTENTRY, _READOPTIONS_SORTENTRY, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=217,
serialized_end=461,
)
_UPDATEREQUEST = _descriptor.Descriptor(
name='UpdateRequest',
full_name='proto.UpdateRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='find', full_name='proto.UpdateRequest.find', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='operation', full_name='proto.UpdateRequest.operation', 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),
_descriptor.FieldDescriptor(
name='update', full_name='proto.UpdateRequest.update', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.UpdateRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=463,
serialized_end=554,
)
_DELETEREQUEST = _descriptor.Descriptor(
name='DeleteRequest',
full_name='proto.DeleteRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='find', full_name='proto.DeleteRequest.find', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='operation', full_name='proto.DeleteRequest.operation', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.DeleteRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=556,
serialized_end=631,
)
_AGGREGATEREQUEST = _descriptor.Descriptor(
name='AggregateRequest',
full_name='proto.AggregateRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='pipeline', full_name='proto.AggregateRequest.pipeline', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='operation', full_name='proto.AggregateRequest.operation', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.AggregateRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=633,
serialized_end=715,
)
_RESPONSE = _descriptor.Descriptor(
name='Response',
full_name='proto.Response',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='status', full_name='proto.Response.status', index=0,
number=1, 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),
_descriptor.FieldDescriptor(
name='error', full_name='proto.Response.error', 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),
_descriptor.FieldDescriptor(
name='result', full_name='proto.Response.result', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=717,
serialized_end=774,
)
_META = _descriptor.Descriptor(
name='Meta',
full_name='proto.Meta',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='project', full_name='proto.Meta.project', 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),
_descriptor.FieldDescriptor(
name='dbType', full_name='proto.Meta.dbType', 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),
_descriptor.FieldDescriptor(
name='col', full_name='proto.Meta.col', 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),
_descriptor.FieldDescriptor(
name='token', full_name='proto.Meta.token', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=776,
serialized_end=843,
)
_ALLREQUEST = _descriptor.Descriptor(
name='AllRequest',
full_name='proto.AllRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='col', full_name='proto.AllRequest.col', 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),
_descriptor.FieldDescriptor(
name='document', full_name='proto.AllRequest.document', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='operation', full_name='proto.AllRequest.operation', 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),
_descriptor.FieldDescriptor(
name='find', full_name='proto.AllRequest.find', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='update', full_name='proto.AllRequest.update', index=4,
number=5, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='type', full_name='proto.AllRequest.type', index=5,
number=6, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=845,
serialized_end=951,
)
_BATCHREQUEST = _descriptor.Descriptor(
name='BatchRequest',
full_name='proto.BatchRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='batchrequest', full_name='proto.BatchRequest.batchrequest', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.BatchRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=953,
serialized_end=1035,
)
_FUNCTIONSREQUEST = _descriptor.Descriptor(
name='FunctionsRequest',
full_name='proto.FunctionsRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='params', full_name='proto.FunctionsRequest.params', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='timeout', full_name='proto.FunctionsRequest.timeout', index=1,
number=2, type=3, cpp_type=2, 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),
_descriptor.FieldDescriptor(
name='service', full_name='proto.FunctionsRequest.service', 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),
_descriptor.FieldDescriptor(
name='function', full_name='proto.FunctionsRequest.function', 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),
_descriptor.FieldDescriptor(
name='token', full_name='proto.FunctionsRequest.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),
_descriptor.FieldDescriptor(
name='project', full_name='proto.FunctionsRequest.project', index=5,
number=6, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1037,
serialized_end=1155,
)
_FUNCTIONSPAYLOAD = _descriptor.Descriptor(
name='FunctionsPayload',
full_name='proto.FunctionsPayload',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='auth', full_name='proto.FunctionsPayload.auth', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='params', full_name='proto.FunctionsPayload.params', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='service', full_name='proto.FunctionsPayload.service', 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),
_descriptor.FieldDescriptor(
name='function', full_name='proto.FunctionsPayload.function', 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),
_descriptor.FieldDescriptor(
name='type', full_name='proto.FunctionsPayload.type', 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),
_descriptor.FieldDescriptor(
name='id', full_name='proto.FunctionsPayload.id', index=5,
number=6, 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),
_descriptor.FieldDescriptor(
name='error', full_name='proto.FunctionsPayload.error', index=6,
number=7, 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),
_descriptor.FieldDescriptor(
name='project', full_name='proto.FunctionsPayload.project', index=7,
number=8, 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),
_descriptor.FieldDescriptor(
name='token', full_name='proto.FunctionsPayload.token', index=8,
number=9, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1158,
serialized_end=1314,
)
_FEEDDATA = _descriptor.Descriptor(
name='FeedData',
full_name='proto.FeedData',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='queryId', full_name='proto.FeedData.queryId', 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),
_descriptor.FieldDescriptor(
name='docId', full_name='proto.FeedData.docId', 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),
_descriptor.FieldDescriptor(
name='type', full_name='proto.FeedData.type', 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),
_descriptor.FieldDescriptor(
name='group', full_name='proto.FeedData.group', 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),
_descriptor.FieldDescriptor(
name='dbType', full_name='proto.FeedData.dbType', 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),
_descriptor.FieldDescriptor(
name='payload', full_name='proto.FeedData.payload', index=5,
number=6, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='timeStamp', full_name='proto.FeedData.timeStamp', index=6,
number=7, type=3, cpp_type=2, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1316,
serialized_end=1439,
)
_REALTIMEREQUEST = _descriptor.Descriptor(
name='RealTimeRequest',
full_name='proto.RealTimeRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='token', full_name='proto.RealTimeRequest.token', 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),
_descriptor.FieldDescriptor(
name='dbType', full_name='proto.RealTimeRequest.dbType', 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),
_descriptor.FieldDescriptor(
name='project', full_name='proto.RealTimeRequest.project', 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),
_descriptor.FieldDescriptor(
name='group', full_name='proto.RealTimeRequest.group', 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),
_descriptor.FieldDescriptor(
name='type', full_name='proto.RealTimeRequest.type', 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),
_descriptor.FieldDescriptor(
name='id', full_name='proto.RealTimeRequest.id', index=5,
number=6, 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),
_descriptor.FieldDescriptor(
name='where', full_name='proto.RealTimeRequest.where', index=6,
number=7, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='options', full_name='proto.RealTimeRequest.options', index=7,
number=8, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1442,
serialized_end=1580,
)
_REALTIMERESPONSE = _descriptor.Descriptor(
name='RealTimeResponse',
full_name='proto.RealTimeResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='group', full_name='proto.RealTimeResponse.group', 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),
_descriptor.FieldDescriptor(
name='id', full_name='proto.RealTimeResponse.id', 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),
_descriptor.FieldDescriptor(
name='ack', full_name='proto.RealTimeResponse.ack', index=2,
number=3, 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),
_descriptor.FieldDescriptor(
name='error', full_name='proto.RealTimeResponse.error', 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),
_descriptor.FieldDescriptor(
name='feedData', full_name='proto.RealTimeResponse.feedData', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1582,
serialized_end=1690,
)
_PROFILEREQUEST = _descriptor.Descriptor(
name='ProfileRequest',
full_name='proto.ProfileRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='id', full_name='proto.ProfileRequest.id', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.ProfileRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1692,
serialized_end=1747,
)
_PROFILESREQUEST = _descriptor.Descriptor(
name='ProfilesRequest',
full_name='proto.ProfilesRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='meta', full_name='proto.ProfilesRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1749,
serialized_end=1793,
)
_EDITPROFILEREQUEST = _descriptor.Descriptor(
name='EditProfileRequest',
full_name='proto.EditProfileRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='id', full_name='proto.EditProfileRequest.id', 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),
_descriptor.FieldDescriptor(
name='email', full_name='proto.EditProfileRequest.email', 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),
_descriptor.FieldDescriptor(
name='name', full_name='proto.EditProfileRequest.name', 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),
_descriptor.FieldDescriptor(
name='password', full_name='proto.EditProfileRequest.password', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.EditProfileRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1795,
serialized_end=1901,
)
_SIGNINREQUEST = _descriptor.Descriptor(
name='SignInRequest',
full_name='proto.SignInRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='email', full_name='proto.SignInRequest.email', 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),
_descriptor.FieldDescriptor(
name='password', full_name='proto.SignInRequest.password', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.SignInRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1903,
serialized_end=1978,
)
_SIGNUPREQUEST = _descriptor.Descriptor(
name='SignUpRequest',
full_name='proto.SignUpRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='email', full_name='proto.SignUpRequest.email', 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),
_descriptor.FieldDescriptor(
name='name', full_name='proto.SignUpRequest.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),
_descriptor.FieldDescriptor(
name='password', full_name='proto.SignUpRequest.password', 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),
_descriptor.FieldDescriptor(
name='role', full_name='proto.SignUpRequest.role', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.SignUpRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1980,
serialized_end=2083,
)
_CREATEFOLDERREQUEST = _descriptor.Descriptor(
name='CreateFolderRequest',
full_name='proto.CreateFolderRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='path', full_name='proto.CreateFolderRequest.path', 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),
_descriptor.FieldDescriptor(
name='name', full_name='proto.CreateFolderRequest.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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.CreateFolderRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2085,
serialized_end=2161,
)
_LISTFILESREQUEST = _descriptor.Descriptor(
name='ListFilesRequest',
full_name='proto.ListFilesRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='path', full_name='proto.ListFilesRequest.path', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.ListFilesRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2163,
serialized_end=2222,
)
_DELETEFILEREQUEST = _descriptor.Descriptor(
name='DeleteFileRequest',
full_name='proto.DeleteFileRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='path', full_name='proto.DeleteFileRequest.path', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.DeleteFileRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2224,
serialized_end=2284,
)
_DOWNLOADFILEREQUEST = _descriptor.Descriptor(
name='DownloadFileRequest',
full_name='proto.DownloadFileRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='path', full_name='proto.DownloadFileRequest.path', 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),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.DownloadFileRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2286,
serialized_end=2348,
)
_UPLOADFILEREQUEST = _descriptor.Descriptor(
name='UploadFileRequest',
full_name='proto.UploadFileRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='path', full_name='proto.UploadFileRequest.path', 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),
_descriptor.FieldDescriptor(
name='name', full_name='proto.UploadFileRequest.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),
_descriptor.FieldDescriptor(
name='payload', full_name='proto.UploadFileRequest.payload', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.UploadFileRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2350,
serialized_end=2441,
)
_FILEPAYLOAD = _descriptor.Descriptor(
name='FilePayload',
full_name='proto.FilePayload',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='status', full_name='proto.FilePayload.status', index=0,
number=1, 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),
_descriptor.FieldDescriptor(
name='error', full_name='proto.FilePayload.error', 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),
_descriptor.FieldDescriptor(
name='payload', full_name='proto.FilePayload.payload', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2443,
serialized_end=2504,
)
_PUBSUBPUBLISHREQUEST = _descriptor.Descriptor(
name='PubsubPublishRequest',
full_name='proto.PubsubPublishRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='subject', full_name='proto.PubsubPublishRequest.subject', 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),
_descriptor.FieldDescriptor(
name='msg', full_name='proto.PubsubPublishRequest.msg', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='meta', full_name='proto.PubsubPublishRequest.meta', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2506,
serialized_end=2585,
)
_PUBSUBSUBSCRIBEREQUEST = _descriptor.Descriptor(
name='PubsubSubscribeRequest',
full_name='proto.PubsubSubscribeRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='subject', full_name='proto.PubsubSubscribeRequest.subject', 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),
_descriptor.FieldDescriptor(
name='queue', full_name='proto.PubsubSubscribeRequest.queue', 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),
_descriptor.FieldDescriptor(
name='type', full_name='proto.PubsubSubscribeRequest.type', 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),
_descriptor.FieldDescriptor(
name='token', full_name='proto.PubsubSubscribeRequest.token', 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),
_descriptor.FieldDescriptor(
name='project', full_name='proto.PubsubSubscribeRequest.project', 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),
_descriptor.FieldDescriptor(
name='id', full_name='proto.PubsubSubscribeRequest.id', index=5,
number=6, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2587,
serialized_end=2701,
)
_PUBSUBMSGRESPONSE = _descriptor.Descriptor(
name='PubsubMsgResponse',
full_name='proto.PubsubMsgResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='id', full_name='proto.PubsubMsgResponse.id', 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),
_descriptor.FieldDescriptor(
name='type', full_name='proto.PubsubMsgResponse.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),
_descriptor.FieldDescriptor(
name='status', full_name='proto.PubsubMsgResponse.status', index=2,
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=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='error', full_name='proto.PubsubMsgResponse.error', 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),
_descriptor.FieldDescriptor(
name='msg', full_name='proto.PubsubMsgResponse.msg', index=4,
number=5, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2703,
serialized_end=2792,
)
_CREATEREQUEST.fields_by_name['meta'].message_type = _META
_READREQUEST.fields_by_name['options'].message_type = _READOPTIONS
_READREQUEST.fields_by_name['meta'].message_type = _META
_READOPTIONS_SELECTENTRY.containing_type = _READOPTIONS
_READOPTIONS_SORTENTRY.containing_type = _READOPTIONS
_READOPTIONS.fields_by_name['select'].message_type = _READOPTIONS_SELECTENTRY
_READOPTIONS.fields_by_name['sort'].message_type = _READOPTIONS_SORTENTRY
_UPDATEREQUEST.fields_by_name['meta'].message_type = _META
_DELETEREQUEST.fields_by_name['meta'].message_type = _META
_AGGREGATEREQUEST.fields_by_name['meta'].message_type = _META
_BATCHREQUEST.fields_by_name['batchrequest'].message_type = _ALLREQUEST
_BATCHREQUEST.fields_by_name['meta'].message_type = _META
_REALTIMERESPONSE.fields_by_name['feedData'].message_type = _FEEDDATA
_PROFILEREQUEST.fields_by_name['meta'].message_type = _META
_PROFILESREQUEST.fields_by_name['meta'].message_type = _META
_EDITPROFILEREQUEST.fields_by_name['meta'].message_type = _META
_SIGNINREQUEST.fields_by_name['meta'].message_type = _META
_SIGNUPREQUEST.fields_by_name['meta'].message_type = _META
_CREATEFOLDERREQUEST.fields_by_name['meta'].message_type = _META
_LISTFILESREQUEST.fields_by_name['meta'].message_type = _META
_DELETEFILEREQUEST.fields_by_name['meta'].message_type = _META
_DOWNLOADFILEREQUEST.fields_by_name['meta'].message_type = _META
_UPLOADFILEREQUEST.fields_by_name['meta'].message_type = _META
_PUBSUBPUBLISHREQUEST.fields_by_name['meta'].message_type = _META
DESCRIPTOR.message_types_by_name['CreateRequest'] = _CREATEREQUEST
DESCRIPTOR.message_types_by_name['ReadRequest'] = _READREQUEST
DESCRIPTOR.message_types_by_name['ReadOptions'] = _READOPTIONS
DESCRIPTOR.message_types_by_name['UpdateRequest'] = _UPDATEREQUEST
DESCRIPTOR.message_types_by_name['DeleteRequest'] = _DELETEREQUEST
DESCRIPTOR.message_types_by_name['AggregateRequest'] = _AGGREGATEREQUEST
DESCRIPTOR.message_types_by_name['Response'] = _RESPONSE
DESCRIPTOR.message_types_by_name['Meta'] = _META
DESCRIPTOR.message_types_by_name['AllRequest'] = _ALLREQUEST
DESCRIPTOR.message_types_by_name['BatchRequest'] = _BATCHREQUEST
DESCRIPTOR.message_types_by_name['FunctionsRequest'] = _FUNCTIONSREQUEST
DESCRIPTOR.message_types_by_name['FunctionsPayload'] = _FUNCTIONSPAYLOAD
DESCRIPTOR.message_types_by_name['FeedData'] = _FEEDDATA
DESCRIPTOR.message_types_by_name['RealTimeRequest'] = _REALTIMEREQUEST
DESCRIPTOR.message_types_by_name['RealTimeResponse'] = _REALTIMERESPONSE
DESCRIPTOR.message_types_by_name['ProfileRequest'] = _PROFILEREQUEST
DESCRIPTOR.message_types_by_name['ProfilesRequest'] = _PROFILESREQUEST
DESCRIPTOR.message_types_by_name['EditProfileRequest'] = _EDITPROFILEREQUEST
DESCRIPTOR.message_types_by_name['SignInRequest'] = _SIGNINREQUEST
DESCRIPTOR.message_types_by_name['SignUpRequest'] = _SIGNUPREQUEST
DESCRIPTOR.message_types_by_name['CreateFolderRequest'] = _CREATEFOLDERREQUEST
DESCRIPTOR.message_types_by_name['ListFilesRequest'] = _LISTFILESREQUEST
DESCRIPTOR.message_types_by_name['DeleteFileRequest'] = _DELETEFILEREQUEST
DESCRIPTOR.message_types_by_name['DownloadFileRequest'] = _DOWNLOADFILEREQUEST
DESCRIPTOR.message_types_by_name['UploadFileRequest'] = _UPLOADFILEREQUEST
DESCRIPTOR.message_types_by_name['FilePayload'] = _FILEPAYLOAD
DESCRIPTOR.message_types_by_name['PubsubPublishRequest'] = _PUBSUBPUBLISHREQUEST
DESCRIPTOR.message_types_by_name['PubsubSubscribeRequest'] = _PUBSUBSUBSCRIBEREQUEST
DESCRIPTOR.message_types_by_name['PubsubMsgResponse'] = _PUBSUBMSGRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
CreateRequest = _reflection.GeneratedProtocolMessageType('CreateRequest', (_message.Message,), dict(
DESCRIPTOR = _CREATEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.CreateRequest)
))
_sym_db.RegisterMessage(CreateRequest)
ReadRequest = _reflection.GeneratedProtocolMessageType('ReadRequest', (_message.Message,), dict(
DESCRIPTOR = _READREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.ReadRequest)
))
_sym_db.RegisterMessage(ReadRequest)
ReadOptions = _reflection.GeneratedProtocolMessageType('ReadOptions', (_message.Message,), dict(
SelectEntry = _reflection.GeneratedProtocolMessageType('SelectEntry', (_message.Message,), dict(
DESCRIPTOR = _READOPTIONS_SELECTENTRY,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.ReadOptions.SelectEntry)
))
,
SortEntry = _reflection.GeneratedProtocolMessageType('SortEntry', (_message.Message,), dict(
DESCRIPTOR = _READOPTIONS_SORTENTRY,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.ReadOptions.SortEntry)
))
,
DESCRIPTOR = _READOPTIONS,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.ReadOptions)
))
_sym_db.RegisterMessage(ReadOptions)
_sym_db.RegisterMessage(ReadOptions.SelectEntry)
_sym_db.RegisterMessage(ReadOptions.SortEntry)
UpdateRequest = _reflection.GeneratedProtocolMessageType('UpdateRequest', (_message.Message,), dict(
DESCRIPTOR = _UPDATEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.UpdateRequest)
))
_sym_db.RegisterMessage(UpdateRequest)
DeleteRequest = _reflection.GeneratedProtocolMessageType('DeleteRequest', (_message.Message,), dict(
DESCRIPTOR = _DELETEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.DeleteRequest)
))
_sym_db.RegisterMessage(DeleteRequest)
AggregateRequest = _reflection.GeneratedProtocolMessageType('AggregateRequest', (_message.Message,), dict(
DESCRIPTOR = _AGGREGATEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.AggregateRequest)
))
_sym_db.RegisterMessage(AggregateRequest)
Response = _reflection.GeneratedProtocolMessageType('Response', (_message.Message,), dict(
DESCRIPTOR = _RESPONSE,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.Response)
))
_sym_db.RegisterMessage(Response)
Meta = _reflection.GeneratedProtocolMessageType('Meta', (_message.Message,), dict(
DESCRIPTOR = _META,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.Meta)
))
_sym_db.RegisterMessage(Meta)
AllRequest = _reflection.GeneratedProtocolMessageType('AllRequest', (_message.Message,), dict(
DESCRIPTOR = _ALLREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.AllRequest)
))
_sym_db.RegisterMessage(AllRequest)
BatchRequest = _reflection.GeneratedProtocolMessageType('BatchRequest', (_message.Message,), dict(
DESCRIPTOR = _BATCHREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.BatchRequest)
))
_sym_db.RegisterMessage(BatchRequest)
FunctionsRequest = _reflection.GeneratedProtocolMessageType('FunctionsRequest', (_message.Message,), dict(
DESCRIPTOR = _FUNCTIONSREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.FunctionsRequest)
))
_sym_db.RegisterMessage(FunctionsRequest)
FunctionsPayload = _reflection.GeneratedProtocolMessageType('FunctionsPayload', (_message.Message,), dict(
DESCRIPTOR = _FUNCTIONSPAYLOAD,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.FunctionsPayload)
))
_sym_db.RegisterMessage(FunctionsPayload)
FeedData = _reflection.GeneratedProtocolMessageType('FeedData', (_message.Message,), dict(
DESCRIPTOR = _FEEDDATA,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.FeedData)
))
_sym_db.RegisterMessage(FeedData)
RealTimeRequest = _reflection.GeneratedProtocolMessageType('RealTimeRequest', (_message.Message,), dict(
DESCRIPTOR = _REALTIMEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.RealTimeRequest)
))
_sym_db.RegisterMessage(RealTimeRequest)
RealTimeResponse = _reflection.GeneratedProtocolMessageType('RealTimeResponse', (_message.Message,), dict(
DESCRIPTOR = _REALTIMERESPONSE,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.RealTimeResponse)
))
_sym_db.RegisterMessage(RealTimeResponse)
ProfileRequest = _reflection.GeneratedProtocolMessageType('ProfileRequest', (_message.Message,), dict(
DESCRIPTOR = _PROFILEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.ProfileRequest)
))
_sym_db.RegisterMessage(ProfileRequest)
ProfilesRequest = _reflection.GeneratedProtocolMessageType('ProfilesRequest', (_message.Message,), dict(
DESCRIPTOR = _PROFILESREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.ProfilesRequest)
))
_sym_db.RegisterMessage(ProfilesRequest)
EditProfileRequest = _reflection.GeneratedProtocolMessageType('EditProfileRequest', (_message.Message,), dict(
DESCRIPTOR = _EDITPROFILEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.EditProfileRequest)
))
_sym_db.RegisterMessage(EditProfileRequest)
SignInRequest = _reflection.GeneratedProtocolMessageType('SignInRequest', (_message.Message,), dict(
DESCRIPTOR = _SIGNINREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.SignInRequest)
))
_sym_db.RegisterMessage(SignInRequest)
SignUpRequest = _reflection.GeneratedProtocolMessageType('SignUpRequest', (_message.Message,), dict(
DESCRIPTOR = _SIGNUPREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.SignUpRequest)
))
_sym_db.RegisterMessage(SignUpRequest)
CreateFolderRequest = _reflection.GeneratedProtocolMessageType('CreateFolderRequest', (_message.Message,), dict(
DESCRIPTOR = _CREATEFOLDERREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.CreateFolderRequest)
))
_sym_db.RegisterMessage(CreateFolderRequest)
ListFilesRequest = _reflection.GeneratedProtocolMessageType('ListFilesRequest', (_message.Message,), dict(
DESCRIPTOR = _LISTFILESREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.ListFilesRequest)
))
_sym_db.RegisterMessage(ListFilesRequest)
DeleteFileRequest = _reflection.GeneratedProtocolMessageType('DeleteFileRequest', (_message.Message,), dict(
DESCRIPTOR = _DELETEFILEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.DeleteFileRequest)
))
_sym_db.RegisterMessage(DeleteFileRequest)
DownloadFileRequest = _reflection.GeneratedProtocolMessageType('DownloadFileRequest', (_message.Message,), dict(
DESCRIPTOR = _DOWNLOADFILEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.DownloadFileRequest)
))
_sym_db.RegisterMessage(DownloadFileRequest)
UploadFileRequest = _reflection.GeneratedProtocolMessageType('UploadFileRequest', (_message.Message,), dict(
DESCRIPTOR = _UPLOADFILEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.UploadFileRequest)
))
_sym_db.RegisterMessage(UploadFileRequest)
FilePayload = _reflection.GeneratedProtocolMessageType('FilePayload', (_message.Message,), dict(
DESCRIPTOR = _FILEPAYLOAD,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.FilePayload)
))
_sym_db.RegisterMessage(FilePayload)
PubsubPublishRequest = _reflection.GeneratedProtocolMessageType('PubsubPublishRequest', (_message.Message,), dict(
DESCRIPTOR = _PUBSUBPUBLISHREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.PubsubPublishRequest)
))
_sym_db.RegisterMessage(PubsubPublishRequest)
PubsubSubscribeRequest = _reflection.GeneratedProtocolMessageType('PubsubSubscribeRequest', (_message.Message,), dict(
DESCRIPTOR = _PUBSUBSUBSCRIBEREQUEST,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.PubsubSubscribeRequest)
))
_sym_db.RegisterMessage(PubsubSubscribeRequest)
PubsubMsgResponse = _reflection.GeneratedProtocolMessageType('PubsubMsgResponse', (_message.Message,), dict(
DESCRIPTOR = _PUBSUBMSGRESPONSE,
__module__ = 'server_pb2'
# @@protoc_insertion_point(class_scope:proto.PubsubMsgResponse)
))
_sym_db.RegisterMessage(PubsubMsgResponse)
DESCRIPTOR._options = None
_READOPTIONS_SELECTENTRY._options = None
_READOPTIONS_SORTENTRY._options = None
_SPACECLOUD = _descriptor.ServiceDescriptor(
name='SpaceCloud',
full_name='proto.SpaceCloud',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=2795,
serialized_end=4025,
methods=[
_descriptor.MethodDescriptor(
name='Create',
full_name='proto.SpaceCloud.Create',
index=0,
containing_service=None,
input_type=_CREATEREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Read',
full_name='proto.SpaceCloud.Read',
index=1,
containing_service=None,
input_type=_READREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Update',
full_name='proto.SpaceCloud.Update',
index=2,
containing_service=None,
input_type=_UPDATEREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Delete',
full_name='proto.SpaceCloud.Delete',
index=3,
containing_service=None,
input_type=_DELETEREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Aggregate',
full_name='proto.SpaceCloud.Aggregate',
index=4,
containing_service=None,
input_type=_AGGREGATEREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Batch',
full_name='proto.SpaceCloud.Batch',
index=5,
containing_service=None,
input_type=_BATCHREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Call',
full_name='proto.SpaceCloud.Call',
index=6,
containing_service=None,
input_type=_FUNCTIONSREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='RealTime',
full_name='proto.SpaceCloud.RealTime',
index=7,
containing_service=None,
input_type=_REALTIMEREQUEST,
output_type=_REALTIMERESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Service',
full_name='proto.SpaceCloud.Service',
index=8,
containing_service=None,
input_type=_FUNCTIONSPAYLOAD,
output_type=_FUNCTIONSPAYLOAD,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Profile',
full_name='proto.SpaceCloud.Profile',
index=9,
containing_service=None,
input_type=_PROFILEREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='Profiles',
full_name='proto.SpaceCloud.Profiles',
index=10,
containing_service=None,
input_type=_PROFILESREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='EditProfile',
full_name='proto.SpaceCloud.EditProfile',
index=11,
containing_service=None,
input_type=_EDITPROFILEREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='SignIn',
full_name='proto.SpaceCloud.SignIn',
index=12,
containing_service=None,
input_type=_SIGNINREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='SignUp',
full_name='proto.SpaceCloud.SignUp',
index=13,
containing_service=None,
input_type=_SIGNUPREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='CreateFolder',
full_name='proto.SpaceCloud.CreateFolder',
index=14,
containing_service=None,
input_type=_CREATEFOLDERREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='ListFiles',
full_name='proto.SpaceCloud.ListFiles',
index=15,
containing_service=None,
input_type=_LISTFILESREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='DeleteFile',
full_name='proto.SpaceCloud.DeleteFile',
index=16,
containing_service=None,
input_type=_DELETEFILEREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='UploadFile',
full_name='proto.SpaceCloud.UploadFile',
index=17,
containing_service=None,
input_type=_UPLOADFILEREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='DownloadFile',
full_name='proto.SpaceCloud.DownloadFile',
index=18,
containing_service=None,
input_type=_DOWNLOADFILEREQUEST,
output_type=_FILEPAYLOAD,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='PubsubPublish',
full_name='proto.SpaceCloud.PubsubPublish',
index=19,
containing_service=None,
input_type=_PUBSUBPUBLISHREQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='PubsubSubscribe',
full_name='proto.SpaceCloud.PubsubSubscribe',
index=20,
containing_service=None,
input_type=_PUBSUBSUBSCRIBEREQUEST,
output_type=_PUBSUBMSGRESPONSE,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_SPACECLOUD)
DESCRIPTOR.services_by_name['SpaceCloud'] = _SPACECLOUD
# @@protoc_insertion_point(module_scope)
| 39.597341 | 7,671 | 0.734183 | 10,426 | 83,392 | 5.607903 | 0.041531 | 0.05432 | 0.03891 | 0.041732 | 0.725782 | 0.686632 | 0.67808 | 0.656205 | 0.651553 | 0.60522 | 0 | 0.042349 | 0.132399 | 83,392 | 2,105 | 7,672 | 39.616152 | 0.765767 | 0.024007 | 0 | 0.70229 | 1 | 0.010687 | 0.151879 | 0.108182 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.002036 | 0.002545 | 0 | 0.002545 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
64a0ffae558c9b19ccdb96e6568e328351f309fe | 1,490 | py | Python | ejercicio_nombre_phyton.py | juandab07/Algoritmos-y-programacion | f3c10f5c4620b15432ecfe2b9f5831437a49ace9 | [
"MIT"
] | null | null | null | ejercicio_nombre_phyton.py | juandab07/Algoritmos-y-programacion | f3c10f5c4620b15432ecfe2b9f5831437a49ace9 | [
"MIT"
] | null | null | null | ejercicio_nombre_phyton.py | juandab07/Algoritmos-y-programacion | f3c10f5c4620b15432ecfe2b9f5831437a49ace9 | [
"MIT"
] | null | null | null | from turtle import*
def j(n):
fd(100)
right(90)
fd(30)
right(90)
fd(35)
up()
fd(30)
down()
fd(35)
right(90)
fd(30)
up()
left(180)
fd(30)
left(90)
fd(35)
down()
right(90)
fd(100)
left(180)
up()
fd(100)
left(270)
fd(30)
right(90)
down()
fd(130)
right(90)
fd(65)
right(90)
fd(30)
right(90)
fd(35)
up()
left(90)
fd(130)
right(90)
def u(n):
up()
fd(100)
right(90)
down()
fd(160)
left(90)
fd(100)
left(90)
fd(160)
left(90)
fd(30)
left(90)
fd(130)
right(90)
fd(40)
right(90)
fd(130)
left(90)
fd(30)
def a(n):
up()
right(180)
fd(140)
right(90)
fd(160)
left(180)
down()
fd(160)
right(90)
fd(100)
right(90)
fd(160)
right(90)
fd(30)
right(90)
fd(80)
left(90)
fd(40)
left(90)
fd(80)
right(90)
fd(30)
up()
left(180)
fd(30)
left(90)
fd(100)
down()
for i in range(4):
fd(40)
right(90)
def n(n):
up()
fd(60)
right(90)
fd(120)
down()
fd(40)
right(40)
fd(80)
left(130)
fd(50)
right(90)
fd(50)
right(90)
fd(160)
right(90)
fd(40)
right(40)
fd(80)
left(130)
fd(50)
right(90)
fd(50)
right(90)
fd(160)
def name(m):
j(100),u(100),a(100),n(100)
name(100) | 12.016129 | 31 | 0.43557 | 238 | 1,490 | 2.726891 | 0.147059 | 0.191063 | 0.291217 | 0.084746 | 0.551618 | 0.439137 | 0.383667 | 0.323575 | 0.323575 | 0.249615 | 0 | 0.259711 | 0.395302 | 1,490 | 124 | 32 | 12.016129 | 0.460599 | 0 | 0 | 0.87395 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.042017 | false | 0 | 0.008403 | 0 | 0.05042 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
64ad74af3767388b10e3986487a9e0f85135989b | 73 | py | Python | Ex 1.py | norman-normandi/Learning | 16f598295595b35f40cab1fb9f86debb6c1b0bb4 | [
"MIT"
] | null | null | null | Ex 1.py | norman-normandi/Learning | 16f598295595b35f40cab1fb9f86debb6c1b0bb4 | [
"MIT"
] | null | null | null | Ex 1.py | norman-normandi/Learning | 16f598295595b35f40cab1fb9f86debb6c1b0bb4 | [
"MIT"
] | null | null | null | for i in range(1500,2701):
if (i%7==0) and (i%5==0):
print(i) | 24.333333 | 29 | 0.493151 | 16 | 73 | 2.25 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.226415 | 0.273973 | 73 | 3 | 30 | 24.333333 | 0.45283 | 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 | 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 |
64bbc7370f9f8bcd62808db1edb8fe24427637ea | 243 | py | Python | algorithms/implement_selection_sort/implement_selection_sort_test.py | JCPedroza/freeCodeCamp-coding-interview-prep-python | 56d40d42d127e98f2d8132e043054ba72cc5faaa | [
"MIT"
] | null | null | null | algorithms/implement_selection_sort/implement_selection_sort_test.py | JCPedroza/freeCodeCamp-coding-interview-prep-python | 56d40d42d127e98f2d8132e043054ba72cc5faaa | [
"MIT"
] | null | null | null | algorithms/implement_selection_sort/implement_selection_sort_test.py | JCPedroza/freeCodeCamp-coding-interview-prep-python | 56d40d42d127e98f2d8132e043054ba72cc5faaa | [
"MIT"
] | null | null | null | from implement_selection_sort import selection_sort as ssort
def test_empty_list():
assert ssort([]) == []
def test_one_item():
assert ssort([0]) == [0]
def test_small_sort():
assert ssort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]
| 17.357143 | 60 | 0.625514 | 39 | 243 | 3.666667 | 0.538462 | 0.146853 | 0.167832 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.062176 | 0.205761 | 243 | 13 | 61 | 18.692308 | 0.678756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | 1 | 0.428571 | true | 0 | 0.142857 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
64c71076e47486abfb40935f8fae509947f7b030 | 1,990 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/GREMEDY/frame_terminator.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/GREMEDY/frame_terminator.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/GREMEDY/frame_terminator.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''OpenGL extension GREMEDY.frame_terminator
This module customises the behaviour of the
OpenGL.raw.GL.GREMEDY.frame_terminator to provide a more
Python-friendly API
Overview (from the spec)
This extension defines a mechanism that enables marking the end
of render frames within the OpenGL stream.
When debugging or profiling an OpenGL application, the debuggers
and profilers needs to know when a render frame is ended. This
is important for frame per second measurements, statistical analysis,
marking and clearing stream loggers logs, performance counters
sampling and more.
When an application uses off screen buffers, the debugger / profiler
cannot be guaranteed that the application will call a certain function at
the end of each off-screen frame (e.g: SwapBuffers / glClear / etc).
This extension enables the application to notify the debugger / profiler
whenever a render frame is ended.
This extension is mainly useful for debuggers and profilers. It is not
expected that standard drivers would implement this extension. The main
point of having this extension is to allow applications to have a clean
way of accessing this functionality only when they are run under the
control of a debugger / profiler, without having to recompile or change
the application source code.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/GREMEDY/frame_terminator.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.GREMEDY.frame_terminator import *
from OpenGL.raw.GL.GREMEDY.frame_terminator import _EXTENSION_NAME
def glInitFrameTerminatorGREMEDY():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
### END AUTOGENERATED SECTION | 42.340426 | 75 | 0.782915 | 278 | 1,990 | 5.564748 | 0.503597 | 0.058824 | 0.071105 | 0.034906 | 0.106658 | 0.106658 | 0.055591 | 0.055591 | 0 | 0 | 0 | 0 | 0.177387 | 1,990 | 47 | 76 | 42.340426 | 0.945021 | 0.848241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | true | 0 | 0.777778 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
64de0e681095a0b2f1aa7507322d3b02f6f60947 | 5,034 | py | Python | messente_api/__init__.py | messente/messente-api-python | 154abca9e6a226a5c97d8052c3f2631765503426 | [
"Apache-2.0"
] | null | null | null | messente_api/__init__.py | messente/messente-api-python | 154abca9e6a226a5c97d8052c3f2631765503426 | [
"Apache-2.0"
] | null | null | null | messente_api/__init__.py | messente/messente-api-python | 154abca9e6a226a5c97d8052c3f2631765503426 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# flake8: noqa
"""
Messente API
[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. # noqa: E501
The version of the OpenAPI document: 1.4.0
Contact: messente@messente.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
__version__ = "1.4.1"
# import apis into sdk package
from messente_api.api.blacklist_api import BlacklistApi
from messente_api.api.contacts_api import ContactsApi
from messente_api.api.delivery_report_api import DeliveryReportApi
from messente_api.api.groups_api import GroupsApi
from messente_api.api.number_lookup_api import NumberLookupApi
from messente_api.api.omnimessage_api import OmnimessageApi
from messente_api.api.statistics_api import StatisticsApi
# import ApiClient
from messente_api.api_client import ApiClient
from messente_api.configuration import Configuration
from messente_api.exceptions import OpenApiException
from messente_api.exceptions import ApiTypeError
from messente_api.exceptions import ApiValueError
from messente_api.exceptions import ApiKeyError
from messente_api.exceptions import ApiAttributeError
from messente_api.exceptions import ApiException
# import models into sdk package
from messente_api.models.channel import Channel
from messente_api.models.contact_envelope import ContactEnvelope
from messente_api.models.contact_fields import ContactFields
from messente_api.models.contact_list_envelope import ContactListEnvelope
from messente_api.models.contact_response_fields import ContactResponseFields
from messente_api.models.contact_update_fields import ContactUpdateFields
from messente_api.models.delivery_report_response import DeliveryReportResponse
from messente_api.models.delivery_result import DeliveryResult
from messente_api.models.error_code_omnichannel import ErrorCodeOmnichannel
from messente_api.models.error_code_omnichannel_machine import ErrorCodeOmnichannelMachine
from messente_api.models.error_code_phonebook import ErrorCodePhonebook
from messente_api.models.error_code_statistics import ErrorCodeStatistics
from messente_api.models.error_item_number_lookup import ErrorItemNumberLookup
from messente_api.models.error_item_number_lookup_error import ErrorItemNumberLookupError
from messente_api.models.error_item_omnichannel import ErrorItemOmnichannel
from messente_api.models.error_item_phonebook import ErrorItemPhonebook
from messente_api.models.error_item_statistics import ErrorItemStatistics
from messente_api.models.error_number_lookup import ErrorNumberLookup
from messente_api.models.error_omnichannel import ErrorOmnichannel
from messente_api.models.error_phonebook import ErrorPhonebook
from messente_api.models.error_statistics import ErrorStatistics
from messente_api.models.error_title_omnichannel import ErrorTitleOmnichannel
from messente_api.models.error_title_phonebook import ErrorTitlePhonebook
from messente_api.models.fetch_blacklist_success import FetchBlacklistSuccess
from messente_api.models.group_envelope import GroupEnvelope
from messente_api.models.group_list_envelope import GroupListEnvelope
from messente_api.models.group_name import GroupName
from messente_api.models.group_response_fields import GroupResponseFields
from messente_api.models.message_result import MessageResult
from messente_api.models.mobile_network import MobileNetwork
from messente_api.models.number_to_blacklist import NumberToBlacklist
from messente_api.models.numbers_to_investigate import NumbersToInvestigate
from messente_api.models.omni_message_create_success_response import OmniMessageCreateSuccessResponse
from messente_api.models.omnimessage import Omnimessage
from messente_api.models.priority import Priority
from messente_api.models.sms import SMS
from messente_api.models.statistics_report import StatisticsReport
from messente_api.models.statistics_report_settings import StatisticsReportSettings
from messente_api.models.statistics_report_success import StatisticsReportSuccess
from messente_api.models.status import Status
from messente_api.models.sync_number_lookup_result import SyncNumberLookupResult
from messente_api.models.sync_number_lookup_success import SyncNumberLookupSuccess
from messente_api.models.telegram import Telegram
from messente_api.models.text_store import TextStore
from messente_api.models.viber import Viber
from messente_api.models.whats_app import WhatsApp
from messente_api.models.whats_app_audio import WhatsAppAudio
from messente_api.models.whats_app_document import WhatsAppDocument
from messente_api.models.whats_app_image import WhatsAppImage
from messente_api.models.whats_app_text import WhatsAppText
| 55.933333 | 473 | 0.883592 | 652 | 5,034 | 6.569018 | 0.269939 | 0.169507 | 0.227644 | 0.245155 | 0.331076 | 0.178847 | 0.056035 | 0.019612 | 0 | 0 | 0 | 0.002374 | 0.079658 | 5,034 | 89 | 474 | 56.561798 | 0.922081 | 0.140644 | 0 | 0 | 0 | 0 | 0.001165 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.985075 | 0 | 0.985075 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
b3b9f114d5292ee0425745449e43b6d6d2043b67 | 117 | py | Python | bullet_journal/exceptions.py | pinxiu/bullet_journal | 30264306fd4d3f2e4079259c8a09db1dcddab9f2 | [
"MIT"
] | 1 | 2020-12-17T04:18:46.000Z | 2020-12-17T04:18:46.000Z | bullet_journal/exceptions.py | pinxiu/bullet_journal | 30264306fd4d3f2e4079259c8a09db1dcddab9f2 | [
"MIT"
] | 1 | 2019-09-09T21:13:09.000Z | 2019-09-09T21:13:09.000Z | bullet_journal/exceptions.py | pinxiu/bullet_journal | 30264306fd4d3f2e4079259c8a09db1dcddab9f2 | [
"MIT"
] | 1 | 2020-04-29T14:38:39.000Z | 2020-04-29T14:38:39.000Z | class BulletJournalException(Exception):
"""Base class for all exceptions raised by bullet journal."""
pass
| 23.4 | 65 | 0.735043 | 13 | 117 | 6.615385 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179487 | 117 | 4 | 66 | 29.25 | 0.895833 | 0.470085 | 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 |
b3bb5cb1ecdcca2a100744e4798717d260dc1fac | 4,425 | py | Python | falcon/core/protocol/fbs/FalconEvent.py | jopereira/horus-tracer | 03671206f02c5ebea18f5682b346f59884e0a538 | [
"MIT"
] | null | null | null | falcon/core/protocol/fbs/FalconEvent.py | jopereira/horus-tracer | 03671206f02c5ebea18f5682b346f59884e0a538 | [
"MIT"
] | 1 | 2021-05-17T21:06:03.000Z | 2021-05-17T21:06:03.000Z | falcon/core/protocol/fbs/FalconEvent.py | jopereira/horus-tracer | 03671206f02c5ebea18f5682b346f59884e0a538 | [
"MIT"
] | 1 | 2021-05-17T17:14:32.000Z | 2021-05-17T17:14:32.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: fbs
import flatbuffers
class FalconEvent(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsFalconEvent(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = FalconEvent()
x.Init(buf, n + offset)
return x
# FalconEvent
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# FalconEvent
def Id(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# FalconEvent
def UserTime(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
return 0
# FalconEvent
def KernelTime(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
return 0
# FalconEvent
def Type(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0
# FalconEvent
def Pid(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
return 0
# FalconEvent
def Tid(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
return 0
# FalconEvent
def Comm(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# FalconEvent
def Host(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# FalconEvent
def EventType(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0
# FalconEvent
def Event(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
if o != 0:
from flatbuffers.table import Table
obj = Table(bytearray(), 0)
self._tab.Union(obj, o)
return obj
return None
# FalconEvent
def ExtraData(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
def FalconEventStart(builder): builder.StartObject(11)
def FalconEventAddId(builder, id): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(id), 0)
def FalconEventAddUserTime(builder, userTime): builder.PrependInt64Slot(1, userTime, 0)
def FalconEventAddKernelTime(builder, kernelTime): builder.PrependInt64Slot(2, kernelTime, 0)
def FalconEventAddType(builder, type): builder.PrependUint8Slot(3, type, 0)
def FalconEventAddPid(builder, pid): builder.PrependUint32Slot(4, pid, 0)
def FalconEventAddTid(builder, tid): builder.PrependUint32Slot(5, tid, 0)
def FalconEventAddComm(builder, comm): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(comm), 0)
def FalconEventAddHost(builder, host): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(host), 0)
def FalconEventAddEventType(builder, eventType): builder.PrependUint8Slot(8, eventType, 0)
def FalconEventAddEvent(builder, event): builder.PrependUOffsetTRelativeSlot(9, flatbuffers.number_types.UOffsetTFlags.py_type(event), 0)
def FalconEventAddExtraData(builder, extraData): builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(extraData), 0)
def FalconEventEnd(builder): return builder.EndObject()
| 38.815789 | 150 | 0.68565 | 536 | 4,425 | 5.518657 | 0.184701 | 0.078093 | 0.163624 | 0.189317 | 0.533469 | 0.533469 | 0.464165 | 0.464165 | 0.464165 | 0.464165 | 0 | 0.023395 | 0.20791 | 4,425 | 113 | 151 | 39.159292 | 0.820542 | 0.050847 | 0 | 0.390244 | 1 | 0 | 0.000956 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.317073 | false | 0 | 0.02439 | 0.012195 | 0.646341 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
b3be36bf02a65855156a9cd50f75d9d2ac08c1d2 | 143 | py | Python | pkg/storages/redis.py | GKAurora/Aurora2.0-WebAPI | d91a028115c449e77f07681f39cfd4dd25870137 | [
"MIT"
] | null | null | null | pkg/storages/redis.py | GKAurora/Aurora2.0-WebAPI | d91a028115c449e77f07681f39cfd4dd25870137 | [
"MIT"
] | null | null | null | pkg/storages/redis.py | GKAurora/Aurora2.0-WebAPI | d91a028115c449e77f07681f39cfd4dd25870137 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:file: redis.py
:author: -Farmer
:url: https://blog.farmer233.top
:date: 2021/06/23 00:40:09
'''
| 14.3 | 36 | 0.524476 | 20 | 143 | 3.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165138 | 0.237762 | 143 | 9 | 37 | 15.888889 | 0.522936 | 0.804196 | 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 |
b3c777b6c002f92742d1a3d502c9bf4ffbb8e845 | 100 | py | Python | web-frameworks/django/iWillTestEachApps/django_filter/apps.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | web-frameworks/django/iWillTestEachApps/django_filter/apps.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | web-frameworks/django/iWillTestEachApps/django_filter/apps.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class DjangoFilterConfig(AppConfig):
name = 'django_filter'
| 16.666667 | 36 | 0.78 | 11 | 100 | 7 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 100 | 5 | 37 | 20 | 0.905882 | 0 | 0 | 0 | 0 | 0 | 0.13 | 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 |
b3d753de21940d69037e8f17b08bda3f10a2b808 | 143 | py | Python | custom_components/colorfulclouds/__init__.py | mikal/colorfulclouds-hass | 2b01bb08b2452f53e6c13f65021769fd41a05785 | [
"MIT"
] | 22 | 2019-06-10T02:28:52.000Z | 2022-03-26T14:14:29.000Z | custom_components/colorfulclouds/__init__.py | mikal/colorfulclouds-hass | 2b01bb08b2452f53e6c13f65021769fd41a05785 | [
"MIT"
] | 3 | 2019-06-10T14:10:35.000Z | 2019-12-25T03:53:58.000Z | custom_components/colorfulclouds/__init__.py | mikal/colorfulclouds-hass | 2b01bb08b2452f53e6c13f65021769fd41a05785 | [
"MIT"
] | 6 | 2019-08-27T15:54:03.000Z | 2021-06-06T01:22:59.000Z | """
Component to integrate with 彩云天气.
For more details about this component, please refer to
https://github.com/jihao/colorfulclouds-hass
"""
| 20.428571 | 54 | 0.769231 | 20 | 143 | 5.5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125874 | 143 | 6 | 55 | 23.833333 | 0.88 | 0.937063 | 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 |
b3f3f9695bab413d909aed9e8cd942b89398360b | 176 | py | Python | password_generator/input_sanitise.py | rwgeaston/django-password-generator | 62607905bafc111802c61223a1c3c34aa927c9fc | [
"MIT"
] | null | null | null | password_generator/input_sanitise.py | rwgeaston/django-password-generator | 62607905bafc111802c61223a1c3c34aa927c9fc | [
"MIT"
] | null | null | null | password_generator/input_sanitise.py | rwgeaston/django-password-generator | 62607905bafc111802c61223a1c3c34aa927c9fc | [
"MIT"
] | null | null | null | import re
from unidecode import unidecode
def sanitise(word):
word = word.lower()
word = unidecode(word)
word = re.sub(r'[^a-z0-9\-]+', '', word)
return word
| 17.6 | 44 | 0.619318 | 25 | 176 | 4.36 | 0.56 | 0.220183 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014599 | 0.221591 | 176 | 9 | 45 | 19.555556 | 0.781022 | 0 | 0 | 0 | 0 | 0 | 0.068182 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
b3fc64e7965651fd3edbab2058ae7a67db382870 | 63 | py | Python | Pacotes/prova2.py | TonyRio/Python-Exercicios | 8a72d1b12418c6485794dae184425df0daf098bb | [
"MIT"
] | null | null | null | Pacotes/prova2.py | TonyRio/Python-Exercicios | 8a72d1b12418c6485794dae184425df0daf098bb | [
"MIT"
] | null | null | null | Pacotes/prova2.py | TonyRio/Python-Exercicios | 8a72d1b12418c6485794dae184425df0daf098bb | [
"MIT"
] | null | null | null | a = (i for i in range (300_000_000))
for i in a:
print(i)
| 10.5 | 37 | 0.587302 | 15 | 63 | 2.333333 | 0.533333 | 0.228571 | 0.342857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0.285714 | 63 | 5 | 38 | 12.6 | 0.577778 | 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 | 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 |
b6131ce5d9b4a595b80d59361402fc66f913654a | 18,065 | py | Python | setup.py | demis001/puticr | c510d4a6e2815011a839d9bd25eb8e4cdc05d2b7 | [
"MIT"
] | 1 | 2019-11-20T20:21:31.000Z | 2019-11-20T20:21:31.000Z | setup.py | demis001/puticr | c510d4a6e2815011a839d9bd25eb8e4cdc05d2b7 | [
"MIT"
] | 1 | 2021-11-15T17:48:25.000Z | 2021-11-15T17:48:25.000Z | setup.py | demis001/puticr | c510d4a6e2815011a839d9bd25eb8e4cdc05d2b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from __future__ import print_function
from setuptools import setup, find_packages
import os
import sys
import subprocess
import imp
if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **kwargs):
proc = subprocess.Popen(
cmd_args, *args,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
out, err = proc.communicate()
if proc.returncode != 0:
raise subprocess.CalledProcessError(args)
return out
subprocess.check_output = check_output
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from distutils import spawn
from glob import glob
try:
import colorama
colorama.init() # Initialize colorama on Windows
except ImportError:
# Don't require colorama just for running paver tasks. This allows us to
# run `paver install' without requiring the user to first have colorama
# installed.
pass
# Add the current directory to the module search path
sys.path.insert(0, os.path.abspath('.'))
#Constants
CODE_DIRECTORY = 'puticr'
DOCS_DIRECTORY = 'docs'
TESTS_DIRECTORY = 'tests'
PYTEST_FLAGS = ['--doctest-modules']
# Import metadata
metadata = imp.load_source(
'metadata', os.path.join(CODE_DIRECTORY, 'metadata.py'))
## Miscellaneous helper functions
def get_project_files():
"""Retrieve a list of project files, ignoring hidden files.
:return: sorted list of project files
:rtype: :class:`list`
"""
if is_git_project() and has_git():
return get_git_project_files()
project_files = []
for top, subdirs, files in os.walk('.'):
for subdir in subdirs:
if subdir.startswith('.'):
subdirs.remove(subdir)
for f in files:
if f.startswith('.'):
continue
project_files.append(os.path.join(top, f))
return project_files
def is_git_project():
return os.path.isdir('.git')
def has_git():
return bool(spawn.find_executable("git"))
def get_git_project_files():
"""Retrieve a list of all non-ignored files, including untracked files,
excluding deleted files.
:return: sorted list of git project files
:rtype: :class:`list`
"""
cached_and_untracked_files = git_ls_files(
'--cached', # All files cached in the index
'--others', # Untracked files
# Exclude untracked files that would be excluded by .gitignore, etc.
'--exclude-standard')
uncommitted_deleted_files = git_ls_files('--deleted')
# Since sorting of files in a set is arbitrary, return a sorted list to
# provide a well-defined order to tools like flake8, etc.
return sorted(cached_and_untracked_files - uncommitted_deleted_files)
def git_ls_files(*cmd_args):
"""Run ``git ls-files`` in the top-level project directory. Arguments go
directly to execution call.
:return: set of file names
:rtype: :class:`set`
"""
cmd = ['git', 'ls-files']
cmd.extend(cmd_args)
return set(subprocess.check_output(cmd).splitlines())
def print_success_message(message):
"""Print a message indicating success in green color to STDOUT.
:param message: the message to print
:type message: :class:`str`
"""
try:
import colorama
print(colorama.Fore.GREEN + message + colorama.Fore.RESET)
except ImportError:
print(message)
def print_failure_message(message):
"""Print a message indicating failure in red color to STDERR.
:param message: the message to print
:type message: :class:`str`
"""
try:
import colorama
print(colorama.Fore.RED + message + colorama.Fore.RESET,
file=sys.stderr)
except ImportError:
print(message, file=sys.stderr)
def read(filename):
"""Return the contents of a file.
:param filename: file path
:type filename: :class:`str`
:return: the file's content
:rtype: :class:`str`
"""
with open(os.path.join(os.path.dirname(__file__), filename)) as f:
return f.read()
def _lint():
"""Run lint and return an exit code."""
# Flake8 doesn't have an easy way to run checks using a Python function, so
# just fork off another process to do it.
# Python 3 compat:
# - The result of subprocess call outputs are byte strings, meaning we need
# to pass a byte string to endswith.
project_python_files = [filename for filename in get_project_files()
if filename.endswith(b'.py')]
retcode = subprocess.call(
['flake8', '--max-complexity=10'] + project_python_files)
if retcode == 0:
print_success_message('No style errors')
return retcode
def _test():
"""Run the unit tests.
:return: exit code
"""
# Make sure to import pytest in this function. For the reason, see here:
# <http://pytest.org/latest/goodpractises.html#integration-with-setuptools-test-commands> # NOPEP8
import pytest
# This runs the unit tests.
# It also runs doctest, but only on the modules in TESTS_DIRECTORY.
return pytest.main(PYTEST_FLAGS + [TESTS_DIRECTORY])
def _test_all():
"""Run lint and tests.
:return: exit code
"""
return _lint() + _test()
class TestAllCommand(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
# These are fake, and just set to appease distutils and setuptools.
self.test_suite = True
self.test_args = []
def run_tests(self):
raise SystemExit(_test_all())
# define install_requires for specific Python versions
python_version_specific_requires = []
# as of Python >= 2.7 and >= 3.2, the argparse module is maintained within
# the Python standard library, otherwise we install it as a separate package
if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 3):
python_version_specific_requires.append('argparse')
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['Click>=6.0', ]
setup_requirements = ['pytest-runner', ]
test_requirements = ['pytest', ]
#GLOBDIR = glob('puticr/download/cgmaptools-0.1.2/bin/CG*')
setup_dict = dict(
author="Dereje Jima",
author_email='ddjima2014@gmail.com',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
description="Program to idenentify putative imprint control region (ICR) from Whole genome methylation data.",
entry_points={
'console_scripts': [
'puticr_cli=puticr.main:main',
],
},
install_requires=requirements,
license='MIT',
long_description=readme + '\n\n' + history,
include_package_data=True,
keywords='puticr',
name='puticr',
packages=find_packages(include=['puticr']),
setup_requires=setup_requirements,
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/demis001/puticr',
version='0.1.0',
zip_safe=False,
scripts = [
'puticr/download/TrimGalore-0.5.0/trim_galore',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-align-l',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-align-l-debug',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-inspect-l-debug',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-align-s-debug',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-inspect-s-debug',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-build-l',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-build-l-debug',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-inspect-s',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-build-s-debug',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-align-s',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-build-s',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-inspect',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-inspect-l',
'puticr/download/bowtie2-2.3.4.3-linux-x86_64/bowtie2-build',
'puticr/download/samtools/samtools',
'puticr/download/cgmaptools-0.1.2/bin/ATCGbzFetchRegion',
'puticr/download/cgmaptools-0.1.2/bin/ATCGbzToATCGmap',
'puticr/download/cgmaptools-0.1.2/bin/ATCGmapMerge',
'puticr/download/cgmaptools-0.1.2/bin/ATCGmapToATCGbz',
'puticr/download/cgmaptools-0.1.2/bin/CGbzFetchRegion',
'puticr/download/cgmaptools-0.1.2/bin/CGbzToCGmap',
'puticr/download/cgmaptools-0.1.2/bin/CGmapFromBAM',
'puticr/download/cgmaptools-0.1.2/bin/CGmapMethInBed',
'puticr/download/cgmaptools-0.1.2/bin/CGmapMethInFragReg',
'puticr/download/cgmaptools-0.1.2/bin/CGmapSelectByRegion',
'puticr/download/cgmaptools-0.1.2/bin/CGmapToCGbz',
'puticr/download/bedops24/bin/starchcluster_gnuParallel-float128',
'puticr/download/bedops24/bin/starchcluster_gnuParallel-megarow',
'puticr/download/bedops24/bin/starchcluster_gnuParallel-typical',
'puticr/download/bedops24/bin/starchcluster_sge',
'puticr/download/bedops24/bin/starchcluster_sge-float128',
'puticr/download/bedops24/bin/starchcluster_sge-megarow',
'puticr/download/bedops24/bin/starchcluster_sge-typical',
'puticr/download/bedops24/bin/starchcluster_slurm',
'puticr/download/bedops24/bin/starchcluster_slurm-float128',
'puticr/download/bedops24/bin/starchcluster_slurm-megarow',
'puticr/download/bedops24/bin/starchcluster_slurm-typical',
'puticr/download/bedops24/bin/starch-diff',
'puticr/download/bedops24/bin/starch-diff-float128',
'puticr/download/bedops24/bin/starch-diff-megarow',
'puticr/download/bedops24/bin/starch-diff-typical',
'puticr/download/bedops24/bin/starch-float128',
'puticr/download/bedops24/bin/starch-megarow',
'puticr/download/bedops24/bin/starchstrip',
'puticr/download/bedops24/bin/starchstrip-float128',
'puticr/download/bedops24/bin/starchstrip-megarow',
'puticr/download/bedops24/bin/starchstrip-typical',
'puticr/download/bedops24/bin/starch-typical',
'puticr/download/bedops24/bin/switch-BEDOPS-binary-type',
'puticr/download/bedops24/bin/unstarch',
'puticr/download/bedops24/bin/unstarch-float128',
'puticr/download/bedops24/bin/unstarch-megarow',
'puticr/download/bedops24/bin/unstarch-typical',
'puticr/download/bedops24/bin/update-sort-bed-migrate-candidates',
'puticr/download/bedops24/bin/update-sort-bed-migrate-candidates-float128',
'puticr/download/bedops24/bin/update-sort-bed-migrate-candidates-megarow',
'puticr/download/bedops24/bin/update-sort-bed-migrate-candidates-typical',
'puticr/download/bedops24/bin/update-sort-bed-slurm',
'puticr/download/bedops24/bin/update-sort-bed-slurm-float128',
'puticr/download/bedops24/bin/update-sort-bed-slurm-megarow',
'puticr/download/bedops24/bin/update-sort-bed-slurm-typical',
'puticr/download/bedops24/bin/update-sort-bed-starch-slurm',
'puticr/download/bedops24/bin/update-sort-bed-starch-slurm-float128',
'puticr/download/bedops24/bin/update-sort-bed-starch-slurm-megarow',
'puticr/download/bedops24/bin/update-sort-bed-starch-slurm-typical',
'puticr/download/bedops24/bin/vcf2bed',
'puticr/download/bedops24/bin/vcf2bed-float128',
'puticr/download/bedops24/bin/vcf2bed-megarow',
'puticr/download/bedops24/bin/vcf2bed-typical',
'puticr/download/bedops24/bin/vcf2starch',
'puticr/download/bedops24/bin/vcf2starch-float128',
'puticr/download/bedops24/bin/vcf2starch-megarow',
'puticr/download/bedops24/bin/vcf2starch-typical',
'puticr/download/bedops24/bin/wig2bed',
'puticr/download/bedops24/bin/wig2bed-float128',
'puticr/download/bedops24/bin/wig2bed-megarow',
'puticr/download/bedops24/bin/wig2bed-typical',
'puticr/download/bedops24/bin/wig2starch',
'puticr/download/bedops24/bin/wig2starch-float128',
'puticr/download/bedops24/bin/wig2starch-megarow',
'puticr/download/bedops24/bin/wig2starch-typical',
'puticr/download/bedops24/bin/bam2bed',
'puticr/download/bedops24/bin/bam2bed-float128',
'puticr/download/bedops24/bin/bam2bed_gnuParallel',
'puticr/download/bedops24/bin/bam2bed_gnuParallel-float128',
'puticr/download/bedops24/bin/bam2bed_gnuParallel-megarow',
'puticr/download/bedops24/bin/bam2bed_gnuParallel-typical',
'puticr/download/bedops24/bin/bam2bed-megarow',
'puticr/download/bedops24/bin/bam2bed_sge',
'puticr/download/bedops24/bin/bam2bed_sge-float128',
'puticr/download/bedops24/bin/bam2bed_sge-megarow',
'puticr/download/bedops24/bin/bam2bed_sge-typical',
'puticr/download/bedops24/bin/bam2bed_slurm',
'puticr/download/bedops24/bin/bam2bed_slurm-float128',
'puticr/download/bedops24/bin/bam2bed_slurm-megarow',
'puticr/download/bedops24/bin/bam2bed_slurm-typical',
'puticr/download/bedops24/bin/bam2bed-typical',
'puticr/download/bedops24/bin/bam2starch',
'puticr/download/bedops24/bin/bam2starch-float128',
'puticr/download/bedops24/bin/bam2starch_gnuParallel',
'puticr/download/bedops24/bin/bam2starch_gnuParallel-float128',
'puticr/download/bedops24/bin/bam2starch_gnuParallel-megarow',
'puticr/download/bedops24/bin/bam2starch_gnuParallel-typical',
'puticr/download/bedops24/bin/bam2starch-megarow',
'puticr/download/bedops24/bin/bam2starch_sge',
'puticr/download/bedops24/bin/bam2starch_sge-float128',
'puticr/download/bedops24/bin/bam2starch_sge-megarow',
'puticr/download/bedops24/bin/bam2starch_sge-typical',
'puticr/download/bedops24/bin/bam2starch_slurm',
'puticr/download/bedops24/bin/bam2starch_slurm-float128',
'puticr/download/bedops24/bin/bam2starch_slurm-megarow',
'puticr/download/bedops24/bin/bam2starch_slurm-typical',
'puticr/download/bedops24/bin/bam2starch-typical',
'puticr/download/bedops24/bin/bedextract',
'puticr/download/bedops24/bin/bedextract-float128',
'puticr/download/bedops24/bin/bedextract-megarow',
'puticr/download/bedops24/bin/bedextract-typical',
'puticr/download/bedops24/bin/bedmap',
'puticr/download/bedops24/bin/bedmap-float128',
'puticr/download/bedops24/bin/bedmap-megarow',
'puticr/download/bedops24/bin/bedmap-typical',
'puticr/download/bedops24/bin/bedops',
'puticr/download/bedops24/bin/bedops-float128',
'puticr/download/bedops24/bin/bedops-megarow',
'puticr/download/bedops24/bin/bedops-typical',
'puticr/download/bedops24/bin/closest-features',
'puticr/download/bedops24/bin/closest-features-float128',
'puticr/download/bedops24/bin/closest-features-megarow',
'puticr/download/bedops24/bin/closest-features-typical',
'puticr/download/bedops24/bin/convert2bed',
'puticr/download/bedops24/bin/convert2bed-float128',
'puticr/download/bedops24/bin/convert2bed-megarow',
'puticr/download/bedops24/bin/convert2bed-typical',
'puticr/download/bedops24/bin/gff2bed',
'puticr/download/bedops24/bin/gff2bed-float128',
'puticr/download/bedops24/bin/gff2bed-megarow',
'puticr/download/bedops24/bin/gff2bed-typical',
'puticr/download/bedops24/bin/gff2starch',
'puticr/download/bedops24/bin/gff2starch-float128',
'puticr/download/bedops24/bin/gff2starch-megarow',
'puticr/download/bedops24/bin/gff2starch-typical',
'puticr/download/bedops24/bin/gtf2bed',
'puticr/download/bedops24/bin/gtf2bed-float128',
'puticr/download/bedops24/bin/gtf2bed-megarow',
'puticr/download/bedops24/bin/gtf2bed-typical',
'puticr/download/bedops24/bin/gtf2starch',
'puticr/download/bedops24/bin/gtf2starch-float128',
'puticr/download/bedops24/bin/gtf2starch-megarow',
'puticr/download/bedops24/bin/gtf2starch-typical',
'puticr/download/bedops24/bin/gvf2bed',
'puticr/download/bedops24/bin/gvf2bed-float128',
'puticr/download/bedops24/bin/gvf2bed-megarow',
'puticr/download/bedops24/bin/gvf2bed-typical',
'puticr/download/bedops24/bin/gvf2starch',
'puticr/download/bedops24/bin/gvf2starch-float128',
'puticr/download/bedops24/bin/gvf2starch-megarow',
'puticr/download/bedops24/bin/gvf2starch-typical',
'puticr/download/bedops24/bin/sort-bed',
'puticr/download/bedops24/bin/sort-bed-float128',
'puticr/download/bedops24/bin/sort-bed-megarow',
'puticr/download/bedops24/bin/sort-bed-typical',
],
package_data = {
'puticr': ['files/*'],
},
)
# def runTasks():
# """ Run paver taks
# """
# cmd = "paver install"/data1/jimaprogramming/python/puticr/puticr/bin
# return subprocess.Popen(cmd, shell=True).communicate()
def main():
#setup(**setup_dict)
try:
import paver.tasks
except ImportError:
if os.path.exists("paver-minilib.zip"):
sys.path.insert(0, "paver-minilib.zip")
else:
raise ValueError("No paver in the path")
import paver.tasks
paver.tasks.main()
#runTasks()
if __name__ == '__main__':
main()
| 40.686937 | 114 | 0.693994 | 2,210 | 18,065 | 5.591403 | 0.186878 | 0.185806 | 0.24035 | 0.273125 | 0.591244 | 0.378975 | 0.187262 | 0.127053 | 0.117181 | 0.074128 | 0 | 0.045921 | 0.17426 | 18,065 | 443 | 115 | 40.778781 | 0.782463 | 0.088901 | 0 | 0.055901 | 0 | 0.043478 | 0.58473 | 0.526251 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.003106 | 0.062112 | null | null | 0.02795 | 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 | 1 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
3733e1f03086d10263a315ab8de78f7640ad37d4 | 359 | py | Python | web-api/api/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | 1 | 2021-09-12T16:28:52.000Z | 2021-09-12T16:28:52.000Z | web-api/api/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | 2 | 2021-09-06T08:31:56.000Z | 2021-09-06T08:35:25.000Z | web-api/api/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | null | null | null | from dj_rest_auth.registration.views import SocialLoginView
from allauth.socialaccount.providers.vk.views import VKOAuth2Adapter
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
class VKLoginView(SocialLoginView):
adapter_class = VKOAuth2Adapter
class GoogleLoginView(SocialLoginView):
adapter_class = GoogleOAuth2Adapter | 39.888889 | 76 | 0.86351 | 36 | 359 | 8.5 | 0.527778 | 0.107843 | 0.156863 | 0.215686 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012195 | 0.086351 | 359 | 9 | 77 | 39.888889 | 0.920732 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
375010deab91047b8769ae6057d6e8be34209eae | 35 | py | Python | Beginner/1921.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Beginner/1921.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Beginner/1921.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | n = int(input())
print(n*(n-3)//2)
| 11.666667 | 17 | 0.514286 | 8 | 35 | 2.25 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.064516 | 0.114286 | 35 | 2 | 18 | 17.5 | 0.516129 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
377619974f6ba6fbc8f0f2f88e1ce96a7e48ec1f | 212 | py | Python | modules/dbnd/src/dbnd/api/runs.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | modules/dbnd/src/dbnd/api/runs.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | modules/dbnd/src/dbnd/api/runs.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | from dbnd._core.current import get_databand_context
def kill_run(run_uid, ctx=None):
ctx = ctx or get_databand_context()
return ctx.databand_api_client.api_request(endpoint="runs/stop", data=[run_uid])
| 30.285714 | 84 | 0.778302 | 34 | 212 | 4.529412 | 0.676471 | 0.142857 | 0.233766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117925 | 212 | 6 | 85 | 35.333333 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0.042453 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
37c447224e83151d14c8329a039e50b75a43c59b | 2,244 | py | Python | architectures/providers/azure/office365.py | marinmuso/architectures | d824056e6e69cdb06db31562a1fb71af058892c0 | [
"MIT"
] | 15 | 2021-01-18T02:46:12.000Z | 2021-08-23T20:10:22.000Z | architectures/providers/azure/office365.py | marinmuso/architectures | d824056e6e69cdb06db31562a1fb71af058892c0 | [
"MIT"
] | 77 | 2021-01-11T05:01:30.000Z | 2021-08-15T22:39:19.000Z | architectures/providers/azure/office365.py | marinmuso/architectures | d824056e6e69cdb06db31562a1fb71af058892c0 | [
"MIT"
] | 2 | 2021-01-10T19:28:13.000Z | 2021-08-12T19:06:45.000Z | # Do not modify this file directly. It is auto-generated with Python.
from architectures.providers import _Azure
class _Office365(_Azure):
_service_type = "office365"
_icon_dir = "icons/azure/office365"
class O365Stream(_Office365):
_icon = "o365-stream.png"
_default_label = "O365 Stream"
class O365Publisher(_Office365):
_icon = "o365-publisher.png"
_default_label = "O365 Publisher"
class O365Visio(_Office365):
_icon = "o365-visio.png"
_default_label = "O365 Visio"
class O365Onenote(_Office365):
_icon = "o365-onenote.png"
_default_label = "O365 Onenote"
class O365Delve(_Office365):
_icon = "o365-delve.png"
_default_label = "O365 Delve"
class O365Outlook(_Office365):
_icon = "o365-outlook.png"
_default_label = "O365 Outlook"
class O365Yammer(_Office365):
_icon = "o365-yammer.png"
_default_label = "O365 Yammer"
class O365Sharepoint(_Office365):
_icon = "o365-sharepoint.png"
_default_label = "O365 Sharepoint"
class O365Powerpoint(_Office365):
_icon = "o365-powerpoint.png"
_default_label = "O365 Powerpoint"
class O365Access(_Office365):
_icon = "o365-access.png"
_default_label = "O365 Access"
class O365Dynamics(_Office365):
_icon = "o365-dynamics.png"
_default_label = "O365 Dynamics"
class O365Sway(_Office365):
_icon = "o365-sway.png"
_default_label = "O365 Sway"
class O365Forms(_Office365):
_icon = "o365-forms.png"
_default_label = "O365 Forms"
class O365Teams(_Office365):
_icon = "o365-teams.png"
_default_label = "O365 Teams"
class O365List(_Office365):
_icon = "o365-list.png"
_default_label = "O365 List"
class O365Excel(_Office365):
_icon = "o365-excel.png"
_default_label = "O365 Excel"
class O365(_Office365):
_icon = "o365.png"
_default_label = "O365"
class O365Planner(_Office365):
_icon = "o365-planner.png"
_default_label = "O365 Planner"
class O365Exchange(_Office365):
_icon = "o365-exchange.png"
_default_label = "O365 Exchange"
class O365Onedrive(_Office365):
_icon = "o365-onedrive.png"
_default_label = "O365 Onedrive"
class O365Project(_Office365):
_icon = "o365-project.png"
_default_label = "O365 Project" | 24.659341 | 69 | 0.707665 | 257 | 2,244 | 5.824903 | 0.264591 | 0.191049 | 0.238477 | 0.266533 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142312 | 0.182709 | 2,244 | 91 | 70 | 24.659341 | 0.673937 | 0.029857 | 0 | 0 | 1 | 0 | 0.269301 | 0.009651 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.014925 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
80671b40701fd6e368f9c11996b035795916aadd | 173 | py | Python | __main__.py | helvecioneto/sdt2 | 36e6e134e92dfd7ae4c65a255d0b2d275cd2168f | [
"Apache-2.0"
] | 1 | 2020-07-13T17:26:30.000Z | 2020-07-13T17:26:30.000Z | __main__.py | helvecioneto/sdt | e10ee2696dc767a7fe3ad0cac00af29f38ef1609 | [
"Apache-2.0"
] | null | null | null | __main__.py | helvecioneto/sdt | e10ee2696dc767a7fe3ad0cac00af29f38ef1609 | [
"Apache-2.0"
] | null | null | null |
#from modules.main_menu import main_menu
from __init__ import *
if __name__ == "__main__":
### Usar menus
# mainMenu()
## Processamento direto
main_qualify() | 19.222222 | 40 | 0.687861 | 20 | 173 | 5.2 | 0.7 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208092 | 173 | 9 | 41 | 19.222222 | 0.759124 | 0.473988 | 0 | 0 | 0 | 0 | 0.095238 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
807a86bd48e121eaea227531a8c95015af3067b8 | 4,344 | py | Python | tests/test_wps_generic_shape_properties.py | davidcaron/raven | c8dd818e42b81120acf57cef0a340f42785074cf | [
"MIT"
] | null | null | null | tests/test_wps_generic_shape_properties.py | davidcaron/raven | c8dd818e42b81120acf57cef0a340f42785074cf | [
"MIT"
] | null | null | null | tests/test_wps_generic_shape_properties.py | davidcaron/raven | c8dd818e42b81120acf57cef0a340f42785074cf | [
"MIT"
] | null | null | null | import json
import numpy as np
from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for, TESTDATA, CFG_FILE, get_output
from raven.processes import ShapePropertiesProcess
class TestGenericShapePropertiesProcess:
def test_simple(self):
client = client_for(Service(processes=[ShapePropertiesProcess(), ], cfgfiles=CFG_FILE))
fields = ['shape=file@xlink:href=file://{file}', 'crs={crs}', 'projected_crs={projected_crs}']
datainputs = ';'.join(fields).format(
file=TESTDATA['watershed_vector'],
crs=4326,
projected_crs=32198
)
resp = client.get(
service='WPS', request='Execute', version='1.0.0', identifier='shape-properties', datainputs=datainputs)
assert_response_success(resp)
out = get_output(resp.xml)
assert {'properties'}.issubset([*out])
props = json.loads(out['properties'])
assert {'centroid', 'area', 'perimeter', 'gravelius'}.issubset(props[0].keys())
np.testing.assert_approx_equal(props[0]['area'], 44877188052)
np.testing.assert_approx_equal(props[0]['centroid'][0], -72.69128332)
np.testing.assert_approx_equal(props[0]['centroid'][1], 49.50119363)
np.testing.assert_approx_equal(props[0]['perimeter'], 1861151.69970881)
np.testing.assert_approx_equal(props[0]['gravelius'], 2.4783578)
def test_geographic_epsg(self):
"""Calculate the geometric properties using degree-length units"""
client = client_for(Service(processes=[ShapePropertiesProcess(), ], cfgfiles=CFG_FILE))
fields = ['shape=file@xlink:href=file://{file}', 'crs={crs}', 'projected_crs={projected_crs}']
datainputs = ';'.join(fields).format(
file=TESTDATA['watershed_vector'],
crs=4326,
projected_crs=4326
)
resp = client.get(
service='WPS', request='Execute', version='1.0.0', identifier='shape-properties', datainputs=datainputs)
assert_response_success(resp)
out = get_output(resp.xml)
assert {'properties'}.issubset([*out])
props = json.loads(out['properties'])
assert {'centroid', 'area', 'perimeter', 'gravelius'}.issubset(props[0].keys())
np.testing.assert_approx_equal(props[0]['area'], 5.63123920)
np.testing.assert_approx_equal(props[0]['centroid'][0], -72.69128332)
np.testing.assert_approx_equal(props[0]['centroid'][1], 49.50119363)
np.testing.assert_approx_equal(props[0]['perimeter'], 20.464501)
np.testing.assert_approx_equal(props[0]['gravelius'], 2.4327318)
def test_multifeature_shape(self):
"""Calculate shape properties for multiple features in a shape"""
client = client_for(Service(processes=[ShapePropertiesProcess(), ], cfgfiles=CFG_FILE))
fields = ['shape=file@xlink:href=file://{file}', 'crs={crs}', 'projected_crs={projected_crs}']
datainputs = ';'.join(fields).format(
file=TESTDATA['mrc_subset'],
crs=4326,
projected_crs=32198
)
resp = client.get(
service='WPS', request='Execute', version='1.0.0', identifier='shape-properties', datainputs=datainputs)
assert_response_success(resp)
out = get_output(resp.xml)
assert {'properties'}.issubset([*out])
props = json.loads(out['properties'])
for i in range(len(props)):
assert {'centroid', 'area', 'perimeter', 'gravelius'}.issubset(props[i].keys())
np.testing.assert_approx_equal(props[0]['area'], 111417901.6141605)
np.testing.assert_approx_equal(props[0]['centroid'][0], -71.8223648)
np.testing.assert_approx_equal(props[0]['centroid'][1], 48.8974365)
np.testing.assert_approx_equal(props[0]['perimeter'], 46351.1628725)
np.testing.assert_approx_equal(props[0]['gravelius'], 1.2387344)
np.testing.assert_approx_equal(props[-1]['area'], 334136220.2845515)
np.testing.assert_approx_equal(props[-1]['centroid'][0], -72.6117018)
np.testing.assert_approx_equal(props[-1]['centroid'][1], 46.3632907)
np.testing.assert_approx_equal(props[-1]['perimeter'], 92477.3057504)
np.testing.assert_approx_equal(props[-1]['gravelius'], 1.4271461)
| 42.174757 | 116 | 0.654696 | 512 | 4,344 | 5.404297 | 0.224609 | 0.065052 | 0.108421 | 0.151789 | 0.777015 | 0.777015 | 0.777015 | 0.724611 | 0.666064 | 0.591615 | 0 | 0.077207 | 0.188996 | 4,344 | 102 | 117 | 42.588235 | 0.708203 | 0.027624 | 0 | 0.547945 | 0 | 0 | 0.156421 | 0.045573 | 0 | 0 | 0 | 0 | 0.410959 | 1 | 0.041096 | false | 0 | 0.082192 | 0 | 0.136986 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
809cdd389489664cf904614b417a4524aca1a3cd | 26 | py | Python | tests/__init__.py | danielhoherd/plexdl | 31b07f8f993fd0fcd68846c35e39629368e858e8 | [
"MIT"
] | 23 | 2017-09-29T21:55:11.000Z | 2022-02-04T11:11:42.000Z | tests/__init__.py | danielhoherd/plexdl | 31b07f8f993fd0fcd68846c35e39629368e858e8 | [
"MIT"
] | 5 | 2019-04-05T13:12:26.000Z | 2022-03-31T15:50:11.000Z | tests/__init__.py | danielhoherd/plexdl | 31b07f8f993fd0fcd68846c35e39629368e858e8 | [
"MIT"
] | 2 | 2020-05-13T13:54:34.000Z | 2021-05-19T23:22:36.000Z | """plexdl test module."""
| 13 | 25 | 0.615385 | 3 | 26 | 5.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 26 | 1 | 26 | 26 | 0.695652 | 0.730769 | 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 |
80a4bb6976859528e406ee133872e0e468149140 | 616 | py | Python | dist/python/cocktail/minimizer_ring.py | natir/coktail | bdb37edffb5ddb9df34b15f5938a9f7794cf7b20 | [
"MIT"
] | 5 | 2020-07-20T12:32:03.000Z | 2021-09-03T09:57:20.000Z | dist/python/cocktail/minimizer_ring.py | natir/coktail | bdb37edffb5ddb9df34b15f5938a9f7794cf7b20 | [
"MIT"
] | null | null | null | dist/python/cocktail/minimizer_ring.py | natir/coktail | bdb37edffb5ddb9df34b15f5938a9f7794cf7b20 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from ._lowlevel import ffi, lib
from .utils import RustObject
class MinimizerRing(RustObject):
__dealloc_func__ = lib.cocktail_minimizerring_free
def __init__(self, k: int, m: int, kmer: int):
self._objptr = lib.cocktail_minimizerring_new(k, m, kmer)
def populate_buffer(self, kmer: int):
self._methodcall(lib.cocktail_minimizerring_populate_buffer, kmer)
def add_kmer(self, kmer: int):
self._methodcall(lib.cocktail_minimizerring_add_kmer, kmer)
def get_mini(self) -> int:
return self._methodcall(lib.cocktail_minimizerring_get_mini)
| 29.333333 | 74 | 0.733766 | 81 | 616 | 5.209877 | 0.407407 | 0.130332 | 0.28436 | 0.177725 | 0.322275 | 0.232227 | 0.232227 | 0.232227 | 0 | 0 | 0 | 0 | 0.172078 | 616 | 20 | 75 | 30.8 | 0.827451 | 0.032468 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0.083333 | 0.75 | 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 |
80aad63c51e7fdf37aa67e738b373cb06bbfc3a9 | 1,031 | py | Python | scrap_jobs/analysis/save.py | andytan0727/scrap-jobs | b03ca1b4b21e4e10e653d20e8a35d08cf1b70ab7 | [
"MIT"
] | null | null | null | scrap_jobs/analysis/save.py | andytan0727/scrap-jobs | b03ca1b4b21e4e10e653d20e8a35d08cf1b70ab7 | [
"MIT"
] | 2 | 2021-03-31T19:14:07.000Z | 2021-12-13T20:06:00.000Z | scrap_jobs/analysis/save.py | andytan0727/scrap-jobs | b03ca1b4b21e4e10e653d20e8a35d08cf1b70ab7 | [
"MIT"
] | null | null | null | """
This module contains function to save scrapped data into local file system
"""
import os
from pandas import DataFrame
def save_to_csv(df: DataFrame, filename: str) -> None:
"""Save dataframe as csv file in data/ folder
Args:
df (DataFrame): Pandas DataFrame instance
filename (str): Filename of the new file
"""
if not isinstance(df, DataFrame):
raise TypeError('Argument 1 must be an instance of pandas DataFrame.')
save_path = os.path.join(os.path.curdir, 'data', filename)
df.to_csv(save_path)
def save_to_excel(df: DataFrame, filename: str) -> None:
"""Save dataframe as excel file in data/ folder
Args:
df (DataFrame): Pandas DataFrame instance
filename (str): Filename of the new file
"""
if not isinstance(df, DataFrame):
raise TypeError('Argument 1 must be an instance of pandas DataFrame.')
save_path = os.path.join(os.path.curdir, 'data', filename)
df.to_excel(save_path)
| 27.131579 | 79 | 0.651794 | 140 | 1,031 | 4.728571 | 0.321429 | 0.099698 | 0.02719 | 0.066465 | 0.767372 | 0.767372 | 0.767372 | 0.767372 | 0.643505 | 0.643505 | 0 | 0.002604 | 0.255092 | 1,031 | 37 | 80 | 27.864865 | 0.859375 | 0.349176 | 0 | 0.5 | 0 | 0 | 0.189003 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.333333 | 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 |
80be17233c602c8f51be2ea8c7a54d0e0730faaf | 1,041 | py | Python | models/exceptions.py | oyeyemidamilola/samba-model | 5f51a8303a43227667f6c561c028600f69358372 | [
"MIT"
] | 1 | 2020-03-17T20:41:28.000Z | 2020-03-17T20:41:28.000Z | models/exceptions.py | oyeyemidamilola/samba-model | 5f51a8303a43227667f6c561c028600f69358372 | [
"MIT"
] | null | null | null | models/exceptions.py | oyeyemidamilola/samba-model | 5f51a8303a43227667f6c561c028600f69358372 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 17 22:41:00 2019
@author: USER
"""
class InvalidExtensionError(Exception):
def __init__(self,message):
super().__init__(message)
self.message = message
def __str__(self):
return self.message
class InvalidModelFile(Exception):
def __init__(self,message):
super().__init__(self,message)
self.message = message
def __str__(self):
return self.message
class IncompleteInitialParameters(Exception):
def __init__(self,**kwargs):
super().__init__(self,kwargs['message'])
self.message = kwargs['message']
self.parameter = kwargs['param']
def __str__(self):
return self.message
class InvalidInputs(Exception):
def __init__(self,message):
super().__init__(self,message)
self.message = message
def __str__(self):
return self.message
| 22.630435 | 49 | 0.567723 | 99 | 1,041 | 5.484848 | 0.30303 | 0.263352 | 0.138122 | 0.14733 | 0.578269 | 0.578269 | 0.578269 | 0.453039 | 0.453039 | 0.453039 | 0 | 0.018545 | 0.326609 | 1,041 | 46 | 50 | 22.630435 | 0.756063 | 0.070125 | 0 | 0.64 | 0 | 0 | 0.020742 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.32 | false | 0 | 0 | 0.16 | 0.64 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
038ae43d541e5761f69a67bb2b6e6c4c8d6de2af | 670 | py | Python | src/pyrin/template/handlers/exceptions.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | src/pyrin/template/handlers/exceptions.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | src/pyrin/template/handlers/exceptions.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
template handlers exceptions module.
"""
from pyrin.core.exceptions import CoreException, CoreBusinessException
class TemplateHandlersException(CoreException):
"""
template handlers exception.
"""
pass
class TemplateHandlersBusinessException(CoreBusinessException, TemplateHandlersException):
"""
template handlers business exception.
"""
pass
class InvalidPackagePathError(TemplateHandlersBusinessException):
"""
invalid package path error.
"""
pass
class InvalidPackageClassNameError(TemplateHandlersBusinessException):
"""
invalid package class name error.
"""
pass
| 19.142857 | 90 | 0.722388 | 47 | 670 | 10.297872 | 0.553191 | 0.099174 | 0.07438 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001838 | 0.18806 | 670 | 34 | 91 | 19.705882 | 0.887868 | 0.280597 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.444444 | 0.111111 | 0 | 0.555556 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
03af01765e9b160b812c1d0d9b67acb5ce0c13b9 | 233 | py | Python | mica/starcheck/__init__.py | sot/mica | 136a9b0d9521efda5208067b51cf0c8700b4def3 | [
"BSD-3-Clause"
] | null | null | null | mica/starcheck/__init__.py | sot/mica | 136a9b0d9521efda5208067b51cf0c8700b4def3 | [
"BSD-3-Clause"
] | 150 | 2015-01-23T17:09:53.000Z | 2022-01-10T00:50:54.000Z | mica/starcheck/__init__.py | sot/mica | 136a9b0d9521efda5208067b51cf0c8700b4def3 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .starcheck import (get_starcheck_catalog, get_starcheck_catalog_at_date,
get_mp_dir, get_monitor_windows, get_dither, get_att, get_starcat)
| 58.25 | 90 | 0.751073 | 34 | 233 | 4.764706 | 0.705882 | 0.148148 | 0.234568 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005319 | 0.193133 | 233 | 3 | 91 | 77.666667 | 0.856383 | 0.261803 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 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 |
03bbbb8836b5d1bfc2e23707fc72ddef7d2ab250 | 39 | py | Python | examples/video_annotation/labelme2voc.py | yuankaihuo/MedLabel | 15673affda520ea159727dc7647a8963898e9788 | [
"MIT"
] | 10 | 2020-07-30T02:04:24.000Z | 2022-03-23T02:33:50.000Z | examples/video_annotation/labelme2voc.py | yuankaihuo/MedLabel | 15673affda520ea159727dc7647a8963898e9788 | [
"MIT"
] | 1 | 2020-08-24T02:31:00.000Z | 2020-08-24T02:31:00.000Z | examples/video_annotation/labelme2voc.py | yuankaihuo/MedLabel | 15673affda520ea159727dc7647a8963898e9788 | [
"MIT"
] | 6 | 2020-07-30T02:04:25.000Z | 2021-01-25T08:11:20.000Z | ../semantic_segmentation/labelme2voc.py | 39 | 39 | 0.871795 | 4 | 39 | 8.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025641 | 0 | 39 | 1 | 39 | 39 | 0.820513 | 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 |
03c424f963aeb4fbc66fd40e4545a041574e1c0e | 9 | py | Python | api/managed_users/admin.py | Codebiosys/oauth-microservice | a87796bff41bed745878bafab3ccf06e346c43e9 | [
"MIT"
] | 2 | 2019-12-30T02:21:51.000Z | 2020-10-18T08:09:54.000Z | api/managed_users/admin.py | Codebiosys/oauth-microservice | a87796bff41bed745878bafab3ccf06e346c43e9 | [
"MIT"
] | null | null | null | api/managed_users/admin.py | Codebiosys/oauth-microservice | a87796bff41bed745878bafab3ccf06e346c43e9 | [
"MIT"
] | 2 | 2018-12-06T21:08:24.000Z | 2018-12-06T21:16:02.000Z | # no: qa
| 4.5 | 8 | 0.444444 | 2 | 9 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 9 | 1 | 9 | 9 | 0.666667 | 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 |
03c58e6f297f2c4bedb37f2281eae622308f5eeb | 281 | py | Python | phase1/pack_mini_loto/global_var.py | ashidagithub/SSOL02 | e02a1d47563e2108d2c023afc56d4321d3f957db | [
"Apache-2.0"
] | null | null | null | phase1/pack_mini_loto/global_var.py | ashidagithub/SSOL02 | e02a1d47563e2108d2c023afc56d4321d3f957db | [
"Apache-2.0"
] | null | null | null | phase1/pack_mini_loto/global_var.py | ashidagithub/SSOL02 | e02a1d47563e2108d2c023afc56d4321d3f957db | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
# ------------------------(max to 80 columns)-----------------------------------
# author by : (学员ID)
# created: 2019.8.10
# Description:
# mini 彩票所使用的全局变量
# ------------------------(max to 80 columns)-----------------------------------
MAX_NUM = 10
| 21.615385 | 80 | 0.348754 | 24 | 281 | 4.041667 | 0.708333 | 0.103093 | 0.14433 | 0.28866 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057613 | 0.135231 | 281 | 12 | 81 | 23.416667 | 0.341564 | 0.886121 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
03e421f468b0dfd61a86982f91bd89262da4eec9 | 24 | py | Python | webservices/__init__.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | 246 | 2015-01-07T16:59:42.000Z | 2020-01-18T20:35:05.000Z | webservices/__init__.py | dwillis/openFEC | dae84b0e526eac4a917e80697a7999956f9c96cb | [
"CC0-1.0"
] | 2,532 | 2015-01-02T16:22:46.000Z | 2018-03-08T17:30:53.000Z | webservices/__init__.py | dwillis/openFEC | dae84b0e526eac4a917e80697a7999956f9c96cb | [
"CC0-1.0"
] | 75 | 2015-02-01T00:46:56.000Z | 2021-02-14T10:51:34.000Z | __API_VERSION__ = '1.0'
| 12 | 23 | 0.708333 | 4 | 24 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 0.125 | 24 | 1 | 24 | 24 | 0.47619 | 0 | 0 | 0 | 0 | 0 | 0.125 | 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 |
20a01146ff39a418ef29253d45f1ff6d98d8e6f7 | 120 | py | Python | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/repository/__init__.py | PeepData/cookiecutter_python_cli | bf4165d251ed8a5435a3362d044a06132bf9fb71 | [
"MIT"
] | null | null | null | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/repository/__init__.py | PeepData/cookiecutter_python_cli | bf4165d251ed8a5435a3362d044a06132bf9fb71 | [
"MIT"
] | null | null | null | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/repository/__init__.py | PeepData/cookiecutter_python_cli | bf4165d251ed8a5435a3362d044a06132bf9fb71 | [
"MIT"
] | null | null | null | from {{cookiecutter.repo_name}}.repository.example_repository import ExampleRepository
__all__ = ["ExampleRepository"]
| 30 | 86 | 0.833333 | 11 | 120 | 8.545455 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 120 | 3 | 87 | 40 | 0.839286 | 0 | 0 | 0 | 0 | 0 | 0.141667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.5 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
20e661fd4759adaee8f2e592765aaa28dc7efb2d | 78 | py | Python | pycom_lopy4_tireeweatherstation/weatherstation_jesustransmitter/boot.py | AidanTek/Fab-Cre8_IoT | 3d358a484aea2e2a50d6dbef443e9a2757ef9ab8 | [
"MIT"
] | null | null | null | pycom_lopy4_tireeweatherstation/weatherstation_jesustransmitter/boot.py | AidanTek/Fab-Cre8_IoT | 3d358a484aea2e2a50d6dbef443e9a2757ef9ab8 | [
"MIT"
] | null | null | null | pycom_lopy4_tireeweatherstation/weatherstation_jesustransmitter/boot.py | AidanTek/Fab-Cre8_IoT | 3d358a484aea2e2a50d6dbef443e9a2757ef9ab8 | [
"MIT"
] | null | null | null | # pycom_LoPy4_BME680/LoPy4files/boot.py
import pycom
pycom.heartbeat(False)
| 13 | 39 | 0.820513 | 11 | 78 | 5.636364 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.070423 | 0.089744 | 78 | 5 | 40 | 15.6 | 0.802817 | 0.474359 | 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 |
4557fc16e0fd2e8aa9a421232cf8d58de7b9e230 | 446 | py | Python | data_service/frontpage/routes.py | freelancing-solutions/GCP-Based-Database-as-a-Service | 7d6a12c33db238ca2f748bf4ddea6d2cf3c16da3 | [
"MIT"
] | 1 | 2021-04-15T19:45:04.000Z | 2021-04-15T19:45:04.000Z | data_service/frontpage/routes.py | freelancing-solutions/pinydesk | 7d6a12c33db238ca2f748bf4ddea6d2cf3c16da3 | [
"MIT"
] | 516 | 2021-05-02T11:46:36.000Z | 2022-03-29T06:09:49.000Z | data_service/frontpage/routes.py | freelancing-solutions/pinydesk | 7d6a12c33db238ca2f748bf4ddea6d2cf3c16da3 | [
"MIT"
] | 1 | 2021-09-04T22:40:14.000Z | 2021-09-04T22:40:14.000Z | from flask import Blueprint, render_template
from data_service.main import cache_stocks, default_timeout
home_bp = Blueprint('home', __name__, template_folder='templates', static_folder='static')
@home_bp.route('/', methods=["GET"])
# @cache_stocks.cached(timeout=default_timeout)
def home():
return render_template('index.html')
# TODO create a decent front page with
# API Documentation and a github link to support further development
| 31.857143 | 90 | 0.782511 | 61 | 446 | 5.47541 | 0.704918 | 0.083832 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.11435 | 446 | 13 | 91 | 34.307692 | 0.84557 | 0.334081 | 0 | 0 | 0 | 0 | 0.112628 | 0 | 0 | 0 | 0 | 0.076923 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0.166667 | 0.666667 | 0.333333 | 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 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
458170dc6caaeb764287ed4ef701592347ed19e0 | 30 | py | Python | ctrl-hyper/hyper-y.py | MTfirst/cmd-ctrl_onLinux | 38a6db67796bdc8d438ca63171d9fea03e84f5f7 | [
"MIT"
] | 1 | 2020-05-02T03:46:10.000Z | 2020-05-02T03:46:10.000Z | ctrl-hyper/hyper-y.py | MTfirst/cmd-ctrl_onLinux | 38a6db67796bdc8d438ca63171d9fea03e84f5f7 | [
"MIT"
] | null | null | null | ctrl-hyper/hyper-y.py | MTfirst/cmd-ctrl_onLinux | 38a6db67796bdc8d438ca63171d9fea03e84f5f7 | [
"MIT"
] | null | null | null | keyboard.send_keys("<ctrl>+y") | 30 | 30 | 0.733333 | 5 | 30 | 4.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 1 | 30 | 30 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0.258065 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
459513775b286d37ae766540a01fd2cda9dab483 | 682 | py | Python | tangos/properties/pynbody/spherical_region.py | TobiBu/tangos | decab8c892c5937fd68474a375089abef198dba2 | [
"BSD-3-Clause"
] | 15 | 2017-12-04T18:05:32.000Z | 2021-12-20T22:11:20.000Z | tangos/properties/pynbody/spherical_region.py | TobiBu/tangos | decab8c892c5937fd68474a375089abef198dba2 | [
"BSD-3-Clause"
] | 99 | 2017-11-09T16:47:20.000Z | 2022-03-07T10:15:12.000Z | tangos/properties/pynbody/spherical_region.py | TobiBu/tangos | decab8c892c5937fd68474a375089abef198dba2 | [
"BSD-3-Clause"
] | 14 | 2017-11-06T18:46:17.000Z | 2021-12-13T10:49:53.000Z | from __future__ import absolute_import
from . import PynbodyPropertyCalculation
class SphericalRegionPropertyCalculation(PynbodyPropertyCalculation):
"""A base class for calculations which require all data within a sphere (rather than just the literal
halo finder output)"""
def region_specification(self, db_data):
import pynbody
return pynbody.filt.Sphere(db_data['max_radius'], db_data['shrink_center'])
def requires_property(self):
return ["shrink_center", "max_radius"]+super(SphericalRegionPropertyCalculation, self).requires_property()
SphericalRegionHaloProperties = SphericalRegionPropertyCalculation # old name, to be deprecated | 45.466667 | 114 | 0.78739 | 72 | 682 | 7.25 | 0.638889 | 0.034483 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140762 | 682 | 15 | 115 | 45.466667 | 0.890785 | 0.214076 | 0 | 0 | 0 | 0 | 0.087287 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.333333 | 0.111111 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
45a0ec9d395c4a5a02b29a19bfd136ac005b78a8 | 64 | py | Python | src/core/default/resources/__init__.py | cdev-framework/cdev-sdk | 06cd7b40936ab063d1d8fd1a7d9f6882750e8a96 | [
"BSD-3-Clause-Clear"
] | 2 | 2022-02-28T02:51:59.000Z | 2022-03-24T15:23:18.000Z | src/core/default/resources/__init__.py | cdev-framework/cdev-sdk | 06cd7b40936ab063d1d8fd1a7d9f6882750e8a96 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/core/default/resources/__init__.py | cdev-framework/cdev-sdk | 06cd7b40936ab063d1d8fd1a7d9f6882750e8a96 | [
"BSD-3-Clause-Clear"
] | null | null | null | """
Basic set of resources that should be available for use
"""
| 16 | 55 | 0.71875 | 10 | 64 | 4.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1875 | 64 | 3 | 56 | 21.333333 | 0.884615 | 0.859375 | 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 |
45d6214ac06259e1149823f685550beac39951d5 | 8,674 | py | Python | Java_customization/invoiceCreation.py | rochish-winfo/EBS-Automation-POC | ec21068c48d03134f7ae569830913d8cc63663ad | [
"Apache-2.0"
] | null | null | null | Java_customization/invoiceCreation.py | rochish-winfo/EBS-Automation-POC | ec21068c48d03134f7ae569830913d8cc63663ad | [
"Apache-2.0"
] | null | null | null | Java_customization/invoiceCreation.py | rochish-winfo/EBS-Automation-POC | ec21068c48d03134f7ae569830913d8cc63663ad | [
"Apache-2.0"
] | null | null | null | from pyjab.jabdriver import JABDriver
from robot.api.deco import keyword
import logging
import time
import win32api as win32
import win32gui as win32gui
import win32con as win32con
import time
from RPA.Desktop import Desktop
from Java_customization.Allactions import ebsCopyValue
APPLICATION = "Oracle Applications - EBSVIS"
PATH = "C:\\GitHub\\EBS-Automation-POC\\Driver\\WindowsAccessBridge-64.dll"
logger = logging.getLogger(__name__)
desktop = Desktop()
driver = JABDriver(APPLICATION, PATH)
def _is_wait_cursor_complete() :
bool = 'False'
start = time.time()
while bool == 'False':
hCursor = win32gui.SetCursor(win32gui.LoadCursor(0, win32con.IDC_WAIT))
hCursor = win32gui.SetCursor(win32gui.LoadCursor(0, win32con.IDC_ARROW))
currCur = win32gui.GetCursorInfo()[1]
if hCursor !=currCur:
bool = 'True'
end = time.time()
logger.info(f'Loading completed in {end - start}')
setDriver()
def setDriver(name = APPLICATION):
driver = JABDriver(name, PATH)
logger.info("The JABDriver is initialized")
if __name__ == '__main__':
start_time = time.time()
setDriver("Oracle Applications - EBSVIS")
XPATH = f"//text[@name=contains('PO Number')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="16689", simulate=True)
logger.info(f"Typed 16689 into PO number")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Invoice Date')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="11-MAR-2022", simulate=True)
logger.info(f"Typed 11-MAR-2022 into Invoice Date")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Invoice Num')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="PO-16883", simulate=True)
logger.info(f"Typed PO-16883 into Invoice Num")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Invoice Amount Required')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="1000", simulate=True)
logger.info(f"Typed 1000 into Invoice Amount Required ")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Match')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Match")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Find')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Find")
_is_wait_cursor_complete()
XPATH = f"//check box[@name=contains('Match')]"
checkbox = driver.find_element_by_xpath(XPATH)
checkbox.click()
logger.info(f"Clicked Check Box Match")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Match')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Match")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Calculate Tax')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Calculate Tax")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Total')]"
txtelement = driver.find_element_by_xpath(XPATH)
text = txtelement.text
logger.info(f"Element Total has {text} text")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Invoice Amount Required')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value=text, simulate=True)
logger.info(f"Typed {text} into Invoice Amount Required")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Actions')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Actions")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Actions')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Actions")
_is_wait_cursor_complete()
XPATH = f"//check box[@name=contains('Validate')]"
checkbox = driver.find_element_by_xpath(XPATH)
checkbox.click()
logger.info(f"Clicked Check Box Validate")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('OK')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button OK")
_is_wait_cursor_complete()
Menu = driver.find_element_by_xpath(f"//menu[@name=contains('View')]")
Request = driver.find_element_by_xpath(f"//menu item[@name=contains('Requests')]")
Menu.click()
logger.info(f"Clicked On Menu View")
Request.click()
logger.info(f"Clicked On Menu Item Requests")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Submit a New Request')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Submit a New Request")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Name')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="Create Accounting", simulate=True)
logger.info(f"Typed Create Accounting into Name")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Ledger')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="Vision Operations (USA)", simulate=True)
logger.info(f"Typed Vision Operations (USA) into Ledger")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('End Date')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="11-MAR-22", simulate=True)
logger.info(f"Typed 11-MAR-22 into End Date")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Mode')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="Draft", simulate=True)
logger.info(f"Typed Draft into Mode")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('OK')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button OK")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Submit')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Submit")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Yes')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Yes")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Name')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="Create Accounting", simulate=True)
logger.info(f"Typed Create Accounting into Name")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('Ledger')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="Vision Operations (USA)", simulate=True)
logger.info(f"Typed Vision Operations (USA) into Ledger")
_is_wait_cursor_complete()
XPATH = f"//text[@name=contains('End Date')]"
txtelement = driver.find_element_by_xpath(XPATH)
txtelement.send_text(value="11-MAR-22", simulate=True)
logger.info(f"Typed 11-MAR-22 into End Date")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('OK')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button OK")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Submit')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button Submit")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('No')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button No")
_is_wait_cursor_complete()
XPATH = f"//push button[@name=contains('Find')]"
btn = driver.find_element_by_xpath(XPATH)
btn.click()
logger.info(f"Clicked Push Button No")
_is_wait_cursor_complete()
txt_one = ebsCopyValue(name)
while True :
txt_two = ebsCopyValue(name)
if txt_one != txt_two or txt_two == 'Completed' :
break
driver = JABDriver(APPLICATION, PATH)
logger.info("The JABDriver is initialized")
refreshBtn = driver.find_element_by_xpath(f"//push button[@name=contains('Refresh Data')]")
refreshBtn.click()
_is_wait_cursor_complete()
desktop.press_keys("ctrl","s")
end_time = time.time()
logger.info(f"The Execution completed in {end_time - start_time}")
| 34.696 | 99 | 0.698409 | 1,167 | 8,674 | 4.96144 | 0.12168 | 0.062176 | 0.064594 | 0.11399 | 0.786356 | 0.775993 | 0.743696 | 0.703454 | 0.679102 | 0.671848 | 0 | 0.012105 | 0.171432 | 8,674 | 249 | 100 | 34.835341 | 0.793516 | 0 | 0 | 0.625616 | 0 | 0 | 0.298189 | 0.121467 | 0 | 0 | 0 | 0 | 0 | 1 | 0.009852 | false | 0 | 0.049261 | 0 | 0.059113 | 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 |
aff1966f1f9969f04bf320437955fc8fdf31580e | 64,012 | py | Python | steam/protobufs/steammessages_clientserver_ufs_pb2.py | sammiee5311/steam | 79231d5bbf7ed4c7781680d392274d6bd21b9d7e | [
"MIT"
] | 727 | 2015-07-13T20:32:55.000Z | 2022-03-31T11:55:34.000Z | steam/protobufs/steammessages_clientserver_ufs_pb2.py | sammiee5311/steam | 79231d5bbf7ed4c7781680d392274d6bd21b9d7e | [
"MIT"
] | 335 | 2015-07-22T12:28:35.000Z | 2022-02-24T11:53:12.000Z | steam/protobufs/steammessages_clientserver_ufs_pb2.py | sammiee5311/steam | 79231d5bbf7ed4c7781680d392274d6bd21b9d7e | [
"MIT"
] | 155 | 2015-07-22T08:53:19.000Z | 2022-03-30T10:59:22.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: steammessages_clientserver_ufs.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
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()
import steam.protobufs.steammessages_base_pb2 as steammessages__base__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='steammessages_clientserver_ufs.proto',
package='',
syntax='proto2',
serialized_options=_b('H\001\220\001\000'),
serialized_pb=_b('\n$steammessages_clientserver_ufs.proto\x1a\x18steammessages_base.proto\"\x86\x02\n\x1e\x43MsgClientUFSUploadFileRequest\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\r\x12\x11\n\tfile_size\x18\x02 \x01(\r\x12\x15\n\rraw_file_size\x18\x03 \x01(\r\x12\x10\n\x08sha_file\x18\x04 \x01(\x0c\x12\x12\n\ntime_stamp\x18\x05 \x01(\x04\x12\x11\n\tfile_name\x18\x06 \x01(\t\x12$\n\x1cplatforms_to_sync_deprecated\x18\x07 \x01(\r\x12%\n\x11platforms_to_sync\x18\x08 \x01(\r:\n4294967295\x12\x0f\n\x07\x63\x65ll_id\x18\t \x01(\r\x12\x13\n\x0b\x63\x61n_encrypt\x18\n \x01(\x08\"\xbb\x01\n\x1f\x43MsgClientUFSUploadFileResponse\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12\x10\n\x08sha_file\x18\x02 \x01(\x0c\x12\x10\n\x08use_http\x18\x03 \x01(\x08\x12\x11\n\thttp_host\x18\x04 \x01(\t\x12\x10\n\x08http_url\x18\x05 \x01(\t\x12\x12\n\nkv_headers\x18\x06 \x01(\x0c\x12\x11\n\tuse_https\x18\x07 \x01(\x08\x12\x14\n\x0c\x65ncrypt_file\x18\x08 \x01(\x08\"\xae\x01\n\x19\x43MsgClientUFSUploadCommit\x12.\n\x05\x66iles\x18\x01 \x03(\x0b\x32\x1f.CMsgClientUFSUploadCommit.File\x1a\x61\n\x04\x46ile\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12\x0e\n\x06\x61pp_id\x18\x02 \x01(\r\x12\x10\n\x08sha_file\x18\x03 \x01(\x0c\x12\x10\n\x08\x63ub_file\x18\x04 \x01(\r\x12\x11\n\tfile_name\x18\x05 \x01(\t\"\x99\x01\n!CMsgClientUFSUploadCommitResponse\x12\x36\n\x05\x66iles\x18\x01 \x03(\x0b\x32\'.CMsgClientUFSUploadCommitResponse.File\x1a<\n\x04\x46ile\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12\x0e\n\x06\x61pp_id\x18\x02 \x01(\r\x12\x10\n\x08sha_file\x18\x03 \x01(\x0c\"L\n\x16\x43MsgClientUFSFileChunk\x12\x10\n\x08sha_file\x18\x01 \x01(\x0c\x12\x12\n\nfile_start\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\" \n\x1e\x43MsgClientUFSTransferHeartbeat\"G\n\x1f\x43MsgClientUFSUploadFileFinished\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12\x10\n\x08sha_file\x18\x02 \x01(\x0c\"_\n\x1e\x43MsgClientUFSDeleteFileRequest\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\r\x12\x11\n\tfile_name\x18\x02 \x01(\t\x12\x1a\n\x12is_explicit_delete\x18\x03 \x01(\x08\"H\n\x1f\x43MsgClientUFSDeleteFileResponse\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12\x11\n\tfile_name\x18\x02 \x01(\t\"S\n\x1e\x43MsgClientUFSGetFileListForApp\x12\x15\n\rapps_to_query\x18\x01 \x03(\r\x12\x1a\n\x12send_path_prefixes\x18\x02 \x01(\x08\"\xc1\x02\n&CMsgClientUFSGetFileListForAppResponse\x12;\n\x05\x66iles\x18\x01 \x03(\x0b\x32,.CMsgClientUFSGetFileListForAppResponse.File\x12\x15\n\rpath_prefixes\x18\x02 \x03(\t\x1a\xb8\x01\n\x04\x46ile\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\r\x12\x11\n\tfile_name\x18\x02 \x01(\t\x12\x10\n\x08sha_file\x18\x03 \x01(\x0c\x12\x12\n\ntime_stamp\x18\x04 \x01(\x04\x12\x15\n\rraw_file_size\x18\x05 \x01(\r\x12\x1a\n\x12is_explicit_delete\x18\x06 \x01(\x08\x12\x19\n\x11platforms_to_sync\x18\x07 \x01(\r\x12\x19\n\x11path_prefix_index\x18\x08 \x01(\r:\x08\x80\xb5\x18\x08\x88\xb5\x18\x10\"Z\n\x1c\x43MsgClientUFSDownloadRequest\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\r\x12\x11\n\tfile_name\x18\x02 \x01(\t\x12\x17\n\x0f\x63\x61n_handle_http\x18\x03 \x01(\x08\"\xa0\x02\n\x1d\x43MsgClientUFSDownloadResponse\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12\x0e\n\x06\x61pp_id\x18\x02 \x01(\r\x12\x11\n\tfile_size\x18\x03 \x01(\r\x12\x15\n\rraw_file_size\x18\x04 \x01(\r\x12\x10\n\x08sha_file\x18\x05 \x01(\x0c\x12\x12\n\ntime_stamp\x18\x06 \x01(\x04\x12\x1a\n\x12is_explicit_delete\x18\x07 \x01(\x08\x12\x10\n\x08use_http\x18\x08 \x01(\x08\x12\x11\n\thttp_host\x18\t \x01(\t\x12\x10\n\x08http_url\x18\n \x01(\t\x12\x12\n\nkv_headers\x18\x0b \x01(\x0c\x12\x11\n\tuse_https\x18\x0c \x01(\x08\x12\x11\n\tencrypted\x18\r \x01(\x08\"]\n\x19\x43MsgClientUFSLoginRequest\x12\x18\n\x10protocol_version\x18\x01 \x01(\r\x12\x18\n\x10\x61m_session_token\x18\x02 \x01(\x04\x12\x0c\n\x04\x61pps\x18\x03 \x03(\r\"0\n\x1a\x43MsgClientUFSLoginResponse\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\"D\n\x1a\x43MsgClientUFSGetUGCDetails\x12&\n\x08hcontent\x18\x01 \x01(\x06:\x14\x31\x38\x34\x34\x36\x37\x34\x34\x30\x37\x33\x37\x30\x39\x35\x35\x31\x36\x31\x35\"\xe5\x01\n\"CMsgClientUFSGetUGCDetailsResponse\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0e\n\x06\x61pp_id\x18\x03 \x01(\r\x12\x10\n\x08\x66ilename\x18\x04 \x01(\t\x12\x17\n\x0fsteamid_creator\x18\x05 \x01(\x06\x12\x11\n\tfile_size\x18\x06 \x01(\r\x12\x1c\n\x14\x63ompressed_file_size\x18\x07 \x01(\r\x12\x17\n\x0frangecheck_host\x18\x08 \x01(\t\x12\x19\n\x11\x66ile_encoded_sha1\x18\t \x01(\t\"C\n\x1e\x43MsgClientUFSGetSingleFileInfo\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\r\x12\x11\n\tfile_name\x18\x02 \x01(\t\"\xb8\x01\n&CMsgClientUFSGetSingleFileInfoResponse\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12\x0e\n\x06\x61pp_id\x18\x02 \x01(\r\x12\x11\n\tfile_name\x18\x03 \x01(\t\x12\x10\n\x08sha_file\x18\x04 \x01(\x0c\x12\x12\n\ntime_stamp\x18\x05 \x01(\x04\x12\x15\n\rraw_file_size\x18\x06 \x01(\r\x12\x1a\n\x12is_explicit_delete\x18\x07 \x01(\x08\";\n\x16\x43MsgClientUFSShareFile\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\r\x12\x11\n\tfile_name\x18\x02 \x01(\t\"\\\n\x1e\x43MsgClientUFSShareFileResponse\x12\x12\n\x07\x65result\x18\x01 \x01(\x05:\x01\x32\x12&\n\x08hcontent\x18\x02 \x01(\x06:\x14\x31\x38\x34\x34\x36\x37\x34\x34\x30\x37\x33\x37\x30\x39\x35\x35\x31\x36\x31\x35\x42\x05H\x01\x90\x01\x00')
,
dependencies=[steammessages__base__pb2.DESCRIPTOR,])
_CMSGCLIENTUFSUPLOADFILEREQUEST = _descriptor.Descriptor(
name='CMsgClientUFSUploadFileRequest',
full_name='CMsgClientUFSUploadFileRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSUploadFileRequest.app_id', index=0,
number=1, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_size', full_name='CMsgClientUFSUploadFileRequest.file_size', index=1,
number=2, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='raw_file_size', full_name='CMsgClientUFSUploadFileRequest.raw_file_size', index=2,
number=3, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSUploadFileRequest.sha_file', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_stamp', full_name='CMsgClientUFSUploadFileRequest.time_stamp', index=4,
number=5, type=4, cpp_type=4, 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),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSUploadFileRequest.file_name', index=5,
number=6, 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),
_descriptor.FieldDescriptor(
name='platforms_to_sync_deprecated', full_name='CMsgClientUFSUploadFileRequest.platforms_to_sync_deprecated', index=6,
number=7, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='platforms_to_sync', full_name='CMsgClientUFSUploadFileRequest.platforms_to_sync', index=7,
number=8, type=13, cpp_type=3, label=1,
has_default_value=True, default_value=4294967295,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cell_id', full_name='CMsgClientUFSUploadFileRequest.cell_id', index=8,
number=9, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='can_encrypt', full_name='CMsgClientUFSUploadFileRequest.can_encrypt', index=9,
number=10, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=67,
serialized_end=329,
)
_CMSGCLIENTUFSUPLOADFILERESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSUploadFileResponse',
full_name='CMsgClientUFSUploadFileResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSUploadFileResponse.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSUploadFileResponse.sha_file', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='use_http', full_name='CMsgClientUFSUploadFileResponse.use_http', index=2,
number=3, 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),
_descriptor.FieldDescriptor(
name='http_host', full_name='CMsgClientUFSUploadFileResponse.http_host', 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),
_descriptor.FieldDescriptor(
name='http_url', full_name='CMsgClientUFSUploadFileResponse.http_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),
_descriptor.FieldDescriptor(
name='kv_headers', full_name='CMsgClientUFSUploadFileResponse.kv_headers', index=5,
number=6, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='use_https', full_name='CMsgClientUFSUploadFileResponse.use_https', index=6,
number=7, 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),
_descriptor.FieldDescriptor(
name='encrypt_file', full_name='CMsgClientUFSUploadFileResponse.encrypt_file', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=332,
serialized_end=519,
)
_CMSGCLIENTUFSUPLOADCOMMIT_FILE = _descriptor.Descriptor(
name='File',
full_name='CMsgClientUFSUploadCommit.File',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSUploadCommit.File.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSUploadCommit.File.app_id', index=1,
number=2, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSUploadCommit.File.sha_file', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cub_file', full_name='CMsgClientUFSUploadCommit.File.cub_file', index=3,
number=4, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSUploadCommit.File.file_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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=599,
serialized_end=696,
)
_CMSGCLIENTUFSUPLOADCOMMIT = _descriptor.Descriptor(
name='CMsgClientUFSUploadCommit',
full_name='CMsgClientUFSUploadCommit',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='files', full_name='CMsgClientUFSUploadCommit.files', 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),
],
extensions=[
],
nested_types=[_CMSGCLIENTUFSUPLOADCOMMIT_FILE, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=522,
serialized_end=696,
)
_CMSGCLIENTUFSUPLOADCOMMITRESPONSE_FILE = _descriptor.Descriptor(
name='File',
full_name='CMsgClientUFSUploadCommitResponse.File',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSUploadCommitResponse.File.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSUploadCommitResponse.File.app_id', index=1,
number=2, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSUploadCommitResponse.File.sha_file', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=599,
serialized_end=659,
)
_CMSGCLIENTUFSUPLOADCOMMITRESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSUploadCommitResponse',
full_name='CMsgClientUFSUploadCommitResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='files', full_name='CMsgClientUFSUploadCommitResponse.files', 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),
],
extensions=[
],
nested_types=[_CMSGCLIENTUFSUPLOADCOMMITRESPONSE_FILE, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=699,
serialized_end=852,
)
_CMSGCLIENTUFSFILECHUNK = _descriptor.Descriptor(
name='CMsgClientUFSFileChunk',
full_name='CMsgClientUFSFileChunk',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSFileChunk.sha_file', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='file_start', full_name='CMsgClientUFSFileChunk.file_start', index=1,
number=2, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='data', full_name='CMsgClientUFSFileChunk.data', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=854,
serialized_end=930,
)
_CMSGCLIENTUFSTRANSFERHEARTBEAT = _descriptor.Descriptor(
name='CMsgClientUFSTransferHeartbeat',
full_name='CMsgClientUFSTransferHeartbeat',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=932,
serialized_end=964,
)
_CMSGCLIENTUFSUPLOADFILEFINISHED = _descriptor.Descriptor(
name='CMsgClientUFSUploadFileFinished',
full_name='CMsgClientUFSUploadFileFinished',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSUploadFileFinished.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSUploadFileFinished.sha_file', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=966,
serialized_end=1037,
)
_CMSGCLIENTUFSDELETEFILEREQUEST = _descriptor.Descriptor(
name='CMsgClientUFSDeleteFileRequest',
full_name='CMsgClientUFSDeleteFileRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSDeleteFileRequest.app_id', index=0,
number=1, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSDeleteFileRequest.file_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),
_descriptor.FieldDescriptor(
name='is_explicit_delete', full_name='CMsgClientUFSDeleteFileRequest.is_explicit_delete', index=2,
number=3, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1039,
serialized_end=1134,
)
_CMSGCLIENTUFSDELETEFILERESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSDeleteFileResponse',
full_name='CMsgClientUFSDeleteFileResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSDeleteFileResponse.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSDeleteFileResponse.file_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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1136,
serialized_end=1208,
)
_CMSGCLIENTUFSGETFILELISTFORAPP = _descriptor.Descriptor(
name='CMsgClientUFSGetFileListForApp',
full_name='CMsgClientUFSGetFileListForApp',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='apps_to_query', full_name='CMsgClientUFSGetFileListForApp.apps_to_query', index=0,
number=1, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='send_path_prefixes', full_name='CMsgClientUFSGetFileListForApp.send_path_prefixes', 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1210,
serialized_end=1293,
)
_CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE_FILE = _descriptor.Descriptor(
name='File',
full_name='CMsgClientUFSGetFileListForAppResponse.File',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSGetFileListForAppResponse.File.app_id', index=0,
number=1, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSGetFileListForAppResponse.File.file_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),
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSGetFileListForAppResponse.File.sha_file', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_stamp', full_name='CMsgClientUFSGetFileListForAppResponse.File.time_stamp', index=3,
number=4, type=4, cpp_type=4, 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),
_descriptor.FieldDescriptor(
name='raw_file_size', full_name='CMsgClientUFSGetFileListForAppResponse.File.raw_file_size', index=4,
number=5, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='is_explicit_delete', full_name='CMsgClientUFSGetFileListForAppResponse.File.is_explicit_delete', 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),
_descriptor.FieldDescriptor(
name='platforms_to_sync', full_name='CMsgClientUFSGetFileListForAppResponse.File.platforms_to_sync', index=6,
number=7, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='path_prefix_index', full_name='CMsgClientUFSGetFileListForAppResponse.File.path_prefix_index', index=7,
number=8, type=13, cpp_type=3, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1423,
serialized_end=1607,
)
_CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSGetFileListForAppResponse',
full_name='CMsgClientUFSGetFileListForAppResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='files', full_name='CMsgClientUFSGetFileListForAppResponse.files', 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),
_descriptor.FieldDescriptor(
name='path_prefixes', full_name='CMsgClientUFSGetFileListForAppResponse.path_prefixes', 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),
],
extensions=[
],
nested_types=[_CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE_FILE, ],
enum_types=[
],
serialized_options=_b('\200\265\030\010\210\265\030\020'),
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1296,
serialized_end=1617,
)
_CMSGCLIENTUFSDOWNLOADREQUEST = _descriptor.Descriptor(
name='CMsgClientUFSDownloadRequest',
full_name='CMsgClientUFSDownloadRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSDownloadRequest.app_id', index=0,
number=1, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSDownloadRequest.file_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),
_descriptor.FieldDescriptor(
name='can_handle_http', full_name='CMsgClientUFSDownloadRequest.can_handle_http', index=2,
number=3, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1619,
serialized_end=1709,
)
_CMSGCLIENTUFSDOWNLOADRESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSDownloadResponse',
full_name='CMsgClientUFSDownloadResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSDownloadResponse.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSDownloadResponse.app_id', index=1,
number=2, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_size', full_name='CMsgClientUFSDownloadResponse.file_size', index=2,
number=3, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='raw_file_size', full_name='CMsgClientUFSDownloadResponse.raw_file_size', index=3,
number=4, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSDownloadResponse.sha_file', index=4,
number=5, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_stamp', full_name='CMsgClientUFSDownloadResponse.time_stamp', index=5,
number=6, type=4, cpp_type=4, 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),
_descriptor.FieldDescriptor(
name='is_explicit_delete', full_name='CMsgClientUFSDownloadResponse.is_explicit_delete', index=6,
number=7, 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),
_descriptor.FieldDescriptor(
name='use_http', full_name='CMsgClientUFSDownloadResponse.use_http', 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),
_descriptor.FieldDescriptor(
name='http_host', full_name='CMsgClientUFSDownloadResponse.http_host', index=8,
number=9, 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),
_descriptor.FieldDescriptor(
name='http_url', full_name='CMsgClientUFSDownloadResponse.http_url', index=9,
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=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='kv_headers', full_name='CMsgClientUFSDownloadResponse.kv_headers', index=10,
number=11, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='use_https', full_name='CMsgClientUFSDownloadResponse.use_https', index=11,
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=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='encrypted', full_name='CMsgClientUFSDownloadResponse.encrypted', index=12,
number=13, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1712,
serialized_end=2000,
)
_CMSGCLIENTUFSLOGINREQUEST = _descriptor.Descriptor(
name='CMsgClientUFSLoginRequest',
full_name='CMsgClientUFSLoginRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='protocol_version', full_name='CMsgClientUFSLoginRequest.protocol_version', index=0,
number=1, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='am_session_token', full_name='CMsgClientUFSLoginRequest.am_session_token', index=1,
number=2, type=4, cpp_type=4, 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),
_descriptor.FieldDescriptor(
name='apps', full_name='CMsgClientUFSLoginRequest.apps', index=2,
number=3, type=13, cpp_type=3, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2002,
serialized_end=2095,
)
_CMSGCLIENTUFSLOGINRESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSLoginResponse',
full_name='CMsgClientUFSLoginResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSLoginResponse.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2097,
serialized_end=2145,
)
_CMSGCLIENTUFSGETUGCDETAILS = _descriptor.Descriptor(
name='CMsgClientUFSGetUGCDetails',
full_name='CMsgClientUFSGetUGCDetails',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='hcontent', full_name='CMsgClientUFSGetUGCDetails.hcontent', index=0,
number=1, type=6, cpp_type=4, label=1,
has_default_value=True, default_value=18446744073709551615,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2147,
serialized_end=2215,
)
_CMSGCLIENTUFSGETUGCDETAILSRESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSGetUGCDetailsResponse',
full_name='CMsgClientUFSGetUGCDetailsResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSGetUGCDetailsResponse.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='url', full_name='CMsgClientUFSGetUGCDetailsResponse.url', 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),
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSGetUGCDetailsResponse.app_id', index=2,
number=3, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='filename', full_name='CMsgClientUFSGetUGCDetailsResponse.filename', 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),
_descriptor.FieldDescriptor(
name='steamid_creator', full_name='CMsgClientUFSGetUGCDetailsResponse.steamid_creator', index=4,
number=5, type=6, cpp_type=4, 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),
_descriptor.FieldDescriptor(
name='file_size', full_name='CMsgClientUFSGetUGCDetailsResponse.file_size', index=5,
number=6, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='compressed_file_size', full_name='CMsgClientUFSGetUGCDetailsResponse.compressed_file_size', index=6,
number=7, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='rangecheck_host', full_name='CMsgClientUFSGetUGCDetailsResponse.rangecheck_host', index=7,
number=8, 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),
_descriptor.FieldDescriptor(
name='file_encoded_sha1', full_name='CMsgClientUFSGetUGCDetailsResponse.file_encoded_sha1', index=8,
number=9, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2218,
serialized_end=2447,
)
_CMSGCLIENTUFSGETSINGLEFILEINFO = _descriptor.Descriptor(
name='CMsgClientUFSGetSingleFileInfo',
full_name='CMsgClientUFSGetSingleFileInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSGetSingleFileInfo.app_id', index=0,
number=1, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSGetSingleFileInfo.file_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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2449,
serialized_end=2516,
)
_CMSGCLIENTUFSGETSINGLEFILEINFORESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSGetSingleFileInfoResponse',
full_name='CMsgClientUFSGetSingleFileInfoResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSGetSingleFileInfoResponse.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSGetSingleFileInfoResponse.app_id', index=1,
number=2, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSGetSingleFileInfoResponse.file_name', 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),
_descriptor.FieldDescriptor(
name='sha_file', full_name='CMsgClientUFSGetSingleFileInfoResponse.sha_file', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_stamp', full_name='CMsgClientUFSGetSingleFileInfoResponse.time_stamp', index=4,
number=5, type=4, cpp_type=4, 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),
_descriptor.FieldDescriptor(
name='raw_file_size', full_name='CMsgClientUFSGetSingleFileInfoResponse.raw_file_size', index=5,
number=6, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='is_explicit_delete', full_name='CMsgClientUFSGetSingleFileInfoResponse.is_explicit_delete', index=6,
number=7, 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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2519,
serialized_end=2703,
)
_CMSGCLIENTUFSSHAREFILE = _descriptor.Descriptor(
name='CMsgClientUFSShareFile',
full_name='CMsgClientUFSShareFile',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='app_id', full_name='CMsgClientUFSShareFile.app_id', index=0,
number=1, type=13, cpp_type=3, 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),
_descriptor.FieldDescriptor(
name='file_name', full_name='CMsgClientUFSShareFile.file_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),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2705,
serialized_end=2764,
)
_CMSGCLIENTUFSSHAREFILERESPONSE = _descriptor.Descriptor(
name='CMsgClientUFSShareFileResponse',
full_name='CMsgClientUFSShareFileResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='eresult', full_name='CMsgClientUFSShareFileResponse.eresult', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=True, default_value=2,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='hcontent', full_name='CMsgClientUFSShareFileResponse.hcontent', index=1,
number=2, type=6, cpp_type=4, label=1,
has_default_value=True, default_value=18446744073709551615,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2766,
serialized_end=2858,
)
_CMSGCLIENTUFSUPLOADCOMMIT_FILE.containing_type = _CMSGCLIENTUFSUPLOADCOMMIT
_CMSGCLIENTUFSUPLOADCOMMIT.fields_by_name['files'].message_type = _CMSGCLIENTUFSUPLOADCOMMIT_FILE
_CMSGCLIENTUFSUPLOADCOMMITRESPONSE_FILE.containing_type = _CMSGCLIENTUFSUPLOADCOMMITRESPONSE
_CMSGCLIENTUFSUPLOADCOMMITRESPONSE.fields_by_name['files'].message_type = _CMSGCLIENTUFSUPLOADCOMMITRESPONSE_FILE
_CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE_FILE.containing_type = _CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE
_CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE.fields_by_name['files'].message_type = _CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE_FILE
DESCRIPTOR.message_types_by_name['CMsgClientUFSUploadFileRequest'] = _CMSGCLIENTUFSUPLOADFILEREQUEST
DESCRIPTOR.message_types_by_name['CMsgClientUFSUploadFileResponse'] = _CMSGCLIENTUFSUPLOADFILERESPONSE
DESCRIPTOR.message_types_by_name['CMsgClientUFSUploadCommit'] = _CMSGCLIENTUFSUPLOADCOMMIT
DESCRIPTOR.message_types_by_name['CMsgClientUFSUploadCommitResponse'] = _CMSGCLIENTUFSUPLOADCOMMITRESPONSE
DESCRIPTOR.message_types_by_name['CMsgClientUFSFileChunk'] = _CMSGCLIENTUFSFILECHUNK
DESCRIPTOR.message_types_by_name['CMsgClientUFSTransferHeartbeat'] = _CMSGCLIENTUFSTRANSFERHEARTBEAT
DESCRIPTOR.message_types_by_name['CMsgClientUFSUploadFileFinished'] = _CMSGCLIENTUFSUPLOADFILEFINISHED
DESCRIPTOR.message_types_by_name['CMsgClientUFSDeleteFileRequest'] = _CMSGCLIENTUFSDELETEFILEREQUEST
DESCRIPTOR.message_types_by_name['CMsgClientUFSDeleteFileResponse'] = _CMSGCLIENTUFSDELETEFILERESPONSE
DESCRIPTOR.message_types_by_name['CMsgClientUFSGetFileListForApp'] = _CMSGCLIENTUFSGETFILELISTFORAPP
DESCRIPTOR.message_types_by_name['CMsgClientUFSGetFileListForAppResponse'] = _CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE
DESCRIPTOR.message_types_by_name['CMsgClientUFSDownloadRequest'] = _CMSGCLIENTUFSDOWNLOADREQUEST
DESCRIPTOR.message_types_by_name['CMsgClientUFSDownloadResponse'] = _CMSGCLIENTUFSDOWNLOADRESPONSE
DESCRIPTOR.message_types_by_name['CMsgClientUFSLoginRequest'] = _CMSGCLIENTUFSLOGINREQUEST
DESCRIPTOR.message_types_by_name['CMsgClientUFSLoginResponse'] = _CMSGCLIENTUFSLOGINRESPONSE
DESCRIPTOR.message_types_by_name['CMsgClientUFSGetUGCDetails'] = _CMSGCLIENTUFSGETUGCDETAILS
DESCRIPTOR.message_types_by_name['CMsgClientUFSGetUGCDetailsResponse'] = _CMSGCLIENTUFSGETUGCDETAILSRESPONSE
DESCRIPTOR.message_types_by_name['CMsgClientUFSGetSingleFileInfo'] = _CMSGCLIENTUFSGETSINGLEFILEINFO
DESCRIPTOR.message_types_by_name['CMsgClientUFSGetSingleFileInfoResponse'] = _CMSGCLIENTUFSGETSINGLEFILEINFORESPONSE
DESCRIPTOR.message_types_by_name['CMsgClientUFSShareFile'] = _CMSGCLIENTUFSSHAREFILE
DESCRIPTOR.message_types_by_name['CMsgClientUFSShareFileResponse'] = _CMSGCLIENTUFSSHAREFILERESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
CMsgClientUFSUploadFileRequest = _reflection.GeneratedProtocolMessageType('CMsgClientUFSUploadFileRequest', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSUPLOADFILEREQUEST,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSUploadFileRequest)
))
_sym_db.RegisterMessage(CMsgClientUFSUploadFileRequest)
CMsgClientUFSUploadFileResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSUploadFileResponse', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSUPLOADFILERESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSUploadFileResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSUploadFileResponse)
CMsgClientUFSUploadCommit = _reflection.GeneratedProtocolMessageType('CMsgClientUFSUploadCommit', (_message.Message,), dict(
File = _reflection.GeneratedProtocolMessageType('File', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSUPLOADCOMMIT_FILE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSUploadCommit.File)
))
,
DESCRIPTOR = _CMSGCLIENTUFSUPLOADCOMMIT,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSUploadCommit)
))
_sym_db.RegisterMessage(CMsgClientUFSUploadCommit)
_sym_db.RegisterMessage(CMsgClientUFSUploadCommit.File)
CMsgClientUFSUploadCommitResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSUploadCommitResponse', (_message.Message,), dict(
File = _reflection.GeneratedProtocolMessageType('File', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSUPLOADCOMMITRESPONSE_FILE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSUploadCommitResponse.File)
))
,
DESCRIPTOR = _CMSGCLIENTUFSUPLOADCOMMITRESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSUploadCommitResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSUploadCommitResponse)
_sym_db.RegisterMessage(CMsgClientUFSUploadCommitResponse.File)
CMsgClientUFSFileChunk = _reflection.GeneratedProtocolMessageType('CMsgClientUFSFileChunk', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSFILECHUNK,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSFileChunk)
))
_sym_db.RegisterMessage(CMsgClientUFSFileChunk)
CMsgClientUFSTransferHeartbeat = _reflection.GeneratedProtocolMessageType('CMsgClientUFSTransferHeartbeat', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSTRANSFERHEARTBEAT,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSTransferHeartbeat)
))
_sym_db.RegisterMessage(CMsgClientUFSTransferHeartbeat)
CMsgClientUFSUploadFileFinished = _reflection.GeneratedProtocolMessageType('CMsgClientUFSUploadFileFinished', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSUPLOADFILEFINISHED,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSUploadFileFinished)
))
_sym_db.RegisterMessage(CMsgClientUFSUploadFileFinished)
CMsgClientUFSDeleteFileRequest = _reflection.GeneratedProtocolMessageType('CMsgClientUFSDeleteFileRequest', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSDELETEFILEREQUEST,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSDeleteFileRequest)
))
_sym_db.RegisterMessage(CMsgClientUFSDeleteFileRequest)
CMsgClientUFSDeleteFileResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSDeleteFileResponse', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSDELETEFILERESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSDeleteFileResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSDeleteFileResponse)
CMsgClientUFSGetFileListForApp = _reflection.GeneratedProtocolMessageType('CMsgClientUFSGetFileListForApp', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSGETFILELISTFORAPP,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSGetFileListForApp)
))
_sym_db.RegisterMessage(CMsgClientUFSGetFileListForApp)
CMsgClientUFSGetFileListForAppResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSGetFileListForAppResponse', (_message.Message,), dict(
File = _reflection.GeneratedProtocolMessageType('File', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE_FILE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSGetFileListForAppResponse.File)
))
,
DESCRIPTOR = _CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSGetFileListForAppResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSGetFileListForAppResponse)
_sym_db.RegisterMessage(CMsgClientUFSGetFileListForAppResponse.File)
CMsgClientUFSDownloadRequest = _reflection.GeneratedProtocolMessageType('CMsgClientUFSDownloadRequest', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSDOWNLOADREQUEST,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSDownloadRequest)
))
_sym_db.RegisterMessage(CMsgClientUFSDownloadRequest)
CMsgClientUFSDownloadResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSDownloadResponse', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSDOWNLOADRESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSDownloadResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSDownloadResponse)
CMsgClientUFSLoginRequest = _reflection.GeneratedProtocolMessageType('CMsgClientUFSLoginRequest', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSLOGINREQUEST,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSLoginRequest)
))
_sym_db.RegisterMessage(CMsgClientUFSLoginRequest)
CMsgClientUFSLoginResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSLoginResponse', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSLOGINRESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSLoginResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSLoginResponse)
CMsgClientUFSGetUGCDetails = _reflection.GeneratedProtocolMessageType('CMsgClientUFSGetUGCDetails', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSGETUGCDETAILS,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSGetUGCDetails)
))
_sym_db.RegisterMessage(CMsgClientUFSGetUGCDetails)
CMsgClientUFSGetUGCDetailsResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSGetUGCDetailsResponse', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSGETUGCDETAILSRESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSGetUGCDetailsResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSGetUGCDetailsResponse)
CMsgClientUFSGetSingleFileInfo = _reflection.GeneratedProtocolMessageType('CMsgClientUFSGetSingleFileInfo', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSGETSINGLEFILEINFO,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSGetSingleFileInfo)
))
_sym_db.RegisterMessage(CMsgClientUFSGetSingleFileInfo)
CMsgClientUFSGetSingleFileInfoResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSGetSingleFileInfoResponse', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSGETSINGLEFILEINFORESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSGetSingleFileInfoResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSGetSingleFileInfoResponse)
CMsgClientUFSShareFile = _reflection.GeneratedProtocolMessageType('CMsgClientUFSShareFile', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSSHAREFILE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSShareFile)
))
_sym_db.RegisterMessage(CMsgClientUFSShareFile)
CMsgClientUFSShareFileResponse = _reflection.GeneratedProtocolMessageType('CMsgClientUFSShareFileResponse', (_message.Message,), dict(
DESCRIPTOR = _CMSGCLIENTUFSSHAREFILERESPONSE,
__module__ = 'steammessages_clientserver_ufs_pb2'
# @@protoc_insertion_point(class_scope:CMsgClientUFSShareFileResponse)
))
_sym_db.RegisterMessage(CMsgClientUFSShareFileResponse)
DESCRIPTOR._options = None
_CMSGCLIENTUFSGETFILELISTFORAPPRESPONSE._options = None
# @@protoc_insertion_point(module_scope)
| 43.903978 | 5,351 | 0.763872 | 7,419 | 64,012 | 6.291953 | 0.047041 | 0.051928 | 0.045116 | 0.037853 | 0.667909 | 0.629327 | 0.622279 | 0.617245 | 0.608526 | 0.603877 | 0 | 0.0414 | 0.12154 | 64,012 | 1,457 | 5,352 | 43.934111 | 0.788732 | 0.029088 | 0 | 0.721068 | 1 | 0.006677 | 0.191694 | 0.170138 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.004451 | 0 | 0.004451 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
b30b5d86cfc906696b4691d662e5cec240485e36 | 695 | py | Python | Problems/CodingBat/list-1.py | kvlizhvn/Lab_7 | e7f7f8da2b5f52a426bb55981594fb8ddcbd127a | [
"MIT"
] | 1 | 2022-02-18T15:44:46.000Z | 2022-02-18T15:44:46.000Z | Problems/CodingBat/list-1.py | kvlizhvn/Lab_7 | e7f7f8da2b5f52a426bb55981594fb8ddcbd127a | [
"MIT"
] | null | null | null | Problems/CodingBat/list-1.py | kvlizhvn/Lab_7 | e7f7f8da2b5f52a426bb55981594fb8ddcbd127a | [
"MIT"
] | 1 | 2021-03-26T13:55:52.000Z | 2021-03-26T13:55:52.000Z | def first_last6(nums):
return 6 in [nums[0], nums[-1]]
def common_end(a, b):
return a[0] == b[0] or a[-1] == b[-1]
def reverse3(nums):
return [nums[2], nums[1], nums[0]]
def middle_way(a, b):
return [a[1], b[1]]
def make_ends(nums):
return [nums[0], nums[-1]]
def has23(nums):
return 2 in nums or 3 in nums
def same_first_last(nums):
return len(nums) > 0 and nums[0] == nums[-1]
def make_pi():
return [3, 1, 4]
def sum3(nums):
return sum(nums)
def max_end3(nums):
return [nums[0]] * 3 if nums[0] >= nums[-1] else [nums[-1]] * 3
def rotate_left3(nums):
return [nums[1], nums[2], nums[0]]
def sum2(nums):
return sum(nums[:2])
| 14.479167 | 67 | 0.576978 | 128 | 695 | 3.0625 | 0.289063 | 0.229592 | 0.091837 | 0.102041 | 0.135204 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074766 | 0.230216 | 695 | 47 | 68 | 14.787234 | 0.657944 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
b33e19fbdbe82bee4be43876c1dfef3e85c43573 | 326 | py | Python | python/example_robot_data/__init__.py | pFernbach/example-robot-data | cb2c967d5c1eae60f9ad0f7482f4b0f9bc50bd95 | [
"BSD-3-Clause"
] | null | null | null | python/example_robot_data/__init__.py | pFernbach/example-robot-data | cb2c967d5c1eae60f9ad0f7482f4b0f9bc50bd95 | [
"BSD-3-Clause"
] | null | null | null | python/example_robot_data/__init__.py | pFernbach/example-robot-data | cb2c967d5c1eae60f9ad0f7482f4b0f9bc50bd95 | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa
from .robots_loader import (getModelPath, loadANYmal, loadDoublePendulum, loadHector, loadHyQ, loadICub, loadIris,
loadKinova, loadPanda, loadRomeo, loadSolo, loadTalos, loadTalosArm, loadTalosLegs,
loadTiago, loadTiagoNoHand, loadUR, readParamsFromSrdf)
| 65.2 | 114 | 0.687117 | 24 | 326 | 9.291667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004065 | 0.245399 | 326 | 4 | 115 | 81.5 | 0.902439 | 0.03681 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 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 |
b34ff7fa69f3e3f5bfc23e38c67cb370b057b74a | 74 | py | Python | latest/modules/plotting-23.py | willtryagain/sympy_doc | ec1b7285b5fc5b3ba2eafa32470066122ae84b52 | [
"BSD-3-Clause"
] | 20 | 2015-01-28T01:08:13.000Z | 2021-12-19T04:03:28.000Z | latest/modules/plotting-23.py | willtryagain/sympy_doc | ec1b7285b5fc5b3ba2eafa32470066122ae84b52 | [
"BSD-3-Clause"
] | 31 | 2015-01-27T07:16:19.000Z | 2021-11-15T10:58:15.000Z | latest/modules/plotting-23.py | willtryagain/sympy_doc | ec1b7285b5fc5b3ba2eafa32470066122ae84b52 | [
"BSD-3-Clause"
] | 38 | 2015-01-08T18:48:27.000Z | 2021-12-02T13:19:43.000Z | from sympy import plot_implicit, symbols, Eq, And
x, y = symbols('x y')
| 24.666667 | 50 | 0.689189 | 13 | 74 | 3.846154 | 0.769231 | 0.08 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189189 | 74 | 2 | 51 | 37 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 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 |
2fdecda4305140c6fbe077bae8d46cde4a483154 | 165 | py | Python | PyTemp/gis/shape.py | SwaggerKhan/PatrolGis | 89b1a398ffd6171ac35ea9d023bce98a0fc7e930 | [
"MIT"
] | null | null | null | PyTemp/gis/shape.py | SwaggerKhan/PatrolGis | 89b1a398ffd6171ac35ea9d023bce98a0fc7e930 | [
"MIT"
] | null | null | null | PyTemp/gis/shape.py | SwaggerKhan/PatrolGis | 89b1a398ffd6171ac35ea9d023bce98a0fc7e930 | [
"MIT"
] | null | null | null | import os
import earthpy as et
import random
#
# class Shape_File():
# def __init__(self, name):
# self._name = name
#
# def open_shape_file(self):
| 15 | 32 | 0.642424 | 23 | 165 | 4.26087 | 0.608696 | 0.183673 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.248485 | 165 | 10 | 33 | 16.5 | 0.790323 | 0.642424 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
6414e955d1e1d9c3981ce1733c01e946f8652e9f | 169 | py | Python | FileMover.py | sventhijssen/compact | 1bc90f1bad4c034568abc2f7ffb6c6324743e87d | [
"Apache-2.0"
] | 2 | 2022-03-13T11:51:52.000Z | 2022-03-13T19:43:44.000Z | FileMover.py | sventhijssen/compact | 1bc90f1bad4c034568abc2f7ffb6c6324743e87d | [
"Apache-2.0"
] | null | null | null | FileMover.py | sventhijssen/compact | 1bc90f1bad4c034568abc2f7ffb6c6324743e87d | [
"Apache-2.0"
] | 1 | 2022-03-12T22:12:50.000Z | 2022-03-12T22:12:50.000Z | import subprocess
class FileMover:
@staticmethod
def move(from_file, to_file):
subprocess.call(['mv', from_file, to_file], stdout=subprocess.DEVNULL)
| 18.777778 | 78 | 0.710059 | 21 | 169 | 5.52381 | 0.666667 | 0.137931 | 0.172414 | 0.241379 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183432 | 169 | 8 | 79 | 21.125 | 0.84058 | 0 | 0 | 0 | 0 | 0 | 0.011834 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
641e105f3ce04daf5a41837e74faedb5b25dcf10 | 40,833 | py | Python | app/definitions/tests/test_queries.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 53 | 2020-07-01T23:11:59.000Z | 2022-03-31T19:10:28.000Z | app/definitions/tests/test_queries.py | metamapper-io/metamapper | 376716e72bcaca62f1ec09ca9a13a0346e5502f9 | [
"BSD-2-Clause"
] | 5 | 2020-11-25T19:48:57.000Z | 2022-02-27T23:50:18.000Z | app/definitions/tests/test_queries.py | metamapper-io/metamapper | 376716e72bcaca62f1ec09ca9a13a0346e5502f9 | [
"BSD-2-Clause"
] | 5 | 2020-08-29T16:43:59.000Z | 2022-01-17T19:05:30.000Z | # -*- coding: utf-8 -*-
import unittest.mock as mock
import app.definitions.models as models
import testutils.cases as cases
import testutils.decorators as decorators
import testutils.factories as factories
import testutils.helpers as helpers
class TestGetDatastores(cases.GraphQLTestCase):
"""Test cases for listing all datastores in a workspace.
"""
factory = factories.DatastoreFactory
operation = 'datastores'
statement = '''
query getDatastores {
datastores {
edges {
node {
id
pk
name
isEnabled
jdbcConnection {
engine
}
}
}
totalCount
}
}
'''
def setUp(self):
super(TestGetDatastores, self).setUp()
models.Datastore.objects.all().delete()
self.count = 5
self.datastores = self.factory.create_batch(self.count, workspace=self.workspace)
self.other_datastore = self.factory(workspace=self.other_workspace)
@decorators.as_someone(['MEMBER', 'READONLY', 'OWNER'])
def test_query_when_authorized(self):
results = self.execute(self.statement)
results = results['data'][self.operation]
self.assertEqual(
first=len(results['edges']),
second=self.count,
msg="Node count should equal number of active datastores."
)
self.assertEqual(
first=len(results['edges']),
second=results['totalCount'],
msg="Node count should equal totalCount field."
)
@decorators.as_someone(['MEMBER', 'READONLY', 'OWNER'])
def test_query_when_object_permissions_are_disabled(self):
restricted_datastore = self.factory(workspace=self.workspace, object_permissions_enabled=True)
results = self.execute(self.statement)
results = results['data'][self.operation]
count = self.count
# Owners should still be able to see every datastore in the workspace.
if self.user_type == 'OWNER':
count += 1
self.assertEqual(
first=len(results['edges']),
second=count,
msg="Node count should equal number of active datastores."
)
self.assertEqual(
first=len(results['edges']),
second=results['totalCount'],
msg="Node count should equal totalCount field."
)
# We need to clean up this test at the end so it doesn't affect the other decorated tests.
restricted_datastore.delete()
@decorators.as_someone(['OUTSIDER', 'ANONYMOUS'])
def test_query_when_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
self.assertPermissionDenied(self.execute(self.statement))
class TestSearchDatastoresByName(cases.GraphQLTestCase):
"""Test cases for searching for a datastore.
"""
factory = factories.DatastoreFactory
operation = 'datastores'
statement = '''
query getDatastores($search: String) {
datastores(search: $search) {
edges {
node {
name
isEnabled
}
}
}
}
'''
def setUp(self):
super(TestSearchDatastoresByName, self).setUp()
self.names = [
'Alpha',
'Beta',
'Alpha Beta',
]
self.datastores = []
for n in self.names:
self.datastores.append(
self.factory(name=n, workspace=self.workspace)
)
self.excluded_datastore = self.factory(
name='Beta Alpha',
workspace=self.workspace,
object_permissions_enabled=True,
)
self.names += ['Beta Alpha']
def test_query(self):
"""It should return a limited number of datastores.
"""
results = self.execute(self.statement, variables={'search': 'alpha'})
results = results['data'][self.operation]
self.assertEqual(len(results['edges']), 3)
self.assertIn(results['edges'][0]['node']['name'], self.names)
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_with_object_permissions_filters(self):
"""It should return a limited number of datastores.
"""
results = self.execute(self.statement, variables={'search': 'alpha'})
results = results['data'][self.operation]
self.assertEqual(len(results['edges']), 2)
self.assertIn(results['edges'][0]['node']['name'], self.names)
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_with_object_permission_granted(self):
"""It should return a limited number of datastores.
"""
self.excluded_datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables={'search': 'alpha'})
results = results['data'][self.operation]
self.assertEqual(len(results['edges']), 3)
self.assertIn(results['edges'][0]['node']['name'], self.names)
class TestGetDatastore(cases.GraphQLTestCase):
"""Test cases for fetching a specific datastore.
"""
factory = factories.DatastoreFactory
operation = 'datastore'
statement = '''
query getDatastoreSettings($id: ID!) {
datastore(id: $id) {
name
tags
version
isEnabled
jdbcConnection {
engine
host
username
database
port
}
sshConfig {
isEnabled
host
user
port
publicKey
}
}
}
'''
def setUp(self):
super(TestGetDatastore, self).setUp()
self.datastore_kwargs = {
'name': 'Metamapper',
'tags': ['metadata', 'platform'],
'version': '9.0.1',
'is_enabled': False,
'engine': 'mysql',
'host': 'locahost',
'username': 'admin',
'password': 'password1234',
'port': 3306,
'database': 'metadata',
'workspace': self.workspace,
'ssh_host': '127.0.0.1',
'ssh_user': 'ubuntu',
'ssh_port': 22,
}
self.datastore = self.factory(**self.datastore_kwargs)
self.global_id = helpers.to_global_id('DatastoreType', self.datastore.pk)
@decorators.as_someone(['MEMBER', 'READONLY', 'OWNER'])
def test_query(self):
"""It should return the requested resource.
"""
results = self.execute(self.statement, variables={'id': self.global_id})
results = results['data'][self.operation]
self.assertEqual(results, {
'name': 'Metamapper',
'tags': ['metadata', 'platform'],
'version': '9.0.1',
'isEnabled': False,
'jdbcConnection': {
'engine': 'mysql',
'host': 'locahost',
'username': 'admin',
'database': 'metadata',
'port': 3306,
},
'sshConfig': {
'isEnabled': False,
'host': '127.0.0.1',
'user': 'ubuntu',
'port': 22,
'publicKey': self.workspace.ssh_public_key,
}
})
@decorators.as_someone(['OWNER'])
def test_object_permissions_as_owner(self):
"""It should return the requested resource if object-level permissions are granted.
"""
datastore = self.factory(workspace=self.workspace, object_permissions_enabled=True)
global_id = helpers.to_global_id('DatastoreType', datastore.pk)
results = self.execute(self.statement, variables={'id': global_id})
results = results['data'][self.operation]
self.assertEqual(results, {
'name': datastore.name,
'tags': datastore.tags,
'version': datastore.version,
'isEnabled': datastore.is_enabled,
'jdbcConnection': {
'engine': datastore.engine,
'host': datastore.host,
'username': datastore.username,
'database': datastore.database,
'port': datastore.port,
},
'sshConfig': {
'isEnabled': datastore.ssh_enabled,
'host': datastore.ssh_host,
'user': datastore.ssh_user,
'port': datastore.ssh_port,
'publicKey': self.workspace.ssh_public_key,
}
})
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_object_permissions(self):
"""It should return the requested resource if object-level permissions are granted.
"""
datastore = self.factory(workspace=self.workspace, object_permissions_enabled=True)
global_id = helpers.to_global_id('DatastoreType', datastore.pk)
results = self.execute(self.statement, variables={'id': global_id})
self.assertPermissionDenied(results)
datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables={'id': global_id})
results = results['data'][self.operation]
self.assertEqual(results, {
'name': datastore.name,
'tags': datastore.tags,
'version': datastore.version,
'isEnabled': datastore.is_enabled,
'jdbcConnection': {
'engine': datastore.engine,
'host': datastore.host,
'username': datastore.username,
'database': datastore.database,
'port': datastore.port,
},
'sshConfig': {
'isEnabled': datastore.ssh_enabled,
'host': datastore.ssh_host,
'user': datastore.ssh_user,
'port': datastore.ssh_port,
'publicKey': self.workspace.ssh_public_key,
}
})
@decorators.as_someone(['OUTSIDER'])
def test_query_when_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
results = self.execute(self.statement, variables={'id': self.global_id})
self.assertPermissionDenied(results)
class TestGetDatastoreBySlug(cases.GraphQLTestCase):
"""Tests for getting a datastore by slug.
"""
factory = factories.DatastoreFactory
operation = 'datastoreBySlug'
statement = '''
query getDatastoreBySlug($slug: String!) {
datastoreBySlug(slug: $slug) {
name
isEnabled
}
}
'''
@decorators.as_someone(['MEMBER', 'READONLY', 'OWNER'])
def test_query(self):
"""It returns the datastore object.
"""
datastore = self.factory(workspace=self.workspace)
results = self.execute(self.statement, variables={'slug': datastore.slug})
results = results['data'][self.operation]
self.assertEqual(results, {
'name': datastore.name,
'isEnabled': datastore.is_enabled,
})
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_with_object_permissions(self):
"""It returns the datastore object.
"""
datastore = self.factory(workspace=self.workspace, object_permissions_enabled=True)
datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables={'slug': datastore.slug})
results = results['data'][self.operation]
self.assertEqual(results, {
'name': datastore.name,
'isEnabled': datastore.is_enabled,
})
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_without_object_permissions(self):
"""It returns a 403 - Permission Denied error.
"""
datastore = self.factory(workspace=self.workspace, object_permissions_enabled=True)
results = self.execute(self.statement, variables={'slug': datastore.slug})
self.assertPermissionDenied(results)
def test_not_found(self):
"""If the datastore does not exist, we return a 404 – Not Found message.
"""
results = self.execute(self.statement, variables={'slug': 'hvob'})
self.assertNotFound(results)
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
datastore = self.factory(workspace=self.workspace)
results = self.execute(self.statement, variables={'slug': datastore.slug})
self.assertPermissionDenied(results)
class TestGetTableDefinition(cases.GraphQLTestCase):
"""Tests for getting a table definition for a datastore.
"""
factory = factories.TableFactory
operation = 'tableDefinition'
statement = '''
query getTableDefinition(
$datastoreId: ID!
$schemaName: String!
$tableName: String!
) {
tableDefinition(
datastoreId: $datastoreId
schemaName: $schemaName
tableName: $tableName
) {
name
schema {
name
}
owners {
type
owner {
id
name
}
}
}
}
'''
def _setup_and_get_variables(self, **overrides):
"""Setup test and return variables for query.
"""
datastore = factories.DatastoreFactory(workspace=self.workspace, **overrides)
schema = factories.SchemaFactory(workspace=self.workspace, datastore=datastore)
table = self.factory(workspace=self.workspace, schema=schema)
variables = {
'datastoreId': helpers.to_global_id('DatastoreType', datastore.pk),
'schemaName': schema.name,
'tableName': table.name,
}
return datastore, variables
@decorators.as_someone(['MEMBER', 'READONLY', 'OWNER'])
def test_query(self):
"""It returns the table definition object.
"""
_, variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, {
'name': variables['tableName'],
'schema': {
'name': variables['schemaName'],
},
'owners': [],
})
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_with_object_permissions(self):
"""It returns the datastore object.
"""
datastore, variables = self._setup_and_get_variables(object_permissions_enabled=True)
datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, {
'name': variables['tableName'],
'schema': {
'name': variables['schemaName'],
},
'owners': [],
})
@decorators.as_someone(['MEMBER', 'READONLY', 'OWNER'])
def test_query_with_owners(self):
"""It returns the table definition object with owners attached.
"""
datastore, variables = self._setup_and_get_variables()
table = datastore.schemas.first().tables.first()
table.owners.create(owner=self.user, workspace=table.workspace)
group = self.workspace.groups.get(id=12412)
table.owners.create(owner=group, workspace=table.workspace)
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, {
'name': variables['tableName'],
'schema': {
'name': variables['schemaName'],
},
'owners': [
{
'owner': {
'id': helpers.to_global_id('UserType', self.user.id),
'name': self.user.name,
},
'type': 'USER',
},
{
'owner': {
'id': helpers.to_global_id('GroupType', group.id),
'name': group.name,
},
'type': 'GROUP',
}
],
})
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_without_object_permissions(self):
"""It returns a 403 - Permission Denied error.
"""
_, variables = self._setup_and_get_variables(object_permissions_enabled=True)
results = self.execute(self.statement, variables=variables)
self.assertPermissionDenied(results)
def test_not_found(self):
"""If the datastore does not exist, we return a 404 – Not Found message.
"""
_, variables = self._setup_and_get_variables()
variables.update({'tableName': 'not_real'})
results = self.execute(self.statement, variables=variables)
self.assertNotFound(results)
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
_, variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
self.assertPermissionDenied(results)
class TestGetColumnDefinition(cases.GraphQLTestCase):
"""Tests for getting a column definition for a datastore.
"""
factory = factories.ColumnFactory
operation = 'columnDefinition'
statement = '''
query GetColumnDefinition(
$datastoreId: ID!
$schemaName: String!
$tableName: String!
$columnName: String!
) {
columnDefinition(
datastoreId: $datastoreId
schemaName: $schemaName
tableName: $tableName
columnName: $columnName
) {
name
readme
table {
name
}
}
}
'''
readme = '''
# Foobar
Foobar is a Python library for dealing with word pluralization.
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.
```bash
pip install foobar
```
'''
def _setup_and_get_variables(self, **overrides):
"""Setup test and return variables for query.
"""
datastore = factories.DatastoreFactory(workspace=self.workspace, **overrides)
schema = factories.SchemaFactory(workspace=self.workspace, datastore=datastore)
table = factories.TableFactory(workspace=self.workspace, schema=schema)
column = self.factory(workspace=self.workspace, table=table, readme=self.readme)
variables = {
'datastoreId': helpers.to_global_id('DatastoreType', datastore.pk),
'schemaName': schema.name,
'tableName': table.name,
'columnName': column.name,
}
return datastore, variables
@decorators.as_someone(['MEMBER', 'READONLY', 'OWNER'])
def test_query(self):
"""It returns the table definition object.
"""
_, variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, {
'name': variables['columnName'],
'readme': self.readme,
'table': {
'name': variables['tableName'],
},
})
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_with_object_permissions(self):
"""It returns the datastore object.
"""
datastore, variables = self._setup_and_get_variables(object_permissions_enabled=True)
datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, {
'name': variables['columnName'],
'readme': self.readme,
'table': {
'name': variables['tableName'],
},
})
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_without_object_permissions(self):
"""It returns a 403 - Permission Denied error.
"""
_, variables = self._setup_and_get_variables(object_permissions_enabled=True)
results = self.execute(self.statement, variables=variables)
self.assertPermissionDenied(results)
def test_not_found(self):
"""If the column does not exist, we return a 404 – Not Found message.
"""
_, variables = self._setup_and_get_variables()
variables.update({'tableName': 'not_real'})
results = self.execute(self.statement, variables=variables)
self.assertNotFound(results)
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
_, variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
self.assertPermissionDenied(results)
class TestGetDatastoreUserAccessPrivileges(cases.GraphQLTestCase):
"""Tests for getting datastore privileges scoped to users.
"""
factory = factories.DatastoreFactory
operation = 'datastoreUserAccessPrivileges'
statement = '''
query GetDatastoreAccessPrivileges($datastoreId: ID!) {
datastoreUserAccessPrivileges(datastoreId: $datastoreId) {
id
name
privileges
}
}
'''
def _setup_and_get_variables(self, **overrides):
"""Setup test and return variables for query.
"""
datastore = factories.DatastoreFactory(workspace=self.workspace, **overrides)
datastore.assign_all_perms(self.users['OWNER'])
variables = {
'datastoreId': helpers.to_global_id('DatastoreType', datastore.pk),
}
return datastore, variables
@decorators.as_someone(['OWNER'])
def test_query(self):
"""It returns the table definition object.
"""
_, variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, [
{
'id': 'VXNlclR5cGU6MQ==',
'name': 'Sam Crust',
'privileges': [
'add_datastore',
'change_datastore',
'change_datastore_access',
'change_datastore_connection',
'change_datastore_metadata',
'change_datastore_settings',
'comment_on_datastore',
'delete_datastore',
'view_datastore',
]
}
])
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_with_object_permissions(self):
"""It returns the datastore object.
"""
datastore, variables = self._setup_and_get_variables(object_permissions_enabled=True)
datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, [
{
'id': 'VXNlclR5cGU6MQ==',
'name': 'Sam Crust',
'privileges': [
'add_datastore',
'change_datastore',
'change_datastore_access',
'change_datastore_connection',
'change_datastore_metadata',
'change_datastore_settings',
'comment_on_datastore',
'delete_datastore',
'view_datastore',
]
},
{
'id': helpers.to_global_id('UserType', self.user.pk),
'name': self.user.name,
'privileges': [
'view_datastore',
]
},
])
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_without_object_permissions(self):
"""It returns a 403 - Permission Denied error.
"""
_, variables = self._setup_and_get_variables(object_permissions_enabled=True)
results = self.execute(self.statement, variables=variables)
self.assertPermissionDenied(results)
def test_not_found(self):
"""If the datastore does not exist, we return a 404 – Not Found message.
"""
results = self.execute(self.statement, variables={
'datastoreId': helpers.to_global_id('DatastoreType', '123456'),
})
self.assertNotFound(results)
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
_, variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
self.assertPermissionDenied(results)
class TestGetDatastoreGroupAccessPrivileges(cases.GraphQLTestCase):
"""Tests for getting datastore privileges scoped to groups.
"""
factory = factories.DatastoreFactory
operation = 'datastoreGroupAccessPrivileges'
statement = '''
query GetDatastoreAccessPrivileges($datastoreId: ID!) {
datastoreGroupAccessPrivileges(datastoreId: $datastoreId) {
id
name
privileges
}
}
'''
def setUp(self):
super().setUp()
self.group = factories.GroupFactory(workspace_id=self.workspace.id)
self.other_group = factories.GroupFactory(workspace_id=self.workspace.id)
self.outside_group = factories.GroupFactory(workspace_id=self.other_workspace.id)
def _setup_and_get_variables(self, **overrides):
"""Setup test and return variables for query.
"""
datastore = factories.DatastoreFactory(workspace=self.workspace, **overrides)
datastore.assign_all_perms(self.group)
variables = {
'datastoreId': helpers.to_global_id('DatastoreType', datastore.pk),
}
return datastore, variables
@decorators.as_someone(['OWNER'])
def test_query(self):
"""It returns the table definition object.
"""
_, variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, [
{
'id': helpers.to_global_id('GroupType', self.group.pk),
'name': self.group.name,
'privileges': [
'add_datastore',
'change_datastore',
'change_datastore_access',
'change_datastore_connection',
'change_datastore_metadata',
'change_datastore_settings',
'comment_on_datastore',
'delete_datastore',
'view_datastore',
]
}
])
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_with_object_permissions(self):
"""It returns the datastore object.
"""
self.group.user_set.add(self.user)
datastore, variables = self._setup_and_get_variables(object_permissions_enabled=True)
datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(results, [
{
'id': helpers.to_global_id('GroupType', self.group.pk),
'name': self.group.name,
'privileges': [
'add_datastore',
'change_datastore',
'change_datastore_access',
'change_datastore_connection',
'change_datastore_metadata',
'change_datastore_settings',
'comment_on_datastore',
'delete_datastore',
'view_datastore',
]
}
])
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_without_object_permissions(self):
"""It returns a 403 - Permission Denied error.
"""
_, variables = self._setup_and_get_variables(object_permissions_enabled=True)
results = self.execute(self.statement, variables=variables)
self.assertPermissionDenied(results)
def test_not_found(self):
"""If the datastore does not exist, we return a 404 – Not Found message.
"""
results = self.execute(self.statement, variables={
'datastoreId': helpers.to_global_id('DatastoreType', '123456'),
})
self.assertNotFound(results)
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
_, variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
self.assertPermissionDenied(results)
class TestGetDatastoreAssets(cases.GraphQLTestCase):
"""Tests for retrieving a list of tables associated with a datastore.
"""
factory = factories.DatastoreFactory
operation = 'datastoreAssets'
statement = '''
query GetDatastoreAssets($datastoreSlug: String!, $schemaName: String, $search: String, $first: Int, $after: String) {
datastoreAssets(
slug: $datastoreSlug
schema: $schemaName
search: $search
first: $first
after: $after
) {
edges {
node {
id
name
kind
shortDesc
schema {
name
}
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
'''
def setUp(self):
super(TestGetDatastoreAssets, self).setUp()
self.datastore = self.factory(workspace=self.workspace)
self.schema = factories.SchemaFactory(datastore=self.datastore)
self.assets = []
for i in range(10):
self.assets.append(
factories.TableFactory(name='app%s' % str(i).zfill(3), schema=self.schema)
)
for j in range(10):
self.assets.append(
factories.TableFactory(name='site%s' % str(j).zfill(3), schema=self.schema)
)
self.other_datastore = self.factory(workspace=self.workspace)
self.other_schema = factories.SchemaFactory(datastore=self.other_datastore)
self.other_table = factories.TableFactory(schema=self.other_schema, name='yyz')
@decorators.as_someone(['OWNER', 'MEMBER', 'READONLY'])
def test_valid(self):
"""Outside users should not be able to access this resource.
"""
variables = {
'datastoreSlug': self.datastore.slug,
'first': 100,
}
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(len(self.assets), len(results['edges']))
names = []
for edge in results['edges']:
names.append(edge['node']['name'])
for asset in self.assets:
self.assertIn(asset.name, names)
self.assertNotIn(self.other_table.name, names)
def test_pagination(self):
"""It should implement cursor pagination.
"""
variables = {
'datastoreSlug': self.datastore.slug,
'first': 10,
}
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertTrue(results['pageInfo']['hasNextPage'])
variables['after'] = results['pageInfo']['endCursor']
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertFalse(results['pageInfo']['hasNextPage'])
def test_search(self):
"""It should implement cursor pagination.
"""
variables = {
'datastoreSlug': self.datastore.slug,
'search': 'app',
}
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(len(results['edges']), 10)
def test_filter_by_schema(self):
"""It should filter the queryset by the provided schema.
"""
schema = factories.SchemaFactory(datastore=self.datastore, name='public')
tables = factories.TableFactory.create_batch(5, schema=schema)
variables = {
'datastoreSlug': self.datastore.slug,
'schemaName': schema.name,
}
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(len(results['edges']), len(tables))
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
results = self.execute(self.statement, variables={'datastoreSlug': self.datastore.slug})
self.assertPermissionDenied(results)
class TestGetSchemaNamesByDatastore(cases.GraphQLTestCase):
"""Tests for getting a list of schema names for a datastore.
"""
factory = factories.DatastoreFactory
operation = 'schemaNamesByDatastore'
statement = '''
query GetDatastoreSchemaNames($datastoreId: ID!) {
schemaNamesByDatastore(datastoreId: $datastoreId)
}
'''
def setUp(self):
super(TestGetSchemaNamesByDatastore, self).setUp()
self.datastore = self.factory(workspace=self.workspace)
self.schemas = factories.SchemaFactory.create_batch(10, datastore=self.datastore)
self.other_schema = factories.SchemaFactory()
self.variables = {
'datastoreId': helpers.to_global_id('DatastoreType', self.datastore.pk),
}
@decorators.as_someone(['OWNER', 'MEMBER', 'READONLY'])
def test_valid(self):
"""Outside users should not be able to access this resource.
"""
results = self.execute(self.statement, variables=self.variables)
results = results['data'][self.operation]
self.assertTrue(len(results), len(self.schemas))
self.assertTrue(self.other_schema.name not in results)
for schema in self.schemas:
self.assertIn(schema.name, results)
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_with_object_permissions(self):
"""It returns the datastore object.
"""
self.datastore.object_permissions_enabled = True
self.datastore.save()
self.datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables=self.variables)
results = results['data'][self.operation]
self.assertTrue(len(results), len(self.schemas))
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_without_object_permissions(self):
"""It returns a 403 - Permission Denied error.
"""
self.datastore.object_permissions_enabled = True
self.datastore.save()
results = self.execute(self.statement, variables=self.variables)
self.assertPermissionDenied(results)
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
results = self.execute(self.statement, variables=self.variables)
self.assertPermissionDenied(results)
class TestGetTableNamesBySchema(cases.GraphQLTestCase):
"""Tests for getting datastore privileges scoped to groups.
"""
factory = factories.DatastoreFactory
operation = 'tableNamesBySchema'
statement = '''
query GetSchemaTableNames(
$datastoreId: ID!
$schemaName: String!
) {
tableNamesBySchema(datastoreId: $datastoreId, schemaName: $schemaName)
}
'''
def setUp(self):
super(TestGetTableNamesBySchema, self).setUp()
self.datastore = self.factory(workspace=self.workspace)
self.schema = factories.SchemaFactory(datastore=self.datastore)
self.tables = factories.TableFactory.create_batch(10, schema=self.schema)
self.other_schema = factories.SchemaFactory(datastore=self.datastore)
self.other_table = factories.TableFactory(schema=self.other_schema)
self.variables = {
'datastoreId': helpers.to_global_id('DatastoreType', self.datastore.pk),
'schemaName': self.schema.name,
}
@decorators.as_someone(['OWNER', 'MEMBER', 'READONLY'])
def test_valid(self):
"""Outside users should not be able to access this resource.
"""
results = self.execute(self.statement, variables=self.variables)
results = results['data'][self.operation]
self.assertTrue(len(results), len(self.tables))
self.assertTrue(self.other_table.name not in results)
for table in self.tables:
self.assertIn(table.name, results)
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_with_object_permissions(self):
"""It returns the datastore object.
"""
self.datastore.object_permissions_enabled = True
self.datastore.save()
self.datastore.assign_perm(self.user, 'definitions.view_datastore')
results = self.execute(self.statement, variables=self.variables)
results = results['data'][self.operation]
self.assertTrue(len(results), len(self.tables))
@decorators.as_someone(['MEMBER', 'READONLY'])
def test_query_without_object_permissions(self):
"""It returns a 403 - Permission Denied error.
"""
self.datastore.object_permissions_enabled = True
self.datastore.save()
results = self.execute(self.statement, variables=self.variables)
self.assertPermissionDenied(results)
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
results = self.execute(self.statement, variables=self.variables)
self.assertPermissionDenied(results)
class TestGetTableLastCommitTimestamp(cases.GraphQLTestCase):
"""Test cases for retrieving the last time a table was modified.
"""
factory = factories.TableFactory
operation = 'tableLastCommitTimestamp'
statement = '''
query GetTableLastCommitTimestamp(
$datastoreId: ID!
$schemaName: String!
$tableName: String!
) {
tableLastCommitTimestamp(
datastoreId: $datastoreId
schemaName: $schemaName
tableName: $tableName
)
}
'''
def _setup_and_get_variables(self, **overrides):
"""Setup test and return variables for query.
"""
datastore = factories.DatastoreFactory(workspace=self.workspace, **overrides)
schema = factories.SchemaFactory(workspace=self.workspace, datastore=datastore)
table = self.factory(workspace=self.workspace, schema=schema)
variables = {
'datastoreId': helpers.to_global_id('DatastoreType', datastore.pk),
'schemaName': schema.name,
'tableName': table.name,
}
return variables
@decorators.as_someone(['MEMBER', 'READONLY', 'OWNER'])
@mock.patch('app.inspector.service.get_engine')
def test_query_when_authorized(self, mock_get_engine):
mocked = mock.MagicMock()
mocked.get_last_commit_time_for_table.return_value = '2020-01-01'
mock_get_engine.return_value = mocked
variables = self._setup_and_get_variables()
results = self.execute(self.statement, variables=variables)
results = results['data'][self.operation]
self.assertEqual(
results,
mocked.get_last_commit_time_for_table.return_value,
)
@decorators.as_someone(['OUTSIDER'])
def test_not_authorized(self):
"""Outside users should not be able to access this resource.
"""
variables = self._setup_and_get_variables()
self.assertPermissionDenied(self.execute(self.statement, variables=variables))
| 33.116788 | 122 | 0.602209 | 3,841 | 40,833 | 6.266077 | 0.083572 | 0.024223 | 0.033031 | 0.05285 | 0.802933 | 0.771522 | 0.727314 | 0.699061 | 0.689255 | 0.666154 | 0 | 0.004311 | 0.284231 | 40,833 | 1,232 | 123 | 33.143669 | 0.819003 | 0.098278 | 0 | 0.658014 | 0 | 0.002257 | 0.20314 | 0.033514 | 0 | 0 | 0 | 0 | 0.072235 | 1 | 0.071106 | false | 0.001129 | 0.006772 | 0 | 0.138826 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
ff273abb2e6f647f8edfdf0e0ee619e12d43d129 | 321 | py | Python | sympy/utilities/quality_unicode.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | 8,323 | 2015-01-02T15:51:43.000Z | 2022-03-31T13:13:19.000Z | sympy/utilities/quality_unicode.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | 15,102 | 2015-01-01T01:33:17.000Z | 2022-03-31T22:53:13.000Z | sympy/utilities/quality_unicode.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | 4,490 | 2015-01-01T17:48:07.000Z | 2022-03-31T17:24:05.000Z | from sympy.utilities.exceptions import SymPyDeprecationWarning
SymPyDeprecationWarning(
feature="Import sympy.utilities.quality_unicode",
useinstead="Import from sympy.testing.quality_unicode",
issue=18095,
deprecated_since_version="1.6").warn()
from sympy.testing.quality_unicode import * # noqa:F401
| 32.1 | 62 | 0.791277 | 36 | 321 | 6.916667 | 0.583333 | 0.108434 | 0.128514 | 0.184739 | 0.240964 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035211 | 0.115265 | 321 | 9 | 63 | 35.666667 | 0.841549 | 0.028037 | 0 | 0 | 0 | 0 | 0.264516 | 0.193548 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.571429 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
ff29349981c81dcfe2f51b6c598d59e56b917bbf | 276 | py | Python | src/z3c/testsetup/tests/cave/samplesetup2.py | zopefoundation/z3c.testsetup | 7a07939b5df33d2124916385efdc9c82495d1b32 | [
"ZPL-2.1"
] | 1 | 2020-09-08T06:51:02.000Z | 2020-09-08T06:51:02.000Z | src/z3c/testsetup/tests/cave/samplesetup2.py | zopefoundation/z3c.testsetup | 7a07939b5df33d2124916385efdc9c82495d1b32 | [
"ZPL-2.1"
] | 2 | 2015-04-14T18:00:03.000Z | 2020-05-15T08:56:34.000Z | src/z3c/testsetup/tests/cave/samplesetup2.py | zopefoundation/z3c.testsetup | 7a07939b5df33d2124916385efdc9c82495d1b32 | [
"ZPL-2.1"
] | 1 | 2020-09-08T06:19:35.000Z | 2020-09-08T06:19:35.000Z | import z3c.testsetup
class CustomTestCollector(z3c.testsetup.TestCollector):
defaults = {
'extensions': ['.bar', ],
'fextensions': ['.baz', ],
}
def dummyfunc(self):
pass
test_suite = CustomTestCollector('z3c.testsetup.tests.cave')
| 19.714286 | 60 | 0.623188 | 24 | 276 | 7.125 | 0.791667 | 0.210526 | 0.362573 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014151 | 0.231884 | 276 | 13 | 61 | 21.230769 | 0.792453 | 0 | 0 | 0 | 0 | 0 | 0.192029 | 0.086957 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0.111111 | 0.111111 | 0 | 0.444444 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
ff33c803bcc047c0b2b7f2345488e44fc9ce7e66 | 3,951 | py | Python | airbyte-integrations/connectors/source-twitter-stats/source_twitter_stats/source.py | Vipoooool/airbyte | d08a6b5b4c6cfb16473bfcba584f6b7fe0ff83de | [
"MIT"
] | 2 | 2022-03-02T13:46:05.000Z | 2022-03-05T12:31:28.000Z | airbyte-integrations/connectors/source-twitter-stats/source_twitter_stats/source.py | Vipoooool/airbyte | d08a6b5b4c6cfb16473bfcba584f6b7fe0ff83de | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-twitter-stats/source_twitter_stats/source.py | Vipoooool/airbyte | d08a6b5b4c6cfb16473bfcba584f6b7fe0ff83de | [
"MIT"
] | null | null | null | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from abc import ABC
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple
import requests
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http import HttpStream
from airbyte_cdk.sources.streams.http.auth import Oauth2Authenticator
"""
TODO: Most comments in this class are instructive and should be deleted after the source is implemented.
This file provides a stubbed example of how to use the Airbyte CDK to develop both a source connector which supports full refresh or and an
incremental syncs from an HTTP API.
The various TODOs are both implementation hints and steps - fulfilling all the TODOs should be sufficient to implement one basic and one incremental
stream from a source. This pattern is the same one used by Airbyte internally to implement connectors.
The approach here is not authoritative, and devs are free to use their own judgement.
There are additional required TODOs in the files within the integration_tests folder and the spec.json file.
"""
# Basic full refresh stream
class TwitterStatsStream(HttpStream, ABC):
url_base = "https://example-api.com/v1/"
def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]:
return None
def request_params(
self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_page_token: Mapping[str, Any] = None
) -> MutableMapping[str, Any]:
return {}
def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapping]:
yield {}
class Twitter(TwitterStatsStream):
"""
TODO: Change class name to match the table/data source this stream corresponds to.
"""
# TODO: Fill in the primary key. Required. This is usually a unique field in the stream, like an ID or a timestamp.
primary_key = None
def path(
self, stream_state: Mapping[str, Any] = None, stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
) -> str:
return ""
# Basic incremental stream
class IncrementalTwitterStatsStream(TwitterStatsStream, ABC):
"""
TODO fill in details of this class to implement functionality related to incremental syncs for your connector.
if you do not need to implement incremental sync for any streams, remove this class.
"""
# TODO: Fill in to checkpoint stream reads after N records. This prevents re-reading of data if the stream fails for any reason.
state_checkpoint_interval = None
@property
def cursor_field(self) -> str:
"""
TODO
Override to return the cursor field used by this stream e.g: an API entity might always use created_at as the cursor field. This is
usually id or date based. This field's presence tells the framework this in an incremental stream. Required for incremental.
:return str: The name of the cursor field.
"""
return []
def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]) -> Mapping[str, Any]:
"""
Override to determine the latest state after reading the latest record. This typically compared the cursor_field from the latest record and
the current state and picks the 'most' recent cursor. This is how a stream's state is determined. Required for incremental.
"""
return {}
# Source
class SourceTwitterStats(AbstractSource):
def check_connection(self, logger, config) -> Tuple[bool, any]:
return True, None
def streams(self, config: Mapping[str, Any]) -> List[Stream]:
# TODO remove the authenticator if not required.
auth = Oauth2Authenticator() # Oauth2Authenticator is also available if you need oauth support
return [Twitter(authenticator=auth)]
| 39.909091 | 148 | 0.726145 | 546 | 3,951 | 5.199634 | 0.371795 | 0.025361 | 0.045791 | 0.02994 | 0.09299 | 0.083128 | 0.040859 | 0.040859 | 0.040859 | 0.040859 | 0 | 0.002549 | 0.205518 | 3,951 | 98 | 149 | 40.316327 | 0.90188 | 0.33384 | 0 | 0.055556 | 0 | 0 | 0.015246 | 0 | 0 | 0 | 0 | 0.091837 | 0 | 1 | 0.222222 | false | 0 | 0.194444 | 0.111111 | 0.805556 | 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 |
ff5a5277f7f7369d7d97276113e70fcecd7f17e9 | 783 | py | Python | server/agent/agent_callbacks.py | themaoci/Tarkov-Wireless-Exploit | 7058212efaea7525816f972a7ce7845ba8fa19de | [
"MIT"
] | 10 | 2020-03-03T18:22:07.000Z | 2020-12-26T17:38:25.000Z | server/agent/agent_callbacks.py | taylormcnally/Coolmura_v1.exe | a75dae42fefe88e18a46da5d1777acb5eb6f1ff6 | [
"MIT"
] | 2 | 2020-03-12T20:37:19.000Z | 2020-10-10T13:24:13.000Z | server/agent/agent_callbacks.py | taylormcnally/Coolmura_v1.exe | a75dae42fefe88e18a46da5d1777acb5eb6f1ff6 | [
"MIT"
] | 5 | 2020-03-03T18:22:09.000Z | 2020-05-14T10:39:21.000Z | import tensorflow as tf
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import numpy as np
import os
import cv2
import scipy.misc
from random import randint
cwd = os.getcwd()
class Autoencoder_Callbacks(tf.keras.callbacks.Callback):
def __init__(self, val_data):
super().__init__()
self.validation_data = val_data
def on_train_begin(self, logs=None):
return
def on_train_end(self, logs=None):
return
def on_epoch_begin(self, epoch, logs=None):
# print(np.shape(self.validation_data[0][0]))
return
def on_epoch_end(self, epoch, logs=None):
return
def on_batch_begin(self, batch, logs=None):
return
def on_batch_end(self, batch, logs=None):
return
| 20.076923 | 57 | 0.679438 | 111 | 783 | 4.567568 | 0.396396 | 0.059172 | 0.138067 | 0.134122 | 0.248521 | 0.185404 | 0 | 0 | 0 | 0 | 0 | 0.004959 | 0.227331 | 783 | 38 | 58 | 20.605263 | 0.833058 | 0.054917 | 0 | 0.230769 | 0 | 0 | 0.006793 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.269231 | false | 0 | 0.307692 | 0.230769 | 0.846154 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.