hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
146e90ad11eb2b874d711f0b54e24b4f0a853f4c | 1,937 | py | Python | rthl_site/migrations/0007_auto_20210131_2323.py | Mauzzz0/Django_demo | b58f088beb98aa4103797e7ff330151dee431ff6 | [
"MIT"
] | null | null | null | rthl_site/migrations/0007_auto_20210131_2323.py | Mauzzz0/Django_demo | b58f088beb98aa4103797e7ff330151dee431ff6 | [
"MIT"
] | null | null | null | rthl_site/migrations/0007_auto_20210131_2323.py | Mauzzz0/Django_demo | b58f088beb98aa4103797e7ff330151dee431ff6 | [
"MIT"
] | 1 | 2021-02-22T17:29:33.000Z | 2021-02-22T17:29:33.000Z | # Generated by Django 3.1.4 on 2021-01-31 20:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rthl_site', '0006_auto_20210131_2321'),
]
operations = [
migrations.AlterField(
model_name='player',
name='birth_date',
field=models.DateField(verbose_name='Дата рождения'),
),
migrations.AlterField(
model_name='player',
name='disqualified_games_count',
field=models.PositiveSmallIntegerField(verbose_name='Кол-во дисквал игр.'),
),
migrations.AlterField(
model_name='player',
name='games_count',
field=models.PositiveSmallIntegerField(verbose_name='Кол-во игр'),
),
migrations.AlterField(
model_name='player',
name='goals_count',
field=models.PositiveSmallIntegerField(verbose_name='Кол-во голов'),
),
migrations.AlterField(
model_name='player',
name='grip',
field=models.CharField(choices=[('Л', 'Левый'), ('П', 'Правый')], max_length=6, verbose_name='Хват'),
),
migrations.AlterField(
model_name='player',
name='growth',
field=models.PositiveSmallIntegerField(verbose_name='Рост'),
),
migrations.AlterField(
model_name='player',
name='passes_count',
field=models.PositiveSmallIntegerField(verbose_name='Кол-во передач'),
),
migrations.AlterField(
model_name='player',
name='penalties_count',
field=models.PositiveSmallIntegerField(verbose_name='Кол-во штрафов'),
),
migrations.AlterField(
model_name='player',
name='weight',
field=models.PositiveSmallIntegerField(verbose_name='Вес'),
),
]
| 32.830508 | 113 | 0.580795 | 174 | 1,937 | 6.293103 | 0.385057 | 0.164384 | 0.205479 | 0.238356 | 0.681279 | 0.595434 | 0.346119 | 0.269406 | 0.113242 | 0 | 0 | 0.023564 | 0.298916 | 1,937 | 58 | 114 | 33.396552 | 0.782769 | 0.023232 | 0 | 0.519231 | 1 | 0 | 0.153968 | 0.024868 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.019231 | 0.019231 | 0 | 0.076923 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
14b32a1eed0250f051ee75539f3a80b3a23b6b0e | 101 | py | Python | python/rpdk/go/__init__.py | parsnips/cloudformation-cli-go-plugin | f7249d18d5feaa31e50b0bd108528510b4d72f6e | [
"Apache-2.0"
] | 40 | 2019-12-05T19:53:09.000Z | 2022-03-28T23:30:17.000Z | python/rpdk/go/__init__.py | parsnips/cloudformation-cli-go-plugin | f7249d18d5feaa31e50b0bd108528510b4d72f6e | [
"Apache-2.0"
] | 71 | 2019-12-01T19:59:49.000Z | 2022-03-04T21:21:33.000Z | python/rpdk/go/__init__.py | parsnips/cloudformation-cli-go-plugin | f7249d18d5feaa31e50b0bd108528510b4d72f6e | [
"Apache-2.0"
] | 30 | 2019-11-27T23:39:00.000Z | 2021-10-30T03:23:12.000Z | import logging
__version__ = "2.0.4"
logging.getLogger(__name__).addHandler(logging.NullHandler())
| 16.833333 | 61 | 0.782178 | 12 | 101 | 5.916667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032258 | 0.079208 | 101 | 5 | 62 | 20.2 | 0.731183 | 0 | 0 | 0 | 0 | 0 | 0.049505 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
14b4bec34f6a2787d83d15ab9e7e9bfaaa07effc | 2,265 | py | Python | client_app/python-cpp/setup.py | yaseenit/debs19_grand_challenge- | 54ae55516c8735db3708efbe717fa2068c0400af | [
"MIT"
] | null | null | null | client_app/python-cpp/setup.py | yaseenit/debs19_grand_challenge- | 54ae55516c8735db3708efbe717fa2068c0400af | [
"MIT"
] | null | null | null | client_app/python-cpp/setup.py | yaseenit/debs19_grand_challenge- | 54ae55516c8735db3708efbe717fa2068c0400af | [
"MIT"
] | null | null | null |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
ext = Extension('my_pcl', sources=["my_pcl.pyx"], language="c++", extra_compile_args=['-std=c++11','-fopenmp','-lpcl_common','-lpcl_features','-lpcl_filters','-lpcl_io','-lpcl_kdtree','-lpcl_keypoints','-lpcl_octree','-lpcl_registration','-lpcl_sample_consensus ','-lpcl_search','-lpcl_segmentation','-lpcl_surface','-lboost_system'],include_dirs=['/usr/include/',
'/usr/include/pcl-1.7/','/usr/include/hdf5/serial/','/usr/include/eigen3/',
'/usr/include/vtk-6.2/','/usr/include/pcl-1.7/pcl/surface/'],extra_link_args=['-lgomp','/usr/local/lib/libpcl_common.so',
'/usr/local/lib/libpcl_features.so',
'/usr/local/lib/libpcl_filters.so',
'/usr/local/lib/libpcl_io.so',
'/usr/local/lib/libpcl_io_ply.so',
'/usr/local/lib/libpcl_kdtree.so',
'/usr/local/lib/libpcl_keypoints.so',
'/usr/local/lib/libpcl_octree.so',
'/usr/local/lib/libpcl_outofcore.so',
'/usr/local/lib/libpcl_people.so',
'/usr/local/lib/libpcl_recognition.so',
'/usr/local/lib/libpcl_registration.so',
'/usr/local/lib/libpcl_sample_consensus.so',
'/usr/local/lib/libpcl_search.so',
'/usr/local/lib/libpcl_segmentation.so',
'/usr/local/lib/libpcl_surface.so',
'/usr/local/lib/libpcl_tracking.so',
'/usr/local/lib/libpcl_visualization.so',
'/usr/lib/x86_64-linux-gnu/libboost_thread.so',
'/usr/lib/x86_64-linux-gnu/libpthread.so',
'/usr/lib/x86_64-linux-gnu/libboost_filesystem.so',
'/usr/lib/x86_64-linux-gnu/libboost_iostreams.so',
'/usr/lib/x86_64-linux-gnu/libboost_system.so',
'/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so',
'/usr/lib/x86_64-linux-gnu/libvtkalglib-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkDICOMParser-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkexoIIc-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkftgl-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkmetaio-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtksys-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkverdict-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkCommonCore-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkCommonMisc-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkCommonColor-6.2.so',
'/usr/lib/x86_64-linux-gnu/libvtkCommonMath-6.2.so',
'/usr/local/lib/librestbed.a'])
setup(name="my_pcl", ext_modules = cythonize([ext]))
| 43.557692 | 364 | 0.742605 | 378 | 2,265 | 4.280423 | 0.227513 | 0.108158 | 0.129172 | 0.189122 | 0.473424 | 0.278739 | 0.252781 | 0.213844 | 0.142151 | 0 | 0 | 0.046661 | 0.034879 | 2,265 | 51 | 365 | 44.411765 | 0.693504 | 0 | 0 | 0 | 0 | 0 | 0.786537 | 0.678477 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.071429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1ae62b320282899d12b2404d6383b1a6fa6f5d3d | 431 | py | Python | docs/project.py | boswellgathu/pybald | a3578f8a5220ce51627b151a2a98b5a59732e63e | [
"BSD-3-Clause"
] | 7 | 2015-10-09T15:45:04.000Z | 2019-03-11T15:54:19.000Z | docs/project.py | boswellgathu/pybald | a3578f8a5220ce51627b151a2a98b5a59732e63e | [
"BSD-3-Clause"
] | 7 | 2015-12-02T20:13:11.000Z | 2018-09-25T16:09:38.000Z | docs/project.py | boswellgathu/pybald | a3578f8a5220ce51627b151a2a98b5a59732e63e | [
"BSD-3-Clause"
] | 3 | 2015-09-19T13:19:59.000Z | 2019-08-22T16:52:18.000Z | import sys
package_name = "pybald.project_template"
class ConfigWrapper(object):
def __init__(self, wrapped):
self.wrapped = wrapped
def __getattr__(self, name):
# Some sensible default?
return getattr(self.wrapped, name, None)
def __dir__(self):
return dir(self.wrapped)
controllers_module = '.'
database_engine_args = {}
sys.modules[__name__] = ConfigWrapper(sys.modules[__name__])
| 25.352941 | 60 | 0.698376 | 49 | 431 | 5.632653 | 0.55102 | 0.15942 | 0.101449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.194896 | 431 | 16 | 61 | 26.9375 | 0.795389 | 0.051044 | 0 | 0 | 0 | 0 | 0.058968 | 0.056511 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.083333 | 0.166667 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
1ae8c0394465f34f26dbab62205debcc14d74a81 | 74 | py | Python | src/awsstepfuncs/types.py | suzil/awsstepfuncs | dd195b54bf8eaa381ea07244b276db6a1e82007b | [
"MIT"
] | 3 | 2020-11-29T18:31:50.000Z | 2021-01-14T07:46:40.000Z | src/awsstepfuncs/types.py | suzil/aws-step-functions | dd195b54bf8eaa381ea07244b276db6a1e82007b | [
"MIT"
] | 54 | 2020-10-17T13:30:05.000Z | 2020-10-28T01:46:59.000Z | src/awsstepfuncs/types.py | suzil/aws-step-functions | dd195b54bf8eaa381ea07244b276db6a1e82007b | [
"MIT"
] | 1 | 2021-08-04T04:40:27.000Z | 2021-08-04T04:40:27.000Z | from typing import Callable, Dict
ResourceToMockFn = Dict[str, Callable]
| 18.5 | 38 | 0.797297 | 9 | 74 | 6.555556 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135135 | 74 | 3 | 39 | 24.666667 | 0.921875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
211596d7e4d226d3094eced440a0a3383fe104ab | 94 | py | Python | hdhp/__init__.py | kekoawong/hdhp.py | ce97a5a1ac59aa3bbdf2c2978b2338a035e12b3d | [
"0BSD"
] | 35 | 2016-10-27T16:37:47.000Z | 2022-03-18T07:55:00.000Z | hdhp/__init__.py | kekoawong/hdhp.py | ce97a5a1ac59aa3bbdf2c2978b2338a035e12b3d | [
"0BSD"
] | 2 | 2018-04-18T16:30:32.000Z | 2020-07-07T10:07:03.000Z | hdhp/__init__.py | kekoawong/hdhp.py | ce97a5a1ac59aa3bbdf2c2978b2338a035e12b3d | [
"0BSD"
] | 14 | 2017-05-06T08:44:01.000Z | 2021-04-28T08:20:32.000Z | from generative_model import HDHProcess
from smc import Particle, infer
__all__ = ['utils']
| 15.666667 | 39 | 0.787234 | 12 | 94 | 5.75 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148936 | 94 | 5 | 40 | 18.8 | 0.8625 | 0 | 0 | 0 | 0 | 0 | 0.053191 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
21243cb750bb8d2e56fe9b48ff062ac6b0ed109d | 141 | py | Python | tests/examples/malformed_skipto.py | jbn/modpipe | 06e182704d4582ab41ce92f5ae1a908874bf60e2 | [
"MIT"
] | 4 | 2018-11-18T23:03:59.000Z | 2021-06-11T19:50:55.000Z | tests/examples/malformed_skipto.py | jbn/modpipe | 06e182704d4582ab41ce92f5ae1a908874bf60e2 | [
"MIT"
] | 8 | 2018-06-13T23:38:52.000Z | 2018-06-15T22:51:05.000Z | tests/examples/malformed_skipto.py | jbn/modpipe | 06e182704d4582ab41ce92f5ae1a908874bf60e2 | [
"MIT"
] | null | null | null | from modpipe import SkipTo
def f(x):
return x + 1
def g(x):
# This is before in the linearized pipeline!
return SkipTo(f, x)
| 12.818182 | 48 | 0.638298 | 24 | 141 | 3.75 | 0.708333 | 0.044444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009804 | 0.276596 | 141 | 10 | 49 | 14.1 | 0.872549 | 0.297872 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 0.4 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
213abda2c46b13f63855ef3c6fb04f483a21c814 | 6,122 | py | Python | tests/unit_tests/vwf_and_transformations_tests/test_spherical_functions.py | parkerwray/smuthi-1 | a5ced07461b8fd223dc37d28259261ceed78aed5 | [
"MIT"
] | null | null | null | tests/unit_tests/vwf_and_transformations_tests/test_spherical_functions.py | parkerwray/smuthi-1 | a5ced07461b8fd223dc37d28259261ceed78aed5 | [
"MIT"
] | null | null | null | tests/unit_tests/vwf_and_transformations_tests/test_spherical_functions.py | parkerwray/smuthi-1 | a5ced07461b8fd223dc37d28259261ceed78aed5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test spherical_functions"""
import smuthi.utility.math
import numpy as np
from sympy.physics.quantum.spin import Rotation
def test_wignerd():
l_test = 5
m_test = -3
m_prime_test = 4
beta_test = 0.64
wigd = smuthi.utility.math.wigner_d(l_test, m_test, m_prime_test, beta_test, wdsympy=False)
wigd_sympy = complex(Rotation.d(l_test, m_test, m_prime_test, beta_test).doit()).real
err = abs((wigd - wigd_sympy) / wigd)
assert err < 1e-10
def test_Plm_against_prototype():
lmax = 3
omega = 2 * 3.14 / 550
kp = omega * np.array([0.01, 0.2, 0.7, 0.99, 1.2, 2 - 0.5j])
kz = np.sqrt(omega ** 2 - kp ** 2 + 0j)
kz[kz.imag < 0] = -kz[kz.imag < 0]
ct = kz / omega
st = kp / omega
plm, pilm, taulm = smuthi.utility.math.legendre_normalized(ct, st, lmax)
# P_3^0
np.testing.assert_almost_equal(plm[3][0][0], 1.870267465826245)
np.testing.assert_almost_equal(plm[3][0][1], 1.649727250184103)
np.testing.assert_almost_equal(plm[3][0][2], -0.300608757357466)
np.testing.assert_almost_equal(plm[3][0][3], -0.382739631607606)
np.testing.assert_almost_equal(plm[3][0][4], - 3.226515147957620j)
np.testing.assert_almost_equal(plm[3][0][5], -25.338383323084539 - 22.141864985871653j)
# P_2^1
np.testing.assert_almost_equal(plm[2][1][0], 0.019363948460993)
np.testing.assert_almost_equal(plm[2][1][1], 0.379473319220206)
np.testing.assert_almost_equal(plm[2][1][2], 0.968052168015753)
np.testing.assert_almost_equal(plm[2][1][3], 0.270444009917026)
np.testing.assert_almost_equal(plm[2][1][4], 1.541427909439815j)
np.testing.assert_almost_equal(plm[2][1][5], 3.906499971729346 + 6.239600710712296j)
# pi_2^1
np.testing.assert_almost_equal(pilm[2][1][0], 1.936394846099318)
np.testing.assert_almost_equal(pilm[2][1][1], 1.897366596101028)
np.testing.assert_almost_equal(pilm[2][1][2], 1.382931668593933)
np.testing.assert_almost_equal(pilm[2][1][3], 0.273175767592955)
np.testing.assert_almost_equal(pilm[2][1][4], 1.284523257866512j)
np.testing.assert_almost_equal(pilm[2][1][5], 1.104282256024128 + 3.395870919362181j)
# tau_3^2
np.testing.assert_almost_equal(taulm[3][2][0], 0.051227068616724)
np.testing.assert_almost_equal(taulm[3][2][1], 0.963213372000203)
np.testing.assert_almost_equal(taulm[3][2][2], 0.950404683542753)
np.testing.assert_almost_equal(taulm[3][2][3], -2.384713931794872)
np.testing.assert_almost_equal(taulm[3][2][4], -7.131877733107878)
np.testing.assert_almost_equal(taulm[3][2][5], -39.706934218093430 + 42.588889121019569j)
def test_jn_against_prototype():
n = 4
z = np.array([0.01, 2, 5, 2+0.1j, 3-0.2j, 20+20j])
jnz = smuthi.utility.math.spherical_bessel(n, z)
np.testing.assert_almost_equal(jnz[0], 1.058196248205502e-11)
np.testing.assert_almost_equal(jnz[1], 0.014079392762915)
np.testing.assert_almost_equal(jnz[2], 0.187017655344890)
np.testing.assert_almost_equal(jnz[3], 0.013925330885893 + 0.002550081632129j)
np.testing.assert_almost_equal(jnz[4], 0.055554281414152 - 0.011718427699962j)
np.testing.assert_almost_equal(jnz[5], 5.430299683226971e+06 - 3.884383001639664e+06j)
def test_hn_against_prototype():
n = 4
z = np.array([0.01, 2, 5, 2+0.1j, 3-0.2j, 20+20j])
hnz = smuthi.utility.math.spherical_hankel(n, z)
# np.testing.assert_almost_equal(hnz[0], 9.562028025173189e-05 - 1.050007500037500e+12j) this test fails - protype incorrect?
np.testing.assert_almost_equal(hnz[1], 0.014079392762917 - 4.461291526363127j)
np.testing.assert_almost_equal(hnz[2], 0.187017655344889 - 0.186615531479296j)
np.testing.assert_almost_equal(hnz[3], -0.937540374646528 - 4.322684701489512j)
np.testing.assert_almost_equal(hnz[4], 0.254757423766403 - 0.894658828739464j)
np.testing.assert_almost_equal(hnz[5], 5.349924210583894e-11 - 7.680177127921456e-11j)
def test_dxxj_against_prototype():
n = 4
z = np.array([0.01, 2, 5, 2+0.1j, 3-0.2j, 20+20j])
dxxj = smuthi.utility.math.dx_xj(n, z)
np.testing.assert_almost_equal(dxxj[0], 5.290971621054867e-11)
np.testing.assert_almost_equal(dxxj[1], 0.065126624274088)
np.testing.assert_almost_equal(dxxj[2], 0.401032469441925)
np.testing.assert_almost_equal(dxxj[3], 0.064527362367182 + 0.011261758715092j)
np.testing.assert_almost_equal(dxxj[4], 0.230875079050277 - 0.041423344864749j)
np.testing.assert_almost_equal(dxxj[5], 3.329872586039824e+07 - 1.858505295737451e+08j)
def test_dxxh_against_prototype():
n = 4
z = np.array([0.01, 2, 5, 2+0.1j, 3-0.2j, 20+20j])
dxxh = smuthi.utility.math.dx_xh(n, z)
#np.testing.assert_almost_equal(dxxh[0], -3.824801872151283e-04 + 4.200015000000000e+12j)
np.testing.assert_almost_equal(dxxh[1], 0.065126624274084 +14.876432990566345j)
np.testing.assert_almost_equal(dxxh[2], 0.401032469441923 + 0.669247576352214j)
np.testing.assert_almost_equal(dxxh[3], 3.574345443512018 +14.372976166070977j)
np.testing.assert_almost_equal(dxxh[4], -0.423459406818455 + 1.976243655979050j)
np.testing.assert_almost_equal(dxxh[5], 4.344741738782320e-10 + 2.612636745427169e-09j)
def test_dxxj_against_j():
n = 3
eps = 1e-8
z0 = 0.5
z = np.array([z0, z0 + eps, z0 - eps])
jn = smuthi.utility.math.spherical_bessel(n, z)
dxxj = smuthi.utility.math.dx_xj(n, z)
d1 = dxxj[0]
d2 = ((z0 + eps) * jn[1] - (z0 - eps) * jn[2]) / 2 / eps
np.testing.assert_almost_equal(d1, d2)
def test_dxxh_against_h():
n = 3
eps = 1e-10
z0 = 0.5
z = np.array([z0, z0 + eps, z0 - eps])
hn = smuthi.utility.math.spherical_hankel(n, z)
dxxh = smuthi.utility.math.dx_xh(n, z)
d1 = dxxh[0]
d2 = ((z0 + eps) * hn[1] - (z0 - eps) * hn[2]) / 2 / eps
assert (d1 - d2) / d1 < 1e-5
if __name__ == '__main__':
test_wignerd()
test_dxxh_against_h()
test_dxxh_against_prototype()
test_dxxj_against_j()
test_dxxj_against_prototype()
test_hn_against_prototype()
test_jn_against_prototype()
test_Plm_against_prototype()
| 42.513889 | 129 | 0.700425 | 966 | 6,122 | 4.250518 | 0.196687 | 0.107404 | 0.179006 | 0.250609 | 0.494398 | 0.488066 | 0.33999 | 0.280565 | 0.06868 | 0.06868 | 0 | 0.268531 | 0.147174 | 6,122 | 143 | 130 | 42.811189 | 0.517908 | 0.046717 | 0 | 0.160714 | 0 | 0 | 0.001374 | 0 | 0 | 0 | 0 | 0 | 0.4375 | 1 | 0.071429 | false | 0 | 0.026786 | 0 | 0.098214 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
214b19dbec888b7c0a458c05dff90d4089b70507 | 243 | py | Python | python/checkIfExist.py | caleberi/LeetCode | fa170244648f73e76d316a6d7fc0e813adccaa82 | [
"MIT"
] | 1 | 2021-08-10T20:00:24.000Z | 2021-08-10T20:00:24.000Z | python/checkIfExist.py | caleberi/LeetCode | fa170244648f73e76d316a6d7fc0e813adccaa82 | [
"MIT"
] | null | null | null | python/checkIfExist.py | caleberi/LeetCode | fa170244648f73e76d316a6d7fc0e813adccaa82 | [
"MIT"
] | 3 | 2021-06-11T11:56:39.000Z | 2021-08-10T08:50:49.000Z | class Solution:
def checkIfExist(self, arr: List[int]) -> bool:
for i in range(len(arr)):
for j in range(len(arr)):
if i != j and arr[i] == 2*arr[j]:
return True
return False
| 30.375 | 51 | 0.481481 | 34 | 243 | 3.441176 | 0.617647 | 0.119658 | 0.17094 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006803 | 0.395062 | 243 | 7 | 52 | 34.714286 | 0.789116 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
21557f4ab49c340295f8af339545048f3dc93903 | 222 | py | Python | Python3-Learn/even_odd_mayankgoyal.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 65 | 2021-10-01T07:02:29.000Z | 2022-03-23T10:41:37.000Z | Python3-Learn/even_odd_mayankgoyal.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 82 | 2021-10-01T14:21:42.000Z | 2022-03-29T03:43:58.000Z | Python3-Learn/even_odd_mayankgoyal.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 210 | 2021-10-01T07:02:39.000Z | 2022-03-27T17:41:00.000Z | """
Name : Even odd
Author : [Mayank Goyal) [https://github.com/mayankgoyal-13]
"""
num = int(input("Enter your number: "))
if num % 2 == 0:
print('The given number is even')
else:
print('The given number is odd')
| 22.2 | 59 | 0.635135 | 34 | 222 | 4.147059 | 0.735294 | 0.113475 | 0.184397 | 0.269504 | 0.297872 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022222 | 0.189189 | 222 | 9 | 60 | 24.666667 | 0.761111 | 0.337838 | 0 | 0 | 0 | 0 | 0.47482 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
215b515a25031cb3ce38e2489d72dc8ffd052640 | 592 | py | Python | angrytux/controller/Commands/CannonAngleUpCommand.py | Wilson194/Angry-tux | 62b7457948675071fe328b69ba5d85aab6b39ed1 | [
"CC0-1.0"
] | null | null | null | angrytux/controller/Commands/CannonAngleUpCommand.py | Wilson194/Angry-tux | 62b7457948675071fe328b69ba5d85aab6b39ed1 | [
"CC0-1.0"
] | 1 | 2019-02-05T04:50:27.000Z | 2019-02-05T04:50:27.000Z | angrytux/controller/Commands/CannonAngleUpCommand.py | Wilson194/Angry-tux | 62b7457948675071fe328b69ba5d85aab6b39ed1 | [
"CC0-1.0"
] | null | null | null | from angrytux.controller.Commands.Command import Command
from angrytux.proxy.Proxy import Proxy
class CannonAngleUpCommand(Command):
"""
Command for rise cannon shooting angle
"""
@property
def create_memento(self) -> bool:
return False
def __init__(self, proxy: Proxy) -> None:
super().__init__()
self.__proxy = proxy
def undo(self) -> None:
self.__proxy.angle_cannon(-5)
def execute(self) -> None:
self.__proxy.angle_cannon(5)
def __repr__(self) -> str:
return '<Command> Cannon angle move up'
| 19.096774 | 56 | 0.640203 | 69 | 592 | 5.188406 | 0.463768 | 0.100559 | 0.072626 | 0.100559 | 0.178771 | 0.178771 | 0.178771 | 0.178771 | 0 | 0 | 0 | 0.004535 | 0.255068 | 592 | 30 | 57 | 19.733333 | 0.807256 | 0.064189 | 0 | 0 | 0 | 0 | 0.055762 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.133333 | 0.133333 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
dcc5255ad56c5419c0493384230216e4ca78c59b | 116 | py | Python | ex/14.py | StopITnowFAST/7lab | 8619e2a6f830d410377c5c0865ea74e30b711168 | [
"MIT"
] | null | null | null | ex/14.py | StopITnowFAST/7lab | 8619e2a6f830d410377c5c0865ea74e30b711168 | [
"MIT"
] | null | null | null | ex/14.py | StopITnowFAST/7lab | 8619e2a6f830d410377c5c0865ea74e30b711168 | [
"MIT"
] | null | null | null | my_list = ['один', 'два', 'три', 'четыре', 'пять']
list_2 = ['шесть', 'семь']
my_list.extend(list_2)
print(my_list)
| 23.2 | 50 | 0.62931 | 19 | 116 | 3.578947 | 0.631579 | 0.264706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019417 | 0.112069 | 116 | 4 | 51 | 29 | 0.640777 | 0 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0d0dbaf304347ae8f5ce75bc0a3b39180ab29c59 | 211 | py | Python | sm2/tsa/tests/test_adfuller_lag.py | jbrockmendel/sm2 | c02a3f9a4fcba35ffc8c852ca5ad8b9d7620f4cf | [
"BSD-3-Clause"
] | 1 | 2021-08-02T13:48:59.000Z | 2021-08-02T13:48:59.000Z | sm2/tsa/tests/test_adfuller_lag.py | jbrockmendel/sm2 | c02a3f9a4fcba35ffc8c852ca5ad8b9d7620f4cf | [
"BSD-3-Clause"
] | 24 | 2018-03-26T00:44:58.000Z | 2018-10-09T17:06:07.000Z | sm2/tsa/tests/test_adfuller_lag.py | jbrockmendel/sm2 | c02a3f9a4fcba35ffc8c852ca5ad8b9d7620f4cf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test for autolag of adfuller, unitroot_adf
Created on Wed May 30 21:39:46 2012
Author: Josef Perktold
"""
# The only test from this file has been moved to test_unit_root (2018-05-04)
| 26.375 | 76 | 0.71564 | 38 | 211 | 3.894737 | 0.947368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 0.170616 | 211 | 7 | 77 | 30.142857 | 0.725714 | 0.947867 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0d2d848244890945c166df16485f3915ec710f22 | 10,412 | py | Python | tools/small_rna_pipelines/small_rna_pipeline_wangw.py | bopopescu/galaxy-pipelines | 109059d32a0a176a42f9d8949e72802677b8133d | [
"CC-BY-3.0"
] | null | null | null | tools/small_rna_pipelines/small_rna_pipeline_wangw.py | bopopescu/galaxy-pipelines | 109059d32a0a176a42f9d8949e72802677b8133d | [
"CC-BY-3.0"
] | null | null | null | tools/small_rna_pipelines/small_rna_pipeline_wangw.py | bopopescu/galaxy-pipelines | 109059d32a0a176a42f9d8949e72802677b8133d | [
"CC-BY-3.0"
] | 1 | 2020-07-25T21:10:26.000Z | 2020-07-25T21:10:26.000Z | #!/usr/bin/env python
# The Galaxy server calls this Python script and this Python script will use
# the parameters from the Galaxy server to a) generate a parameter file,
# b) generate a workflow_file, and c) constitute the command to run the the
# workflow. For example,
#
# this script will generate a parameter file that looks like this:
#
# TODO: Finish this part
#
# and will run a command that looks like this:
#
# python runWorkflow.py -w wf_hanb.txt -i default.txt -o /some/output/dir/in/the/cluster -d biocore -u tester
# Author: Yu Fu (yfu@yfu.me)
import optparse
# Consider use argparse instead. argparse is only available in Python 2.7
# or newer.
from optparse import OptionParser
from subprocess import call
import re
import os
import sys
import random
index_location = "/share/zzpipeline/pipeline/bowtie/indexes"
def main():
# print sys.argv
usage = """usage: python %prog [options] arg
The Galaxy server calls this Python script and this Python script will use the parameters from the Galaxy server to a) generate a parameter file for the workflow and b) constitute the command to run the the workflow.
Please email yfu@yfu.me for bugs or questions."""
parser = OptionParser(usage=usage, version="%prog 0.1")
parser.add_option("-i", "--input", action="store", type="string",
dest="input",
help="Inserts file")
# -o is no longer useful as the result will be under
parser.add_option("-o", "--output-dir", action="store", type="string",
dest="output",
help="Output directory")
parser.add_option("-a", "--adaptor", action="store", type="string",
dest="adaptor", help="Adaptor sequence")
parser.add_option("-s", "--min", action="store", type="string",
dest="min", help="Minimum length of inserts")
parser.add_option("-l", "--max", action="store", type="string",
dest="max", help="Maximum length of inserts")
parser.add_option("-m", "--mm", "--mismatch", action="store",
type="string", dest="mm", help="Mismatches allowed")
parser.add_option("-f", "--female", dest="female", action="store",
help="FEMALE sample")
parser.add_option("-e", "--email", action="store",
type="string", dest="email", help="Email address to be notified")
parser.add_option("--location", action="store",
dest="location",
help="The location specified by the galaxy service. This script will create the corresponding parameter file and workflow file under that directory")
parser.add_option("-u", "--user-email", action="store", dest="user_email",
help="Get the user's email address from the galaxy service")
# The following options are on longer useful
# parser.add_option("-w", "--workflow-file", action="store", type="string",
# dest="workflow_file",
# help="Specify where to store the workflow file. This should be passed from the Galaxy server to this script")
# parser.add_option("-p", "--parameter-file", action="store",
# dest="parameter_file", help="The location for the parameter file of the workflow (specified by Galaxy server)")
(options, args) = parser.parse_args()
print "Options from Galaxy server:"
print options
print
input_file = options.input
# output_dir = options.output
adaptor = options.adaptor
minimum = options.min
maximum = options.max
mm = options.mm
female = options.female
email = options.email
location = options.location
user_email = options.user_email
# print input_file, output_dir, species, cpu, config, default_param_file
pat = re.compile(r"(.*)@")
m = pat.match(user_email)
username = ""
try:
username = m.group(1)
except:
sys.stderr.write("Wrong username!")
exit(1)
basename = os.path.basename(location)
dirname = os.path.dirname(location)
f_o = open(location, "w")
parameter_file = os.path.join(dirname, basename + ".param")
workflow_file = os.path.join(dirname, basename + ".workflow")
f_p = open(parameter_file, "w")
f_w = open(workflow_file, "w")
# Maybe use the default parameter file on the server side
# For now, I will just write all the parameters on the client side
print >> f_p, "@BASH=/bin/bash"
print >> f_p, "@PERL=/share/bin/perl"
print >> f_p, "@PYTHON=/share/bin/python"
# print >> f_p, "@INPUT_FILE=" + input_file
# Note that later in the script, I created a symlink for the original file
input_file_basename = os.path.basename(input_file)
# This is not a platform-neutral solution.
# I do not expect this to run in Windows, though.
unified = "/isilon_temp/weng/fuy2/public/output"
id = str(random.randrange(1, 1000000000))
loc = unified + "/" + username + "_" + id
msg = "You can find your result via the following url:\n" + \
"http://biocore.umassmed.edu/genome/smallRNA/" + username + "_" + id \
+ "\n\n" + "Otherwise, you can find the results on the cluster here:\n" \
+ loc
print >> f_o, msg
print >> f_p, "@INPUT_FILE=" + loc + "/" + input_file_basename
print >> f_p, "@OUTPUT_DIR=" + loc
print >> f_p, "@ADAPTOR=" + adaptor
print >> f_p, "@MINIMUM=" + minimum
print >> f_p, "@MAXIMUM=" + maximum
print >> f_p, "@MM=" + mm
print >> f_p, "@EMAIL=" + email
if female == 't':
print >> f_p, "@FEMALE=" + 'Y'
else:
print >> f_p, "@FEMALE=" + 'N'
# This indicates the real bash script to run. runWorkflow.py just submits
# the one-line workflow.
# I may probably move the pipeline to my isilon_temp space. For now
# I just use the one under Zhiping's directory
# print >> f_p, "@PIPELINEDIR=/isilon_temp/weng/fuy2/public/Hanb/small_RNA_pipeline"
print >> f_p, "@PIPELINEDIR=/home/wengz/pipelines/smallRNApipeline/pipeline_dm"
workflow_command = ["@BASH", "@PIPELINEDIR/zpipe_TAS_new.sh",
"@INPUT_FILE", "@ADAPTOR", "@MINIMUM", "@MAXIMUM", "@MM", "@FEMALE", "@EMAIL", "I_am_a_boring_job_id", index_location]
ld_library_path = """/home/hanb/software/Development/seqan-trunk/extras/include:/home/hanb/lib64:/home/hanb/include:/home/hanb/lib:/share/bin/gcc/lib64:/share/bin/gcc/lib:/share/bin/mpfr/lib:/share/bin/gmp/lib:/home/wangw1/src/libgtextutils-0.6/lib:/lib:/usr/lib:/usr/local/lib:/opt/SUNWhpc/HPC8.1/gnu/lib/lib64:/share/bin/gcc/lib64:/share/bin/gcc/lib:/share/bin/intel/fc/10.1.015/lib:/share/bin/intel/fc/10.1.015/licenses:/share/bin/intel/cc/10.1.015/lib:/share/bin/mpfr/lib:/share/bin/gmp/lib:/share/lib:""" # This is Wei's LD_LIBRARY_PATH
path = """/home/wangw1/src/jdk1.6.0_37/bin:/home/wangw1/bin/python2.7:/home/wangw1/src/bwa-0.7.5a:/home/wangw1/perl5/bin:/share/bin/gcc/bin:/share/bin:/opt/SUNWhpc/HPC8.1/gnu/bin/:/share/bin/intel/bin/intel64:/share/bin/gmp/include:/share/bin/mpfr/include:/sge/bin/lx24-amd64:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin::/home/wangw1/bin::/home/wangw1/localperl/bin::/home/wangw1/src/pcre-8.31::/home/wangw1/src/R-2.15.3::/home/wangw1/src/ucsc_tools:/home/wangw1/bin/samtools::/home/wangw1/src/libgtextutils-0.6/:/home/wangw1/src/libgtextutils-0.6/include/gtextutils/gtextutils::/home/wangw1/src/libgtextutils-0.6/bin::/home/wengz/pipelines/smallRNApipeline/pipeline_dm/:/home/wengz/pipelines/smallRNApipeline/transposon_bucket/::/home/wengz/pipelines/smallRNApipeline/bin::/home/wangw1/src/bowtie-0.12.9:/home/wangw1/src/bowtie2-2.1.0::/home/wangw1/src/circos-0.56:/home/wangw1/src/circos-0.56/bin::/home/wangw1/src/trinityrnaseq_r2013-02-25::/home/wangw1/src/trinityrnaseq_r2013-02-25/trinity-plugins/jellyfish-1.1.6/bin:/home/wangw1/src/trinityrnaseq_r2013-02-25/trinity-plugins/parafly:/home/wangw1/src/bedtools-2.17.0/bin/bedtools:/home/wangw1/src/bedtools-2.17.0/bin::/home/wangw1/src/msort::/home/wangw1/src/HTSeq-0.5.4p2::/home/wangw1/src/trinityrnaseq_r2013-02-25/trinity-plugins/rsem:/home/wangw1/src/STAR_2.3.0e::/home/wangw1/src/tophat-2.0.9.Linux_x86_64::/home/wangw1/src/cufflinks-2.1.1.Linux_x86_64::/home/wangw1/src/numpy-1.6.1::/home/wangw1/src/weblogo-3.2::/home/hanb/bin:/home/hanb/include:/home/hanb/lib::/home/wangj2/bin::/share/bin/gcc/bin:/share/bin:/opt/SUNWhpc/HPC8.1/gnu/bin/:/share/bin/intel/bin/intel64:/share/bin/gmp/include:/share/bin/mpfr/include:/sge/bin/lx24-amd64:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin::/home/wangw1/src/sratoolkit.2.1.10-centos_linux64/bin:""" # This is Wei's PATH
# print default_param_file
# The pipeline itself should have the capability to output the results to
# any dir......
print >> f_w, "CreateOutputDir" + "\t" + "mkdir -p " + loc + "/output" + "\t" + "1"
print >> f_w, "Symlink" + "\t" + "ln -fs " + input_file + " " + loc + "/" + input_file_basename + "\t" + "1"
print >> f_w, "Final" + "\t" + "export PATH=$PATH:" + path + "&& export LD_LIBRARY_PATH=" + ld_library_path + "&&" + " " . join(workflow_command) + "\t" + "1"
f_o.close()
f_p.close()
f_w.close()
# TODO: Change this when migrated to the server
# client = "/isilon_temp/garber/bin/runWorkflow.py"
client = "/isilon_temp/weng/fuy2/public/runWorkflow.py"
# The following makes sure that a runWorkflow.py file is available
try:
open(client)
except IOError:
client = "/home/fuy2/galaxy_pipeline/runWorkflow.py"
print "The client (runWorkflow.py) that I use:"
print client
print
# The workflow file is generated on the fly
command = ["python", client, "-w", workflow_file, "-d", "galaxyweb", "-i", parameter_file]
print "I will run the following command to call runWorkflow.py"
print command
# Prepare for the environment variables.
# The following should have been integrated into Wei's pipeline.
my_env = os.environ.copy()
print my_env
my_env["PATH"] = path
try:
my_env["LD_LIBRARY_PATH"] = ld_library_path + my_env["LD_LIBRARY_PATH"]
except:
my_env["LD_LIBRARY_PATH"] = ld_library_path
call(command, env=my_env)
print "Done!"
if __name__ == "__main__":
main()
| 49.113208 | 1,831 | 0.658183 | 1,515 | 10,412 | 4.429703 | 0.244224 | 0.047683 | 0.052302 | 0.025034 | 0.303681 | 0.248547 | 0.166592 | 0.166592 | 0.125764 | 0.095962 | 0 | 0.025605 | 0.189781 | 10,412 | 211 | 1,832 | 49.345972 | 0.769915 | 0.22426 | 0 | 0.058333 | 1 | 0.033333 | 0.519741 | 0.321086 | 0.008333 | 0 | 0 | 0.004739 | 0 | 0 | null | null | 0 | 0.058333 | null | null | 0.225 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0d2f54a0bd4c0aa4a40ac54c2f4a8c1ef5876264 | 172 | py | Python | flask_rest_multiformat_api/exceptions.py | Aimage/flask_rest_multiformat_api | 4101ce47c0fd338d533892782831b0be766a5803 | [
"MIT"
] | null | null | null | flask_rest_multiformat_api/exceptions.py | Aimage/flask_rest_multiformat_api | 4101ce47c0fd338d533892782831b0be766a5803 | [
"MIT"
] | null | null | null | flask_rest_multiformat_api/exceptions.py | Aimage/flask_rest_multiformat_api | 4101ce47c0fd338d533892782831b0be766a5803 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class ApiException(Exception):
errors = []
def __init__(self, errors, code):
self.errors = errors
self.code = code
| 14.333333 | 37 | 0.552326 | 18 | 172 | 5.055556 | 0.611111 | 0.21978 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008403 | 0.30814 | 172 | 11 | 38 | 15.636364 | 0.756303 | 0.122093 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
0d4acfd4d17804b9cb62b4f4c95d2c9229091f0e | 294 | py | Python | src/road_surface_detection/__init__.py | knu2xs/road-surface-detection | 02e0c5ba05fb666275507da6c368f940d0a9bd78 | [
"Apache-2.0"
] | 1 | 2020-12-11T05:44:57.000Z | 2020-12-11T05:44:57.000Z | src/road_surface_detection/__init__.py | knu2xs/road-surface-detection | 02e0c5ba05fb666275507da6c368f940d0a9bd78 | [
"Apache-2.0"
] | null | null | null | src/road_surface_detection/__init__.py | knu2xs/road-surface-detection | 02e0c5ba05fb666275507da6c368f940d0a9bd78 | [
"Apache-2.0"
] | null | null | null | __title__ = 'road-surface-detection'
__version__ = '0.0.0'
__author__ = 'Esri Advanced Analytics Team'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2020 by Esri Advanced Analytics Team'
# add specific imports below if you want more control over what is visible
## from . import utils
| 32.666667 | 74 | 0.765306 | 41 | 294 | 5 | 0.804878 | 0.019512 | 0.204878 | 0.243902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036145 | 0.153061 | 294 | 8 | 75 | 36.75 | 0.787149 | 0.312925 | 0 | 0 | 0 | 0 | 0.560606 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0d4dcd5270a7620e132321e7d1b7073860f8ef95 | 1,213 | py | Python | dynn/activations.py | pmichel31415/dynet-nn | 7e780c4dcf928cdff5f2e52210409d2775ca7796 | [
"MIT"
] | 1 | 2019-09-04T13:19:47.000Z | 2019-09-04T13:19:47.000Z | dynn/activations.py | pmichel31415/dynn | 7e780c4dcf928cdff5f2e52210409d2775ca7796 | [
"MIT"
] | null | null | null | dynn/activations.py | pmichel31415/dynn | 7e780c4dcf928cdff5f2e52210409d2775ca7796 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Activation functions
====================
Common activation functions for neural networks.
Most of those are wrappers around standard dynet operations
(eg. ``rectify`` -> ``relu``)
"""
import dynet as dy
def identity(x):
"""The identity function
:math:`y=x`
Args:
x (:py:class:`dynet.Expression`): Input expression
Returns:
:py:class:`dynet.Expression`: :math:`x`
"""
return x
def tanh(x):
"""The hyperbolic tangent function
:math:`y=\\tanh(x)`
Args:
x (:py:class:`dynet.Expression`): Input expression
Returns:
:py:class:`dynet.Expression`: :math:`\\tanh(x)`
"""
return dy.tanh(x)
def sigmoid(x):
"""The sigmoid function
:math:`y=\\frac{1}{1+e^{-x}}`
Args:
x (:py:class:`dynet.Expression`): Input expression
Returns:
:py:class:`dynet.Expression`: :math:`\\frac{1}{1+e^{-x}}`
"""
return dy.logistic(x)
def relu(x):
"""The REctified Linear Unit
:math:`y=\max(0,x)`
Args:
x (:py:class:`dynet.Expression`): Input expression
Returns:
:py:class:`dynet.Expression`: :math:`\max(0,x)`
"""
return dy.rectify(x)
| 17.328571 | 65 | 0.571311 | 154 | 1,213 | 4.5 | 0.337662 | 0.080808 | 0.138528 | 0.253968 | 0.460317 | 0.438672 | 0.438672 | 0.438672 | 0.438672 | 0.438672 | 0 | 0.007535 | 0.23413 | 1,213 | 69 | 66 | 17.57971 | 0.738428 | 0.729596 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.444444 | false | 0 | 0.111111 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
0d53e8bf8432e606537b0c8d54bc538b8c54d378 | 171 | py | Python | PopPUNK/__init__.py | Danderson123/PopPUNK | 90e558cd3c3ad30531db48c06134f309edff882d | [
"Apache-2.0"
] | null | null | null | PopPUNK/__init__.py | Danderson123/PopPUNK | 90e558cd3c3ad30531db48c06134f309edff882d | [
"Apache-2.0"
] | null | null | null | PopPUNK/__init__.py | Danderson123/PopPUNK | 90e558cd3c3ad30531db48c06134f309edff882d | [
"Apache-2.0"
] | null | null | null | # vim: set fileencoding=<utf-8> :
# Copyright 2018-2020 John Lees and Nick Croucher
'''PopPUNK (POPulation Partitioning Using Nucleotide Kmers)'''
__version__ = '2.2.1'
| 24.428571 | 62 | 0.730994 | 23 | 171 | 5.26087 | 0.956522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.081633 | 0.140351 | 171 | 6 | 63 | 28.5 | 0.741497 | 0.80117 | 0 | 0 | 0 | 0 | 0.185185 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0d563143d299dd9a30671e5cafc10d5150712216 | 122,179 | py | Python | grpc/clients/python/vegaapiclient/generated/api/trading_pb2_grpc.py | ConnorChristie/api | 7e585d47bad1a5ef95ca932045b0ce70962b029a | [
"MIT"
] | null | null | null | grpc/clients/python/vegaapiclient/generated/api/trading_pb2_grpc.py | ConnorChristie/api | 7e585d47bad1a5ef95ca932045b0ce70962b029a | [
"MIT"
] | null | null | null | grpc/clients/python/vegaapiclient/generated/api/trading_pb2_grpc.py | ConnorChristie/api | 7e585d47bad1a5ef95ca932045b0ce70962b029a | [
"MIT"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from . import trading_pb2 as api_dot_trading__pb2
class TradingServiceStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.PrepareSubmitOrder = channel.unary_unary(
'/api.v1.TradingService/PrepareSubmitOrder',
request_serializer=api_dot_trading__pb2.PrepareSubmitOrderRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PrepareSubmitOrderResponse.FromString,
)
self.PrepareCancelOrder = channel.unary_unary(
'/api.v1.TradingService/PrepareCancelOrder',
request_serializer=api_dot_trading__pb2.PrepareCancelOrderRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PrepareCancelOrderResponse.FromString,
)
self.PrepareAmendOrder = channel.unary_unary(
'/api.v1.TradingService/PrepareAmendOrder',
request_serializer=api_dot_trading__pb2.PrepareAmendOrderRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PrepareAmendOrderResponse.FromString,
)
self.PrepareWithdraw = channel.unary_unary(
'/api.v1.TradingService/PrepareWithdraw',
request_serializer=api_dot_trading__pb2.PrepareWithdrawRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PrepareWithdrawResponse.FromString,
)
self.SubmitTransaction = channel.unary_unary(
'/api.v1.TradingService/SubmitTransaction',
request_serializer=api_dot_trading__pb2.SubmitTransactionRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.SubmitTransactionResponse.FromString,
)
self.PrepareProposalSubmission = channel.unary_unary(
'/api.v1.TradingService/PrepareProposalSubmission',
request_serializer=api_dot_trading__pb2.PrepareProposalSubmissionRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PrepareProposalSubmissionResponse.FromString,
)
self.PrepareVoteSubmission = channel.unary_unary(
'/api.v1.TradingService/PrepareVoteSubmission',
request_serializer=api_dot_trading__pb2.PrepareVoteSubmissionRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PrepareVoteSubmissionResponse.FromString,
)
self.PropagateChainEvent = channel.unary_unary(
'/api.v1.TradingService/PropagateChainEvent',
request_serializer=api_dot_trading__pb2.PropagateChainEventRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PropagateChainEventResponse.FromString,
)
self.PrepareLiquidityProvision = channel.unary_unary(
'/api.v1.TradingService/PrepareLiquidityProvision',
request_serializer=api_dot_trading__pb2.PrepareLiquidityProvisionRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PrepareLiquidityProvisionResponse.FromString,
)
class TradingServiceServicer(object):
"""Missing associated documentation comment in .proto file."""
def PrepareSubmitOrder(self, request, context):
"""Prepare a submit order request
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PrepareCancelOrder(self, request, context):
"""Prepare a cancel order request
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PrepareAmendOrder(self, request, context):
"""Prepare an amend order request
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PrepareWithdraw(self, request, context):
"""Request a withdrawal
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SubmitTransaction(self, request, context):
"""Submit a signed transaction
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PrepareProposalSubmission(self, request, context):
"""Prepare a governance proposal
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PrepareVoteSubmission(self, request, context):
"""Prepare a governance vote
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PropagateChainEvent(self, request, context):
"""Propagate a chain event
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PrepareLiquidityProvision(self, request, context):
"""Prepare a liquidity provision request
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_TradingServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'PrepareSubmitOrder': grpc.unary_unary_rpc_method_handler(
servicer.PrepareSubmitOrder,
request_deserializer=api_dot_trading__pb2.PrepareSubmitOrderRequest.FromString,
response_serializer=api_dot_trading__pb2.PrepareSubmitOrderResponse.SerializeToString,
),
'PrepareCancelOrder': grpc.unary_unary_rpc_method_handler(
servicer.PrepareCancelOrder,
request_deserializer=api_dot_trading__pb2.PrepareCancelOrderRequest.FromString,
response_serializer=api_dot_trading__pb2.PrepareCancelOrderResponse.SerializeToString,
),
'PrepareAmendOrder': grpc.unary_unary_rpc_method_handler(
servicer.PrepareAmendOrder,
request_deserializer=api_dot_trading__pb2.PrepareAmendOrderRequest.FromString,
response_serializer=api_dot_trading__pb2.PrepareAmendOrderResponse.SerializeToString,
),
'PrepareWithdraw': grpc.unary_unary_rpc_method_handler(
servicer.PrepareWithdraw,
request_deserializer=api_dot_trading__pb2.PrepareWithdrawRequest.FromString,
response_serializer=api_dot_trading__pb2.PrepareWithdrawResponse.SerializeToString,
),
'SubmitTransaction': grpc.unary_unary_rpc_method_handler(
servicer.SubmitTransaction,
request_deserializer=api_dot_trading__pb2.SubmitTransactionRequest.FromString,
response_serializer=api_dot_trading__pb2.SubmitTransactionResponse.SerializeToString,
),
'PrepareProposalSubmission': grpc.unary_unary_rpc_method_handler(
servicer.PrepareProposalSubmission,
request_deserializer=api_dot_trading__pb2.PrepareProposalSubmissionRequest.FromString,
response_serializer=api_dot_trading__pb2.PrepareProposalSubmissionResponse.SerializeToString,
),
'PrepareVoteSubmission': grpc.unary_unary_rpc_method_handler(
servicer.PrepareVoteSubmission,
request_deserializer=api_dot_trading__pb2.PrepareVoteSubmissionRequest.FromString,
response_serializer=api_dot_trading__pb2.PrepareVoteSubmissionResponse.SerializeToString,
),
'PropagateChainEvent': grpc.unary_unary_rpc_method_handler(
servicer.PropagateChainEvent,
request_deserializer=api_dot_trading__pb2.PropagateChainEventRequest.FromString,
response_serializer=api_dot_trading__pb2.PropagateChainEventResponse.SerializeToString,
),
'PrepareLiquidityProvision': grpc.unary_unary_rpc_method_handler(
servicer.PrepareLiquidityProvision,
request_deserializer=api_dot_trading__pb2.PrepareLiquidityProvisionRequest.FromString,
response_serializer=api_dot_trading__pb2.PrepareLiquidityProvisionResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'api.v1.TradingService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class TradingService(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
def PrepareSubmitOrder(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/PrepareSubmitOrder',
api_dot_trading__pb2.PrepareSubmitOrderRequest.SerializeToString,
api_dot_trading__pb2.PrepareSubmitOrderResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PrepareCancelOrder(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/PrepareCancelOrder',
api_dot_trading__pb2.PrepareCancelOrderRequest.SerializeToString,
api_dot_trading__pb2.PrepareCancelOrderResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PrepareAmendOrder(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/PrepareAmendOrder',
api_dot_trading__pb2.PrepareAmendOrderRequest.SerializeToString,
api_dot_trading__pb2.PrepareAmendOrderResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PrepareWithdraw(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/PrepareWithdraw',
api_dot_trading__pb2.PrepareWithdrawRequest.SerializeToString,
api_dot_trading__pb2.PrepareWithdrawResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def SubmitTransaction(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/SubmitTransaction',
api_dot_trading__pb2.SubmitTransactionRequest.SerializeToString,
api_dot_trading__pb2.SubmitTransactionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PrepareProposalSubmission(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/PrepareProposalSubmission',
api_dot_trading__pb2.PrepareProposalSubmissionRequest.SerializeToString,
api_dot_trading__pb2.PrepareProposalSubmissionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PrepareVoteSubmission(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/PrepareVoteSubmission',
api_dot_trading__pb2.PrepareVoteSubmissionRequest.SerializeToString,
api_dot_trading__pb2.PrepareVoteSubmissionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PropagateChainEvent(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/PropagateChainEvent',
api_dot_trading__pb2.PropagateChainEventRequest.SerializeToString,
api_dot_trading__pb2.PropagateChainEventResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PrepareLiquidityProvision(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingService/PrepareLiquidityProvision',
api_dot_trading__pb2.PrepareLiquidityProvisionRequest.SerializeToString,
api_dot_trading__pb2.PrepareLiquidityProvisionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
class TradingDataServiceStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.MarketAccounts = channel.unary_unary(
'/api.v1.TradingDataService/MarketAccounts',
request_serializer=api_dot_trading__pb2.MarketAccountsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketAccountsResponse.FromString,
)
self.PartyAccounts = channel.unary_unary(
'/api.v1.TradingDataService/PartyAccounts',
request_serializer=api_dot_trading__pb2.PartyAccountsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PartyAccountsResponse.FromString,
)
self.FeeInfrastructureAccounts = channel.unary_unary(
'/api.v1.TradingDataService/FeeInfrastructureAccounts',
request_serializer=api_dot_trading__pb2.FeeInfrastructureAccountsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.FeeInfrastructureAccountsResponse.FromString,
)
self.Candles = channel.unary_unary(
'/api.v1.TradingDataService/Candles',
request_serializer=api_dot_trading__pb2.CandlesRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.CandlesResponse.FromString,
)
self.MarketDataByID = channel.unary_unary(
'/api.v1.TradingDataService/MarketDataByID',
request_serializer=api_dot_trading__pb2.MarketDataByIDRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketDataByIDResponse.FromString,
)
self.MarketsData = channel.unary_unary(
'/api.v1.TradingDataService/MarketsData',
request_serializer=api_dot_trading__pb2.MarketsDataRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketsDataResponse.FromString,
)
self.MarketByID = channel.unary_unary(
'/api.v1.TradingDataService/MarketByID',
request_serializer=api_dot_trading__pb2.MarketByIDRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketByIDResponse.FromString,
)
self.MarketDepth = channel.unary_unary(
'/api.v1.TradingDataService/MarketDepth',
request_serializer=api_dot_trading__pb2.MarketDepthRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketDepthResponse.FromString,
)
self.Markets = channel.unary_unary(
'/api.v1.TradingDataService/Markets',
request_serializer=api_dot_trading__pb2.MarketsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketsResponse.FromString,
)
self.OrderByMarketAndID = channel.unary_unary(
'/api.v1.TradingDataService/OrderByMarketAndID',
request_serializer=api_dot_trading__pb2.OrderByMarketAndIDRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OrderByMarketAndIDResponse.FromString,
)
self.OrderByReference = channel.unary_unary(
'/api.v1.TradingDataService/OrderByReference',
request_serializer=api_dot_trading__pb2.OrderByReferenceRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OrderByReferenceResponse.FromString,
)
self.OrdersByMarket = channel.unary_unary(
'/api.v1.TradingDataService/OrdersByMarket',
request_serializer=api_dot_trading__pb2.OrdersByMarketRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OrdersByMarketResponse.FromString,
)
self.OrdersByParty = channel.unary_unary(
'/api.v1.TradingDataService/OrdersByParty',
request_serializer=api_dot_trading__pb2.OrdersByPartyRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OrdersByPartyResponse.FromString,
)
self.OrderByID = channel.unary_unary(
'/api.v1.TradingDataService/OrderByID',
request_serializer=api_dot_trading__pb2.OrderByIDRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OrderByIDResponse.FromString,
)
self.OrderVersionsByID = channel.unary_unary(
'/api.v1.TradingDataService/OrderVersionsByID',
request_serializer=api_dot_trading__pb2.OrderVersionsByIDRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OrderVersionsByIDResponse.FromString,
)
self.MarginLevels = channel.unary_unary(
'/api.v1.TradingDataService/MarginLevels',
request_serializer=api_dot_trading__pb2.MarginLevelsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarginLevelsResponse.FromString,
)
self.Parties = channel.unary_unary(
'/api.v1.TradingDataService/Parties',
request_serializer=api_dot_trading__pb2.PartiesRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PartiesResponse.FromString,
)
self.PartyByID = channel.unary_unary(
'/api.v1.TradingDataService/PartyByID',
request_serializer=api_dot_trading__pb2.PartyByIDRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PartyByIDResponse.FromString,
)
self.PositionsByParty = channel.unary_unary(
'/api.v1.TradingDataService/PositionsByParty',
request_serializer=api_dot_trading__pb2.PositionsByPartyRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PositionsByPartyResponse.FromString,
)
self.LastTrade = channel.unary_unary(
'/api.v1.TradingDataService/LastTrade',
request_serializer=api_dot_trading__pb2.LastTradeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.LastTradeResponse.FromString,
)
self.TradesByMarket = channel.unary_unary(
'/api.v1.TradingDataService/TradesByMarket',
request_serializer=api_dot_trading__pb2.TradesByMarketRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.TradesByMarketResponse.FromString,
)
self.TradesByOrder = channel.unary_unary(
'/api.v1.TradingDataService/TradesByOrder',
request_serializer=api_dot_trading__pb2.TradesByOrderRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.TradesByOrderResponse.FromString,
)
self.TradesByParty = channel.unary_unary(
'/api.v1.TradingDataService/TradesByParty',
request_serializer=api_dot_trading__pb2.TradesByPartyRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.TradesByPartyResponse.FromString,
)
self.GetProposals = channel.unary_unary(
'/api.v1.TradingDataService/GetProposals',
request_serializer=api_dot_trading__pb2.GetProposalsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetProposalsResponse.FromString,
)
self.GetProposalsByParty = channel.unary_unary(
'/api.v1.TradingDataService/GetProposalsByParty',
request_serializer=api_dot_trading__pb2.GetProposalsByPartyRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetProposalsByPartyResponse.FromString,
)
self.GetVotesByParty = channel.unary_unary(
'/api.v1.TradingDataService/GetVotesByParty',
request_serializer=api_dot_trading__pb2.GetVotesByPartyRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetVotesByPartyResponse.FromString,
)
self.GetNewMarketProposals = channel.unary_unary(
'/api.v1.TradingDataService/GetNewMarketProposals',
request_serializer=api_dot_trading__pb2.GetNewMarketProposalsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetNewMarketProposalsResponse.FromString,
)
self.GetUpdateMarketProposals = channel.unary_unary(
'/api.v1.TradingDataService/GetUpdateMarketProposals',
request_serializer=api_dot_trading__pb2.GetUpdateMarketProposalsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetUpdateMarketProposalsResponse.FromString,
)
self.GetNetworkParametersProposals = channel.unary_unary(
'/api.v1.TradingDataService/GetNetworkParametersProposals',
request_serializer=api_dot_trading__pb2.GetNetworkParametersProposalsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetNetworkParametersProposalsResponse.FromString,
)
self.GetNewAssetProposals = channel.unary_unary(
'/api.v1.TradingDataService/GetNewAssetProposals',
request_serializer=api_dot_trading__pb2.GetNewAssetProposalsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetNewAssetProposalsResponse.FromString,
)
self.GetProposalByID = channel.unary_unary(
'/api.v1.TradingDataService/GetProposalByID',
request_serializer=api_dot_trading__pb2.GetProposalByIDRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetProposalByIDResponse.FromString,
)
self.GetProposalByReference = channel.unary_unary(
'/api.v1.TradingDataService/GetProposalByReference',
request_serializer=api_dot_trading__pb2.GetProposalByReferenceRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetProposalByReferenceResponse.FromString,
)
self.ObserveGovernance = channel.unary_stream(
'/api.v1.TradingDataService/ObserveGovernance',
request_serializer=api_dot_trading__pb2.ObserveGovernanceRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.ObserveGovernanceResponse.FromString,
)
self.ObservePartyProposals = channel.unary_stream(
'/api.v1.TradingDataService/ObservePartyProposals',
request_serializer=api_dot_trading__pb2.ObservePartyProposalsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.ObservePartyProposalsResponse.FromString,
)
self.ObservePartyVotes = channel.unary_stream(
'/api.v1.TradingDataService/ObservePartyVotes',
request_serializer=api_dot_trading__pb2.ObservePartyVotesRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.ObservePartyVotesResponse.FromString,
)
self.ObserveProposalVotes = channel.unary_stream(
'/api.v1.TradingDataService/ObserveProposalVotes',
request_serializer=api_dot_trading__pb2.ObserveProposalVotesRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.ObserveProposalVotesResponse.FromString,
)
self.ObserveEventBus = channel.stream_stream(
'/api.v1.TradingDataService/ObserveEventBus',
request_serializer=api_dot_trading__pb2.ObserveEventBusRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.ObserveEventBusResponse.FromString,
)
self.Statistics = channel.unary_unary(
'/api.v1.TradingDataService/Statistics',
request_serializer=api_dot_trading__pb2.StatisticsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.StatisticsResponse.FromString,
)
self.GetVegaTime = channel.unary_unary(
'/api.v1.TradingDataService/GetVegaTime',
request_serializer=api_dot_trading__pb2.GetVegaTimeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetVegaTimeResponse.FromString,
)
self.AccountsSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/AccountsSubscribe',
request_serializer=api_dot_trading__pb2.AccountsSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.AccountsSubscribeResponse.FromString,
)
self.CandlesSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/CandlesSubscribe',
request_serializer=api_dot_trading__pb2.CandlesSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.CandlesSubscribeResponse.FromString,
)
self.MarginLevelsSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/MarginLevelsSubscribe',
request_serializer=api_dot_trading__pb2.MarginLevelsSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarginLevelsSubscribeResponse.FromString,
)
self.MarketDepthSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/MarketDepthSubscribe',
request_serializer=api_dot_trading__pb2.MarketDepthSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketDepthSubscribeResponse.FromString,
)
self.MarketDepthUpdatesSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/MarketDepthUpdatesSubscribe',
request_serializer=api_dot_trading__pb2.MarketDepthUpdatesSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketDepthUpdatesSubscribeResponse.FromString,
)
self.MarketsDataSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/MarketsDataSubscribe',
request_serializer=api_dot_trading__pb2.MarketsDataSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.MarketsDataSubscribeResponse.FromString,
)
self.OrdersSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/OrdersSubscribe',
request_serializer=api_dot_trading__pb2.OrdersSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OrdersSubscribeResponse.FromString,
)
self.PositionsSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/PositionsSubscribe',
request_serializer=api_dot_trading__pb2.PositionsSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.PositionsSubscribeResponse.FromString,
)
self.TradesSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/TradesSubscribe',
request_serializer=api_dot_trading__pb2.TradesSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.TradesSubscribeResponse.FromString,
)
self.TransferResponsesSubscribe = channel.unary_stream(
'/api.v1.TradingDataService/TransferResponsesSubscribe',
request_serializer=api_dot_trading__pb2.TransferResponsesSubscribeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.TransferResponsesSubscribeResponse.FromString,
)
self.GetNodeSignaturesAggregate = channel.unary_unary(
'/api.v1.TradingDataService/GetNodeSignaturesAggregate',
request_serializer=api_dot_trading__pb2.GetNodeSignaturesAggregateRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.GetNodeSignaturesAggregateResponse.FromString,
)
self.AssetByID = channel.unary_unary(
'/api.v1.TradingDataService/AssetByID',
request_serializer=api_dot_trading__pb2.AssetByIDRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.AssetByIDResponse.FromString,
)
self.Assets = channel.unary_unary(
'/api.v1.TradingDataService/Assets',
request_serializer=api_dot_trading__pb2.AssetsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.AssetsResponse.FromString,
)
self.EstimateFee = channel.unary_unary(
'/api.v1.TradingDataService/EstimateFee',
request_serializer=api_dot_trading__pb2.EstimateFeeRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.EstimateFeeResponse.FromString,
)
self.EstimateMargin = channel.unary_unary(
'/api.v1.TradingDataService/EstimateMargin',
request_serializer=api_dot_trading__pb2.EstimateMarginRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.EstimateMarginResponse.FromString,
)
self.ERC20WithdrawalApproval = channel.unary_unary(
'/api.v1.TradingDataService/ERC20WithdrawalApproval',
request_serializer=api_dot_trading__pb2.ERC20WithdrawalApprovalRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.ERC20WithdrawalApprovalResponse.FromString,
)
self.Withdrawal = channel.unary_unary(
'/api.v1.TradingDataService/Withdrawal',
request_serializer=api_dot_trading__pb2.WithdrawalRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.WithdrawalResponse.FromString,
)
self.Withdrawals = channel.unary_unary(
'/api.v1.TradingDataService/Withdrawals',
request_serializer=api_dot_trading__pb2.WithdrawalsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.WithdrawalsResponse.FromString,
)
self.Deposit = channel.unary_unary(
'/api.v1.TradingDataService/Deposit',
request_serializer=api_dot_trading__pb2.DepositRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.DepositResponse.FromString,
)
self.Deposits = channel.unary_unary(
'/api.v1.TradingDataService/Deposits',
request_serializer=api_dot_trading__pb2.DepositsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.DepositsResponse.FromString,
)
self.NetworkParameters = channel.unary_unary(
'/api.v1.TradingDataService/NetworkParameters',
request_serializer=api_dot_trading__pb2.NetworkParametersRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.NetworkParametersResponse.FromString,
)
self.LiquidityProvisions = channel.unary_unary(
'/api.v1.TradingDataService/LiquidityProvisions',
request_serializer=api_dot_trading__pb2.LiquidityProvisionsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.LiquidityProvisionsResponse.FromString,
)
self.OracleSpec = channel.unary_unary(
'/api.v1.TradingDataService/OracleSpec',
request_serializer=api_dot_trading__pb2.OracleSpecRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OracleSpecResponse.FromString,
)
self.OracleSpecs = channel.unary_unary(
'/api.v1.TradingDataService/OracleSpecs',
request_serializer=api_dot_trading__pb2.OracleSpecsRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OracleSpecsResponse.FromString,
)
self.OracleDataBySpec = channel.unary_unary(
'/api.v1.TradingDataService/OracleDataBySpec',
request_serializer=api_dot_trading__pb2.OracleDataBySpecRequest.SerializeToString,
response_deserializer=api_dot_trading__pb2.OracleDataBySpecResponse.FromString,
)
class TradingDataServiceServicer(object):
"""Missing associated documentation comment in .proto file."""
def MarketAccounts(self, request, context):
"""-- Accounts --
Get a list of Accounts by Market
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PartyAccounts(self, request, context):
"""Get a list of Accounts by Party
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def FeeInfrastructureAccounts(self, request, context):
"""Get a list of accounts holding infrastructure fees.
Can be filtered by asset, there will be 1 infrastructure fee account per
asset in the network.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Candles(self, request, context):
"""-- Candles --
Get a list of Candles by Market
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarketDataByID(self, request, context):
"""-- Market Data --
Get Market Data by Market ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarketsData(self, request, context):
"""Get a list of Market Data
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarketByID(self, request, context):
"""-- Markets --
Get a Market by ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarketDepth(self, request, context):
"""Get Market Depth
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Markets(self, request, context):
"""Get a list of Markets
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OrderByMarketAndID(self, request, context):
"""-- Orders --
Get an Order by Market and Order ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OrderByReference(self, request, context):
"""Get an Order by Pending Order reference (UUID)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OrdersByMarket(self, request, context):
"""Get a list of Orders by Market
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OrdersByParty(self, request, context):
"""Get a list of Orders by Party
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OrderByID(self, request, context):
"""Get a specific order by order ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OrderVersionsByID(self, request, context):
"""Get all versions of the order by its orderID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarginLevels(self, request, context):
"""-- Parties --
Get Margin Levels by Party ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Parties(self, request, context):
"""Get a list of Parties
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PartyByID(self, request, context):
"""Get a Party by ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PositionsByParty(self, request, context):
"""-- Positions --
Get a list of Positions by Party
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def LastTrade(self, request, context):
"""-- Trades --
Get latest Trade
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TradesByMarket(self, request, context):
"""Get a list of Trades by Market
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TradesByOrder(self, request, context):
"""Get a list of Trades by Order
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TradesByParty(self, request, context):
"""Get a list of Trades by Party
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetProposals(self, request, context):
"""-- Governance --
Get governance data (proposals and votes) for all proposals
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetProposalsByParty(self, request, context):
"""Get governance data (proposals and votes) for proposals by party authoring them
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetVotesByParty(self, request, context):
"""Get votes by party casting them
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetNewMarketProposals(self, request, context):
"""Get governance data (proposals and votes) for proposals that aim creating new markets
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetUpdateMarketProposals(self, request, context):
"""Get governance data (proposals and votes) for proposals that aim updating markets
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetNetworkParametersProposals(self, request, context):
"""Get governance data (proposals and votes) for proposals that aim updating Vega network parameters
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetNewAssetProposals(self, request, context):
"""Get governance data (proposals and votes) for proposals aiming to create new assets
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetProposalByID(self, request, context):
"""Get governance data (proposals and votes) for a proposal located by ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetProposalByReference(self, request, context):
"""Get governance data (proposals and votes) for a proposal located by reference
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ObserveGovernance(self, request, context):
"""Subscribe to a stream of all governance updates
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ObservePartyProposals(self, request, context):
"""Subscribe to a stream of proposal updates
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ObservePartyVotes(self, request, context):
"""Subscribe to a stream of votes cast by a specific party
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ObserveProposalVotes(self, request, context):
"""Subscribe to a stream of proposal votes
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ObserveEventBus(self, request_iterator, context):
"""Subscribe to a stream of events from the core
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Statistics(self, request, context):
"""-- Misc --
Get Statistics on Vega
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetVegaTime(self, request, context):
"""Get Time
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def AccountsSubscribe(self, request, context):
"""Subscribe to a stream of Accounts
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CandlesSubscribe(self, request, context):
"""Subscribe to a stream of Candles
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarginLevelsSubscribe(self, request, context):
"""Subscribe to a stream of Margin Levels
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarketDepthSubscribe(self, request, context):
"""Subscribe to a stream of Market Depth
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarketDepthUpdatesSubscribe(self, request, context):
"""Subscribe to a stream of Market Depth Price Level Updates
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MarketsDataSubscribe(self, request, context):
"""Subscribe to a stream of Markets Data
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OrdersSubscribe(self, request, context):
"""Subscribe to a stream of Orders
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PositionsSubscribe(self, request, context):
"""Subscribe to a stream of Positions
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TradesSubscribe(self, request, context):
"""Subscribe to a stream of Trades
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TransferResponsesSubscribe(self, request, context):
"""Subscribe to a stream of Transfer Responses
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetNodeSignaturesAggregate(self, request, context):
"""Get an aggregate of signatures from all the nodes of the network
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def AssetByID(self, request, context):
"""Get an asset by its identifier
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Assets(self, request, context):
"""Get a list of all assets on Vega
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def EstimateFee(self, request, context):
"""Get an estimate for the fee to be paid for a given order
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def EstimateMargin(self, request, context):
"""Get an estimate for the margin required for a new order
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ERC20WithdrawalApproval(self, request, context):
"""Get the bundle approval for an ERC20 withdrawal,
these data are being used to bundle the call to the smart contract on the ethereum bridge
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Withdrawal(self, request, context):
"""Get a withdrawal by its identifier
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Withdrawals(self, request, context):
"""Get withdrawals for a party
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Deposit(self, request, context):
"""Get a deposit by its identifier
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Deposits(self, request, context):
"""Get deposits for a party
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def NetworkParameters(self, request, context):
"""Get the network parameters
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def LiquidityProvisions(self, request, context):
"""Get the liquidity provision orders
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OracleSpec(self, request, context):
"""Get an oracle spec by ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OracleSpecs(self, request, context):
"""Get the oracle specs
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OracleDataBySpec(self, request, context):
"""Get all oracle data
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_TradingDataServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'MarketAccounts': grpc.unary_unary_rpc_method_handler(
servicer.MarketAccounts,
request_deserializer=api_dot_trading__pb2.MarketAccountsRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketAccountsResponse.SerializeToString,
),
'PartyAccounts': grpc.unary_unary_rpc_method_handler(
servicer.PartyAccounts,
request_deserializer=api_dot_trading__pb2.PartyAccountsRequest.FromString,
response_serializer=api_dot_trading__pb2.PartyAccountsResponse.SerializeToString,
),
'FeeInfrastructureAccounts': grpc.unary_unary_rpc_method_handler(
servicer.FeeInfrastructureAccounts,
request_deserializer=api_dot_trading__pb2.FeeInfrastructureAccountsRequest.FromString,
response_serializer=api_dot_trading__pb2.FeeInfrastructureAccountsResponse.SerializeToString,
),
'Candles': grpc.unary_unary_rpc_method_handler(
servicer.Candles,
request_deserializer=api_dot_trading__pb2.CandlesRequest.FromString,
response_serializer=api_dot_trading__pb2.CandlesResponse.SerializeToString,
),
'MarketDataByID': grpc.unary_unary_rpc_method_handler(
servicer.MarketDataByID,
request_deserializer=api_dot_trading__pb2.MarketDataByIDRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketDataByIDResponse.SerializeToString,
),
'MarketsData': grpc.unary_unary_rpc_method_handler(
servicer.MarketsData,
request_deserializer=api_dot_trading__pb2.MarketsDataRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketsDataResponse.SerializeToString,
),
'MarketByID': grpc.unary_unary_rpc_method_handler(
servicer.MarketByID,
request_deserializer=api_dot_trading__pb2.MarketByIDRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketByIDResponse.SerializeToString,
),
'MarketDepth': grpc.unary_unary_rpc_method_handler(
servicer.MarketDepth,
request_deserializer=api_dot_trading__pb2.MarketDepthRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketDepthResponse.SerializeToString,
),
'Markets': grpc.unary_unary_rpc_method_handler(
servicer.Markets,
request_deserializer=api_dot_trading__pb2.MarketsRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketsResponse.SerializeToString,
),
'OrderByMarketAndID': grpc.unary_unary_rpc_method_handler(
servicer.OrderByMarketAndID,
request_deserializer=api_dot_trading__pb2.OrderByMarketAndIDRequest.FromString,
response_serializer=api_dot_trading__pb2.OrderByMarketAndIDResponse.SerializeToString,
),
'OrderByReference': grpc.unary_unary_rpc_method_handler(
servicer.OrderByReference,
request_deserializer=api_dot_trading__pb2.OrderByReferenceRequest.FromString,
response_serializer=api_dot_trading__pb2.OrderByReferenceResponse.SerializeToString,
),
'OrdersByMarket': grpc.unary_unary_rpc_method_handler(
servicer.OrdersByMarket,
request_deserializer=api_dot_trading__pb2.OrdersByMarketRequest.FromString,
response_serializer=api_dot_trading__pb2.OrdersByMarketResponse.SerializeToString,
),
'OrdersByParty': grpc.unary_unary_rpc_method_handler(
servicer.OrdersByParty,
request_deserializer=api_dot_trading__pb2.OrdersByPartyRequest.FromString,
response_serializer=api_dot_trading__pb2.OrdersByPartyResponse.SerializeToString,
),
'OrderByID': grpc.unary_unary_rpc_method_handler(
servicer.OrderByID,
request_deserializer=api_dot_trading__pb2.OrderByIDRequest.FromString,
response_serializer=api_dot_trading__pb2.OrderByIDResponse.SerializeToString,
),
'OrderVersionsByID': grpc.unary_unary_rpc_method_handler(
servicer.OrderVersionsByID,
request_deserializer=api_dot_trading__pb2.OrderVersionsByIDRequest.FromString,
response_serializer=api_dot_trading__pb2.OrderVersionsByIDResponse.SerializeToString,
),
'MarginLevels': grpc.unary_unary_rpc_method_handler(
servicer.MarginLevels,
request_deserializer=api_dot_trading__pb2.MarginLevelsRequest.FromString,
response_serializer=api_dot_trading__pb2.MarginLevelsResponse.SerializeToString,
),
'Parties': grpc.unary_unary_rpc_method_handler(
servicer.Parties,
request_deserializer=api_dot_trading__pb2.PartiesRequest.FromString,
response_serializer=api_dot_trading__pb2.PartiesResponse.SerializeToString,
),
'PartyByID': grpc.unary_unary_rpc_method_handler(
servicer.PartyByID,
request_deserializer=api_dot_trading__pb2.PartyByIDRequest.FromString,
response_serializer=api_dot_trading__pb2.PartyByIDResponse.SerializeToString,
),
'PositionsByParty': grpc.unary_unary_rpc_method_handler(
servicer.PositionsByParty,
request_deserializer=api_dot_trading__pb2.PositionsByPartyRequest.FromString,
response_serializer=api_dot_trading__pb2.PositionsByPartyResponse.SerializeToString,
),
'LastTrade': grpc.unary_unary_rpc_method_handler(
servicer.LastTrade,
request_deserializer=api_dot_trading__pb2.LastTradeRequest.FromString,
response_serializer=api_dot_trading__pb2.LastTradeResponse.SerializeToString,
),
'TradesByMarket': grpc.unary_unary_rpc_method_handler(
servicer.TradesByMarket,
request_deserializer=api_dot_trading__pb2.TradesByMarketRequest.FromString,
response_serializer=api_dot_trading__pb2.TradesByMarketResponse.SerializeToString,
),
'TradesByOrder': grpc.unary_unary_rpc_method_handler(
servicer.TradesByOrder,
request_deserializer=api_dot_trading__pb2.TradesByOrderRequest.FromString,
response_serializer=api_dot_trading__pb2.TradesByOrderResponse.SerializeToString,
),
'TradesByParty': grpc.unary_unary_rpc_method_handler(
servicer.TradesByParty,
request_deserializer=api_dot_trading__pb2.TradesByPartyRequest.FromString,
response_serializer=api_dot_trading__pb2.TradesByPartyResponse.SerializeToString,
),
'GetProposals': grpc.unary_unary_rpc_method_handler(
servicer.GetProposals,
request_deserializer=api_dot_trading__pb2.GetProposalsRequest.FromString,
response_serializer=api_dot_trading__pb2.GetProposalsResponse.SerializeToString,
),
'GetProposalsByParty': grpc.unary_unary_rpc_method_handler(
servicer.GetProposalsByParty,
request_deserializer=api_dot_trading__pb2.GetProposalsByPartyRequest.FromString,
response_serializer=api_dot_trading__pb2.GetProposalsByPartyResponse.SerializeToString,
),
'GetVotesByParty': grpc.unary_unary_rpc_method_handler(
servicer.GetVotesByParty,
request_deserializer=api_dot_trading__pb2.GetVotesByPartyRequest.FromString,
response_serializer=api_dot_trading__pb2.GetVotesByPartyResponse.SerializeToString,
),
'GetNewMarketProposals': grpc.unary_unary_rpc_method_handler(
servicer.GetNewMarketProposals,
request_deserializer=api_dot_trading__pb2.GetNewMarketProposalsRequest.FromString,
response_serializer=api_dot_trading__pb2.GetNewMarketProposalsResponse.SerializeToString,
),
'GetUpdateMarketProposals': grpc.unary_unary_rpc_method_handler(
servicer.GetUpdateMarketProposals,
request_deserializer=api_dot_trading__pb2.GetUpdateMarketProposalsRequest.FromString,
response_serializer=api_dot_trading__pb2.GetUpdateMarketProposalsResponse.SerializeToString,
),
'GetNetworkParametersProposals': grpc.unary_unary_rpc_method_handler(
servicer.GetNetworkParametersProposals,
request_deserializer=api_dot_trading__pb2.GetNetworkParametersProposalsRequest.FromString,
response_serializer=api_dot_trading__pb2.GetNetworkParametersProposalsResponse.SerializeToString,
),
'GetNewAssetProposals': grpc.unary_unary_rpc_method_handler(
servicer.GetNewAssetProposals,
request_deserializer=api_dot_trading__pb2.GetNewAssetProposalsRequest.FromString,
response_serializer=api_dot_trading__pb2.GetNewAssetProposalsResponse.SerializeToString,
),
'GetProposalByID': grpc.unary_unary_rpc_method_handler(
servicer.GetProposalByID,
request_deserializer=api_dot_trading__pb2.GetProposalByIDRequest.FromString,
response_serializer=api_dot_trading__pb2.GetProposalByIDResponse.SerializeToString,
),
'GetProposalByReference': grpc.unary_unary_rpc_method_handler(
servicer.GetProposalByReference,
request_deserializer=api_dot_trading__pb2.GetProposalByReferenceRequest.FromString,
response_serializer=api_dot_trading__pb2.GetProposalByReferenceResponse.SerializeToString,
),
'ObserveGovernance': grpc.unary_stream_rpc_method_handler(
servicer.ObserveGovernance,
request_deserializer=api_dot_trading__pb2.ObserveGovernanceRequest.FromString,
response_serializer=api_dot_trading__pb2.ObserveGovernanceResponse.SerializeToString,
),
'ObservePartyProposals': grpc.unary_stream_rpc_method_handler(
servicer.ObservePartyProposals,
request_deserializer=api_dot_trading__pb2.ObservePartyProposalsRequest.FromString,
response_serializer=api_dot_trading__pb2.ObservePartyProposalsResponse.SerializeToString,
),
'ObservePartyVotes': grpc.unary_stream_rpc_method_handler(
servicer.ObservePartyVotes,
request_deserializer=api_dot_trading__pb2.ObservePartyVotesRequest.FromString,
response_serializer=api_dot_trading__pb2.ObservePartyVotesResponse.SerializeToString,
),
'ObserveProposalVotes': grpc.unary_stream_rpc_method_handler(
servicer.ObserveProposalVotes,
request_deserializer=api_dot_trading__pb2.ObserveProposalVotesRequest.FromString,
response_serializer=api_dot_trading__pb2.ObserveProposalVotesResponse.SerializeToString,
),
'ObserveEventBus': grpc.stream_stream_rpc_method_handler(
servicer.ObserveEventBus,
request_deserializer=api_dot_trading__pb2.ObserveEventBusRequest.FromString,
response_serializer=api_dot_trading__pb2.ObserveEventBusResponse.SerializeToString,
),
'Statistics': grpc.unary_unary_rpc_method_handler(
servicer.Statistics,
request_deserializer=api_dot_trading__pb2.StatisticsRequest.FromString,
response_serializer=api_dot_trading__pb2.StatisticsResponse.SerializeToString,
),
'GetVegaTime': grpc.unary_unary_rpc_method_handler(
servicer.GetVegaTime,
request_deserializer=api_dot_trading__pb2.GetVegaTimeRequest.FromString,
response_serializer=api_dot_trading__pb2.GetVegaTimeResponse.SerializeToString,
),
'AccountsSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.AccountsSubscribe,
request_deserializer=api_dot_trading__pb2.AccountsSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.AccountsSubscribeResponse.SerializeToString,
),
'CandlesSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.CandlesSubscribe,
request_deserializer=api_dot_trading__pb2.CandlesSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.CandlesSubscribeResponse.SerializeToString,
),
'MarginLevelsSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.MarginLevelsSubscribe,
request_deserializer=api_dot_trading__pb2.MarginLevelsSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.MarginLevelsSubscribeResponse.SerializeToString,
),
'MarketDepthSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.MarketDepthSubscribe,
request_deserializer=api_dot_trading__pb2.MarketDepthSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketDepthSubscribeResponse.SerializeToString,
),
'MarketDepthUpdatesSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.MarketDepthUpdatesSubscribe,
request_deserializer=api_dot_trading__pb2.MarketDepthUpdatesSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketDepthUpdatesSubscribeResponse.SerializeToString,
),
'MarketsDataSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.MarketsDataSubscribe,
request_deserializer=api_dot_trading__pb2.MarketsDataSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.MarketsDataSubscribeResponse.SerializeToString,
),
'OrdersSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.OrdersSubscribe,
request_deserializer=api_dot_trading__pb2.OrdersSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.OrdersSubscribeResponse.SerializeToString,
),
'PositionsSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.PositionsSubscribe,
request_deserializer=api_dot_trading__pb2.PositionsSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.PositionsSubscribeResponse.SerializeToString,
),
'TradesSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.TradesSubscribe,
request_deserializer=api_dot_trading__pb2.TradesSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.TradesSubscribeResponse.SerializeToString,
),
'TransferResponsesSubscribe': grpc.unary_stream_rpc_method_handler(
servicer.TransferResponsesSubscribe,
request_deserializer=api_dot_trading__pb2.TransferResponsesSubscribeRequest.FromString,
response_serializer=api_dot_trading__pb2.TransferResponsesSubscribeResponse.SerializeToString,
),
'GetNodeSignaturesAggregate': grpc.unary_unary_rpc_method_handler(
servicer.GetNodeSignaturesAggregate,
request_deserializer=api_dot_trading__pb2.GetNodeSignaturesAggregateRequest.FromString,
response_serializer=api_dot_trading__pb2.GetNodeSignaturesAggregateResponse.SerializeToString,
),
'AssetByID': grpc.unary_unary_rpc_method_handler(
servicer.AssetByID,
request_deserializer=api_dot_trading__pb2.AssetByIDRequest.FromString,
response_serializer=api_dot_trading__pb2.AssetByIDResponse.SerializeToString,
),
'Assets': grpc.unary_unary_rpc_method_handler(
servicer.Assets,
request_deserializer=api_dot_trading__pb2.AssetsRequest.FromString,
response_serializer=api_dot_trading__pb2.AssetsResponse.SerializeToString,
),
'EstimateFee': grpc.unary_unary_rpc_method_handler(
servicer.EstimateFee,
request_deserializer=api_dot_trading__pb2.EstimateFeeRequest.FromString,
response_serializer=api_dot_trading__pb2.EstimateFeeResponse.SerializeToString,
),
'EstimateMargin': grpc.unary_unary_rpc_method_handler(
servicer.EstimateMargin,
request_deserializer=api_dot_trading__pb2.EstimateMarginRequest.FromString,
response_serializer=api_dot_trading__pb2.EstimateMarginResponse.SerializeToString,
),
'ERC20WithdrawalApproval': grpc.unary_unary_rpc_method_handler(
servicer.ERC20WithdrawalApproval,
request_deserializer=api_dot_trading__pb2.ERC20WithdrawalApprovalRequest.FromString,
response_serializer=api_dot_trading__pb2.ERC20WithdrawalApprovalResponse.SerializeToString,
),
'Withdrawal': grpc.unary_unary_rpc_method_handler(
servicer.Withdrawal,
request_deserializer=api_dot_trading__pb2.WithdrawalRequest.FromString,
response_serializer=api_dot_trading__pb2.WithdrawalResponse.SerializeToString,
),
'Withdrawals': grpc.unary_unary_rpc_method_handler(
servicer.Withdrawals,
request_deserializer=api_dot_trading__pb2.WithdrawalsRequest.FromString,
response_serializer=api_dot_trading__pb2.WithdrawalsResponse.SerializeToString,
),
'Deposit': grpc.unary_unary_rpc_method_handler(
servicer.Deposit,
request_deserializer=api_dot_trading__pb2.DepositRequest.FromString,
response_serializer=api_dot_trading__pb2.DepositResponse.SerializeToString,
),
'Deposits': grpc.unary_unary_rpc_method_handler(
servicer.Deposits,
request_deserializer=api_dot_trading__pb2.DepositsRequest.FromString,
response_serializer=api_dot_trading__pb2.DepositsResponse.SerializeToString,
),
'NetworkParameters': grpc.unary_unary_rpc_method_handler(
servicer.NetworkParameters,
request_deserializer=api_dot_trading__pb2.NetworkParametersRequest.FromString,
response_serializer=api_dot_trading__pb2.NetworkParametersResponse.SerializeToString,
),
'LiquidityProvisions': grpc.unary_unary_rpc_method_handler(
servicer.LiquidityProvisions,
request_deserializer=api_dot_trading__pb2.LiquidityProvisionsRequest.FromString,
response_serializer=api_dot_trading__pb2.LiquidityProvisionsResponse.SerializeToString,
),
'OracleSpec': grpc.unary_unary_rpc_method_handler(
servicer.OracleSpec,
request_deserializer=api_dot_trading__pb2.OracleSpecRequest.FromString,
response_serializer=api_dot_trading__pb2.OracleSpecResponse.SerializeToString,
),
'OracleSpecs': grpc.unary_unary_rpc_method_handler(
servicer.OracleSpecs,
request_deserializer=api_dot_trading__pb2.OracleSpecsRequest.FromString,
response_serializer=api_dot_trading__pb2.OracleSpecsResponse.SerializeToString,
),
'OracleDataBySpec': grpc.unary_unary_rpc_method_handler(
servicer.OracleDataBySpec,
request_deserializer=api_dot_trading__pb2.OracleDataBySpecRequest.FromString,
response_serializer=api_dot_trading__pb2.OracleDataBySpecResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'api.v1.TradingDataService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class TradingDataService(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
def MarketAccounts(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/MarketAccounts',
api_dot_trading__pb2.MarketAccountsRequest.SerializeToString,
api_dot_trading__pb2.MarketAccountsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PartyAccounts(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/PartyAccounts',
api_dot_trading__pb2.PartyAccountsRequest.SerializeToString,
api_dot_trading__pb2.PartyAccountsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def FeeInfrastructureAccounts(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/FeeInfrastructureAccounts',
api_dot_trading__pb2.FeeInfrastructureAccountsRequest.SerializeToString,
api_dot_trading__pb2.FeeInfrastructureAccountsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Candles(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Candles',
api_dot_trading__pb2.CandlesRequest.SerializeToString,
api_dot_trading__pb2.CandlesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarketDataByID(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/MarketDataByID',
api_dot_trading__pb2.MarketDataByIDRequest.SerializeToString,
api_dot_trading__pb2.MarketDataByIDResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarketsData(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/MarketsData',
api_dot_trading__pb2.MarketsDataRequest.SerializeToString,
api_dot_trading__pb2.MarketsDataResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarketByID(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/MarketByID',
api_dot_trading__pb2.MarketByIDRequest.SerializeToString,
api_dot_trading__pb2.MarketByIDResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarketDepth(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/MarketDepth',
api_dot_trading__pb2.MarketDepthRequest.SerializeToString,
api_dot_trading__pb2.MarketDepthResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Markets(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Markets',
api_dot_trading__pb2.MarketsRequest.SerializeToString,
api_dot_trading__pb2.MarketsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OrderByMarketAndID(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OrderByMarketAndID',
api_dot_trading__pb2.OrderByMarketAndIDRequest.SerializeToString,
api_dot_trading__pb2.OrderByMarketAndIDResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OrderByReference(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OrderByReference',
api_dot_trading__pb2.OrderByReferenceRequest.SerializeToString,
api_dot_trading__pb2.OrderByReferenceResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OrdersByMarket(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OrdersByMarket',
api_dot_trading__pb2.OrdersByMarketRequest.SerializeToString,
api_dot_trading__pb2.OrdersByMarketResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OrdersByParty(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OrdersByParty',
api_dot_trading__pb2.OrdersByPartyRequest.SerializeToString,
api_dot_trading__pb2.OrdersByPartyResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OrderByID(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OrderByID',
api_dot_trading__pb2.OrderByIDRequest.SerializeToString,
api_dot_trading__pb2.OrderByIDResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OrderVersionsByID(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OrderVersionsByID',
api_dot_trading__pb2.OrderVersionsByIDRequest.SerializeToString,
api_dot_trading__pb2.OrderVersionsByIDResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarginLevels(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/MarginLevels',
api_dot_trading__pb2.MarginLevelsRequest.SerializeToString,
api_dot_trading__pb2.MarginLevelsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Parties(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Parties',
api_dot_trading__pb2.PartiesRequest.SerializeToString,
api_dot_trading__pb2.PartiesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PartyByID(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/PartyByID',
api_dot_trading__pb2.PartyByIDRequest.SerializeToString,
api_dot_trading__pb2.PartyByIDResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PositionsByParty(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/PositionsByParty',
api_dot_trading__pb2.PositionsByPartyRequest.SerializeToString,
api_dot_trading__pb2.PositionsByPartyResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def LastTrade(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/LastTrade',
api_dot_trading__pb2.LastTradeRequest.SerializeToString,
api_dot_trading__pb2.LastTradeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TradesByMarket(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/TradesByMarket',
api_dot_trading__pb2.TradesByMarketRequest.SerializeToString,
api_dot_trading__pb2.TradesByMarketResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TradesByOrder(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/TradesByOrder',
api_dot_trading__pb2.TradesByOrderRequest.SerializeToString,
api_dot_trading__pb2.TradesByOrderResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TradesByParty(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/TradesByParty',
api_dot_trading__pb2.TradesByPartyRequest.SerializeToString,
api_dot_trading__pb2.TradesByPartyResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetProposals(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetProposals',
api_dot_trading__pb2.GetProposalsRequest.SerializeToString,
api_dot_trading__pb2.GetProposalsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetProposalsByParty(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetProposalsByParty',
api_dot_trading__pb2.GetProposalsByPartyRequest.SerializeToString,
api_dot_trading__pb2.GetProposalsByPartyResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetVotesByParty(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetVotesByParty',
api_dot_trading__pb2.GetVotesByPartyRequest.SerializeToString,
api_dot_trading__pb2.GetVotesByPartyResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetNewMarketProposals(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetNewMarketProposals',
api_dot_trading__pb2.GetNewMarketProposalsRequest.SerializeToString,
api_dot_trading__pb2.GetNewMarketProposalsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetUpdateMarketProposals(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetUpdateMarketProposals',
api_dot_trading__pb2.GetUpdateMarketProposalsRequest.SerializeToString,
api_dot_trading__pb2.GetUpdateMarketProposalsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetNetworkParametersProposals(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetNetworkParametersProposals',
api_dot_trading__pb2.GetNetworkParametersProposalsRequest.SerializeToString,
api_dot_trading__pb2.GetNetworkParametersProposalsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetNewAssetProposals(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetNewAssetProposals',
api_dot_trading__pb2.GetNewAssetProposalsRequest.SerializeToString,
api_dot_trading__pb2.GetNewAssetProposalsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetProposalByID(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetProposalByID',
api_dot_trading__pb2.GetProposalByIDRequest.SerializeToString,
api_dot_trading__pb2.GetProposalByIDResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetProposalByReference(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetProposalByReference',
api_dot_trading__pb2.GetProposalByReferenceRequest.SerializeToString,
api_dot_trading__pb2.GetProposalByReferenceResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ObserveGovernance(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/ObserveGovernance',
api_dot_trading__pb2.ObserveGovernanceRequest.SerializeToString,
api_dot_trading__pb2.ObserveGovernanceResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ObservePartyProposals(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/ObservePartyProposals',
api_dot_trading__pb2.ObservePartyProposalsRequest.SerializeToString,
api_dot_trading__pb2.ObservePartyProposalsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ObservePartyVotes(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/ObservePartyVotes',
api_dot_trading__pb2.ObservePartyVotesRequest.SerializeToString,
api_dot_trading__pb2.ObservePartyVotesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ObserveProposalVotes(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/ObserveProposalVotes',
api_dot_trading__pb2.ObserveProposalVotesRequest.SerializeToString,
api_dot_trading__pb2.ObserveProposalVotesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ObserveEventBus(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(request_iterator, target, '/api.v1.TradingDataService/ObserveEventBus',
api_dot_trading__pb2.ObserveEventBusRequest.SerializeToString,
api_dot_trading__pb2.ObserveEventBusResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Statistics(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Statistics',
api_dot_trading__pb2.StatisticsRequest.SerializeToString,
api_dot_trading__pb2.StatisticsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetVegaTime(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetVegaTime',
api_dot_trading__pb2.GetVegaTimeRequest.SerializeToString,
api_dot_trading__pb2.GetVegaTimeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def AccountsSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/AccountsSubscribe',
api_dot_trading__pb2.AccountsSubscribeRequest.SerializeToString,
api_dot_trading__pb2.AccountsSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def CandlesSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/CandlesSubscribe',
api_dot_trading__pb2.CandlesSubscribeRequest.SerializeToString,
api_dot_trading__pb2.CandlesSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarginLevelsSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/MarginLevelsSubscribe',
api_dot_trading__pb2.MarginLevelsSubscribeRequest.SerializeToString,
api_dot_trading__pb2.MarginLevelsSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarketDepthSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/MarketDepthSubscribe',
api_dot_trading__pb2.MarketDepthSubscribeRequest.SerializeToString,
api_dot_trading__pb2.MarketDepthSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarketDepthUpdatesSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/MarketDepthUpdatesSubscribe',
api_dot_trading__pb2.MarketDepthUpdatesSubscribeRequest.SerializeToString,
api_dot_trading__pb2.MarketDepthUpdatesSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MarketsDataSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/MarketsDataSubscribe',
api_dot_trading__pb2.MarketsDataSubscribeRequest.SerializeToString,
api_dot_trading__pb2.MarketsDataSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OrdersSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/OrdersSubscribe',
api_dot_trading__pb2.OrdersSubscribeRequest.SerializeToString,
api_dot_trading__pb2.OrdersSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PositionsSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/PositionsSubscribe',
api_dot_trading__pb2.PositionsSubscribeRequest.SerializeToString,
api_dot_trading__pb2.PositionsSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TradesSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/TradesSubscribe',
api_dot_trading__pb2.TradesSubscribeRequest.SerializeToString,
api_dot_trading__pb2.TradesSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TransferResponsesSubscribe(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/api.v1.TradingDataService/TransferResponsesSubscribe',
api_dot_trading__pb2.TransferResponsesSubscribeRequest.SerializeToString,
api_dot_trading__pb2.TransferResponsesSubscribeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetNodeSignaturesAggregate(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/GetNodeSignaturesAggregate',
api_dot_trading__pb2.GetNodeSignaturesAggregateRequest.SerializeToString,
api_dot_trading__pb2.GetNodeSignaturesAggregateResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def AssetByID(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/AssetByID',
api_dot_trading__pb2.AssetByIDRequest.SerializeToString,
api_dot_trading__pb2.AssetByIDResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Assets(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Assets',
api_dot_trading__pb2.AssetsRequest.SerializeToString,
api_dot_trading__pb2.AssetsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def EstimateFee(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/EstimateFee',
api_dot_trading__pb2.EstimateFeeRequest.SerializeToString,
api_dot_trading__pb2.EstimateFeeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def EstimateMargin(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/EstimateMargin',
api_dot_trading__pb2.EstimateMarginRequest.SerializeToString,
api_dot_trading__pb2.EstimateMarginResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ERC20WithdrawalApproval(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/ERC20WithdrawalApproval',
api_dot_trading__pb2.ERC20WithdrawalApprovalRequest.SerializeToString,
api_dot_trading__pb2.ERC20WithdrawalApprovalResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Withdrawal(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Withdrawal',
api_dot_trading__pb2.WithdrawalRequest.SerializeToString,
api_dot_trading__pb2.WithdrawalResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Withdrawals(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Withdrawals',
api_dot_trading__pb2.WithdrawalsRequest.SerializeToString,
api_dot_trading__pb2.WithdrawalsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Deposit(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Deposit',
api_dot_trading__pb2.DepositRequest.SerializeToString,
api_dot_trading__pb2.DepositResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Deposits(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/Deposits',
api_dot_trading__pb2.DepositsRequest.SerializeToString,
api_dot_trading__pb2.DepositsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def NetworkParameters(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/NetworkParameters',
api_dot_trading__pb2.NetworkParametersRequest.SerializeToString,
api_dot_trading__pb2.NetworkParametersResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def LiquidityProvisions(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/LiquidityProvisions',
api_dot_trading__pb2.LiquidityProvisionsRequest.SerializeToString,
api_dot_trading__pb2.LiquidityProvisionsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OracleSpec(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OracleSpec',
api_dot_trading__pb2.OracleSpecRequest.SerializeToString,
api_dot_trading__pb2.OracleSpecResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OracleSpecs(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OracleSpecs',
api_dot_trading__pb2.OracleSpecsRequest.SerializeToString,
api_dot_trading__pb2.OracleSpecsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OracleDataBySpec(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/api.v1.TradingDataService/OracleDataBySpec',
api_dot_trading__pb2.OracleDataBySpecRequest.SerializeToString,
api_dot_trading__pb2.OracleDataBySpecResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
| 47.596026 | 121 | 0.667873 | 10,306 | 122,179 | 7.601591 | 0.040365 | 0.056164 | 0.072847 | 0.089658 | 0.85405 | 0.805251 | 0.562368 | 0.433982 | 0.427268 | 0.422443 | 0 | 0.00685 | 0.262827 | 122,179 | 2,566 | 122 | 47.614575 | 0.862969 | 0.035726 | 0 | 0.531646 | 1 | 0 | 0.091498 | 0.055899 | 0 | 0 | 0 | 0 | 0 | 1 | 0.067812 | false | 0 | 0.000904 | 0.033002 | 0.10443 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b4b34d228939e519fe46f70f4f4c23e44354e9f3 | 226 | py | Python | word.py | ouyangzx/stop-motion-printing | dc1b8c55fab26a828dc79816428b8aff17576e09 | [
"MIT"
] | null | null | null | word.py | ouyangzx/stop-motion-printing | dc1b8c55fab26a828dc79816428b8aff17576e09 | [
"MIT"
] | null | null | null | word.py | ouyangzx/stop-motion-printing | dc1b8c55fab26a828dc79816428b8aff17576e09 | [
"MIT"
] | null | null | null | from win32com.client import Dispatch
class WpsWord:
def __init__(self):
self.word = Dispatch('word.Application')
self.word.Visible = True
def open(self,docx):
self.word.Documents.Open(docx)
| 18.833333 | 48 | 0.659292 | 28 | 226 | 5.178571 | 0.607143 | 0.165517 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011561 | 0.234513 | 226 | 11 | 49 | 20.545455 | 0.82659 | 0 | 0 | 0 | 0 | 0 | 0.070796 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
b4ba3b8edee80f6119322cab27848fdd4dc971e1 | 292 | py | Python | totra/__init__.py | jedrus2000/totra | 889e154a7b4743348ca5f6cdf29eb986a6476756 | [
"MIT"
] | 3 | 2019-05-05T16:39:57.000Z | 2020-05-31T14:53:16.000Z | totra/__init__.py | jedrus2000/totra | 889e154a7b4743348ca5f6cdf29eb986a6476756 | [
"MIT"
] | null | null | null | totra/__init__.py | jedrus2000/totra | 889e154a7b4743348ca5f6cdf29eb986a6476756 | [
"MIT"
] | 1 | 2020-05-31T14:53:17.000Z | 2020-05-31T14:53:17.000Z | # -*- coding: utf-8 -*-
import logging
from .version import __version__
from .core import TTrackerSession, how_much_hours, report_activities
from .main import main
from totra.output_format import format_activities, save_output
logging.getLogger(__name__).addHandler(logging.NullHandler())
| 26.545455 | 68 | 0.811644 | 37 | 292 | 6.027027 | 0.621622 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003817 | 0.10274 | 292 | 10 | 69 | 29.2 | 0.847328 | 0.071918 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.833333 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b4bf527d4d3f2f015ddad3e99a28fee52d9ab9c9 | 265 | py | Python | sql_to_django/forms.py | rimi-dev/sql_to_orm | ef58cac457182fa8d30c729d15dd3fbc9347f2fc | [
"MIT"
] | 1 | 2021-03-11T11:52:14.000Z | 2021-03-11T11:52:14.000Z | sql_to_django/forms.py | rimi-dev/sql_to_orm | ef58cac457182fa8d30c729d15dd3fbc9347f2fc | [
"MIT"
] | 8 | 2020-06-03T06:15:39.000Z | 2021-09-22T19:09:18.000Z | sql_to_django/forms.py | rimi-dev/sql_to_orm | ef58cac457182fa8d30c729d15dd3fbc9347f2fc | [
"MIT"
] | null | null | null | from django import forms
from sql_to_django.widgets import DivContentEditable
class QueryInputForm(forms.Form):
query = forms.CharField(max_length=1000, widget=forms.Textarea(attrs={'class': 'form-control', 'placeholder': 'Please input working SQL query.'})) | 37.857143 | 150 | 0.781132 | 34 | 265 | 6 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016807 | 0.101887 | 265 | 7 | 150 | 37.857143 | 0.840336 | 0 | 0 | 0 | 0 | 0 | 0.221805 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b4d83973c31f15f0a21b7d8c6db35690a2bb9ac7 | 1,558 | py | Python | home/serializers.py | ageorgiev97/fictional-octo-meme | afc0f69985c0e79f128cf1bdafa668a9a22a2f0f | [
"MIT"
] | null | null | null | home/serializers.py | ageorgiev97/fictional-octo-meme | afc0f69985c0e79f128cf1bdafa668a9a22a2f0f | [
"MIT"
] | null | null | null | home/serializers.py | ageorgiev97/fictional-octo-meme | afc0f69985c0e79f128cf1bdafa668a9a22a2f0f | [
"MIT"
] | null | null | null | from rest_framework.serializers import HyperlinkedModelSerializer
from rest_framework.viewsets import ModelViewSet
from home.models import Location, Restaurant, Dish, CustomUser, Category, Allergen, Rating, FavouriteRestaurants, RestaurantCategory, \
DishAllergen
class LocationSerializer(HyperlinkedModelSerializer):
class Meta:
model = Location
fields = '__all__'
class RestaurantSerializer(HyperlinkedModelSerializer):
class Meta:
model = Restaurant
fields = '__all__'
class DishSerializer(HyperlinkedModelSerializer):
class Meta:
model = Dish
fields = '__all__'
class CustomUserSerializer(HyperlinkedModelSerializer):
class Meta:
model = CustomUser
fields = '__all__'
class CategorySerializer(HyperlinkedModelSerializer):
class Meta:
model = Category
fields = '__all__'
class AllergenSerializer(HyperlinkedModelSerializer):
class Meta:
model = Allergen
fields = '__all__'
class RatingSerializer(HyperlinkedModelSerializer):
class Meta:
model = Rating
fields = '__all__'
class FavouriteRestaurantsSerializer(HyperlinkedModelSerializer):
class Meta:
model = FavouriteRestaurants
fields = '__all__'
class RestaurantCategorySerializer(HyperlinkedModelSerializer):
class Meta:
model = RestaurantCategory
fields = '__all__'
class DishAllergenSerializer(HyperlinkedModelSerializer):
class Meta:
model = DishAllergen
fields = '__all__'
| 23.253731 | 135 | 0.716945 | 116 | 1,558 | 9.267241 | 0.301724 | 0.288372 | 0.325581 | 0.372093 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.223363 | 1,558 | 66 | 136 | 23.606061 | 0.88843 | 0 | 0 | 0.454545 | 0 | 0 | 0.044958 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.068182 | 0 | 0.522727 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b4fd0774f3758b9601b9b5e7a1dbfe9b37f1bae1 | 372 | py | Python | category/models.py | rvladimirvm/book_reservation | 6d449e233de9faa6a4f8bf45729e9117604ed961 | [
"MIT"
] | 2 | 2018-12-14T05:09:17.000Z | 2018-12-18T02:30:07.000Z | category/models.py | rvladimirvm/book_reservation | 6d449e233de9faa6a4f8bf45729e9117604ed961 | [
"MIT"
] | 13 | 2018-12-14T04:54:40.000Z | 2019-03-28T04:14:44.000Z | category/models.py | rvladimirvm/book_reservation | 6d449e233de9faa6a4f8bf45729e9117604ed961 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Models of category
'''
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Category(models.Model):
'''
Model category
'''
category = models.CharField(max_length=50)
description = models.CharField(max_length=100)
def __unicode__(self):
return self.category
| 16.909091 | 50 | 0.680108 | 44 | 372 | 5.5 | 0.613636 | 0.115702 | 0.14876 | 0.198347 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020339 | 0.206989 | 372 | 21 | 51 | 17.714286 | 0.8 | 0.217742 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0.142857 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
b4fdbba3b49be1640637e4b75181bf0ae39ae639 | 2,967 | py | Python | db/redis_connection.py | dessa-oss/local-docker-scheduler | 0e47f43b31cb8e03228cd61724d378e8f3acf6d2 | [
"Apache-2.0"
] | 4 | 2020-03-16T19:58:25.000Z | 2020-06-24T08:29:01.000Z | db/redis_connection.py | dessa-oss/local-docker-scheduler | 0e47f43b31cb8e03228cd61724d378e8f3acf6d2 | [
"Apache-2.0"
] | null | null | null | db/redis_connection.py | dessa-oss/local-docker-scheduler | 0e47f43b31cb8e03228cd61724d378e8f3acf6d2 | [
"Apache-2.0"
] | null | null | null | import redis
from pickle import loads, dumps
class RedisDict:
def __init__(self, key, host, port, db=0):
self._redis = redis.StrictRedis(host, port, db)
# try the connection; allow user of class to handle exception themselves
self._redis.ping()
self._key = key
def __getitem__(self, field):
response = self._redis.hget(self._key, dumps(field))
if response is None:
raise KeyError(f'Key: {self._key} not found')
return loads(response)
def __setitem__(self, field, value):
return self._redis.hset(self._key, dumps(field), dumps(value))
def items(self):
return [(loads(field), loads(value)) for field, value in self._redis.hgetall(self._key).items()]
def keys(self):
return [loads(field) for field in self._redis.hkeys(self._key)]
def __delitem__(self, field):
return self._redis.hdel(self._key, dumps(field))
def __contains__(self, field):
return self._redis.hexists(self._key, dumps(field)) == 1
class RedisList:
def __init__(self, key, host, port, db=0):
self._redis = redis.StrictRedis(host, port, db)
# try the connection; allow user of class to handle exception themselves
self._redis.ping()
self._key = key
def __getitem__(self, index):
response = self._redis.lindex(self._key, index)
if response is None:
raise IndexError
return loads(response)
def __setitem__(self, index, value):
return self._redis.lset(self._key, index, dumps(value))
def __delitem__(self, index):
return self._redis.lrem(self._key, 1, dumps(self.__getitem__(index)))
def __contains__(self, value):
print(f"looking up {value} in {self._key}")
for i in self:
if i == value:
return True
else:
return False
def insert(self, index, value):
return self._redis.linsert(self._key, "before", dumps(self.__getitem__(index)), dumps(value))
def append(self, value):
return self._redis.rpush(self._key, dumps(value))
def peek(self, index=0):
return self.__getitem__(index)
def pop(self, index=-1):
if index == -1:
response = self._redis.rpop(self._key)
if response is None:
raise IndexError
return loads(response)
elif index == 0:
response = self._redis.lpop(self._key)
if response is None:
raise IndexError
return loads(response)
else:
response = self[index]
del self[index]
return response
def reposition(self, original_position, new_position):
temp = self[original_position]
del self[original_position]
try:
self.insert(new_position, temp)
except IndexError:
self.insert(original_position, temp)
raise
| 31.56383 | 104 | 0.609033 | 365 | 2,967 | 4.69863 | 0.232877 | 0.077551 | 0.061224 | 0.03965 | 0.376676 | 0.336443 | 0.277551 | 0.277551 | 0.277551 | 0.248397 | 0 | 0.003781 | 0.286822 | 2,967 | 93 | 105 | 31.903226 | 0.806711 | 0.047523 | 0 | 0.291667 | 0 | 0 | 0.023025 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.236111 | false | 0 | 0.027778 | 0.138889 | 0.527778 | 0.013889 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3701916651eb74ef3a011d1f7440bbfc83fcee55 | 398 | py | Python | pypegasus/transport/compat.py | vagetablechicken/pegasus-python-client | 4331014eeb3a397e635fe1c506b912105cba4052 | [
"Apache-2.0"
] | 8 | 2018-07-19T09:33:44.000Z | 2022-03-27T15:59:53.000Z | pypegasus/transport/compat.py | vagetablechicken/pegasus-python-client | 4331014eeb3a397e635fe1c506b912105cba4052 | [
"Apache-2.0"
] | 8 | 2018-03-02T08:11:10.000Z | 2022-02-11T03:38:33.000Z | pypegasus/transport/compat.py | vagetablechicken/pegasus-python-client | 4331014eeb3a397e635fe1c506b912105cba4052 | [
"Apache-2.0"
] | 8 | 2018-02-27T07:38:28.000Z | 2021-03-25T02:53:19.000Z | import sys
if sys.version_info[0] == 2:
from cStringIO import StringIO as BufferIO
def binary_to_str(bin_val):
return bin_val
def str_to_binary(str_val):
return str_val
else:
from io import BytesIO as BufferIO # noqa
def binary_to_str(bin_val):
return bin_val.decode('utf8')
def str_to_binary(str_val):
return bytes(str_val, 'utf8')
| 18.090909 | 46 | 0.665829 | 62 | 398 | 4 | 0.419355 | 0.096774 | 0.08871 | 0.112903 | 0.467742 | 0.467742 | 0.467742 | 0.258065 | 0.258065 | 0 | 0 | 0.013559 | 0.258794 | 398 | 21 | 47 | 18.952381 | 0.827119 | 0.01005 | 0 | 0.307692 | 0 | 0 | 0.020408 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.230769 | 0.307692 | 0.846154 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
37091e6d798d8ba87dae60369c0718439aecb046 | 913 | py | Python | catalyst/dl/callbacks/__init__.py | pokidyshev/catalyst | bfe2cc2af7b02bd954fb0b4a0cae8b350f56789a | [
"Apache-2.0"
] | null | null | null | catalyst/dl/callbacks/__init__.py | pokidyshev/catalyst | bfe2cc2af7b02bd954fb0b4a0cae8b350f56789a | [
"Apache-2.0"
] | null | null | null | catalyst/dl/callbacks/__init__.py | pokidyshev/catalyst | bfe2cc2af7b02bd954fb0b4a0cae8b350f56789a | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
from .checkpoint import CheckpointCallback, IterationCheckpointCallback
from .criterion import (
CriterionAggregatorCallback, CriterionCallback,
CriterionOutputOnlyCallback
)
from .inference import InferCallback, InferMaskCallback
from .logging import (
ConsoleLogger, TelegramLogger, TensorboardLogger, VerboseLogger
)
from .metrics import (
AccuracyCallback, AUCCallback, ClasswiseIouCallback,
ClasswiseJaccardCallback, DiceCallback, F1ScoreCallback, IouCallback,
JaccardCallback, MapKCallback, PrecisionRecallF1ScoreCallback
)
from .misc import (
ConfusionMatrixCallback, EarlyStoppingCallback, RaiseExceptionCallback
)
from .mixup import MixupCallback
from .optimizer import OptimizerCallback
from .phase import PhaseManagerCallback
from .scheduler import LRFinder, LRUpdater, SchedulerCallback
from .wrappers import PhaseBatchWrapperCallback, PhaseWrapperCallback
| 36.52 | 74 | 0.838992 | 67 | 913 | 11.432836 | 0.701493 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003713 | 0.115005 | 913 | 24 | 75 | 38.041667 | 0.944307 | 0.013143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
371bcd6e7d1eb85af22cc06d68bce6981f101624 | 2,331 | py | Python | api/migrations/0001_initial.py | ainline/ingo | 8e3ffc98d09895d64d8e3cc4cf6e580b6ac4452b | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | ainline/ingo | 8e3ffc98d09895d64d8e3cc4cf6e580b6ac4452b | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | ainline/ingo | 8e3ffc98d09895d64d8e3cc4cf6e580b6ac4452b | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-08-02 13:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('username', models.CharField(max_length=50)),
('password', models.CharField(max_length=50)),
('group', models.CharField(max_length=50, null=True)),
('permission', models.CharField(max_length=50, null=True)),
],
options={
'db_table': 'SYS_USER',
},
),
migrations.CreateModel(
name='UserInfo',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('age', models.CharField(max_length=50, null=True)),
('sex', models.CharField(max_length=50, null=True)),
('id_card', models.CharField(max_length=50, null=True)),
('create_time', models.CharField(max_length=50, null=True)),
('update_time', models.CharField(max_length=50, null=True)),
('email', models.CharField(max_length=50, null=True)),
('tel', models.CharField(max_length=50, null=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.User')),
],
options={
'db_table': 'SYS_USER_INFO',
},
),
migrations.CreateModel(
name='Token',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('time', models.CharField(max_length=50, null=True)),
('token', models.CharField(max_length=50, null=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.User')),
],
options={
'db_table': 'SYS_TOKEN',
},
),
]
| 39.508475 | 114 | 0.543973 | 239 | 2,331 | 5.158996 | 0.267782 | 0.170316 | 0.20438 | 0.272506 | 0.728305 | 0.644769 | 0.644769 | 0.479319 | 0.386861 | 0.386861 | 0 | 0.026708 | 0.309309 | 2,331 | 58 | 115 | 40.189655 | 0.73913 | 0.019305 | 0 | 0.392157 | 1 | 0 | 0.084939 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.019608 | 0.039216 | 0 | 0.117647 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2ed32156f6705f0063a34838b2fb269a87818aa4 | 411 | py | Python | apps/cc_cms/admin.py | FreeOurKnowledge/old_platform | 44347b331cd2526cbfd57b4c7057281ab7cd6207 | [
"MIT"
] | 11 | 2019-07-10T14:26:56.000Z | 2020-09-17T07:33:50.000Z | apps/cc_cms/admin.py | FreeOurKnowledge/platform | 44347b331cd2526cbfd57b4c7057281ab7cd6207 | [
"MIT"
] | 15 | 2018-11-21T15:11:59.000Z | 2020-11-16T05:08:04.000Z | apps/cc_cms/admin.py | FreeOurKnowledge/old_platform | 44347b331cd2526cbfd57b4c7057281ab7cd6207 | [
"MIT"
] | 2 | 2018-11-29T15:35:43.000Z | 2019-05-14T21:44:07.000Z | from django_summernote.admin import SummernoteModelAdmin
from .models import Page, ColumnsSection, Content, DynamicText
class PageAdmin(SummernoteModelAdmin):
summernote_fields = '__all__'
def register_cms(admin_site):
admin_site.register(Page, PageAdmin)
admin_site.register(ColumnsSection, PageAdmin)
admin_site.register(Content, PageAdmin)
admin_site.register(DynamicText, PageAdmin)
| 29.357143 | 62 | 0.805353 | 44 | 411 | 7.25 | 0.431818 | 0.141066 | 0.213166 | 0.244514 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121655 | 411 | 13 | 63 | 31.615385 | 0.883657 | 0 | 0 | 0 | 0 | 0 | 0.017032 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2eda27b93f538a47e172b6c061190d2f41e15674 | 2,861 | py | Python | features/steps/tutorial.py | JedCainglet/py-behave-example | 2e4bd726f2aa5568ba9440d49969e0bbc1f5e85d | [
"MIT"
] | null | null | null | features/steps/tutorial.py | JedCainglet/py-behave-example | 2e4bd726f2aa5568ba9440d49969e0bbc1f5e85d | [
"MIT"
] | 3 | 2021-01-13T03:31:07.000Z | 2021-02-15T22:55:14.000Z | features/steps/tutorial.py | JedCainglet/py-behave-example | 2e4bd726f2aa5568ba9440d49969e0bbc1f5e85d | [
"MIT"
] | null | null | null | from behave import *
# Feature: showing off behave
# Scenario: run a simple test
@given('we have behave installed')
def step_impl(context):
pass
@when('we implement a test')
def step_impl(context):
assert True is not False
@then('behave will test it for us!')
def step_impl(context):
assert context.failed is False
# Scenario: explaining behave
@given('we put the system in a known state')
def step_impl(context):
pass
@when('we take key actions the user (or external system) performs')
def step_impl(context):
assert True is not False
@then('we observe outcomes')
def step_impl(context):
assert context.failed is False
# Scenario Outline: Blenders
@given('I put Red Tree Frog in a blender')
def step_impl(context):
pass
@when('I switch the blender on')
def step_impl(context):
assert True is not False
@then('it should transform into mush')
def step_impl(context):
assert context.failed is False
@given('I put iPhone in a blender')
def step_impl(context):
pass
# NOTE: already defined
# @when('I switch the blender on')
# def step_impl(context):
# assert True is not False
@then('it should transform into toxic waste')
def step_impl(context):
assert context.failed is False
@given('I put Galaxy Nexus in a blender')
def step_impl(context):
pass
# NOTE: already defined
# @when('I switch the blender on')
# def step_impl(context):
# assert True is not False
# NOTE: already defined
# @then('it should transform into toxic waste')
# def step_impl(context):
# assert context.failed is False
# Scenario: some scenario
@given('a sample text loaded into the frobulator')
def step_impl(context):
print(context.text)
pass
@when('we activate the frobulator')
def step_impl(context):
assert True is not False
@then('we will find it similar to English')
def step_impl(context):
assert context.failed is False
# Scenario: another some scenario
@given('a set of specific users')
def step_impl(context):
for row in context.table:
print(row['name'], "--", row['department'])
@when('we count the number of people in each department')
def step_impl(context):
assert True is not False
@then('we will find two people in "Silly Walks"')
def step_impl(context):
assert context.failed is False
@then('we will find one person in "Beer Cans"')
def step_impl(context):
assert context.failed is False
# Scenario series: look up book
@given('I search for a valid book')
def step_impl(context):
context.response = "success"
pass
@given('I search for an invalid book')
def step_impl(context):
context.response = "failure"
pass
@then('the result page will include "{text}"')
def step_impl(context, text):
if text not in context.response:
raise Exception(f"expected '{context.response}', found '{text}' instead")
| 20.147887 | 81 | 0.707445 | 436 | 2,861 | 4.584862 | 0.279817 | 0.087544 | 0.137569 | 0.225113 | 0.5993 | 0.592296 | 0.570285 | 0.505253 | 0.489245 | 0.467234 | 0 | 0 | 0.189444 | 2,861 | 141 | 82 | 20.29078 | 0.862009 | 0.188396 | 0 | 0.569444 | 0 | 0 | 0.338401 | 0.009123 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.305556 | false | 0.111111 | 0.013889 | 0 | 0.319444 | 0.027778 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
2edd26e5be4188b08209fe1d68a4ecf8bc79a975 | 260 | py | Python | samples/python-concepts/arrays.py | Samples-Playgorunds/Samples.Python | 8a473fe65d7867daf80de658a124b00d90103541 | [
"MIT"
] | null | null | null | samples/python-concepts/arrays.py | Samples-Playgorunds/Samples.Python | 8a473fe65d7867daf80de658a124b00d90103541 | [
"MIT"
] | null | null | null | samples/python-concepts/arrays.py | Samples-Playgorunds/Samples.Python | 8a473fe65d7867daf80de658a124b00d90103541 | [
"MIT"
] | null | null | null |
integers = [ 1, 6, 4, 3, 15, -2]
print("integers[0] = ", integers[0])
print("integers[1] = ", integers[1])
print("integers[2] = ", integers[2])
print("integers[3] = ", integers[3])
print("integers[4] = ", integers[4])
print("integers[5] = ", integers[5])
| 20 | 36 | 0.588462 | 37 | 260 | 4.135135 | 0.27027 | 0.509804 | 0.183007 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085586 | 0.146154 | 260 | 12 | 37 | 21.666667 | 0.603604 | 0 | 0 | 0 | 0 | 0 | 0.324324 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.857143 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
2ef112e25d5ec54dade9f9fac73e6532d28fb076 | 187 | py | Python | dask/verify_dask_standalone.py | ntr/initialization-actions | fa8fd3eb75b0e106d110cee59ea2ca61620b160a | [
"Apache-2.0"
] | 426 | 2015-10-12T22:29:12.000Z | 2020-01-10T11:04:45.000Z | dask/verify_dask_standalone.py | ntr/initialization-actions | fa8fd3eb75b0e106d110cee59ea2ca61620b160a | [
"Apache-2.0"
] | 469 | 2015-11-09T17:47:27.000Z | 2020-01-15T18:46:21.000Z | dask/verify_dask_standalone.py | ntr/initialization-actions | fa8fd3eb75b0e106d110cee59ea2ca61620b160a | [
"Apache-2.0"
] | 416 | 2015-11-09T10:49:02.000Z | 2020-01-15T22:05:31.000Z | from dask.distributed import Client
import dask.array as da
import dask_ml
import dask_bigquery
import numpy as np
client = Client("localhost:8786")
x = da.sum(np.ones(5))
x.compute()
| 15.583333 | 35 | 0.764706 | 32 | 187 | 4.40625 | 0.59375 | 0.212766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031056 | 0.139037 | 187 | 11 | 36 | 17 | 0.844721 | 0 | 0 | 0 | 0 | 0 | 0.074866 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.625 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
2c0e00ec02ad1efcca34b0c401656d7cf3775296 | 400 | py | Python | server/server-flask/server.py | DSM-DMS/Project-DMS-Web | 73a5d8fc2310bca90169414abf50f541ca0724c7 | [
"MIT"
] | 11 | 2017-07-04T07:44:07.000Z | 2017-09-19T12:56:55.000Z | server/server-flask/server.py | DSM-DMS/DMS | 73a5d8fc2310bca90169414abf50f541ca0724c7 | [
"MIT"
] | null | null | null | server/server-flask/server.py | DSM-DMS/DMS | 73a5d8fc2310bca90169414abf50f541ca0724c7 | [
"MIT"
] | 2 | 2017-10-23T06:11:16.000Z | 2017-10-26T03:27:57.000Z | import threading
from app import app
from support import db_migrator
from support.api_interaction import meal
from support.apply_initializer.initializer import initialize
if __name__ == '__main__':
db_migrator.migrate_posts()
# meal.parse()
#
threading.Thread(target=initialize).start()
app.run(host=app.config['HOST'], port=app.config['PORT'], debug=app.debug, threaded=True)
| 26.666667 | 93 | 0.755 | 53 | 400 | 5.45283 | 0.54717 | 0.114187 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135 | 400 | 14 | 94 | 28.571429 | 0.83526 | 0.03 | 0 | 0 | 0 | 0 | 0.041558 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.555556 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
2c1bef4b6ac7bcc926db73e499a01fef9f111c3f | 80 | py | Python | assertion/ok.py | Jenya26/MLP | d8cd3caf0072bd684708a1d38aa893ccc16c863a | [
"MIT"
] | null | null | null | assertion/ok.py | Jenya26/MLP | d8cd3caf0072bd684708a1d38aa893ccc16c863a | [
"MIT"
] | null | null | null | assertion/ok.py | Jenya26/MLP | d8cd3caf0072bd684708a1d38aa893ccc16c863a | [
"MIT"
] | null | null | null | from .equals import equals
__all__ = ['ok']
def ok():
equals(True, True)
| 10 | 26 | 0.625 | 11 | 80 | 4.181818 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.225 | 80 | 7 | 27 | 11.428571 | 0.741935 | 0 | 0 | 0 | 0 | 0 | 0.025 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2c275f3e73d2411446f993cdceb6aa7bcf6a4bba | 215 | py | Python | simplemde/urls.py | shyojimeena/school-project | a410615e61dd22a59e79e5696227871ddaeaaa5c | [
"MIT"
] | 15 | 2016-05-14T16:20:42.000Z | 2022-02-21T14:45:17.000Z | simplemde/urls.py | shyojimeena/school-project | a410615e61dd22a59e79e5696227871ddaeaaa5c | [
"MIT"
] | null | null | null | simplemde/urls.py | shyojimeena/school-project | a410615e61dd22a59e79e5696227871ddaeaaa5c | [
"MIT"
] | 11 | 2017-09-08T16:10:17.000Z | 2021-03-30T23:56:16.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^upload/$', views.ImageUploadView.as_view(), name='upload'),
url(r'^md2html/$', views.MarkdownToHTML.as_view(), name='md2html'),
]
| 26.875 | 71 | 0.688372 | 28 | 215 | 5.214286 | 0.571429 | 0.054795 | 0.136986 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010638 | 0.125581 | 215 | 7 | 72 | 30.714286 | 0.765957 | 0 | 0 | 0 | 0 | 0 | 0.148837 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
25ee672e28d4c327bdd861e335c8eb9cec00c350 | 174 | py | Python | arp_properties.py | Sw4T/open-arp-generator | 1c03401c67940296b8ad1409803dbfd76f2fc54b | [
"MIT"
] | 1 | 2017-11-27T08:52:55.000Z | 2017-11-27T08:52:55.000Z | arp_properties.py | Sw4T/open-arp-generator | 1c03401c67940296b8ad1409803dbfd76f2fc54b | [
"MIT"
] | null | null | null | arp_properties.py | Sw4T/open-arp-generator | 1c03401c67940296b8ad1409803dbfd76f2fc54b | [
"MIT"
] | null | null | null | class ArpProperties(object):
def __init__(self, bpm, base_note, pitch_value):
self.bpm = bpm
self.base_note = base_note
self.pitch = pitch_value
| 24.857143 | 52 | 0.655172 | 23 | 174 | 4.565217 | 0.478261 | 0.228571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.258621 | 174 | 6 | 53 | 29 | 0.813953 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d3036ea873fad96bfc16dfa526956f70477eefdb | 2,019 | py | Python | py/orbit/space_charge/scAccNodes.py | LeoRya/py-orbit | 340b14b6fd041ed8ec2cc25b0821b85742aabe0c | [
"MIT"
] | 17 | 2018-02-09T23:39:06.000Z | 2022-03-04T16:27:04.000Z | py/orbit/space_charge/scAccNodes.py | LeoRya/py-orbit | 340b14b6fd041ed8ec2cc25b0821b85742aabe0c | [
"MIT"
] | 22 | 2017-05-31T19:40:14.000Z | 2021-09-24T22:07:47.000Z | py/orbit/space_charge/scAccNodes.py | LeoRya/py-orbit | 340b14b6fd041ed8ec2cc25b0821b85742aabe0c | [
"MIT"
] | 37 | 2016-12-08T19:39:35.000Z | 2022-02-11T19:59:34.000Z | """
Module. Includes abstract classes for all types of space charge accelerator nodes.
"""
import sys
import os
import math
# import the function that finalizes the execution
from orbit.utils import orbitFinalize
# import general accelerator elements and lattice
from orbit.lattice import AccLattice, AccNode, AccActionsContainer, AccNodeBunchTracker
class SC_Base_AccNode(AccNodeBunchTracker):
"""
The subclass of the AccNodeBunchTracker class. It is a base class for SC nodes. It uses the c++ space charge calculator to calculate the .
"""
def __init__(self, sc_calculator, name = "no name"):
"""
Constructor. Creates the Space Charge (SC) accelerator node element.
"""
AccNodeBunchTracker.__init__(self,name)
self.setType("SC_Base")
self.sc_length = 0.
self.switcher = True
self.sc_calculator = sc_calculator
def isRFGap(self):
"""
Returns False. The RF Gap node returns True.
"""
return False
def setLengthOfSC(self, sc_length):
"""
Defines the path length that will be used in SC kick calculations.
"""
self.sc_length = sc_length
def getLengthOfSC(self):
"""
Returns the path length that will be used in SC kick calculations.
"""
return self.sc_length
def setCalculationOn(self, switcher):
"""
Sets the boolean parameter that define if the calculations will be performed. True of False.
"""
self.switcher = True
def getCalculationOn(self):
"""
Returns the boolean parameter that define if the calculations will be performed. True of False.
"""
return self.switcher
def getCalculator(self):
"""
Returns the space-charge calculator.
"""
return self.sc_calculator
def trackDesign(self, paramsDict):
"""
This method is for Linac Nodes compatibility. It is empty and should not be used for Space Charge calculations.
"""
pass
def track(self, paramsDict):
"""
It is tracking the bunch through the Space Charge calculator. Each subclass should implement this method.
"""
pass
| 25.884615 | 139 | 0.721644 | 264 | 2,019 | 5.443182 | 0.378788 | 0.029228 | 0.033403 | 0.02366 | 0.165623 | 0.165623 | 0.165623 | 0.165623 | 0.165623 | 0.165623 | 0 | 0.000618 | 0.199108 | 2,019 | 77 | 140 | 26.220779 | 0.888064 | 0.500743 | 0 | 0.142857 | 0 | 0 | 0.01573 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.321429 | false | 0.071429 | 0.178571 | 0 | 0.678571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
d3182b27a42b7ee7c90c81d41b61ed7e422d618c | 202 | py | Python | bugtests/test314c.py | doom38/jython_v2.2.1 | 0803a0c953c294e6d14f9fc7d08edf6a3e630a15 | [
"CNRI-Jython"
] | null | null | null | bugtests/test314c.py | doom38/jython_v2.2.1 | 0803a0c953c294e6d14f9fc7d08edf6a3e630a15 | [
"CNRI-Jython"
] | null | null | null | bugtests/test314c.py | doom38/jython_v2.2.1 | 0803a0c953c294e6d14f9fc7d08edf6a3e630a15 | [
"CNRI-Jython"
] | null | null | null |
import string
s = "elem1 elem2"
try:
(a, b, c) = string.split(s)
(d, e, f) = string.split(s)
pass
except ValueError:
pass
else:
print support.TestError("Should raise a ValueError")
| 14.428571 | 55 | 0.628713 | 30 | 202 | 4.233333 | 0.733333 | 0.173228 | 0.188976 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012987 | 0.237624 | 202 | 13 | 56 | 15.538462 | 0.811688 | 0 | 0 | 0.2 | 0 | 0 | 0.180905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.2 | 0.1 | null | null | 0.1 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
d32adf385defb68f90abfa9394c5fa465a44cd02 | 9,907 | py | Python | uvvispy/analysis.py | tillbiskup/uvvispy | 99f11a9dc14cd34e50887bdca42b81388758d41a | [
"BSD-2-Clause"
] | 1 | 2021-03-16T05:39:39.000Z | 2021-03-16T05:39:39.000Z | uvvispy/analysis.py | tillbiskup/uvvispy | 99f11a9dc14cd34e50887bdca42b81388758d41a | [
"BSD-2-Clause"
] | null | null | null | uvvispy/analysis.py | tillbiskup/uvvispy | 99f11a9dc14cd34e50887bdca42b81388758d41a | [
"BSD-2-Clause"
] | null | null | null | """Data analysis functionality.
.. sidebar:: Processing vs. analysis steps
The key difference between processing and analysis steps: While a
processing step *modifies* the data of the dataset it operates on,
an analysis step returns a result based on data of a dataset, but leaves
the original dataset unchanged.
Key to reproducible science is automatic documentation of each analysis
step applied to the data of a dataset. Such an analysis step each is
self-contained, meaning it contains every necessary information to perform
the analysis task on a given dataset.
Analysis steps, in contrast to processing steps (see
:mod:`aspecd.processing` for details), operate on data of a
:class:`aspecd.dataset.Dataset`, but don't change its data. Rather,
some result is obtained that is stored separately, together with the
parameters of the analysis step, in the
:attr:`aspecd.dataset.Dataset.analyses` attribute of the dataset.
Analysis steps implemented
==========================
The analysis steps implemented in this module can be separated into those
specific for UVVis data and those that are generally applicable and were
inherited from the ASpecD framework.
Specific analysis steps for UVVis data
--------------------------------------
Currently, there are no specific analysis steps implemented.
General analysis steps inherited from the ASpecD framework
----------------------------------------------------------
A number of further analysis steps that are generally applicable to
spectroscopic data have been inherited from the underlying ASpecD framework:
* :class:`BasicCharacteristics`
Extract basic characteristics of a dataset
* :class:`BasicStatistics`
Extract basic statistical measures of a dataset
* :class:`BlindSNREstimation`
Blind, *i.e.* parameter-free, estimation of the signal-to-noise ratio
* :class:`PeakFinding`
Find peaks in 1D datasets
Module documentation
====================
"""
import aspecd.analysis
class BasicCharacteristics(aspecd.analysis.BasicCharacteristics):
"""Extract basic characteristics of a dataset.
Extracting basic characteristics (minimum, maximum, area, amplitude) of
a dataset is programmatically quite simple. This class provides a
working solution from within the ASpecD framework.
As the class is fully inherited from ASpecD for simple usage, see the
ASpecD documentation for the :class:`aspecd.analysis.BasicCharacteristics`
class for details.
Examples
--------
For convenience, a series of examples in recipe style (for details of
the recipe-driven data analysis, see :mod:`aspecd.tasks`) is given below
for how to make use of this class. The examples focus each on a single
aspect.
Extracting the characteristic of a dataset is quite simple:
.. code-block:: yaml
- kind: singleanalysis
type: BasicCharacteristics
properties:
parameters:
type: min
result: min_of_dataset
This would simply return the minimum (value) of a given dataset in the
result assigned to the recipe-internal variable ``min_of_dataset``.
Similarly, you can extract "max", "area", and "amplitude" from your
dataset. In case you are interested in the axes values or indices,
set the output parameter appropriately:
.. code-block:: yaml
- kind: singleanalysis
type: BasicCharacteristics
properties:
parameters:
type: min
output: axes
result: min_of_dataset
In this particular case, this would return the axes values of the
global minimum of your dataset in the result. Note that those other
output types are only available for "min" and "max", as "area" and
"amplitude" have no analogon on the axes.
Sometimes, you are interested in getting the values of all
characteristics at once in form of a dictionary:
.. code-block:: yaml
- kind: singleanalysis
type: BasicCharacteristics
properties:
parameters:
type: all
result: characteristics_of_dataset
Make sure to understand the different types the result has depending on
the characteristic and output type chosen. For details, see the table
above.
"""
class BasicStatistics(aspecd.analysis.BasicStatistics):
"""Extract basic statistical measures of a dataset.
Extracting basic statistical measures (mean, median, std, var) of
a dataset is programmatically quite simple. This class provides a
working solution from within the ASpecD framework.
As the class is fully inherited from ASpecD for simple usage, see the
ASpecD documentation for the :class:`aspecd.analysis.BasicStatistics`
class for details.
Examples
--------
For convenience, a series of examples in recipe style (for details of
the recipe-driven data analysis, see :mod:`aspecd.tasks`) is given below
for how to make use of this class. The examples focus each on a single
aspect.
Some description here...
.. code-block:: yaml
- kind: singleanalysis
type: BasicStatistics
"""
class BlindSNREstimation(aspecd.analysis.BlindSNREstimation):
"""Blind, *i.e.* parameter-free, estimation of the signal-to-noise ratio.
In spectroscopy, the signal-to-noise ratio (SNR) is usually defined as the
ratio of mean (of the signal) to standard deviation (of the noise) of a
signal or measurement.
For accurate estimations, this requires to be able to separate noise and
signal, hence to define a part of the overall measurement not including
signal. As this is not always possible, there are different ways to make
a blind estimate of the SNR, *i.e.* without additional parameters.
As the class is fully inherited from ASpecD for simple usage, see the
ASpecD documentation for the :class:`aspecd.analysis.BlindSNREstimation`
class for details.
Examples
--------
For convenience, a series of examples in recipe style (for details of
the recipe-driven data analysis, see :mod:`aspecd.tasks`) is given below
for how to make use of this class. The examples focus each on a single
aspect.
Obtaining a blind estimate of the SNR of a dataset is quite simple:
.. code-block:: yaml
- kind: singleanalysis
type: BlindSNREstimation
result: SNR_of_dataset
This would simply return the SNR of the data of a given dataset in the
result assigned to the recipe-internal variable ``SNR_of_dataset``.
To have more control over the method used to blindly estimate the SNR,
explicitly provide a method:
.. code-block:: yaml
- kind: singleanalysis
type: BlindSNREstimation
properties:
parameters:
method: der_snr
result: SNR_of_dataset
This would use the DER_SNR method as described above.
"""
class PeakFinding(aspecd.analysis.PeakFinding):
"""Peak finding in one dimension.
Finding peaks is a use case often encountered in analysing spectroscopic
data, but it is far from trivial and usually requires careful choosing
of parameters to yield sensible results.
As the class is fully inherited from ASpecD for simple usage, see the
ASpecD documentation for the :class:`aspecd.analysis.PeakFinding`
class for details.
Examples
--------
For convenience, a series of examples in recipe style (for details of
the recipe-driven data analysis, see :mod:`aspecd.tasks`) is given below
for how to make use of this class. The examples focus each on a single
aspect.
Finding the peak positions of a basically noise-free dataset is quite
simple:
.. code-block:: yaml
- kind: singleanalysis
type: PeakFinding
result: peaks
This would simply return the peak positions of the data of a given dataset
in the result assigned to the recipe-internal variable ``peaks``.
To have more control over the method used to find peaks, you can set a
number of parameters. To get the negative peaks as well (normally,
only positive peaks will be looked for):
.. code-block:: yaml
- kind: singleanalysis
type: PeakFinding
properties:
parameters:
negative_peaks: True
result: peaks
Sometimes it is convenient to have the peaks returned as a dataset,
to plot the data and highlight the peaks found:
.. code-block:: yaml
- kind: singleanalysis
type: PeakFinding
properties:
parameters:
return_dataset: True
result: peaks
From the options that can be set for the function
:func:`scipy.signal.find_peaks`, you can set "height", "threshold",
"distance", "prominence", and "width". For details, see the SciPy
documentation.
For noisy data, "prominence" can be a good option to only find "true" peaks:
.. code-block:: yaml
- kind: singleanalysis
type: PeakFinding
properties:
parameters:
prominence: 0.2
result: peaks
If you supply one of these additional options, you might be interested
not only in the peak positions, but in the properties of the peaks found
as well.
.. code-block:: yaml
- kind: singleanalysis
type: PeakFinding
properties:
parameters:
prominence: 0.2
return_properties: True
result: peaks
In this case, the result, here stored in the variable "peaks", will be a
tuple with the peak positions as first element and a dictionary with
properties as the second element. Note that if you ask for negative
peaks as well, this option will silently be ignored and only the peak
positions returned.
"""
| 32.061489 | 80 | 0.692843 | 1,307 | 9,907 | 5.236419 | 0.228768 | 0.01315 | 0.020894 | 0.027323 | 0.457043 | 0.431765 | 0.414962 | 0.37668 | 0.360316 | 0.330508 | 0 | 0.000664 | 0.239931 | 9,907 | 308 | 81 | 32.165584 | 0.908234 | 0.899364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
d33ede936bd70d6eb0ca09853f9eb730ba300e4a | 7,898 | py | Python | OCDTrash.py | OpenLinkedSocialData/ocd | fab93bb2ac671fc08b8847d72e19ba90659572bd | [
"Unlicense"
] | null | null | null | OCDTrash.py | OpenLinkedSocialData/ocd | fab93bb2ac671fc08b8847d72e19ba90659572bd | [
"Unlicense"
] | null | null | null | OCDTrash.py | OpenLinkedSocialData/ocd | fab93bb2ac671fc08b8847d72e19ba90659572bd | [
"Unlicense"
] | 1 | 2020-09-23T17:47:29.000Z | 2020-09-23T17:47:29.000Z | #g = r.Graph()
#g.load("cdTriplestore.rdf")
#print time.time()-T
# mais de 4 minutos para carregar
#ss=set([s for s in g.subjects()])
#len(ss)
#oo=set([s for s in g.objects()])
#len(ss)
#len(oo)
#pp=set([s for s in g.predicates()])
#classes=g.objects(predicate=r.RDF.type)
# classes que apareceram na triplificacao dos dados
#classes_=set([cc for cc in classes])
#properties=set([s for s in g.predicates()])
propriedades=[r.term.URIRef(u'http://purl.org/socialparticipation/ocd/commentCount'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/cep'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/commentBody'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/supporter'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/contact'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/start'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/tagger'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/partners'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/mbox'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/tagged'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/relatedOntology'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/inspirationCount'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/commentType'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/abreviation'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/state'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/text'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/author'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/neighborhood'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/image'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/relevance'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/description'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/contentType'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/size'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/authorDescription'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/ip'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/supportCount'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/longDescription'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/offerer'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/birthday'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/emailTrigger'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/city'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/competition'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/height'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/user'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/userDescription'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/updated'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/phone'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/followersCount'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/status'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/filename'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/regulation'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/tag'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/width'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/created'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/shortDescription'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/name'),
r.term.URIRef(u'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/caption'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/software'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/type'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/fax'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/url'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/awards'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/deleted'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/responsible'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/gender'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/title'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/site'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/articleBody'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/topic')]
classes=[r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Login'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Problem'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Triplestore'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Image'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Inspiration'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Neighborhood'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Tag'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Post'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Observatory'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Comment'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Competition'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/State'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Proposal'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Tagging'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/MacroTag'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Place'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Support'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/City'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Prize'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/Link'),
r.term.URIRef(u'http://purl.org/socialparticipation/ocd/User')]
print time.time()-T
#sparql = SPARQLWrapper("http://200.144.255.210:8082/cidadedemocratica/query") # com reasoner
G(ocd.abbreviation, rdf.type, owl.DatatypeProperty)
G(ocd.abbreviation, rdf.type, owl.functionalProperty)
G(ocd.abbreviation, rdfs.range, xsd.string)
G(ocd.abbreviation, rdfs.domain, ocd.State)
propsD[ocd.abbreviation]=1
G(ocd.accountable, rdf.type, owl.ObjectProperty)
G(ocd.accountable, rdf.type, owl.functionalProperty)
B=r.BNode()
G(ocd.accountable, rdfs.range, B)
G(B, owl.unionOf, ocd.User)
G(B, owl.unionOf, ocd.Post)
G(B, owl.unionOf, ocd.Proposal)
G(B, owl.unionOf, ocd.Observatory)
G(B, owl.unionOf, ocd.Problem)
G(B, owl.unionOf, ocd.Competition)
B2=r.BNode()
G(ocd.accountable, rdfs.domain, B2)
G(B2, owl.unionOf, ocd.Place)
G(B2, owl.unionOf, ocd.Image)
propsD[ocd.accountable]=1
G(ocd.author, rdf.type, owl.ObjectProperty)
G(ocd.author, rdf.type, owl.functionalProperty)
G(ocd.author, rdfs.range, ocd.User)
B=r.BNode()
G(ocd.author, rdfs.domain, B)
G(B, owl.unionOf, ocd.Proposal)
G(B, owl.unionOf, ocd.Post)
G(B, owl.unionOf, ocd.Problem)
G(B, owl.unionOf, ocd.Comment)
G(B, owl.unionOf, ocd.Inspiration)
propsD[ocd.author]=1
G(ocd.authorDescription, rdf.type, owl.DatatypeProperty)
G(ocd.authorDescription, rdf.type, owl.functionalProperty)
G(ocd.authorDescription, rdfs.range, xsd.string)
G(ocd.authorDescription, rdfs.domain, ocd.Competition)
G(ocd.autoDescription, rdf.type, owl.DatatypeProperty)
G(ocd.autoDescription, rdf.type, owl.functionalProperty)
G(ocd.autoDescription, rdfs.range, xsd.string)
G(ocd.autoDescription, rdfs.domain, ocd.User)
| 53.006711 | 93 | 0.730185 | 1,145 | 7,898 | 5.035808 | 0.134498 | 0.070239 | 0.154527 | 0.168574 | 0.792057 | 0.77905 | 0.678287 | 0.671002 | 0.671002 | 0.233958 | 0 | 0.004554 | 0.082426 | 7,898 | 148 | 94 | 53.364865 | 0.791086 | 0.059635 | 0 | 0.066116 | 0 | 0.008264 | 0.520918 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.008264 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d34d5242dc7f07f22b085adaceca3f872ff7ef39 | 14,519 | py | Python | xmlstarlet/__init__.py | dimitern/xmlstarlet | f6304e1f1baff1867b0101501b3f73f09809ec0f | [
"MIT"
] | 8 | 2019-10-31T11:48:08.000Z | 2022-03-11T16:37:39.000Z | xmlstarlet/__init__.py | sthagen/xmlstarlet | 84ec8599c1f21ced9fc912ab30cecff629bed2a8 | [
"MIT"
] | 16 | 2020-04-06T15:11:16.000Z | 2022-03-28T07:23:35.000Z | xmlstarlet/__init__.py | sthagen/xmlstarlet | 84ec8599c1f21ced9fc912ab30cecff629bed2a8 | [
"MIT"
] | 2 | 2020-10-12T13:47:43.000Z | 2020-12-22T05:32:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
CFFI bindings to enable using the XMLStarlet Toolkit Command-line utilities for XML
processing from Python.
All commands are supported:
edit(*args) - Edit/Update XML document(s)
select(*args) - Select data or query XML document(s) (XPATH, etc)
transform(*args) - Transform XML document(s) using XSLT
validate(*args) - Validate XML document(s) (well-formed/DTD/XSD/RelaxNG)
format(*args) - Format XML document(s)
elements(*args) - Display element structure of XML document
canonicalize(*args) - XML canonicalization
listdir(*args) - List directory as XML
escape(*args) - Escape special XML characters
unescape(*args) - Unescape special XML characters
pyx(*args) - Convert XML into PYX format (based on ESIS - ISO 8879)
depyx(*args) - Convert PYX into XML
Each of these functions takes string arguments and returns the integer exit code
(0 = success, otherwise an error occured).
"""
import xmlstarlet._xmlstarlet
_ffi = xmlstarlet._xmlstarlet.ffi # pylint: disable=protected-access
_lib = xmlstarlet._xmlstarlet.lib # pylint: disable=protected-access
__author__ = """Mikhail Grushinskiy"""
__email__ = "mgrouch@users.sourceforge.net"
__version__ = "1.6.7"
def _call_main(*args, main_func, escape_flag=-1):
args = ["xmlstarlet", "command"] + list(args)
ffi_args = []
for arg in args:
barg = bytes(arg, encoding="utf-8")
cdata = _ffi.new("char[]", barg)
ffi_args += [cdata]
ffi_argv = _ffi.new("char *[]", ffi_args)
ffi_argc = len(args)
if escape_flag != -1:
result = main_func(ffi_argc, ffi_argv, escape_flag)
else:
result = main_func(ffi_argc, ffi_argv)
return result
def edit(*args):
"""
Edit/Update XML document(s).
`*args` contain string commands and/or options in the following format:
<global-options> {<action>} [ <xml-file-or-uri> ... ]
where
<global-options> - global options for editing
<xml-file-or-uri> - input XML document file name/uri (stdin otherwise)
<global-options> are:
-P, or -S - preserve whitespace nodes.
(or --pf, --ps) Note that space between attributes is not preserved
-O (or --omit-decl) - omit XML declaration (<?xml ...?>)
-L (or --inplace) - edit file inplace
-N <name>=<value> - predefine namespaces (name without 'xmlns:')
ex: xsql=urn:oracle-xsql
Multiple -N options are allowed.
-N options must be last global options.
--net - allow network access
--help or -h - display help
where <action>
-d or --delete <xpath>
--var <name> <xpath>
-i or --insert <xpath> -t (--type) elem|text|attr -n <name> [-v (--value) <value>]
-a or --append <xpath> -t (--type) elem|text|attr -n <name> [-v (--value) <value>]
-s or --subnode <xpath> -t (--type) elem|text|attr -n <name> [-v (--value) <value>]
-m or --move <xpath1> <xpath2>
-r or --rename <xpath1> -v <new-name>
-u or --update <xpath> -v (--value) <value>
-x (--expr) <xpath>
"""
return _call_main(*args, main_func=_lib.edMain)
def select(*args):
"""
Select from XML document(s).
`*args` contain string commands and/or options in the following format:
<global-options> {<template>} [ <xml-file> ... ]
where
<global-options> - global options for selecting
<xml-file> - input XML document file name/uri (stdin is used if missing)
<template> - template for querying XML document with following syntax:
<global-options> are:
-Q or --quiet - do not write anything to standard output.
-C or --comp - display generated XSLT
-R or --root - print root element <xsl-select>
-T or --text - output is text (default is XML)
-I or --indent - indent output
-D or --xml-decl - do not omit xml declaration line
-B or --noblanks - remove insignificant spaces from XML tree
-E or --encode <encoding> - output in the given encoding (utf-8, unicode...)
-N <name>=<value> - predefine namespaces (name without 'xmlns:')
ex: xsql=urn:oracle-xsql
Multiple -N options are allowed.
--net - allow fetch DTDs or entities over network
--help - display help
Syntax for templates: -t|--template <options>
where <options>
-c or --copy-of <xpath> - print copy of XPATH expression
-v or --value-of <xpath> - print value of XPATH expression
-o or --output <string> - output string literal
-n or --nl - print new line
-f or --inp-name - print input file name (or URL)
-m or --match <xpath> - match XPATH expression
--var <name> <value> --break or
--var <name>=<value> - declare a variable (referenced by $name)
-i or --if <test-xpath> - check condition <xsl:if test="test-xpath">
--elif <test-xpath> - check condition if previous conditions failed
--else - check if previous conditions failed
-e or --elem <name> - print out element <xsl:element name="name">
-a or --attr <name> - add attribute <xsl:attribute name="name">
-b or --break - break nesting
-s or --sort op xpath - sort in order (used after -m) where
op is X:Y:Z,
X is A - for order="ascending"
X is D - for order="descending"
Y is N - for data-type="numeric"
Y is T - for data-type="text"
Z is U - for case-order="upper-first"
Z is L - for case-order="lower-first"
There can be multiple --match, --copy-of, --value-of, etc options
in a single template. The effect of applying command line templates
can be illustrated with the following XSLT analogue
xmlstarlet.select(
"-t", "-c", "xpath0", "-m", "xpath1", "-m", "xpath2", "-v", "xpath3",
"-t", "-m", "xpath4", "-c", "xpath5", "input.xml")
is equivalent to applying the following XSLT
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:call-template name="t1"/>
<xsl:call-template name="t2"/>
</xsl:template>
<xsl:template name="t1">
<xsl:copy-of select="xpath0"/>
<xsl:for-each select="xpath1">
<xsl:for-each select="xpath2">
<xsl:value-of select="xpath3"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template name="t2">
<xsl:for-each select="xpath4">
<xsl:copy-of select="xpath5"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
"""
return _call_main(*args, main_func=_lib.selMain)
def transform(*args):
"""
Transform XML document(s) using XSLT.
`*args` contain string commands and/or options in the following format:
[<options>] <xsl-file> {-p|-s <name>=<value>} [<xml-file>...]
where
<xsl-file> - main XSLT stylesheet for transformation
<xml-file> - input XML document file/URL (stdin is used if missing)
<name>=<value> - name and value of the parameter passed to XSLT processor
-p - parameter is XPATH expression ("'string'" to quote string)
-s - parameter is a string literal
<options> are:
--help or -h - display help message
--omit-decl - omit xml declaration <?xml version="1.0"?>
--embed or -E - allow applying embedded stylesheet
--show-ext - show list of extensions
--val - allow validate against DTDs or schemas
--net - allow fetch DTDs or entities over network
--xinclude - do XInclude processing on document input
--maxdepth val - increase the maximum depth
--html - input document(s) is(are) in HTML format
"""
return _call_main(*args, main_func=_lib.trMain)
def validate(*args):
"""
Validate XML document(s) (well-formed/DTD/XSD/RelaxNG).
`*args` contain string commands and/or options in the following format:
<options> [ <xml-file-or-uri> ... ]
where <options>
-w or --well-formed - validate well-formedness only (default)
-d or --dtd <dtd-file> - validate against DTD
--net - allow network access
-s or --xsd <xsd-file> - validate against XSD schema
-E or --embed - validate using embedded DTD
-r or --relaxng <rng-file> - validate against Relax-NG schema
-e or --err - print verbose error messages on stderr
-S or --stop - stop on first error
-b or --list-bad - list only files which do not validate
-g or --list-good - list only files which validate
-q or --quiet - do not list files (return result code only)
NOTE: XML Schemas are not fully supported yet due to its incomplete
support in libxml2 (see http://xmlsoft.org)
"""
return _call_main(*args, main_func=_lib.valMain)
def format(*args): # pylint:disable=redefined-builtin
"""
Format XML document(s).
`*args` contain string commands and/or options in the following format:
[<options>] <xml-file>
where <options> are
-n or --noindent - do not indent
-t or --indent-tab - indent output with tabulation
-s or --indent-spaces <num> - indent output with <num> spaces
-o or --omit-decl - omit xml declaration <?xml version="1.0"?>
--net - allow network access
-R or --recover - try to recover what is parsable
-D or --dropdtd - remove the DOCTYPE of the input docs
-C or --nocdata - replace cdata section with text nodes
-N or --nsclean - remove redundant namespace declarations
-e or --encode <encoding> - output in the given encoding (utf-8, unicode...)
-H or --html - input is HTML
-h or --help - print help
"""
return _call_main(*args, main_func=_lib.foMain)
def element(*args):
"""
Display element structure of XML document.
`*args` contain string commands and/or options in the following format:
[<options>] <xml-file>
where
<xml-file> - input XML document file name (stdin is used if missing)
<options> is one of:
-a - show attributes as well
-v - show attributes and their values
-u - print out sorted unique lines
-d<n> - print out sorted unique lines up to depth <n>
"""
return _call_main(*args, main_func=_lib.elMain)
def canonicalize(*args):
"""
XML canonicalization.
`*args` contain string commands and/or options in the following format:
[--net] <mode> <xml-file> [<xpath-file>] [<inclusive-ns-list>]
where
<xml-file> - input XML document file name (stdin is used if '-')
<xpath-file> - XML file containing XPath expression for
c14n XML canonicalization
Example:
<?xml version="1.0"?>
<XPath xmlns:n0="http://a.example.com" xmlns:n1="http://b.example">
(//. | //@* | //namespace::*)[ancestor-or-self::n1:elem1]
</XPath>
<inclusive-ns-list> - the list of inclusive namespace prefixes
(only for exclusive canonicalization)
Example: 'n1 n2'
<mode> is one of following:
--with-comments XML file canonicalization w comments (default)
--without-comments XML file canonicalization w/o comments
--exc-with-comments Exclusive XML file canonicalization w comments
--exc-without-comments Exclusive XML file canonicalization w/o comments
"""
return _call_main(*args, main_func=_lib.c14nMain)
def listdir(*args):
"""
List directory as XML.
`*args` contain string commands and/or options in the following format:
[ <dir> | --help ]
Lists current directory in XML format.
Time is shown per ISO 8601 spec.
"""
return _call_main(*args, main_func=_lib.lsMain)
def escape(*args):
"""
Escape special XML characters.
`*args` contain string commands and/or options in the following format:
[<options>] [<string>]
where <options> are
--help - print usage
if <string> is missing stdin is used instead.
"""
return _call_main(*args, main_func=_lib.escMain, escape_flag=1)
def unescape(*args):
"""
Unescape special XML characters.
`*args` contain string commands and/or options in the following format:
[<options>] [<string>]
where <options> are
--help - print usage
if <string> is missing stdin is used instead.
"""
return _call_main(*args, main_func=_lib.escMain, escape_flag=0)
def pyx(*args):
"""
Convert XML into PYX format (based on ESIS - ISO 8879).
`*args` contain string commands and/or options in the following format:
{<xml-file>}
where
<xml-file> - input XML document file name (stdin is used if missing)
The PYX format is a line-oriented representation of
XML documents that is derived from the SGML ESIS format.
(see ESIS - ISO 8879 Element Structure Information Set spec,
ISO/IEC JTC1/SC18/WG8 N931 (ESIS))
A non-validating, ESIS generating tool originally developed for
pyxie project (see http://pyxie.sourceforge.net/)
ESIS Generation by Sean Mc Grath http://www.digitome.com/sean.html
"""
return _call_main(*args, main_func=_lib.pyxMain)
def depyx(*args):
"""
Convert PYX into XML.
`*args` contain string commands and/or options in the following format:
[<pyx-file>]
where
<pyx-file> - input PYX document file name (stdin is used if missing)
The PYX format is a line-oriented representation of
XML documents that is derived from the SGML ESIS format.
(see ESIS - ISO 8879 Element Structure Information Set spec,
ISO/IEC JTC1/SC18/WG8 N931 (ESIS))
"""
return _call_main(*args, main_func=_lib.depyxMain)
| 36.664141 | 89 | 0.600041 | 1,881 | 14,519 | 4.585859 | 0.228602 | 0.024229 | 0.018085 | 0.024113 | 0.441456 | 0.408648 | 0.352655 | 0.289474 | 0.266636 | 0.257825 | 0 | 0.008752 | 0.283835 | 14,519 | 395 | 90 | 36.756962 | 0.820831 | 0.813486 | 0 | 0 | 0 | 0 | 0.052725 | 0.01718 | 0 | 0 | 0 | 0 | 0 | 1 | 0.295455 | false | 0 | 0.022727 | 0 | 0.613636 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
d3677a871e64bdab89db62e6195243b0bb7f27cf | 973 | py | Python | tools/models/processing.py | JwDong2019/CVWC-2019-FCOS | 9c343dc820aea7bc79ee0b8206527fa48ebf106f | [
"Apache-2.0"
] | null | null | null | tools/models/processing.py | JwDong2019/CVWC-2019-FCOS | 9c343dc820aea7bc79ee0b8206527fa48ebf106f | [
"Apache-2.0"
] | null | null | null | tools/models/processing.py | JwDong2019/CVWC-2019-FCOS | 9c343dc820aea7bc79ee0b8206527fa48ebf106f | [
"Apache-2.0"
] | null | null | null | import torch
pretrained_weights = torch.load('fcos_mstrain_640_800_r101_caffe_fpn_gn_2x_4gpu_20190516-42e6f62d.pth')
num_class = 2
# store = []
# for index, name in enumerate(pretrained_weights['state_dict']):
# store.append(name)
# a = store[500:]
# b = pretrained_weights['state_dict']['bbox_head.fcos_cls.weight']
# c = pretrained_weights['state_dict']['bbox_head.fcos_cls.bias']
# d = pretrained_weights['state_dict']['bbox_head.scales.0.scale']
# e = pretrained_weights['state_dict']['bbox_head.scales.1.scale']
pretrained_weights['state_dict']['bbox_head.fcos_cls.weight'].resize_(num_class, 1024, 3, 3)
pretrained_weights['state_dict']['bbox_head.fcos_cls.bias'].resize_(num_class)
pretrained_weights['state_dict']['bbox_head.fcos_reg.weight'].resize_(num_class*4, 1024, 3, 3)
pretrained_weights['state_dict']['bbox_head.fcos_reg.bias'].resize_(num_class*4)
torch.save(pretrained_weights, "fcos_mstrain_640_800_r101_caffe_fpn_gn_2x_4gpu_%d.pth"%num_class)
| 44.227273 | 104 | 0.782117 | 152 | 973 | 4.585526 | 0.335526 | 0.268293 | 0.284075 | 0.335725 | 0.619799 | 0.619799 | 0.619799 | 0.505022 | 0.441894 | 0.232425 | 0 | 0.060373 | 0.06372 | 973 | 21 | 105 | 46.333333 | 0.70472 | 0.38335 | 0 | 0 | 0 | 0 | 0.434856 | 0.367174 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d37839cd1edcc6eee8e41ce70b4f642896dbd2cb | 737 | py | Python | backend/autobets/apimb/trading_logic.py | slarkjm0803/autobets | f92a5d999acaf5d7c83ca2768a260c2282eabbee | [
"MIT"
] | 1 | 2020-03-06T14:29:12.000Z | 2020-03-06T14:29:12.000Z | backend/autobets/apimb/trading_logic.py | slarkjm0803/autobets | f92a5d999acaf5d7c83ca2768a260c2282eabbee | [
"MIT"
] | null | null | null | backend/autobets/apimb/trading_logic.py | slarkjm0803/autobets | f92a5d999acaf5d7c83ca2768a260c2282eabbee | [
"MIT"
] | null | null | null | from django.db.models.signals import pre_save, pre_delete, post_save, post_delete
from django.dispatch import receiver
from .client import get_client
from .models import Stakes, UserStakes, BetTriggers
from matchbook.enums import Side
from matchbook.endpoints.betting import Betting
from matchbook.enums import Side, Status, AggregationType
@receiver(post_save, sender=BetTriggers)
def check_bet_triggers(sender, instance, created, **kwargs):
get_user_stake = UserStakes.objects.get(id=1)
user_back_order = get_user_stake.back_stake
user_lay_order = get_user_stake.lay_stake
pass
'''
1 If instance is Autostake use Autostake
2 If instance is User Stake use UserStake
3 If Trigger is met place Bet
4
5
6
'''
| 22.333333 | 81 | 0.789688 | 111 | 737 | 5.063063 | 0.486486 | 0.064057 | 0.064057 | 0.085409 | 0.099644 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011147 | 0.147897 | 737 | 32 | 82 | 23.03125 | 0.883758 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.076923 | false | 0.076923 | 0.538462 | 0 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
6c9a41f0b07e9611704343f42383692ff72613b3 | 1,332 | py | Python | thunder/__init__.py | pearsonlab/thunder | b15ba0a38642312d597a98643cf3514e2d46b69d | [
"Apache-2.0"
] | 1 | 2017-02-02T19:14:42.000Z | 2017-02-02T19:14:42.000Z | thunder/__init__.py | pearsonlab/thunder | b15ba0a38642312d597a98643cf3514e2d46b69d | [
"Apache-2.0"
] | null | null | null | thunder/__init__.py | pearsonlab/thunder | b15ba0a38642312d597a98643cf3514e2d46b69d | [
"Apache-2.0"
] | null | null | null | # analyses
from thunder.decoding.uniclassify import MassUnivariateClassifier
from thunder.decoding.uniclassify import GaussNaiveBayesClassifier, TTestClassifier
from thunder.factorization.pca import PCA
from thunder.factorization.svd import SVD
from thunder.factorization.ica import ICA
from thunder.factorization.nmf import NMF
from thunder.clustering.kmeans import KMeans, KMeansModel
from thunder.regression.linear.algorithms import LinearRegression
from thunder.regression.linear.algorithms import OrdinaryLinearRegression, TikhonovLinearRegression, RidgeLinearRegression
from thunder.regression.nonlinear.tuning import TuningModel
from thunder.regression.nonlinear.tuning import GaussianTuningModel, CircularTuningModel
from thunder.registration.registration import Registration, RegistrationModel
from thunder.extraction.extraction import SourceExtraction
from thunder.extraction.source import Source, SourceModel
# data types
from thunder.rdds.series import Series
from thunder.rdds.spatialseries import SpatialSeries
from thunder.rdds.timeseries import TimeSeries
from thunder.rdds.matrices import RowMatrix
from thunder.rdds.images import Images
# utilities
from thunder.viz.colorize import Colorize
from thunder.utils.datasets import DataSets
from thunder.utils.context import ThunderContext
__version__ = "0.6.0.dev" | 45.931034 | 122 | 0.87012 | 152 | 1,332 | 7.598684 | 0.361842 | 0.209524 | 0.064935 | 0.051948 | 0.209524 | 0.147186 | 0 | 0 | 0 | 0 | 0 | 0.002453 | 0.081832 | 1,332 | 29 | 123 | 45.931034 | 0.941946 | 0.021772 | 0 | 0 | 0 | 0 | 0.006923 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.956522 | 0 | 0.956522 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
6cabd9b477da4843e2686e303f50357c703f4c16 | 99 | py | Python | scripts/nbgrader_config_undergrad.py | majomarin/Python4Geosciences | b40e016695ddf8c07764271d5960c699d13760a8 | [
"MIT"
] | 44 | 2016-10-05T19:11:20.000Z | 2022-01-03T06:05:27.000Z | scripts/nbgrader_config_undergrad.py | iitbbsvijay2020/python4geosciences | b40e016695ddf8c07764271d5960c699d13760a8 | [
"MIT"
] | null | null | null | scripts/nbgrader_config_undergrad.py | iitbbsvijay2020/python4geosciences | b40e016695ddf8c07764271d5960c699d13760a8 | [
"MIT"
] | 27 | 2017-01-11T22:33:07.000Z | 2021-11-18T11:23:05.000Z | c = get_config()
c.Exchange.root = '/srv/nbgrader/exchange'
c.Exchange.course_id = "2018s-ocng469"
| 24.75 | 42 | 0.737374 | 15 | 99 | 4.733333 | 0.733333 | 0.253521 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.077778 | 0.090909 | 99 | 3 | 43 | 33 | 0.711111 | 0 | 0 | 0 | 0 | 0 | 0.353535 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
6cec196a76cad4782937b93c111e488de6d49ce0 | 243 | py | Python | keyword,default,required arguments.py | karanjakhar/python-programs | 316cd4e83ae39c1d1e70c2a5e8a9329641bad9e1 | [
"MIT"
] | 1 | 2019-09-02T15:56:38.000Z | 2019-09-02T15:56:38.000Z | keyword,default,required arguments.py | karanjakhar/python-programs | 316cd4e83ae39c1d1e70c2a5e8a9329641bad9e1 | [
"MIT"
] | null | null | null | keyword,default,required arguments.py | karanjakhar/python-programs | 316cd4e83ae39c1d1e70c2a5e8a9329641bad9e1 | [
"MIT"
] | null | null | null | #default
def printx(name,age):
print(name)
print(age)
return;
printx(name='miki',age=96)
#keyword
def printm(str):
print(str)
return;
printm(str='sandy')
#required
def printme(str):
print(str)
return;
printme()
| 14.294118 | 27 | 0.633745 | 33 | 243 | 4.666667 | 0.454545 | 0.12987 | 0.142857 | 0.220779 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010417 | 0.209877 | 243 | 16 | 28 | 15.1875 | 0.791667 | 0.090535 | 0 | 0.384615 | 0 | 0 | 0.044554 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0 | 0 | 0.230769 | 0.769231 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
6cf3cc051b817e67b03a291ba93a7c0bd83a432b | 417 | py | Python | lesson9/class_car.py | kelinsobw/lessons | cc0008c31c3397ddadfa80d5e77f746c0a3817f6 | [
"BSD-3-Clause"
] | null | null | null | lesson9/class_car.py | kelinsobw/lessons | cc0008c31c3397ddadfa80d5e77f746c0a3817f6 | [
"BSD-3-Clause"
] | null | null | null | lesson9/class_car.py | kelinsobw/lessons | cc0008c31c3397ddadfa80d5e77f746c0a3817f6 | [
"BSD-3-Clause"
] | null | null | null | class Car:
def __init__(self,marka,model,god,speed=0):
self.marka=marka
self.model=model
self.god=god
self.speed=speed
def speed_up(self):
self.speed+=5
def speed_down(self):
self.speed-=5
def speed_stop(self):
self.speed=0
def print_speed(self):
print(f'Скорость: {self.speed}')
def speed_back(self):
self.speed*=-1 | 19.857143 | 47 | 0.577938 | 59 | 417 | 3.932203 | 0.322034 | 0.232759 | 0.224138 | 0.12069 | 0.189655 | 0.189655 | 0 | 0 | 0 | 0 | 0 | 0.017065 | 0.297362 | 417 | 21 | 48 | 19.857143 | 0.774744 | 0 | 0 | 0 | 0 | 0 | 0.052632 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0 | 0 | 0.4375 | 0.125 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9f03b810c90370aab9aa53b56bb2c53da12a3038 | 6,091 | py | Python | Testing/test_featureExtraction.py | Aarthif-Nawaz/ARC-R3ACT | 8b21eb417cb6f8d603182272d453298c29aff506 | [
"MIT"
] | null | null | null | Testing/test_featureExtraction.py | Aarthif-Nawaz/ARC-R3ACT | 8b21eb417cb6f8d603182272d453298c29aff506 | [
"MIT"
] | null | null | null | Testing/test_featureExtraction.py | Aarthif-Nawaz/ARC-R3ACT | 8b21eb417cb6f8d603182272d453298c29aff506 | [
"MIT"
] | 1 | 2022-01-26T02:30:11.000Z | 2022-01-26T02:30:11.000Z | # Authour - Aarthif Nawaz
# Purpose - Perform Unit tests for all the functions in FeatureExtraction.py
#Imports
import unittest
from sklearn.feature_extraction.text import TfidfVectorizer
import Data_Science.FeatureExtraction
# Defining the class to perform unit test
class TestFeatureExtraction(unittest.TestCase):
# Setting up corpus and vectorizer to test post defined functions
def setUp(self):
# Creating a Corpus of 4 reviews
self.corpus = ["Pay Play . Poor choice . depend accuracy levels tactics . + stats . difference . Pay play system poor matching system destroys game Tennis ","download game . Game play spotty . ball disappears lose points . spot ball hits court , ball ","low amounts gold given . not progress purchasing items game . makes impossible collect rewards unlocking timers boxes extend upto hours not open multiple boxes ! sucks . Edit : complete PAY WIN game ","enjoyed game , got glitchy . Developers work not giving certain attributes power . frustrating . giving game try , developers bad , not able fix glitches"]
# Initializing the TFIDF vectorizer along with its max_features
self.vectorizer = TfidfVectorizer(max_features=200, min_df=2)
# using tfidf vectorizer to transform corpus reviews
tf_idf_vector = self.vectorizer.fit_transform(self.corpus)
# Get the feature names
self.features = self.vectorizer.get_feature_names()
# tranform a partcular review
self.tf_idf_vectors = self.vectorizer.transform(
["download game . Game play spotty . ball disappears lose points . spot ball hits court , ball"])
# Creating MAtrix for the vectorized text
self.sorted_features = Data_Science.FeatureExtraction.FeatureExtraction.sort_matrix(self.tf_idf_vectors.tocoo())
# Testing to find keywords from a corpus
def test_find_keywords(self):
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.find_keywords(self.corpus),[['pay', 'tennis', 'choice', 'depend', 'accuracy', 'levels', 'tactics', 'stats', 'difference', 'play', 'system', 'poor', 'matching', 'destroys'], ['download', 'play', 'spotty', 'spot', 'ball', 'disappears', 'lose', 'points', 'hits', 'court'], ['win', 'edit', 'pay', 'low', 'amounts', 'gold', 'given', 'not', 'progress', 'purchasing', 'items', 'makes', 'impossible', 'collect', 'rewards', 'unlocking', 'timers', 'boxes', 'extend', 'upto', 'hours', 'open', 'multiple', 'sucks', 'complete'], ['enjoyed', 'got', 'glitchy', 'work', 'not', 'giving', 'certain', 'attributes', 'power', 'frustrating', 'try', 'developers', 'bad', 'able', 'fix', 'glitches']],"Testing Successful to Find Keywords")
# Testing to find keywords in a review compared amidst the copus
def test_find_keywords_sentence(self):
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.find_keywords_sentence(self.corpus,"Pay Play . Poor choice . depend accuracy levels tactics . + stats . difference . Pay play system poor matching system destroys game Tennis "),['play', 'pay', 'game'],"Successfully tested to find keywords in the review")
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.find_keywords_sentence(self.corpus,"download game . Game play spotty . ball disappears lose points . spot ball hits court , ball "),['game', 'play'],"Successfully tested to find keywords in the review")
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.find_keywords_sentence(self.corpus,"low amounts gold given . not progress purchasing items game . makes impossible collect rewards unlocking timers boxes extend upto hours not open multiple boxes ! sucks . Edit : complete PAY WIN game "),['not', 'game', 'pay'],"Successfully tested to find keywords in the review")
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.find_keywords_sentence(self.corpus,"enjoyed game , got glitchy . Developers work not giving certain attributes power . frustrating . giving game try , developers bad , not able fix glitches"),['not', 'game'],"Successfully tested to find keywords in the review")
# Testing to extract features from the review amidst the corpus
def test_extract_topn_features_from_vector(self):
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.extract_topn_features_from_vector(self.features,self.sorted_features,0), {'game': 0.798, 'play': 0.603},"Successfully tested to find features in the extracted review")
# Testing to sort the matrix of the extracted features in a 2D Array
def test_sort_matrix(self):
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.sort_matrix(self.tf_idf_vectors.tocoo()), self.sorted_features,"Successfully tested sort matrix")
# Testing to retrieve words from the corpus/review
def test_retrieveWords(self):
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.retrieveWords(self.vectorizer,"download game . Game play spotty . ball disappears lose points . spot ball hits court , ball",self.features), ['game', 'play'],"Successfully tested to retrieve words")
# Testing function to convert to array
def test_convertToArray(self):
self.assertEqual(Data_Science.FeatureExtraction.FeatureExtraction.convertToArray(self.corpus), ['Pay Play . Poor choice . depend accuracy levels tactics . + stats . difference . Pay play system poor matching system destroys game Tennis ', 'download game . Game play spotty . ball disappears lose points . spot ball hits court , ball ', 'low amounts gold given . not progress purchasing items game . makes impossible collect rewards unlocking timers boxes extend upto hours not open multiple boxes ! sucks . Edit : complete PAY WIN game ', 'enjoyed game , got glitchy . Developers work not giving certain attributes power . frustrating . giving game try , developers bad , not able fix glitches'],"Successfully tested to Convert review of corpus to an Array")
# Run all unit test
if __name__ == '__main__':
unittest.main()
| 114.924528 | 789 | 0.74175 | 764 | 6,091 | 5.827225 | 0.218586 | 0.037736 | 0.069182 | 0.101078 | 0.634771 | 0.626685 | 0.612758 | 0.54425 | 0.534142 | 0.504717 | 0 | 0.002934 | 0.160729 | 6,091 | 52 | 790 | 117.134615 | 0.867958 | 0.127894 | 0 | 0 | 0 | 0.310345 | 0.534071 | 0 | 0 | 0 | 0 | 0 | 0.310345 | 1 | 0.241379 | false | 0 | 0.103448 | 0 | 0.37931 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9f046ec3e8edbc2ea971916ea9c3ee4040dab4f4 | 165 | py | Python | zemfrog/extensions/celery.py | aprilahijriyan/zemfrog | 0a4ebc303caa8fadf89ca0cc8569de60c61f3252 | [
"MIT"
] | null | null | null | zemfrog/extensions/celery.py | aprilahijriyan/zemfrog | 0a4ebc303caa8fadf89ca0cc8569de60c61f3252 | [
"MIT"
] | null | null | null | zemfrog/extensions/celery.py | aprilahijriyan/zemfrog | 0a4ebc303caa8fadf89ca0cc8569de60c61f3252 | [
"MIT"
] | null | null | null | from flask import Flask
from zemfrog.app import make_celery
def init_app(app: Flask):
celery = make_celery(app)
app.extensions["celery"] = celery
| 18.333333 | 38 | 0.69697 | 23 | 165 | 4.869565 | 0.434783 | 0.178571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.218182 | 165 | 8 | 39 | 20.625 | 0.868217 | 0 | 0 | 0 | 0 | 0 | 0.038217 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9f38ee9f8595b0ff878d35dd69b749a2a40e323c | 5,575 | py | Python | data/pyalt/fhmt1.py | GameMaker2k/Neo-Hockey-Test | 5737bfedf0d83f69964e85ac1dbf7e6a93c13f44 | [
"BSD-3-Clause"
] | 1 | 2020-04-04T10:25:42.000Z | 2020-04-04T10:25:42.000Z | data/pyalt/fhmt1.py | GameMaker2k/Neo-Hockey-Test | 5737bfedf0d83f69964e85ac1dbf7e6a93c13f44 | [
"BSD-3-Clause"
] | null | null | null | data/pyalt/fhmt1.py | GameMaker2k/Neo-Hockey-Test | 5737bfedf0d83f69964e85ac1dbf7e6a93c13f44 | [
"BSD-3-Clause"
] | 3 | 2021-09-07T08:44:33.000Z | 2021-12-07T23:49:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals;
import libhockeydata;
hockeyarray = libhockeydata.CreateHockeyArray("./php/data/fhmt1y17-18.db3");
hockeyarray = libhockeydata.AddHockeyLeagueToArray(hockeyarray, "HOL", "Hockey League", "USA", "United States", "20171001", "Division=1,Conference=1", "ORDER BY Points DESC, GamesPlayed ASC, TWins DESC, Losses ASC, GoalsDifference DESC", True, True);
hockeyarray = libhockeydata.AddHockeyConferenceToArray(hockeyarray, "HOL", "Conference 1");
hockeyarray = libhockeydata.AddHockeyDivisionToArray(hockeyarray, "HOL", "Division 1", "Conference 1", "", "");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "HOL", "Kansas City", "MO", "USA", "United States", "Missouri", "Flies", "Conference 1", "Division 1", "KAN Arena", "Kansas City", "", "MIL:Milan Dazzle");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "HOL", "Chicago", "IL", "USA", "United States", "Illionis", "Lampreys", "Conference 1", "Division 1", "CHI Arena", "Chicago", "", "MIL:Moline Expositions");
hockeyarray = libhockeydata.AddHockeyDivisionToArray(hockeyarray, "HOL", "Division 2", "Conference 1", "", "");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "HOL", "Ft. Wayne", "IN", "USA", "United States", "Indiana", "Whitecaps", "Conference 1", "Division 2", "WHI Arena", "Ft. Wayne", "", "MIL:Kokomo Loggerheads");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "HOL", "Minneapolis", "MN", "USA", "United States", "Minnesota", "Frogs", "Conference 1", "Division 2", "MIN Arena", "Minneapolis", "", "MIL:Becker Winged Wheelers");
hockeyarray = libhockeydata.AddHockeyConferenceToArray(hockeyarray, "HOL", "Conference 2");
hockeyarray = libhockeydata.AddHockeyDivisionToArray(hockeyarray, "HOL", "Division 3", "Conference 2", "", "");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "HOL", "Columbus", "OH", "USA", "United States", "Ohio", "Passion", "Conference 2", "Division 3", "COL Arena", "Columbus", "", "MIL:Toledo Pugs");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "HOL", "Akron", "OH", "USA", "United States", "Ohio", "Cattlemen", "Conference 2", "Division 3", "AKR Arena", "Akron", "", "MIL:Mason Caravans");
hockeyarray = libhockeydata.AddHockeyDivisionToArray(hockeyarray, "HOL", "Division 4", "Conference 2", "", "");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "HOL", "Indianapolis", "IN", "USA", "United States", "Indiana", "Gears", "Conference 2", "Division 4", "IND Arena", "Indianapolis", "", "MIL:Lawrence Walkers");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "HOL", "Wichita", "KS", "USA", "United States", "Kansas", "Rail Hawks", "Conference 2", "Division 4", "WIC Arena", "Wichita", "", "MIL:Garden City Jammers");
hockeyarray = libhockeydata.AddHockeyLeagueToArray(hockeyarray, "MIL", "Minor League", "USA", "United States", "20171001", "Division=1,Conference=1", "ORDER BY PCT DESC, GamesPlayed ASC, TWins DESC, Losses ASC, GoalsDifference DESC", True, True);
hockeyarray = libhockeydata.AddHockeyConferenceToArray(hockeyarray, "MIL", "Conference 1");
hockeyarray = libhockeydata.AddHockeyDivisionToArray(hockeyarray, "MIL", "Division 1", "Conference 1", "", "");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "MIL", "Milan", "MO", "USA", "United States", "Missouri", "Dazzle", "Conference 1", "Division 1", "MIL Arena", "Milan", "", "HOL:Kansas City Flies");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "MIL", "Moline", "IL", "USA", "United States", "Illionis", "Expositions", "Conference 1", "Division 1", "MOL Arena", "Moline", "", "HOL:Chicago Lampreys");
hockeyarray = libhockeydata.AddHockeyDivisionToArray(hockeyarray, "MIL", "Division 2", "Conference 1", "", "");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "MIL", "Kokomo", "IN", "USA", "United States", "Indiana", "Loggerheads", "Conference 1", "Division 2", "KOK Arena", "Kokomo", "", "HOL:Ft. Wayne Whitecaps");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "MIL", "Becker", "MN", "USA", "United States", "Minnesota", "Winged Wheelers", "Conference 1", "Division 2", "BEC Arena", "Becker", "", "HOL:Minneapolis Frogs");
hockeyarray = libhockeydata.AddHockeyConferenceToArray(hockeyarray, "MIL", "Conference 2");
hockeyarray = libhockeydata.AddHockeyDivisionToArray(hockeyarray, "MIL", "Division 3", "Conference 2", "", "");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "MIL", "Toledo", "OH", "USA", "United States", "Ohio", "Pugs", "Conference 2", "Division 3", "TOL Arena", "Toledo", "", "HOL:Columbus Passion");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "MIL", "Mason", "OH", "USA", "United States", "Ohio", "Caravans", "Conference 2", "Division 3", "MAS Arena", "Mason", "", "HOL:Akron Cattlemen");
hockeyarray = libhockeydata.AddHockeyDivisionToArray(hockeyarray, "MIL", "Division 4", "Conference 2", "", "");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "MIL", "Lawrence", "IN", "USA", "United States", "Indiana", "Walkers", "Conference 2", "Division 4", "LAW Arena", "Lawrence", "", "HOL:Indianapolis Gears");
hockeyarray = libhockeydata.AddHockeyTeamToArray(hockeyarray, "MIL", "Garden City", "KS", "USA", "United States", "Kansas", "Jammers", "Conference 2", "Division 4", "GAR Arena", "Garden City", "", "HOL:Wichita Rail Hawks");
libhockeydata.MakeHockeyDatabaseFromHockeyArray(hockeyarray, None, False, True, False, True, True);
| 139.375 | 250 | 0.718206 | 559 | 5,575 | 7.150268 | 0.21288 | 0.18614 | 0.067551 | 0.220165 | 0.625469 | 0.414811 | 0.246185 | 0.24018 | 0.090068 | 0.090068 | 0 | 0.015665 | 0.095426 | 5,575 | 39 | 251 | 142.948718 | 0.776919 | 0.007534 | 0 | 0 | 0 | 0 | 0.40047 | 0.013018 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.058824 | 0.058824 | 0 | 0.058824 | 0.029412 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
9f3e1404974d6664a189327fdee78a89365bad6e | 397 | py | Python | src/__init__.py | patdaburu/qgis-plugin-starter | 61cc90c2e5b7d4bb47549a224f0ef92ed1ea7819 | [
"MIT"
] | null | null | null | src/__init__.py | patdaburu/qgis-plugin-starter | 61cc90c2e5b7d4bb47549a224f0ef92ed1ea7819 | [
"MIT"
] | null | null | null | src/__init__.py | patdaburu/qgis-plugin-starter | 61cc90c2e5b7d4bb47549a224f0ef92ed1ea7819 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. currentmodule:: sample
.. moduleauthor:: Pat Daburu <pat@daburu.net>
This script initializes the plugin, making it known to QGIS.
"""
#noinspection PyPep8Naming
def classFactory(iface):
"""
:param iface: a QGIS interface instance
:return: :py:class:`QgsInterface`
"""
from plugin import Plugin
return Plugin(iface)
| 18.904762 | 60 | 0.670025 | 47 | 397 | 5.659574 | 0.808511 | 0.067669 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006231 | 0.191436 | 397 | 20 | 61 | 19.85 | 0.82243 | 0.692695 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
9f48e46fee1440b0804b41535940cfbd7fa05cb5 | 208 | py | Python | inventory/urls.py | Melpomene927/jp-trade | cbfa33a090c5d3b01d37ccb1b835963bb0e180aa | [
"Apache-2.0"
] | null | null | null | inventory/urls.py | Melpomene927/jp-trade | cbfa33a090c5d3b01d37ccb1b835963bb0e180aa | [
"Apache-2.0"
] | null | null | null | inventory/urls.py | Melpomene927/jp-trade | cbfa33a090c5d3b01d37ccb1b835963bb0e180aa | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('', views.inventory_list, name='inventory'),
path('package/', views.package, name='package'),
]
| 23.111111 | 53 | 0.711538 | 26 | 208 | 5.653846 | 0.5 | 0.136054 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.149038 | 208 | 8 | 54 | 26 | 0.830508 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9f596d9f87dc9d7bc744c315f6c1b62827b1eeff | 984 | py | Python | resources/lib/script.py | mastashake08/mebo-updater | d13ad8911a43f4f8e18e95b37af7aad5c9cbe7b8 | [
"MIT"
] | null | null | null | resources/lib/script.py | mastashake08/mebo-updater | d13ad8911a43f4f8e18e95b37af7aad5c9cbe7b8 | [
"MIT"
] | null | null | null | resources/lib/script.py | mastashake08/mebo-updater | d13ad8911a43f4f8e18e95b37af7aad5c9cbe7b8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from resources.lib import kodiutils
from resources.lib import kodilogging
import logging
import xbmcaddon
import xbmcgui
import xbmc
import urllib
from subprocess import call
logger = logging.getLogger(ADDON.getAddonInfo('mebo.updater'))
# Put your code here, this is just an example showing
# a textbox as soon as this addon gets called
def show_dialog():
addon_name = ADDON.getAddonInfo('MEBO Updater')
line1 = "Welcome To The MEBO Updater! \n Please wait while add-ons are installed."
xbmcgui.Dialog().ok(addon_name, line1)
def download_addons():
addons = ['https://github.com/covenantkodi/repository.colossus/blob/master/repository.colossus/repository.colossus-999.999.9.zip']
for a in addons:
#call(["cd ~/.kodi/addons; wget %s" % a])
urllib.urlretrieve(str(a), filename="/storage/.kodi/userdata/addons/")
xbmc.Notification('Plugin Installed','You can now use this plugin!')
| 32.8 | 135 | 0.707317 | 132 | 984 | 5.242424 | 0.643939 | 0.047688 | 0.046243 | 0.063584 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012392 | 0.179878 | 984 | 29 | 136 | 33.931034 | 0.845105 | 0.159553 | 0 | 0 | 0 | 0.055556 | 0.363178 | 0.039092 | 0 | 0 | 0 | 0.034483 | 0 | 1 | 0.111111 | false | 0 | 0.444444 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
9f683b98c29f84bc0bc593884072aaf2227d79da | 21,002 | py | Python | blowdrycss/unit_tests/test_watchdogwrapper_main.py | nueverest/BlowDryCSS | d41b587c9b6ed6bdf22f01ffcb4598be24db8637 | [
"MIT"
] | null | null | null | blowdrycss/unit_tests/test_watchdogwrapper_main.py | nueverest/BlowDryCSS | d41b587c9b6ed6bdf22f01ffcb4598be24db8637 | [
"MIT"
] | null | null | null | blowdrycss/unit_tests/test_watchdogwrapper_main.py | nueverest/BlowDryCSS | d41b587c9b6ed6bdf22f01ffcb4598be24db8637 | [
"MIT"
] | null | null | null | # python 2
from __future__ import absolute_import, print_function, unicode_literals, with_statement
import _thread
# builtins
from unittest import TestCase, main
import logging
import sys
from io import StringIO, open
from time import sleep
from os import path, remove
# plugins
from blowdrycss.utilities import unittest_file_path, change_settings_for_testing, make_directory, delete_file_paths
from blowdrycss import watchdogwrapper
import blowdrycss_settings as settings
change_settings_for_testing()
class TestWatchdogWrapperMain(TestCase):
passing = True
non_matching = ''
output = ''
def monitor_modify_delete_stop(self, file_path):
""" Monitor console output. Modify the file to trigger watchdog on_modified().
Delete file at file_path_to_delete. Wait for output. Stop watchdogwrapper.main()
Reference: http://stackoverflow.com/questions/7602120/sending-keyboard-interrupt-programmatically
"""
substrings = [
'~~~ blowdrycss started ~~~',
'Auto-Generated CSS',
'Completed',
'blowdry.css',
'blowdry.min.css',
]
saved_stdout = sys.stdout # Monitor console
try:
out = StringIO()
sys.stdout = out
# Wait for main() to start.
while 'Ctrl + C' not in out.getvalue():
sleep(0.05)
# Modify file
with open(file_path, 'w') as generic_file:
generic_file.write('<html>modified</html>')
# IMPORTANT: Must wait up to 5 seconds for output otherwise test will fail.
count = 0
while substrings[-1] not in out.getvalue():
if count > 100: # Max wait is 5 seconds = 100 count * 0.05 sleep
break
else:
sleep(0.05)
count += 1
output = out.getvalue()
for substring in substrings:
if substring not in output:
self.passing = False
self.non_matching = substring
self.output = output
self.assertTrue(substring in output, msg=substring + '\noutput:\n' + output)
finally:
sys.stdout = saved_stdout
remove(file_path) # Remove html file.
_thread.interrupt_main() # Stop watchdogwrapper.main().
def monitor_limit_expires_stop(self):
""" Monitor console output. Wait for output based on LimitTimer expiration. Stop watchdogwrapper.main()
Reference: http://stackoverflow.com/questions/7602120/sending-keyboard-interrupt-programmatically
"""
substrings = [
'~~~ blowdrycss started ~~~',
'Auto-Generated CSS',
'Completed',
'blowdry.css',
'blowdry.min.css',
'----- Limit timer reset -----',
]
saved_stdout = sys.stdout # Monitor console
try:
out = StringIO()
sys.stdout = out
# Wait for main() to start.
while 'Ctrl + C' not in out.getvalue():
sleep(0.05)
# IMPORTANT: Must wait up to 5 seconds for output otherwise test will fail.
count = 0
while substrings[-1] not in out.getvalue():
if count > 100: # Max wait is 5 seconds = 100 count * 0.05 sleep
break
else:
sleep(0.05)
count += 1
output = out.getvalue()
for substring in substrings:
if substring not in output:
self.passing = False
self.non_matching = substring
self.output = output
self.assertTrue(substring in output, msg=substring + '\noutput:\n' + output)
finally:
sys.stdout = saved_stdout
_thread.interrupt_main() # Stop watchdogwrapper.main().
def test_main_auto_generate_True_on_modify(self):
# Integration test
logging.basicConfig(level=logging.DEBUG)
html_text = '<html></html>'
test_examplesite = unittest_file_path(folder='test_examplesite')
test_css = unittest_file_path(folder='test_examplesite/test_css')
delete_dot_html = unittest_file_path(folder='test_examplesite', filename='delete.html')
# Directory must be created for Travis CI case
make_directory(test_examplesite)
make_directory(test_css)
self.assertTrue(path.isdir(test_examplesite))
self.assertTrue(path.isdir(test_css))
# Create file delete.html
with open(delete_dot_html, 'w') as _file:
_file.write(html_text)
# Double check to ensure it got created.
self.assertTrue(path.isfile(delete_dot_html))
auto_generate = settings.auto_generate # original
settings.auto_generate = True
_thread.start_new_thread(self.monitor_modify_delete_stop, (delete_dot_html,))
sleep(0.25) # Required for Travis CI
watchdogwrapper.main() # Caution: Nothing will run after this line unless _thread.interrupt_main() is called.
self.assertTrue(self.passing, msg=self.non_matching + ' not found in output:\n' + self.output)
settings.auto_generate = auto_generate # reset setting
def test_main_auto_generate_True_limit_timer_expired(self):
# Integration test
logging.basicConfig(level=logging.DEBUG)
html_text = '<html><div class="blue"></div></html>'
test_examplesite = unittest_file_path(folder='test_examplesite')
test_css = unittest_file_path(folder='test_examplesite/test_css')
limit_dot_html = unittest_file_path(folder='test_examplesite', filename='limit_expired.html')
# Directory must be created for Travis CI case
make_directory(test_examplesite)
make_directory(test_css)
self.assertTrue(path.isdir(test_examplesite))
self.assertTrue(path.isdir(test_css))
# Create file limit_expired.html
with open(limit_dot_html, 'w') as _file:
_file.write(html_text)
# Double check to ensure it got created.
self.assertTrue(path.isfile(limit_dot_html))
auto_generate = settings.auto_generate # original
time_limit = settings.time_limit
settings.auto_generate = True
settings.time_limit = 0.1 # reduce the time_limit
_thread.start_new_thread(self.monitor_limit_expires_stop, ())
watchdogwrapper.main() # Caution: Nothing will run after this line unless _thread.interrupt_main() is called.
self.assertTrue(self.passing, msg=self.non_matching + ' not found in output:\n' + self.output)
remove(limit_dot_html) # delete files
settings.auto_generate = auto_generate # reset setting
settings.time_limit = time_limit
def test_main_auto_generate_False_print_statements(self):
# Integration test
logging.basicConfig(level=logging.DEBUG)
substrings = [
'~~~ blowdrycss started ~~~',
'Auto-Generated CSS',
'Completed',
'blowdry.css',
'blowdry.min.css',
]
html_text = '<html></html>'
test_examplesite = unittest_file_path(folder='test_examplesite')
test_css = unittest_file_path(folder='test_css')
delete_dot_html = unittest_file_path(folder='test_examplesite', filename='delete.html')
auto_generate = settings.auto_generate # original
# Directory must be created for Travis CI case
make_directory(test_examplesite)
make_directory(test_css)
self.assertTrue(path.isdir(test_examplesite))
self.assertTrue(path.isdir(test_css))
# Create delete.html
with open(delete_dot_html, 'w') as _file:
_file.write(html_text)
self.assertTrue(path.isfile(delete_dot_html))
saved_stdout = sys.stdout
try:
out = StringIO()
sys.stdout = out
settings.auto_generate = False
watchdogwrapper.main()
sleep(0.25) # IMPORTANT: Must wait for output otherwise test will fail.
output = out.getvalue()
for substring in substrings:
self.assertTrue(substring in output, msg=substring + '\noutput:\n' + output)
finally:
sys.stdout = saved_stdout
remove(delete_dot_html) # Delete delete.html
settings.auto_generate = auto_generate # reset setting
def test_main_auto_generate_False_css_text_Fully_Integrated_Test(self):
# Integration test that checks blowdry.css and blowdry.min.css output.
logging.basicConfig(level=logging.DEBUG)
expected_css_text = """.h444-hover:hover {
color: #444
}
.height-200 {
height: 12.5em
}
.talign-center {
text-align: center
}
.bgc-h000 {
background-color: #000
}
.fantasy {
font-family: fantasy
}
.padding-5 {
padding: 0.3125em
}
.c-blue {
color: blue
}
.display-none {
display: none
}
.t-align-center {
text-align: center
}
.padding-top-10 {
padding-top: 0.625em
}
.rgb-255-255-255 {
color: rgb(255, 255, 255)
}
.margin-top-30 {
margin-top: 1.875em
}
.bold {
font-weight: bold
}
.border-1px-solid-gray {
border: 1px solid gray
}
.sans-serif {
font-family: sans-serif
}
.height-150px {
height: 9.375em
}
.margin-top-10 {
margin-top: 0.625em
}
.border-5px-solid-hd0d {
border: 5px solid #d0d
}
.color-hfff {
color: #fff
}
.hfff-hover-i:hover {
color: #fff !important
}
.margin-top-50px {
margin-top: 3.125em
}
.display-inline {
display: inline
}
.red-i-hover:hover {
color: red !important
}
.margin-20 {
margin: 1.25em
}
.orange {
color: orange
}
.margin-25 {
margin: 1.5625em
}
.bgc-hf8f8f8 {
background-color: #f8f8f8
}
.h484848 {
color: #484848
}
.padding-10 {
padding: 0.625em
}
.width-50 {
width: 3.125em
}
.text-align-center {
text-align: center
}
.bgc-h5f2424-i-hover:hover {
background-color: #5f2424 !important
}
.width-150 {
width: 9.375em
}
.height-50px {
height: 3.125em
}
.padding-100-s {
padding: 6.25em
}
@media only screen and (max-width: 64em) {
.padding-100-s {
padding: 5.9923em
}
}
@media only screen and (max-width: 45em) {
.padding-100-s {
padding: 5.5556em
}
}
@media only screen and (max-width: 30em) {
.padding-100-s {
padding: 5em
}
}
@media only screen and (max-width: 45.0625em) {
.large-up {
display: none
}
}
@media only screen and (max-width: 45em) {
.display-720-up {
display: none
}
}
.font-size-48-s {
font-size: 3em
}
@media only screen and (max-width: 64em) {
.font-size-48-s {
font-size: 2.8763em
}
}
@media only screen and (max-width: 45em) {
.font-size-48-s {
font-size: 2.6667em
}
}
@media only screen and (max-width: 30em) {
.font-size-48-s {
font-size: 2.4em
}
}
@media only screen and (max-width: 30.0625em) {
.display-medium-up {
display: none
}
}
@media only screen and (min-width: 45.0625em) and (max-width: 64em) {
.padding-100-large-only {
padding: 6.25em
}
}
.font-size-48-s-i {
font-size: 3em !important
}
@media only screen and (max-width: 64em) {
.font-size-48-s-i {
font-size: 2.8763em !important
}
}
@media only screen and (max-width: 45em) {
.font-size-48-s-i {
font-size: 2.6667em !important
}
}
@media only screen and (max-width: 30em) {
.font-size-48-s-i {
font-size: 2.4em !important
}
}"""
expected_css_min_text = ".h444-hover:hover{color:#444}.height-200{height:12.5em}" \
".talign-center{text-align:center}" \
".bgc-h000{background-color:#000}.fantasy{font-family:fantasy}.padding-5{padding:.3125em}" \
".c-blue{color:blue}.display-none{display:none}.t-align-center{text-align:center}" \
".padding-top-10{padding-top:.625em}.rgb-255-255-255{color:rgb(255,255,255)}" \
".margin-top-30{margin-top:1.875em}.bold{font-weight:bold}" \
".border-1px-solid-gray{border:1px solid gray}.sans-serif{font-family:sans-serif}" \
".height-150px{height:9.375em}.margin-top-10{margin-top:.625em}" \
".border-5px-solid-hd0d{border:5px solid #d0d}.color-hfff{color:#fff}" \
".hfff-hover-i:hover{color:#fff !important}.margin-top-50px{margin-top:3.125em}" \
".display-inline{display:inline}.red-i-hover:hover{color:red !important}" \
".margin-20{margin:1.25em}" \
".orange{color:orange}.margin-25{margin:1.5625em}.bgc-hf8f8f8{background-color:#f8f8f8}" \
".h484848{color:#484848}.padding-10{padding:.625em}.width-50{width:3.125em}" \
".text-align-center{text-align:center}" \
".bgc-h5f2424-i-hover:hover{background-color:#5f2424 !important}.width-150{width:9.375em}" \
".height-50px{height:3.125em}.padding-100-s{padding:6.25em}" \
"@media only screen and (max-width:64em){.padding-100-s{padding:5.9923em}}" \
"@media only screen and (max-width:45em){.padding-100-s{padding:5.5556em}}" \
"@media only screen and (max-width:30em){.padding-100-s{padding:5em}}" \
"@media only screen and (max-width:45.0625em){.large-up{display:none}}" \
"@media only screen and (max-width:45em){.display-720-up{display:none}}" \
".font-size-48-s{font-size:3em}@media only screen and (max-width:64em){" \
".font-size-48-s{font-size:2.8763em}}@media only screen and (max-width:45em){" \
".font-size-48-s{font-size:2.6667em}}@media only screen and (max-width:30em){" \
".font-size-48-s{font-size:2.4em}}@media only screen and (max-width:30.0625em){" \
".display-medium-up{display:none}}@media only screen and (min-width:45.0625em) and " \
"(max-width:64em){.padding-100-large-only{padding:6.25em}}.font-size-48-s-i{" \
"font-size:3em !important}@media only screen and (max-width:64em){.font-size-48-s-i{" \
"font-size:2.8763em !important}}@media only screen and (max-width:45em){.font-size-48-s-i{" \
"font-size:2.6667em !important}}@media only screen and (max-width:30em){.font-size-48-s-i{" \
"font-size:2.4em !important}}"
html_text = """<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>blowdrycss - example site</title>
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<link rel="stylesheet" type="text/css" href="css/blowdry.min.css" />
</head>
<body>
<!-- Title -->
<h1 class="c-blue hfff-hover-i bgc-h5f2424-i-hover text-align-center display-medium-up font-size-48-s">
Blow Dry CSS
</h1>
<div>
<img src="images/why-blow-dry.jpg" alt="Blow Dry CSS" title="Blow Dry CSS" width=480 />
</div>
<div class="t-align-center margin-top-50px large-up">
<img class="width-150 height-150px" src="images/blow.jpg" alt="blow" title="blow" />
<img class=" width-50 height-50px" src="images/plus.png" alt="plus" title="plus" />
<img class="width-150 height-150px" src="images/dry-ground.jpg" alt="dry" title="dry" />
<img class=" width-50 height-50px" src="images/plus.png" alt="plus" title="plus" />
<img class="width-150 height-150px" src="images/css.jpg" alt="css" title="css" />
</div>
<!-- Blow Dryers -->
<ul class="margin-top-10">
<li class="bold padding-top-10">
<div>
<img class="height-200" src="images/blow-dryer1.jpg" alt="hair-yer1" title="blow-dryer1" />
</div>
<div class="color-hfff bgc-h000 padding-100-large-only">
A blow dryer drys the dryer of the hair.
<br class="display-none" />
This should be on the same line i.e. br-tag should be hidden once css is applied.
</div>
</li>
<li class="font-size-48-s-i padding-top-10">
<div>
<img class="height-200" src="images/blow-dryer2.jpg" alt="hadryer2" title="blow-dryer2" />
</div>
<div class="h484848 bgc-h000">
A blow dryer drys the hair of the dryer of hair.
</div>
</li>
<li class="b padding-top-10">
<div>
<img class="height-200" src="images/blow-dryer3.jpg" alt="ha-dryer3" title="blow-dryer3" />
</div>
<div class="color-#fff bgc-#000">
A blow dryer drys the dryer of hair. Intentional WRONG HEX ENCODING
</div>
</li>
<li class="b padding-top-10 h444-hover">
<div class="">
<img class="height-200 border-5px-solid-hd0d" src="images/blow-dryer4.jpg" />
</div>
<div class="rgb-255-255-255 bgc-h000">
<h3 class="sans-serif">
A blow dryer <span class="fantasy orange">drys</span> the dryer of hair.
</h3>
</div>
</li>
</ul>
<div class="hfff h000000-hover">Testing</div>
<!-- <p class="margin-left-123">Class should not be found in comments</p> -->
<h1 class="c-blue text-align-center padding-10 display-720-up">Blow Dry CSS</h1>
<div id="div1">Should have margin of 25px all the way around. Javascript class selectors.</div>
<div class="padding-100-s margin-20 red-i-hover margin-top-30 border-5px-solid-hd0d">
Testing<br class="hide" />1 2 3
</div>
<script>
// create element
var element = document.getElementById("div1");
// element.classList.add() variant 1
element.classList.add("margin-25");
</script>
</body>
</html>"""
test_examplesite = unittest_file_path(folder='test_examplesite')
test_css = unittest_file_path(folder='test_examplesite/test_css')
blowdry_css = unittest_file_path(folder=test_css, filename='blowdry.css')
blowdry_min_css = unittest_file_path(folder=test_css, filename='blowdry.min.css')
test_dot_html = unittest_file_path(folder='test_examplesite', filename='test.html')
auto_generate = settings.auto_generate # original
# Directory must be created for Travis CI case
make_directory(test_examplesite)
make_directory(test_css)
self.assertTrue(path.isdir(test_examplesite))
self.assertTrue(path.isdir(test_css))
# Create delete.html
with open(test_dot_html, 'w') as _file:
_file.write(html_text)
self.assertTrue(path.isfile(test_dot_html))
settings.auto_generate = False
watchdogwrapper.main()
sleep(0.25)
# Human-readable CSS
with open(blowdry_css, 'r') as css_text:
self.assertTrue(expected_css_text, css_text.read())
# Minified CSS
with open(blowdry_min_css, 'r') as css_min_text:
self.assertTrue(expected_css_min_text, css_min_text.read())
delete_file_paths((test_dot_html, blowdry_css, blowdry_min_css, )) # Delete test html
settings.auto_generate = auto_generate # reset setting
if __name__ == '__main__':
main()
| 37.237589 | 120 | 0.566184 | 2,475 | 21,002 | 4.690101 | 0.145455 | 0.023432 | 0.033598 | 0.040317 | 0.741902 | 0.725706 | 0.710286 | 0.689438 | 0.665834 | 0.639817 | 0 | 0.051002 | 0.315684 | 21,002 | 563 | 121 | 37.30373 | 0.75668 | 0.086135 | 0 | 0.392781 | 0 | 0.101911 | 0.548379 | 0.134947 | 0 | 0 | 0 | 0 | 0.04034 | 1 | 0.012739 | false | 0.010616 | 0.053079 | 0 | 0.07431 | 0.004246 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9f75ae8b4f90ddeecd2bde3907fabaa0574a4dcd | 1,871 | py | Python | profiles_api/models.py | AkshayVKumar/Source-code-of-REST-API | a8e2eda822a98c90e697006acde6a2377665142d | [
"MIT"
] | null | null | null | profiles_api/models.py | AkshayVKumar/Source-code-of-REST-API | a8e2eda822a98c90e697006acde6a2377665142d | [
"MIT"
] | 4 | 2020-06-06T01:45:42.000Z | 2022-02-10T11:20:23.000Z | profiles_api/models.py | AkshayVKumar/Source-code-of-REST-API | a8e2eda822a98c90e697006acde6a2377665142d | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin,BaseUserManager
from django.conf import settings
# Create your models here.
class UserProfileManager(BaseUserManager):
"""manager for user profiles"""
def create_user(self,email,name,password=None):
if not email:
raise ValueError("Users Must Have an Email Address")
email=self.normalize_email(email)
user=self.model(email=email,name=name)
user.set_password(password)
user.save(using=self._db)
return user
def create_superuser(self,email,name,password):
"""creating a new super user with given details"""
user=self.create_user(email,name,password)
user.is_superuser=True
user.is_staff=True
user.save(using=self._db)
return user
class UserProfile(AbstractBaseUser,PermissionsMixin):
"""Database Models for users in the system"""
email=models.EmailField(max_length=255,unique=True)
name=models.CharField(max_length=255)
is_active=models.BooleanField(default=True)
is_staff=models.BooleanField(default=False)
objects=UserProfileManager()
USERNAME_FIELD='email'
REQUIRED_FIELDS=['name']
def get_full_name(self):
#retrives full name of the user
return self.name
def get_short_name(self):
#retrives full name of the user
return self.name
def __str__(self):
return self.email
class ProfileFeedItem(models.Model):
#profile status update
user_profile=models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE)
status_text=models.CharField(max_length=255)
created_on=models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.status_text
| 29.234375 | 85 | 0.702833 | 235 | 1,871 | 5.438298 | 0.395745 | 0.031299 | 0.039906 | 0.032864 | 0.246479 | 0.175274 | 0.123631 | 0.078247 | 0.078247 | 0.078247 | 0 | 0.006093 | 0.210583 | 1,871 | 64 | 86 | 29.234375 | 0.859174 | 0.115981 | 0 | 0.205128 | 0 | 0 | 0.025061 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0.102564 | 0.102564 | 0.102564 | 0.74359 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 |
9f7d12f1f8eaa3c0fad8cf7330d9e945547adca6 | 226 | py | Python | 1-beginner/1038.py | alenvieira/uri-online-judge-solutions | ca5ae7064d84af4dae12fc37d4d14ee441e49d06 | [
"MIT"
] | null | null | null | 1-beginner/1038.py | alenvieira/uri-online-judge-solutions | ca5ae7064d84af4dae12fc37d4d14ee441e49d06 | [
"MIT"
] | null | null | null | 1-beginner/1038.py | alenvieira/uri-online-judge-solutions | ca5ae7064d84af4dae12fc37d4d14ee441e49d06 | [
"MIT"
] | null | null | null | price_list = { 1 : 4.0, 2 : 4.5, 3 : 5.0, 4 : 2.0, 5 : 1.5}
values = input()
product_code, price_product = [int(value) for value in values.split(' ')]
print('Total: R$ {:.2f}'.format(price_list[product_code] * price_product))
| 45.2 | 74 | 0.637168 | 41 | 226 | 3.365854 | 0.536585 | 0.130435 | 0.231884 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08377 | 0.154867 | 226 | 4 | 75 | 56.5 | 0.638743 | 0 | 0 | 0 | 0 | 0 | 0.075221 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9f8b42c9df78456cfb417a42b38e3e6c126cfc4f | 118 | py | Python | newsCrawl/fakeNews/crawlapp/urls.py | ARIF-KHAN-420/Fake_News | acfbffcce454afc09c4a7b06205c1a632c11f822 | [
"MIT"
] | 1 | 2022-01-03T17:54:03.000Z | 2022-01-03T17:54:03.000Z | newsCrawl/fakeNews/crawlapp/urls.py | arifkhan-silicornya/Fake_News | acfbffcce454afc09c4a7b06205c1a632c11f822 | [
"MIT"
] | null | null | null | newsCrawl/fakeNews/crawlapp/urls.py | arifkhan-silicornya/Fake_News | acfbffcce454afc09c4a7b06205c1a632c11f822 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('',views.crawling,name='actionCrawler')
]
| 14.75 | 48 | 0.711864 | 14 | 118 | 6 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.161017 | 118 | 7 | 49 | 16.857143 | 0.848485 | 0 | 0 | 0 | 0 | 0 | 0.110169 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9fa5a83931a783c516d67093672870cbdefcd754 | 921 | py | Python | eds/exception.py | jleopold28/eds | 7a1f61ec1d595ea39c73c4c0096127cbe83be862 | [
"Apache-2.0"
] | 3 | 2021-05-20T10:53:56.000Z | 2021-12-06T13:21:15.000Z | eds/exception.py | jleopold28/eds | 7a1f61ec1d595ea39c73c4c0096127cbe83be862 | [
"Apache-2.0"
] | 27 | 2021-06-05T03:21:28.000Z | 2021-09-22T19:15:27.000Z | eds/exception.py | jleopold28/eds | 7a1f61ec1d595ea39c73c4c0096127cbe83be862 | [
"Apache-2.0"
] | 3 | 2021-05-16T18:49:55.000Z | 2021-07-09T15:07:21.000Z |
class EdsError(Exception):
"""EDS base exception."""
class DuplicateIncludeError(Exception):
"""Raised when a duplicate include occurs."""
class PluginNameNotFoundError(EdsError):
"""Raised when a specific plugin is not found."""
class PluginNameMismatchError(EdsError):
"""Raised when a plugin name does not match the 'plugin_name' attribute of the object."""
class UnknownPluginIntefaceError(EdsError):
"""Raised when a plugin group or interface is unknown."""
class PluginInterfaceNotImplementedError(EdsError):
"""Raised when a plugin does not implement the expected interface."""
class DuplicatePluginError(EdsError):
"""Raised when a specific name has multiple plugins."""
class NoPluginsFoundError(EdsError):
"""Raised when no template plugins are found."""
class PluginNoNameAttributeError(EdsError):
"""Raised when a plugin has no 'plugin_name' attribute."""
| 25.583333 | 93 | 0.741585 | 102 | 921 | 6.676471 | 0.421569 | 0.117474 | 0.113069 | 0.167401 | 0.226138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156352 | 921 | 35 | 94 | 26.314286 | 0.876448 | 0.487514 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
9fb0043dd7e77d4c67d41badd0e746e1b7aedca2 | 161 | py | Python | examples/one/histology/brain_regions_navigation.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | 38 | 2018-08-07T21:55:29.000Z | 2022-03-21T14:49:03.000Z | examples/one/histology/brain_regions_navigation.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | 207 | 2018-07-25T15:10:48.000Z | 2022-03-08T13:23:08.000Z | examples/one/histology/brain_regions_navigation.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | 35 | 2018-09-04T14:49:56.000Z | 2022-01-06T21:17:51.000Z | from ibllib.atlas import AllenAtlas
ba = AllenAtlas()
# Primary somatosensory area nose
region_id = 353
ba.regions.descendants(353)
ba.regions.ancestors(353)
| 16.1 | 35 | 0.78882 | 22 | 161 | 5.727273 | 0.727273 | 0.079365 | 0.190476 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06383 | 0.124224 | 161 | 9 | 36 | 17.888889 | 0.829787 | 0.192547 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9fb6cf849ae5e92585b4285ec068a1a8237d28c5 | 269 | py | Python | app/controllers/atividadesProfissionais.py | pedroferronato/curriculos | f76bb8a2abf2c833903af1ef251a1b57126e9d4a | [
"MIT"
] | null | null | null | app/controllers/atividadesProfissionais.py | pedroferronato/curriculos | f76bb8a2abf2c833903af1ef251a1b57126e9d4a | [
"MIT"
] | null | null | null | app/controllers/atividadesProfissionais.py | pedroferronato/curriculos | f76bb8a2abf2c833903af1ef251a1b57126e9d4a | [
"MIT"
] | null | null | null | from flask import render_template
from app import app
from app.models.tables import AtividadeProfissional
@app.route('/atividades')
def atividades():
lista = AtividadeProfissional.query.all()
return render_template("listar_ativProfissional.html", lista=lista)
| 29.888889 | 71 | 0.799257 | 32 | 269 | 6.625 | 0.59375 | 0.132075 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111524 | 269 | 8 | 72 | 33.625 | 0.887029 | 0 | 0 | 0 | 0 | 0 | 0.144981 | 0.104089 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
9fb94250dbd07287b9778a6397a6c1e51820989a | 213 | py | Python | helpers/render_index_html.py | nortics/stepik-flask2 | dde72785c35427f2e80745d26afe442cfbef1815 | [
"MIT"
] | null | null | null | helpers/render_index_html.py | nortics/stepik-flask2 | dde72785c35427f2e80745d26afe442cfbef1815 | [
"MIT"
] | null | null | null | helpers/render_index_html.py | nortics/stepik-flask2 | dde72785c35427f2e80745d26afe442cfbef1815 | [
"MIT"
] | null | null | null | from flask import render_template
from data import tours
import random
def index_html():
tours6 ={}
for i in range(1,7):
tours6[i] = tours[i]
return render_template('index.html',tour = tours6) | 23.666667 | 54 | 0.685446 | 32 | 213 | 4.46875 | 0.625 | 0.195804 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029762 | 0.211268 | 213 | 9 | 54 | 23.666667 | 0.821429 | 0 | 0 | 0 | 0 | 0 | 0.046729 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
9fcc390db02d00206b91280b29cfed7c5184d396 | 106 | py | Python | .history/ClassFiles/OOP/InstanciatingAClass_20210103151548.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/OOP/InstanciatingAClass_20210103151548.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/OOP/InstanciatingAClass_20210103151548.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | ''' instantiating a class
The process of creating a an object from a class.
''' | 10.6 | 49 | 0.54717 | 13 | 106 | 4.461538 | 0.769231 | 0.206897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.386792 | 106 | 10 | 50 | 10.6 | 0.892308 | 0.669811 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9fcd1d795526bde99374ed3498ecc22cc7c5855e | 3,628 | py | Python | tests/test_device_history.py | gilmaicor/history | f45bce34336de2cbe3c03d92934e92afcfb18b75 | [
"Apache-2.0"
] | null | null | null | tests/test_device_history.py | gilmaicor/history | f45bce34336de2cbe3c03d92934e92afcfb18b75 | [
"Apache-2.0"
] | null | null | null | tests/test_device_history.py | gilmaicor/history | f45bce34336de2cbe3c03d92934e92afcfb18b75 | [
"Apache-2.0"
] | null | null | null | import pytest
import falcon
from unittest.mock import MagicMock, Mock, patch
from history.api.models import DeviceHistory, HistoryUtil
class TestDeviceHistory:
def test_parse_request1(self):
request = MagicMock()
request.params.keys.return_value = ['firstN', 'dateFrom', 'dateTo']
req_content = {"firstN": 2, "dateFrom": "20190901", "dateTo": "20190910"}
request.params.__getitem__.side_effect = lambda key: req_content[key]
assert DeviceHistory.parse_request(request, 'test')
def test_parse_request2(self):
request = MagicMock()
request.params.keys.return_value = ['lastN','dateFrom','dateTo']
req_content = {"lastN":2,"dateFrom":"20190901" ,"dateTo":"20190910"}
request.params.__getitem__.side_effect = lambda key: req_content[key]
assert DeviceHistory.parse_request(request,'test')
def test_parse_request_invalid_firstN(self):
with pytest.raises(falcon.HTTPInvalidParam):
request = MagicMock()
request.params.keys.return_value = ['firstN', 'dateFrom', 'dateTo']
req_content = {"firstN": "test"}
request.params.__getitem__.side_effect = lambda key: req_content[key]
DeviceHistory.parse_request(request, "test")
def test_parse_request_invalid_lastN(self):
with pytest.raises(falcon.HTTPInvalidParam):
request = MagicMock()
request.params.keys.return_value = ['lastN','dateFrom','dateTo']
req_content = {"lastN":"test"}
request.params.__getitem__.side_effect = lambda key: req_content[key]
DeviceHistory.parse_request(request,"test")
def test_parse_request_invalid_hLimit(self):
with pytest.raises(falcon.HTTPInvalidParam):
request = MagicMock()
request.params.keys.return_value = ['hLimit','dateFrom','dateTo']
req_content = {"hLimit":"test"}
request.params.__getitem__.side_effect = lambda key: req_content[key]
DeviceHistory.parse_request(request,"test")
@patch('history.api.models.HistoryUtil.get_collection')
@patch('history.api.models.DeviceHistory.get_single_attr')
def test_on_get_single_attr(self,mock_historyu_get_collection, mock_get_single_attr):
request = MagicMock()
request.params.keys.return_value = ['attr']
request.params.return_value = ['value']
response = falcon.Response()
mock_historyu_get_collection.return_value = { }
with pytest.raises(falcon.HTTPNotFound):
mock_get_single_attr.return_value = []
DeviceHistory.on_get(request,response,'testid')
@patch('history.api.models.HistoryUtil.get_collection')
@patch('history.api.models.DeviceHistory.get_attrs')
@patch('history.api.models.DeviceHistory.parse_request')
def test_on_get_no_attr(self,mock_get_collection,mock_get_attrs,mock_parse_request):
with patch('history.api.models.DeviceHistory.get_single_attr') as mock_get_attr:
request = MagicMock()
request.params.keys.return_value = []
request.get_header.return_value = 'token'
request.params.return_value = ['value']
response = falcon.Response()
attr_list = ['attr1','attr2']
mock_get_attrs.__getitem__.side_effect = lambda key: attr_list[key]
mock_parse_request.return_value = None
mock_get_attr.return_value = ''
DeviceHistory.on_get(request, response, 'test')
assert response.status == falcon.HTTP_200
| 46.512821 | 89 | 0.668964 | 399 | 3,628 | 5.774436 | 0.16792 | 0.078993 | 0.048611 | 0.088108 | 0.731337 | 0.705295 | 0.705295 | 0.705295 | 0.549479 | 0.549479 | 0 | 0.014452 | 0.218026 | 3,628 | 77 | 90 | 47.116883 | 0.797674 | 0 | 0 | 0.461538 | 0 | 0 | 0.146362 | 0.075524 | 0 | 0 | 0 | 0 | 0.046154 | 1 | 0.107692 | false | 0 | 0.061538 | 0 | 0.184615 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4c892cc3c691ae0ce06b26d95f0c67b3aae081f0 | 743 | py | Python | scripts/greaseweazle/image/hfe.py | uffejakobsen/Greaseweazle | 2dc37fe3ec9a52e13cb4a17b530fcca13fd61842 | [
"Unlicense"
] | 1 | 2021-05-24T13:35:39.000Z | 2021-05-24T13:35:39.000Z | scripts/greaseweazle/image/hfe.py | uffejakobsen/Greaseweazle | 2dc37fe3ec9a52e13cb4a17b530fcca13fd61842 | [
"Unlicense"
] | null | null | null | scripts/greaseweazle/image/hfe.py | uffejakobsen/Greaseweazle | 2dc37fe3ec9a52e13cb4a17b530fcca13fd61842 | [
"Unlicense"
] | null | null | null | # greaseweazle/image/hfe.py
#
# Written & released by Keir Fraser <keir.xen@gmail.com>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for more details, or visit <http://unlicense.org>.
class HFE:
def __init__(self, start_cyl, nr_sides):
self.start_cyl = start_cyl
self.nr_sides = nr_sides
self.nr_revs = None
self.track_list = []
@classmethod
def from_file(cls, dat):
hfe = cls(0, 2)
return hfe
def get_track(self, cyl, side, writeout=False):
return None
def append_track(self, flux):
pass
def get_image(self):
return bytes()
# Local variables:
# python-indent: 4
# End:
| 19.552632 | 73 | 0.625841 | 102 | 743 | 4.401961 | 0.647059 | 0.053452 | 0.053452 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005587 | 0.277254 | 743 | 37 | 74 | 20.081081 | 0.83054 | 0.35397 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3125 | false | 0.0625 | 0 | 0.125 | 0.5625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 3 |
4c9d7b35446b11f0d180e206023e1a7adf1d95c2 | 121 | py | Python | env.py | spin13/slack | a99013e3a8901c0c33304780e56b819ce192cd49 | [
"MIT"
] | null | null | null | env.py | spin13/slack | a99013e3a8901c0c33304780e56b819ce192cd49 | [
"MIT"
] | null | null | null | env.py | spin13/slack | a99013e3a8901c0c33304780e56b819ce192cd49 | [
"MIT"
] | null | null | null | SLACK_TOKEN = ''
APP_TOKEN = ''
WUNDERLIST_CLIENT_ID = ''
WUNDERLIST_TOKEN = ''
SLACK_WUNDERLIST_TOKENS = [ '' ]
| 17.285714 | 33 | 0.652893 | 13 | 121 | 5.615385 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.198347 | 121 | 6 | 34 | 20.166667 | 0.742268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4ca4a8e3361e72eba6cb4e042e17348498ac5d62 | 302 | py | Python | python/conditionals/conditionals1.py | maleich/ReadingBat-conditional1 | 4701caf110fb88952c4ca318a755c37869088750 | [
"Apache-2.0"
] | null | null | null | python/conditionals/conditionals1.py | maleich/ReadingBat-conditional1 | 4701caf110fb88952c4ca318a755c37869088750 | [
"Apache-2.0"
] | null | null | null | python/conditionals/conditionals1.py | maleich/ReadingBat-conditional1 | 4701caf110fb88952c4ca318a755c37869088750 | [
"Apache-2.0"
] | 1 | 2020-07-31T01:59:29.000Z | 2020-07-31T01:59:29.000Z | # @desc By Anay '24
def check_age(age):
if age < 21:
return age
return age + 5
def main():
print(check_age(5))
print(check_age(29))
print(check_age(42))
print(check_age(15))
print(check_age(0.38))
print(check_age(21))
if __name__ == '__main__':
main()
| 14.380952 | 26 | 0.589404 | 47 | 302 | 3.468085 | 0.404255 | 0.343558 | 0.478528 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076577 | 0.264901 | 302 | 20 | 27 | 15.1 | 0.657658 | 0.056291 | 0 | 0 | 0 | 0 | 0.028269 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0 | 0 | 0.307692 | 0.461538 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
4cbf68b03b9393e0f9ec94ef908660506954e670 | 3,339 | py | Python | stubs.min/Rhino/Geometry/__init___parts/Vector3f.py | denfromufa/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2017-07-07T11:15:45.000Z | 2017-07-07T11:15:45.000Z | stubs.min/Rhino/Geometry/__init___parts/Vector3f.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/Rhino/Geometry/__init___parts/Vector3f.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class Vector3f(object,IEquatable[Vector3f],IComparable[Vector3f],IComparable,IEpsilonFComparable[Vector3f]):
""" Vector3f(x: Single,y: Single,z: Single) """
@staticmethod
def Add(point,vector):
""" Add(point: Point3f,vector: Vector3f) -> Point3f """
pass
def CompareTo(self,other):
""" CompareTo(self: Vector3f,other: Vector3f) -> int """
pass
@staticmethod
def CrossProduct(a,b):
""" CrossProduct(a: Vector3f,b: Vector3f) -> Vector3f """
pass
def EpsilonEquals(self,other,epsilon):
""" EpsilonEquals(self: Vector3f,other: Vector3f,epsilon: Single) -> bool """
pass
def Equals(self,*__args):
"""
Equals(self: Vector3f,vector: Vector3f) -> bool
Equals(self: Vector3f,obj: object) -> bool
"""
pass
def GetHashCode(self):
""" GetHashCode(self: Vector3f) -> int """
pass
@staticmethod
def Multiply(*__args):
"""
Multiply(t: Single,vector: Vector3f) -> Vector3f
Multiply(vector: Vector3f,t: Single) -> Vector3f
"""
pass
def PerpendicularTo(self,other):
""" PerpendicularTo(self: Vector3f,other: Vector3f) -> bool """
pass
def Reverse(self):
""" Reverse(self: Vector3f) -> bool """
pass
def Rotate(self,angleRadians,rotationAxis):
""" Rotate(self: Vector3f,angleRadians: float,rotationAxis: Vector3f) -> bool """
pass
def ToString(self):
""" ToString(self: Vector3f) -> str """
pass
def Transform(self,transformation):
""" Transform(self: Vector3f,transformation: Transform) """
pass
def Unitize(self):
""" Unitize(self: Vector3f) -> bool """
pass
def __eq__(self,*args):
""" x.__eq__(y) <==> x==y """
pass
def __ge__(self,*args):
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self,*args):
pass
def __lt__(self,*args):
pass
def __mul__(self,*args):
""" x.__mul__(y) <==> x*y """
pass
@staticmethod
def __new__(self,x,y,z):
"""
__new__[Vector3f]() -> Vector3f
__new__(cls: type,x: Single,y: Single,z: Single)
"""
pass
def __ne__(self,*args):
pass
def __radd__(self,*args):
""" __radd__(point: Point3f,vector: Vector3f) -> Point3f """
pass
def __reduce_ex__(self,*args):
pass
def __repr__(self,*args):
""" __repr__(self: object) -> str """
pass
def __rmul__(self,*args):
""" __rmul__(t: Single,vector: Vector3f) -> Vector3f """
pass
def __str__(self,*args):
pass
Length=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Get: Length(self: Vector3f) -> Single
"""
X=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Get: X(self: Vector3f) -> Single
Set: X(self: Vector3f)=value
"""
Y=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Get: Y(self: Vector3f) -> Single
Set: Y(self: Vector3f)=value
"""
Z=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Get: Z(self: Vector3f) -> Single
Set: Z(self: Vector3f)=value
"""
Unset=None
XAxis=None
YAxis=None
ZAxis=None
Zero=None
# variables with complex values
| 26.927419 | 215 | 0.642408 | 404 | 3,339 | 5 | 0.205446 | 0.079703 | 0.041584 | 0.044554 | 0.308416 | 0.227228 | 0.206436 | 0.166832 | 0.166832 | 0.166832 | 0 | 0.016624 | 0.189278 | 3,339 | 123 | 216 | 27.146341 | 0.72959 | 0.381551 | 0 | 0.455882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.397059 | false | 0.397059 | 0 | 0 | 0.544118 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
4cd877603db2e32984f79f6bab3da7ef60c844aa | 147 | py | Python | titanicsp/utils.py | abbiyanaila/titanicsp | 1b05c72f4ad30182ef71890abd1e941852dc169d | [
"MIT"
] | null | null | null | titanicsp/utils.py | abbiyanaila/titanicsp | 1b05c72f4ad30182ef71890abd1e941852dc169d | [
"MIT"
] | null | null | null | titanicsp/utils.py | abbiyanaila/titanicsp | 1b05c72f4ad30182ef71890abd1e941852dc169d | [
"MIT"
] | null | null | null | from pathlib import Path
import joblib
class Loader:
@staticmethod
def load_model(path:str):
p = Path(path)
joblib.load(p) | 18.375 | 29 | 0.653061 | 20 | 147 | 4.75 | 0.65 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.265306 | 147 | 8 | 30 | 18.375 | 0.87963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
4ce190ee15aa11b75effd19aa499e8a55cdc9bf7 | 443 | py | Python | cpp_04.py | sitdh/59.com-prog | 24f536a72b0467ff3ee1615f515ecff9fbf36bb3 | [
"MIT"
] | 1 | 2021-04-25T14:46:12.000Z | 2021-04-25T14:46:12.000Z | cpp_04.py | sitdh/com-prog | 24f536a72b0467ff3ee1615f515ecff9fbf36bb3 | [
"MIT"
] | null | null | null | cpp_04.py | sitdh/com-prog | 24f536a72b0467ff3ee1615f515ecff9fbf36bb3 | [
"MIT"
] | null | null | null | first_number = int(input())
second_number = int(input())
large_number = max(first_number, second_number)
small_number = min(first_number, second_number)
remaining_number = 0
gcd = 0
while True:
times = large_number // small_number
remain = large_number - ( small_number * times )
if 0 == remain:
gcd = small_number
break
else:
large_number = small_number
small_number = remain
print(gcd)
| 18.458333 | 52 | 0.672686 | 57 | 443 | 4.929825 | 0.350877 | 0.234875 | 0.302491 | 0.234875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008929 | 0.241535 | 443 | 23 | 53 | 19.26087 | 0.827381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.0625 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4cf52aa5f12a7a43cd09e908a7a3e0b8689307ad | 335 | py | Python | tests/context.py | stevepbyrne/dbus-systemcalc-py | 4d50ca36af51bbe1e3040cb63f60ef262da5d397 | [
"MIT"
] | 5 | 2018-07-08T20:05:52.000Z | 2021-11-29T03:07:00.000Z | tests/context.py | stevepbyrne/dbus-systemcalc-py | 4d50ca36af51bbe1e3040cb63f60ef262da5d397 | [
"MIT"
] | 2 | 2016-10-13T13:02:54.000Z | 2021-03-05T17:08:55.000Z | tests/context.py | stevepbyrne/dbus-systemcalc-py | 4d50ca36af51bbe1e3040cb63f60ef262da5d397 | [
"MIT"
] | 13 | 2015-04-13T12:21:24.000Z | 2022-01-24T16:28:35.000Z | import os
import sys
# Modify path so we can find our own packages
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
sys.path.insert(1, os.path.join(test_dir, '..', 'ext', 'velib_python', 'test'))
sys.path.insert(1, os.path.join(test_dir, '..', 'ext', 'velib_python'))
sys.path.insert(1, os.path.join(test_dir, '..'))
| 33.5 | 79 | 0.695522 | 59 | 335 | 3.762712 | 0.389831 | 0.157658 | 0.234234 | 0.189189 | 0.545045 | 0.545045 | 0.545045 | 0.545045 | 0.545045 | 0.405405 | 0 | 0.013289 | 0.101493 | 335 | 9 | 80 | 37.222222 | 0.724252 | 0.128358 | 0 | 0 | 0 | 0 | 0.137931 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4cfe8d22aac080d737f325c14ae157c5368846da | 59 | py | Python | src/wshop/apps/order/__init__.py | vituocgia/wshop-core | 5f6d1ec9e9158f13aab136c5bd901c41e69a1dba | [
"BSD-3-Clause"
] | null | null | null | src/wshop/apps/order/__init__.py | vituocgia/wshop-core | 5f6d1ec9e9158f13aab136c5bd901c41e69a1dba | [
"BSD-3-Clause"
] | null | null | null | src/wshop/apps/order/__init__.py | vituocgia/wshop-core | 5f6d1ec9e9158f13aab136c5bd901c41e69a1dba | [
"BSD-3-Clause"
] | null | null | null | default_app_config = 'wshop.apps.order.config.OrderConfig'
| 29.5 | 58 | 0.830508 | 8 | 59 | 5.875 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050847 | 59 | 1 | 59 | 59 | 0.839286 | 0 | 0 | 0 | 0 | 0 | 0.59322 | 0.59322 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9816d04b429d935bcf46081722fdb240f2307f39 | 20 | py | Python | tests/nark/data/sample1.py | shadowmint/python-nark | 7919c544c8386a023f6a9d0ffbc50e1145604528 | [
"Apache-2.0"
] | null | null | null | tests/nark/data/sample1.py | shadowmint/python-nark | 7919c544c8386a023f6a9d0ffbc50e1145604528 | [
"Apache-2.0"
] | null | null | null | tests/nark/data/sample1.py | shadowmint/python-nark | 7919c544c8386a023f6a9d0ffbc50e1145604528 | [
"Apache-2.0"
] | null | null | null | text = "Hello WORLD" | 20 | 20 | 0.7 | 3 | 20 | 4.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 20 | 1 | 20 | 20 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0.52381 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9818d605f2274608bdd62c6b0343efa8fd6dfad4 | 53 | py | Python | src/manim_onlinetex/__init__.py | jsonvillanueva/manim-onlinetex | c142124fca67346e96156e66a675912b8c724238 | [
"MIT"
] | null | null | null | src/manim_onlinetex/__init__.py | jsonvillanueva/manim-onlinetex | c142124fca67346e96156e66a675912b8c724238 | [
"MIT"
] | null | null | null | src/manim_onlinetex/__init__.py | jsonvillanueva/manim-onlinetex | c142124fca67346e96156e66a675912b8c724238 | [
"MIT"
] | null | null | null | __version__ = "0.1.0"
from .manim_onlinetex import *
| 17.666667 | 30 | 0.735849 | 8 | 53 | 4.25 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065217 | 0.132075 | 53 | 2 | 31 | 26.5 | 0.673913 | 0 | 0 | 0 | 0 | 0 | 0.09434 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
e21f334807001905e410ff4e87e8006ccee3bcb6 | 56 | py | Python | 09/1 - Absolute Value.py | Surferlul/csc-python-solutions | bea99e5e1e344d17fb2cb29d8bcbc6b108e24cee | [
"MIT"
] | null | null | null | 09/1 - Absolute Value.py | Surferlul/csc-python-solutions | bea99e5e1e344d17fb2cb29d8bcbc6b108e24cee | [
"MIT"
] | null | null | null | 09/1 - Absolute Value.py | Surferlul/csc-python-solutions | bea99e5e1e344d17fb2cb29d8bcbc6b108e24cee | [
"MIT"
] | null | null | null | x=int(input())
if x < 0:
print(-x)
else:
print(x)
| 9.333333 | 14 | 0.517857 | 11 | 56 | 2.636364 | 0.636364 | 0.413793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02381 | 0.25 | 56 | 5 | 15 | 11.2 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e23e68a32c22b60eca662b95389842c6fcff0a90 | 245 | py | Python | Chap4.py | belenox/python4kids | 90bbfca824851703d197d162cfc6bbcc2b4a5099 | [
"Unlicense"
] | null | null | null | Chap4.py | belenox/python4kids | 90bbfca824851703d197d162cfc6bbcc2b4a5099 | [
"Unlicense"
] | null | null | null | Chap4.py | belenox/python4kids | 90bbfca824851703d197d162cfc6bbcc2b4a5099 | [
"Unlicense"
] | null | null | null | import turtle
t = turtle.Pen()
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)
t.forward(50)
t.left(90)
t.reset()
t.clear()
t.reset()
t.backward(100)
t.up()
t.right(90)
t.forward(20)
t.left(90)
t.down()
t.forward(100)
| 11.666667 | 16 | 0.669388 | 54 | 245 | 3.037037 | 0.296296 | 0.292683 | 0.213415 | 0.243902 | 0.420732 | 0.420732 | 0.420732 | 0.420732 | 0.420732 | 0.420732 | 0 | 0.126126 | 0.093878 | 245 | 20 | 17 | 12.25 | 0.612613 | 0 | 0 | 0.55 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.05 | 0 | 0.05 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e24e0112c24a287eefd118ac6c411f2ebbe0387a | 2,805 | py | Python | utils.py | LenSin3/Alcohol-Consumption-in-Russia | acff8cb8a36620d7213acf10dc27e3c681f8f52c | [
"MIT"
] | null | null | null | utils.py | LenSin3/Alcohol-Consumption-in-Russia | acff8cb8a36620d7213acf10dc27e3c681f8f52c | [
"MIT"
] | null | null | null | utils.py | LenSin3/Alcohol-Consumption-in-Russia | acff8cb8a36620d7213acf10dc27e3c681f8f52c | [
"MIT"
] | null | null | null | from numpy.lib.function_base import iterable
from pandas.core.frame import DataFrame
class InvalidFilePath(Exception):
"""
Exception for invalid filepath.
Raises an exception if string is not a valid file path.
...
Attributes
----------
file_path: str
Path to file.
"""
def __init__(self, file_path: object) -> None:
self.file_path = file_path
def __str__(self):
return "{} is not a valid file path.".format(self.file_path)
class InvalidDataFrame(Exception):
"""
Exception for invalid DataFrame.
Raises an exception if object is not a DataFrame.
...
Attributes
----------
df: DataFrame
Object to validate if it is a DataFrame.
"""
def __init__(self, df: DataFrame) -> None:
self.df = df
def __str__(self):
return "Object supplied is not a valid DataFrame."
class UnexpectedDataFrame(Exception):
"""
Exception for Unexpected DataFrame.
Raises an exception if when DataFrame is validated and returns False.
...
Attributes
---------
df: DataFrame
DataFrame to validate.
"""
def __init__(self, df: DataFrame) -> None:
self.df = df
def __str__(self):
return "DataFrame supplied is not expected."
class InvalidBeverage(Exception):
"""
Exception for Invalid Beverage.
Raises an exception if beverage is not in list of beverages.
...
Attributes
----------
*bevs: iterable
List of beverages.
"""
def __init__(self, *bevs: list) -> None:
self.bevs = bevs
def __str__(self):
return "{} not in list of beverages.".format(self.bevs)
class InvalidRegion(Exception):
"""
Exception for Invalid Region.
Raises an exception if region is not in list of regions.
...
Attributes
----------
region: str
String to check if in list of regions.
"""
def __init__(self, region: object) -> None:
self.region = region
def __str__(self):
return "{} is not a region in regions.".format(self.region)
class BeverageRegionExceptions(Exception):
"""
Exception for both Invalid Beverage and Invalid Region.
Raises an exception if beverage and region supplied are not in list of beverages and list of regions, respectively.
...
Attributes
----------
beverage: str
String to check if in list of beverages.
region: str
String to check if in list of regions.
"""
def __init__(self, beverage, region):
self.beverage = beverage
self.region = region
def __str__(self):
return "{} not found in beverage list and, {} not found in regions.".format(self.beverage, self.region)
| 23.771186 | 119 | 0.614617 | 330 | 2,805 | 5.060606 | 0.2 | 0.032335 | 0.033533 | 0.068263 | 0.358683 | 0.247904 | 0.190419 | 0.135329 | 0.11976 | 0.11976 | 0 | 0 | 0.284492 | 2,805 | 118 | 120 | 23.771186 | 0.832088 | 0.405704 | 0 | 0.363636 | 0 | 0 | 0.155524 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.363636 | false | 0 | 0.060606 | 0.181818 | 0.787879 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
e273e32b411b21df8da3ffcb91ccebd18c5aa5c1 | 2,382 | py | Python | itests/pages/permissions.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | itests/pages/permissions.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | itests/pages/permissions.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | from typing import TYPE_CHECKING
from itests.pages.base import BaseElement, BasePage
if TYPE_CHECKING:
from typing import List
class PermissionsPage(BasePage):
@property
def has_create_permission_button(self):
# type: () -> bool
return self.find_elements_by_class_name("create-permission") != []
@property
def permission_rows(self):
# type: () -> List[PermissionRow]
all_permission_rows = self.find_elements_by_class_name("permission-row")
return [PermissionRow(row) for row in all_permission_rows]
@property
def limit_label(self):
# type: () -> str
return self.find_element_by_class_name("dropdown-toggle").text.strip()
def click_show_all_button(self):
# type: () -> None
button = self.find_element_by_class_name("show-all")
button.click()
def click_show_audited_button(self):
# type: () -> None
button = self.find_element_by_class_name("show-audited")
button.click()
def click_sort_by_date(self):
# type: () -> None
heading = self.find_element_by_class_name("col-date")
link = heading.find_element_by_tag_name("a")
self.root.get(link.get_attribute("href"))
class PermissionRow(BaseElement):
@property
def name(self):
# type: () -> str
return self.find_element_by_class_name("permission-name").text
@property
def description(self):
# type: () -> str
return self.find_element_by_class_name("permission-description").text
@property
def created_on(self):
# type: () -> str
return self.find_element_by_class_name("permission-created-on").text
class PermissionGrantRow(BaseElement):
@property
def name(self):
return self.find_element_by_class_name("permission-name").text
@property
def href(self):
name = self.find_element_by_class_name("permission-name")
link = name.find_element_by_tag_name("a")
return link.get_attribute("href")
@property
def argument(self):
return self.find_element_by_class_name("permission-argument").text
@property
def source(self):
return self.find_element_by_class_name("permission-source").text
@property
def granted_on(self):
return self.find_element_by_class_name("permission-granted-on").text
| 29.04878 | 80 | 0.670865 | 296 | 2,382 | 5.101351 | 0.212838 | 0.074172 | 0.101987 | 0.135099 | 0.49404 | 0.459603 | 0.378808 | 0.378808 | 0.352318 | 0.258278 | 0 | 0 | 0.218304 | 2,382 | 81 | 81 | 29.407407 | 0.810956 | 0.06843 | 0 | 0.320755 | 0 | 0 | 0.103667 | 0.028972 | 0 | 0 | 0 | 0 | 0 | 1 | 0.264151 | false | 0 | 0.056604 | 0.169811 | 0.584906 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
e2796021bb8a9c77f754afd1bfca9cbb3db6b942 | 144 | py | Python | arabicnlp/utils.py | adhaamehab/arabicnlp | 3b460d2000064777165dfee68c7f1c3f7cae4d48 | [
"MIT"
] | 18 | 2019-05-22T10:43:14.000Z | 2021-11-02T09:53:27.000Z | arabicnlp/utils.py | adhaamehab/arabicnlp | 3b460d2000064777165dfee68c7f1c3f7cae4d48 | [
"MIT"
] | null | null | null | arabicnlp/utils.py | adhaamehab/arabicnlp | 3b460d2000064777165dfee68c7f1c3f7cae4d48 | [
"MIT"
] | 3 | 2019-11-04T13:26:04.000Z | 2021-03-19T00:31:36.000Z | from pathlib import Path
# set home dir for default
HOME_DIR = str(Path.home())
DEFAULT_MODEL_DIR = os.path.join(HOME_DIR,'arabicnlp_models')
| 20.571429 | 61 | 0.770833 | 24 | 144 | 4.416667 | 0.625 | 0.198113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 144 | 6 | 62 | 24 | 0.84127 | 0.166667 | 0 | 0 | 0 | 0 | 0.136752 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
e2a5f32414938584dbe34e042829d37ee5a911f2 | 893 | py | Python | crits/targets/urls.py | dutrow/crits | 6b357daa5c3060cf622d3a3b0c7b41a9ca69c049 | [
"MIT"
] | 738 | 2015-01-02T12:39:55.000Z | 2022-03-23T11:05:51.000Z | crits/targets/urls.py | dutrow/crits | 6b357daa5c3060cf622d3a3b0c7b41a9ca69c049 | [
"MIT"
] | 605 | 2015-01-01T01:03:39.000Z | 2021-11-17T18:51:07.000Z | crits/targets/urls.py | dutrow/crits | 6b357daa5c3060cf622d3a3b0c7b41a9ca69c049 | [
"MIT"
] | 316 | 2015-01-07T12:35:01.000Z | 2022-03-30T04:44:30.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^list/$', views.targets_listing, name='crits-targets-views-targets_listing'),
url(r'^list/(?P<option>\S+)/$', views.targets_listing, name='crits-targets-views-targets_listing'),
url(r'^divisions/list/$', views.divisions_listing, name='crits-targets-views-divisions_listing'),
url(r'^divisions/list/(?P<option>\S+)/$', views.divisions_listing, name='crits-targets-views-divisions_listing'),
url(r'^add_target/$', views.add_update_target, name='crits-targets-views-add_update_target'),
url(r'^details/(?P<email_address>[\S ]+)/$', views.target_details, name='crits-targets-views-target_details'),
url(r'^details/$', views.target_details, name='crits-targets-views-target_details'),
url(r'^info/(?P<email_address>[\S ]+)/$', views.target_info, name='crits-targets-views-target_info'),
]
| 59.533333 | 117 | 0.717805 | 125 | 893 | 4.96 | 0.2 | 0.051613 | 0.206452 | 0.270968 | 0.748387 | 0.630645 | 0.567742 | 0.567742 | 0.567742 | 0.567742 | 0 | 0 | 0.080627 | 893 | 14 | 118 | 63.785714 | 0.755177 | 0 | 0 | 0 | 0 | 0 | 0.506159 | 0.44009 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2c344fed5002a8d2d1903a7be6089dfc41a778e2 | 119 | py | Python | tep/__init__.py | dongfanger/tep | ec5516ec7e0ff1b68f7afbf430d47245245f02e7 | [
"Apache-2.0"
] | 39 | 2020-08-19T14:46:21.000Z | 2022-03-20T01:11:23.000Z | tep/__init__.py | dongfanger/tep | ec5516ec7e0ff1b68f7afbf430d47245245f02e7 | [
"Apache-2.0"
] | 6 | 2020-07-24T02:44:54.000Z | 2021-09-07T05:10:36.000Z | tep/__init__.py | dongfanger/tep | ec5516ec7e0ff1b68f7afbf430d47245245f02e7 | [
"Apache-2.0"
] | 11 | 2021-02-03T09:17:09.000Z | 2022-01-14T00:03:01.000Z | __version__ = "0.9.1"
__description__ = "tep is a testing tool to help you write pytest more easily. Try Easy Pytest!"
| 39.666667 | 96 | 0.747899 | 20 | 119 | 4.05 | 0.95 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030303 | 0.168067 | 119 | 2 | 97 | 59.5 | 0.787879 | 0 | 0 | 0 | 0 | 0 | 0.680672 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2c4a275faf4e414c3a2ad4096f866f468a5775bb | 1,318 | py | Python | Factory_Method/concrete_creator_tea.py | dcesarz/design_patterns_factories | e276e25586dc631309febb0fe9eb5f1454627107 | [
"MIT"
] | null | null | null | Factory_Method/concrete_creator_tea.py | dcesarz/design_patterns_factories | e276e25586dc631309febb0fe9eb5f1454627107 | [
"MIT"
] | null | null | null | Factory_Method/concrete_creator_tea.py | dcesarz/design_patterns_factories | e276e25586dc631309febb0fe9eb5f1454627107 | [
"MIT"
] | null | null | null | from __future__ import annotations
from Factory_Method.creator_cafe import CafeCreator
from Factory_Method.product_interface import IProduct
class ConcreteCreatorTeaBlack(CafeCreator):
def factory_method(self) -> IProduct:
return ConcreteTeaBlack()
class ConcreteCreatorTeaRed(CafeCreator):
def factory_method(self) -> IProduct:
return ConcreteTeaRed()
class ConcreteCreatorTeaGreen(CafeCreator):
def factory_method(self) -> IProduct:
return ConcreteTeaGreen()
class ConcreteCreatorTeaWhite(CafeCreator):
def factory_method(self) -> IProduct:
return ConcreteTeaWhite()
class ConcreteCreatorTeaMatcha(CafeCreator):
def factory_method(self) -> IProduct:
return ConcreteTeaMatcha()
class ConcreteTeaBlack(IProduct):
def operation(self) -> str:
return str(self.__class__)
class ConcreteTeaRed(IProduct):
def operation(self) -> str:
return str(self.__class__)
class ConcreteTeaGreen(IProduct):
def operation(self) -> str:
return str(self.__class__)
class ConcreteTeaWhite(IProduct):
def operation(self) -> str:
return str(self.__class__)
class ConcreteTeaMatcha(IProduct):
def operation(self) -> str:
return str(self.__class__)
| 23.963636 | 54 | 0.701062 | 123 | 1,318 | 7.243902 | 0.227642 | 0.102132 | 0.117845 | 0.151515 | 0.527497 | 0.527497 | 0.527497 | 0.274972 | 0.274972 | 0.224467 | 0 | 0 | 0.217754 | 1,318 | 54 | 55 | 24.407407 | 0.86421 | 0 | 0 | 0.454545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.30303 | false | 0 | 0.090909 | 0.30303 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
2c53e4ee6d1dab6f254bc0149d5a8bbacc9d86a5 | 172 | py | Python | substitutiion/check.py | delvinru/decrypt-vizhener-rsa | 7cde344832af1e8b4ab9f8b22cdc5108f2e83c82 | [
"MIT"
] | 1 | 2021-12-12T21:34:47.000Z | 2021-12-12T21:34:47.000Z | substitutiion/check.py | delvinru/decrypt-vizhener-rsa | 7cde344832af1e8b4ab9f8b22cdc5108f2e83c82 | [
"MIT"
] | null | null | null | substitutiion/check.py | delvinru/decrypt-vizhener-rsa | 7cde344832af1e8b4ab9f8b22cdc5108f2e83c82 | [
"MIT"
] | null | null | null | sub = {
"а" : {
"freq": 10.234,
"count": 3243,
"sub" : "б"
},
"б" : {
"freq": 8.324,
"count": 123,
"sub" : "д"
}
}
print(sub['а']['freq'], sub['б']['sub']) | 12.285714 | 40 | 0.389535 | 24 | 172 | 2.791667 | 0.541667 | 0.119403 | 0.238806 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0.255814 | 172 | 14 | 40 | 12.285714 | 0.398438 | 0 | 0 | 0 | 0 | 0 | 0.213873 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.076923 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2c73a045a5afb3e1bdc813857c7974480c1bbc25 | 991 | py | Python | src/regoct/Util.py | runoverPy/regOct | cfeeaaf3ab9a8e039a72e889eb77844aadb36b9a | [
"MIT"
] | null | null | null | src/regoct/Util.py | runoverPy/regOct | cfeeaaf3ab9a8e039a72e889eb77844aadb36b9a | [
"MIT"
] | 1 | 2021-02-10T16:27:52.000Z | 2021-02-10T16:27:52.000Z | src/regoct/Util.py | runoverPy/regOct | cfeeaaf3ab9a8e039a72e889eb77844aadb36b9a | [
"MIT"
] | null | null | null | import glm
class Geometry():
@staticmethod
def index_from_coords(coord_list, level=0):
return sum(glm.i16vec3(coord_list) * glm.i16vec3(1,2,4) / 2**level)
@staticmethod
def coord_gen(num):
for i in range(8):
yield glm.vec3(num) % glm.vec3(2, 4, 8) // glm.vec3(1, 2, 4)
@staticmethod
def coords_from_index(num, level=0):
return (glm.vec3(num) % glm.vec3(2, 4, 8) // glm.vec3(1, 2, 4) * 2**level).to_list()
@staticmethod
def coord_addition(coord1, coord2):
return (glm.vec3(coord1) + glm.vec3(coord2)).to_list()
@staticmethod
def coord_div(coord, denom):
return (glm.vec3(coord) // denom).to_list()
@staticmethod
def coord_mod(coord, denom):
return (glm.vec3(coord) % denom).to_list()
@staticmethod
def coord_compare_less(coord, value):
if 1 in (glm.i16vec3(coord) < glm.i16vec3(value)):
return False
else:
return True | 28.314286 | 92 | 0.598385 | 138 | 991 | 4.181159 | 0.304348 | 0.121317 | 0.17331 | 0.145581 | 0.42461 | 0.308492 | 0.308492 | 0.308492 | 0.308492 | 0.308492 | 0 | 0.064295 | 0.262361 | 991 | 35 | 93 | 28.314286 | 0.725034 | 0 | 0 | 0.259259 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.259259 | false | 0 | 0.037037 | 0.185185 | 0.592593 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
2c74267e046f72b4f82e5f690276fa85718438e2 | 491 | py | Python | breeze/model.py | chrisseto/Breeze | 53fc81666ba144e4a873c5f20e77cde00a675d38 | [
"MIT"
] | null | null | null | breeze/model.py | chrisseto/Breeze | 53fc81666ba144e4a873c5f20e77cde00a675d38 | [
"MIT"
] | null | null | null | breeze/model.py | chrisseto/Breeze | 53fc81666ba144e4a873c5f20e77cde00a675d38 | [
"MIT"
] | null | null | null | import abc
class ResourceModel(metaclass=abc.ABCMeta):
@classmethod
def default_resource_name(cls):
return cls.name.lower() + 's'
@abc.abstractclassmethod
def load(cls, pk):
pass
@abc.abstractclassmethod
def create(cls, **kwargs):
pass
@abc.abstractclassmethod
def list(cls, filter_options):
pass
@abc.abstractmethod
def save(cls, pk):
pass
@abc.abstractmethod
def update(cls, pk):
pass
| 16.931034 | 43 | 0.617108 | 54 | 491 | 5.555556 | 0.5 | 0.093333 | 0.25 | 0.08 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285132 | 491 | 28 | 44 | 17.535714 | 0.854701 | 0 | 0 | 0.5 | 0 | 0 | 0.002037 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0.25 | 0.05 | 0.05 | 0.45 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
2c896f8d2ed3403eb59e74a8ba2e703412b35dc9 | 166 | py | Python | src/utils/log.py | brwnow/garticNotifier | 0a1c05c97d4b38bf469ef33b669af434cd355a1a | [
"WTFPL"
] | null | null | null | src/utils/log.py | brwnow/garticNotifier | 0a1c05c97d4b38bf469ef33b669af434cd355a1a | [
"WTFPL"
] | null | null | null | src/utils/log.py | brwnow/garticNotifier | 0a1c05c97d4b38bf469ef33b669af434cd355a1a | [
"WTFPL"
] | null | null | null | logLevel = 0
def log(msg):
if logLevel > 0:
print(msg)
else:
pass
def setLogLevel(value):
global logLevel
logLevel = value | 15.090909 | 24 | 0.548193 | 19 | 166 | 4.789474 | 0.631579 | 0.197802 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019231 | 0.373494 | 166 | 11 | 25 | 15.090909 | 0.855769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0.111111 | 0 | 0 | 0.222222 | 0.111111 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
2cad60dd568624f06bad624fe423399ee2109019 | 97 | py | Python | Chapter 05/Praktikum-1/2.py | icaksh/Python-Projects-Protek | dfd56ea5afc637a8850911a9296131652de383c5 | [
"MIT"
] | null | null | null | Chapter 05/Praktikum-1/2.py | icaksh/Python-Projects-Protek | dfd56ea5afc637a8850911a9296131652de383c5 | [
"MIT"
] | null | null | null | Chapter 05/Praktikum-1/2.py | icaksh/Python-Projects-Protek | dfd56ea5afc637a8850911a9296131652de383c5 | [
"MIT"
] | null | null | null | bil = -4
if (bil > 0):
print("Bilangan positif")
else:
print("Bilangan negatif atau nol") | 19.4 | 38 | 0.628866 | 14 | 97 | 4.357143 | 0.785714 | 0.42623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026316 | 0.216495 | 97 | 5 | 38 | 19.4 | 0.776316 | 0 | 0 | 0 | 0 | 0 | 0.418367 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2cb7571fcc29f95f15f0ebbb97e57b382646f255 | 395 | py | Python | src/airfly/_vendor/airflow/providers/amazon/aws/operators/emr_add_steps.py | ryanchao2012/airfly | 230ddd88885defc67485fa0c51f66c4a67ae98a9 | [
"MIT"
] | 7 | 2021-09-27T11:38:48.000Z | 2022-02-01T06:06:24.000Z | src/airfly/_vendor/airflow/providers/amazon/aws/operators/emr_add_steps.py | ryanchao2012/airfly | 230ddd88885defc67485fa0c51f66c4a67ae98a9 | [
"MIT"
] | null | null | null | src/airfly/_vendor/airflow/providers/amazon/aws/operators/emr_add_steps.py | ryanchao2012/airfly | 230ddd88885defc67485fa0c51f66c4a67ae98a9 | [
"MIT"
] | null | null | null | # Auto generated by 'inv collect-airflow'
from airfly._vendor.airflow.models.baseoperator import BaseOperator
class EmrAddStepsOperator(BaseOperator):
job_flow_id: "typing.Union[str, NoneType]"
job_flow_name: "typing.Union[str, NoneType]"
cluster_states: "typing.Union[typing.List[str], NoneType]"
aws_conn_id: "str"
steps: "typing.Union[typing.List[dict], str, NoneType]"
| 35.909091 | 67 | 0.751899 | 51 | 395 | 5.666667 | 0.568627 | 0.152249 | 0.096886 | 0.152249 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.124051 | 395 | 10 | 68 | 39.5 | 0.83526 | 0.098734 | 0 | 0 | 1 | 0 | 0.403955 | 0.172316 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.142857 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
e2dcfe03b473f9ef6b41305b42be86ff132cb087 | 730 | py | Python | srl/base/rl/remote_memory/experience_replay_buffer.py | pocokhc/simple_rl | 765f12f392f87e6897027905d74f1bced6a2b7bf | [
"MIT"
] | 1 | 2022-03-01T09:16:57.000Z | 2022-03-01T09:16:57.000Z | srl/base/rl/remote_memory/experience_replay_buffer.py | pocokhc/simple_rl | 765f12f392f87e6897027905d74f1bced6a2b7bf | [
"MIT"
] | null | null | null | srl/base/rl/remote_memory/experience_replay_buffer.py | pocokhc/simple_rl | 765f12f392f87e6897027905d74f1bced6a2b7bf | [
"MIT"
] | null | null | null | import random
from collections import deque
from typing import Any
from srl.base.rl.base import RLRemoteMemory
class ExperienceReplayBuffer(RLRemoteMemory):
def __init__(self, *args):
super().__init__(*args)
def init(self, capacity: int):
self.memory = deque(maxlen=capacity)
def length(self) -> int:
return len(self.memory)
def restore(self, data: Any) -> None:
self.memory = data
def backup(self):
return self.memory
# ---------------------------
def add(self, batch: Any):
self.memory.append(batch)
def sample(self, batch_size: int):
return random.sample(self.memory, batch_size)
def clear(self):
self.memory.clear()
| 22.121212 | 53 | 0.623288 | 88 | 730 | 5.056818 | 0.397727 | 0.157303 | 0.049438 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.236986 | 730 | 32 | 54 | 22.8125 | 0.798923 | 0.036986 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.380952 | false | 0 | 0.190476 | 0.142857 | 0.761905 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
e2ee2cf9a26fd6354d581a3587f28e5f5f1e0d7e | 377 | py | Python | taxonomies/uruguay/process.py | openspending/dataflows-openspending | 9b6b33d48025185fcf9a69752960e8ff4cbbab87 | [
"MIT"
] | 1 | 2019-07-30T07:42:05.000Z | 2019-07-30T07:42:05.000Z | taxonomies/uruguay/process.py | openspending/dataflows-openspending | 9b6b33d48025185fcf9a69752960e8ff4cbbab87 | [
"MIT"
] | null | null | null | taxonomies/uruguay/process.py | openspending/dataflows-openspending | 9b6b33d48025185fcf9a69752960e8ff4cbbab87 | [
"MIT"
] | 1 | 2020-12-08T07:50:46.000Z | 2020-12-08T07:50:46.000Z | import os
import datapackage
from dataflows import Flow, set_type
from dgp.config.consts import CONFIG_MODEL_MAPPING, CONFIG_TAXONOMY_CT
from dgp.core import BaseAnalyzer
from dgp_server.log import logger
from dataflows_openspending.common_transforms import flows as p_flows
def flows(config, context):
return p_flows(config, context)
def analyzers(*_):
return []
| 22.176471 | 70 | 0.811671 | 54 | 377 | 5.462963 | 0.555556 | 0.071186 | 0.122034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135279 | 377 | 16 | 71 | 23.5625 | 0.904908 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.181818 | false | 0 | 0.636364 | 0.181818 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
39142d7b8f1b66d55c1475b9e8ddc666cb5b6061 | 911 | py | Python | src/yellowdog_client/model/configured_worker_pool.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/model/configured_worker_pool.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/model/configured_worker_pool.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from datetime import datetime
from typing import Optional
from .configured_worker_pool_properties import ConfiguredWorkerPoolProperties
from .node_summary import NodeSummary
from .worker_pool import WorkerPool
from .worker_pool_status import WorkerPoolStatus
from .worker_summary import WorkerSummary
@dataclass
class ConfiguredWorkerPool(WorkerPool):
type: str = field(default="co.yellowdog.platform.model.ConfiguredWorkerPool", init=False)
id: Optional[str] = None
name: Optional[str] = None
createdTime: Optional[datetime] = None
status: Optional[WorkerPoolStatus] = None
statusChangedTime: Optional[datetime] = None
expectedNodeCount: int = 0
awaitingNodes: bool = False
workerSummary: Optional[WorkerSummary] = None
nodeSummary: Optional[NodeSummary] = None
properties: Optional[ConfiguredWorkerPoolProperties] = None
| 36.44 | 93 | 0.794731 | 94 | 911 | 7.617021 | 0.43617 | 0.041899 | 0.039106 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001277 | 0.140505 | 911 | 24 | 94 | 37.958333 | 0.913155 | 0 | 0 | 0 | 0 | 0 | 0.052689 | 0.052689 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.380952 | 0 | 0.952381 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
3924eb7587817bd2bf834b22b475cb4829589b0e | 324 | py | Python | websauna/utils/psql.py | highPriestLOL/websauna | 2e78cd87eda305fbbb1080d386b8cf96537360e5 | [
"CNRI-Python"
] | 286 | 2016-01-17T05:44:02.000Z | 2022-02-07T20:28:49.000Z | websauna/utils/psql.py | highPriestLOL/websauna | 2e78cd87eda305fbbb1080d386b8cf96537360e5 | [
"CNRI-Python"
] | 203 | 2016-03-15T02:00:53.000Z | 2021-09-27T10:48:49.000Z | websauna/utils/psql.py | ooduor/websauna | 2e78cd87eda305fbbb1080d386b8cf96537360e5 | [
"CNRI-Python"
] | 71 | 2016-01-17T11:04:26.000Z | 2021-08-24T08:04:31.000Z | """PostgreSQL helpers."""
# Use pgcrypto, instead of uuid-ossp
# Also create a function uuid_generate_v4 for backward compatibility
UUID_SUPPORT_STMT = """CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE OR REPLACE FUNCTION uuid_generate_v4()
RETURNS uuid
AS '
BEGIN
RETURN gen_random_uuid();
END'
LANGUAGE 'plpgsql';
"""
| 23.142857 | 68 | 0.774691 | 45 | 324 | 5.4 | 0.755556 | 0.098765 | 0.164609 | 0.18107 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007092 | 0.12963 | 324 | 13 | 69 | 24.923077 | 0.85461 | 0.376543 | 0 | 0 | 1 | 0 | 0.841026 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
393a7e0007fe88d99603ef84d0e1c5e20721b921 | 364 | py | Python | {{cookiecutter.project_repo}}/src/app/api/routes/api.py | cpatrickalves/cookiecutter-ml-fastapi | ede351a195969f9843508304788a1c96af7b9deb | [
"MIT"
] | null | null | null | {{cookiecutter.project_repo}}/src/app/api/routes/api.py | cpatrickalves/cookiecutter-ml-fastapi | ede351a195969f9843508304788a1c96af7b9deb | [
"MIT"
] | null | null | null | {{cookiecutter.project_repo}}/src/app/api/routes/api.py | cpatrickalves/cookiecutter-ml-fastapi | ede351a195969f9843508304788a1c96af7b9deb | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from api.routes import trainer
from api.routes import common
from api.routes import predictor
router = APIRouter()
router.include_router(predictor.router, tags=["predictor"], prefix="/v1")
router.include_router(predictor.router, tags=["trainer"], prefix="/v1")
router.include_router(predictor.router, tags=["common"], prefix="/v1")
| 33.090909 | 73 | 0.777473 | 48 | 364 | 5.833333 | 0.291667 | 0.214286 | 0.139286 | 0.203571 | 0.464286 | 0.464286 | 0.328571 | 0.328571 | 0 | 0 | 0 | 0.008982 | 0.082418 | 364 | 10 | 74 | 36.4 | 0.829341 | 0 | 0 | 0 | 0 | 0 | 0.085165 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
393b6fbef9f78b887c2b5991abd585aa15030a4f | 201 | py | Python | tests/test_zpl_fx.py | marcovannoord/simple_zpl2 | 7550485c50ee9a4808d1c6dfbeb040ab6429f3bb | [
"MIT"
] | 16 | 2017-06-15T23:01:16.000Z | 2021-09-30T00:30:49.000Z | tests/test_zpl_fx.py | marcovannoord/simple_zpl2 | 7550485c50ee9a4808d1c6dfbeb040ab6429f3bb | [
"MIT"
] | 139 | 2017-05-27T15:14:34.000Z | 2022-03-21T14:31:04.000Z | tests/test_zpl_fx.py | marcovannoord/simple_zpl2 | 7550485c50ee9a4808d1c6dfbeb040ab6429f3bb | [
"MIT"
] | 5 | 2018-04-09T03:54:28.000Z | 2022-03-22T08:46:38.000Z | import pytest
from simple_zpl2 import ZPLDocument
def test_comment():
zdoc = ZPLDocument()
zdoc.add_comment('Testing Comment')
assert zdoc.zpl_bytes == b'^XA\n^FXTesting Comment^FS\n^XZ'
| 22.333333 | 63 | 0.731343 | 29 | 201 | 4.931034 | 0.724138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005917 | 0.159204 | 201 | 8 | 64 | 25.125 | 0.840237 | 0 | 0 | 0 | 0 | 0 | 0.228856 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
3948e9d056cb4eb1a7c588f04bb62ec28ba82e21 | 580 | py | Python | example/13.Singel_motors/set_degrees_counted.py | rundhall/PC-LEGO-SPIKE-Simulator | 5b2fae19293875b2f60d599940d77237700798d3 | [
"MIT"
] | null | null | null | example/13.Singel_motors/set_degrees_counted.py | rundhall/PC-LEGO-SPIKE-Simulator | 5b2fae19293875b2f60d599940d77237700798d3 | [
"MIT"
] | null | null | null | example/13.Singel_motors/set_degrees_counted.py | rundhall/PC-LEGO-SPIKE-Simulator | 5b2fae19293875b2f60d599940d77237700798d3 | [
"MIT"
] | null | null | null | '''set_degrees_counted(degrees_counted)
Sets the "number of degrees counted" to the desired value.
Parameters
degrees_counted
The value to which the number of degrees counted should be set.
Type:integer (a positive or negative whole number, including 0)
Values:any number
Default:no default value
Errors
TypeError
degrees_counted is not an integer.
RuntimeError
The motor has been disconnected from the Port
'''
from spike import Motor
motor = Motor('A')
motor.set_degrees_counted(10)
#motor.run_for_rotations(2)
# The program will never proceed to here if the motor is stalled | 26.363636 | 64 | 0.806897 | 93 | 580 | 4.935484 | 0.569892 | 0.213508 | 0.074074 | 0.078431 | 0.108932 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008 | 0.137931 | 580 | 22 | 64 | 26.363636 | 0.91 | 0.851724 | 0 | 0 | 0 | 0 | 0.012658 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
394edc71749c380ea3c3f25388b980a8b88e9089 | 410 | py | Python | koicore/types/koi_character.py | koi-lang/koi-python | e4f5d5fc095654b51b2956e932beb5bd7c9b4a3c | [
"BSD-3-Clause"
] | null | null | null | koicore/types/koi_character.py | koi-lang/koi-python | e4f5d5fc095654b51b2956e932beb5bd7c9b4a3c | [
"BSD-3-Clause"
] | null | null | null | koicore/types/koi_character.py | koi-lang/koi-python | e4f5d5fc095654b51b2956e932beb5bd7c9b4a3c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""""""
from koicore.koi_object import KoiObject
class KoiCharacter(KoiObject):
def __init__(self, value: str):
super().__init__()
self.value = value[0]
def to_boolean(self):
pass
def to_character(self):
return KoiCharacter(self.value)
def to_integer(self):
pass
def to_string(self):
pass
| 17.083333 | 40 | 0.602439 | 50 | 410 | 4.68 | 0.58 | 0.08547 | 0.111111 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01 | 0.268293 | 410 | 23 | 41 | 17.826087 | 0.77 | 0.104878 | 0 | 0.230769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.384615 | false | 0.230769 | 0.076923 | 0.076923 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
39536be6023269d09ecc3fbd2e2909d020e0851e | 194 | py | Python | vk_bot/mods/testing/hello-world.py | triangle1984/vk-bot | 39dea7bf8043e791ef079ea1ac6616f95d5b5312 | [
"BSD-3-Clause"
] | 3 | 2019-11-05T12:32:04.000Z | 2019-11-15T14:29:46.000Z | vk_bot/mods/testing/hello-world.py | anar66/vk-bot | 39dea7bf8043e791ef079ea1ac6616f95d5b5312 | [
"BSD-3-Clause"
] | 1 | 2019-12-11T20:26:31.000Z | 2019-12-11T20:26:31.000Z | vk_bot/mods/testing/hello-world.py | triangle1984/vk-bot | 39dea7bf8043e791ef079ea1ac6616f95d5b5312 | [
"BSD-3-Clause"
] | 5 | 2019-11-20T14:20:30.000Z | 2022-02-05T10:37:01.000Z | from vk_bot.core.modules.basicplug import BasicPlug
class Test(BasicPlug):
command = ("hello",)
doc = "первый модуль, тест"
def main(self):
self.sendmsg("Хелоу ворлдддд")
| 19.4 | 51 | 0.664948 | 24 | 194 | 5.333333 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.21134 | 194 | 9 | 52 | 21.555556 | 0.836601 | 0 | 0 | 0 | 0 | 0 | 0.195876 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.833333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
1a52e5c425a558fdc74699ce332ffcbacff420ca | 1,499 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/EXT/texture_compression_latc.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/EXT/texture_compression_latc.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/EXT/texture_compression_latc.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''OpenGL extension EXT.texture_compression_latc
This module customises the behaviour of the
OpenGL.raw.GL.EXT.texture_compression_latc to provide a more
Python-friendly API
Overview (from the spec)
This extension introduces four new block-based texture compression
formats suited for unsigned and signed luminance and luminance-alpha
textures (hence the name "latc" for Luminance-Alpha Texture
Compression).
These formats are designed to reduce the storage requirements and
memory bandwidth required for luminance and luminance-alpha textures
by a factor of 2-to-1 over conventional uncompressed luminance and
luminance-alpha textures with 8-bit components (GL_LUMINANCE8 and
GL_LUMINANCE8_ALPHA8).
The compressed signed luminance-alpha format is reasonably suited
for storing compressed normal maps.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/texture_compression_latc.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.EXT.texture_compression_latc import *
from OpenGL.raw.GL.EXT.texture_compression_latc import _EXTENSION_NAME
def glInitTextureCompressionLatcEXT():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
### END AUTOGENERATED SECTION | 38.435897 | 72 | 0.798532 | 200 | 1,499 | 5.89 | 0.49 | 0.106961 | 0.089134 | 0.106112 | 0.195246 | 0.108659 | 0.108659 | 0.078098 | 0.078098 | 0 | 0 | 0.004724 | 0.152769 | 1,499 | 39 | 73 | 38.435897 | 0.922835 | 0.759173 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | true | 0 | 0.777778 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1a6a7be79ded4d153292c1d33f4abf9e977ab2e5 | 163 | py | Python | deploy/urls.py | zeus911/OSP | 5a1db0d8ed12b2b7355e56aed7a6e741f43914d9 | [
"BSD-2-Clause"
] | 6 | 2016-05-31T07:19:05.000Z | 2020-02-17T09:00:26.000Z | deploy/urls.py | zeus911/OSP | 5a1db0d8ed12b2b7355e56aed7a6e741f43914d9 | [
"BSD-2-Clause"
] | null | null | null | deploy/urls.py | zeus911/OSP | 5a1db0d8ed12b2b7355e56aed7a6e741f43914d9 | [
"BSD-2-Clause"
] | 6 | 2016-06-05T12:24:46.000Z | 2020-03-01T15:56:09.000Z | from django.conf.urls import include, url
from views import index, deploy
urlpatterns = [
url(r'^$', index),
url(r'^api/$', deploy, name='deploy_work'),
] | 23.285714 | 47 | 0.662577 | 23 | 163 | 4.652174 | 0.652174 | 0.074766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165644 | 163 | 7 | 48 | 23.285714 | 0.786765 | 0 | 0 | 0 | 0 | 0 | 0.115854 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1a6cadae6d824c472e7b3feb7f228ab915dff7c2 | 607 | py | Python | bootstrapper.py | Scandinaf/ll_free | 7d35dce5955f11e4af52400f961c76c9904c2f05 | [
"Apache-2.0"
] | null | null | null | bootstrapper.py | Scandinaf/ll_free | 7d35dce5955f11e4af52400f961c76c9904c2f05 | [
"Apache-2.0"
] | null | null | null | bootstrapper.py | Scandinaf/ll_free | 7d35dce5955f11e4af52400f961c76c9904c2f05 | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
from logging.config import fileConfig
from aiokafka import AIOKafkaProducer
from service.mongodb.db_layer import DBLayer
def __init_logger__():
fileConfig('logging.conf')
logger = logging.getLogger()
logger.info("Logger was initialized.")
def __init_io_loop__():
return asyncio.get_event_loop()
def __init_db_layer__(loop):
return DBLayer(loop)
def __init_producer__(loop):
producer = AIOKafkaProducer(
loop=loop, bootstrap_servers='{0}:{1}'.format("127.0.0.1", 9092))
loop.run_until_complete(producer.start())
return producer
| 20.931034 | 73 | 0.741351 | 77 | 607 | 5.480519 | 0.493506 | 0.066351 | 0.052133 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023392 | 0.15486 | 607 | 28 | 74 | 21.678571 | 0.79922 | 0 | 0 | 0 | 0 | 0 | 0.08402 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.277778 | 0.111111 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
1a798826dd8721655f601c53a4aab2ccd15d02a2 | 483 | py | Python | dedupsqlfs/compression/none.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 22 | 2015-04-09T09:00:00.000Z | 2022-03-23T00:16:04.000Z | dedupsqlfs/compression/none.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 119 | 2015-02-11T21:39:27.000Z | 2021-07-27T23:04:49.000Z | dedupsqlfs/compression/none.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 7 | 2016-03-16T11:53:45.000Z | 2022-02-24T13:47:31.000Z | # -*- coding: utf8 -*-
__author__ = 'sergey'
"""
Class for NONE compression helper
"""
from dedupsqlfs.compression import BaseCompression
class NoneCompression(BaseCompression):
_method_name = "none"
_minimal_size = 0
_has_comp_level_options = False
def _init_module(self):
return None
def _noop(self, data):
return data
def _get_comp_func(self):
return self._noop
def _get_decomp_func(self):
return self._noop
| 15.580645 | 50 | 0.668737 | 56 | 483 | 5.357143 | 0.607143 | 0.1 | 0.093333 | 0.12 | 0.146667 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005495 | 0.246377 | 483 | 30 | 51 | 16.1 | 0.818681 | 0.041408 | 0 | 0.142857 | 0 | 0 | 0.023866 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.071429 | 0.285714 | 0.928571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.