hexsha
stringlengths
40
40
size
int64
5
2.06M
ext
stringclasses
11 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
251
max_stars_repo_name
stringlengths
4
130
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
251
max_issues_repo_name
stringlengths
4
130
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
251
max_forks_repo_name
stringlengths
4
130
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
1
1.05M
avg_line_length
float64
1
1.02M
max_line_length
int64
3
1.04M
alphanum_fraction
float64
0
1
66edc872f39ffc8e4f5e60f1aba0149f68247a58
220
py
Python
my_lambdata/my_script.py
TheLadyJack/lambdata-pt5
0ff4a86f3cd35e502c0a8a1c704e7944298840f2
[ "MIT" ]
null
null
null
my_lambdata/my_script.py
TheLadyJack/lambdata-pt5
0ff4a86f3cd35e502c0a8a1c704e7944298840f2
[ "MIT" ]
null
null
null
my_lambdata/my_script.py
TheLadyJack/lambdata-pt5
0ff4a86f3cd35e502c0a8a1c704e7944298840f2
[ "MIT" ]
1
2020-05-11T02:49:28.000Z
2020-05-11T02:49:28.000Z
# my_script.py import pandas from my_lambdata.my_mod import enlarge print('HAPPY TUESDAY NIGHT') df = pandas.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]}) print(df.head()) x = 5 print("ENLARGE", x, "TO", enlarge(x))
14.666667
55
0.636364
66ee56f212ce0df2c239268cabb21b8541c895a2
1,063
py
Python
Week02/Assignment/jstoppelman_01.py
nkruyer/SkillsWorkshop2018
2201255ff63eca111635789267d0600a95854c38
[ "BSD-3-Clause" ]
1
2020-04-18T03:30:46.000Z
2020-04-18T03:30:46.000Z
Week02/Assignment/jstoppelman_01.py
nkruyer/SkillsWorkshop2018
2201255ff63eca111635789267d0600a95854c38
[ "BSD-3-Clause" ]
21
2018-07-12T19:12:23.000Z
2018-08-10T13:52:45.000Z
Week02/Assignment/jstoppelman_01.py
nkruyer/SkillsWorkshop2018
2201255ff63eca111635789267d0600a95854c38
[ "BSD-3-Clause" ]
60
2018-05-08T16:59:20.000Z
2018-08-01T14:28:28.000Z
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np from scipy.integrate import simps from scipy.optimize import curve_fit x = [ 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10. ] y = [3.43, 4.94, 6.45, 9.22, 6.32, 6.11, 4.63, 8.95, 7.8, 8.35, 11.45, 14.71, 11.97, 12.46, 17.42, 17.0, 15.45, 19.15, 20.86] x=np.asarray(x) y=np.asarray(y) coeff=np.polyfit(x,y,1) t=np.poly1d(coeff) params, covar = curve_fit(curve3,x,y) y3=np.asarray(curve3(x,*params)) bt3=BIC(y, y3,3) print(bt3) bt=BIC(y,t(x),1) print(bt) #print("area=", simps(t3(x),x)) plt.scatter(x,y) plt.plot(x,t(x),'-') plt.plot(x,curve3(x,*params),'-') plt.xlabel('x') plt.ylabel('y') plt.title('Week 2 Plot') plt.text(6,5,"area={}".format(simps(curve3(x,*params)),x)) plt.savefig("jstoppelman_01.png")
26.575
125
0.590781
66eed650aab89b6bac9cd47794d827289659357d
1,225
py
Python
apps/wordcount.py
marsupialtail/quokka
9dfffaf8499a27f121eb5007db5371934ab9fda5
[ "Apache-2.0" ]
4
2022-03-09T19:51:02.000Z
2022-03-24T22:00:18.000Z
apps/wordcount.py
marsupialtail/quokka
9dfffaf8499a27f121eb5007db5371934ab9fda5
[ "Apache-2.0" ]
null
null
null
apps/wordcount.py
marsupialtail/quokka
9dfffaf8499a27f121eb5007db5371934ab9fda5
[ "Apache-2.0" ]
1
2022-02-10T04:38:24.000Z
2022-02-10T04:38:24.000Z
import time import sys sys.path.append("/home/ubuntu/quokka/pyquokka") import pyarrow.compute as compute import pyarrow as pa import pandas as pd from pyquokka.quokka_runtime import TaskGraph from pyquokka.dataset import InputS3CSVDataset from pyquokka.executors import UDFExecutor, AggExecutor import ray from pyquokka.utils import LocalCluster, QuokkaClusterManager manager = QuokkaClusterManager() cluster = manager.get_cluster_from_json("config.json") task_graph = TaskGraph(cluster) reader = InputS3CSVDataset("wordcount-input",["text"], sep="|", stride = 128 * 1024 * 1024) words = task_graph.new_input_reader_node(reader, batch_func = udf2) agg = AggExecutor(fill_value=0) intermediate = task_graph.new_non_blocking_node({0:words},agg) result = task_graph.new_blocking_node({0:intermediate}, agg, ip_to_num_channel={cluster.leader_private_ip: 1}, partition_key_supplied={0:None}) task_graph.create() start = time.time() task_graph.run() print(time.time() - start) print(result.to_pandas())
36.029412
143
0.777959
66f14722457fd9966ac9b7749eb637bceaf702bb
5,464
py
Python
websauna/system/devop/cmdline.py
stevepiercy/websauna
2886b86f7920d75900c634958779d61aa73f011b
[ "CNRI-Python" ]
null
null
null
websauna/system/devop/cmdline.py
stevepiercy/websauna
2886b86f7920d75900c634958779d61aa73f011b
[ "CNRI-Python" ]
null
null
null
websauna/system/devop/cmdline.py
stevepiercy/websauna
2886b86f7920d75900c634958779d61aa73f011b
[ "CNRI-Python" ]
null
null
null
"""Helper functions to initializer Websauna framework for command line applications.""" # Standard Library import logging import os import sys import typing as t # Pyramid import plaster from pyramid import router from pyramid import scripting from rainbow_logging_handler import RainbowLoggingHandler # Websauna from websauna.system import Initializer from websauna.system.http import Request from websauna.system.http.utils import make_routable_request from websauna.system.model.meta import create_dbsession def prepare_config_uri(config_uri: str) -> str: """Make sure a configuration uri has the prefix ws://. :param config_uri: Configuration uri, i.e.: websauna/conf/development.ini :return: Configuration uri with the prefix ws://. """ if not config_uri.startswith('ws://'): config_uri = 'ws://{uri}'.format(uri=config_uri) return config_uri def get_wsgi_app(config_uri: str, defaults: dict) -> router.Router: """Return a Websauna WSGI application given a configuration uri. :param config_uri: Configuration uri, i.e.: websauna/conf/development.ini. :param defaults: Extra options to be passed to the app. :return: A Websauna WSGI Application """ config_uri = prepare_config_uri(config_uri) loader = plaster.get_loader(config_uri) return loader.get_wsgi_app(defaults=defaults) def initializer_from_app(app: router.Router) -> Initializer: """Return the initializer for the given app. :param app: Websauna WSGI application :return: Websauna Initializer """ initializer = getattr(app, 'initializer', None) assert initializer is not None, "Configuration did not yield to Websauna application with Initializer set up" return initializer def setup_logging(config_uri, disable_existing_loggers=False): """Include-aware Python logging setup from INI config file. """ config_uri = prepare_config_uri(config_uri) loader = plaster.get_loader(config_uri, protocols=['wsgi']) loader.setup_logging(disable_existing_loggers=disable_existing_loggers) def setup_console_logging(log_level: t.Optional[str]=None): """Setup console logging. Aimed to give easy sane defaults for logging in command line applications. Don't use logging settings from INI, but use hardcoded defaults. """ formatter = logging.Formatter("[%(asctime)s] [%(name)s %(funcName)s] %(message)s") # same as default # setup `RainbowLoggingHandler` # and quiet some logs for the test output handler = RainbowLoggingHandler(sys.stdout) handler.setFormatter(formatter) logger = logging.getLogger() logger.handlers = [handler] env_level = os.environ.get("LOG_LEVEL", "info") log_level = log_level or getattr(logging, env_level.upper()) logger.setLevel(log_level) logger = logging.getLogger("requests.packages.urllib3.connectionpool") logger.setLevel(logging.ERROR) # SQL Alchemy transactions logger = logging.getLogger("txn") logger.setLevel(logging.ERROR) def init_websauna(config_uri: str, sanity_check: bool=False, console_app: bool=False, extra_options: dict=None) -> Request: """Initialize Websauna WSGI application for a command line oriented script. Example: .. code-block:: python import sys from websauna.system.devop.cmdline import init_websauna config_uri = sys.argv[1] request = init_websauna(config_uri) :param config_uri: Path to config INI file :param sanity_check: Perform database sanity check on start :param console_app: Set true to setup console-mode logging. See :func:`setup_console_logging` :param extra_options: Passed through bootstrap() and is available as :attr:`websauna.system.Initializer.global_options`. :return: Faux Request object pointing to a site root, having registry and every configured. """ # Paster thinks we are a string if sanity_check: sanity_check = "true" else: sanity_check = "false" options = { "sanity_check": sanity_check } if extra_options: options.update(extra_options) app = get_wsgi_app(config_uri, defaults=options) initializer = initializer_from_app(app) registry = initializer.config.registry dbsession = create_dbsession(registry) # Set up the request with websauna.site_url setting as the base URL request = make_routable_request(dbsession, registry) # This exposes the app object for the integration tests e.g test_static_asset # TODO: Find a cleaner way to do this request.app = app return request def init_websauna_script_env(config_uri: str) -> dict: """Initialize Websauna WSGI application for a IPython notebook. :param config_uri: Path to config INI file :return: Dictionary of shell variables """ options = {"sanity_check": False} app = get_wsgi_app(config_uri, defaults=options) initializer = initializer_from_app(app) registry = initializer.config.registry dbsession = create_dbsession(registry) pyramid_env = scripting.prepare(registry=app.initializer.config.registry) pyramid_env["app"] = app pyramid_env["initializer"] = initializer # Websauna specific # Set up the request with websauna.site_url setting as the base URL request = make_routable_request(dbsession, registry) pyramid_env["request"] = request pyramid_env["dbsession"] = dbsession return pyramid_env
31.583815
124
0.731149
dd0515ae81e31b3081572aafa51d5253637ae85f
2,010
py
Python
src/apd/aggregation/actions/base.py
MatthewWilkes/apd.aggregation
427fa908f45332d623295f92e1ccfdaf545d6997
[ "BSD-3-Clause" ]
null
null
null
src/apd/aggregation/actions/base.py
MatthewWilkes/apd.aggregation
427fa908f45332d623295f92e1ccfdaf545d6997
[ "BSD-3-Clause" ]
11
2020-11-23T21:36:48.000Z
2022-03-12T00:48:58.000Z
src/apd/aggregation/actions/base.py
MatthewWilkes/apd.aggregation
427fa908f45332d623295f92e1ccfdaf545d6997
[ "BSD-3-Clause" ]
1
2020-08-09T01:47:59.000Z
2020-08-09T01:47:59.000Z
import typing as t from ..typing import T_value from ..database import DataPoint from ..exceptions import NoDataForTrigger
31.904762
77
0.636816
dd05c5af3b4de9bb3a156483a19f52a9e8f9c454
1,056
py
Python
scripts/32_Model_Parse_SPRING/24_Collect_Test_Gold_Graphs.py
MeghaTiya/amrlib
61febbd1ed15d64e3f01126eaeea46211d42e738
[ "MIT" ]
null
null
null
scripts/32_Model_Parse_SPRING/24_Collect_Test_Gold_Graphs.py
MeghaTiya/amrlib
61febbd1ed15d64e3f01126eaeea46211d42e738
[ "MIT" ]
null
null
null
scripts/32_Model_Parse_SPRING/24_Collect_Test_Gold_Graphs.py
MeghaTiya/amrlib
61febbd1ed15d64e3f01126eaeea46211d42e738
[ "MIT" ]
1
2022-02-09T16:20:42.000Z
2022-02-09T16:20:42.000Z
#!/usr/bin/python3 import setup_run_dir # Set the working directory and python sys.path to 2 levels above import os from glob import glob from amrlib.graph_processing.amr_loading_raw import load_raw_amr # Collect all the amr graphs from multiple files and create a gold test file. # This simply concatenates files and cleans a few bad characters out. The glob pattern # needs to be exactly the same as what's in generate so the output graph ordering is the same. if __name__ == '__main__': glob_pattern = 'amrlib/data/amr_annotation_3.0/data/amrs/split/test/*.txt' out_fpath = 'amrlib/data/model_parse_spring/test-gold.txt.wiki' # Load the data graphs = [] print('Loading data from', glob_pattern) for fpath in sorted(glob(glob_pattern)): graphs.extend(load_raw_amr(fpath)) print('Loaded {:,} graphs'.format(len(graphs))) # Save the collated data print('Saving data to', out_fpath) with open(out_fpath, 'w') as f: for graph in graphs: f.write('%s\n\n' % graph) print()
37.714286
94
0.705492
dd0710c4323697be4edfde027a5e9419170be224
1,818
py
Python
migrations/versions/281362c70f34_.py
TobiasPrt/Smartphoniker-shop
6b74a3cc1c81db7a56d70609dbca29ddeec3053f
[ "MIT" ]
2
2020-05-11T08:46:45.000Z
2020-05-11T09:09:57.000Z
migrations/versions/281362c70f34_.py
TobiasPrt/Smartphoniker-shop
6b74a3cc1c81db7a56d70609dbca29ddeec3053f
[ "MIT" ]
4
2021-02-19T13:31:53.000Z
2022-02-20T13:34:10.000Z
migrations/versions/281362c70f34_.py
TobiasPrt/Smartphoniker-shop
6b74a3cc1c81db7a56d70609dbca29ddeec3053f
[ "MIT" ]
5
2020-04-27T16:25:39.000Z
2020-06-07T16:03:15.000Z
"""empty message Revision ID: 281362c70f34 Revises: acff3391146d Create Date: 2020-05-27 16:58:11.029790 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '281362c70f34' down_revision = 'acff3391146d' branch_labels = None depends_on = None
31.894737
65
0.60011
dd07924629dd0724abf147fb5de6f38d430e1d51
136
py
Python
ui/widgets/histogram/__init__.py
berendkleinhaneveld/Registrationshop
0d6f3ee5324865cdcb419369139f37c39dfe9a1c
[ "MIT" ]
25
2015-11-08T16:36:54.000Z
2022-01-20T16:03:28.000Z
ui/widgets/histogram/__init__.py
berendkleinhaneveld/Registrationshop
0d6f3ee5324865cdcb419369139f37c39dfe9a1c
[ "MIT" ]
2
2016-12-01T23:13:08.000Z
2017-07-25T02:40:49.000Z
ui/widgets/histogram/__init__.py
berendkleinhaneveld/Registrationshop
0d6f3ee5324865cdcb419369139f37c39dfe9a1c
[ "MIT" ]
10
2016-07-05T14:39:16.000Z
2022-01-01T02:05:55.000Z
from Histogram import Histogram from HistogramWidget import HistogramWidget from TrackingHistogramWidget import TrackingHistogramWidget
34
59
0.911765
dd083d9565ab68711f5686f12e467a2276370bf5
188
py
Python
python_module/numpy_module/numpy_test.py
panc-test/python-study
fb172ed4a4f7fb521de9a005cd55115ad63a5b6d
[ "MIT" ]
1
2021-09-17T09:32:56.000Z
2021-09-17T09:32:56.000Z
python_module/numpy_module/numpy_test.py
panc-test/python-study
fb172ed4a4f7fb521de9a005cd55115ad63a5b6d
[ "MIT" ]
2
2021-05-11T05:47:13.000Z
2021-05-11T05:48:10.000Z
python_module/numpy_module/numpy_test.py
panc-test/python-study
fb172ed4a4f7fb521de9a005cd55115ad63a5b6d
[ "MIT" ]
null
null
null
""" numpy """ import numpy # array = numpy.array([[1,2,3],[4,5,6]]) print(array,'\n',type(array)) # print(array.ndim) # print(array.shape) # print(array.size)
11.75
38
0.654255
dd0944f2e40b50921bc2a055a4736363525bffe8
395
py
Python
mellophone/mellophone/settings_production.py
nchlswhttkr/mellophone
c454c26d06a0cdebabc7b9ec5fef22c9c48d6ea6
[ "MIT" ]
9
2019-02-11T03:35:18.000Z
2019-07-17T07:51:44.000Z
mellophone/mellophone/settings_production.py
nchlswhttkr/mellophone
c454c26d06a0cdebabc7b9ec5fef22c9c48d6ea6
[ "MIT" ]
26
2019-03-13T05:11:08.000Z
2020-04-21T03:53:10.000Z
mellophone/mellophone/settings_production.py
nchlswhttkr/mellophone
c454c26d06a0cdebabc7b9ec5fef22c9c48d6ea6
[ "MIT" ]
2
2019-07-19T05:24:58.000Z
2019-09-20T06:36:44.000Z
# pylint: disable=unused-wildcard-import,wildcard-import """ Please try and avoid modifying this file where possible, doing so may cause different behaviours between local (development) and production environments. Instead consider modifying the base (default) config. This way, the production config is effectively the default for this project. """ from mellophone.settings_default import *
32.916667
78
0.807595
dd0a966e3c92349746b727ce42ffb0efe29eb341
232
py
Python
pythonProject/051.py
MontanhaRio/python
43ad6173d692ebeb153c23c893e4b8f0bf07afcc
[ "MIT" ]
null
null
null
pythonProject/051.py
MontanhaRio/python
43ad6173d692ebeb153c23c893e4b8f0bf07afcc
[ "MIT" ]
null
null
null
pythonProject/051.py
MontanhaRio/python
43ad6173d692ebeb153c23c893e4b8f0bf07afcc
[ "MIT" ]
null
null
null
#051 - Progresso Aritmtica primeiro = int(input('primeiro termo: ')) razao = int(input('razao: ')) decimo = primeiro + (10 - 1) * razao for c in range(primeiro, decimo + razao, razao): print(f'{c}', end=' - ') print('acabou')
29
48
0.637931
dd0b8f696341df5e31ece62f9a50dbeb45afc875
5,175
py
Python
ProxyCrawl/ProxyCrawl/rules.py
Time1ess/ProxyPool
c44e74e8045fc560e5fe905aa41135ecb3e6da98
[ "MIT" ]
18
2017-04-25T09:39:08.000Z
2022-03-09T08:07:28.000Z
ProxyCrawl/ProxyCrawl/rules.py
ghosttyq/ProxyPool
c44e74e8045fc560e5fe905aa41135ecb3e6da98
[ "MIT" ]
null
null
null
ProxyCrawl/ProxyCrawl/rules.py
ghosttyq/ProxyPool
c44e74e8045fc560e5fe905aa41135ecb3e6da98
[ "MIT" ]
10
2017-05-29T00:53:41.000Z
2021-05-08T09:07:52.000Z
#!/usr/local/bin/python3 # coding: UTF-8 # Author: David # Email: youchen.du@gmail.com # Created: 2017-04-26 11:14 # Last modified: 2017-04-30 15:55 # Filename: rules.py # Description: import os import redis from scrapy.utils.conf import init_env from ProxyCrawl.settings import PROJECT_ROOT conn = redis.Redis(decode_responses=True) labels = ('name', 'url_fmt', 'row_xpath', 'host_xpath', 'port_xpath', 'addr_xpath', 'mode_xpath', 'proto_xpath', 'vt_xpath', 'max_page') if __name__ == '__main__': # rule = Rule.load('xici') init_env('default') rules = Rule.loads('csv') for r in rules: r.save() print(rules[0]) # rule.save_rule()
26.813472
79
0.565217
dd0c981b401b14bcc898b39cf9bb3a7382b0f82e
1,299
py
Python
bcs-ui/backend/helm/authtoken/views.py
kayinli/bk-bcs
93a0856175f7b066ef835921572c1cac590dbd8e
[ "Apache-2.0" ]
1
2021-11-16T08:15:13.000Z
2021-11-16T08:15:13.000Z
bcs-ui/backend/helm/authtoken/views.py
kayinli/bk-bcs
93a0856175f7b066ef835921572c1cac590dbd8e
[ "Apache-2.0" ]
null
null
null
bcs-ui/backend/helm/authtoken/views.py
kayinli/bk-bcs
93a0856175f7b066ef835921572c1cac590dbd8e
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making PaaS (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://opensource.org/licenses/MIT Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import logging from rest_framework import viewsets from backend.utils.views import ActionSerializerMixin, with_code_wrapper from .models import Token from .serializers import TokenSLZ, TokenUpdateSLZ logger = logging.getLogger(__name__)
34.184211
115
0.779831
dd114daf874a5113511e683f27e7e520b01176b1
3,469
py
Python
backend/workspaces/Users/actions/login.py
makakken/roseguarden
9a867f3d5e979b990bf474dcba81e5e9d0814c6a
[ "MIT" ]
null
null
null
backend/workspaces/Users/actions/login.py
makakken/roseguarden
9a867f3d5e979b990bf474dcba81e5e9d0814c6a
[ "MIT" ]
50
2021-03-28T03:06:19.000Z
2021-10-18T12:36:16.000Z
backend/workspaces/Users/actions/login.py
makakken/roseguarden
9a867f3d5e979b990bf474dcba81e5e9d0814c6a
[ "MIT" ]
1
2021-07-30T07:12:46.000Z
2021-07-30T07:12:46.000Z
""" The roseguarden project Copyright (C) 2018-2020 Marcus Drobisch, This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ __authors__ = ["Marcus Drobisch"] __contact__ = "roseguarden@fabba.space" __credits__ = [] __license__ = "GPLv3" from core.actions.action import Action from core.logs import logManager from core.actions import webclientActions import arrow
45.051948
118
0.63563
dd118309b83096677693134bb6b0d70a964e1ab7
1,157
py
Python
fastquotes/fund/__init__.py
YangzhenZhao/fastquotes
1faba9f7fc7801a11359001e08cefa9cfbc41d64
[ "MIT" ]
4
2020-11-18T11:25:00.000Z
2021-04-08T01:02:49.000Z
fastquotes/fund/__init__.py
YangzhenZhao/fastquotes
1faba9f7fc7801a11359001e08cefa9cfbc41d64
[ "MIT" ]
null
null
null
fastquotes/fund/__init__.py
YangzhenZhao/fastquotes
1faba9f7fc7801a11359001e08cefa9cfbc41d64
[ "MIT" ]
1
2020-11-18T11:25:01.000Z
2020-11-18T11:25:01.000Z
import json import requests
29.666667
83
0.586863
dd13e1b360546b453646ec337688f0743f83b569
3,374
py
Python
pyrentals/test_pyrentals.py
asm128/pyrentals
862a0f78d93b18499555dd3c8c1effb7cae9f99b
[ "MIT" ]
null
null
null
pyrentals/test_pyrentals.py
asm128/pyrentals
862a0f78d93b18499555dd3c8c1effb7cae9f99b
[ "MIT" ]
null
null
null
pyrentals/test_pyrentals.py
asm128/pyrentals
862a0f78d93b18499555dd3c8c1effb7cae9f99b
[ "MIT" ]
null
null
null
from pyrentals import Cart import unittest if __name__ == '__main__': unittest.main()
43.25641
116
0.648488
dd173340b0cceb447e4578760ece3ab7a5d8df8b
63,514
py
Python
src/simple_tools/p4a_processor.py
DVSR1966/par4all
86b33ca9da736e832b568c5637a2381f360f1996
[ "MIT" ]
51
2015-01-31T01:51:39.000Z
2022-02-18T02:01:50.000Z
src/simple_tools/p4a_processor.py
DVSR1966/par4all
86b33ca9da736e832b568c5637a2381f360f1996
[ "MIT" ]
7
2017-05-29T09:29:00.000Z
2019-03-11T16:01:39.000Z
src/simple_tools/p4a_processor.py
DVSR1966/par4all
86b33ca9da736e832b568c5637a2381f360f1996
[ "MIT" ]
12
2015-03-26T08:05:38.000Z
2022-02-18T02:01:51.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Authors: # - Grgoire Pan <gregoire.pean@hpc-project.com> # - Ronan Keryell <ronan.keryell@hpc-project.com> # + Many others... # Beware: class p4a_scmp_compiler declared in ../scmp/p4a_scmp_compiler.py # inherits from class p4a_processor. # Maybe a common parent class with the minimal set of shared features # should be defined, from which all compilers (say p4a_cuda_compiler, # p4a_openmp_compiler) would inherit. BC. import p4a_util import p4a_astrad import optparse import subprocess import sys import os import re import shutil import pypsex ''' Par4All processing ''' # Basic properties to be used in Par4All: default_properties = dict( # Useless to go on if something goes wrong... :-( #ABORT_ON_USER_ERROR = True, ABORT_ON_USER_ERROR = False, # Compute the intraprocedural preconditions at the same # Compute the intraprocedural preconditions at the same # time as transformers and use them to improve the # accuracy of expression and statement transformers: SEMANTICS_COMPUTE_TRANSFORMERS_IN_CONTEXT = True, # Use the more precise fix point operator to cope with # while loops: SEMANTICS_FIX_POINT_OPERATOR = "derivative", # Try to restructure the code for more precision: UNSPAGHETTIFY_TEST_RESTRUCTURING = True, UNSPAGHETTIFY_RECURSIVE_DECOMPOSITION = True, # Simplify for loops into Fortran do-loops internally for # better precision of analysis: FOR_TO_DO_LOOP_IN_CONTROLIZER = True, # Warning: assume that there is no aliasing between IO # streams ('FILE *' variables): ALIASING_ACROSS_IO_STREAMS = False, # Warning: this is a work in progress. Assume no weird # aliasing CONSTANT_PATH_EFFECTS = False, # Prevents automatic pretty-printing of OpenMP directives when # unsplitting. We will add them using ompify if requested. PRETTYPRINT_SEQUENTIAL_STYLE = "do", # Required property since floating point arithmetic operations are not # associative because of rounding. PIPS does not take that into # account now and is based on theoretical math... cf PIPS TRAC #551 # Well, Franois Irigoin seems to have improved this, so avoid # the spam of parenthesis... # PRETTYPRINT_ALL_PARENTHESES = True SCALARIZATION_USE_REGISTERS = False ) # The default values of some PIPS properties are OK for C but has to be # redefined for FORTRAN default_fortran_cuda_properties = dict( GPU_KERNEL_PREFIX = "P4A_KERNEL", GPU_WRAPPER_PREFIX = "P4A_WRAPPER", GPU_LAUNCHER_PREFIX = "P4A_LAUNCHER", GPU_FORTRAN_WRAPPER_PREFIX = "P4A_F08_WRAPPER", CROUGH_SCALAR_BY_VALUE_IN_FCT_DECL = True, CROUGH_SCALAR_BY_VALUE_IN_FCT_CALL = True, PRETTYPRINT_STATEMENT_NUMBER = False, CROUGH_FORTRAN_USES_INTERFACE = True, KERNEL_LOAD_STORE_LOAD_FUNCTION = "P4A_COPY_TO_ACCEL", KERNEL_LOAD_STORE_LOAD_FUNCTION_1D = "P4A_COPY_TO_ACCEL_1D", KERNEL_LOAD_STORE_LOAD_FUNCTION_2D = "P4A_COPY_TO_ACCEL_2D", KERNEL_LOAD_STORE_LOAD_FUNCTION_3D = "P4A_COPY_TO_ACCEL_3D", KERNEL_LOAD_STORE_LOAD_FUNCTION_4D = "P4A_COPY_TO_ACCEL_4D", KERNEL_LOAD_STORE_LOAD_FUNCTION_5D = "P4A_COPY_TO_ACCEL_5D", KERNEL_LOAD_STORE_LOAD_FUNCTION_6D = "P4A_COPY_TO_ACCEL_6D", KERNEL_LOAD_STORE_ALLOCATE_FUNCTION = "P4A_ACCEL_MALLOC", KERNEL_LOAD_STORE_STORE_FUNCTION = "P4A_COPY_FROM_ACCEL", KERNEL_LOAD_STORE_STORE_FUNCTION_1D = "P4A_COPY_FROM_ACCEL_1D", KERNEL_LOAD_STORE_STORE_FUNCTION_2D = "P4A_COPY_FROM_ACCEL_2D", KERNEL_LOAD_STORE_STORE_FUNCTION_3D = "P4A_COPY_FROM_ACCEL_3D", KERNEL_LOAD_STORE_STORE_FUNCTION_4D = "P4A_COPY_FROM_ACCEL_4D", KERNEL_LOAD_STORE_STORE_FUNCTION_5D = "P4A_COPY_FROM_ACCEL_5D", KERNEL_LOAD_STORE_STORE_FUNCTION_6D = "P4A_COPY_FROM_ACCEL_6D", KERNEL_LOAD_STORE_DEALLOCATE_FUNCTION = "P4A_ACCEL_FREE", KERNEL_LOAD_STORE_VAR_SUFFIX = "_num" ) # Import of pyps will be done manually. # Module instance will be held in following variable. pyps = None def apply_user_requested_phases(modules=None, phases_to_apply=[]): """Apply user requested phases to modules """ for ph in phases_to_apply: # Apply requested phases to modules: getattr(modules, ph)() if __name__ == "__main__": print(__doc__) print("This module is not directly executable") # Some Emacs stuff: ### Local Variables: ### mode: python ### mode: flyspell ### ispell-local-dictionary: "american" ### tab-width: 4 ### End:
43.592313
283
0.616211
dd173502c78ac900cdc7ccca958ee936158c16b0
4,790
py
Python
hivwholeseq/cross_sectional/get_subtype_entropy_synonymous.py
iosonofabio/hivwholeseq
d504c63b446c3a0308aad6d6e484ea1666bbe6df
[ "MIT" ]
3
2016-12-01T03:12:06.000Z
2021-07-03T01:29:26.000Z
hivwholeseq/cross_sectional/get_subtype_entropy_synonymous.py
iosonofabio/hivwholeseq
d504c63b446c3a0308aad6d6e484ea1666bbe6df
[ "MIT" ]
null
null
null
hivwholeseq/cross_sectional/get_subtype_entropy_synonymous.py
iosonofabio/hivwholeseq
d504c63b446c3a0308aad6d6e484ea1666bbe6df
[ "MIT" ]
3
2016-01-17T03:43:46.000Z
2020-03-25T07:00:11.000Z
# vim: fdm=marker ''' author: Fabio Zanini date: 12/01/15 content: Get subtype entropy from alignments, since it's used so often. ''' # Modules import os import argparse import cPickle as pickle import numpy as np from hivwholeseq.utils.miseq import alpha from hivwholeseq.utils.one_site_statistics import get_entropy from hivwholeseq.cross_sectional.filenames import ( get_subtype_reference_alignment_filename, get_subtype_reference_alignment_entropy_syn_filename) from hivwholeseq.cross_sectional.get_subtype_reference_alignment import get_subtype_reference_alignment # Functions def get_ali_entropy_syn(alim, positions=None, alpha=alpha[:5], VERBOSE=0): '''Get entropy of alignment at some positions''' from collections import defaultdict from hivwholeseq.utils.sequence import translate_with_gaps as translate if len(ali[0]) % 3: raise ValueError('The alignment length is not a multiple of 3') if positions is None: positions = np.arange(len(ali[0]) // 3) # The data structure is a nested dict by position and amino acid S = {} # Iterate over codons for pos in positions: if VERBOSE >= 3: print pos asub = alim[:, pos * 3: (pos + 1) * 3] aacount = defaultdict(lambda: defaultdict(int)) for cod in asub: cod = ''.join(cod) aacount[translate(cod)][cod] += 1 Spos = {} for aa, codd in aacount.iteritems(): af = np.array(codd.values(), float) af /= af.sum() Spos[aa] = get_entropy(af) S[pos] = Spos return S def get_subtype_reference_alignment_entropy_syn(region, subtype='B', VERBOSE=0, refname='HXB2', type='nuc'): '''Get the entropy of a large subtype reference alignment''' import cPickle as pickle fn = get_subtype_reference_alignment_entropy_syn_filename(region, subtype=subtype, refname=refname, type=type, VERBOSE=VERBOSE) with open(fn, 'r') as f: data = pickle.load(f) return data # Script if __name__ == '__main__': # Parse input args parser = argparse.ArgumentParser( description='Calculate entropy of subtype alignment', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--regions', nargs='+', required=True, help='Regions to analyze (e.g. F1 p17)') parser.add_argument('--verbose', type=int, default=0, help='Verbosity level [0-4]') parser.add_argument('--subtype', default='B', help='Subtype of the alignment') parser.add_argument('--reference', default='HXB2', help='Reference of the alignment') parser.add_argument('--save', action='store_true', help='Save to file') args = parser.parse_args() regions = args.regions VERBOSE = args.verbose subtype = args.subtype refname = args.reference use_save = args.save Ss = {} for region in regions: if VERBOSE >= 1: print region if use_save: if VERBOSE >= 2: print 'Get alignment' ali = get_subtype_reference_alignment(region, subtype=subtype, refname=refname, VERBOSE=VERBOSE) alim = np.array(ali, 'S1') if VERBOSE >= 2: print 'Compute entropy' S = get_ali_entropy_syn(alim, VERBOSE=VERBOSE) if VERBOSE >= 2: print 'Store to file' fn_out = get_subtype_reference_alignment_entropy_syn_filename(region, subtype=subtype, refname=refname, VERBOSE=VERBOSE) with open(fn_out, 'wb') as f: pickle.dump(S, f) else: if VERBOSE >= 2: print 'Get entropy from file' S = get_subtype_reference_alignment_entropy_syn(region, subtype=subtype, refname=refname, VERBOSE=VERBOSE) Ss[region] = S
33.971631
103
0.524426
dd17680bbd248da6c5086919dd5e04da84e0dd2e
15,119
py
Python
udebs/interpret.py
recrm/Udebs
d7e8e248e7afaf6559f2a96ce5dd6e2698d65af7
[ "MIT" ]
6
2017-08-20T02:48:12.000Z
2020-09-04T21:46:35.000Z
udebs/interpret.py
recrm/Udebs
d7e8e248e7afaf6559f2a96ce5dd6e2698d65af7
[ "MIT" ]
null
null
null
udebs/interpret.py
recrm/Udebs
d7e8e248e7afaf6559f2a96ce5dd6e2698d65af7
[ "MIT" ]
1
2019-08-28T00:48:43.000Z
2019-08-28T00:48:43.000Z
import copy import json import itertools import os import operator from .errors import * # --------------------------------------------------- # Imports and Variables - # --------------------------------------------------- def importFunction(f, args): """ Allows a user to import a single function into udebs. **deprecated - please use udebs.utilities.register """ module = { f.__name__: { "f": f.__name__ } } module[f.__name__].update(args) importModule(module, {f.__name__: f}) def importModule(dicts=None, globs=None, version=-1): """ Allows user to extend base variables available to the interpreter. Should be run before the instance object is created. **deprecated for users - please use udebs.utilities.register """ if globs is None: globs = {} if dicts is None: dicts = {} if version not in Variables.modules: Variables.modules[version] = {} Variables.modules[version].update(dicts) Variables.env.update(globs) def importSystemModule(name, globs=None): """Convenience script for import system keywords.""" if globs is None: globs = {} path = os.path.dirname(__file__) for version in Variables.versions: filename = "{}/keywords/{}-{}.json".format(path, name, str(version)) with open(filename) as fp: importModule(json.load(fp), globs, version) def _getEnv(local, glob=None): """Retrieves a copy of the base variables.""" value = copy.copy(Variables.env) if glob: value.update(glob) value["storage"] = local return value # --------------------------------------------------- # Interpreter Functions - # --------------------------------------------------- def formatS(string, version): """Converts a string into its python representation.""" string = str(string) if string == "self": return string elif string == "false": return "False" elif string == "true": return "True" elif string == "None": return string elif string.isdigit(): return string # String quoted by user. elif string[0] == string[-1] and string[0] in {"'", '"'}: return string # String has already been handled by call elif string[-1] == ")": return string elif string in Variables.env: return string # In case prefix notation used in keyword defaults. elif string[0] in Variables.keywords(version): return interpret(string, version) else: return "'" + string + "'" def call(args, version): """Converts callList into functionString.""" # Find keyword keywords = [i for i in args if i in Variables.keywords(version)] # Too many keywords is a syntax error. if len(keywords) > 1: raise UdebsSyntaxError("CallList contains to many keywords '{}'".format(args)) # No keywords creates a tuple object. elif len(keywords) == 0: return "(" + ",".join(formatS(i, version) for i in args) + ")" keyword = keywords[0] # Get and fix data for this keyword. data = copy.copy(Variables.default) data.update(Variables.keywords(version)[keyword]) # Create dict of values current = args.index(keyword) nodes = copy.copy(data["default"]) for index in range(len(args)): value = "$" if index >= current else "-$" value += str(abs(index - current)) if args[index] != keyword: nodes[value] = args[index] # Force strings into quoted arguments. for string in data["string"]: nodes[string] = "'" + str(nodes[string]).replace("'", "\\'") + "'" # Claim keyword arguments. kwargs = {} for key, value in data["kwargs"].items(): if value in nodes: new_value = nodes[value] del nodes[value] else: new_value = value kwargs[key] = formatS(new_value, version) arguments = [] # Insert positional arguments for key in data["args"]: if key in nodes: arguments.append(formatS(nodes[key], version)) del nodes[key] else: arguments.append(formatS(key, version)) # Insert ... arguments. if data["all"]: for key in sorted(nodes.keys(), key=lambda x: int(x.replace("$", ""))): arguments.append(formatS(nodes[key], version)) del nodes[key] if len(nodes) > 0: raise UdebsSyntaxError("Keyword contains unused arguments. '{}'".format(" ".join(args))) # Insert keyword arguments. for key in sorted(kwargs.keys()): arguments.append(str(key) + "=" + str(kwargs[key])) return data["f"] + "(" + ",".join(arguments) + ")" def split_callstring(raw, version): """Converts callString into call_list.""" open_bracket = {'(', '{', '['} close_bracket = {')', '}', ']'} call_list = [] buf = '' in_brackets = 0 in_quotes = False dot_legal = True for char in raw.strip(): if char in {'"', "'"}: in_quotes = not in_quotes elif not in_quotes: if char in open_bracket: in_brackets += 1 elif char in close_bracket: in_brackets -= 1 elif not in_brackets: if dot_legal: if char == ".": call_list.append(buf) buf = '' continue elif char.isspace(): dot_legal = False if call_list: call_list = [".".join(call_list) + "." + buf] buf = '' if char.isspace(): if buf: call_list.append(buf) buf = '' continue buf += char call_list.append(buf) if in_brackets: raise UdebsSyntaxError("Brackets are mismatched. '{}'".format(raw)) if '' in call_list: raise UdebsSyntaxError("Empty element in call_list. '{}'".format(raw)) # Length one special cases. if len(call_list) == 1: value = call_list[0] # Prefix calling. if value not in Variables.keywords(version): if value[0] in Variables.keywords(version): return [value[0], value[1:]] return call_list def interpret(string, version=1, debug=False): """Recursive function that parses callString""" try: _list = split_callstring(string, version) if debug: print("Interpret:", string) print("Split:", _list) found = [] for entry in _list: if entry[0] == "(" and entry[-1] == ")": found.append(interpret(entry[1:-1], version, debug)) elif "." in entry: found.append(interpret(entry, version, debug)) elif entry[0] in Variables.keywords(version) and entry not in Variables.keywords(version): found.append(interpret(entry, version, debug)) else: found.append(entry) comp = call(found, version) if debug: print("call:", _list) print("computed:", comp) return UdebsStr(comp) except Exception: print(string) raise # --------------------------------------------------- # Script Main Class - # --------------------------------------------------- # An easy way to distinguish between interpreted strings. # --------------------------------------------------- # Runtime - # --------------------------------------------------- importSystemModule("base") importSystemModule("udebs")
25.031457
102
0.511674
dd19eb06c6b535902edc1e166510cf7dc3e3ac06
425
py
Python
src/aequitas/plot/__init__.py
antoinelb/aequitas
5a912a3c1751b04c8688ad9e0c09ed87a6c48870
[ "MIT" ]
469
2018-04-24T23:11:45.000Z
2022-03-29T07:54:07.000Z
src/aequitas/plot/__init__.py
antoinelb/aequitas
5a912a3c1751b04c8688ad9e0c09ed87a6c48870
[ "MIT" ]
62
2018-04-16T00:14:56.000Z
2021-11-12T10:35:01.000Z
src/aequitas/plot/__init__.py
antoinelb/aequitas
5a912a3c1751b04c8688ad9e0c09ed87a6c48870
[ "MIT" ]
94
2018-05-21T16:13:57.000Z
2022-03-25T20:07:25.000Z
from aequitas.plot.summary_chart import plot_summary_chart as summary from aequitas.plot.bubble_disparity_chart import plot_disparity_bubble_chart as disparity from aequitas.plot.bubble_metric_chart import plot_metric_bubble_chart as absolute from aequitas.plot.bubble_concatenation_chart import plot_concatenated_bubble_charts as disparity_absolute from aequitas.plot.xy_metrics_chart import plot_xy_metrics_chart as scatter
85
106
0.908235
dd1a3f013274c36a04a9e56b4c6a20cb322ded06
287
py
Python
python-safety/predict.py
alexeyinkin/geonames-to-json
6055d4f3484f859a784aa8b9bfd96682a74fcd1b
[ "MIT" ]
null
null
null
python-safety/predict.py
alexeyinkin/geonames-to-json
6055d4f3484f859a784aa8b9bfd96682a74fcd1b
[ "MIT" ]
null
null
null
python-safety/predict.py
alexeyinkin/geonames-to-json
6055d4f3484f859a784aa8b9bfd96682a74fcd1b
[ "MIT" ]
null
null
null
import numpy as np from model import get_model #model = get_fit_model('random.tsv') #inputs_raw = [[0,0,0,0,0]] #inputs_np = np.array(inputs_raw) #print(model.predict(inputs_np))
20.5
38
0.71777
dd1a79c02a429daf639fa22cee8d29423011e935
12,150
py
Python
src/predict.py
yzhhome/JDProductSummaryGeneration
4939f061ca90ad7ddd69b5a1794735f962e45bc0
[ "MIT" ]
1
2021-09-18T07:42:36.000Z
2021-09-18T07:42:36.000Z
src/predict.py
yzhhome/JDProductSummaryGeneration
4939f061ca90ad7ddd69b5a1794735f962e45bc0
[ "MIT" ]
null
null
null
src/predict.py
yzhhome/JDProductSummaryGeneration
4939f061ca90ad7ddd69b5a1794735f962e45bc0
[ "MIT" ]
null
null
null
''' @Author: dzy @Date: 2021-09-13 11:07:48 @LastEditTime: 2021-09-26 20:25:17 @LastEditors: dzy @Description: Helper functions or classes used for the model. @FilePath: /JDProductSummaryGeneration/src/predict.py ''' import random import os import sys import pathlib import torch import jieba import config from model import PGN from dataset import PairDataset from utils import source2ids, outputids2words, Beam, timer, add2heap, replace_oovs abs_path = pathlib.Path(__file__).parent.absolute() if __name__ == "__main__": pred = Predict() print('vocab_size: ', len(pred.vocab)) # with open(config.test_data_path, 'r') as test: picked = random.choice(list(test)) source, ref = picked.strip().split('<sep>') print('source: ', source, '\n') greedy_prediction = pred.predict(source.split(), beam_search=False) print('greedy: ', greedy_prediction, '\n') beam_prediction = pred.predict(source.split(), beam_search=True) print('beam: ', beam_prediction, '\n') print('reference: ', ref, '\n')
38.087774
85
0.535885
dd1d14cad8d7b51f2d3997d8681795f2ed9d4e1a
2,863
py
Python
server/blog/models.py
rafay826/django-react
60bd7dcea8bb5c921f80d064e4d16fa34381ae09
[ "MIT" ]
null
null
null
server/blog/models.py
rafay826/django-react
60bd7dcea8bb5c921f80d064e4d16fa34381ae09
[ "MIT" ]
12
2020-06-05T21:17:35.000Z
2022-03-11T23:49:11.000Z
server/blog/models.py
midasdev711/djudo
5717ad63b0ef5dddddfd1d3839fa5231ac21972f
[ "MIT" ]
null
null
null
from django.db import models from django.db.models import permalink from django.core.urlresolvers import reverse from comments.models import Comment # Create your models here.
35.7875
103
0.691233
dd1d3ef072d0bbe5516060cc303f3f2982632867
305
py
Python
django_obfuscator/testobfuscator/models.py
vishnuc91/obfuscator-date
d4424cb7823dbf20543c5cc2bc0ce48d8d62a69a
[ "Apache-2.0" ]
null
null
null
django_obfuscator/testobfuscator/models.py
vishnuc91/obfuscator-date
d4424cb7823dbf20543c5cc2bc0ce48d8d62a69a
[ "Apache-2.0" ]
null
null
null
django_obfuscator/testobfuscator/models.py
vishnuc91/obfuscator-date
d4424cb7823dbf20543c5cc2bc0ce48d8d62a69a
[ "Apache-2.0" ]
null
null
null
from django.db import models # Create your models here.
30.5
67
0.734426
dd1ed841552b8b3a90cb7777b80332b35c886661
7,621
py
Python
PySyft_dev/FL_BC/cryptolib/wrapper_pyca.py
samuelxu999/FederatedLearning_dev
354d951c53ee20eb41bf7980210d61b7a358d341
[ "MIT" ]
null
null
null
PySyft_dev/FL_BC/cryptolib/wrapper_pyca.py
samuelxu999/FederatedLearning_dev
354d951c53ee20eb41bf7980210d61b7a358d341
[ "MIT" ]
2
2021-03-17T23:27:00.000Z
2021-03-17T23:27:01.000Z
PySyft_dev/FL_BC/cryptolib/wrapper_pyca.py
samuelxu999/FederatedLearning_dev
354d951c53ee20eb41bf7980210d61b7a358d341
[ "MIT" ]
2
2019-04-23T22:13:18.000Z
2019-08-19T01:39:51.000Z
''' ======================== Wrapper_pyca module ======================== Created on Nov.7, 2017 @author: Xu Ronghua @Email: rxu22@binghamton.edu @TaskDescription: This module provide cryptography function based on pyca API. @Reference:https://cryptography.io/en/latest/ ''' from cryptography.fernet import Fernet from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, dsa from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat, PrivateFormat, BestAvailableEncryption from cryptography.hazmat.primitives import serialization from cryptography.exceptions import InvalidSignature # Message digests (Hashing) related function ''' Get all dataset ''' if __name__ == "__main__": test_func() pass
28.543071
124
0.746228
dd1f85e853fc4ae8cfcfa14f28add26fec35c361
693
py
Python
src/utils/formatter.py
RuhuiCheng/ladybug
fa9e1ea660dd040d3ecfde96ad6c4db67df9bcb9
[ "Apache-2.0" ]
4
2020-03-14T10:43:29.000Z
2020-09-23T11:15:44.000Z
src/utils/formatter.py
RuhuiCheng/ladybug
fa9e1ea660dd040d3ecfde96ad6c4db67df9bcb9
[ "Apache-2.0" ]
null
null
null
src/utils/formatter.py
RuhuiCheng/ladybug
fa9e1ea660dd040d3ecfde96ad6c4db67df9bcb9
[ "Apache-2.0" ]
null
null
null
import logging import json from src.utils.ucm import app_id, env
26.653846
47
0.506494
dd21e59c37175256cff1379b7b03b4b83f129381
363
py
Python
afterglow_core/resources/job_plugins/__init__.py
SkynetRTN/afterglow-access-server
3d8d62f622577fdd1ae7b0076cb536251f7bf0cd
[ "Apache-2.0" ]
2
2021-05-24T15:12:07.000Z
2022-02-17T19:58:16.000Z
afterglow_core/resources/job_plugins/__init__.py
SkynetRTN/afterglow-access-server
3d8d62f622577fdd1ae7b0076cb536251f7bf0cd
[ "Apache-2.0" ]
1
2022-02-27T03:01:06.000Z
2022-02-27T03:01:06.000Z
afterglow_core/resources/job_plugins/__init__.py
SkynetRTN/afterglow-access-server
3d8d62f622577fdd1ae7b0076cb536251f7bf0cd
[ "Apache-2.0" ]
2
2021-06-08T18:16:40.000Z
2021-07-09T14:19:49.000Z
""" Afterglow Core: job plugin package A job plugin must define a custom model subclassing from :class:`afterglow_core.models.jobs.Job`, along with the optional custom result and settings models (subclassing from :class:`afterglow_core.models.jobs.JobResult` and :class:`afterglow_core.schemas.AfterglowSchema`, respectively), and implement :meth:`Job.run`. """
33
78
0.793388
dd2300aac8a3080e89edc939e28aa0516c80f6a3
4,909
py
Python
wotpy/wot/dictionaries/thing.py
JKRhb/wot-py
3eaa780189b686c82b7dbdea404fd8077bd3c9f9
[ "MIT" ]
null
null
null
wotpy/wot/dictionaries/thing.py
JKRhb/wot-py
3eaa780189b686c82b7dbdea404fd8077bd3c9f9
[ "MIT" ]
null
null
null
wotpy/wot/dictionaries/thing.py
JKRhb/wot-py
3eaa780189b686c82b7dbdea404fd8077bd3c9f9
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Wrapper class for dictionaries to represent Things. """ import six from wotpy.wot.dictionaries.base import WotBaseDict from wotpy.wot.dictionaries.interaction import PropertyFragmentDict, ActionFragmentDict, EventFragmentDict from wotpy.wot.dictionaries.link import LinkDict from wotpy.wot.dictionaries.security import SecuritySchemeDict from wotpy.utils.utils import to_camel from wotpy.wot.dictionaries.version import VersioningDict from wotpy.wot.enums import SecuritySchemeType
29.932927
106
0.606233
dd25aadd6a2a27a37d069c617bb272fc239e2c39
1,044
py
Python
MyApp/config.py
muayyad-alsadi/uPyApp
e81fb9d336a843d068ae93c866cf503989ef6a60
[ "Apache-2.0" ]
null
null
null
MyApp/config.py
muayyad-alsadi/uPyApp
e81fb9d336a843d068ae93c866cf503989ef6a60
[ "Apache-2.0" ]
null
null
null
MyApp/config.py
muayyad-alsadi/uPyApp
e81fb9d336a843d068ae93c866cf503989ef6a60
[ "Apache-2.0" ]
1
2020-03-18T07:27:27.000Z
2020-03-18T07:27:27.000Z
__all__ = ['app_config'] import sys, os, os.path try: import ConfigParser as configparser except ImportError: import configparser try: import simplejson as json except ImportError: import json from .base_utils import * app_config=AppConfig()
36
97
0.707854
dd25b254cf6453ad21e303d8fb8dc65ace25ddf6
1,131
py
Python
src/models/losses/corr_loss.py
yewzijian/RegTR
64e5b3f0ccc1e1a11b514eb22734959d32e0cec6
[ "MIT" ]
25
2022-03-28T06:26:16.000Z
2022-03-30T14:21:24.000Z
src/models/losses/corr_loss.py
yewzijian/RegTR
64e5b3f0ccc1e1a11b514eb22734959d32e0cec6
[ "MIT" ]
null
null
null
src/models/losses/corr_loss.py
yewzijian/RegTR
64e5b3f0ccc1e1a11b514eb22734959d32e0cec6
[ "MIT" ]
2
2022-03-29T09:37:50.000Z
2022-03-30T06:26:35.000Z
import torch import torch.nn as nn from utils.se3_torch import se3_transform_list _EPS = 1e-6
27.585366
112
0.625111
dd26b6dd687da7d2ec0ed40d629b6615e9538af8
501
py
Python
application/services/balance_service.py
singnet/token-balances-service
5e32b11bbad46e9df2820132026ab993935f8049
[ "MIT" ]
null
null
null
application/services/balance_service.py
singnet/token-balances-service
5e32b11bbad46e9df2820132026ab993935f8049
[ "MIT" ]
1
2021-04-07T14:40:02.000Z
2021-04-07T14:40:02.000Z
application/services/balance_service.py
singnet/token-balances-service
5e32b11bbad46e9df2820132026ab993935f8049
[ "MIT" ]
3
2021-04-07T14:12:00.000Z
2021-04-27T07:18:34.000Z
from infrastructure.repository.token_snapshot_repo import TokenSnapshotRepo from http import HTTPStatus
27.833333
75
0.718563
dd272efee44a376502bf4522d14dd1625b93c91b
5,015
py
Python
vaccine_allocation/TN_proj.py
COVID-IWG/epimargin-studies
7d4a78e2e6713c6a0aea2cd2440529153e9a635d
[ "MIT" ]
null
null
null
vaccine_allocation/TN_proj.py
COVID-IWG/epimargin-studies
7d4a78e2e6713c6a0aea2cd2440529153e9a635d
[ "MIT" ]
null
null
null
vaccine_allocation/TN_proj.py
COVID-IWG/epimargin-studies
7d4a78e2e6713c6a0aea2cd2440529153e9a635d
[ "MIT" ]
null
null
null
from typing import Callable, Tuple from epimargin.models import SIR import pandas as pd from epimargin.estimators import analytical_MPVS from epimargin.etl.covid19india import data_path, get_time_series, load_all_data import epimargin.plots as plt from epimargin.smoothing import notched_smoothing from epimargin.utils import cwd, weeks from studies.vaccine_allocation.commons import * from studies.vaccine_allocation.epi_simulations import * from tqdm import tqdm # model details CI = 0.95 smoothing = 7 root = cwd() data = root/"data" figs = root/"figs" data.mkdir(exist_ok=True) figs.mkdir(exist_ok=True) # define data versions for api files paths = { "v3": [data_path(i) for i in (1, 2)], "v4": [data_path(i) for i in range(3, 26)] } for target in paths['v3'] + paths['v4']: try: download_data(data, target) except: pass df = load_all_data( v3_paths = [data/filepath for filepath in paths['v3']], v4_paths = [data/filepath for filepath in paths['v4']] ) # cutoff = None # cutoff = "April 7, 2021" cutoff = "April 14, 2021" if cutoff: df = df[df.date_announced <= cutoff] data_recency = str(df["date_announced"].max()).split()[0] run_date = str(pd.Timestamp.now()).split()[0] ts = get_time_series( df[df.detected_state == "Tamil Nadu"], ["detected_state", "detected_district"] )\ .drop(columns = ["date", "time", "delta", "logdelta"])\ .rename(columns = { "Deceased": "dD", "Hospitalized": "dT", "Recovered": "dR" }).droplevel(0)\ .drop(labels = ["Other State", "Railway Quarantine", "Airport Quarantine"]) district_estimates = [] simulation_initial_conditions = pd.read_csv(data/f"all_india_coalesced_initial_conditions{simulation_start.strftime('%b%d')}.csv")\ .drop(columns = ["Unnamed: 0"])\ .set_index(["state", "district"])\ .loc["Tamil Nadu"] district_estimates = [] for district in tqdm(simulation_initial_conditions.index.get_level_values(0).unique()): simulation, Rt_estimates = setup(district) district_estimates.append(Rt_estimates.assign(district = district)) Rt_estimates.to_csv(data/f"TN_Rt_data_{district}_{data_recency}_run{run_date}.csv") projections = pd.DataFrame( np.array( [simulation(_).run(6 * weeks).dT for _ in range(1000)] )).astype(int).T\ .set_index(pd.date_range(start = data_recency, freq = "D", periods = 6*weeks + 1)) print(district, projections.mean(axis = 1)) projections.to_csv(data/f"TN_projections/projections_{district}_data{data_recency}_run{run_date}.csv")
34.586207
131
0.656032
dd27497c195aa372001cc5557855526c81484bc2
263
py
Python
nameyourapp/routes.py
WhereWeCanShare/minipy
485e9c4f122aa56ed8389d0ea7b5c16d59179aed
[ "BSD-3-Clause" ]
null
null
null
nameyourapp/routes.py
WhereWeCanShare/minipy
485e9c4f122aa56ed8389d0ea7b5c16d59179aed
[ "BSD-3-Clause" ]
null
null
null
nameyourapp/routes.py
WhereWeCanShare/minipy
485e9c4f122aa56ed8389d0ea7b5c16d59179aed
[ "BSD-3-Clause" ]
null
null
null
from flask import Blueprint main = Blueprint('main', __name__)
29.222222
161
0.714829
dd28575d99501b8ab89e76a54053a882db38d79c
1,514
py
Python
backend/db/test/id_allocator_test.py
xuantan/viewfinder
992209086d01be0ef6506f325cf89b84d374f969
[ "Apache-2.0" ]
645
2015-01-03T02:03:59.000Z
2021-12-03T08:43:16.000Z
backend/db/test/id_allocator_test.py
hoowang/viewfinder
9caf4e75faa8070d85f605c91d4cfb52c4674588
[ "Apache-2.0" ]
null
null
null
backend/db/test/id_allocator_test.py
hoowang/viewfinder
9caf4e75faa8070d85f605c91d4cfb52c4674588
[ "Apache-2.0" ]
222
2015-01-07T05:00:52.000Z
2021-12-06T09:54:26.000Z
# Copyright 2011 Viewfinder Inc. All Rights Reserved. """Tests for IdAllocator data object. """ __author__ = 'spencer@emailscrubbed.com (Spencer Kimball)' import unittest from viewfinder.backend.base import util from viewfinder.backend.base.testing import async_test from viewfinder.backend.db.id_allocator import IdAllocator from base_test import DBBaseTestCase
30.28
82
0.694188
dd2928863b82fbf5dba0596d90335b5ef6bbbb9b
2,429
py
Python
ayame/link.py
hattya/ayame
e8bb2b0ace79cd358b1384270cb9c5e809e12b5d
[ "MIT" ]
1
2022-03-05T03:21:13.000Z
2022-03-05T03:21:13.000Z
ayame/link.py
hattya/ayame
e8bb2b0ace79cd358b1384270cb9c5e809e12b5d
[ "MIT" ]
1
2021-08-25T13:41:34.000Z
2021-08-25T13:41:34.000Z
ayame/link.py
hattya/ayame
e8bb2b0ace79cd358b1384270cb9c5e809e12b5d
[ "MIT" ]
1
2018-03-04T21:47:27.000Z
2018-03-04T21:47:27.000Z
# # ayame.link # # Copyright (c) 2012-2021 Akinori Hattori <hattya@gmail.com> # # SPDX-License-Identifier: MIT # import urllib.parse from . import core, markup, uri, util from . import model as mm from .exception import ComponentError __all__ = ['Link', 'ActionLink', 'PageLink'] # HTML elements _A = markup.QName(markup.XHTML_NS, 'a') _LINK = markup.QName(markup.XHTML_NS, 'link') _AREA = markup.QName(markup.XHTML_NS, 'area') _SCRIPT = markup.QName(markup.XHTML_NS, 'script') _STYLE = markup.QName(markup.XHTML_NS, 'style') # HTML attributes _HREF = markup.QName(markup.XHTML_NS, 'href') _SRC = markup.QName(markup.XHTML_NS, 'src')
26.692308
91
0.611774
dd2b17b19b93b0baf9bf8e30437c71d115b7442f
885
py
Python
local/race_sim.py
tractiming/trac-gae
46c4a1fe409a45e8595210a5cf242425d40d4b41
[ "MIT" ]
3
2020-09-13T04:56:31.000Z
2021-05-26T11:46:08.000Z
local/race_sim.py
tractiming/trac-gae
46c4a1fe409a45e8595210a5cf242425d40d4b41
[ "MIT" ]
null
null
null
local/race_sim.py
tractiming/trac-gae
46c4a1fe409a45e8595210a5cf242425d40d4b41
[ "MIT" ]
1
2020-05-09T10:05:08.000Z
2020-05-09T10:05:08.000Z
import requests import datetime import time UPDATE_URL = "http://www.trac-us.appspot.com/api/updates/" #UPDATE_URL = "http://localhost:8000/api/updates/" if __name__ == "__main__": main()
20.113636
74
0.59661
dd2b8d0943d4247577bcc13dba218fa49f1ddda9
5,775
py
Python
classes.py
mattjoman/deep-RL-snake
c1b48ef3cb7ac0ad068887df1f60bc83a626f9d6
[ "MIT" ]
null
null
null
classes.py
mattjoman/deep-RL-snake
c1b48ef3cb7ac0ad068887df1f60bc83a626f9d6
[ "MIT" ]
null
null
null
classes.py
mattjoman/deep-RL-snake
c1b48ef3cb7ac0ad068887df1f60bc83a626f9d6
[ "MIT" ]
null
null
null
import pygame import numpy as np import random import torch from torch import nn from torch.nn import functional as F if __name__ == "__main__": ai = AI() state = np.random.rand(20, 20) ai.set_direction(state) print(ai.direction) print(ai.body[0]) ai.move() print(ai.body[0])
26.612903
86
0.546667
dd2f7e3c6dec1485c37b66c19a901c087ee62101
1,289
py
Python
examples/basic/turnOffLight_fb.py
quangthanh010290/EchoSkills
b90379cddb034a1e379fef77ca48c583bd6e47d5
[ "MIT" ]
null
null
null
examples/basic/turnOffLight_fb.py
quangthanh010290/EchoSkills
b90379cddb034a1e379fef77ca48c583bd6e47d5
[ "MIT" ]
null
null
null
examples/basic/turnOffLight_fb.py
quangthanh010290/EchoSkills
b90379cddb034a1e379fef77ca48c583bd6e47d5
[ "MIT" ]
null
null
null
import logging from random import randint from flask import Flask, render_template from flask_ask import Ask, statement, question, session from firebase import firebase import time firebase = firebase.FirebaseApplication('https://iotdev-6b58b.firebaseio.com', None) app = Flask(__name__) ask = Ask(app, "/") #logging.getLogger("flask_ask").setLevel(logging.DEBUG) def stop(): return statement("Stoped") if __name__ == '__main__': app.run(debug=False,host = '0.0.0.0', port=7000)
22.614035
84
0.703646
dd333037440197eebf8dccb7cbf70627b566e58c
763
py
Python
home_app/migrations/0003_auto_20200412_0206.py
Ymirrp/Home-page
6ac9b5b76cc2b08298086c7e784685dad802c9d6
[ "MIT" ]
null
null
null
home_app/migrations/0003_auto_20200412_0206.py
Ymirrp/Home-page
6ac9b5b76cc2b08298086c7e784685dad802c9d6
[ "MIT" ]
7
2020-04-18T04:54:05.000Z
2020-04-29T14:49:46.000Z
home_app/migrations/0003_auto_20200412_0206.py
Ymirrp/Home-page
6ac9b5b76cc2b08298086c7e784685dad802c9d6
[ "MIT" ]
null
null
null
# Generated by Django 3.0.5 on 2020-04-12 02:06 from django.db import migrations, models
33.173913
292
0.55308
dd341ee91f7a33f3e372a0311daf89a77f9a9148
349
py
Python
tests/test_license_screening.py
sthagen/python-scaling-tribble
2bb2e41185ae2b0108f341751d0e4a2187909683
[ "MIT" ]
null
null
null
tests/test_license_screening.py
sthagen/python-scaling-tribble
2bb2e41185ae2b0108f341751d0e4a2187909683
[ "MIT" ]
18
2021-02-14T15:17:17.000Z
2021-02-14T17:46:27.000Z
tests/test_license_screening.py
sthagen/python-scaling-tribble
2bb2e41185ae2b0108f341751d0e4a2187909683
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # pylint: disable=missing-docstring,unused-import,reimported import pytest # type: ignore import tests.context as ctx import license_screening.license_screening as lis
21.8125
60
0.744986
dd3452c9bed80f5adb210957aa5ef5db051c0f6c
301
py
Python
ml_progress/percent_metric.py
gregrolwes/ml_progress
e352f73847e163993ff9e642973512f070555805
[ "MIT" ]
null
null
null
ml_progress/percent_metric.py
gregrolwes/ml_progress
e352f73847e163993ff9e642973512f070555805
[ "MIT" ]
null
null
null
ml_progress/percent_metric.py
gregrolwes/ml_progress
e352f73847e163993ff9e642973512f070555805
[ "MIT" ]
null
null
null
import sys from .display import Display
27.363636
78
0.644518
dd34c031db159b934c285da9deacefad0961aecf
762
py
Python
src/server/alembic/versions/6b8cf99be000_add_user_journal_table.py
princessruthie/paws-data-pipeline
6f7095f99b9ad31b0171b256cf18849d63445c91
[ "MIT" ]
27
2019-11-20T20:20:30.000Z
2022-01-31T17:24:55.000Z
src/server/alembic/versions/6b8cf99be000_add_user_journal_table.py
mrcrnkovich/paws-data-pipeline
7c0bd4c5f23276f541611cb564f2f5abbb6b9887
[ "MIT" ]
348
2019-11-26T20:34:02.000Z
2022-02-27T20:28:20.000Z
src/server/alembic/versions/6b8cf99be000_add_user_journal_table.py
mrcrnkovich/paws-data-pipeline
7c0bd4c5f23276f541611cb564f2f5abbb6b9887
[ "MIT" ]
20
2019-12-03T23:50:33.000Z
2022-02-09T18:38:25.000Z
"""Add user journal table Revision ID: 6b8cf99be000 Revises: 36c4ecbfd11a Create Date: 2020-12-21 15:08:07.784568 """ from alembic import op import sqlalchemy as sa from sqlalchemy.sql import func # revision identifiers, used by Alembic. revision = "6b8cf99be000" down_revision = "36c4ecbfd11a" branch_labels = None depends_on = None
23.090909
83
0.692913
dd368cbbf1f2713371fc20b46be0df6fde83d872
1,906
py
Python
Python/WearherTelegram/weatherbot.py
OnCode-channel/OnCode
4aa7022932bc5aece39121233b34ebea12063717
[ "CC0-1.0" ]
3
2021-11-21T05:09:45.000Z
2021-11-21T09:55:02.000Z
Python/WearherTelegram/weatherbot.py
OnCode-channel/OnCode
4aa7022932bc5aece39121233b34ebea12063717
[ "CC0-1.0" ]
null
null
null
Python/WearherTelegram/weatherbot.py
OnCode-channel/OnCode
4aa7022932bc5aece39121233b34ebea12063717
[ "CC0-1.0" ]
1
2022-03-16T20:34:29.000Z
2022-03-16T20:34:29.000Z
import telebot from pyowm import OWM from pyowm.utils.config import get_default_config bot = telebot.TeleBot("telegram API-key") bot.polling(none_stop=True, interval=0)
32.862069
217
0.64638
dd37cbcc06fe382942dc56ae1ef81d1193794b23
17
py
Python
appium/version.py
zgq346712481/python-client
1c179d2c84c76bbed33e6333f381cc8a86f3bb82
[ "Apache-2.0" ]
1
2019-03-07T00:53:43.000Z
2019-03-07T00:53:43.000Z
appium/version.py
zgq346712481/python-client
1c179d2c84c76bbed33e6333f381cc8a86f3bb82
[ "Apache-2.0" ]
null
null
null
appium/version.py
zgq346712481/python-client
1c179d2c84c76bbed33e6333f381cc8a86f3bb82
[ "Apache-2.0" ]
null
null
null
version = '0.38'
8.5
16
0.588235
dd3bf5910219efb966cd48792f7c68202d3a54a8
130
py
Python
earth_enterprise/src/server/wsgi/serve/push/stream/__init__.py
ezeeyahoo/earthenterprise
b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9
[ "Apache-2.0" ]
2,661
2017-03-20T22:12:50.000Z
2022-03-30T09:43:19.000Z
earth_enterprise/src/server/wsgi/serve/push/stream/__init__.py
ezeeyahoo/earthenterprise
b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9
[ "Apache-2.0" ]
1,531
2017-03-24T17:20:32.000Z
2022-03-16T18:11:14.000Z
earth_enterprise/src/server/wsgi/serve/push/stream/__init__.py
ezeeyahoo/earthenterprise
b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9
[ "Apache-2.0" ]
990
2017-03-24T11:54:28.000Z
2022-03-22T11:51:47.000Z
"""The package indicator for serve.push.stream. Modules for transferring and registering servable stream data on the server. """
26
76
0.784615
dd3c2fd0cab5262a11100e98979113701b2c65bd
2,828
py
Python
Projects_Django/MyPets/tienda_mascotas/models.py
JuanCasanovaQ/Frameworks_8A
353838473b275d366cac8364ef4df72578c0aed8
[ "Apache-2.0" ]
null
null
null
Projects_Django/MyPets/tienda_mascotas/models.py
JuanCasanovaQ/Frameworks_8A
353838473b275d366cac8364ef4df72578c0aed8
[ "Apache-2.0" ]
null
null
null
Projects_Django/MyPets/tienda_mascotas/models.py
JuanCasanovaQ/Frameworks_8A
353838473b275d366cac8364ef4df72578c0aed8
[ "Apache-2.0" ]
null
null
null
from django.db import models from django.db.models.fields.related import ForeignKey # Create your models here.
32.883721
54
0.724187
dd3c339456c728831d00962485678bd366a32bd9
34
py
Python
homeassistant/components/limitlessled/__init__.py
domwillcode/home-assistant
f170c80bea70c939c098b5c88320a1c789858958
[ "Apache-2.0" ]
30,023
2016-04-13T10:17:53.000Z
2020-03-02T12:56:31.000Z
homeassistant/components/limitlessled/__init__.py
jagadeeshvenkatesh/core
1bd982668449815fee2105478569f8e4b5670add
[ "Apache-2.0" ]
31,101
2020-03-02T13:00:16.000Z
2022-03-31T23:57:36.000Z
homeassistant/components/limitlessled/__init__.py
jagadeeshvenkatesh/core
1bd982668449815fee2105478569f8e4b5670add
[ "Apache-2.0" ]
11,956
2016-04-13T18:42:31.000Z
2020-03-02T09:32:12.000Z
"""The limitlessled component."""
17
33
0.705882
dd3c5ef2c1c57128342b4cbe674344dc894fe7e9
14,427
py
Python
projectroles/app_settings.py
olgabot/sodar_core
2a012c962c763fe970261839226e848d752d14d5
[ "MIT" ]
null
null
null
projectroles/app_settings.py
olgabot/sodar_core
2a012c962c763fe970261839226e848d752d14d5
[ "MIT" ]
null
null
null
projectroles/app_settings.py
olgabot/sodar_core
2a012c962c763fe970261839226e848d752d14d5
[ "MIT" ]
null
null
null
"""Project and user settings API""" import json from projectroles.models import AppSetting, APP_SETTING_TYPES, SODAR_CONSTANTS from projectroles.plugins import get_app_plugin, get_active_plugins # SODAR constants APP_SETTING_SCOPE_PROJECT = SODAR_CONSTANTS['APP_SETTING_SCOPE_PROJECT'] APP_SETTING_SCOPE_USER = SODAR_CONSTANTS['APP_SETTING_SCOPE_USER'] APP_SETTING_SCOPE_PROJECT_USER = SODAR_CONSTANTS[ 'APP_SETTING_SCOPE_PROJECT_USER' ] # Local constants VALID_SCOPES = [ APP_SETTING_SCOPE_PROJECT, APP_SETTING_SCOPE_USER, APP_SETTING_SCOPE_PROJECT_USER, ]
32.938356
80
0.561932
dd3d84abfc37890e97980406a58c52b188bedbc3
2,835
py
Python
util/2mass_catalog.py
spake/astrometry.net
12c76f4a44fe90a009eeb962f2ae28b0791829b8
[ "BSD-3-Clause" ]
4
2018-02-13T23:11:40.000Z
2021-09-30T16:02:22.000Z
util/2mass_catalog.py
spake/astrometry.net
12c76f4a44fe90a009eeb962f2ae28b0791829b8
[ "BSD-3-Clause" ]
null
null
null
util/2mass_catalog.py
spake/astrometry.net
12c76f4a44fe90a009eeb962f2ae28b0791829b8
[ "BSD-3-Clause" ]
1
2019-02-11T06:56:30.000Z
2019-02-11T06:56:30.000Z
#! /usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE from __future__ import print_function import sys from optparse import OptionParser try: import pyfits except ImportError: try: from astropy.io import fits as pyfits except ImportError: raise ImportError("Cannot import either pyfits or astropy.io.fits") from numpy import * from astrometry.util.fits import * from astrometry.util.healpix import * from astrometry.util.starutil_numpy import * if __name__ == '__main__': parser = OptionParser(usage='%prog [options] <ra> <dec> <output-filename>') parser.add_option('-r', dest='radius', type='float', help='Search radius, in deg (default 1 deg)') parser.add_option('-b', dest='basefn', help='Base filename of 2MASS FITS files (default: 2mass_hp%03i.fits)') parser.add_option('-B', dest='band', help='Band (J, H, or K) to use for cuts') parser.set_defaults(radius=1.0, basefn=None, band='J') (opt, args) = parser.parse_args() if len(args) != 3: parser.print_help() print() print('Got extra arguments:', args) sys.exit(-1) # parse RA,Dec. ra = float(args[0]) dec = float(args[1]) outfn = args[2] band = opt.band.lower() # ugh! opts = {} for k in ['radius', 'basefn']: opts[k] = getattr(opt, k) X = get_2mass_sources(ra, dec, **opts) print('Got %i 2MASS sources.' % len(X)) #print X.about() print('Applying cuts...') I = logical_not(X.minor_planet) print('not minor planet:', sum(I)) qual = X.get(band + '_quality') # work around dumb bug where it's a single-char column rather than a byte. nobrightness = chr(0) I = logical_and(I, (qual != nobrightness)) print('not NO_BRIGHTNESS', sum(I)) print(len(X)) print(len(X.j_cc)) cc = array(X.getcolumn(band + '_cc')) ccnone = chr(0) #print 'cc shape', cc.shape #print cc[:10] #print ccnone I = logical_and(I, (cc == ccnone)) print('CC_NONE', sum(I)) X = X[I] print('%i pass cuts' % len(X)) print('Writing to', outfn) X.write_to(outfn)
28.35
113
0.610229
dd3f4f79ce1d8a927e706c3ca5d870ec9910cd7c
682
py
Python
models/nicknames.py
Tyson-Chicken-Nuggets/me-discord-leaderboard
d0e04c77e4f7a309cbb6315d24bd47929ba4ec54
[ "MIT" ]
4
2018-12-13T04:15:26.000Z
2021-02-15T21:46:59.000Z
models/nicknames.py
Tyson-Chicken-Nuggets/me-discord-leaderboard
d0e04c77e4f7a309cbb6315d24bd47929ba4ec54
[ "MIT" ]
2
2019-05-17T18:47:18.000Z
2020-09-26T01:31:39.000Z
models/nicknames.py
Tyson-Chicken-Nuggets/me-discord-leaderboard
d0e04c77e4f7a309cbb6315d24bd47929ba4ec54
[ "MIT" ]
1
2018-06-08T17:08:29.000Z
2018-06-08T17:08:29.000Z
from sqlalchemy import Column, String, Integer, ForeignKey from sqlalchemy.orm import relationship from models.base import Base from models.servers import Server from models.users import User
31
73
0.727273
dd3fd65b348e0bcff47a6b9cda24ca0e585cfa0c
6,749
py
Python
pirates/leveleditor/worldData/tortuga_building_int_10.py
itsyaboyrocket/pirates
6ca1e7d571c670b0d976f65e608235707b5737e3
[ "BSD-3-Clause" ]
3
2021-02-25T06:38:13.000Z
2022-03-22T07:00:15.000Z
pirates/leveleditor/worldData/tortuga_building_int_10.py
itsyaboyrocket/pirates
6ca1e7d571c670b0d976f65e608235707b5737e3
[ "BSD-3-Clause" ]
null
null
null
pirates/leveleditor/worldData/tortuga_building_int_10.py
itsyaboyrocket/pirates
6ca1e7d571c670b0d976f65e608235707b5737e3
[ "BSD-3-Clause" ]
1
2021-02-25T06:38:17.000Z
2021-02-25T06:38:17.000Z
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.leveleditor.worldData.tortuga_building_int_10 from pandac.PandaModules import Point3, VBase3, Vec4, Vec3 objectStruct = {'AmbientColors': {}, 'DirectionalColors': {}, 'FogColors': {}, 'FogRanges': {}, 'Objects': {'1156279496.29dzlu0': {'Type': 'Building Interior', 'Name': '', 'AdditionalData': ['interior_shanty_store_tattoo'], 'Instanced': True, 'Objects': {'1169067906.19mike': {'Type': 'Townsperson', 'Category': 'Commoner', 'AnimSet': 'tatoo', 'CustomModel': 'None', 'GhostColor': 'None', 'GhostFX': 0, 'Greeting Animation': '', 'Hpr': VBase3(-102.509, 1.642, 0.0), 'Level': '37', 'Notice Animation 1': '', 'Notice Animation 2': '', 'Patrol Radius': '12.0000', 'Pos': Point3(6.941, -8.134, -0.178), 'PoseAnim': '', 'PoseFrame': '', 'Private Status': 'All', 'PropLeft': 'None', 'PropRight': 'None', 'Respawns': True, 'Scale': VBase3(1.0, 1.0, 1.0), 'ShopID': 'PORT_ROYAL_DEFAULTS', 'Start State': 'Idle', 'StartFrame': '0', 'Team': 'Villager', 'TrailFX': 'None', 'TrailLeft': 'None', 'TrailRight': 'None'}, '1179360000.0dchiappe': {'Type': 'Furniture', 'DisableCollision': False, 'Holiday': '', 'Hpr': VBase3(19.675, 0.0, 0.0), 'Pos': Point3(7.057, -8.171, 0.0), 'Scale': VBase3(1.023, 1.023, 1.023), 'VisSize': '', 'Visual': {'Model': 'models/props/stool_shanty'}}, '1179360000.0dchiappe0': {'Type': 'Furniture', 'DisableCollision': False, 'Holiday': '', 'Hpr': VBase3(-29.781, 0.0, 0.0), 'Objects': {}, 'Pos': Point3(7.771, -4.618, -0.007), 'Scale': VBase3(0.965, 0.965, 0.965), 'VisSize': '', 'Visual': {'Model': 'models/props/stool_shanty'}}, '1179360256.0dchiappe': {'Type': 'Townsperson', 'Category': 'Commoner', 'AnimSet': 'tatoo_receive', 'CustomModel': 'None', 'GhostColor': 'None', 'GhostFX': 0, 'Greeting Animation': '', 'HelpID': 'NONE', 'Holiday': '', 'Hpr': VBase3(-125.548, -4.22, -0.497), 'Level': '37', 'Notice Animation 1': '', 'Notice Animation 2': '', 'Patrol Radius': '12.0000', 'Pos': Point3(7.165, -4.221, 0.093), 'PoseAnim': '', 'PoseFrame': '', 'Private Status': 'All', 'PropLeft': 'None', 'PropRight': 'None', 'Respawns': True, 'Scale': VBase3(1.0, 1.0, 1.0), 'ShopID': 'PORT_ROYAL_DEFAULTS', 'Start State': 'Idle', 'StartFrame': '0', 'Team': 'Villager', 'TrailFX': 'None', 'TrailLeft': 'None', 'TrailRight': 'None', 'VisSize': ''}, '1201025152.0dxschafe': {'Type': 'Door Locator Node', 'Name': 'door_locator', 'Hpr': VBase3(-180.0, 0.0, 0.0), 'Pos': Point3(0.044, -4.421, 5.0), 'Scale': VBase3(1.0, 1.0, 1.0)}, '1201025280.0dxschafe': {'Type': 'Townsperson', 'Category': 'Tattoo', 'AnimSet': 'primp', 'CustomModel': 'None', 'GhostColor': 'None', 'GhostFX': 0, 'Greeting Animation': '', 'Hpr': VBase3(-163.551, 0.0, 0.0), 'Level': '37', 'Notice Animation 1': '', 'Notice Animation 2': '', 'Patrol Radius': '1.0000', 'Pos': Point3(16.835, 12.638, 0.0), 'PoseAnim': '', 'PoseFrame': '', 'Private Status': 'All', 'PropLeft': 'None', 'PropRight': 'None', 'Respawns': True, 'Scale': VBase3(1.0, 1.0, 1.0), 'ShopID': 'TORTUGA_DEFAULTS', 'Start State': 'Idle', 'StartFrame': '0', 'Team': 'Villager', 'TrailFX': 'None', 'TrailLeft': 'None', 'TrailRight': 'None'}, '1201122985.55dxschafe': {'Type': 'Light - Dynamic', 'Attenuation': '0.005', 'ConeAngle': '15.0000', 'DropOff': '45.5422', 'FlickRate': '0.5000', 'Flickering': False, 'Hpr': VBase3(170.832, -20.397, 4.921), 'Intensity': '1.0602', 'LightType': 'SPOT', 'Pos': Point3(19.411, 22.344, 13.063), 'Scale': VBase3(1.0, 1.0, 1.0), 'Visual': {'Color': (1, 1, 1, 1), 'Model': 'models/props/light_tool_bulb'}}, '1201124068.83dxschafe': {'Type': 'Light - Dynamic', 'Attenuation': '0.005', 'ConeAngle': '60.0000', 'DropOff': '29.8193', 'FlickRate': '0.5000', 'Flickering': False, 'Hpr': VBase3(-119.397, -38.379, 0.0), 'Intensity': '0.9639', 'LightType': 'SPOT', 'Pos': Point3(1.086, 14.825, 18.821), 'Scale': VBase3(1.0, 1.0, 1.0), 'Visual': {'Color': (1, 1, 1, 1), 'Model': 'models/props/light_tool_bulb'}}}, 'Visual': {'Model': 'models/buildings/interior_shanty_store'}}}, 'Node Links': [], 'Layers': {'Collisions': ['1184008208.59kmuller', '1184016064.62kmuller', '1184013852.84kmuller', '1185822696.06kmuller', '1184006140.32kmuller', '1184002350.98kmuller', '1184007573.29kmuller', '1184021176.59kmuller', '1184005963.59kmuller', '1188324241.31akelts', '1184006537.34kmuller', '1184006605.81kmuller', '1187139568.33kmuller', '1188324186.98akelts', '1184006730.66kmuller', '1184007538.51kmuller', '1184006188.41kmuller', '1184021084.27kmuller', '1185824396.94kmuller', '1185824250.16kmuller', '1185823630.52kmuller', '1185823760.23kmuller', '1185824497.83kmuller', '1185824751.45kmuller', '1187739103.34akelts', '1188323993.34akelts', '1184016538.29kmuller', '1185822200.97kmuller', '1184016225.99kmuller', '1195241421.34akelts', '1195242796.08akelts', '1184020642.13kmuller', '1195237994.63akelts', '1184020756.88kmuller', '1184020833.4kmuller', '1185820992.97kmuller', '1185821053.83kmuller', '1184015068.54kmuller', '1184014935.82kmuller', '1185821432.88kmuller', '1185821701.86kmuller', '1195240137.55akelts', '1195241539.38akelts', '1195238422.3akelts', '1195238473.22akelts', '1185821453.17kmuller', '1184021269.96kmuller', '1185821310.89kmuller', '1185821165.59kmuller', '1185821199.36kmuller', '1185822035.98kmuller', '1184015806.59kmuller', '1185822059.48kmuller', '1185920461.76kmuller', '1194984449.66akelts', '1185824206.22kmuller', '1184003446.23kmuller', '1184003254.85kmuller', '1184003218.74kmuller', '1184002700.44kmuller', '1186705073.11kmuller', '1187658531.86akelts', '1186705214.3kmuller', '1185824927.28kmuller', '1184014204.54kmuller', '1184014152.84kmuller']}, 'ObjectIds': {'1156279496.29dzlu0': '["Objects"]["1156279496.29dzlu0"]', '1169067906.19mike': '["Objects"]["1156279496.29dzlu0"]["Objects"]["1169067906.19mike"]', '1179360000.0dchiappe': '["Objects"]["1156279496.29dzlu0"]["Objects"]["1179360000.0dchiappe"]', '1179360000.0dchiappe0': '["Objects"]["1156279496.29dzlu0"]["Objects"]["1179360000.0dchiappe0"]', '1179360256.0dchiappe': '["Objects"]["1156279496.29dzlu0"]["Objects"]["1179360256.0dchiappe"]', '1201025152.0dxschafe': '["Objects"]["1156279496.29dzlu0"]["Objects"]["1201025152.0dxschafe"]', '1201025280.0dxschafe': '["Objects"]["1156279496.29dzlu0"]["Objects"]["1201025280.0dxschafe"]', '1201122985.55dxschafe': '["Objects"]["1156279496.29dzlu0"]["Objects"]["1201122985.55dxschafe"]', '1201124068.83dxschafe': '["Objects"]["1156279496.29dzlu0"]["Objects"]["1201124068.83dxschafe"]'}} extraInfo = {'camPos': Point3(295.478, -101.859, 7.30613), 'camHpr': VBase3(66.8195, -6.16144, 0), 'focalLength': 1.39999997616, 'skyState': 2, 'fog': 0}
964.142857
6,298
0.676397
dd409f1079701595dd303cbae441bb3663ea68de
755
py
Python
hgtools/managers/library.py
jaraco/hgtools
1090d139e5dbdab864da8f1917a9e674331b6f9b
[ "MIT" ]
1
2017-05-17T15:12:29.000Z
2017-05-17T15:12:29.000Z
hgtools/managers/library.py
jaraco/hgtools
1090d139e5dbdab864da8f1917a9e674331b6f9b
[ "MIT" ]
12
2016-01-01T14:43:44.000Z
2021-10-03T02:13:19.000Z
hgtools/managers/library.py
jaraco/hgtools
1090d139e5dbdab864da8f1917a9e674331b6f9b
[ "MIT" ]
null
null
null
import sys from . import base from . import cmd from . import reentry
30.2
69
0.637086
dd40a6f098a3b0e41331e54d98f742cb251a3af3
1,882
py
Python
app/core/tests/test_models.py
royandri/attendance
cecb7a91b5e048569299ae6dfb796c20051a16a9
[ "MIT" ]
null
null
null
app/core/tests/test_models.py
royandri/attendance
cecb7a91b5e048569299ae6dfb796c20051a16a9
[ "MIT" ]
null
null
null
app/core/tests/test_models.py
royandri/attendance
cecb7a91b5e048569299ae6dfb796c20051a16a9
[ "MIT" ]
null
null
null
from django.test import TestCase from django.contrib.auth import get_user_model from core import models from django.utils import timezone
33.607143
76
0.667906
dd41e5e1e67e9d900eb2ff0bece445448ea41207
1,775
py
Python
controllers/__controller.py
VNCompany/vnforum
770aca3a94ad1ed54628d48867c299d83215f75a
[ "Unlicense" ]
null
null
null
controllers/__controller.py
VNCompany/vnforum
770aca3a94ad1ed54628d48867c299d83215f75a
[ "Unlicense" ]
null
null
null
controllers/__controller.py
VNCompany/vnforum
770aca3a94ad1ed54628d48867c299d83215f75a
[ "Unlicense" ]
null
null
null
from flask import redirect, url_for, render_template from flask_login import current_user from components.pagination import html_pagination from db_session import create_session
34.803922
119
0.580845
dd43d5641662aeed07a7ef83b6967c23588c8ac3
371
py
Python
practice/algos/quick_sort/quick_sort.py
markfranciose/cheat_sheet_of_cheat_sheets
d126bbbb499af43098d3938e35df3381833cecac
[ "MIT" ]
null
null
null
practice/algos/quick_sort/quick_sort.py
markfranciose/cheat_sheet_of_cheat_sheets
d126bbbb499af43098d3938e35df3381833cecac
[ "MIT" ]
20
2020-07-21T01:52:53.000Z
2022-02-27T09:44:44.000Z
practice/algos/quick_sort/quick_sort.py
markfranciose/drops_of_knowledge
d126bbbb499af43098d3938e35df3381833cecac
[ "MIT" ]
null
null
null
arr = [1,2,2,1,2,1,5,23,1,91,2,4,1,] print(quick_sort(arr))
18.55
58
0.490566
dd442063bf90797178fddb15d68e9d7b4d342147
157
py
Python
Python/texttospeech.py
Rohit01-pro/All_Program_helper
86b75ecc4ecb095f11e46e6f80c660e27dd22f27
[ "MIT" ]
16
2021-10-03T11:15:49.000Z
2021-10-31T04:40:24.000Z
Python/texttospeech.py
Rohit01-pro/All_Program_helper
86b75ecc4ecb095f11e46e6f80c660e27dd22f27
[ "MIT" ]
232
2021-10-02T14:51:43.000Z
2021-11-14T08:23:27.000Z
Python/texttospeech.py
Rohit01-pro/All_Program_helper
86b75ecc4ecb095f11e46e6f80c660e27dd22f27
[ "MIT" ]
166
2021-10-02T13:56:34.000Z
2021-10-31T17:56:34.000Z
from gtts import gTTS import os f=open("1.txt") x=f.read() language='en' audio=gTTS(text=x,lang=language,slow=False) audio.save("1.wav") os.system("1.wav")
15.7
43
0.707006
dd464fa4b37cf124b28327d6a98fc0f0c806f33d
101
py
Python
code/pyFoamSymlinkToFile.py
sosohungry/pyfoam
b19e40a0ef1f41268930122226660414722178e6
[ "MIT" ]
null
null
null
code/pyFoamSymlinkToFile.py
sosohungry/pyfoam
b19e40a0ef1f41268930122226660414722178e6
[ "MIT" ]
null
null
null
code/pyFoamSymlinkToFile.py
sosohungry/pyfoam
b19e40a0ef1f41268930122226660414722178e6
[ "MIT" ]
null
null
null
#! /usr/bin/env python from PyFoam.Applications.SymlinkToFile import SymlinkToFile SymlinkToFile()
16.833333
59
0.811881
dd468535a193a7786f5ac49b546150a18ebcd261
1,172
py
Python
setup.py
themightyoarfish/svcca
23faa374489067c1c76cee44d92663c120603bdc
[ "Apache-2.0" ]
8
2019-01-17T14:20:07.000Z
2021-07-08T12:16:23.000Z
setup.py
themightyoarfish/svcca
23faa374489067c1c76cee44d92663c120603bdc
[ "Apache-2.0" ]
1
2019-01-30T11:44:25.000Z
2019-02-07T15:02:02.000Z
setup.py
themightyoarfish/svcca-gpu
23faa374489067c1c76cee44d92663c120603bdc
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python from distutils.core import setup import setuptools import os root_dir = os.path.abspath(os.path.dirname(__file__)) with open(f'{root_dir}/README.md') as f: readme = f.read() with open(f'{root_dir}/requirements.txt') as f: requirements = f.read().split() packages = setuptools.find_packages('.', include='svcca.*') setup(name='svcca', version='0.0.1', description='SVCCA on Numpy, Cupy, and PyTorch', long_description=readme, author='Rasmus Diederichsen', author_email='rasmus@peltarion.com', url='https://github.com/themightyoarfish/svcca-gpu', classifiers=['Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Visualization', 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: Apache License', 'Intended Audience :: Developers', ], keywords='deep-learning pytorch cupy numpy svcca neural-networks machine-learning'.split(), install_requires=requirements, packages=packages, zip_safe=False, # don't install egg, but source )
33.485714
97
0.636519
dd470b99c72201568c8abe1bba1e9f7add60848f
1,679
py
Python
classmark/ui/home_section.py
mdocekal/ClassMark
e6019f9abeb99e9a6b72365a508d5a6dac13c3c7
[ "Unlicense" ]
null
null
null
classmark/ui/home_section.py
mdocekal/ClassMark
e6019f9abeb99e9a6b72365a508d5a6dac13c3c7
[ "Unlicense" ]
2
2021-01-18T12:29:18.000Z
2021-01-18T14:33:31.000Z
classmark/ui/home_section.py
windionleaf/ClassMark
e6019f9abeb99e9a6b72365a508d5a6dac13c3c7
[ "Unlicense" ]
null
null
null
""" Created on 19. 12. 2018 Module for home section of the application. :author: Martin Doekal :contact: xdocek09@stud.fit.vubtr.cz """ from .widget_manager import WidgetManager from .section_router import SectionRouter from functools import partial from .models import ListLastExperiments from PySide2.QtCore import Qt
29.45614
96
0.661108
dd4835795e462053f9d98a0abafa853d67dd9bfc
829
py
Python
urls.py
CodeForPhilly/philly_legislative
5774100325b5374a0510674b4a542171fff3fcd3
[ "BSD-Source-Code" ]
2
2017-08-29T22:27:05.000Z
2019-04-27T20:21:31.000Z
urls.py
CodeForPhilly/philly_legislative
5774100325b5374a0510674b4a542171fff3fcd3
[ "BSD-Source-Code" ]
null
null
null
urls.py
CodeForPhilly/philly_legislative
5774100325b5374a0510674b4a542171fff3fcd3
[ "BSD-Source-Code" ]
null
null
null
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: #(r'^philly_legislative/', include('philly_legislative.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^admin/(.*)', admin.site.root), (r'^subs/$', 'phillyleg.views.index'), (r'^subs/create/$', 'phillyleg.views.create'), (r'^subs/unsubscribe/$', 'phillyleg.views.unsubscribe'), #(r'^subs/(?P<subscription_id>\d+)/$', 'phillyleg.views.edit'), (r'^subs/delete/$', 'phillyleg.views.delete') )
33.16
76
0.671894
dd486d1d0f1328a725ad7af4079cf4b9fc30ab88
2,510
py
Python
irf/scripts/read_corsika_headers.py
fact-project/irf
d82a3d4ae8b9ef15d9f473cdcd01a5f9c92d42a2
[ "MIT" ]
null
null
null
irf/scripts/read_corsika_headers.py
fact-project/irf
d82a3d4ae8b9ef15d9f473cdcd01a5f9c92d42a2
[ "MIT" ]
8
2017-04-25T11:19:32.000Z
2019-05-28T07:24:32.000Z
irf/scripts/read_corsika_headers.py
fact-project/irf
d82a3d4ae8b9ef15d9f473cdcd01a5f9c92d42a2
[ "MIT" ]
null
null
null
from corsikaio import CorsikaFile from fact.io import to_h5py from multiprocessing import Pool, cpu_count from tqdm import tqdm import os import click import pandas as pd import numpy as np from glob import glob event_columns = [ 'run_number', 'event_number', 'particle_id', 'total_energy', 'starting_altitude', 'first_target_id', 'first_interaction_height', 'momentum_x', 'momentum_y', 'momentum_minus_z', 'zenith', 'azimuth', ] run_header_columns = [ 'run_number', 'date', 'energy_spectrum_slope', 'energy_min', 'energy_max', ] if __name__ == '__main__': main()
25.1
89
0.632669
dd489e1ae7bc915c79a5ee9217ee84f8b92fa142
3,101
py
Python
tests/test_maker.py
chfsx/pibooth
4049fb748853ff90e53212336ff7d71bba6c1328
[ "MIT" ]
null
null
null
tests/test_maker.py
chfsx/pibooth
4049fb748853ff90e53212336ff7d71bba6c1328
[ "MIT" ]
null
null
null
tests/test_maker.py
chfsx/pibooth
4049fb748853ff90e53212336ff7d71bba6c1328
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import pytest from pibooth.pictures.factory import PilPictureFactory, OpenCvPictureFactory footer_texts = ('This is the main title', 'Footer text 2', 'Footer text 3') footer_fonts = ('Amatic-Bold', 'DancingScript-Regular', 'Roboto-LightItalic') footer_colors = ((10, 0, 0), (0, 50, 0), (0, 50, 50)) def test_save_pil_overlay(captures_landscape, fond, overlay): factory = PilPictureFactory(3600, 2400, *captures_landscape) setup_factory(factory, fond, overlay) factory.save("PIL-overlay-4.jpg") def test_save_cv2_overlay(captures_landscape, fond, overlay): factory = OpenCvPictureFactory(3600, 2400, *captures_landscape) setup_factory(factory, fond, overlay) factory.save("OpenCV-overlay-4.jpg")
37.817073
82
0.751048
dd491d9bbf97708bde610843ff7316857a2a3334
6,452
py
Python
assignment 1/question3/q3.py
Eunoia1729/soft-computing
d7fc155378d1bb0b914a6f660095653e32d2c0b8
[ "Apache-2.0" ]
1
2021-11-14T15:02:35.000Z
2021-11-14T15:02:35.000Z
assignment 1/question3/q3.py
Eunoia1729/soft-computing
d7fc155378d1bb0b914a6f660095653e32d2c0b8
[ "Apache-2.0" ]
null
null
null
assignment 1/question3/q3.py
Eunoia1729/soft-computing
d7fc155378d1bb0b914a6f660095653e32d2c0b8
[ "Apache-2.0" ]
null
null
null
"""## Question 3: Scrap Hotel Data The below code is for India and can be extended to other countries by adding an outer loop given in the last part. The below codes takes several minutes to run. """ import requests import pandas as pd from bs4 import BeautifulSoup hotelname_list = [] city_list = [] countries_list = [] rating_list = [] prince_list = [] Amenities_list = [] HotelDescription_list = [] Review1_list = [] Review2_list = [] hotel_name = "" city_name = "" country_name = "" ratingl = "" pricel = "" amenities = "" descriptionl = "" review1l = "" review2l = "" url = 'https://www.goibibo.com/destinations/all-states-in-india/' data = requests.get(url) html = data.text soup = BeautifulSoup(html, 'html.parser') cards = soup.find_all('div', {'class' : 'col-md-4 col-sm-4 col-xs-12 filtr-item posrel'}) state_urls = [] state_names = [] for card in cards : for a in card.find_all('a', href=True): if a.text.rstrip(): state_urls.append(a['href']) state_names.append(a.text.rstrip()) length = len(state_urls) for i in range(length): url = state_urls[i] country_name = 'India' data = requests.get(url) html = data.text soup = BeautifulSoup(html, 'html.parser') places_to_visit = soup.find('div', {'class' : 'place-to-visit-container'}) if(places_to_visit): card = places_to_visit.find('div', {'class' : 'col-md-12'}) city_urls = {} for a in card.find_all('a', href=True): if a['href']: list = a['href'].split('/') city_urls[list[4]] = 'https://www.goibibo.com/hotels/hotels-in-' + list[4] + '-ct/' for city in city_urls: print(f'Extracting for city : {city}') city_name = city url = city_urls[city] response = requests.get(url) data = BeautifulSoup(response.text, 'html.parser') cards_price_data = data.find_all('p', attrs={'class', 'HotelCardstyles__CurrentPrice-sc-1s80tyk-27 czKsrL'}) cards_url_data = data.find_all('div', attrs={'class', 'HotelCardstyles__HotelNameWrapperDiv-sc-1s80tyk-11 hiiHjq'}) hotel_price = {} hotel_url = {} for i in range(0, len(cards_price_data)): hotel_price[cards_url_data[i].text.rstrip()] = cards_price_data[i].text.rstrip() hotel_url[cards_url_data[i].text.rstrip()] = 'https://www.goibibo.com' + cards_url_data[i].find('a', href = True)['href'] for i in range(0, len(cards_price_data)): url = hotel_url[cards_url_data[i].text.rstrip()] data = requests.get(url) html = data.text hotel_name = cards_url_data[i].text.rstrip() pricel = hotel_price[cards_url_data[i].text.rstrip()] # print('Extracting for hotel : ' + cards_url_data[i].text.rstrip()) soup = BeautifulSoup(html, 'html.parser') div = soup.find('div', { 'id': 'root' }) description = div.find('section', {'class' : 'HotelDetailsMain__HotelDetailsContainer-sc-2p7gdu-0 kpmitu'}) descriptiont = description.find('span', {'itemprop' : 'streetAddress'}) if descriptiont: address = descriptiont.text.rstrip().replace(' View on Map', '') descriptionl = address rating = 'Rating not found' ratingdata = description.find('span', {'itemprop' : 'ratingValue'}) #contains rating if ratingdata: rating = ratingdata.text.rstrip() ratingl = rating review1 = 'Review not found' review2 = 'Review not found' reviews = div.find_all('span', {'class' : 'UserReviewstyles__UserReviewTextStyle-sc-1y05l7z-4 dTkBBw'}) if(len(reviews) > 1): review1 = reviews[0].text.rstrip() if(len(reviews) > 3): review2 = reviews[3].text.rstrip() review1l = review1 review2l = review2 amenities_list = [] #contains all the amenities. amenitiesdiv = div.find('div', {'class' : 'Amenitiesstyles__AmenitiesListBlock-sc-10opy4a-4 cMbIgg'}) if amenitiesdiv: for amenity in amenitiesdiv.find_all('span', {'class':'Amenitiesstyles__AmenityItemText-sc-10opy4a-8 iwRmcg'}) : if amenity: amenities_list.append(amenity.text.rstrip()) else: amenities_list.append('Amenity Not Found') amenities = amenities_list hotelname_list.append(hotel_name) city_list.append(city_name) countries_list.append(country_name) rating_list.append(ratingl) prince_list.append(pricel) Amenities_list.append(amenities) HotelDescription_list.append(descriptionl) Review1_list.append(review1l) Review2_list.append(review2l) print(f'Extracted {len(cards_price_data)} hotels at {city} successfully') dict = {'Hotel_Name': hotelname_list, 'City_Name': city_list, 'country_name': countries_list, 'Rating' : rating_list, 'Price/Night' : prince_list, 'Amenities' : Amenities_list, 'Description' : HotelDescription_list, 'Review1' : Review1_list, 'Review2' : Review2_list} df = pd.DataFrame(dict) df.to_csv('hotels.csv') """To extract for all the countries, we need to use the below code in the outer loop""" hotelname_list = [] city_list = [] countries_list = [] rating_list = [] prince_list = [] Amenities_list = [] HotelDescription_list = [] Review1_list = [] Review2_list = [] hotel_name = "" city_name = "" country_name = "" ratingl = "" pricel = "" amenities = "" descriptionl = "" review1l = "" review2l = "" url = 'https://www.goibibo.com/destinations/intl/all-countries/' data = requests.get(url) html = data.text soup = BeautifulSoup(html, 'html.parser') cards = soup.find_all('div', {'class' : 'col-md-4 col-sm-4 col-xs-12 filtr-item posrel'}) country_urls = [] country_names = [] for card in cards : for a in card.find_all('a', href=True): if a['href']: country_urls.append(a['href']) country_names.append(a.text.rstrip()) length = len(country_urls) for i in range(length): url = country_urls[i] country_name = country_names[i] data = requests.get(url) html = data.text soup = BeautifulSoup(html, 'html.parser') places_to_visit = soup.find('div', {'class' : 'place-to-visit-container'}) if(places_to_visit): card = places_to_visit.find('div', {'class' : 'col-md-12'}) city_urls = {} for a in card.find_all('a', href=True): if a['href']: list = a['href'].split('/') city_urls[list[3]] = 'https://www.goibibo.com/hotels/intl-hotels-in-' + list[3] + '-ct/' print(country_name)
36.451977
160
0.653131
dd4965798452f29205244dc8f8464e898af885fa
234
py
Python
groundstation/ROV/OCR/SScrop.py
iturov/rov2018
ca1949806d105a2caddf2cf7a1361e2d3f6a1246
[ "MIT" ]
3
2018-01-26T14:00:50.000Z
2018-08-08T06:44:21.000Z
groundstation/ROV/OCR/SScrop.py
iturov/rov2018
ca1949806d105a2caddf2cf7a1361e2d3f6a1246
[ "MIT" ]
null
null
null
groundstation/ROV/OCR/SScrop.py
iturov/rov2018
ca1949806d105a2caddf2cf7a1361e2d3f6a1246
[ "MIT" ]
2
2018-08-08T06:44:23.000Z
2020-10-24T11:36:33.000Z
import pyscreenshot as ImageGrab i=0 src_path ="C:\\Users\\Public\\ROV\OCR\\" if __name__ == "__main__": # part of the screen im=ImageGrab.grab(bbox=(200,100,1100,600)) # X1,Y1,X2,Y2 im.save(src_path + 'init.png')
14.625
60
0.645299
dd4ba76a5fa9e5f97446998ac4f6a5e6ee41ec63
3,008
py
Python
tests/http_client/conftest.py
sjaensch/aiobravado
d3f1eb71883b1f24c4b592917890160eb3d3cbcc
[ "BSD-3-Clause" ]
19
2017-11-20T22:47:12.000Z
2021-12-23T15:56:41.000Z
tests/http_client/conftest.py
sjaensch/aiobravado
d3f1eb71883b1f24c4b592917890160eb3d3cbcc
[ "BSD-3-Clause" ]
10
2018-01-11T12:53:01.000Z
2020-01-27T20:05:51.000Z
tests/http_client/conftest.py
sjaensch/aiobravado
d3f1eb71883b1f24c4b592917890160eb3d3cbcc
[ "BSD-3-Clause" ]
4
2017-11-18T12:37:14.000Z
2021-03-19T14:48:13.000Z
# -*- coding: utf-8 -*- import threading import time import bottle import ephemeral_port_reserve import pytest import umsgpack from bravado_core.content_type import APP_JSON from bravado_core.content_type import APP_MSGPACK from six.moves import urllib ROUTE_1_RESPONSE = b'HEY BUDDY' ROUTE_2_RESPONSE = b'BYE BUDDY' API_RESPONSE = {'answer': 42} SWAGGER_SPEC_DICT = { 'swagger': '2.0', 'info': {'version': '1.0.0', 'title': 'Integration tests'}, 'definitions': { 'api_response': { 'properties': { 'answer': { 'type': 'integer' }, }, 'required': ['answer'], 'type': 'object', 'x-model': 'api_response', 'title': 'api_response', } }, 'basePath': '/', 'paths': { '/json': { 'get': { 'operationId': 'get_json', 'tags': ['json'], 'produces': ['application/json'], 'responses': { '200': { 'description': 'HTTP/200', 'schema': {'$ref': '#/definitions/api_response'}, }, }, }, }, '/msgpack': { 'get': { 'produces': ['application/msgpack'], 'responses': { '200': { 'description': 'HTTP/200', 'schema': {'$ref': '#/definitions/api_response'}, } } } } } } def wait_unit_service_starts(url, timeout=10): start = time.time() while time.time() < start + timeout: try: urllib.request.urlopen(url, timeout=2) except urllib.error.HTTPError: return except urllib.error.URLError: time.sleep(0.1)
24.064
73
0.539894
dd4bd1dde3eae994bf4970c151cbd96f077c070c
1,479
py
Python
test/test_convvae.py
kejiejiang/UnsupervisedDeepLearning-Pytorch
6ea7b7151ae62bf0130b56cc023f2be068aa87f0
[ "MIT" ]
87
2017-11-22T02:59:24.000Z
2022-01-16T13:08:40.000Z
test/test_convvae.py
CauchyLagrange/UnsupervisedDeepLearning-Pytorch
6ea7b7151ae62bf0130b56cc023f2be068aa87f0
[ "MIT" ]
3
2018-04-24T11:46:51.000Z
2020-01-07T00:01:46.000Z
test/test_convvae.py
CauchyLagrange/UnsupervisedDeepLearning-Pytorch
6ea7b7151ae62bf0130b56cc023f2be068aa87f0
[ "MIT" ]
25
2018-03-15T04:02:21.000Z
2021-12-30T09:24:19.000Z
import torch import torch.utils.data from torchvision import datasets, transforms import numpy as np from udlp.autoencoder.convVAE import ConvVAE import argparse parser = argparse.ArgumentParser(description='VAE MNIST Example') parser.add_argument('--lr', type=float, default=0.0001, metavar='N', help='learning rate for training (default: 0.001)') parser.add_argument('--batch-size', type=int, default=128, metavar='N', help='input batch size for training (default: 128)') parser.add_argument('--epochs', type=int, default=10, metavar='N', help='number of epochs to train (default: 10)') parser.add_argument('--save', type=str, default="", metavar='N', help='number of epochs to train (default: 10)') args = parser.parse_args() train_loader = torch.utils.data.DataLoader( datasets.SVHN('./dataset/svhn', split='train', download=True, transform=transforms.ToTensor()), batch_size=args.batch_size, shuffle=True, num_workers=2) test_loader = torch.utils.data.DataLoader( datasets.SVHN('./dataset/svhn', split='test', download=True, transform=transforms.ToTensor()), batch_size=args.batch_size, shuffle=True, num_workers=2) vae = ConvVAE(width=32, height=32, nChannels=3, hidden_size=500, z_dim=100, binary=True, nFilters=64) vae.fit(train_loader, test_loader, lr=args.lr, num_epochs=args.epochs) if args.save!="": torch.save(vae.state_dict(), args.save)
46.21875
98
0.697769
dd4db1c506d212f1e3f132f918bc8f782cebb18b
673
py
Python
SourceCode/Bayes/bayeslearn.py
xuanyuansen/PyMachineLearning
c5b88c4d9aa2f5d59160d0824f7cee8377e7e16e
[ "Apache-2.0" ]
1
2017-01-17T06:19:33.000Z
2017-01-17T06:19:33.000Z
SourceCode/Bayes/bayeslearn.py
xuanyuansen/PyMachineLearning
c5b88c4d9aa2f5d59160d0824f7cee8377e7e16e
[ "Apache-2.0" ]
null
null
null
SourceCode/Bayes/bayeslearn.py
xuanyuansen/PyMachineLearning
c5b88c4d9aa2f5d59160d0824f7cee8377e7e16e
[ "Apache-2.0" ]
null
null
null
#coding=utf-8 ''' Created on 2013920 @author: Wangliaofan ''' import bayes import feedparser from time import * if __name__== '__main__': listOPosts,listClasses = bayes.loadDataSet() print listOPosts,listClasses myVocabList = bayes.createVocabList(listOPosts) print myVocabList trainMat=[] for postinDoc in listOPosts: trainMat.append(bayes.setOfWords2Vec(myVocabList, postinDoc)) print trainMat p0V,p1V,pAb=bayes.trainNB0(trainMat, listClasses) print p0V print p1V print pAb #ny=feedparser.parse('http://newyork.craigslist.org/stp/index.rss') #sleep(5) #print ny['entries'] bayes.spamTest() pass
24.035714
71
0.708767
dd57860debea07d7b1dee00c8d3f246398e5a1ff
573
py
Python
modules/yats/middleware/header.py
PrathameshBolade/yats
93bb5271255120b7131a3bc416e3386428a4d3ec
[ "MIT" ]
54
2015-01-26T07:56:59.000Z
2022-03-10T18:48:05.000Z
modules/yats/middleware/header.py
PrathameshBolade/yats
93bb5271255120b7131a3bc416e3386428a4d3ec
[ "MIT" ]
8
2015-03-15T18:33:39.000Z
2021-12-21T14:23:11.000Z
modules/yats/middleware/header.py
PrathameshBolade/yats
93bb5271255120b7131a3bc416e3386428a4d3ec
[ "MIT" ]
23
2015-02-19T16:55:35.000Z
2022-03-11T19:49:06.000Z
# -*- coding: utf-8 -*- from socket import gethostname
30.157895
64
0.649215
dd58051ac5d7683774d3d6e01bb0dea25252af19
1,334
py
Python
handshake_client/sockets.py
naoki-maeda/handshake-client-py
286884b358e15f84965f3c3224cfabd83e1a1406
[ "MIT" ]
3
2020-12-31T08:29:20.000Z
2021-08-14T14:41:22.000Z
handshake_client/sockets.py
naoki-maeda/handshake-client-py
286884b358e15f84965f3c3224cfabd83e1a1406
[ "MIT" ]
null
null
null
handshake_client/sockets.py
naoki-maeda/handshake-client-py
286884b358e15f84965f3c3224cfabd83e1a1406
[ "MIT" ]
1
2020-05-25T14:26:33.000Z
2020-05-25T14:26:33.000Z
import logging import socketio logger = logging.getLogger("handshake.socket") sio = socketio.AsyncClient(logger=logger) async def get_wallet_connection( url: str, api_key: str, wallet_id: str = "*", ) -> socketio.AsyncClient: """ see https://hsd-dev.org/guides/events.html """ assert type(url) == str assert type(api_key) == str assert type(wallet_id) == str if sio.connected is False: await sio.connect(url, transports=["websocket"]) await sio.call("auth", api_key) await sio.call("join", wallet_id) return sio
26.68
81
0.642429
dd586c3a691480974c3b96292cc74640fddadda5
869
py
Python
generator01/testing/test_generator01.py
sku899/World_Travel_Language_Wizard
a9e009336e2f53c5fc0f3e40af51f34335645e5f
[ "MIT" ]
null
null
null
generator01/testing/test_generator01.py
sku899/World_Travel_Language_Wizard
a9e009336e2f53c5fc0f3e40af51f34335645e5f
[ "MIT" ]
null
null
null
generator01/testing/test_generator01.py
sku899/World_Travel_Language_Wizard
a9e009336e2f53c5fc0f3e40af51f34335645e5f
[ "MIT" ]
null
null
null
from unittest.mock import patch from flask import url_for, Response, request from flask_testing import TestCase from random import randint from app import app
34.76
126
0.653625
dd5b35b49e23eb6c89bb23b5e7b7a0d158afacb3
14,640
py
Python
assets/arguments.py
YuhangSong/Arena-Baselines-Depreciated
78c33994e67aede7565dda3f68f5cebe0d5ee6e6
[ "Apache-2.0" ]
null
null
null
assets/arguments.py
YuhangSong/Arena-Baselines-Depreciated
78c33994e67aede7565dda3f68f5cebe0d5ee6e6
[ "Apache-2.0" ]
null
null
null
assets/arguments.py
YuhangSong/Arena-Baselines-Depreciated
78c33994e67aede7565dda3f68f5cebe0d5ee6e6
[ "Apache-2.0" ]
null
null
null
import argparse import torch import assets.utils as utils
48.476821
126
0.616189
dd5c3b4cdcb7e58a2c1873f564ec41c534d2da13
687
py
Python
khtube/download_ffmpeg.py
KodersHub/khtube
b1a8f96b7ff27cbb7eae615e8aee7d27260f80e8
[ "MIT" ]
1
2021-08-09T14:01:12.000Z
2021-08-09T14:01:12.000Z
khtube/download_ffmpeg.py
KodersHub/khtube
b1a8f96b7ff27cbb7eae615e8aee7d27260f80e8
[ "MIT" ]
null
null
null
khtube/download_ffmpeg.py
KodersHub/khtube
b1a8f96b7ff27cbb7eae615e8aee7d27260f80e8
[ "MIT" ]
null
null
null
from google_drive_downloader import GoogleDriveDownloader as gdd import sys import os import requests platform = get_platform() if platform == "linux": print("Nothing needs to install") else: print("Installing ffmpeg") gdd.download_file_from_google_drive(file_id='1Q5zbaXonPEUNQmclp1WMIVVodnUuJdKo', dest_path='./ffmpeg.exe', unzip=False)
25.444444
84
0.604076
dd5ce8afa891dc4561f13cf8c918df7e99c18b1f
1,231
py
Python
climbing (1).py
VamsiKrishna1211/Hacker_rank_solutions
a683a36fcc2f011c120eb4d52aa08468deccc820
[ "Apache-2.0" ]
null
null
null
climbing (1).py
VamsiKrishna1211/Hacker_rank_solutions
a683a36fcc2f011c120eb4d52aa08468deccc820
[ "Apache-2.0" ]
null
null
null
climbing (1).py
VamsiKrishna1211/Hacker_rank_solutions
a683a36fcc2f011c120eb4d52aa08468deccc820
[ "Apache-2.0" ]
null
null
null
#!/bin/python3 import math import os import random import re import sys # Complete the climbingLeaderboard function below. if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') scores_count = int(input()) scores = list(map(int, input().rstrip().split())) alice_count = int(input()) alice = list(map(int, input().rstrip().split())) result = climbingLeaderboard(scores, alice) fptr.write('\n'.join(map(str, result))) fptr.write('\n') fptr.close()
20.864407
53
0.541024
dd5d2da4c7eb58adfbaff7779a18bcc9d814e736
25,661
py
Python
game_manager/machine_learning/block_controller_train.py
EndoNrak/tetris
0ce4863348d644b401c53e6c9a50cdc6f7430ed1
[ "MIT" ]
1
2022-01-29T15:23:15.000Z
2022-01-29T15:23:15.000Z
game_manager/machine_learning/block_controller_train.py
EndoNrak/tetris
0ce4863348d644b401c53e6c9a50cdc6f7430ed1
[ "MIT" ]
null
null
null
game_manager/machine_learning/block_controller_train.py
EndoNrak/tetris
0ce4863348d644b401c53e6c9a50cdc6f7430ed1
[ "MIT" ]
null
null
null
#!/usr/bin/python3 # -*- coding: utf-8 -*- from datetime import datetime import pprint import random import copy import torch import torch.nn as nn from model.deepqnet import DeepQNetwork,DeepQNetwork_v2 import omegaconf from hydra import compose, initialize import os from tensorboardX import SummaryWriter from collections import deque from random import random, sample,randint import numpy as np import subprocess BLOCK_CONTROLLER_TRAIN = Block_Controller()
41.929739
145
0.575465
dd5da8896dcd0d60de2ab7a1e52c8732ee3a4ea8
405
py
Python
erp/migrations/0123_auto_20210513_1720.py
bzg/acceslibre
52c7c6990dc132da71a92e856d65f4a983c3b15a
[ "MIT" ]
8
2020-07-23T08:17:28.000Z
2022-03-09T22:31:36.000Z
erp/migrations/0123_auto_20210513_1720.py
bzg/acceslibre
52c7c6990dc132da71a92e856d65f4a983c3b15a
[ "MIT" ]
37
2020-07-01T08:47:33.000Z
2022-02-03T19:50:58.000Z
erp/migrations/0123_auto_20210513_1720.py
bzg/acceslibre
52c7c6990dc132da71a92e856d65f4a983c3b15a
[ "MIT" ]
4
2021-04-08T10:57:18.000Z
2022-01-31T13:16:31.000Z
# Generated by Django 3.2 on 2021-05-13 15:20 import uuid from django.db import migrations, models
20.25
68
0.604938
dd5e767c2f0f3137c08350fa015010541f736e41
290
py
Python
migrations/824-auto-exclude-regions.py
muffinresearch/zamboni
045a6f07c775b99672af6d9857d295ed02fe5dd9
[ "BSD-3-Clause" ]
null
null
null
migrations/824-auto-exclude-regions.py
muffinresearch/zamboni
045a6f07c775b99672af6d9857d295ed02fe5dd9
[ "BSD-3-Clause" ]
null
null
null
migrations/824-auto-exclude-regions.py
muffinresearch/zamboni
045a6f07c775b99672af6d9857d295ed02fe5dd9
[ "BSD-3-Clause" ]
null
null
null
from mkt.constants import regions from mkt.developers.cron import exclude_new_region
18.125
50
0.586207
dd5ec06ae412be00165dc082fa38f505f00c44d7
2,959
py
Python
qa/rpc-tests/checkpoint-load.py
ericramos1980/energi
aadc44f714f9d52433ab3595a9f33a61433c60c9
[ "MIT" ]
2
2021-12-28T21:47:07.000Z
2022-02-09T21:04:29.000Z
qa/rpc-tests/checkpoint-load.py
reddragon34/energi
4cc6c426d9d4b6b9053912de9b2197eba071201e
[ "MIT" ]
null
null
null
qa/rpc-tests/checkpoint-load.py
reddragon34/energi
4cc6c426d9d4b6b9053912de9b2197eba071201e
[ "MIT" ]
1
2019-10-07T19:17:55.000Z
2019-10-07T19:17:55.000Z
#!/usr/bin/env python3 # Copyright (c) 2019 The Energi Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import logging if __name__ == '__main__': CheckpointLoadTest().main()
37.935897
86
0.639743
dd5ffb792de44849ba525e817187b550fe21e9d9
648
py
Python
python/setup.py
tcolgate/gracetests
552c8113b0554d49cf146e6d7cfd573c8b4cbf8f
[ "MIT" ]
2
2019-07-30T16:50:20.000Z
2021-11-26T22:46:29.000Z
python/setup.py
tcolgate/gracetests
552c8113b0554d49cf146e6d7cfd573c8b4cbf8f
[ "MIT" ]
null
null
null
python/setup.py
tcolgate/gracetests
552c8113b0554d49cf146e6d7cfd573c8b4cbf8f
[ "MIT" ]
1
2019-07-30T16:50:54.000Z
2019-07-30T16:50:54.000Z
import os from setuptools import find_packages, setup DIR = os.path.dirname(os.path.abspath(__file__)) setup( name='graceful', version='1.2.0', description='test of graceful shutdown', url='https://github.com/qubitdigital/graceful/python', author='Infra', author_email='infra@qubit.com', license='All rights reserved.', packages=find_packages(), install_requires=[ 'sanic==0.7.0', 'ujson==1.35', 'python-dotenv==0.8.2', 'cchardet==2.1.1', ], zip_safe=False, entry_points={ 'console_scripts': [ 'graceful=graceful.server:main', ] } )
22.344828
58
0.603395
dd61bcf996578639e6980380d244d98682bbdae6
812
py
Python
src/mylog/logger.py
JoeBuzh/Pm_Composition_Quallity_Control
676c508a37c9a3774bf223e7abd53db04df771d7
[ "MIT" ]
1
2020-07-23T04:13:02.000Z
2020-07-23T04:13:02.000Z
src/runtime/mylog/mylog.py
JoeBuzh/DeepWeather
2677edc16d9865ec98401aaf121aaabd24974aaf
[ "MIT" ]
null
null
null
src/runtime/mylog/mylog.py
JoeBuzh/DeepWeather
2677edc16d9865ec98401aaf121aaabd24974aaf
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import os import logging import logging.handlers import time
31.230769
103
0.699507
dd61ede10dd7a8e91db98cff1eeb2bd9cfadde8d
637
py
Python
convert_assets.py
michaelgold/usdzconvert
f4e6e552db4e27a3e088649f19f6bd61977501c1
[ "MIT" ]
null
null
null
convert_assets.py
michaelgold/usdzconvert
f4e6e552db4e27a3e088649f19f6bd61977501c1
[ "MIT" ]
null
null
null
convert_assets.py
michaelgold/usdzconvert
f4e6e552db4e27a3e088649f19f6bd61977501c1
[ "MIT" ]
null
null
null
import glob import os import subprocess import shutil source_file_list = glob.glob("../source/assets/*.glb") for input_file_name in source_file_list: base_file_name = os.path.split(input_file_name)[1] output_file_name = "../dist/assets/{}.usdz".format(os.path.splitext(base_file_name)[0]) print(output_file_name) subprocess.call("python run_usd.py usdzconvert/usdzconvert {} {}".format(input_file_name, output_file_name), shell=True) for glb_file in source_file_list: print(glb_file) destination = "../dist/assets/{}".format(os.path.split(glb_file)[1]) shutil.move(glb_file, destination)
35.388889
125
0.726845
dd6374321202c04d2e14fb1f005b96daccd1a28b
36
py
Python
csv_json/__init__.py
Rerice/Csv_json_converter
54bf0f839d8fff203c1cf96812b96af915449fef
[ "MIT" ]
3
2021-06-02T15:32:45.000Z
2021-12-13T10:12:25.000Z
csv_json/__init__.py
Rerice/Csv_json_converter
54bf0f839d8fff203c1cf96812b96af915449fef
[ "MIT" ]
null
null
null
csv_json/__init__.py
Rerice/Csv_json_converter
54bf0f839d8fff203c1cf96812b96af915449fef
[ "MIT" ]
2
2021-06-02T15:30:42.000Z
2021-06-02T17:28:41.000Z
from csv_json.csv_json_conv import *
36
36
0.861111
dd63b219f3cb356db869fd14f9d34da5dd98361a
463
py
Python
Constants.py
HKN-UCSD/HIIT
63f726398ca63c92e82a8052a05608a8537e6e87
[ "MIT" ]
null
null
null
Constants.py
HKN-UCSD/HIIT
63f726398ca63c92e82a8052a05608a8537e6e87
[ "MIT" ]
null
null
null
Constants.py
HKN-UCSD/HIIT
63f726398ca63c92e82a8052a05608a8537e6e87
[ "MIT" ]
1
2019-08-18T19:23:44.000Z
2019-08-18T19:23:44.000Z
COLUMNS = ['First Name', 'Last Name', 'Class Standing', 'Cum GPA', 'Major Code', 'Dept', 'Email'] DEPTS = ['CSE', 'ECE', 'MATH', 'BENG'] CLASS_STANDINGS = ['SO', 'JR', 'SR'] DEPTS_MAJORS = dict() # bit of a faux-pas... DEPTS_MAJORS['CSE'] = ['CS25', 'CS26', 'CS27', 'CS28'] DEPTS_MAJORS['ECE'] = ['EC26', 'EC27', 'EC28'] DEPTS_MAJORS['MATH'] = ['MA30'] DEPTS_MAJORS['BENG'] = ['BE25', 'BE26', 'BE27', 'BE28'] CLASS_QUANTILE = {'SO': 0.8, 'JR': 0.75, 'SR': 0.667}
51.444444
97
0.580994
dd6453c36feaa6225a2781434ed2cbc21f1477e2
258
py
Python
app/admin.py
Syilun/aiot-django-dashboard-postgresql
3aa607bd623006a4c99a97da304985eb908741c8
[ "MIT" ]
null
null
null
app/admin.py
Syilun/aiot-django-dashboard-postgresql
3aa607bd623006a4c99a97da304985eb908741c8
[ "MIT" ]
null
null
null
app/admin.py
Syilun/aiot-django-dashboard-postgresql
3aa607bd623006a4c99a97da304985eb908741c8
[ "MIT" ]
null
null
null
# -*- encoding: utf-8 -*- """ License: MIT Copyright (c) 2019 - present AppSeed.us """ from django.contrib import admin from .models import PERSON from .models import FACE # Register your models here. admin.site.register(PERSON) admin.site.register(FACE)
17.2
39
0.728682
dd646968d684c4605ba1ae783d48a3452bbee81d
933
py
Python
Python/python-tutorials/networking/tcp_server.py
zhongyangynag/code-study
5410929554107a384a09d899c6fa3d16ed383d2b
[ "MIT" ]
null
null
null
Python/python-tutorials/networking/tcp_server.py
zhongyangynag/code-study
5410929554107a384a09d899c6fa3d16ed383d2b
[ "MIT" ]
null
null
null
Python/python-tutorials/networking/tcp_server.py
zhongyangynag/code-study
5410929554107a384a09d899c6fa3d16ed383d2b
[ "MIT" ]
null
null
null
#!/usr/bin/env python import re import sys import socket import SocketServer import struct import fcntl import sys if __name__=='__main__': # start server server = SocketServer.ThreadingTCPServer( (getip("eth0"),44444), MyHandler) server.serve_forever()
21.697674
96
0.736334
dd64daf0644c28687a4705d4e8b356d44e031ab4
2,190
py
Python
tests/test_examples.py
timgates42/goless
3c8742fa0f94d0a365840aae404da4e8eaed9d71
[ "Apache-2.0" ]
266
2015-01-03T04:18:48.000Z
2022-02-16T03:08:38.000Z
tests/test_examples.py
timgates42/goless
3c8742fa0f94d0a365840aae404da4e8eaed9d71
[ "Apache-2.0" ]
19
2015-03-06T11:04:53.000Z
2021-06-09T15:08:57.000Z
tests/test_examples.py
timgates42/goless
3c8742fa0f94d0a365840aae404da4e8eaed9d71
[ "Apache-2.0" ]
20
2015-01-03T03:45:08.000Z
2022-03-05T06:05:32.000Z
""" Idiomatic Go examples converted to use goless. """ from __future__ import print_function import time from . import BaseTests import goless
26.071429
75
0.541096
dd67590d08d500fd8ab7568abbfffa79b1097a7f
3,211
py
Python
Utils/Messaging.py
philshams/FC_analysis
cabe2385d5061d206a21b230605bfce9e39ec7f2
[ "MIT" ]
null
null
null
Utils/Messaging.py
philshams/FC_analysis
cabe2385d5061d206a21b230605bfce9e39ec7f2
[ "MIT" ]
null
null
null
Utils/Messaging.py
philshams/FC_analysis
cabe2385d5061d206a21b230605bfce9e39ec7f2
[ "MIT" ]
null
null
null
from slackclient import SlackClient import requests import os from Config import slack_env_var_token, slack_username """ These functions take care of sending slack messages and emails """ def upload_file( filepath ): """Upload file to channel Note: URLs can be constructed from: https://api.slack.com/methods/files.upload/test """ slack_chat_messenger('Trying to send you {}'.format(filepath)) slack_token = os.environ.get(slack_env_var_token) data = {} data['token'] = slack_token data['file'] = filepath data['filename'] = filepath data['channels'] = [slack_username] data['display_as_bot'] = True filepath = data['file'] files = { 'content': (filepath, open(filepath, 'rb'), 'image/png', { 'Expires': '0' }) } data['media'] = files response = requests.post( url='https://slack.com/api/files.upload', data=data, headers={'Accept': 'application/json'}, files=files) print(response.text)
28.669643
106
0.646528
dd67b0be318886c07c1697a2ac8415ae63718592
71,403
py
Python
venv/lib/python3.8/site-packages/spaceone/api/monitoring/v1/alert_pb2.py
choonho/plugin-prometheus-mon-webhook
afa7d65d12715fd0480fb4f92a9c62da2d6128e0
[ "Apache-2.0" ]
null
null
null
venv/lib/python3.8/site-packages/spaceone/api/monitoring/v1/alert_pb2.py
choonho/plugin-prometheus-mon-webhook
afa7d65d12715fd0480fb4f92a9c62da2d6128e0
[ "Apache-2.0" ]
null
null
null
venv/lib/python3.8/site-packages/spaceone/api/monitoring/v1/alert_pb2.py
choonho/plugin-prometheus-mon-webhook
afa7d65d12715fd0480fb4f92a9c62da2d6128e0
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: spaceone/api/monitoring/v1/alert.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from spaceone.api.core.v1 import query_pb2 as spaceone_dot_api_dot_core_dot_v1_dot_query__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='spaceone/api/monitoring/v1/alert.proto', package='spaceone.api.monitoring.v1', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n&spaceone/api/monitoring/v1/alert.proto\x12\x1aspaceone.api.monitoring.v1\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/api/annotations.proto\x1a spaceone/api/core/v1/query.proto\"I\n\rAlertResource\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"<\n\x0e\x41lertResponder\x12\x15\n\rresource_type\x18\x01 \x01(\t\x12\x13\n\x0bresource_id\x18\x02 \x01(\t\"\xac\x01\n\x12\x43reateAlertRequest\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x10\n\x08\x61ssignee\x18\x03 \x01(\t\x12\x39\n\x07urgency\x18\x04 \x01(\x0e\x32(.spaceone.api.monitoring.v1.AlertUrgency\x12\x12\n\nproject_id\x18\x05 \x01(\t\x12\x11\n\tdomain_id\x18\x0b \x01(\t\"\xb6\x02\n\x12UpdateAlertRequest\x12\x10\n\x08\x61lert_id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\r\n\x05state\x18\x03 \x01(\t\x12\x16\n\x0estatus_message\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x10\n\x08\x61ssignee\x18\x06 \x01(\t\x12\x39\n\x07urgency\x18\x07 \x01(\x0e\x32(.spaceone.api.monitoring.v1.AlertUrgency\x12\x12\n\nproject_id\x18\x08 \x01(\t\x12\x1c\n\x14reset_status_message\x18\x0b \x01(\x08\x12\x19\n\x11reset_description\x18\x0c \x01(\x08\x12\x16\n\x0ereset_assignee\x18\r \x01(\x08\x12\x11\n\tdomain_id\x18\x15 \x01(\t\"N\n\x17UpdateAlertStateRequest\x12\x10\n\x08\x61lert_id\x18\x01 \x01(\t\x12\x12\n\naccess_key\x18\x02 \x01(\t\x12\r\n\x05state\x18\x03 \x01(\t\"H\n\x11MergeAlertRequest\x12\x0e\n\x06\x61lerts\x18\x01 \x03(\t\x12\x10\n\x08merge_to\x18\x02 \x01(\t\x12\x11\n\tdomain_id\x18\x03 \x01(\t\"K\n\x12SnoozeAlertRequest\x12\x10\n\x08\x61lert_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nd_time\x18\x02 \x01(\t\x12\x11\n\tdomain_id\x18\x03 \x01(\t\"h\n\x15\x41lertResponderRequest\x12\x10\n\x08\x61lert_id\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x13\n\x0bresource_id\x18\x03 \x01(\t\x12\x11\n\tdomain_id\x18\x04 \x01(\t\"X\n\x1d\x41lertProjectDependencyRequest\x12\x10\n\x08\x61lert_id\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12\x11\n\tdomain_id\x18\x03 \x01(\t\"3\n\x0c\x41lertRequest\x12\x10\n\x08\x61lert_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\"D\n\x0fGetAlertRequest\x12\x10\n\x08\x61lert_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x0c\n\x04only\x18\x03 \x03(\t\"\x9d\x03\n\nAlertQuery\x12*\n\x05query\x18\x01 \x01(\x0b\x32\x1b.spaceone.api.core.v1.Query\x12\x14\n\x0c\x61lert_number\x18\x02 \x01(\x05\x12\x10\n\x08\x61lert_id\x18\x03 \x01(\t\x12\r\n\x05title\x18\x04 \x01(\t\x12\x35\n\x05state\x18\x05 \x01(\x0e\x32&.spaceone.api.monitoring.v1.AlertState\x12\x10\n\x08\x61ssignee\x18\x06 \x01(\t\x12\x39\n\x07urgency\x18\x07 \x01(\x0e\x32(.spaceone.api.monitoring.v1.AlertUrgency\x12\x10\n\x08severity\x18\x08 \x01(\t\x12\x12\n\nis_snoozed\x18\t \x01(\t\x12\x13\n\x0bresource_id\x18\n \x01(\t\x12\x14\n\x0ctriggered_by\x18\x0b \x01(\t\x12\x12\n\nwebhook_id\x18\x0c \x01(\t\x12\x1c\n\x14\x65scalation_policy_id\x18\r \x01(\t\x12\x12\n\nproject_id\x18\x0e \x01(\t\x12\x11\n\tdomain_id\x18\x0f \x01(\t\"\x9a\x06\n\tAlertInfo\x12\x14\n\x0c\x61lert_number\x18\x01 \x01(\x05\x12\x10\n\x08\x61lert_id\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x35\n\x05state\x18\x04 \x01(\x0e\x32&.spaceone.api.monitoring.v1.AlertState\x12\x16\n\x0estatus_message\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x10\n\x08\x61ssignee\x18\x07 \x01(\t\x12\x39\n\x07urgency\x18\x08 \x01(\x0e\x32(.spaceone.api.monitoring.v1.AlertUrgency\x12\x10\n\x08severity\x18\t \x01(\t\x12\x0c\n\x04rule\x18\n \x01(\t\x12;\n\x08resource\x18\x0b \x01(\x0b\x32).spaceone.api.monitoring.v1.AlertResource\x12\x30\n\x0f\x61\x64\x64itional_info\x18\x0c \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\nis_snoozed\x18\r \x01(\x08\x12\x18\n\x10snoozed_end_time\x18\x0e \x01(\t\x12\x17\n\x0f\x65scalation_step\x18\x0f \x01(\x05\x12\x16\n\x0e\x65scalation_ttl\x18\x10 \x01(\x05\x12>\n\nresponders\x18\x11 \x03(\x0b\x32*.spaceone.api.monitoring.v1.AlertResponder\x12\x1c\n\x14project_dependencies\x18\x12 \x03(\t\x12\x14\n\x0ctriggered_by\x18\x15 \x01(\t\x12\x12\n\nwebhook_id\x18\x16 \x01(\t\x12\x1c\n\x14\x65scalation_policy_id\x18\x17 \x01(\t\x12\x12\n\nproject_id\x18\x18 \x01(\t\x12\x11\n\tdomain_id\x18\x19 \x01(\t\x12\x12\n\ncreated_at\x18\x1f \x01(\t\x12\x12\n\nupdated_at\x18 \x01(\t\x12\x17\n\x0f\x61\x63knowledged_at\x18! \x01(\t\x12\x13\n\x0bresolved_at\x18\" \x01(\t\x12\x14\n\x0c\x65scalated_at\x18# \x01(\t\"Y\n\nAlertsInfo\x12\x36\n\x07results\x18\x01 \x03(\x0b\x32%.spaceone.api.monitoring.v1.AlertInfo\x12\x13\n\x0btotal_count\x18\x02 \x01(\x05\"Y\n\x0e\x41lertStatQuery\x12\x34\n\x05query\x18\x01 \x01(\x0b\x32%.spaceone.api.core.v1.StatisticsQuery\x12\x11\n\tdomain_id\x18\x02 \x01(\t*9\n\x0c\x41lertUrgency\x12\x16\n\x12\x41LERT_URGENCY_NONE\x10\x00\x12\x08\n\x04HIGH\x10\x01\x12\x07\n\x03LOW\x10\x02*\\\n\nAlertState\x12\x14\n\x10\x41LERT_STATE_NONE\x10\x00\x12\r\n\tTRIGGERED\x10\x01\x12\x10\n\x0c\x41\x43KNOWLEDGED\x10\x02\x12\x0c\n\x08RESOLVED\x10\x03\x12\t\n\x05\x45RROR\x10\x04\x32\x9e\x0f\n\x05\x41lert\x12~\n\x06\x63reate\x12..spaceone.api.monitoring.v1.CreateAlertRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x15/monitoring/v1/alerts\x12\x88\x01\n\x06update\x12..spaceone.api.monitoring.v1.UpdateAlertRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"\'\x82\xd3\xe4\x93\x02!\x1a\x1f/monitoring/v1/alert/{alert_id}\x12\xa8\x01\n\x0cupdate_state\x12\x33.spaceone.api.monitoring.v1.UpdateAlertStateRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"<\x82\xd3\xe4\x93\x02\x36\"4/monitoring/v1/alert/{alert_id}/{access_key}/{state}\x12\x82\x01\n\x05merge\x12-.spaceone.api.monitoring.v1.MergeAlertRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"#\x82\xd3\xe4\x93\x02\x1d\"\x1b/monitoring/v1/alerts/merge\x12\x8f\x01\n\x06snooze\x12..spaceone.api.monitoring.v1.SnoozeAlertRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\".\x82\xd3\xe4\x93\x02(\"&/monitoring/v1/alert/{alert_id}/snooze\x12\x9d\x01\n\radd_responder\x12\x31.spaceone.api.monitoring.v1.AlertResponderRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"2\x82\xd3\xe4\x93\x02,\"*/monitoring/v1/alert/{alert_id}/responders\x12\xa0\x01\n\x10remove_responder\x12\x31.spaceone.api.monitoring.v1.AlertResponderRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"2\x82\xd3\xe4\x93\x02,**/monitoring/v1/alert/{alert_id}/responders\x12\xb8\x01\n\x16\x61\x64\x64_project_dependency\x12\x39.spaceone.api.monitoring.v1.AlertProjectDependencyRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"<\x82\xd3\xe4\x93\x02\x36\"4/monitoring/v1/alert/{alert_id}/project-dependencies\x12\xc6\x01\n\x19remove_project_dependency\x12\x39.spaceone.api.monitoring.v1.AlertProjectDependencyRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"G\x82\xd3\xe4\x93\x02\x41*?/monitoring/v1/alert/{alert_id}/project-dependency/{project_id}\x12s\n\x06\x64\x65lete\x12(.spaceone.api.monitoring.v1.AlertRequest\x1a\x16.google.protobuf.Empty\"\'\x82\xd3\xe4\x93\x02!*\x1f/monitoring/v1/alert/{alert_id}\x12\x82\x01\n\x03get\x12+.spaceone.api.monitoring.v1.GetAlertRequest\x1a%.spaceone.api.monitoring.v1.AlertInfo\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/monitoring/v1/alert/{alert_id}\x12\x95\x01\n\x04list\x12&.spaceone.api.monitoring.v1.AlertQuery\x1a&.spaceone.api.monitoring.v1.AlertsInfo\"=\x82\xd3\xe4\x93\x02\x37\x12\x15/monitoring/v1/alertsZ\x1e\"\x1c/monitoring/v1/alerts/search\x12o\n\x04stat\x12*.spaceone.api.monitoring.v1.AlertStatQuery\x1a\x17.google.protobuf.Struct\"\"\x82\xd3\xe4\x93\x02\x1c\"\x1a/monitoring/v1/alerts/statb\x06proto3' , dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_api_dot_annotations__pb2.DESCRIPTOR,spaceone_dot_api_dot_core_dot_v1_dot_query__pb2.DESCRIPTOR,]) _ALERTURGENCY = _descriptor.EnumDescriptor( name='AlertUrgency', full_name='spaceone.api.monitoring.v1.AlertUrgency', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='ALERT_URGENCY_NONE', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='HIGH', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='LOW', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=2763, serialized_end=2820, ) _sym_db.RegisterEnumDescriptor(_ALERTURGENCY) AlertUrgency = enum_type_wrapper.EnumTypeWrapper(_ALERTURGENCY) _ALERTSTATE = _descriptor.EnumDescriptor( name='AlertState', full_name='spaceone.api.monitoring.v1.AlertState', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='ALERT_STATE_NONE', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TRIGGERED', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ACKNOWLEDGED', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RESOLVED', index=3, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ERROR', index=4, number=4, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=2822, serialized_end=2914, ) _sym_db.RegisterEnumDescriptor(_ALERTSTATE) AlertState = enum_type_wrapper.EnumTypeWrapper(_ALERTSTATE) ALERT_URGENCY_NONE = 0 HIGH = 1 LOW = 2 ALERT_STATE_NONE = 0 TRIGGERED = 1 ACKNOWLEDGED = 2 RESOLVED = 3 ERROR = 4 _ALERTRESOURCE = _descriptor.Descriptor( name='AlertResource', full_name='spaceone.api.monitoring.v1.AlertResource', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='resource_id', full_name='spaceone.api.monitoring.v1.AlertResource.resource_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='resource_type', full_name='spaceone.api.monitoring.v1.AlertResource.resource_type', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='name', full_name='spaceone.api.monitoring.v1.AlertResource.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, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=193, serialized_end=266, ) _ALERTRESPONDER = _descriptor.Descriptor( name='AlertResponder', full_name='spaceone.api.monitoring.v1.AlertResponder', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='resource_type', full_name='spaceone.api.monitoring.v1.AlertResponder.resource_type', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='resource_id', full_name='spaceone.api.monitoring.v1.AlertResponder.resource_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, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=268, serialized_end=328, ) _CREATEALERTREQUEST = _descriptor.Descriptor( name='CreateAlertRequest', full_name='spaceone.api.monitoring.v1.CreateAlertRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='title', full_name='spaceone.api.monitoring.v1.CreateAlertRequest.title', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='description', full_name='spaceone.api.monitoring.v1.CreateAlertRequest.description', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='assignee', full_name='spaceone.api.monitoring.v1.CreateAlertRequest.assignee', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='urgency', full_name='spaceone.api.monitoring.v1.CreateAlertRequest.urgency', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='project_id', full_name='spaceone.api.monitoring.v1.CreateAlertRequest.project_id', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.CreateAlertRequest.domain_id', index=5, number=11, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=331, serialized_end=503, ) _UPDATEALERTREQUEST = _descriptor.Descriptor( name='UpdateAlertRequest', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.alert_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='title', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.title', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='state', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.state', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='status_message', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.status_message', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='description', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.description', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='assignee', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.assignee', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='urgency', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.urgency', index=6, number=7, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='project_id', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.project_id', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='reset_status_message', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.reset_status_message', index=8, number=11, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='reset_description', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.reset_description', index=9, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='reset_assignee', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.reset_assignee', index=10, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.UpdateAlertRequest.domain_id', index=11, number=21, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=506, serialized_end=816, ) _UPDATEALERTSTATEREQUEST = _descriptor.Descriptor( name='UpdateAlertStateRequest', full_name='spaceone.api.monitoring.v1.UpdateAlertStateRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.UpdateAlertStateRequest.alert_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='access_key', full_name='spaceone.api.monitoring.v1.UpdateAlertStateRequest.access_key', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='state', full_name='spaceone.api.monitoring.v1.UpdateAlertStateRequest.state', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=818, serialized_end=896, ) _MERGEALERTREQUEST = _descriptor.Descriptor( name='MergeAlertRequest', full_name='spaceone.api.monitoring.v1.MergeAlertRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alerts', full_name='spaceone.api.monitoring.v1.MergeAlertRequest.alerts', index=0, number=1, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='merge_to', full_name='spaceone.api.monitoring.v1.MergeAlertRequest.merge_to', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.MergeAlertRequest.domain_id', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=898, serialized_end=970, ) _SNOOZEALERTREQUEST = _descriptor.Descriptor( name='SnoozeAlertRequest', full_name='spaceone.api.monitoring.v1.SnoozeAlertRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.SnoozeAlertRequest.alert_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='end_time', full_name='spaceone.api.monitoring.v1.SnoozeAlertRequest.end_time', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.SnoozeAlertRequest.domain_id', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=972, serialized_end=1047, ) _ALERTRESPONDERREQUEST = _descriptor.Descriptor( name='AlertResponderRequest', full_name='spaceone.api.monitoring.v1.AlertResponderRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.AlertResponderRequest.alert_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='resource_type', full_name='spaceone.api.monitoring.v1.AlertResponderRequest.resource_type', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='resource_id', full_name='spaceone.api.monitoring.v1.AlertResponderRequest.resource_id', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.AlertResponderRequest.domain_id', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1049, serialized_end=1153, ) _ALERTPROJECTDEPENDENCYREQUEST = _descriptor.Descriptor( name='AlertProjectDependencyRequest', full_name='spaceone.api.monitoring.v1.AlertProjectDependencyRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.AlertProjectDependencyRequest.alert_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='project_id', full_name='spaceone.api.monitoring.v1.AlertProjectDependencyRequest.project_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.AlertProjectDependencyRequest.domain_id', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1155, serialized_end=1243, ) _ALERTREQUEST = _descriptor.Descriptor( name='AlertRequest', full_name='spaceone.api.monitoring.v1.AlertRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.AlertRequest.alert_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.AlertRequest.domain_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, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1245, serialized_end=1296, ) _GETALERTREQUEST = _descriptor.Descriptor( name='GetAlertRequest', full_name='spaceone.api.monitoring.v1.GetAlertRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.GetAlertRequest.alert_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.GetAlertRequest.domain_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='only', full_name='spaceone.api.monitoring.v1.GetAlertRequest.only', index=2, number=3, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1298, serialized_end=1366, ) _ALERTQUERY = _descriptor.Descriptor( name='AlertQuery', full_name='spaceone.api.monitoring.v1.AlertQuery', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='query', full_name='spaceone.api.monitoring.v1.AlertQuery.query', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='alert_number', full_name='spaceone.api.monitoring.v1.AlertQuery.alert_number', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.AlertQuery.alert_id', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='title', full_name='spaceone.api.monitoring.v1.AlertQuery.title', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='state', full_name='spaceone.api.monitoring.v1.AlertQuery.state', index=4, number=5, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='assignee', full_name='spaceone.api.monitoring.v1.AlertQuery.assignee', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='urgency', full_name='spaceone.api.monitoring.v1.AlertQuery.urgency', index=6, number=7, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='severity', full_name='spaceone.api.monitoring.v1.AlertQuery.severity', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='is_snoozed', full_name='spaceone.api.monitoring.v1.AlertQuery.is_snoozed', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='resource_id', full_name='spaceone.api.monitoring.v1.AlertQuery.resource_id', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='triggered_by', full_name='spaceone.api.monitoring.v1.AlertQuery.triggered_by', index=10, number=11, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='webhook_id', full_name='spaceone.api.monitoring.v1.AlertQuery.webhook_id', index=11, number=12, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='escalation_policy_id', full_name='spaceone.api.monitoring.v1.AlertQuery.escalation_policy_id', index=12, number=13, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='project_id', full_name='spaceone.api.monitoring.v1.AlertQuery.project_id', index=13, number=14, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.AlertQuery.domain_id', index=14, number=15, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1369, serialized_end=1782, ) _ALERTINFO = _descriptor.Descriptor( name='AlertInfo', full_name='spaceone.api.monitoring.v1.AlertInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='alert_number', full_name='spaceone.api.monitoring.v1.AlertInfo.alert_number', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='alert_id', full_name='spaceone.api.monitoring.v1.AlertInfo.alert_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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='title', full_name='spaceone.api.monitoring.v1.AlertInfo.title', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='state', full_name='spaceone.api.monitoring.v1.AlertInfo.state', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='status_message', full_name='spaceone.api.monitoring.v1.AlertInfo.status_message', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='description', full_name='spaceone.api.monitoring.v1.AlertInfo.description', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='assignee', full_name='spaceone.api.monitoring.v1.AlertInfo.assignee', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='urgency', full_name='spaceone.api.monitoring.v1.AlertInfo.urgency', index=7, number=8, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='severity', full_name='spaceone.api.monitoring.v1.AlertInfo.severity', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='rule', full_name='spaceone.api.monitoring.v1.AlertInfo.rule', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='resource', full_name='spaceone.api.monitoring.v1.AlertInfo.resource', index=10, number=11, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='additional_info', full_name='spaceone.api.monitoring.v1.AlertInfo.additional_info', index=11, number=12, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='is_snoozed', full_name='spaceone.api.monitoring.v1.AlertInfo.is_snoozed', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='snoozed_end_time', full_name='spaceone.api.monitoring.v1.AlertInfo.snoozed_end_time', index=13, number=14, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='escalation_step', full_name='spaceone.api.monitoring.v1.AlertInfo.escalation_step', index=14, number=15, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='escalation_ttl', full_name='spaceone.api.monitoring.v1.AlertInfo.escalation_ttl', index=15, number=16, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='responders', full_name='spaceone.api.monitoring.v1.AlertInfo.responders', index=16, number=17, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='project_dependencies', full_name='spaceone.api.monitoring.v1.AlertInfo.project_dependencies', index=17, number=18, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='triggered_by', full_name='spaceone.api.monitoring.v1.AlertInfo.triggered_by', index=18, number=21, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='webhook_id', full_name='spaceone.api.monitoring.v1.AlertInfo.webhook_id', index=19, number=22, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='escalation_policy_id', full_name='spaceone.api.monitoring.v1.AlertInfo.escalation_policy_id', index=20, number=23, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='project_id', full_name='spaceone.api.monitoring.v1.AlertInfo.project_id', index=21, number=24, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.AlertInfo.domain_id', index=22, number=25, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='created_at', full_name='spaceone.api.monitoring.v1.AlertInfo.created_at', index=23, number=31, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='updated_at', full_name='spaceone.api.monitoring.v1.AlertInfo.updated_at', index=24, number=32, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='acknowledged_at', full_name='spaceone.api.monitoring.v1.AlertInfo.acknowledged_at', index=25, number=33, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='resolved_at', full_name='spaceone.api.monitoring.v1.AlertInfo.resolved_at', index=26, number=34, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='escalated_at', full_name='spaceone.api.monitoring.v1.AlertInfo.escalated_at', index=27, number=35, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1785, serialized_end=2579, ) _ALERTSINFO = _descriptor.Descriptor( name='AlertsInfo', full_name='spaceone.api.monitoring.v1.AlertsInfo', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='results', full_name='spaceone.api.monitoring.v1.AlertsInfo.results', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='total_count', full_name='spaceone.api.monitoring.v1.AlertsInfo.total_count', 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, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2581, serialized_end=2670, ) _ALERTSTATQUERY = _descriptor.Descriptor( name='AlertStatQuery', full_name='spaceone.api.monitoring.v1.AlertStatQuery', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='query', full_name='spaceone.api.monitoring.v1.AlertStatQuery.query', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='domain_id', full_name='spaceone.api.monitoring.v1.AlertStatQuery.domain_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, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=2672, serialized_end=2761, ) _CREATEALERTREQUEST.fields_by_name['urgency'].enum_type = _ALERTURGENCY _UPDATEALERTREQUEST.fields_by_name['urgency'].enum_type = _ALERTURGENCY _ALERTQUERY.fields_by_name['query'].message_type = spaceone_dot_api_dot_core_dot_v1_dot_query__pb2._QUERY _ALERTQUERY.fields_by_name['state'].enum_type = _ALERTSTATE _ALERTQUERY.fields_by_name['urgency'].enum_type = _ALERTURGENCY _ALERTINFO.fields_by_name['state'].enum_type = _ALERTSTATE _ALERTINFO.fields_by_name['urgency'].enum_type = _ALERTURGENCY _ALERTINFO.fields_by_name['resource'].message_type = _ALERTRESOURCE _ALERTINFO.fields_by_name['additional_info'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT _ALERTINFO.fields_by_name['responders'].message_type = _ALERTRESPONDER _ALERTSINFO.fields_by_name['results'].message_type = _ALERTINFO _ALERTSTATQUERY.fields_by_name['query'].message_type = spaceone_dot_api_dot_core_dot_v1_dot_query__pb2._STATISTICSQUERY DESCRIPTOR.message_types_by_name['AlertResource'] = _ALERTRESOURCE DESCRIPTOR.message_types_by_name['AlertResponder'] = _ALERTRESPONDER DESCRIPTOR.message_types_by_name['CreateAlertRequest'] = _CREATEALERTREQUEST DESCRIPTOR.message_types_by_name['UpdateAlertRequest'] = _UPDATEALERTREQUEST DESCRIPTOR.message_types_by_name['UpdateAlertStateRequest'] = _UPDATEALERTSTATEREQUEST DESCRIPTOR.message_types_by_name['MergeAlertRequest'] = _MERGEALERTREQUEST DESCRIPTOR.message_types_by_name['SnoozeAlertRequest'] = _SNOOZEALERTREQUEST DESCRIPTOR.message_types_by_name['AlertResponderRequest'] = _ALERTRESPONDERREQUEST DESCRIPTOR.message_types_by_name['AlertProjectDependencyRequest'] = _ALERTPROJECTDEPENDENCYREQUEST DESCRIPTOR.message_types_by_name['AlertRequest'] = _ALERTREQUEST DESCRIPTOR.message_types_by_name['GetAlertRequest'] = _GETALERTREQUEST DESCRIPTOR.message_types_by_name['AlertQuery'] = _ALERTQUERY DESCRIPTOR.message_types_by_name['AlertInfo'] = _ALERTINFO DESCRIPTOR.message_types_by_name['AlertsInfo'] = _ALERTSINFO DESCRIPTOR.message_types_by_name['AlertStatQuery'] = _ALERTSTATQUERY DESCRIPTOR.enum_types_by_name['AlertUrgency'] = _ALERTURGENCY DESCRIPTOR.enum_types_by_name['AlertState'] = _ALERTSTATE _sym_db.RegisterFileDescriptor(DESCRIPTOR) AlertResource = _reflection.GeneratedProtocolMessageType('AlertResource', (_message.Message,), { 'DESCRIPTOR' : _ALERTRESOURCE, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertResource) }) _sym_db.RegisterMessage(AlertResource) AlertResponder = _reflection.GeneratedProtocolMessageType('AlertResponder', (_message.Message,), { 'DESCRIPTOR' : _ALERTRESPONDER, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertResponder) }) _sym_db.RegisterMessage(AlertResponder) CreateAlertRequest = _reflection.GeneratedProtocolMessageType('CreateAlertRequest', (_message.Message,), { 'DESCRIPTOR' : _CREATEALERTREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.CreateAlertRequest) }) _sym_db.RegisterMessage(CreateAlertRequest) UpdateAlertRequest = _reflection.GeneratedProtocolMessageType('UpdateAlertRequest', (_message.Message,), { 'DESCRIPTOR' : _UPDATEALERTREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.UpdateAlertRequest) }) _sym_db.RegisterMessage(UpdateAlertRequest) UpdateAlertStateRequest = _reflection.GeneratedProtocolMessageType('UpdateAlertStateRequest', (_message.Message,), { 'DESCRIPTOR' : _UPDATEALERTSTATEREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.UpdateAlertStateRequest) }) _sym_db.RegisterMessage(UpdateAlertStateRequest) MergeAlertRequest = _reflection.GeneratedProtocolMessageType('MergeAlertRequest', (_message.Message,), { 'DESCRIPTOR' : _MERGEALERTREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.MergeAlertRequest) }) _sym_db.RegisterMessage(MergeAlertRequest) SnoozeAlertRequest = _reflection.GeneratedProtocolMessageType('SnoozeAlertRequest', (_message.Message,), { 'DESCRIPTOR' : _SNOOZEALERTREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.SnoozeAlertRequest) }) _sym_db.RegisterMessage(SnoozeAlertRequest) AlertResponderRequest = _reflection.GeneratedProtocolMessageType('AlertResponderRequest', (_message.Message,), { 'DESCRIPTOR' : _ALERTRESPONDERREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertResponderRequest) }) _sym_db.RegisterMessage(AlertResponderRequest) AlertProjectDependencyRequest = _reflection.GeneratedProtocolMessageType('AlertProjectDependencyRequest', (_message.Message,), { 'DESCRIPTOR' : _ALERTPROJECTDEPENDENCYREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertProjectDependencyRequest) }) _sym_db.RegisterMessage(AlertProjectDependencyRequest) AlertRequest = _reflection.GeneratedProtocolMessageType('AlertRequest', (_message.Message,), { 'DESCRIPTOR' : _ALERTREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertRequest) }) _sym_db.RegisterMessage(AlertRequest) GetAlertRequest = _reflection.GeneratedProtocolMessageType('GetAlertRequest', (_message.Message,), { 'DESCRIPTOR' : _GETALERTREQUEST, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.GetAlertRequest) }) _sym_db.RegisterMessage(GetAlertRequest) AlertQuery = _reflection.GeneratedProtocolMessageType('AlertQuery', (_message.Message,), { 'DESCRIPTOR' : _ALERTQUERY, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertQuery) }) _sym_db.RegisterMessage(AlertQuery) AlertInfo = _reflection.GeneratedProtocolMessageType('AlertInfo', (_message.Message,), { 'DESCRIPTOR' : _ALERTINFO, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertInfo) }) _sym_db.RegisterMessage(AlertInfo) AlertsInfo = _reflection.GeneratedProtocolMessageType('AlertsInfo', (_message.Message,), { 'DESCRIPTOR' : _ALERTSINFO, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertsInfo) }) _sym_db.RegisterMessage(AlertsInfo) AlertStatQuery = _reflection.GeneratedProtocolMessageType('AlertStatQuery', (_message.Message,), { 'DESCRIPTOR' : _ALERTSTATQUERY, '__module__' : 'spaceone.api.monitoring.v1.alert_pb2' # @@protoc_insertion_point(class_scope:spaceone.api.monitoring.v1.AlertStatQuery) }) _sym_db.RegisterMessage(AlertStatQuery) _ALERT = _descriptor.ServiceDescriptor( name='Alert', full_name='spaceone.api.monitoring.v1.Alert', file=DESCRIPTOR, index=0, serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=2917, serialized_end=4867, methods=[ _descriptor.MethodDescriptor( name='create', full_name='spaceone.api.monitoring.v1.Alert.create', index=0, containing_service=None, input_type=_CREATEALERTREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\002\027\"\025/monitoring/v1/alerts', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='update', full_name='spaceone.api.monitoring.v1.Alert.update', index=1, containing_service=None, input_type=_UPDATEALERTREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\002!\032\037/monitoring/v1/alert/{alert_id}', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='update_state', full_name='spaceone.api.monitoring.v1.Alert.update_state', index=2, containing_service=None, input_type=_UPDATEALERTSTATEREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\0026\"4/monitoring/v1/alert/{alert_id}/{access_key}/{state}', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='merge', full_name='spaceone.api.monitoring.v1.Alert.merge', index=3, containing_service=None, input_type=_MERGEALERTREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\002\035\"\033/monitoring/v1/alerts/merge', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='snooze', full_name='spaceone.api.monitoring.v1.Alert.snooze', index=4, containing_service=None, input_type=_SNOOZEALERTREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\002(\"&/monitoring/v1/alert/{alert_id}/snooze', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='add_responder', full_name='spaceone.api.monitoring.v1.Alert.add_responder', index=5, containing_service=None, input_type=_ALERTRESPONDERREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\002,\"*/monitoring/v1/alert/{alert_id}/responders', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='remove_responder', full_name='spaceone.api.monitoring.v1.Alert.remove_responder', index=6, containing_service=None, input_type=_ALERTRESPONDERREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\002,**/monitoring/v1/alert/{alert_id}/responders', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='add_project_dependency', full_name='spaceone.api.monitoring.v1.Alert.add_project_dependency', index=7, containing_service=None, input_type=_ALERTPROJECTDEPENDENCYREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\0026\"4/monitoring/v1/alert/{alert_id}/project-dependencies', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='remove_project_dependency', full_name='spaceone.api.monitoring.v1.Alert.remove_project_dependency', index=8, containing_service=None, input_type=_ALERTPROJECTDEPENDENCYREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\002A*?/monitoring/v1/alert/{alert_id}/project-dependency/{project_id}', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='delete', full_name='spaceone.api.monitoring.v1.Alert.delete', index=9, containing_service=None, input_type=_ALERTREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, serialized_options=b'\202\323\344\223\002!*\037/monitoring/v1/alert/{alert_id}', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='get', full_name='spaceone.api.monitoring.v1.Alert.get', index=10, containing_service=None, input_type=_GETALERTREQUEST, output_type=_ALERTINFO, serialized_options=b'\202\323\344\223\002!\022\037/monitoring/v1/alert/{alert_id}', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='list', full_name='spaceone.api.monitoring.v1.Alert.list', index=11, containing_service=None, input_type=_ALERTQUERY, output_type=_ALERTSINFO, serialized_options=b'\202\323\344\223\0027\022\025/monitoring/v1/alertsZ\036\"\034/monitoring/v1/alerts/search', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='stat', full_name='spaceone.api.monitoring.v1.Alert.stat', index=12, containing_service=None, input_type=_ALERTSTATQUERY, output_type=google_dot_protobuf_dot_struct__pb2._STRUCT, serialized_options=b'\202\323\344\223\002\034\"\032/monitoring/v1/alerts/stat', create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_ALERT) DESCRIPTOR.services_by_name['Alert'] = _ALERT # @@protoc_insertion_point(module_scope)
50.676366
7,646
0.759086
dd67c81828221987d83cf924bc48aff8f98affa6
3,364
py
Python
fluid.py
fomightez/stable-fluids
a7bdbb0960c746022a1dfc216dbfe928ee98947b
[ "Unlicense" ]
1
2020-04-20T12:14:59.000Z
2020-04-20T12:14:59.000Z
fluid.py
fomightez/stable-fluids
a7bdbb0960c746022a1dfc216dbfe928ee98947b
[ "Unlicense" ]
null
null
null
fluid.py
fomightez/stable-fluids
a7bdbb0960c746022a1dfc216dbfe928ee98947b
[ "Unlicense" ]
null
null
null
import numpy as np import scipy.sparse as sp from scipy.ndimage import map_coordinates from scipy.sparse.linalg import factorized import operators as ops
51.753846
117
0.69352
dd69e272fd1cf6715ec8277d234fe3f1835d95b2
879
py
Python
setup.py
ngocjr7/geneticpython
4b4157523ce13b3da56cef61282cb0a984cd317b
[ "MIT" ]
null
null
null
setup.py
ngocjr7/geneticpython
4b4157523ce13b3da56cef61282cb0a984cd317b
[ "MIT" ]
null
null
null
setup.py
ngocjr7/geneticpython
4b4157523ce13b3da56cef61282cb0a984cd317b
[ "MIT" ]
null
null
null
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() PROJECT_URLS = { 'Bug Tracker': 'https://github.com/ngocjr7/geneticpython/issues', 'Documentation': 'https://github.com/ngocjr7/geneticpython/blob/master/README.md', 'Source Code': 'https://github.com/ngocjr7/geneticpython' } with open('requirements.txt') as f: install_requires = f.read().strip().split('\n') setup(name='geneticpython', description='A simple and friendly Python framework for genetic-based algorithms', author='Ngoc Bui', long_description=long_description, long_description_content_type="text/markdown", author_email='ngocjr7@gmail.com', project_urls=PROJECT_URLS, version='0.0.2', packages=find_packages(), install_requires=install_requires, python_requires='>=3.6')
33.807692
88
0.703072
dd6a3b230c4f4617de43080fbacd944fd76f81a8
182
py
Python
Script Python/Desafios/Desafio-012.py
Hubyratan/Material-Python
3f7910dd10b91cefe7b2f3f6aa49e9f9c522fd32
[ "MIT" ]
1
2020-05-11T04:05:56.000Z
2020-05-11T04:05:56.000Z
Script Python/Desafios/Desafio-012.py
Hubyratan/Material-Python
3f7910dd10b91cefe7b2f3f6aa49e9f9c522fd32
[ "MIT" ]
null
null
null
Script Python/Desafios/Desafio-012.py
Hubyratan/Material-Python
3f7910dd10b91cefe7b2f3f6aa49e9f9c522fd32
[ "MIT" ]
null
null
null
v = float(input('Valor do produto? R$')) d = float(input('Porcentagem de desconto: ')) ds = (d*v)/100 p = v-ds print(f'Voc recebeu R${ds} de desconto, e pagar somente R${p} reais')
36.4
71
0.659341
dd6c3adf785e5f57e8767ea1f8f416eff17606e6
208
py
Python
gavia/__init__.py
brett-hosking/gavia
d771235902b9a949efa92a1954d47dac8b1b527f
[ "MIT" ]
null
null
null
gavia/__init__.py
brett-hosking/gavia
d771235902b9a949efa92a1954d47dac8b1b527f
[ "MIT" ]
null
null
null
gavia/__init__.py
brett-hosking/gavia
d771235902b9a949efa92a1954d47dac8b1b527f
[ "MIT" ]
null
null
null
# Package modules from gavia import camera from gavia import vizualise from gavia import nav from gavia import gps from gavia import log from gavia import time # For nested packages from gavia import image
20.8
27
0.8125
dd6dcaf577bcfeb980245ce8c8087ba55da11a51
1,241
py
Python
pynetester/pynetester/netester.py
zoumingzhe/pynetester
256776491b65d4b5f474754e02537f28a5961888
[ "MIT" ]
null
null
null
pynetester/pynetester/netester.py
zoumingzhe/pynetester
256776491b65d4b5f474754e02537f28a5961888
[ "MIT" ]
null
null
null
pynetester/pynetester/netester.py
zoumingzhe/pynetester
256776491b65d4b5f474754e02537f28a5961888
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # coding=utf-8 # ---------------------------------------------------------------------------------------------------- import socket import os # ---------------------------------------------------------------------------------------------------- # netester # ---------------------------------------------------------------------------------------------------- # # 2021-05-17 | Zou Mingzhe | Ver0.1 | # ---------------------------------------------------------------------------------------------------- # MAP # | server(self, ...) | # ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
45.962963
102
0.2361
dd6f59dfe10afced9799503fae00bbea231ed3f2
7,121
py
Python
cmepy/solver.py
hegland/cmepy
fa8cdf2fad779badbcb629bf6ee33316724ec4a4
[ "BSD-3-Clause" ]
6
2015-05-21T04:56:26.000Z
2019-12-11T18:23:58.000Z
cmepy/solver.py
fcostin/cmepy
fa8cdf2fad779badbcb629bf6ee33316724ec4a4
[ "BSD-3-Clause" ]
1
2018-11-28T15:45:39.000Z
2019-09-18T23:25:40.000Z
cmepy/solver.py
hegland/cmepy
fa8cdf2fad779badbcb629bf6ee33316724ec4a4
[ "BSD-3-Clause" ]
3
2017-05-13T06:56:08.000Z
2021-09-01T14:20:52.000Z
""" Creates solvers for the Chemical Master Equation (CME). """ import numpy from cmepy import cme_matrix, domain, ode_solver, other_solver, state_enum from cmepy import model as mdl def create_packing_functions(domain_enum): """ create_packing_functions(domain_enum) -> (pack, unpack) where pack((p, p_sink)) -> y unpack(y) -> (p, p_sink) """ def pack((p, p_sink)): """ pack((p, p_sink)) -> y where p : mapping from states to probability p_sink : float, storing probability lost from domain due to truncation of domain states y : array passed to differential equations solver """ d_dense = domain_enum.pack_distribution(p) return numpy.concatenate((d_dense, [p_sink])) def unpack(y): """ unpack(y) -> (p, p_sink) where p : mapping from states to probability p_sink : float, storing probability lost from domain due to truncation of domain states y : array passed to differential equations solver """ p_sparse = domain_enum.unpack_distribution(y[:-1]) p_sink = y[-1] return p_sparse, p_sink return (pack, unpack) def create(model, sink, p_0=None, t_0=None, sink_0=None, time_dependencies=None, domain_states=None, solver=ode_solver.Solver, outflow=False, **solver_args): """ Returns a solver for the Chemical Master Equation of the given model. arguments: model : the CME model to solve sink : If sink is True, the solver will include a 'sink' state used to accumulate any probability that may flow outside the domain. This can be used to measure the error in the solution due to truncation of the domain. If sink is False, the solver will not include a 'sink' state, and probability will be artificially prevented from flowing outside of the domain. p_0 : (optional) mapping from states in the domain to probabilities, for the initial probability distribution. If not specified, and the initial state of the state space is given by the model, defaults to all probability concentrated at the initial state, otherwise, a ValueError will be raised. t_0 : (optional) initial time, defaults to 0.0 sink_0 : (optional) initial sink probability, defaults to 0.0 Only a valid argument if sink is set to True. time_dependencies : (optional) By default, reaction propensities are time independent. If specified, time_dependencies must be of the form { s_1 : phi_1, ..., s_n : phi_n }, where each (s_j, phi_j) item satisifes : s_j : set of reaction indices phi_j : phi_j(t) -> time dependent coefficient The propensities of the reactions with indicies contained in s_j will all be multiplied by the coefficient phi_j(t), at time t. Reactions are indexed according to the ordering of the propensities in the model. The reaction index sets s_j must be *disjoint*. It is not necessary for the union of the s_j to include all the reaction indices. If a reaction's index is not contained in any s_j then the reaction is treated as time-independent. mapping of time dependent coefficient functions keyed by subsets of reaction indices, with respect to the ordering of reactions determined by the order of the propensity functions inside the model. The propensities of the reactions with indices included in each subset are multiplied by the time dependent coefficient function. By default, no time dependent coefficient functions are specified, that is, the CME has time-independent propensities. domain_states : (optional) array of states in the domain. By default, generate the rectangular lattice of states defined by the 'shape' entry of the model. A ValueError is raised if both domain_states and 'shape' are unspecified. """ mdl.validate_model(model) if sink and outflow: raise ValueError('sink and outflow cannot be both True') if sink_0 is not None: if not sink: raise ValueError('sink_0 may not be specified if sink is False') sink_0 = float(sink_0) else: sink_0 = 0.0 # determine states in domain, then construct an enumeration of the # domain states if domain_states is None: if mdl.SHAPE not in model: lament = 'if no states given, model must contain key \'%s\'' raise KeyError(lament % mdl.SHAPE) else: domain_states = domain.from_rect(shape = model.shape) domain_enum = state_enum.create(domain_states) # determine p_0, then construct a dense representation with respect to # the domain enumeration initial_state = model.get(mdl.INITIAL_STATE, None) if p_0 is None: if initial_state is None: lament = 'if no p_0 given, model must contain key \'%s\'' raise ValueError(lament % mdl.INITIAL_STATE) else: p_0 = {initial_state : 1.0} if t_0 is None: t_0 = 0.0 member_flags = domain_enum.contains(domain.from_iter(p_0)) if not numpy.logical_and.reduce(member_flags): raise ValueError('support of p_0 is not a subset of domain_states') # compute reaction matrices and use them to define differential equations gen_matrices = cme_matrix.gen_reaction_matrices( model, domain_enum, sink, cme_matrix.non_neg_states, outflow=outflow ) reaction_matrices = list(gen_matrices) dy_dt = cme_matrix.create_diff_eqs( reaction_matrices, phi = time_dependencies ) if solver_args: solver_args['reaction_matrices'] = reaction_matrices # construct and initialise solver if sink: cme_solver = solver( dy_dt, y_0 = (p_0, sink_0), t_0 = t_0, **solver_args ) pack, unpack = create_packing_functions(domain_enum) cme_solver.set_packing( pack, unpack, transform_dy_dt = False ) else: pack = domain_enum.pack_distribution unpack = domain_enum.unpack_distribution cme_solver = solver( dy_dt, y_0 = p_0, t_0 = t_0, **solver_args ) cme_solver.set_packing( pack, unpack, transform_dy_dt = False ) return cme_solver
35.078818
79
0.602303
dd767e6d50fc90c7d830096cddd6903575b2142e
1,290
py
Python
server_common/helpers.py
GustavLero/EPICS-inst_servers
4bcdd6a80f1d9e074de3f0f7c66968d506981988
[ "BSD-3-Clause" ]
null
null
null
server_common/helpers.py
GustavLero/EPICS-inst_servers
4bcdd6a80f1d9e074de3f0f7c66968d506981988
[ "BSD-3-Clause" ]
null
null
null
server_common/helpers.py
GustavLero/EPICS-inst_servers
4bcdd6a80f1d9e074de3f0f7c66968d506981988
[ "BSD-3-Clause" ]
null
null
null
import json import os import sys from server_common.ioc_data_source import IocDataSource from server_common.mysql_abstraction_layer import SQLAbstraction from server_common.utilities import print_and_log, SEVERITY def register_ioc_start(ioc_name, pv_database=None, prefix=None): """ A helper function to register the start of an ioc. Args: ioc_name: name of the ioc to start pv_database: doctionary of pvs in the iov prefix: prefix of pvs in this ioc """ try: exepath = sys.argv[0] if pv_database is None: pv_database = {} if prefix is None: prefix = "none" ioc_data_source = IocDataSource(SQLAbstraction("iocdb", "iocdb", "$iocdb")) ioc_data_source.insert_ioc_start(ioc_name, os.getpid(), exepath, pv_database, prefix) except Exception as e: print_and_log("Error registering ioc start: {}: {}".format(e.__class__.__name__, e), SEVERITY.MAJOR) def get_macro_values(): """ Parse macro environment JSON into dict. To make this work use the icpconfigGetMacros program. Returns: Macro Key:Value pairs as dict """ macros = json.loads(os.environ.get("REFL_MACROS", "")) macros = {key: value for (key, value) in macros.items()} return macros
32.25
108
0.686047
dd782114838d338a027967eb958ee0dd0d6070b0
12,799
py
Python
rman_ui/rman_ui_txmanager.py
ian-hsieh/RenderManForBlender
c827f029f4cbbd1fcc71ed8d3694fc5ac58cc468
[ "MIT" ]
12
2019-05-03T21:58:15.000Z
2022-02-24T07:02:21.000Z
rman_ui/rman_ui_txmanager.py
ian-hsieh/RenderManForBlender
c827f029f4cbbd1fcc71ed8d3694fc5ac58cc468
[ "MIT" ]
4
2019-03-07T18:20:16.000Z
2020-09-24T21:53:15.000Z
rman_ui/rman_ui_txmanager.py
ian-hsieh/RenderManForBlender
c827f029f4cbbd1fcc71ed8d3694fc5ac58cc468
[ "MIT" ]
3
2019-05-25T01:17:09.000Z
2019-09-13T14:43:12.000Z
import bpy from bpy.props import StringProperty, IntProperty, CollectionProperty, EnumProperty, BoolProperty from bpy.types import PropertyGroup, UIList, Operator, Panel from bpy_extras.io_utils import ImportHelper from .rman_ui_base import _RManPanelHeader from ..txmanager3 import txparams from ..rman_utils import texture_utils from .. import txmanager3 as txmngr3 import os import uuid def index_updated(self, context): ''' When the index updates, make sure the texture settings are in sync with the txmanager. ''' idx = context.scene.rman_txmgr_list_index if idx < 0: return item = context.scene.rman_txmgr_list[idx] txfile = None if item.nodeID != "": txfile = texture_utils.get_txmanager().txmanager.get_txfile_from_id(item.nodeID) else: txfile = texture_utils.get_txmanager().txmanager.get_txfile_from_path(item.name) if txfile: params = txfile.params item.texture_type = params.texture_type item.smode = params.smode item.tmode = params.tmode item.texture_type = params.texture_type if params.data_type is not None: item.data_type = params.data_type item.resize = params.resize if txfile.state == txmngr3.STATE_IS_TEX: item.enable = False classes = [ TxFileItem, PRMAN_UL_Renderman_txmanager_list, PRMAN_OT_Renderman_txmanager_parse_scene, PRMAN_OT_Renderman_txmanager_pick_images, PRMAN_OT_Renderman_txmanager_clear_all_cache, PRMAN_OT_Renderman_txmanager_reconvert_all, PRMAN_OT_Renderman_txmanager_apply_preset, PRMAN_OT_Renderman_txmanager_add_texture, PRMAN_PT_Renderman_txmanager_list ]
32.734015
110
0.615595
dd788c7b5bde6a0a3088e641302680a262892fc0
943
py
Python
cousins-in-binary-tree/cousins-in-binary-tree.py
hyeseonko/LeetCode
48dfc93f1638e13041d8ce1420517a886abbdc77
[ "MIT" ]
2
2021-12-05T14:29:06.000Z
2022-01-01T05:46:13.000Z
cousins-in-binary-tree/cousins-in-binary-tree.py
hyeseonko/LeetCode
48dfc93f1638e13041d8ce1420517a886abbdc77
[ "MIT" ]
null
null
null
cousins-in-binary-tree/cousins-in-binary-tree.py
hyeseonko/LeetCode
48dfc93f1638e13041d8ce1420517a886abbdc77
[ "MIT" ]
null
null
null
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right
36.269231
74
0.520679
dd793146f92f3801277eeab8ef75d59d722ca146
5,581
py
Python
rdmo/questions/tests/test_validator_locked_questions.py
berkerY/rdmo
c0500f9b6caff9106a254a05e0d0e8018fc8db28
[ "Apache-2.0" ]
77
2016-08-09T11:40:20.000Z
2022-03-06T11:03:26.000Z
rdmo/questions/tests/test_validator_locked_questions.py
MSpenger/rdmo
c0500f9b6caff9106a254a05e0d0e8018fc8db28
[ "Apache-2.0" ]
377
2016-07-01T13:59:36.000Z
2022-03-30T13:53:19.000Z
rdmo/questions/tests/test_validator_locked_questions.py
MSpenger/rdmo
c0500f9b6caff9106a254a05e0d0e8018fc8db28
[ "Apache-2.0" ]
47
2016-06-23T11:32:19.000Z
2022-03-01T11:34:37.000Z
import pytest from django.core.exceptions import ValidationError from rest_framework.exceptions import \ ValidationError as RestFameworkValidationError from ..models import Question, QuestionSet from ..serializers.v1 import QuestionSerializer from ..validators import QuestionLockedValidator
25.600917
64
0.689124
dd79ddb1ceb718cc4031b1942143fae9a88b3147
80,373
py
Python
samtranslator/model/sam_resources.py
aaythapa/serverless-application-model
1029548db5787845d1a321d7c182aeb3716933ba
[ "Apache-2.0" ]
null
null
null
samtranslator/model/sam_resources.py
aaythapa/serverless-application-model
1029548db5787845d1a321d7c182aeb3716933ba
[ "Apache-2.0" ]
null
null
null
samtranslator/model/sam_resources.py
aaythapa/serverless-application-model
1029548db5787845d1a321d7c182aeb3716933ba
[ "Apache-2.0" ]
null
null
null
""" SAM macro definitions """ from six import string_types import copy import uuid import samtranslator.model.eventsources import samtranslator.model.eventsources.pull import samtranslator.model.eventsources.push import samtranslator.model.eventsources.cloudwatchlogs from .api.api_generator import ApiGenerator from .api.http_api_generator import HttpApiGenerator from .packagetype import ZIP, IMAGE from .s3_utils.uri_parser import construct_s3_location_object, construct_image_code_object from .tags.resource_tagging import get_tag_list from samtranslator.model import PropertyType, SamResourceMacro, ResourceTypeResolver from samtranslator.model.apigateway import ( ApiGatewayDeployment, ApiGatewayStage, ApiGatewayDomainName, ApiGatewayUsagePlan, ApiGatewayUsagePlanKey, ApiGatewayApiKey, ) from samtranslator.model.apigatewayv2 import ApiGatewayV2Stage, ApiGatewayV2DomainName from samtranslator.model.cloudformation import NestedStack from samtranslator.model.s3 import S3Bucket from samtranslator.model.cloudwatch import SyntheticsCanary, CloudWatchAlarm from samtranslator.model.dynamodb import DynamoDBTable from samtranslator.model.exceptions import InvalidEventException, InvalidResourceException from samtranslator.model.resource_policies import ResourcePolicies, PolicyTypes from samtranslator.model.iam import IAMRole, IAMRolePolicies from samtranslator.model.lambda_ import ( LambdaFunction, LambdaVersion, LambdaAlias, LambdaLayerVersion, LambdaEventInvokeConfig, ) from samtranslator.model.types import dict_of, is_str, is_type, list_of, one_of, any_type from samtranslator.translator import logical_id_generator from samtranslator.translator.arn_generator import ArnGenerator from samtranslator.model.intrinsics import ( is_intrinsic_if, is_intrinsic_no_value, ref, make_not_conditional, make_conditional, make_and_condition, ) from samtranslator.model.sqs import SQSQueue from samtranslator.model.sns import SNSTopic from samtranslator.model.stepfunctions import StateMachineGenerator from samtranslator.model.role_utils import construct_role_for_resource from samtranslator.model.xray_utils import get_xray_managed_policy_name # len(prefix) + MAX_CANARY_LOGICAL_ID_LENGTH + MAX_CANARY_UNIQUE_ID_LENGTH + 1 (extra '-' char added) must be less # than or equal to 21 # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-name MAX_CANARY_LOGICAL_ID_LENGTH = 11 MAX_CANARY_UNIQUE_ID_LENGTH = 5 CANARY_NAME_PREFIX = "sam-" # The default values for ComparisonOperator, Threshold and Period based on the MetricName provided by the user # These default values were acquired from the Create Canary page in the Synthetics Canary dashboard # https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_metrics.html DEFAULT_METRIC_VALUES = { "SuccessPercent": {"ComparisonOperator": "LessThanThreshold", "Threshold": 90, "Period": 300}, "Failed": {"ComparisonOperator": "GreaterThanOrEqualToThreshold", "Threshold": 1, "Period": 300}, "Duration": {"ComparisonOperator": "GreaterThanThreshold", "Threshold": 30000, "Period": 900}, } # the main metrics produced by Synthetics Canary # sorted for backwards compatibility (python 2.7 automatically sorts keys) VALID_CANARY_METRICS = list(sorted(DEFAULT_METRIC_VALUES))
47.333922
205
0.674617
dd7bb92f20393f9e12f7115e84f70223584f154d
928
py
Python
media_logs/urls/audios.py
Akshayvm98/Django-School
723d52db2cd3bc7665680a3adaf8687f97836d48
[ "MIT" ]
26
2015-08-04T00:13:27.000Z
2021-03-19T01:01:14.000Z
media_logs/urls/audios.py
Akshayvm98/Django-School
723d52db2cd3bc7665680a3adaf8687f97836d48
[ "MIT" ]
null
null
null
media_logs/urls/audios.py
Akshayvm98/Django-School
723d52db2cd3bc7665680a3adaf8687f97836d48
[ "MIT" ]
28
2015-01-19T15:10:15.000Z
2020-10-27T11:22:21.000Z
from django.conf.urls.defaults import * from media_logs.models import * audio_list = { 'queryset': Audio.objects.all(), } audio_set_list = { 'queryset': AudioSet.objects.all(), } urlpatterns = patterns('', url( regex = '^sets/(?P<slug>[-\w]+)/$', view = 'django.views.generic.list_detail.object_detail', kwargs = audio_set_list, name = 'audio_set_detail', ), url ( regex = '^sets/$', view = 'django.views.generic.list_detail.object_list', kwargs = audio_set_list, name = 'audio_set_list', ), url( regex = '^(?P<user>[-\w]+)/(?P<slug>[-\w]+)/$', #regex = '^(?P<slug>[-\w]+)/$', view = 'views.generic.list_detail.object_detail', kwargs = audio_list, name = 'audio_detail', ), url ( regex = '^$', view = 'django.views.generic.list_detail.object_list', kwargs = audio_list, name = 'audio_list', ), )
23.2
63
0.574353
dd7d61b4fcf318d454a05f755e0919c0dd18ea88
2,964
py
Python
pycalc/MAVProxy/modules/mavproxy_gopro.py
joakimzhang/python-electron
79bc174a14c5286ca739bb7d8ce6522fdc6e9e80
[ "CC0-1.0" ]
null
null
null
pycalc/MAVProxy/modules/mavproxy_gopro.py
joakimzhang/python-electron
79bc174a14c5286ca739bb7d8ce6522fdc6e9e80
[ "CC0-1.0" ]
8
2021-01-28T19:26:22.000Z
2022-03-24T18:07:24.000Z
pycalc/MAVProxy/modules/mavproxy_gopro.py
joakimzhang/python-electron
79bc174a14c5286ca739bb7d8ce6522fdc6e9e80
[ "CC0-1.0" ]
null
null
null
#!/usr/bin/env python '''gopro control over mavlink for the solo-gimbal To use this module connect to a Solo with a GoPro installed on the gimbal. ''' import time, os from MAVProxy.modules.lib import mp_module from pymavlink import mavutil def init(mpstate): '''initialise module''' return GoProModule(mpstate)
34.068966
83
0.5361