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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f082c41af88239a42e587b5df115c245699b68b1
| 240
|
py
|
Python
|
plink/admin.py
|
dgraham66/apertura_django
|
bfc524c3681395e655098500510d67e40886d7d4
|
[
"MIT"
] | 1
|
2016-07-22T10:40:41.000Z
|
2016-07-22T10:40:41.000Z
|
plink/admin.py
|
dgraham66/apertura_django
|
bfc524c3681395e655098500510d67e40886d7d4
|
[
"MIT"
] | null | null | null |
plink/admin.py
|
dgraham66/apertura_django
|
bfc524c3681395e655098500510d67e40886d7d4
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from models import Plink
from models import PlinkJob
from models import PlinkOption
# Register your models here.
admin.site.register(Plink)
admin.site.register(PlinkJob)
admin.site.register(PlinkOption)
| 18.461538
| 32
| 0.820833
| 33
| 240
| 5.969697
| 0.393939
| 0.152284
| 0.243655
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116667
| 240
| 12
| 33
| 20
| 0.929245
| 0.108333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.571429
| 0
| 0.571429
| 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
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b2b6b2ace4430dfecfe0b6654eedbe76f9a8218a
| 1,444
|
py
|
Python
|
tests/unit/compress/CompressWithOrder.py
|
wangjeaf/CSSCheckStyle
|
d1b1ed89c61ca80d65f398ec4a07d73789197b04
|
[
"BSD-3-Clause"
] | 21
|
2015-04-27T14:54:45.000Z
|
2021-11-08T09:12:08.000Z
|
tests/unit/compress/CompressWithOrder.py
|
wangjeaf/CSSCheckStyle
|
d1b1ed89c61ca80d65f398ec4a07d73789197b04
|
[
"BSD-3-Clause"
] | null | null | null |
tests/unit/compress/CompressWithOrder.py
|
wangjeaf/CSSCheckStyle
|
d1b1ed89c61ca80d65f398ec4a07d73789197b04
|
[
"BSD-3-Clause"
] | 6
|
2015-03-02T08:08:59.000Z
|
2016-03-16T14:52:38.000Z
|
from helper import *
def doTest():
_basic()
_with_hack()
_with_extra()
_with_different_level()
_with_css3_props()
def _basic():
msg = doCssCompress('/* @wangjeaf */ .test {width: 100px; display:none; height: 100px;}')
equal(msg, '.test{display:none;width:100px;height:100px}', 'general order compress is ok')
def _with_hack():
msg = doCssCompress('.test {_width: 100px; *display:none;_display:none;display:block\9;*height: 100px;}')
equal(msg, '.test{*display:none;_display:none;display:block\9;_width:100px;*height:100px}', 'hack order compress is ok')
def _with_extra():
msg = doCssCompress('@import (url-here);.test {_width: 100px; *height: 100px;}')
equal(msg, '@import (url-here);.test{_width:100px;*height:100px}', 'extra order compress is ok')
def _with_different_level():
msg = doCssCompress('.test {cursor:pointer;color:red;line-height:10px;background-color:red;margin-top:10px;padding-bottom:10px;position:relative;}')
equal(msg, '.test{position:relative;margin-top:10px;padding-bottom:10px;background-color:red;line-height:10px;color:red;cursor:pointer}', 'different levels is ok')
def _with_css3_props():
msg = doCssCompress('.test {-moz-transform:xxxx;-webkit-transform:xxxx;transform:xxxx;*zoom:1;width:100px;display:none;}')
equal(msg, '.test{display:none;width:100px;*zoom:1;-webkit-transform:xxxx;-moz-transform:xxxx;transform:xxxx}', 'different levels is ok')
| 49.793103
| 167
| 0.718144
| 198
| 1,444
| 5.09596
| 0.262626
| 0.079286
| 0.055501
| 0.083251
| 0.456888
| 0.374628
| 0.243806
| 0.075322
| 0
| 0
| 0
| 0.046548
| 0.107341
| 1,444
| 28
| 168
| 51.571429
| 0.73623
| 0
| 0
| 0
| 0
| 0.272727
| 0.654432
| 0.449446
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0
| 0.136364
| 0
| 0.409091
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b2c3ea1bcacaf61348fb99ebd07da99776aed39c
| 83
|
py
|
Python
|
pafd/apps.py
|
kavinzhao/fduhole
|
508922cfa0558c58b95206dd8fbf51d10525fa1e
|
[
"Apache-2.0"
] | 9
|
2021-04-14T12:08:38.000Z
|
2021-12-16T08:14:40.000Z
|
pafd/apps.py
|
kavinzhao/fduhole
|
508922cfa0558c58b95206dd8fbf51d10525fa1e
|
[
"Apache-2.0"
] | 9
|
2021-04-18T09:48:25.000Z
|
2021-11-26T07:43:22.000Z
|
pafd/apps.py
|
kavinzhao/fduhole
|
508922cfa0558c58b95206dd8fbf51d10525fa1e
|
[
"Apache-2.0"
] | 4
|
2021-07-15T02:10:42.000Z
|
2022-01-22T02:12:11.000Z
|
from django.apps import AppConfig
class PafdConfig(AppConfig):
name = 'pafd'
| 13.833333
| 33
| 0.73494
| 10
| 83
| 6.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180723
| 83
| 5
| 34
| 16.6
| 0.897059
| 0
| 0
| 0
| 0
| 0
| 0.048193
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b2d16142577b6e024a6f8a010d2ed3092065fe2c
| 162
|
py
|
Python
|
t2.py
|
mabotech/mabo.data
|
6142226580aca6e0031f9d7f48e0823e7b0fe30a
|
[
"MIT"
] | null | null | null |
t2.py
|
mabotech/mabo.data
|
6142226580aca6e0031f9d7f48e0823e7b0fe30a
|
[
"MIT"
] | null | null | null |
t2.py
|
mabotech/mabo.data
|
6142226580aca6e0031f9d7f48e0823e7b0fe30a
|
[
"MIT"
] | null | null | null |
#-*- coding: UTF-8 -*-
import urllib
s = "测试"
print urllib.urlencode(s)
print(repr(s))
# \'c8\'d5\'c6\'da\lang2052\f2\'c8\'d5\'c6\'da\
#u'\xb2\xe2\xca\xd4'
| 11.571429
| 47
| 0.58642
| 29
| 162
| 3.275862
| 0.724138
| 0.084211
| 0.126316
| 0.168421
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106383
| 0.12963
| 162
| 14
| 48
| 11.571429
| 0.567376
| 0.530864
| 0
| 0
| 0
| 0
| 0.027027
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.25
| null | null | 0.5
| 1
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
b2d398c8ff7ba8807d8f15677195538be7ced920
| 4,416
|
py
|
Python
|
roster/migrations/0060_studentregistration_country.py
|
ankanb240/otis-web
|
45eda65b419705c65c02b15872a137969d53d8e9
|
[
"MIT"
] | 15
|
2021-08-28T18:18:37.000Z
|
2022-03-13T07:48:15.000Z
|
roster/migrations/0060_studentregistration_country.py
|
ankanb240/otis-web
|
45eda65b419705c65c02b15872a137969d53d8e9
|
[
"MIT"
] | 65
|
2021-08-20T02:37:27.000Z
|
2022-02-07T17:19:23.000Z
|
roster/migrations/0060_studentregistration_country.py
|
ankanb240/otis-web
|
45eda65b419705c65c02b15872a137969d53d8e9
|
[
"MIT"
] | 31
|
2020-01-09T02:35:29.000Z
|
2022-03-13T07:48:18.000Z
|
# Generated by Django 3.2.5 on 2021-07-27 22:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('roster', '0059_auto_20210727_1754'),
]
operations = [
migrations.AddField(
model_name='studentregistration',
name='country',
field=models.CharField(choices=[('AFG', 'Afghanistan (AFG)'), ('ALB', 'Albania (ALB)'), ('ALG', 'Algeria (ALG)'), ('AGO', 'Angola (AGO)'), ('ARG', 'Argentina (ARG)'), ('ARM', 'Armenia (ARM)'), ('AUS', 'Australia (AUS)'), ('AUT', 'Austria (AUT)'), ('AZE', 'Azerbaijan (AZE)'), ('BAH', 'Bahrain (BAH)'), ('BGD', 'Bangladesh (BGD)'), ('BLR', 'Belarus (BLR)'), ('BEL', 'Belgium (BEL)'), ('BEN', 'Benin (BEN)'), ('BOL', 'Bolivia (BOL)'), ('BIH', 'Bosnia and Herzegovina (BIH)'), ('BWA', 'Botswana (BWA)'), ('BRA', 'Brazil (BRA)'), ('BRU', 'Brunei (BRU)'), ('BGR', 'Bulgaria (BGR)'), ('BFA', 'Burkina Faso (BFA)'), ('KHM', 'Cambodia (KHM)'), ('CAN', 'Canada (CAN)'), ('CHI', 'Chile (CHI)'), ('CHN', "People's Republic of China (CHN)"), ('COL', 'Colombia (COL)'), ('CIS', 'Commonwealth of Independent States (CIS)'), ('CRI', 'Costa Rica (CRI)'), ('HRV', 'Croatia (HRV)'), ('CUB', 'Cuba (CUB)'), ('CYP', 'Cyprus (CYP)'), ('CZE', 'Czech Republic (CZE)'), ('CZS', 'Czechoslovakia (CZS)'), ('DEN', 'Denmark (DEN)'), ('DOM', 'Dominican Republic (DOM)'), ('ECU', 'Ecuador (ECU)'), ('EGY', 'Egypt (EGY)'), ('EST', 'Estonia (EST)'), ('FIN', 'Finland (FIN)'), ('FRA', 'France (FRA)'), ('GMB', 'Gambia (GMB)'), ('GEO', 'Georgia (GEO)'), ('GDR', 'German Democratic Republic (GDR)'), ('GER', 'Germany (GER)'), ('GHA', 'Ghana (GHA)'), ('HEL', 'Greece (HEL)'), ('GTM', 'Guatemala (GTM)'), ('HND', 'Honduras (HND)'), ('HKG', 'Hong Kong (HKG)'), ('HUN', 'Hungary (HUN)'), ('ISL', 'Iceland (ISL)'), ('IND', 'India (IND)'), ('IDN', 'Indonesia (IDN)'), ('IRQ', 'Iraq (IRQ)'), ('IRN', 'Islamic Republic of Iran (IRN)'), ('IRL', 'Ireland (IRL)'), ('ISR', 'Israel (ISR)'), ('ITA', 'Italy (ITA)'), ('CIV', 'Ivory Coast (CIV)'), ('JAM', 'Jamaica (JAM)'), ('JPN', 'Japan (JPN)'), ('KAZ', 'Kazakhstan (KAZ)'), ('KEN', 'Kenya (KEN)'), ('PRK', "Democratic People's Republic of Korea (PRK)"), ('KOR', 'Republic of Korea (KOR)'), ('KSV', 'Kosovo (KSV)'), ('KWT', 'Kuwait (KWT)'), ('KGZ', 'Kyrgyzstan (KGZ)'), ('LAO', 'Laos (LAO)'), ('LVA', 'Latvia (LVA)'), ('LIE', 'Liechtenstein (LIE)'), ('LTU', 'Lithuania (LTU)'), ('LUX', 'Luxembourg (LUX)'), ('MAC', 'Macau (MAC)'), ('MDG', 'Madagascar (MDG)'), ('MAS', 'Malaysia (MAS)'), ('MRT', 'Mauritania (MRT)'), ('MEX', 'Mexico (MEX)'), ('MDA', 'Republic of Moldova (MDA)'), ('MNG', 'Mongolia (MNG)'), ('MNE', 'Montenegro (MNE)'), ('MAR', 'Morocco (MAR)'), ('MOZ', 'Mozambique (MOZ)'), ('MMR', 'Myanmar (MMR)'), ('NPL', 'Nepal (NPL)'), ('NLD', 'Netherlands (NLD)'), ('NZL', 'New Zealand (NZL)'), ('NIC', 'Nicaragua (NIC)'), ('NGA', 'Nigeria (NGA)'), ('MKD', 'North Macedonia (MKD)'), ('NOR', 'Norway (NOR)'), ('OMN', 'Oman (OMN)'), ('PAK', 'Pakistan (PAK)'), ('PAN', 'Panama (PAN)'), ('PAR', 'Paraguay (PAR)'), ('PER', 'Peru (PER)'), ('PHI', 'Philippines (PHI)'), ('POL', 'Poland (POL)'), ('POR', 'Portugal (POR)'), ('PRI', 'Puerto Rico (PRI)'), ('ROU', 'Romania (ROU)'), ('RUS', 'Russian Federation (RUS)'), ('RWA', 'Rwanda (RWA)'), ('SLV', 'El Salvador (SLV)'), ('SAU', 'Saudi Arabia (SAU)'), ('SEN', 'Senegal (SEN)'), ('SRB', 'Serbia (SRB)'), ('SCG', 'Serbia and Montenegro (SCG)'), ('SGP', 'Singapore (SGP)'), ('SVK', 'Slovakia (SVK)'), ('SVN', 'Slovenia (SVN)'), ('SAF', 'South Africa (SAF)'), ('ESP', 'Spain (ESP)'), ('LKA', 'Sri Lanka (LKA)'), ('SWE', 'Sweden (SWE)'), ('SUI', 'Switzerland (SUI)'), ('SYR', 'Syria (SYR)'), ('TWN', 'Taiwan (TWN)'), ('TJK', 'Tajikistan (TJK)'), ('TZA', 'Tanzania (TZA)'), ('THA', 'Thailand (THA)'), ('TTO', 'Trinidad and Tobago (TTO)'), ('TUN', 'Tunisia (TUN)'), ('TUR', 'Turkey (TUR)'), ('NCY', 'Turkish Republic of Northern Cyprus (NCY)'), ('TKM', 'Turkmenistan (TKM)'), ('UGA', 'Uganda (UGA)'), ('UKR', 'Ukraine (UKR)'), ('UAE', 'United Arab Emirates (UAE)'), ('UNK', 'United Kingdom (UNK)'), ('USA', 'United States of America (USA)'), ('URY', 'Uruguay (URY)'), ('USS', 'Union of Soviet Socialist Republics (USS)'), ('UZB', 'Uzbekistan (UZB)'), ('VEN', 'Venezuela (VEN)'), ('VNM', 'Vietnam (VNM)'), ('YEM', 'Yemen (YEM)'), ('YUG', 'Yugoslavia (YUG)'), ('ZWE', 'Zimbabwe (ZWE)')], default='USA', max_length=6),
),
]
| 232.421053
| 4,069
| 0.54144
| 517
| 4,416
| 4.615087
| 0.663443
| 0.025147
| 0.012573
| 0.01425
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008346
| 0.131793
| 4,416
| 18
| 4,070
| 245.333333
| 0.61398
| 0.01019
| 0
| 0
| 1
| 0
| 0.609522
| 0.005264
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.083333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b2d9ed8cc228811cd062a85279547d65134826bb
| 201
|
py
|
Python
|
channels_presence/management/commands/prune_presences.py
|
klima7/django4-channels-presence
|
112b79517d2e8c2e24100576a5364efeacf540bc
|
[
"MIT"
] | 37
|
2017-08-25T15:33:42.000Z
|
2020-10-29T10:18:07.000Z
|
channels_presence/management/commands/prune_presences.py
|
klima7/django4-channels-presence
|
112b79517d2e8c2e24100576a5364efeacf540bc
|
[
"MIT"
] | 12
|
2017-09-10T08:37:00.000Z
|
2020-03-30T14:53:19.000Z
|
channels_presence/management/commands/prune_presences.py
|
klima7/django4-channels-presence
|
112b79517d2e8c2e24100576a5364efeacf540bc
|
[
"MIT"
] | 12
|
2017-12-22T12:25:36.000Z
|
2020-08-06T13:56:46.000Z
|
from django.core.management.base import BaseCommand
from channels_presence.models import Room
class Command(BaseCommand):
def handle(self, *args, **kwargs):
Room.objects.prune_presences()
| 28.714286
| 51
| 0.766169
| 25
| 201
| 6.08
| 0.84
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139303
| 201
| 6
| 52
| 33.5
| 0.878613
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b2f1f7837cddfa0c32b840364dad90525b41cd2d
| 104
|
py
|
Python
|
apps/rivenmygoods/apps.py
|
tufbel/wFocus
|
ee0f02053b8a5bc9c40dd862306fc5df1a063b9d
|
[
"Apache-2.0"
] | null | null | null |
apps/rivenmygoods/apps.py
|
tufbel/wFocus
|
ee0f02053b8a5bc9c40dd862306fc5df1a063b9d
|
[
"Apache-2.0"
] | 11
|
2020-06-06T01:51:51.000Z
|
2022-02-10T14:31:21.000Z
|
apps/rivenmygoods/apps.py
|
tufbel/wFocus
|
ee0f02053b8a5bc9c40dd862306fc5df1a063b9d
|
[
"Apache-2.0"
] | null | null | null |
from django.apps import AppConfig
class RivenmygoodsConfig(AppConfig):
name = 'apps.rivenmygoods'
| 17.333333
| 36
| 0.778846
| 11
| 104
| 7.363636
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144231
| 104
| 5
| 37
| 20.8
| 0.910112
| 0
| 0
| 0
| 0
| 0
| 0.163462
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
651255c68a0bd167004e87c9844ce723d2a0b03d
| 36,552
|
py
|
Python
|
plugins/modules/oci_cloud_guard_responder_recipe.py
|
sohwaje/oci-ansible-collection
|
9e6b8cf55e596a96560710a457a7df05886fc59c
|
[
"Apache-2.0"
] | null | null | null |
plugins/modules/oci_cloud_guard_responder_recipe.py
|
sohwaje/oci-ansible-collection
|
9e6b8cf55e596a96560710a457a7df05886fc59c
|
[
"Apache-2.0"
] | null | null | null |
plugins/modules/oci_cloud_guard_responder_recipe.py
|
sohwaje/oci-ansible-collection
|
9e6b8cf55e596a96560710a457a7df05886fc59c
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for details.
# GENERATED FILE - DO NOT EDIT - MANUAL CHANGES WILL BE OVERWRITTEN
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_cloud_guard_responder_recipe
short_description: Manage a ResponderRecipe resource in Oracle Cloud Infrastructure
description:
- This module allows the user to create, update and delete a ResponderRecipe resource in Oracle Cloud Infrastructure
- For I(state=present), create a ResponderRecipe.
- "This resource has the following action operations in the M(oci_responder_recipe_actions) module: change_compartment."
version_added: "2.9.0"
author: Oracle (@oracle)
options:
display_name:
description:
- ResponderRecipe Display Name
- Required for create using I(state=present), update using I(state=present) with responder_recipe_id present.
- Required for delete when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is set.
type: str
aliases: ["name"]
description:
description:
- ResponderRecipe Description
- This parameter is updatable.
type: str
source_responder_recipe_id:
description:
- The id of the source responder recipe.
- Required for create using I(state=present).
type: str
compartment_id:
description:
- Compartment Identifier
- Required for create using I(state=present).
- Required for update when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is set.
- Required for delete when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is set.
type: str
responder_rules:
description:
- Responder Rules to override from source responder recipe
- This parameter is updatable.
type: list
elements: dict
suboptions:
responder_rule_id:
description:
- ResponderRecipeRule Identifier
type: str
required: true
details:
description:
- ""
type: dict
required: true
suboptions:
is_enabled:
description:
- Identifies state for ResponderRule
type: bool
required: true
freeform_tags:
description:
- "Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
Example: `{\\"bar-key\\": \\"value\\"}`"
- This parameter is updatable.
type: dict
defined_tags:
description:
- "Defined tags for this resource. Each key is predefined and scoped to a namespace.
Example: `{\\"foo-namespace\\": {\\"bar-key\\": \\"value\\"}}`"
- This parameter is updatable.
type: dict
responder_recipe_id:
description:
- OCID of ResponderRecipe
- Required for update using I(state=present) when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is not set.
- Required for delete using I(state=absent) when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is not set.
type: str
aliases: ["id"]
state:
description:
- The state of the ResponderRecipe.
- Use I(state=present) to create or update a ResponderRecipe.
- Use I(state=absent) to delete a ResponderRecipe.
type: str
required: false
default: 'present'
choices: ["present", "absent"]
extends_documentation_fragment: [ oracle.oci.oracle, oracle.oci.oracle_creatable_resource, oracle.oci.oracle_wait_options ]
"""
EXAMPLES = """
- name: Create responder_recipe
oci_cloud_guard_responder_recipe:
display_name: display_name_example
source_responder_recipe_id: "ocid1.sourceresponderrecipe.oc1..xxxxxxEXAMPLExxxxxx"
compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
- name: Update responder_recipe using name (when environment variable OCI_USE_NAME_AS_IDENTIFIER is set)
oci_cloud_guard_responder_recipe:
display_name: display_name_example
description: description_example
compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
responder_rules:
- responder_rule_id: "ocid1.responderrule.oc1..xxxxxxEXAMPLExxxxxx"
details:
is_enabled: true
freeform_tags: {'Department': 'Finance'}
defined_tags: {'Operations': {'CostCenter': 'US'}}
- name: Update responder_recipe
oci_cloud_guard_responder_recipe:
display_name: display_name_example
description: description_example
responder_recipe_id: "ocid1.responderrecipe.oc1..xxxxxxEXAMPLExxxxxx"
- name: Delete responder_recipe
oci_cloud_guard_responder_recipe:
responder_recipe_id: "ocid1.responderrecipe.oc1..xxxxxxEXAMPLExxxxxx"
state: absent
- name: Delete responder_recipe using name (when environment variable OCI_USE_NAME_AS_IDENTIFIER is set)
oci_cloud_guard_responder_recipe:
display_name: display_name_example
compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
state: absent
"""
RETURN = """
responder_recipe:
description:
- Details of the ResponderRecipe resource acted upon by the current operation
returned: on success
type: complex
contains:
id:
description:
- Identifier for ResponderRecipe.
returned: on success
type: str
sample: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"
display_name:
description:
- ResponderRecipe Display Name
returned: on success
type: str
sample: display_name_example
description:
description:
- ResponderRecipe Description
returned: on success
type: str
sample: description_example
owner:
description:
- Owner of ResponderRecipe
returned: on success
type: str
sample: CUSTOMER
responder_rules:
description:
- List of responder rules associated with the recipe
returned: on success
type: complex
contains:
responder_rule_id:
description:
- Identifier for ResponderRule.
returned: on success
type: str
sample: "ocid1.responderrule.oc1..xxxxxxEXAMPLExxxxxx"
display_name:
description:
- ResponderRule Display Name
returned: on success
type: str
sample: display_name_example
description:
description:
- ResponderRule Description
returned: on success
type: str
sample: description_example
type:
description:
- Type of Responder
returned: on success
type: str
sample: REMEDIATION
policies:
description:
- List of Policy
returned: on success
type: list
sample: []
supported_modes:
description:
- Supported Execution Modes
returned: on success
type: list
sample: []
details:
description:
- ""
returned: on success
type: complex
contains:
condition:
description:
- ""
returned: on success
type: complex
contains:
kind:
description:
- Type of condition object
returned: on success
type: str
sample: COMPOSITE
left_operand:
description:
- ""
returned: on success
type: complex
contains:
kind:
description:
- Type of condition object
returned: on success
type: str
sample: COMPOSITE
composite_operator:
description:
- ""
returned: on success
type: str
sample: AND
right_operand:
description:
- ""
returned: on success
type: complex
contains:
kind:
description:
- Type of condition object
returned: on success
type: str
sample: COMPOSITE
parameter:
description:
- parameter Key
returned: on success
type: str
sample: parameter_example
operator:
description:
- type of operator
returned: on success
type: str
sample: IN
value:
description:
- type of operator
returned: on success
type: str
sample: value_example
value_type:
description:
- type of value
returned: on success
type: str
sample: MANAGED
configurations:
description:
- ResponderRule configurations
returned: on success
type: complex
contains:
config_key:
description:
- Unique name of the configuration
returned: on success
type: str
sample: config_key_example
name:
description:
- configuration name
returned: on success
type: str
sample: name_example
value:
description:
- configuration value
returned: on success
type: str
sample: value_example
is_enabled:
description:
- Identifies state for ResponderRule
returned: on success
type: bool
sample: true
mode:
description:
- Execution Mode for ResponderRule
returned: on success
type: str
sample: AUTOACTION
compartment_id:
description:
- Compartment Identifier
returned: on success
type: str
sample: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
time_created:
description:
- The date and time the responder recipe rule was created. Format defined by RFC3339.
returned: on success
type: str
sample: "2013-10-20T19:20:30+01:00"
time_updated:
description:
- The date and time the responder recipe rule was updated. Format defined by RFC3339.
returned: on success
type: str
sample: "2013-10-20T19:20:30+01:00"
lifecycle_state:
description:
- The current state of the ResponderRule.
returned: on success
type: str
sample: CREATING
lifecycle_details:
description:
- A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in
Failed state.
returned: on success
type: str
sample: lifecycle_details_example
effective_responder_rules:
description:
- List of responder rules associated with the recipe
returned: on success
type: complex
contains:
responder_rule_id:
description:
- Identifier for ResponderRule.
returned: on success
type: str
sample: "ocid1.responderrule.oc1..xxxxxxEXAMPLExxxxxx"
display_name:
description:
- ResponderRule Display Name
returned: on success
type: str
sample: display_name_example
description:
description:
- ResponderRule Description
returned: on success
type: str
sample: description_example
type:
description:
- Type of Responder
returned: on success
type: str
sample: REMEDIATION
policies:
description:
- List of Policy
returned: on success
type: list
sample: []
supported_modes:
description:
- Supported Execution Modes
returned: on success
type: list
sample: []
details:
description:
- ""
returned: on success
type: complex
contains:
condition:
description:
- ""
returned: on success
type: complex
contains:
kind:
description:
- Type of condition object
returned: on success
type: str
sample: COMPOSITE
left_operand:
description:
- ""
returned: on success
type: complex
contains:
kind:
description:
- Type of condition object
returned: on success
type: str
sample: COMPOSITE
composite_operator:
description:
- ""
returned: on success
type: str
sample: AND
right_operand:
description:
- ""
returned: on success
type: complex
contains:
kind:
description:
- Type of condition object
returned: on success
type: str
sample: COMPOSITE
parameter:
description:
- parameter Key
returned: on success
type: str
sample: parameter_example
operator:
description:
- type of operator
returned: on success
type: str
sample: IN
value:
description:
- type of operator
returned: on success
type: str
sample: value_example
value_type:
description:
- type of value
returned: on success
type: str
sample: MANAGED
configurations:
description:
- ResponderRule configurations
returned: on success
type: complex
contains:
config_key:
description:
- Unique name of the configuration
returned: on success
type: str
sample: config_key_example
name:
description:
- configuration name
returned: on success
type: str
sample: name_example
value:
description:
- configuration value
returned: on success
type: str
sample: value_example
is_enabled:
description:
- Identifies state for ResponderRule
returned: on success
type: bool
sample: true
mode:
description:
- Execution Mode for ResponderRule
returned: on success
type: str
sample: AUTOACTION
compartment_id:
description:
- Compartment Identifier
returned: on success
type: str
sample: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
time_created:
description:
- The date and time the responder recipe rule was created. Format defined by RFC3339.
returned: on success
type: str
sample: "2013-10-20T19:20:30+01:00"
time_updated:
description:
- The date and time the responder recipe rule was updated. Format defined by RFC3339.
returned: on success
type: str
sample: "2013-10-20T19:20:30+01:00"
lifecycle_state:
description:
- The current state of the ResponderRule.
returned: on success
type: str
sample: CREATING
lifecycle_details:
description:
- A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in
Failed state.
returned: on success
type: str
sample: lifecycle_details_example
source_responder_recipe_id:
description:
- The id of the source responder recipe.
returned: on success
type: str
sample: "ocid1.sourceresponderrecipe.oc1..xxxxxxEXAMPLExxxxxx"
compartment_id:
description:
- Compartment Identifier
returned: on success
type: str
sample: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
time_created:
description:
- The date and time the responder recipe was created. Format defined by RFC3339.
returned: on success
type: str
sample: "2013-10-20T19:20:30+01:00"
time_updated:
description:
- The date and time the responder recipe was updated. Format defined by RFC3339.
returned: on success
type: str
sample: "2013-10-20T19:20:30+01:00"
lifecycle_state:
description:
- The current state of the Example.
returned: on success
type: str
sample: CREATING
lifecycle_details:
description:
- A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed
state.
returned: on success
type: str
sample: lifecycle_details_example
freeform_tags:
description:
- "Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
Example: `{\\"bar-key\\": \\"value\\"}`"
returned: on success
type: dict
sample: {'Department': 'Finance'}
defined_tags:
description:
- "Defined tags for this resource. Each key is predefined and scoped to a namespace.
Example: `{\\"foo-namespace\\": {\\"bar-key\\": \\"value\\"}}`"
returned: on success
type: dict
sample: {'Operations': {'CostCenter': 'US'}}
system_tags:
description:
- System tags for this resource. Each key is predefined and scoped to a namespace.
For more information, see L(Resource Tags,https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
System tags can be viewed by users, but can only be created by the system.
- "Example: `{\\"orcl-cloud\\": {\\"free-tier-retained\\": \\"true\\"}}`"
returned: on success
type: dict
sample: {}
sample: {
"id": "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx",
"display_name": "display_name_example",
"description": "description_example",
"owner": "CUSTOMER",
"responder_rules": [{
"responder_rule_id": "ocid1.responderrule.oc1..xxxxxxEXAMPLExxxxxx",
"display_name": "display_name_example",
"description": "description_example",
"type": "REMEDIATION",
"policies": [],
"supported_modes": [],
"details": {
"condition": {
"kind": "COMPOSITE",
"left_operand": {
"kind": "COMPOSITE"
},
"composite_operator": "AND",
"right_operand": {
"kind": "COMPOSITE"
},
"parameter": "parameter_example",
"operator": "IN",
"value": "value_example",
"value_type": "MANAGED"
},
"configurations": [{
"config_key": "config_key_example",
"name": "name_example",
"value": "value_example"
}],
"is_enabled": true,
"mode": "AUTOACTION"
},
"compartment_id": "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx",
"time_created": "2013-10-20T19:20:30+01:00",
"time_updated": "2013-10-20T19:20:30+01:00",
"lifecycle_state": "CREATING",
"lifecycle_details": "lifecycle_details_example"
}],
"effective_responder_rules": [{
"responder_rule_id": "ocid1.responderrule.oc1..xxxxxxEXAMPLExxxxxx",
"display_name": "display_name_example",
"description": "description_example",
"type": "REMEDIATION",
"policies": [],
"supported_modes": [],
"details": {
"condition": {
"kind": "COMPOSITE",
"left_operand": {
"kind": "COMPOSITE"
},
"composite_operator": "AND",
"right_operand": {
"kind": "COMPOSITE"
},
"parameter": "parameter_example",
"operator": "IN",
"value": "value_example",
"value_type": "MANAGED"
},
"configurations": [{
"config_key": "config_key_example",
"name": "name_example",
"value": "value_example"
}],
"is_enabled": true,
"mode": "AUTOACTION"
},
"compartment_id": "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx",
"time_created": "2013-10-20T19:20:30+01:00",
"time_updated": "2013-10-20T19:20:30+01:00",
"lifecycle_state": "CREATING",
"lifecycle_details": "lifecycle_details_example"
}],
"source_responder_recipe_id": "ocid1.sourceresponderrecipe.oc1..xxxxxxEXAMPLExxxxxx",
"compartment_id": "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx",
"time_created": "2013-10-20T19:20:30+01:00",
"time_updated": "2013-10-20T19:20:30+01:00",
"lifecycle_state": "CREATING",
"lifecycle_details": "lifecycle_details_example",
"freeform_tags": {'Department': 'Finance'},
"defined_tags": {'Operations': {'CostCenter': 'US'}},
"system_tags": {}
}
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.oracle.oci.plugins.module_utils import (
oci_common_utils,
oci_wait_utils,
)
from ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils import (
OCIResourceHelperBase,
get_custom_class,
)
try:
from oci.cloud_guard import CloudGuardClient
from oci.cloud_guard.models import CreateResponderRecipeDetails
from oci.cloud_guard.models import UpdateResponderRecipeDetails
HAS_OCI_PY_SDK = True
except ImportError:
HAS_OCI_PY_SDK = False
class ResponderRecipeHelperGen(OCIResourceHelperBase):
"""Supported operations: create, update, get, list and delete"""
def get_module_resource_id_param(self):
return "responder_recipe_id"
def get_module_resource_id(self):
return self.module.params.get("responder_recipe_id")
def get_get_fn(self):
return self.client.get_responder_recipe
def get_resource(self):
return oci_common_utils.call_with_backoff(
self.client.get_responder_recipe,
responder_recipe_id=self.module.params.get("responder_recipe_id"),
)
def get_required_kwargs_for_list(self):
required_list_method_params = [
"compartment_id",
]
return dict(
(param, self.module.params[param]) for param in required_list_method_params
)
def get_optional_kwargs_for_list(self):
optional_list_method_params = ["display_name"]
return dict(
(param, self.module.params[param])
for param in optional_list_method_params
if self.module.params.get(param) is not None
and (
self._use_name_as_identifier()
or (
not self.module.params.get("key_by")
or param in self.module.params.get("key_by")
)
)
)
def list_resources(self):
required_kwargs = self.get_required_kwargs_for_list()
optional_kwargs = self.get_optional_kwargs_for_list()
kwargs = oci_common_utils.merge_dicts(required_kwargs, optional_kwargs)
return oci_common_utils.list_all_resources(
self.client.list_responder_recipes, **kwargs
)
def get_create_model_class(self):
return CreateResponderRecipeDetails
def create_resource(self):
create_details = self.get_create_model()
return oci_wait_utils.call_and_wait(
call_fn=self.client.create_responder_recipe,
call_fn_args=(),
call_fn_kwargs=dict(create_responder_recipe_details=create_details,),
waiter_type=oci_wait_utils.LIFECYCLE_STATE_WAITER_KEY,
operation=oci_common_utils.CREATE_OPERATION_KEY,
waiter_client=self.get_waiter_client(),
resource_helper=self,
wait_for_states=self.get_wait_for_states_for_operation(
oci_common_utils.CREATE_OPERATION_KEY,
),
)
def get_update_model_class(self):
return UpdateResponderRecipeDetails
def update_resource(self):
update_details = self.get_update_model()
return oci_wait_utils.call_and_wait(
call_fn=self.client.update_responder_recipe,
call_fn_args=(),
call_fn_kwargs=dict(
responder_recipe_id=self.module.params.get("responder_recipe_id"),
update_responder_recipe_details=update_details,
),
waiter_type=oci_wait_utils.LIFECYCLE_STATE_WAITER_KEY,
operation=oci_common_utils.UPDATE_OPERATION_KEY,
waiter_client=self.get_waiter_client(),
resource_helper=self,
wait_for_states=self.get_wait_for_states_for_operation(
oci_common_utils.UPDATE_OPERATION_KEY,
),
)
def delete_resource(self):
return oci_wait_utils.call_and_wait(
call_fn=self.client.delete_responder_recipe,
call_fn_args=(),
call_fn_kwargs=dict(
responder_recipe_id=self.module.params.get("responder_recipe_id"),
),
waiter_type=oci_wait_utils.LIFECYCLE_STATE_WAITER_KEY,
operation=oci_common_utils.DELETE_OPERATION_KEY,
waiter_client=self.get_waiter_client(),
resource_helper=self,
wait_for_states=self.get_wait_for_states_for_operation(
oci_common_utils.DELETE_OPERATION_KEY,
),
)
ResponderRecipeHelperCustom = get_custom_class("ResponderRecipeHelperCustom")
class ResourceHelper(ResponderRecipeHelperCustom, ResponderRecipeHelperGen):
pass
def main():
module_args = oci_common_utils.get_common_arg_spec(
supports_create=True, supports_wait=True
)
module_args.update(
dict(
display_name=dict(aliases=["name"], type="str"),
description=dict(type="str"),
source_responder_recipe_id=dict(type="str"),
compartment_id=dict(type="str"),
responder_rules=dict(
type="list",
elements="dict",
options=dict(
responder_rule_id=dict(type="str", required=True),
details=dict(
type="dict",
required=True,
options=dict(is_enabled=dict(type="bool", required=True)),
),
),
),
freeform_tags=dict(type="dict"),
defined_tags=dict(type="dict"),
responder_recipe_id=dict(aliases=["id"], type="str"),
state=dict(type="str", default="present", choices=["present", "absent"]),
)
)
module = AnsibleModule(argument_spec=module_args, supports_check_mode=True)
if not HAS_OCI_PY_SDK:
module.fail_json(msg="oci python sdk required for this module.")
resource_helper = ResourceHelper(
module=module,
resource_type="responder_recipe",
service_client_class=CloudGuardClient,
namespace="cloud_guard",
)
result = dict(changed=False)
if resource_helper.is_delete_using_name():
result = resource_helper.delete_using_name()
elif resource_helper.is_delete():
result = resource_helper.delete()
elif resource_helper.is_update_using_name():
result = resource_helper.update_using_name()
elif resource_helper.is_update():
result = resource_helper.update()
elif resource_helper.is_create():
result = resource_helper.create()
module.exit_json(**result)
if __name__ == "__main__":
main()
| 41.395243
| 157
| 0.470535
| 2,877
| 36,552
| 5.776851
| 0.109141
| 0.044525
| 0.075692
| 0.093502
| 0.758905
| 0.718171
| 0.687545
| 0.644043
| 0.638147
| 0.610048
| 0
| 0.01571
| 0.468839
| 36,552
| 882
| 158
| 41.442177
| 0.84033
| 0.012065
| 0
| 0.737923
| 0
| 0.012077
| 0.81861
| 0.068229
| 0
| 0
| 0
| 0
| 0
| 1
| 0.0157
| false
| 0.001208
| 0.009662
| 0.008454
| 0.042271
| 0.001208
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6526981e44148365134d29661d8822cba0993f3d
| 50
|
py
|
Python
|
cloudaux/orchestration/aws/iam/__init__.py
|
scriptsrc/cloudaux
|
9e2bdc1c690df9aa01ddf919d1d79bd77e5cb5e4
|
[
"Apache-2.0"
] | 76
|
2017-02-20T21:35:29.000Z
|
2022-02-07T19:21:07.000Z
|
cloudaux/orchestration/aws/iam/__init__.py
|
scriptsrc/cloudaux
|
9e2bdc1c690df9aa01ddf919d1d79bd77e5cb5e4
|
[
"Apache-2.0"
] | 100
|
2016-11-13T08:36:09.000Z
|
2021-08-11T05:59:18.000Z
|
cloudaux/orchestration/aws/iam/__init__.py
|
scriptsrc/cloudaux
|
9e2bdc1c690df9aa01ddf919d1d79bd77e5cb5e4
|
[
"Apache-2.0"
] | 43
|
2016-11-13T16:50:40.000Z
|
2021-08-16T21:01:03.000Z
|
class MissingFieldException(Exception):
pass
| 12.5
| 39
| 0.78
| 4
| 50
| 9.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 50
| 3
| 40
| 16.666667
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
e8ddbe336f43f80a5c4dd8228effd504807229cf
| 136
|
py
|
Python
|
django_mako_plus/router/base.py
|
knowsuchagency/django-mako-plus
|
e737be6a2db6e9e897cc804c660494415c4ea180
|
[
"Apache-2.0"
] | null | null | null |
django_mako_plus/router/base.py
|
knowsuchagency/django-mako-plus
|
e737be6a2db6e9e897cc804c660494415c4ea180
|
[
"Apache-2.0"
] | null | null | null |
django_mako_plus/router/base.py
|
knowsuchagency/django-mako-plus
|
e737be6a2db6e9e897cc804c660494415c4ea180
|
[
"Apache-2.0"
] | null | null | null |
####################################
### The router base class
class Router(object):
'''Common superclass of routers'''
pass
| 19.428571
| 38
| 0.470588
| 12
| 136
| 5.333333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 136
| 6
| 39
| 22.666667
| 0.571429
| 0.389706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
e8ece3a88c15a65546294c733def1fc74a26c13c
| 338
|
py
|
Python
|
trains/backend_api/session/__init__.py
|
doliveralg/trains
|
c99d3f36ba621153ff3c35859b8b6c946cdbc80b
|
[
"Apache-2.0"
] | 112
|
2019-10-29T10:36:20.000Z
|
2020-12-19T08:08:27.000Z
|
trains/backend_api/session/__init__.py
|
doliveralg/trains
|
c99d3f36ba621153ff3c35859b8b6c946cdbc80b
|
[
"Apache-2.0"
] | 53
|
2020-12-29T07:52:40.000Z
|
2022-03-31T10:11:54.000Z
|
trains/backend_api/session/__init__.py
|
doliveralg/trains
|
c99d3f36ba621153ff3c35859b8b6c946cdbc80b
|
[
"Apache-2.0"
] | 29
|
2019-10-29T13:06:29.000Z
|
2020-12-19T08:09:24.000Z
|
from .session import Session
from .datamodel import DataModel, NonStrictDataModel, schema_property, StringEnum
from .request import Request, BatchRequest, CompoundRequest
from .response import Response
from .token_manager import TokenManager
from .errors import TimeoutExpiredError, ResultNotReadyError
from .callresult import CallResult
| 42.25
| 81
| 0.860947
| 36
| 338
| 8.027778
| 0.527778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.100592
| 338
| 7
| 82
| 48.285714
| 0.950658
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
331256a509f1916ee161385839501fb077ba2a23
| 365
|
py
|
Python
|
quenv/management/commands/__init__.py
|
raratiru/django-quenv
|
7a900e3d73de4cb9477375f3257eef99f9126eb0
|
[
"BSD-3-Clause"
] | 2
|
2019-11-06T14:30:26.000Z
|
2020-07-31T18:32:49.000Z
|
quenv/management/commands/__init__.py
|
raratiru/django-quenv
|
7a900e3d73de4cb9477375f3257eef99f9126eb0
|
[
"BSD-3-Clause"
] | 10
|
2019-05-06T19:51:34.000Z
|
2021-12-29T17:42:34.000Z
|
quenv/management/commands/__init__.py
|
raratiru/django-quenv
|
7a900e3d73de4cb9477375f3257eef99f9126eb0
|
[
"BSD-3-Clause"
] | 2
|
2019-05-07T13:13:10.000Z
|
2020-07-30T20:46:16.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
#
# File Name : quenv/management/commands/__init__.py
#
# Creation Date : Fri 31 Jul 2020 10:51:23 PM EEST (22:51)
#
# Last Modified :
#
# ==============================================================================
| 26.071429
| 80
| 0.323288
| 29
| 365
| 3.931034
| 0.965517
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055016
| 0.153425
| 365
| 13
| 81
| 28.076923
| 0.313916
| 0.934247
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
332b273ba3ab41289f108b7b05df7fbe14a9ec7b
| 166
|
py
|
Python
|
problem0426.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
problem0426.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
problem0426.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
###########################
#
# #426 Box-ball system - Project Euler
# https://projecteuler.net/problem=426
#
# Code by Kevin Marciniak
#
###########################
| 18.444444
| 38
| 0.46988
| 15
| 166
| 5.2
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.040816
| 0.114458
| 166
| 8
| 39
| 20.75
| 0.489796
| 0.578313
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3335265e414d5035d97b091289cc71a079ddac4f
| 162
|
py
|
Python
|
application/filters.py
|
Falldog/appengine-flask-template-light
|
b87b73b1d1862db6dbb388fee716b60d29b3b10c
|
[
"Apache-2.0"
] | null | null | null |
application/filters.py
|
Falldog/appengine-flask-template-light
|
b87b73b1d1862db6dbb388fee716b60d29b3b10c
|
[
"Apache-2.0"
] | null | null | null |
application/filters.py
|
Falldog/appengine-flask-template-light
|
b87b73b1d1862db6dbb388fee716b60d29b3b10c
|
[
"Apache-2.0"
] | null | null | null |
from application import app
@app.template_filter('reverse')
def reverse_filter(s):
return s[::-1]
# app.jinja_env.filters['reverse'] = reverse_filte
| 20.25
| 51
| 0.703704
| 22
| 162
| 5
| 0.681818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007353
| 0.160494
| 162
| 7
| 52
| 23.142857
| 0.801471
| 0.296296
| 0
| 0
| 0
| 0
| 0.067308
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
3339142f49678f8f22576268adc34643b9ea8b39
| 78
|
py
|
Python
|
src/astro/files/__init__.py
|
astro-projects/astro
|
7fa0404fc690569ff85e379ecca54778f09a9333
|
[
"Apache-2.0"
] | 71
|
2021-12-06T22:41:59.000Z
|
2022-03-31T21:47:16.000Z
|
src/astro/files/__init__.py
|
astro-projects/astro
|
7fa0404fc690569ff85e379ecca54778f09a9333
|
[
"Apache-2.0"
] | 171
|
2021-12-14T07:34:57.000Z
|
2022-03-31T21:04:15.000Z
|
src/astro/files/__init__.py
|
astro-projects/astro
|
7fa0404fc690569ff85e379ecca54778f09a9333
|
[
"Apache-2.0"
] | 11
|
2021-12-06T22:46:23.000Z
|
2022-03-31T18:09:46.000Z
|
from astro.files.base import File, get_files # noqa: F401 # skipcq: PY-W2000
| 39
| 77
| 0.74359
| 13
| 78
| 4.384615
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106061
| 0.153846
| 78
| 1
| 78
| 78
| 0.757576
| 0.358974
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
333fa6cb51b4ded9341ed8b9eaf0b4f91a4da306
| 203
|
py
|
Python
|
blog/urls.py
|
u-will/Django-blog-project
|
917599c5364f361b3f1b4920191b862ccd9024a4
|
[
"MIT"
] | null | null | null |
blog/urls.py
|
u-will/Django-blog-project
|
917599c5364f361b3f1b4920191b862ccd9024a4
|
[
"MIT"
] | null | null | null |
blog/urls.py
|
u-will/Django-blog-project
|
917599c5364f361b3f1b4920191b862ccd9024a4
|
[
"MIT"
] | null | null | null |
from django.urls import path
from .views import HomePage
from .views import AboutPage
urlpatterns = [
path('', HomePage.as_view(), name="home"),
path('about/', AboutPage.as_view(), name="about"),
]
| 22.555556
| 52
| 0.704433
| 27
| 203
| 5.222222
| 0.518519
| 0.12766
| 0.212766
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133005
| 203
| 8
| 53
| 25.375
| 0.801136
| 0
| 0
| 0
| 0
| 0
| 0.073892
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.428571
| 0
| 0.428571
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
33689ab13b42b0e9be97e4ccee2538e1b9d6da0a
| 429
|
py
|
Python
|
cogdl/wrappers/data_wrapper/link_prediction/gnn_kg_link_prediction_dw.py
|
li-ziang/cogdl
|
60022d3334e3abae2d2a505e6e049a26acf10f39
|
[
"MIT"
] | 6
|
2020-07-09T02:48:41.000Z
|
2021-06-16T09:04:14.000Z
|
cogdl/wrappers/data_wrapper/link_prediction/gnn_kg_link_prediction_dw.py
|
li-ziang/cogdl
|
60022d3334e3abae2d2a505e6e049a26acf10f39
|
[
"MIT"
] | null | null | null |
cogdl/wrappers/data_wrapper/link_prediction/gnn_kg_link_prediction_dw.py
|
li-ziang/cogdl
|
60022d3334e3abae2d2a505e6e049a26acf10f39
|
[
"MIT"
] | 1
|
2020-05-19T11:45:45.000Z
|
2020-05-19T11:45:45.000Z
|
from .. import DataWrapper
class GNNKGLinkPredictionDataWrapper(DataWrapper):
def __init__(self, dataset):
super(GNNKGLinkPredictionDataWrapper, self).__init__(dataset)
self.dataset = dataset
self.edge_set = None
def train_wrapper(self):
return self.dataset.data
def val_wrapper(self):
return self.dataset.data
def test_wrapper(self):
return self.dataset.data
| 23.833333
| 69
| 0.692308
| 46
| 429
| 6.195652
| 0.413043
| 0.192982
| 0.178947
| 0.221053
| 0.357895
| 0.357895
| 0.245614
| 0
| 0
| 0
| 0
| 0
| 0.228438
| 429
| 17
| 70
| 25.235294
| 0.861027
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.083333
| 0.25
| 0.75
| 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
| 1
| 1
| 0
|
0
| 4
|
681ee56a47befeb9b481745f3d4b51963f16b41e
| 79
|
py
|
Python
|
.history/auto-click2_20220119222038.py
|
pedroeuropeu/python-stubs
|
c3dcf6cba5fb706be9b4b199c930aa97533bcf31
|
[
"Apache-2.0"
] | null | null | null |
.history/auto-click2_20220119222038.py
|
pedroeuropeu/python-stubs
|
c3dcf6cba5fb706be9b4b199c930aa97533bcf31
|
[
"Apache-2.0"
] | null | null | null |
.history/auto-click2_20220119222038.py
|
pedroeuropeu/python-stubs
|
c3dcf6cba5fb706be9b4b199c930aa97533bcf31
|
[
"Apache-2.0"
] | null | null | null |
import pyautogui
print(pyautogui.size())
pyautogui.moveTo(2100,425,duration=1)
| 19.75
| 37
| 0.810127
| 11
| 79
| 5.818182
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106667
| 0.050633
| 79
| 4
| 37
| 19.75
| 0.746667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
6828a62151e848ac4834c9934f60af4a4dba19f7
| 797
|
py
|
Python
|
tests/distortion_test.py
|
KendallPark/pangloss
|
2e13b56ecfb21011e0b9e83cdbcfa68aafb72903
|
[
"MIT"
] | null | null | null |
tests/distortion_test.py
|
KendallPark/pangloss
|
2e13b56ecfb21011e0b9e83cdbcfa68aafb72903
|
[
"MIT"
] | 1
|
2020-09-25T21:10:58.000Z
|
2020-09-25T21:10:58.000Z
|
tests/distortion_test.py
|
KendallPark/panaugment
|
2e13b56ecfb21011e0b9e83cdbcfa68aafb72903
|
[
"MIT"
] | null | null | null |
import unittest
from panaugment import distortion
def int_add_fn(example, magnitude):
return example + magnitude
def int_sub_fn(example, magnitude):
return example - magnitude
def int_mult_fn(example, magnitude):
return example * magnitude
def int_div_fn(example, magnitude):
return example / magnitude
ADD_DIST = distortion.Distortion('Add', int_add_fn)
SUB_DIST = distortion.Distortion('Sub', int_sub_fn)
MULT_DIST = distortion.Distortion('Mult', int_mult_fn)
DIV_DIST = distortion.Distortion('Div', int_div_fn)
class DistortionTest(unittest.TestCase):
def setUp(self):
self._add_distortion = distortion.Distortion('Add', int_add_fn)
def test_distort(self):
self.assertEqual(self._add_distortion.distort(3, 3), 6)
if __name__ == '__main__':
unittest.main()
| 20.973684
| 67
| 0.762861
| 108
| 797
| 5.305556
| 0.268519
| 0.223386
| 0.125654
| 0.167539
| 0.418848
| 0.418848
| 0.240838
| 0.240838
| 0
| 0
| 0
| 0.004342
| 0.132999
| 797
| 37
| 68
| 21.540541
| 0.824891
| 0
| 0
| 0
| 0
| 0
| 0.030113
| 0
| 0
| 0
| 0
| 0
| 0.047619
| 1
| 0.285714
| false
| 0
| 0.095238
| 0.190476
| 0.619048
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
68293a9f10bf2a1a1027b00a000342e2206e5b75
| 100
|
py
|
Python
|
omoide/migration_engine/operations/relocate/__init__.py
|
TaXeH/Omoide
|
8ccc9d47e802433bb2de21ff930e6630658cd5e3
|
[
"MIT"
] | null | null | null |
omoide/migration_engine/operations/relocate/__init__.py
|
TaXeH/Omoide
|
8ccc9d47e802433bb2de21ff930e6630658cd5e3
|
[
"MIT"
] | null | null | null |
omoide/migration_engine/operations/relocate/__init__.py
|
TaXeH/Omoide
|
8ccc9d47e802433bb2de21ff930e6630658cd5e3
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from omoide.migration_engine.operations \
.relocate.relocate import act
| 25
| 41
| 0.71
| 12
| 100
| 5.833333
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011765
| 0.15
| 100
| 3
| 42
| 33.333333
| 0.811765
| 0.21
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
686094b5fafde27e34a296544c83cddcdc368f49
| 110
|
py
|
Python
|
Part_3_advanced/m17_tests_II/stub_mock/homework_1_start/galactic_systems/vehicle.py
|
Mikma03/InfoShareacademy_Python_Courses
|
3df1008c8c92831bebf1625f960f25b39d6987e6
|
[
"MIT"
] | null | null | null |
Part_3_advanced/m17_tests_II/stub_mock/homework_1_start/galactic_systems/vehicle.py
|
Mikma03/InfoShareacademy_Python_Courses
|
3df1008c8c92831bebf1625f960f25b39d6987e6
|
[
"MIT"
] | null | null | null |
Part_3_advanced/m17_tests_II/stub_mock/homework_1_start/galactic_systems/vehicle.py
|
Mikma03/InfoShareacademy_Python_Courses
|
3df1008c8c92831bebf1625f960f25b39d6987e6
|
[
"MIT"
] | null | null | null |
from dataclasses import dataclass
@dataclass
class Vehicle:
name: str
model: str
max_speed: int
| 12.222222
| 33
| 0.709091
| 14
| 110
| 5.5
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.245455
| 110
| 8
| 34
| 13.75
| 0.927711
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
6866d78498e1d151df134278c8be475caa7e5a27
| 950
|
py
|
Python
|
tests/resource/test_todo.py
|
mbohal/sandbox_apistar
|
aa146bfb375691f17dea6bd316076599b58ee519
|
[
"MIT"
] | null | null | null |
tests/resource/test_todo.py
|
mbohal/sandbox_apistar
|
aa146bfb375691f17dea6bd316076599b58ee519
|
[
"MIT"
] | null | null | null |
tests/resource/test_todo.py
|
mbohal/sandbox_apistar
|
aa146bfb375691f17dea6bd316076599b58ee519
|
[
"MIT"
] | null | null | null |
from apistar import test
from app import APP
CLIENT = test.TestClient(APP)
def test_todo_item_get():
response = CLIENT.get('/todos/1')
assert response.status_code == 200
assert response.json() == {'id': 1, 'task': 'Buy milk'}
def test_todo_item_put():
response = CLIENT.put('/todos/100', {'task': 'Buy butter'})
assert response.status_code == 200
assert response.json() == {'id': 100, 'task': 'Buy butter'}
def test_todo_item_delete():
response = CLIENT.delete('/todos/23')
assert response.status_code == 204
def test_todo_collection_post():
response = CLIENT.post('/todos/', json={'id': 2, 'task': 'Buy apples'}, allow_redirects=False)
assert response.status_code == 201
assert response.json() == {'id': 2, 'task': 'Buy apples'}
def test_todo_collection_get():
response = CLIENT.get('/todos')
assert response.status_code == 200
assert response.json() == [{'id': 1, 'task': 'Buy milk'}]
| 31.666667
| 98
| 0.661053
| 129
| 950
| 4.705426
| 0.286822
| 0.207578
| 0.09061
| 0.197694
| 0.420099
| 0.337727
| 0.271829
| 0.271829
| 0.271829
| 0.194399
| 0
| 0.035443
| 0.168421
| 950
| 29
| 99
| 32.758621
| 0.732911
| 0
| 0
| 0.136364
| 0
| 0
| 0.136842
| 0
| 0
| 0
| 0
| 0
| 0.409091
| 1
| 0.227273
| false
| 0
| 0.090909
| 0
| 0.318182
| 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
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6869df174e0b3945a7c63942e864cb0edcf37832
| 28
|
py
|
Python
|
client/__init__.py
|
leni1/click-cli-news-api
|
63e4242496cab9b7d65f9a3eb0d68c89f5ad5b2c
|
[
"BSD-3-Clause"
] | null | null | null |
client/__init__.py
|
leni1/click-cli-news-api
|
63e4242496cab9b7d65f9a3eb0d68c89f5ad5b2c
|
[
"BSD-3-Clause"
] | 1
|
2021-06-01T23:32:02.000Z
|
2021-06-01T23:32:02.000Z
|
client/__init__.py
|
leni1/click-cli-news-api
|
63e4242496cab9b7d65f9a3eb0d68c89f5ad5b2c
|
[
"BSD-3-Clause"
] | null | null | null |
name = "click-cli-news-api"
| 14
| 27
| 0.678571
| 5
| 28
| 3.8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 28
| 1
| 28
| 28
| 0.76
| 0
| 0
| 0
| 0
| 0
| 0.642857
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6888206c2ad33f770fa0b0e6a8bb13a46222db01
| 106
|
py
|
Python
|
pytest_djangoapp/tests/testapp/models.py
|
jayvdb/pytest-djangoapp
|
271df3cd57045961aadeb1ee4433de3f4fcfd2ef
|
[
"BSD-3-Clause"
] | 34
|
2018-06-18T12:18:13.000Z
|
2021-05-14T14:15:39.000Z
|
pytest_djangoapp/tests/testapp/models.py
|
jayvdb/pytest-djangoapp
|
271df3cd57045961aadeb1ee4433de3f4fcfd2ef
|
[
"BSD-3-Clause"
] | 25
|
2019-05-21T23:13:13.000Z
|
2022-02-10T10:49:50.000Z
|
pytest_djangoapp/tests/testapp/models.py
|
jayvdb/pytest-djangoapp
|
271df3cd57045961aadeb1ee4433de3f4fcfd2ef
|
[
"BSD-3-Clause"
] | 4
|
2018-06-25T03:59:22.000Z
|
2021-05-27T04:09:57.000Z
|
from django.db import models
class Article(models.Model):
title = models.CharField(max_length=200)
| 15.142857
| 44
| 0.754717
| 15
| 106
| 5.266667
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033333
| 0.150943
| 106
| 6
| 45
| 17.666667
| 0.844444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
68a840ae3592ebb5f5c89171558117c185122171
| 119
|
py
|
Python
|
tests/runtests.py
|
deformio/python-deform
|
c1edc7572881b83a4981b2dd39898527e518bd1f
|
[
"MIT"
] | 3
|
2016-02-22T16:35:30.000Z
|
2019-09-05T15:08:55.000Z
|
tests/runtests.py
|
deformio/python-deform
|
c1edc7572881b83a4981b2dd39898527e518bd1f
|
[
"MIT"
] | 12
|
2016-03-21T09:13:02.000Z
|
2016-07-30T17:15:56.000Z
|
tests/runtests.py
|
deformio/python-deform
|
c1edc7572881b83a4981b2dd39898527e518bd1f
|
[
"MIT"
] | null | null | null |
import nose
import requests
requests.packages.urllib3.disable_warnings()
if __name__ == '__main__':
nose.main()
| 13.222222
| 44
| 0.747899
| 14
| 119
| 5.714286
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009804
| 0.142857
| 119
| 8
| 45
| 14.875
| 0.77451
| 0
| 0
| 0
| 0
| 0
| 0.067227
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
d7c3a88b60f9a0e7720e1018329e60af8f4e920a
| 733
|
py
|
Python
|
Mobiles/models.py
|
roqcodes/RoundUpCart
|
444aad70ff5d8b0646b6ee58f1e7df25358a7c3c
|
[
"MIT-0",
"MIT"
] | 1
|
2021-06-16T14:15:35.000Z
|
2021-06-16T14:15:35.000Z
|
Mobiles/models.py
|
roqcodes/RoundUpCart
|
444aad70ff5d8b0646b6ee58f1e7df25358a7c3c
|
[
"MIT-0",
"MIT"
] | null | null | null |
Mobiles/models.py
|
roqcodes/RoundUpCart
|
444aad70ff5d8b0646b6ee58f1e7df25358a7c3c
|
[
"MIT-0",
"MIT"
] | null | null | null |
from django.db import models
# Create your models here.
class Product(models.Model):
name = models.CharField(max_length=255)
category = models.CharField(max_length=255 )
price = models.FloatField()
data = models.CharField(max_length=2000 )
stock = models.IntegerField()
image = models.CharField(max_length=2500)
# class Saled(models.Model):
# name = 'product'
class Payment(models.Model):
name = models.CharField(max_length=255 )
email = models.EmailField()
number = models.IntegerField(default=0)
address = models.CharField(max_length=255 )
city = models.CharField(max_length=255)
state = models.CharField(max_length=255)
zip = models.IntegerField(default=000000)
| 27.148148
| 49
| 0.709413
| 90
| 733
| 5.688889
| 0.411111
| 0.234375
| 0.28125
| 0.375
| 0.375
| 0.164063
| 0.164063
| 0.164063
| 0
| 0
| 0
| 0.054817
| 0.178718
| 733
| 26
| 50
| 28.192308
| 0.795681
| 0.098226
| 0
| 0.125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.0625
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
cc01fb7554c2acd0d43ac2f134f3f76db6785d56
| 49
|
py
|
Python
|
_common/__init__.py
|
davidslusser/padlock
|
5a8714b0febb0eecd04e9245919720199f1d3c30
|
[
"Apache-2.0"
] | null | null | null |
_common/__init__.py
|
davidslusser/padlock
|
5a8714b0febb0eecd04e9245919720199f1d3c30
|
[
"Apache-2.0"
] | 2
|
2020-06-05T21:07:29.000Z
|
2021-06-10T21:34:13.000Z
|
_common/__init__.py
|
davidslusser/padlock
|
5a8714b0febb0eecd04e9245919720199f1d3c30
|
[
"Apache-2.0"
] | null | null | null |
default_app_config = '_common.apps.CommonConfig'
| 24.5
| 48
| 0.836735
| 6
| 49
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.061224
| 49
| 1
| 49
| 49
| 0.826087
| 0
| 0
| 0
| 0
| 0
| 0.510204
| 0.510204
| 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
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cc2fe53a33a12f60977121dc16e6ba6c03e9c0a0
| 88
|
py
|
Python
|
csv_to_html.py
|
cathdp/Web-Design-Challenge
|
6de86e72bfba8baf7b6c2b1845d830717a84fabf
|
[
"ADSL"
] | null | null | null |
csv_to_html.py
|
cathdp/Web-Design-Challenge
|
6de86e72bfba8baf7b6c2b1845d830717a84fabf
|
[
"ADSL"
] | null | null | null |
csv_to_html.py
|
cathdp/Web-Design-Challenge
|
6de86e72bfba8baf7b6c2b1845d830717a84fabf
|
[
"ADSL"
] | null | null | null |
import pandas as pd
pd.read_csv('Resources/cities.csv').to_html('Resources/table.html')
| 29.333333
| 67
| 0.784091
| 15
| 88
| 4.466667
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.056818
| 88
| 3
| 67
| 29.333333
| 0.807229
| 0
| 0
| 0
| 0
| 0
| 0.449438
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
0bc3542a91ba0505f3dbbf8471e3cf4a291da639
| 2,110
|
py
|
Python
|
spydrnet/ir/views/listview.py
|
ganeshgore/spydrnet
|
22672b8fc7d63461a71077bd20f29df6d38e96f4
|
[
"BSD-3-Clause"
] | 34
|
2020-03-12T15:40:49.000Z
|
2022-02-28T07:13:47.000Z
|
spydrnet/ir/views/listview.py
|
ganeshgore/spydrnet
|
22672b8fc7d63461a71077bd20f29df6d38e96f4
|
[
"BSD-3-Clause"
] | 104
|
2020-01-06T20:32:19.000Z
|
2022-01-02T00:20:14.000Z
|
spydrnet/ir/views/listview.py
|
ganeshgore/spydrnet
|
22672b8fc7d63461a71077bd20f29df6d38e96f4
|
[
"BSD-3-Clause"
] | 10
|
2020-09-02T20:24:00.000Z
|
2022-02-24T16:10:07.000Z
|
class ListView:
__slots__ = ['_list']
def __init__(self, list_object):
self._list = list_object
def __add__(self, other):
return self._list.__add__(other)
def __getitem__(self, other):
return self._list.__getitem__(other)
def __contains__(self, item):
return self._list.__contains__(item)
def __eq__(self, other):
return self._list.__eq__(other)
def __hash__(self):
return self._list.__hash__()
def __ge__(self, other):
if isinstance(other, ListView):
return self._list.__ge__(other._list)
return self._list.__ge__(other)
def __gt__(self, other):
if isinstance(other, ListView):
return self._list.__gt__(other._list)
return self._list.__gt__(other)
def __iter__(self):
return self._list.__iter__()
def __le__(self, other):
if isinstance(other, ListView):
return self._list.__le__(other._list)
return self._list.__le__(other)
def __len__(self):
return self._list.__len__()
def __lt__(self, other):
if isinstance(other, ListView):
return self._list.__lt__(other._list)
return self._list.__lt__(other)
def __ne__(self, other):
return self._list.__ne__(other)
def __mul__(self, other):
return self._list.__mul__(other)
def __rmul__(self, n):
return self._list.__rmul__(n)
def __reversed__(self):
return self._list.__reversed__()
def __repr__(self):
return self._list.__repr__()
def __str__(self):
return self._list.__str__()
def __radd__(self, other):
return other + self._list
def __iadd__(self, other):
raise TypeError("unsupported operator for type SetView")
def __imul__(self, other):
raise TypeError("unsupported operator for type SetView")
def copy(self):
return self._list.copy()
def count(self, object):
return self._list.count(object)
def index(self, *args, **kwargs):
return self._list.index(*args, **kwargs)
| 25.731707
| 64
| 0.631754
| 251
| 2,110
| 4.494024
| 0.183267
| 0.191489
| 0.297872
| 0.111702
| 0.490248
| 0.274823
| 0.274823
| 0.274823
| 0.274823
| 0.10461
| 0
| 0
| 0.258768
| 2,110
| 82
| 65
| 25.731707
| 0.721228
| 0
| 0
| 0.103448
| 0
| 0
| 0.037423
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.413793
| false
| 0
| 0
| 0.293103
| 0.87931
| 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
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
0bca467fe9587280e8f29063469d683f5a75c777
| 197
|
py
|
Python
|
examples/sample_package/util/io.py
|
sherbold/Python-Programmierkurs
|
d77a0196019e8c70730cd64f005cce6854bf1a23
|
[
"Apache-2.0"
] | 6
|
2019-04-11T12:44:38.000Z
|
2022-01-24T09:56:40.000Z
|
examples/sample_package/util/io.py
|
sherbold/Python-Programmierkurs
|
d77a0196019e8c70730cd64f005cce6854bf1a23
|
[
"Apache-2.0"
] | null | null | null |
examples/sample_package/util/io.py
|
sherbold/Python-Programmierkurs
|
d77a0196019e8c70730cd64f005cce6854bf1a23
|
[
"Apache-2.0"
] | 2
|
2019-05-23T11:30:22.000Z
|
2020-04-17T11:07:20.000Z
|
def print_with_linenumbers(*args, numberwidth=3):
"""Prints every argument in a new line and adds line numbers"""
for i,arg in enumerate(args):
print(f"{i:0{numberwidth}d}: {arg}")
| 39.4
| 67
| 0.675127
| 31
| 197
| 4.225806
| 0.774194
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012422
| 0.182741
| 197
| 4
| 68
| 49.25
| 0.801242
| 0.28934
| 0
| 0
| 0
| 0
| 0.19403
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0
| 0
| 0.333333
| 0.666667
| 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
| 1
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
0bdfd6ac856e8f733b77f6e1a048b86843e7dd38
| 1,099
|
py
|
Python
|
lib/systems/d-glutamic_acid.py
|
pulsar-chem/BPModule
|
f8e64e04fdb01947708f098e833600c459c2ff0e
|
[
"BSD-3-Clause"
] | null | null | null |
lib/systems/d-glutamic_acid.py
|
pulsar-chem/BPModule
|
f8e64e04fdb01947708f098e833600c459c2ff0e
|
[
"BSD-3-Clause"
] | null | null | null |
lib/systems/d-glutamic_acid.py
|
pulsar-chem/BPModule
|
f8e64e04fdb01947708f098e833600c459c2ff0e
|
[
"BSD-3-Clause"
] | null | null | null |
import pulsar as psr
def load_ref_system():
""" Returns d-glutamic_acid as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
C 1.9188 -0.6506 -1.2786
C 0.5809 -1.0283 -0.6469
N -0.3648 -1.6187 -1.6221
C -0.0210 0.2202 0.0136
H 0.7600 0.7313 0.6129
H -0.3356 0.9565 -0.7544
C -1.1973 -0.1400 0.9069
H -1.9908 -0.6507 0.3226
H -0.8854 -0.8641 1.6877
C -1.7910 1.0696 1.5793
O -1.4611 2.2406 1.5237
O -2.8595 0.8030 2.3698
H -3.1833 1.6095 2.7588
O 2.9610 -0.5673 -0.4227
O 2.1674 -0.4287 -2.4500
H 0.7623 -1.8125 0.1319
H 0.0500 -2.4164 -2.0541
H -0.6084 -0.9479 -2.3208
H 3.7499 -0.3110 -0.8909
""")
| 40.703704
| 71
| 0.410373
| 164
| 1,099
| 2.72561
| 0.560976
| 0.026846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.503534
| 0.484986
| 1,099
| 26
| 72
| 42.269231
| 0.286219
| 0.101911
| 0
| 0
| 0
| 0
| 0.913133
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.043478
| true
| 0
| 0.043478
| 0
| 0.130435
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0be075a2b91d2e8066d6617820d13bd0ae89fa71
| 329
|
py
|
Python
|
scripts/Damper.py
|
kakemotokeita/dqn-seismic-control
|
d8d76df760c41eadc375bbd20d92fecfc1e51344
|
[
"MIT"
] | null | null | null |
scripts/Damper.py
|
kakemotokeita/dqn-seismic-control
|
d8d76df760c41eadc375bbd20d92fecfc1e51344
|
[
"MIT"
] | null | null | null |
scripts/Damper.py
|
kakemotokeita/dqn-seismic-control
|
d8d76df760c41eadc375bbd20d92fecfc1e51344
|
[
"MIT"
] | null | null | null |
class Damper:
def __init__(self):
self.damper_force0 = 0
def d_damper_force(self, force, action):
damper_force = force * -action # AIが決定するパラメータで、与えられた力に対して、どんな割合で力を返すかを決める値
d_damper_force = damper_force - self.damper_force0
self.damper_force0 = damper_force
return d_damper_force
| 32.9
| 82
| 0.699088
| 40
| 329
| 5.35
| 0.35
| 0.308411
| 0.224299
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015873
| 0.234043
| 329
| 9
| 83
| 36.555556
| 0.833333
| 0.12462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0be8e4501e5c8fd52193f9ebc4de64285c0d28fa
| 60
|
py
|
Python
|
base.py
|
gajanlee/JumpMore
|
93df00c669b9f7bffd5623b353fee39793859cca
|
[
"MIT"
] | null | null | null |
base.py
|
gajanlee/JumpMore
|
93df00c669b9f7bffd5623b353fee39793859cca
|
[
"MIT"
] | null | null | null |
base.py
|
gajanlee/JumpMore
|
93df00c669b9f7bffd5623b353fee39793859cca
|
[
"MIT"
] | null | null | null |
import func
if __name__ == "__main__":
os.system("dir")
| 15
| 26
| 0.65
| 8
| 60
| 3.875
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.183333
| 60
| 4
| 27
| 15
| 0.632653
| 0
| 0
| 0
| 0
| 0
| 0.180328
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
040426b2a18d923d502b932bfa607404c528fac0
| 198
|
py
|
Python
|
api/api_v1/horoskop/api.py
|
mhajder/dobrysennik-api
|
83b549edd663c93012be30d76b6d470ce505eff4
|
[
"MIT"
] | null | null | null |
api/api_v1/horoskop/api.py
|
mhajder/dobrysennik-api
|
83b549edd663c93012be30d76b6d470ce505eff4
|
[
"MIT"
] | null | null | null |
api/api_v1/horoskop/api.py
|
mhajder/dobrysennik-api
|
83b549edd663c93012be30d76b6d470ce505eff4
|
[
"MIT"
] | null | null | null |
from fastapi import APIRouter
from api.api_v1.horoskop import horoskop_anielski
horoskop_router = APIRouter()
horoskop_router.include_router(horoskop_anielski.router, prefix="/horoskop-anielski")
| 28.285714
| 85
| 0.848485
| 25
| 198
| 6.48
| 0.44
| 0.296296
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005464
| 0.075758
| 198
| 6
| 86
| 33
| 0.879781
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
041e116214a78a60600b7e02ed6a5fbcea8c88ba
| 203
|
py
|
Python
|
table.py
|
Hrushabhs/My-Pycode
|
c27549b89a7848827117e42d324d383732adfac5
|
[
"Apache-2.0"
] | null | null | null |
table.py
|
Hrushabhs/My-Pycode
|
c27549b89a7848827117e42d324d383732adfac5
|
[
"Apache-2.0"
] | null | null | null |
table.py
|
Hrushabhs/My-Pycode
|
c27549b89a7848827117e42d324d383732adfac5
|
[
"Apache-2.0"
] | null | null | null |
#/* n=int(input("Enter the number to print the tables for:"))
#for i in range(1,11):
# print(n,"x",i,"=",n*i)
n=int(input("Enter the number"))
for i in range(1,11):
print (n ,"x", i, "=", n * i)
| 25.375
| 61
| 0.55665
| 41
| 203
| 2.756098
| 0.390244
| 0.053097
| 0.159292
| 0.247788
| 0.831858
| 0.831858
| 0.424779
| 0.424779
| 0.424779
| 0.424779
| 0
| 0.036364
| 0.187192
| 203
| 7
| 62
| 29
| 0.648485
| 0.527094
| 0
| 0
| 0
| 0
| 0.193548
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0422cdf6965fd3310cb3ebce9dada590aef4eab6
| 82
|
py
|
Python
|
cogs/owner/__init__.py
|
DangVietH/DangVietBot
|
e59092c57d990339d6a4f0cd412e5f243df2d6ed
|
[
"MIT"
] | 2
|
2022-03-24T09:03:40.000Z
|
2022-03-25T18:31:42.000Z
|
cogs/owner/__init__.py
|
DangVietH/DangVietBot
|
e59092c57d990339d6a4f0cd412e5f243df2d6ed
|
[
"MIT"
] | null | null | null |
cogs/owner/__init__.py
|
DangVietH/DangVietBot
|
e59092c57d990339d6a4f0cd412e5f243df2d6ed
|
[
"MIT"
] | null | null | null |
from .owner import Owner
async def setup(bot):
await bot.add_cog(Owner(bot))
| 16.4
| 33
| 0.719512
| 14
| 82
| 4.142857
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170732
| 82
| 5
| 33
| 16.4
| 0.852941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
04342ae9a1580691a139cbaeb35014849e51bf63
| 83
|
py
|
Python
|
signals.py
|
allenling/dbss
|
238913e0514ceefee7089cebaaacf12c858652bb
|
[
"MIT"
] | null | null | null |
signals.py
|
allenling/dbss
|
238913e0514ceefee7089cebaaacf12c858652bb
|
[
"MIT"
] | null | null | null |
signals.py
|
allenling/dbss
|
238913e0514ceefee7089cebaaacf12c858652bb
|
[
"MIT"
] | null | null | null |
import django.dispatch
index_update = django.dispatch.Signal(providing_args=[''])
| 20.75
| 58
| 0.795181
| 10
| 83
| 6.4
| 0.8
| 0.4375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072289
| 83
| 3
| 59
| 27.666667
| 0.831169
| 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 | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
04391a93aea17a93933e769d9f77381e6a6a9cbb
| 4,287
|
py
|
Python
|
PAL/Cross/pupy/crypto/credentials.py
|
infosecsecurity/OSPTF
|
df3f63dc882db6d7e0b7bd80476e9bbc8471ac1f
|
[
"MIT"
] | 2
|
2017-11-23T01:07:37.000Z
|
2021-06-25T05:03:49.000Z
|
PAL/Cross/pupy/crypto/credentials.py
|
infosecsecurity/OSPTF
|
df3f63dc882db6d7e0b7bd80476e9bbc8471ac1f
|
[
"MIT"
] | null | null | null |
PAL/Cross/pupy/crypto/credentials.py
|
infosecsecurity/OSPTF
|
df3f63dc882db6d7e0b7bd80476e9bbc8471ac1f
|
[
"MIT"
] | 1
|
2018-05-22T02:28:43.000Z
|
2018-05-22T02:28:43.000Z
|
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# This file should contains the credentials your payloads' transports needs.
# These credentials will be embedded depending on which transport you use when you generate payloads with pupygen.py
# If pupygen.py doesn't find your credentials here, it will use default ones
#SCRAMBLESUIT_PASSWD="th!s_iS_pupy_sct_k3y"
#BIND_PAYLOADS_PASSWORD="PuPyD3f4ultP4sSw0rd"
#RSA_PUB_KEY = """
#-----BEGIN RSA PUBLIC KEY-----
#MIICCgKCAgEAu1AvqNawlgXdpT3s0/YoOSj3bSsGOd2UXrDKmEt3VkGvDVyxllwm
#9TctdCIS8X9ziOtpSH2yYcS1zwVD0qb/Dt6im6Z0jiaiizsZPqJL16SfmP7b41ub
#iCcM4a3gI1wRxt3HtBDgqPVZTqsKPsC3m6fiWfOQCy9CmLSBlwwE+9+elnUG4pvA
#XQn0KDdrnzo5qGLxFyj9/jLI4y+rhS9DlwgsmFd42MCaJ/CgceM7QChN0zjxxT23
#Y/RSR6wnYKasDbz7KoCa/QkYpvN4XqmvUZVQDI2y8F87ta/Cqo3UMEz5hNYt96LU
#KN2qXNVOeiCO57tFFriWnKk6cAFHgrGzwA23xKUYB9/YivaEMjrh7C3907B+I1bK
#t/BXOxdRwbTHkWQWrpxfUGs+5LJzwwsixzNJOifqgFyZTef6EyNTwSyr0oRslNk7
#JIrE1Lab5Ve26+M92pCrs/UOIxpSWSKRmJeWcyAiw3crYrzAxC9r654BnmCfeWtn
#MRAWmUrljx6aJSojTAbeY9aDDrYQRuQ7VevO+SHxYwOG/1Jq+qgznTN3zroUI97w
#5g1oVVJrthUrYQZYKboaiEZmQckxLU5ca9pAyXu/o4pa1ez4a14YbollG9bjSnbK
#+qRicAn26w5undwWlPX52DnrOw0v9sAqazfzG5rMH7mKWnSDvHPWOAsCAwEAAQ==
#-----END RSA PUBLIC KEY-----
#"""
#SSL_BIND_CERT = """
#-----BEGIN CERTIFICATE-----
#MIIDczCCAlugAwIBAgIJAK4ksVkg9NIlMA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNV
#BAYTAkZSMQwwCgYDVQQIDANQT1UxDjAMBgNVBAcMBUpBSVVZMQ8wDQYDVQQKDAZM
#T0xJVEExEjAQBgNVBAsMCVMgQ09NTUUgPzAeFw0xNjA3MTUxODQyMTNaFw0xOTA0
#MTExODQyMTNaMFAxCzAJBgNVBAYTAkZSMQwwCgYDVQQIDANQT1UxDjAMBgNVBAcM
#BUpBSVVZMQ8wDQYDVQQKDAZMT0xJVEExEjAQBgNVBAsMCVMgQ09NTUUgPzCCASIw
#DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANyq22QP5r5i9J3hfZDY0ja3098A
#lAYUq7Ua62d1iJvsp7QyTLO8q5Q5MVkeUI+J2qU2VUPsCo6TA9qW9CYMEWAuRE50
#oG/Q3lGCXmh6QoExgQs5BzVj0q9b+l+O9DYqt4SCwkp6jHRedM05W98L9qM1yPkc
#bfQjWhN6V0kHjdVSchomReUtS5JrDasKklBSSJ2Au4bOTzt+VKO8YYEaC/sASBT+
#W1Z5XfSDWxnDyks94GGEgIetMmFhYAlhy3cuWCmDCeLDZKmLYS1ufSyEGQBz002S
#IedKJM9h/Cf64oNer1qgMYxdsX1zwSEhIZz7osk6H9eE/AgrHfnkWDNzjbMCAwEA
#AaNQME4wHQYDVR0OBBYEFEhJiWWQoxVJK37zDDZzQhue/rxKMB8GA1UdIwQYMBaA
#FEhJiWWQoxVJK37zDDZzQhue/rxKMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEL
#BQADggEBAMWbHWK1ZJcTvsmaM9/7P0bpBmN8pg86nZBkGKdUjm2jPjIHOavW7pSU
#VEhV1g6aXHX8E6eiG82uh49FCWcmWMbKGQFxpueCOR7cASbGeeIiOugnOoLtfS/D
#PC39Fc2t6AqB1RfTlG66UFOIf2SRfHwP5JKSoKxwF/JYXoEppbiQ0ew2JXIsRzgI
#+HHjl0I72fjwPi/f4LQh8cLvD4roiiuneCmqelsW3Bx9rZ9HMPCVhnmqHOgjgMV0
#Yv+23qYfV56D4ZsKHzbYgb2RjfGKyN1tt8UfkpGSecekPN9yj6AiWAeG8DJcxWja
#9CuF53F4g+3ShRW8KtA29CgJBq5PQFY=
#-----END CERTIFICATE-----
#"""
#SSL_BIND_KEY = """
#-----BEGIN PRIVATE KEY-----
#MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDcqttkD+a+YvSd
#4X2Q2NI2t9PfAJQGFKu1GutndYib7Ke0MkyzvKuUOTFZHlCPidqlNlVD7AqOkwPa
#lvQmDBFgLkROdKBv0N5Rgl5oekKBMYELOQc1Y9KvW/pfjvQ2KreEgsJKeox0XnTN
#OVvfC/ajNcj5HG30I1oTeldJB43VUnIaJkXlLUuSaw2rCpJQUkidgLuGzk87flSj
#vGGBGgv7AEgU/ltWeV30g1sZw8pLPeBhhICHrTJhYWAJYct3Llgpgwniw2Spi2Et
#bn0shBkAc9NNkiHnSiTPYfwn+uKDXq9aoDGMXbF9c8EhISGc+6LJOh/XhPwIKx35
#5Fgzc42zAgMBAAECggEAXBUgP/0yuLfqhAeYsl0IO7UyQJipLHBrxsNZAG9Xdlmn
#Edb7kvVkVBIZuaqgy4UnLFIj+pgBP8WxkgH0F/xpM82ay3J3kLGEVFcmtkpufiL+
#SoSdsXXacTrcnAu3dPMWacF2+kVxXw4bh5gr8kO3xBuppeprJ7mo2P/wdJUmZqGe
#SjkZew7mn6CZrSzHZZRupw/qWCu6DcRZsj0I7UnaYDCQdz4ajB6Qn+Zm1wdATpl9
#IYJpe93sIvcbcVgIHsGPoLgvgAWi+ShJBY4732/Ir5qqXcRcrBvvwNGayswONdpp
#JczPjO1O0xoDxf7NeNHd8M6wuiFzNHzrTCkd+04pQQKBgQD5hhZUX+Y02A3x1QX5
#Kw1txB199nV4gQ3fGdifktIGRKBEmqQwB4EJqSRHaaXMdh/rfK7xXGRiULNbRl9c
#q2Fbf8THpgyNXVdlMRtcWQrGFLMHgo1llz5k6VqNPbEWQHUYKvu6hZSA5WuYW6Gt
#U4K4k07a71Yo+/sMZS04x4qwKQKBgQDiZQoHuRh+WPGFmMZv3GfmT8JogrLBvvwg
#tIysFF9j3P0xzBEjT+7i98UCacdtxUyTecm8kQYDipowRETOXOC8FuRpU3gYbELw
#9cdzhdHWuiWTNk42yQ6Yucu2/WUo10HQ/yKPuQunb2Xj81eB2FMla8GxVcvskNkq
#K8uVjR7aewKBgFJ3upGQUGlOru0qVpsPW5TXqFelSRXWsVr3E91JjRh9PeruoS0u
#jbs/p7nidOWqdMpDnx4uRw8nVN/p1kKucbLn+4Vwn91o6CWNoVlYJHNrC/CDeXAG
#GJ0JcuATb5/HFewy6Jew5m/jYzgrsLe0ThPqu7koOPW6sjJajiOh73hhAoGBAIXT
#XD58d7IYOYzTZlmxW+mUtEK7H5fPoZJjp9QApvKNK05IZskM8xVPiTGH/c8xlbaH
#g2zn/ToSsFpfwJyL4nzMu3BXWuJ0/I0bfC8Zp5TarGN88ncIGozFJ1qgJzAhLlKw
#vmle5TiwbPZ2Xf/vNBcmv3RoVwccCIMZKFra9KYJAoGAXUN+JuAgg4PD895vHycu
#lhQSPXHIeyYb66H3DxoeHB3zxTHKlWOekBWk2HQ/19THedXpY5hDKayvFLbTMNZz
#ANvQJD17X6lG7svjuvIbB4EA4Ho9oWJfD+R6u8xpBFm2kqd0A2BqqOlyvkYtU4FD
#ZWz7p5p+MA8a2SjqgYP6Dlo=
#-----END PRIVATE KEY-----
#"""
| 51.035714
| 116
| 0.904362
| 219
| 4,287
| 17.643836
| 0.872146
| 0.004658
| 0.006211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117335
| 0.033823
| 4,287
| 83
| 117
| 51.650602
| 0.815548
| 0.963144
| 0
| null | 0
| null | 0
| 0
| null | 1
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 1
| 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 | 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
043f444bc58f084afdb93cc9fe60281e884207d8
| 102
|
py
|
Python
|
django_renderservice/apps.py
|
aldowntown/django-renderservice
|
04e20963da313b6d16be370a92292262555a86fc
|
[
"MIT"
] | null | null | null |
django_renderservice/apps.py
|
aldowntown/django-renderservice
|
04e20963da313b6d16be370a92292262555a86fc
|
[
"MIT"
] | null | null | null |
django_renderservice/apps.py
|
aldowntown/django-renderservice
|
04e20963da313b6d16be370a92292262555a86fc
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class RenderServiceConfig(AppConfig):
name = 'render_service'
| 17
| 37
| 0.784314
| 11
| 102
| 7.181818
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 102
| 5
| 38
| 20.4
| 0.908046
| 0
| 0
| 0
| 0
| 0
| 0.137255
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
f0b55399da69fabeefc52b71a3166c1f5f6d8865
| 123
|
py
|
Python
|
intro/language/demo.py
|
junghun73/Learning
|
8b5a295c42f142a3b2f5fa13fc75434a2ea9235a
|
[
"CC-BY-4.0"
] | 419
|
2016-03-05T08:50:48.000Z
|
2022-03-24T15:16:46.000Z
|
intro/language/demo.py
|
techeye220/scipy-lecture-notes-zh-CN
|
cc87204fcc4bd2f4702f7c29c83cb8ed5c94b7d6
|
[
"CC-BY-4.0"
] | 5
|
2016-05-21T14:21:12.000Z
|
2017-10-06T11:09:48.000Z
|
intro/language/demo.py
|
techeye220/scipy-lecture-notes-zh-CN
|
cc87204fcc4bd2f4702f7c29c83cb8ed5c94b7d6
|
[
"CC-BY-4.0"
] | 233
|
2016-02-13T09:22:57.000Z
|
2021-11-11T17:58:44.000Z
|
"A demo module."
def print_b():
"Prints b."
print 'b'
def print_a():
"Prints a."
print 'a'
c = 2
d = 2
| 8.785714
| 16
| 0.495935
| 21
| 123
| 2.809524
| 0.47619
| 0.271186
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02439
| 0.333333
| 123
| 13
| 17
| 9.461538
| 0.695122
| 0
| 0
| 0
| 0
| 0
| 0.276423
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.444444
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
f0b739474b9b6af6ba0ed03e322b1d5a250a8c5e
| 31
|
py
|
Python
|
data/studio21_generated/introductory/3710/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/introductory/3710/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/introductory/3710/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
def ulam_sequence(u0, u1, n):
| 15.5
| 29
| 0.677419
| 6
| 31
| 3.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 0.16129
| 31
| 2
| 30
| 15.5
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f0bbaed1c3fcd94be0fd462d5d84048db6b6e089
| 101
|
py
|
Python
|
M-SOLUTIONS/MS_B.py
|
consommee/AtCoder
|
9beccf6a1202ca48491b4fcf748aa3dba0f12fb3
|
[
"MIT"
] | null | null | null |
M-SOLUTIONS/MS_B.py
|
consommee/AtCoder
|
9beccf6a1202ca48491b4fcf748aa3dba0f12fb3
|
[
"MIT"
] | null | null | null |
M-SOLUTIONS/MS_B.py
|
consommee/AtCoder
|
9beccf6a1202ca48491b4fcf748aa3dba0f12fb3
|
[
"MIT"
] | null | null | null |
a = int(input())
print((a-2)*180)c = input()
if c.count('x') <= 7:
print("YES")
else:
print("NO")
| 16.833333
| 27
| 0.534653
| 19
| 101
| 2.842105
| 0.736842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0.158416
| 101
| 6
| 28
| 16.833333
| 0.576471
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
f0ee765356c79d2d347e75c002daf5561759936a
| 1,996
|
py
|
Python
|
apps/breakfast/tools/Life/tools/cx/messages/SetProbeSchedule.py
|
mtaghiza/tinyos-main-1
|
cac075f7eae46c6a37409e66137a78b9bc3a64b1
|
[
"BSD-3-Clause"
] | null | null | null |
apps/breakfast/tools/Life/tools/cx/messages/SetProbeSchedule.py
|
mtaghiza/tinyos-main-1
|
cac075f7eae46c6a37409e66137a78b9bc3a64b1
|
[
"BSD-3-Clause"
] | null | null | null |
apps/breakfast/tools/Life/tools/cx/messages/SetProbeSchedule.py
|
mtaghiza/tinyos-main-1
|
cac075f7eae46c6a37409e66137a78b9bc3a64b1
|
[
"BSD-3-Clause"
] | 1
|
2022-02-21T14:31:18.000Z
|
2022-02-21T14:31:18.000Z
|
from tools.cx.messages import SetSettingsStorageMsg
import tools.cx.constants
class SetProbeSchedule(SetSettingsStorageMsg.SetSettingsStorageMsg):
def __init__(self, probeInterval, channel, invFrequency, bw,
maxDepth):
SetSettingsStorageMsg.SetSettingsStorageMsg.__init__(self )
self.set_key(tools.cx.constants.SS_KEY_PROBE_SCHEDULE)
#wish this wasn't hardcoded, but I don't see a better way to
# subclass this.
self.set_len(28)
#4
self.setUIntElement(self.offsetBits_val(0), 32, probeInterval, 1)
#12
self.setUIntElement(self.offsetBits_val(4), 8, channel[0], 1)
self.setUIntElement(self.offsetBits_val(5), 8, channel[1], 1)
self.setUIntElement(self.offsetBits_val(6), 8, channel[2], 1)
self.setUIntElement(self.offsetBits_val(7), 8, invFrequency[0], 1)
self.setUIntElement(self.offsetBits_val(8), 8, invFrequency[1], 1)
self.setUIntElement(self.offsetBits_val(9), 8, invFrequency[2], 1)
self.setUIntElement(self.offsetBits_val(10), 8, bw[0], 1)
self.setUIntElement(self.offsetBits_val(11), 8, bw[1], 1)
self.setUIntElement(self.offsetBits_val(12), 8, bw[2], 1)
self.setUIntElement(self.offsetBits_val(13), 8, maxDepth[0], 1)
self.setUIntElement(self.offsetBits_val(14), 8, maxDepth[1], 1)
self.setUIntElement(self.offsetBits_val(15), 8, maxDepth[2], 1)
#12
for i in range(3):
print "ns %u: pi %u if %u md %u -> %u"%(i, probeInterval,
invFrequency[i], maxDepth[i],
probeInterval*invFrequency[i]*maxDepth[i]*32)
self.setUIntElement(self.offsetBits_val(16), 32,
probeInterval*invFrequency[0]*maxDepth[0]*32, 1)
self.setUIntElement(self.offsetBits_val(20), 32,
probeInterval*invFrequency[1]*maxDepth[1]*32, 1)
self.setUIntElement(self.offsetBits_val(24), 32,
probeInterval*invFrequency[2]*maxDepth[2]*32, 1)
| 51.179487
| 74
| 0.665331
| 257
| 1,996
| 5.054475
| 0.272374
| 0.221709
| 0.270978
| 0.394149
| 0.507313
| 0.426482
| 0.371824
| 0
| 0
| 0
| 0
| 0.059899
| 0.205411
| 1,996
| 38
| 75
| 52.526316
| 0.759143
| 0.04008
| 0
| 0
| 0
| 0
| 0.015699
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.064516
| null | null | 0.032258
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f0f373aaf363bfe55b135af7713608298f484256
| 57
|
py
|
Python
|
src/start.py
|
jairomr/ReportCamera
|
550b4e2e943660b9157b3918deef9048f2627117
|
[
"MIT"
] | null | null | null |
src/start.py
|
jairomr/ReportCamera
|
550b4e2e943660b9157b3918deef9048f2627117
|
[
"MIT"
] | null | null | null |
src/start.py
|
jairomr/ReportCamera
|
550b4e2e943660b9157b3918deef9048f2627117
|
[
"MIT"
] | null | null | null |
from GetFileFTP import GetFileFTP as gftp
gftp().main()
| 14.25
| 41
| 0.77193
| 8
| 57
| 5.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.140351
| 57
| 3
| 42
| 19
| 0.897959
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f0f8278a7db188aa7870423ca03f857140617070
| 100
|
py
|
Python
|
Question 51 - 60/Q55.py
|
debdutgoswami/python-semester-practical
|
9abdc9091d825a2425b36437f6f8fe6806ac84f2
|
[
"MIT"
] | null | null | null |
Question 51 - 60/Q55.py
|
debdutgoswami/python-semester-practical
|
9abdc9091d825a2425b36437f6f8fe6806ac84f2
|
[
"MIT"
] | null | null | null |
Question 51 - 60/Q55.py
|
debdutgoswami/python-semester-practical
|
9abdc9091d825a2425b36437f6f8fe6806ac84f2
|
[
"MIT"
] | null | null | null |
import math
a, b = tuple(int(i) for i in input("enter two number: ").split())
print(math.gcd(a,b))
| 20
| 65
| 0.65
| 20
| 100
| 3.25
| 0.8
| 0.061538
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 100
| 5
| 66
| 20
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0.178218
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
0b072e123f4c3af5c3fbb8a97f91dbb823ca1c93
| 192
|
py
|
Python
|
rocketman/types/history.py
|
Batucho/Rocketman
|
ff93b7e68be269e4b1b04b4d72611e308e73a76b
|
[
"MIT"
] | null | null | null |
rocketman/types/history.py
|
Batucho/Rocketman
|
ff93b7e68be269e4b1b04b4d72611e308e73a76b
|
[
"MIT"
] | null | null | null |
rocketman/types/history.py
|
Batucho/Rocketman
|
ff93b7e68be269e4b1b04b4d72611e308e73a76b
|
[
"MIT"
] | null | null | null |
from typing import Dict, TypedDict
class HistoricEventData(TypedDict):
id: str
links: Dict[str, str]
title: str
event_date_utc: str
event_date_unix: int
details: str
| 17.454545
| 35
| 0.692708
| 26
| 192
| 4.961538
| 0.653846
| 0.124031
| 0.186047
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.239583
| 192
| 10
| 36
| 19.2
| 0.883562
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.125
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
9bcef62a7d3242edb57a41139cda014a1a7bf36e
| 91
|
py
|
Python
|
configs/__init__.py
|
mutalisk999/bibi
|
2e0043d207c83ef7fc55d20b9c0a1b7e493a551c
|
[
"Apache-2.0"
] | 1,037
|
2017-03-24T11:18:55.000Z
|
2022-03-19T14:02:27.000Z
|
configs/__init__.py
|
spacecode-live/An-e-commerce-fullstack-solution-for-Flask-
|
28130a18a73afbb99bf850e857dd1f14c08fbca1
|
[
"Apache-2.0"
] | 8
|
2017-03-26T02:53:24.000Z
|
2018-09-14T03:18:26.000Z
|
configs/__init__.py
|
spacecode-live/An-e-commerce-fullstack-solution-for-Flask-
|
28130a18a73afbb99bf850e857dd1f14c08fbca1
|
[
"Apache-2.0"
] | 365
|
2017-03-24T11:29:02.000Z
|
2021-11-24T03:14:19.000Z
|
# -*- coding: utf-8 -*-
from .config import BaseConfig, DevConfig, TestConfig, get_config
| 22.75
| 65
| 0.714286
| 11
| 91
| 5.818182
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012821
| 0.142857
| 91
| 3
| 66
| 30.333333
| 0.807692
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
9be5cd74a92a724c408e39cb56bd9e8e9f4ccda9
| 226
|
py
|
Python
|
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/models.py
|
pylabs/pyramid-full
|
9bc40a16ae1fa71aef9746bdbeb5a19ae305ee90
|
[
"MIT"
] | null | null | null |
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/models.py
|
pylabs/pyramid-full
|
9bc40a16ae1fa71aef9746bdbeb5a19ae305ee90
|
[
"MIT"
] | null | null | null |
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/models.py
|
pylabs/pyramid-full
|
9bc40a16ae1fa71aef9746bdbeb5a19ae305ee90
|
[
"MIT"
] | null | null | null |
#from pyramid_sqlalchemy import BaseObject
#from sqlalchemy import Column, Integer, String
#class MyModel(BaseObject):
#
# __tablename__ = ''
#
# id = Column(Integer, primary_key=True)
# field = Column(String(255))
| 20.545455
| 47
| 0.716814
| 25
| 226
| 6.24
| 0.68
| 0.205128
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015957
| 0.168142
| 226
| 10
| 48
| 22.6
| 0.81383
| 0.920354
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9bf03018ab48026de12c74be90575e18c75c0354
| 247
|
py
|
Python
|
qmt/__init__.py
|
merrittlosert/qmt
|
bf4684d9cf0ae64aac05ecd1e16b2aaa2d359c54
|
[
"MIT"
] | 31
|
2018-03-07T18:30:41.000Z
|
2019-05-06T18:35:41.000Z
|
qmt/__init__.py
|
merrittlosert/qmt
|
bf4684d9cf0ae64aac05ecd1e16b2aaa2d359c54
|
[
"MIT"
] | 64
|
2018-03-23T19:10:48.000Z
|
2019-05-06T18:14:13.000Z
|
qmt/__init__.py
|
merrittlosert/qmt
|
bf4684d9cf0ae64aac05ecd1e16b2aaa2d359c54
|
[
"MIT"
] | 15
|
2019-05-08T10:55:04.000Z
|
2022-01-05T16:49:29.000Z
|
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from ._version import __version__
del _version
from .physics_constants import units, constants, parse_unit, to_float
from .materials import Materials
| 24.7
| 69
| 0.809717
| 32
| 247
| 5.96875
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137652
| 247
| 9
| 70
| 27.444444
| 0.896714
| 0.360324
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
9bf9338f1b7bdb27f31d544457ae65d79d59a453
| 17,582
|
py
|
Python
|
tests/utils/test_flexible_version.py
|
mbearup/WALinuxAgent
|
4a64802c2a0a31c458a2d1de9cbe378b26674bac
|
[
"Apache-2.0"
] | null | null | null |
tests/utils/test_flexible_version.py
|
mbearup/WALinuxAgent
|
4a64802c2a0a31c458a2d1de9cbe378b26674bac
|
[
"Apache-2.0"
] | null | null | null |
tests/utils/test_flexible_version.py
|
mbearup/WALinuxAgent
|
4a64802c2a0a31c458a2d1de9cbe378b26674bac
|
[
"Apache-2.0"
] | null | null | null |
import random # pylint: disable=unused-import
import re
import unittest
from azurelinuxagent.common.utils.flexible_version import FlexibleVersion
class TestFlexibleVersion(unittest.TestCase):
def setUp(self):
self.v = FlexibleVersion() # pylint: disable=invalid-name
def test_compile_separator(self): # pylint: disable=useless-return
tests = [
'.',
'',
'-'
]
for t in tests: # pylint: disable=invalid-name
t_escaped = re.escape(t)
t_re = re.compile(t_escaped)
self.assertEqual((t_escaped, t_re), self.v._compile_separator(t)) # pylint: disable=protected-access
self.assertEqual(('', re.compile('')), self.v._compile_separator(None)) # pylint: disable=protected-access
return
def test_compile_pattern(self): # pylint: disable=useless-return
self.v._compile_pattern() # pylint: disable=protected-access
tests = {
'1': True,
'1.2': True,
'1.2.3': True,
'1.2.3.4': True,
'1.2.3.4.5': True,
'1alpha': True,
'1.alpha': True,
'1-alpha': True,
'1alpha0': True,
'1.alpha0': True,
'1-alpha0': True,
'1.2alpha': True,
'1.2.alpha': True,
'1.2-alpha': True,
'1.2alpha0': True,
'1.2.alpha0': True,
'1.2-alpha0': True,
'1beta': True,
'1.beta': True,
'1-beta': True,
'1beta0': True,
'1.beta0': True,
'1-beta0': True,
'1.2beta': True,
'1.2.beta': True,
'1.2-beta': True,
'1.2beta0': True,
'1.2.beta0': True,
'1.2-beta0': True,
'1rc': True,
'1.rc': True,
'1-rc': True,
'1rc0': True,
'1.rc0': True,
'1-rc0': True,
'1.2rc': True,
'1.2.rc': True,
'1.2-rc': True,
'1.2rc0': True,
'1.2.rc0': True,
'1.2-rc0': True,
'1.2.3.4alpha5': True,
' 1': False,
'beta': False,
'1delta0': False,
'': False
}
for test in iter(tests):
expectation = tests[test]
self.assertEqual(
expectation,
self.v.version_re.match(test) is not None,
"test: {0} expected: {1} ".format(test, expectation))
return
def test_compile_pattern_sep(self): # pylint: disable=useless-return
self.v.sep = '-'
self.v._compile_pattern() # pylint: disable=protected-access
tests = {
'1': True,
'1-2': True,
'1-2-3': True,
'1-2-3-4': True,
'1-2-3-4-5': True,
'1alpha': True,
'1-alpha': True,
'1alpha0': True,
'1-alpha0': True,
'1-2alpha': True,
'1-2.alpha': True,
'1-2-alpha': True,
'1-2alpha0': True,
'1-2.alpha0': True,
'1-2-alpha0': True,
'1beta': True,
'1-beta': True,
'1beta0': True,
'1-beta0': True,
'1-2beta': True,
'1-2.beta': True,
'1-2-beta': True,
'1-2beta0': True,
'1-2.beta0': True,
'1-2-beta0': True,
'1rc': True,
'1-rc': True,
'1rc0': True,
'1-rc0': True,
'1-2rc': True,
'1-2.rc': True,
'1-2-rc': True,
'1-2rc0': True,
'1-2.rc0': True,
'1-2-rc0': True,
'1-2-3-4alpha5': True,
' 1': False,
'beta': False,
'1delta0': False,
'': False
}
for test in iter(tests):
expectation = tests[test]
self.assertEqual(
expectation,
self.v.version_re.match(test) is not None,
"test: {0} expected: {1} ".format(test, expectation))
return
def test_compile_pattern_prerel(self): # pylint: disable=useless-return
self.v.prerel_tags = ('a', 'b', 'c')
self.v._compile_pattern() # pylint: disable=protected-access
tests = {
'1': True,
'1.2': True,
'1.2.3': True,
'1.2.3.4': True,
'1.2.3.4.5': True,
'1a': True,
'1.a': True,
'1-a': True,
'1a0': True,
'1.a0': True,
'1-a0': True,
'1.2a': True,
'1.2.a': True,
'1.2-a': True,
'1.2a0': True,
'1.2.a0': True,
'1.2-a0': True,
'1b': True,
'1.b': True,
'1-b': True,
'1b0': True,
'1.b0': True,
'1-b0': True,
'1.2b': True,
'1.2.b': True,
'1.2-b': True,
'1.2b0': True,
'1.2.b0': True,
'1.2-b0': True,
'1c': True,
'1.c': True,
'1-c': True,
'1c0': True,
'1.c0': True,
'1-c0': True,
'1.2c': True,
'1.2.c': True,
'1.2-c': True,
'1.2c0': True,
'1.2.c0': True,
'1.2-c0': True,
'1.2.3.4a5': True,
' 1': False,
'1.2.3.4alpha5': False,
'beta': False,
'1delta0': False,
'': False
}
for test in iter(tests):
expectation = tests[test]
self.assertEqual(
expectation,
self.v.version_re.match(test) is not None,
"test: {0} expected: {1} ".format(test, expectation))
return
def test_ensure_compatible_separators(self): # pylint: disable=useless-return
v1 = FlexibleVersion('1.2.3') # pylint: disable=invalid-name
v2 = FlexibleVersion('1-2-3', sep='-') # pylint: disable=invalid-name
try:
v1 == v2 # pylint: disable=pointless-statement
self.assertTrue(False, "Incompatible separators failed to raise an exception") # pylint: disable=redundant-unittest-assert
except ValueError:
pass
except Exception as e: # pylint: disable=invalid-name
t = e.__class__.__name__ # pylint: disable=invalid-name
# pylint: disable=redundant-unittest-assert
self.assertTrue(False, "Incompatible separators raised an unexpected exception: {0}" \
.format(t))
# pylint: enable=redundant-unittest-assert
return
def test_ensure_compatible_prerel(self): # pylint: disable=useless-return
v1 = FlexibleVersion('1.2.3', prerel_tags=('alpha', 'beta', 'rc')) # pylint: disable=invalid-name
v2 = FlexibleVersion('1.2.3', prerel_tags=('a', 'b', 'c')) # pylint: disable=invalid-name
try:
v1 == v2 # pylint: disable=pointless-statement
self.assertTrue(False, "Incompatible prerel_tags failed to raise an exception") # pylint: disable=redundant-unittest-assert
except ValueError:
pass
except Exception as e: # pylint: disable=invalid-name
t = e.__class__.__name__ # pylint: disable=invalid-name
# pylint: disable=redundant-unittest-assert
self.assertTrue(False, "Incompatible prerel_tags raised an unexpected exception: {0}" \
.format(t))
# pylint: enable=redundant-unittest-assert
return
def test_ensure_compatible_prerel_length(self): # pylint: disable=useless-return
v1 = FlexibleVersion('1.2.3', prerel_tags=('a', 'b', 'c')) # pylint: disable=invalid-name
v2 = FlexibleVersion('1.2.3', prerel_tags=('a', 'b')) # pylint: disable=invalid-name
try:
v1 == v2 # pylint: disable=pointless-statement
self.assertTrue(False, "Incompatible prerel_tags failed to raise an exception") # pylint: disable=redundant-unittest-assert
except ValueError:
pass
except Exception as e: # pylint: disable=invalid-name
t = e.__class__.__name__ # pylint: disable=invalid-name
# pylint: disable=redundant-unittest-assert
self.assertTrue(False, "Incompatible prerel_tags raised an unexpected exception: {0}" \
.format(t))
# pylint: enable=redundant-unittest-assert
return
def test_ensure_compatible_prerel_order(self): # pylint: disable=useless-return
v1 = FlexibleVersion('1.2.3', prerel_tags=('a', 'b')) # pylint: disable=invalid-name
v2 = FlexibleVersion('1.2.3', prerel_tags=('b', 'a')) # pylint: disable=invalid-name
try:
v1 == v2 # pylint: disable=pointless-statement
self.assertTrue(False, "Incompatible prerel_tags failed to raise an exception") # pylint: disable=redundant-unittest-assert
except ValueError:
pass
except Exception as e: # pylint: disable=invalid-name
t = e.__class__.__name__ # pylint: disable=invalid-name
# pylint: disable=redundant-unittest-assert
self.assertTrue(False, "Incompatible prerel_tags raised an unexpected exception: {0}" \
.format(t))
# pylint: enable=redundant-unittest-assert
return
def test_major(self): # pylint: disable=useless-return
tests = {
'1' : 1,
'1.2' : 1,
'1.2.3' : 1,
'1.2.3.4' : 1
}
for test in iter(tests):
expectation = tests[test]
self.assertEqual(
expectation,
FlexibleVersion(test).major)
return
def test_minor(self): # pylint: disable=useless-return
tests = {
'1' : 0,
'1.2' : 2,
'1.2.3' : 2,
'1.2.3.4' : 2
}
for test in iter(tests):
expectation = tests[test]
self.assertEqual(
expectation,
FlexibleVersion(test).minor)
return
def test_patch(self): # pylint: disable=useless-return
tests = {
'1' : 0,
'1.2' : 0,
'1.2.3' : 3,
'1.2.3.4' : 3
}
for test in iter(tests):
expectation = tests[test]
self.assertEqual(
expectation,
FlexibleVersion(test).patch)
return
def test_parse(self): # pylint: disable=useless-return
tests = {
"1.2.3.4": ((1, 2, 3, 4), None),
"1.2.3.4alpha5": ((1, 2, 3, 4), ('alpha', 5)),
"1.2.3.4-alpha5": ((1, 2, 3, 4), ('alpha', 5)),
"1.2.3.4.alpha5": ((1, 2, 3, 4), ('alpha', 5))
}
for test in iter(tests):
expectation = tests[test]
self.v._parse(test) # pylint: disable=protected-access
self.assertEqual(expectation, (self.v.version, self.v.prerelease))
return
def test_decrement(self): # pylint: disable=useless-return
src_v = FlexibleVersion('1.0.0.0.10')
dst_v = FlexibleVersion(str(src_v))
for i in range(1,10):
dst_v -= 1
self.assertEqual(i, src_v.version[-1] - dst_v.version[-1])
return
def test_decrement_disallows_below_zero(self): # pylint: disable=useless-return
try:
FlexibleVersion('1.0') - 1 # pylint: disable=expression-not-assigned
self.assertTrue(False, "Decrement failed to raise an exception") # pylint: disable=redundant-unittest-assert
except ArithmeticError:
pass
except Exception as e: # pylint: disable=invalid-name
t = e.__class__.__name__ # pylint: disable=invalid-name
self.assertTrue(False, "Decrement raised an unexpected exception: {0}".format(t)) # pylint: disable=redundant-unittest-assert
return
def test_increment(self): # pylint: disable=useless-return
src_v = FlexibleVersion('1.0.0.0.0')
dst_v = FlexibleVersion(str(src_v))
for i in range(1,10):
dst_v += 1
self.assertEqual(i, dst_v.version[-1] - src_v.version[-1])
return
def test_str(self): # pylint: disable=useless-return
tests = [
'1',
'1.2',
'1.2.3',
'1.2.3.4',
'1.2.3.4.5',
'1alpha',
'1.alpha',
'1-alpha',
'1alpha0',
'1.alpha0',
'1-alpha0',
'1.2alpha',
'1.2.alpha',
'1.2-alpha',
'1.2alpha0',
'1.2.alpha0',
'1.2-alpha0',
'1beta',
'1.beta',
'1-beta',
'1beta0',
'1.beta0',
'1-beta0',
'1.2beta',
'1.2.beta',
'1.2-beta',
'1.2beta0',
'1.2.beta0',
'1.2-beta0',
'1rc',
'1.rc',
'1-rc',
'1rc0',
'1.rc0',
'1-rc0',
'1.2rc',
'1.2.rc',
'1.2-rc',
'1.2rc0',
'1.2.rc0',
'1.2-rc0',
'1.2.3.4alpha5',
]
for test in tests:
self.assertEqual(test, str(FlexibleVersion(test)))
return
def test_creation_from_flexible_version(self): # pylint: disable=useless-return
tests = [
'1',
'1.2',
'1.2.3',
'1.2.3.4',
'1.2.3.4.5',
'1alpha',
'1.alpha',
'1-alpha',
'1alpha0',
'1.alpha0',
'1-alpha0',
'1.2alpha',
'1.2.alpha',
'1.2-alpha',
'1.2alpha0',
'1.2.alpha0',
'1.2-alpha0',
'1beta',
'1.beta',
'1-beta',
'1beta0',
'1.beta0',
'1-beta0',
'1.2beta',
'1.2.beta',
'1.2-beta',
'1.2beta0',
'1.2.beta0',
'1.2-beta0',
'1rc',
'1.rc',
'1-rc',
'1rc0',
'1.rc0',
'1-rc0',
'1.2rc',
'1.2.rc',
'1.2-rc',
'1.2rc0',
'1.2.rc0',
'1.2-rc0',
'1.2.3.4alpha5',
]
for test in tests:
v = FlexibleVersion(test) # pylint: disable=invalid-name
self.assertEqual(test, str(FlexibleVersion(v)))
return
def test_repr(self):
v = FlexibleVersion('1,2,3rc4', ',', ['lol', 'rc']) # pylint: disable=invalid-name
expected = "FlexibleVersion ('1,2,3rc4', ',', ('lol', 'rc'))"
self.assertEqual(expected, repr(v))
def test_order(self): # pylint: disable=useless-return
test0 = ["1.7.0", "1.7.0rc0", "1.11.0"]
expected0 = ['1.7.0rc0', '1.7.0', '1.11.0']
self.assertEqual(expected0, list(map(str, sorted([FlexibleVersion(v) for v in test0]))))
test1 = [
'2.0.2rc2',
'2.2.0beta3',
'2.0.10',
'2.1.0alpha42',
'2.0.2beta4',
'2.1.1',
'2.0.1',
'2.0.2rc3',
'2.2.0',
'2.0.0',
'3.0.1',
'2.1.0rc1'
]
expected1 = [
'2.0.0',
'2.0.1',
'2.0.2beta4',
'2.0.2rc2',
'2.0.2rc3',
'2.0.10',
'2.1.0alpha42',
'2.1.0rc1',
'2.1.1',
'2.2.0beta3',
'2.2.0',
'3.0.1'
]
self.assertEqual(expected1, list(map(str, sorted([FlexibleVersion(v) for v in test1]))))
self.assertEqual(FlexibleVersion("1.0.0.0.0.0.0.0"), FlexibleVersion("1"))
self.assertFalse(FlexibleVersion("1.0") > FlexibleVersion("1.0"))
self.assertFalse(FlexibleVersion("1.0") < FlexibleVersion("1.0"))
self.assertTrue(FlexibleVersion("1.0") < FlexibleVersion("1.1"))
self.assertTrue(FlexibleVersion("1.9") < FlexibleVersion("1.10"))
self.assertTrue(FlexibleVersion("1.9.9") < FlexibleVersion("1.10.0"))
self.assertTrue(FlexibleVersion("1.0.0.0") < FlexibleVersion("1.2.0.0"))
self.assertTrue(FlexibleVersion("1.1") > FlexibleVersion("1.0"))
self.assertTrue(FlexibleVersion("1.10") > FlexibleVersion("1.9"))
self.assertTrue(FlexibleVersion("1.10.0") > FlexibleVersion("1.9.9"))
self.assertTrue(FlexibleVersion("1.2.0.0") > FlexibleVersion("1.0.0.0"))
self.assertTrue(FlexibleVersion("1.0") <= FlexibleVersion("1.1"))
self.assertTrue(FlexibleVersion("1.1") > FlexibleVersion("1.0"))
self.assertTrue(FlexibleVersion("1.1") >= FlexibleVersion("1.0"))
self.assertTrue(FlexibleVersion("1.0") == FlexibleVersion("1.0"))
self.assertTrue(FlexibleVersion("1.0") >= FlexibleVersion("1.0"))
self.assertTrue(FlexibleVersion("1.0") <= FlexibleVersion("1.0"))
self.assertFalse(FlexibleVersion("1.0") != FlexibleVersion("1.0"))
self.assertTrue(FlexibleVersion("1.1") != FlexibleVersion("1.0"))
return
if __name__ == '__main__':
unittest.main()
| 32.925094
| 138
| 0.479752
| 1,990
| 17,582
| 4.171357
| 0.08392
| 0.028912
| 0.036863
| 0.063607
| 0.84014
| 0.775087
| 0.722443
| 0.699916
| 0.689555
| 0.668233
| 0
| 0.076051
| 0.368047
| 17,582
| 533
| 139
| 32.986867
| 0.671047
| 0.124616
| 0
| 0.557447
| 0
| 0
| 0.168168
| 0
| 0
| 0
| 0
| 0
| 0.095745
| 1
| 0.042553
| false
| 0.010638
| 0.008511
| 0
| 0.091489
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ac8d295e14f2f964d4cbd786e12e2b52c32d8ae3
| 1,059
|
py
|
Python
|
libra/transaction/__init__.py
|
MoveOnLibra/libra-core
|
3b04fd86d263a22e323cca873c13e6397a560f8b
|
[
"MIT"
] | 5
|
2020-01-06T08:31:23.000Z
|
2020-10-17T19:24:30.000Z
|
libra/transaction/__init__.py
|
MoveOnLibra/libra-core
|
3b04fd86d263a22e323cca873c13e6397a560f8b
|
[
"MIT"
] | 1
|
2020-04-08T10:35:48.000Z
|
2020-04-08T10:35:48.000Z
|
libra/transaction/__init__.py
|
MoveOnLibra/libra-core
|
3b04fd86d263a22e323cca873c13e6397a560f8b
|
[
"MIT"
] | 1
|
2020-04-07T11:19:59.000Z
|
2020-04-07T11:19:59.000Z
|
from libra.transaction.transaction_argument import TransactionArgument # noqa: F401
from libra.transaction.write_set import WriteSet, WriteOp # noqa: F401
from libra.transaction.change_set import ChangeSet # noqa: F401
from libra.transaction.script import Script # noqa: F401
from libra.transaction.module import Module # noqa: F401
from libra.transaction.transaction_payload import TransactionPayload # noqa: F401
from libra.transaction.raw_transaction import RawTransaction, MAX_GAS_AMOUNT # noqa: F401
from libra.transaction.signed_transaction import SignedTransaction, SignatureCheckedTransaction # noqa: F401
from libra.transaction.transaction_info import TransactionInfo # noqa: F401
from libra.transaction.transaction import Transaction, Version # noqa: F401
from libra.transaction.mod import TransactionStatus, TransactionOutput, TransactionToCommit # noqa: F401
from libra.transaction.authenticator import TransactionAuthenticator, AuthenticationKey # noqa: F401
MAX_TRANSACTION_SIZE_IN_BYTES = 4096
SCRIPT_HASH_LENGTH = 32
| 70.6
| 110
| 0.830028
| 122
| 1,059
| 7.081967
| 0.352459
| 0.125
| 0.277778
| 0.216435
| 0.394676
| 0.135417
| 0
| 0
| 0
| 0
| 0
| 0.044872
| 0.116147
| 1,059
| 15
| 111
| 70.6
| 0.878205
| 0.123702
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.857143
| 0
| 0.857143
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ac8e729873144f89e2255b843a2b5b36a8f3d405
| 28
|
py
|
Python
|
wrangalytics/config/__init__.py
|
acastrounis/data-wrangler
|
0288449e08ebd14393e1718e6ecf3765b0ec77b2
|
[
"MIT"
] | 1
|
2018-07-02T22:18:24.000Z
|
2018-07-02T22:18:24.000Z
|
wrangalytics/config/__init__.py
|
acastrounis/data-wrangler
|
0288449e08ebd14393e1718e6ecf3765b0ec77b2
|
[
"MIT"
] | null | null | null |
wrangalytics/config/__init__.py
|
acastrounis/data-wrangler
|
0288449e08ebd14393e1718e6ecf3765b0ec77b2
|
[
"MIT"
] | null | null | null |
name = "wrangalytics.config"
| 28
| 28
| 0.785714
| 3
| 28
| 7.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 28
| 1
| 28
| 28
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0.655172
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ac920722c5c99eeb88e78ee45c08918b9ea695e2
| 259
|
py
|
Python
|
apps/main/api/document.py
|
major-hub/soil_app
|
ddd250161ad496afd4c8484f79500ff2657b51df
|
[
"MIT"
] | null | null | null |
apps/main/api/document.py
|
major-hub/soil_app
|
ddd250161ad496afd4c8484f79500ff2657b51df
|
[
"MIT"
] | null | null | null |
apps/main/api/document.py
|
major-hub/soil_app
|
ddd250161ad496afd4c8484f79500ff2657b51df
|
[
"MIT"
] | null | null | null |
from rest_framework.viewsets import ModelViewSet
from main.models import Document
from main.serializers.document import DocumentSerializer
class DocumentViewSet(ModelViewSet):
queryset = Document.objects.all()
serializer_class = DocumentSerializer
| 25.9
| 56
| 0.830116
| 27
| 259
| 7.888889
| 0.62963
| 0.075117
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119691
| 259
| 9
| 57
| 28.777778
| 0.934211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ac9cf64b6710a2d79c467efc2bdd0184afa2efa7
| 510
|
py
|
Python
|
tests/kyu_7_tests/test_digitize.py
|
the-zebulan/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 40
|
2016-03-09T12:26:20.000Z
|
2022-03-23T08:44:51.000Z
|
tests/kyu_7_tests/test_digitize.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | null | null | null |
tests/kyu_7_tests/test_digitize.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 36
|
2016-11-07T19:59:58.000Z
|
2022-03-31T11:18:27.000Z
|
import unittest
from katas.kyu_7.digitize import digitize
class DigitizeTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(digitize(123), [1, 2, 3])
def test_equals_2(self):
self.assertEqual(digitize(1), [1])
def test_equals_3(self):
self.assertEqual(digitize(0), [0])
def test_equals_4(self):
self.assertEqual(digitize(1230), [1, 2, 3, 0])
def test_equals_5(self):
self.assertEqual(digitize(8675309), [8, 6, 7, 5, 3, 0, 9])
| 24.285714
| 66
| 0.65098
| 73
| 510
| 4.410959
| 0.369863
| 0.108696
| 0.201863
| 0.419255
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.091584
| 0.207843
| 510
| 20
| 67
| 25.5
| 0.705446
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.384615
| 1
| 0.384615
| false
| 0
| 0.153846
| 0
| 0.615385
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
ac9dfb6a997d4da3fd657f04305b7706b974db33
| 15,620
|
py
|
Python
|
musiczone/Music/tests.py
|
yan17asn/ITC172win20
|
1a7c0280956fdb9279d46dff5237190584653a5e
|
[
"Apache-2.0"
] | null | null | null |
musiczone/Music/tests.py
|
yan17asn/ITC172win20
|
1a7c0280956fdb9279d46dff5237190584653a5e
|
[
"Apache-2.0"
] | null | null | null |
musiczone/Music/tests.py
|
yan17asn/ITC172win20
|
1a7c0280956fdb9279d46dff5237190584653a5e
|
[
"Apache-2.0"
] | null | null | null |
from django.test import TestCase
from django.urls import reverse
from .models import Genre, Artist, Album, Song, SongReview
from django.contrib.auth.models import User
from .forms import GenreForm, ArtistForm, AlbumForm, SongForm, SongReviewForm
# Create your tests here.
# ================== Genre Model ========================
class GenreTest(TestCase):
def setUp(self):
genre = Genre(genrename='Pop')
return genre
#test string
def test_string(self):
gen = self.setUp()
self.assertEqual(str(gen), gen.genrename)
# test Genre table.
def test_table(self):
self.assertEqual(str(Genre._meta.db_table), 'genre')
# ================== Artist Model ========================
class ArtistTest(TestCase):
def setUp(self):
artist = Artist(name='Taylor Swift',born='1989-12-31',url='https://en.wikipedia.org/wiki/Taylor_Swift',
description='Taylor Alison Swift is an American singer-songwriter.')
return artist
#test string
def test_string(self):
art = self.setUp()
self.assertEqual(str(art), art.name)
def test_born(self):
art = self.setUp()
self.assertEqual(str(art.born),'1989-12-31')
def test_url(self):
art = self.setUp()
self.assertEqual(str(art.url),'https://en.wikipedia.org/wiki/Taylor_Swift')
def test_description(self):
art = self.setUp()
self.assertEqual(str(art.description),'Taylor Alison Swift is an American singer-songwriter.')
# test Artist table.
def test_table(self):
self.assertEqual(str(Artist._meta.db_table), 'artist')
# ================== Album Model ========================
class AlbumTest(TestCase):
def setUp(self):
artist = Artist(name='Taylor Swift')
album = Album(albumtitle='Fearless',artist=artist,releasedate='2008-11-11')
return album
#test string
def test_string(self):
alb = self.setUp()
self.assertEqual(str(alb), alb.albumtitle)
def test_artist(self):
alb = self.setUp()
self.assertEqual(str(alb.artist),'Taylor Swift')
def test_releasedate(self):
alb = self.setUp()
self.assertEqual(str(alb.releasedate),'2008-11-11')
# test Album table.
def test_table(self):
self.assertEqual(str(Album._meta.db_table), 'album')
# ================== Song Model ========================
class SongTest(TestCase):
def setUp(self):
album = Album(albumtitle='Fearless')
artist = Artist(name='Taylor Swift')
genre = Genre(genrename='Pop')
song = Song(songtitle='Love Stroy',album=album,artist=artist,genre=genre,track='3',length='3:55')
return song
#test string
def test_string(self):
son = self.setUp()
self.assertEqual(str(son), son.songtitle)
def test_album(self):
son = self.setUp()
self.assertEqual(str(son.album),'Fearless')
def test_artist(self):
son = self.setUp()
self.assertEqual(str(son.artist),'Taylor Swift')
def test_genre(self):
son = self.setUp()
self.assertEqual(str(son.genre),'Pop')
def test_track(self):
son = self.setUp()
self.assertEqual(str(son.track),'3')
def test_length(self):
son = self.setUp()
self.assertEqual(str(son.length),'3:55')
# test Song table.
def test_table(self):
self.assertEqual(str(Song._meta.db_table), 'song')
# ================== SongReview Model ========================
class SongReviewTest(TestCase):
def setUp(self):
song = Song(songtitle='Love Stroy')
sr = SongReview(song=song, rating='10', reviews='Good song!')
return sr
#test string
def test_string(self):
sr = self.setUp()
self.assertEqual(str(sr), sr.reviews)
def test_song(self):
sr = self.setUp()
self.assertEqual(str(sr.song),'Love Stroy')
def test_postby(self):
song = Song(songtitle='Love Stroy')
user = User.objects.create(username='User001')
sr = SongReview(song=song, postby=user,rating='10', reviews='Good song!')
self.assertEqual(str(sr.postby),'User001')
def test_reviews(self):
sr = self.setUp()
self.assertEqual(str(sr.reviews),'Good song!')
# test SongReview table.
def test_table(self):
self.assertEqual(str(SongReview._meta.db_table), 'songreview')
# ================== View_url Test ========================
class IndexTest(TestCase):
def test_view_url_accessible_by_name(self):
response=self.client.get(reverse('index'))
self.assertEqual(response.status_code, 200)
class ArtistViewTest(TestCase):
def test_view_url_accessible_by_name(self):
response=self.client.get(reverse('artist'))
self.assertEqual(response.status_code, 200)
class AlbumViewTest(TestCase):
def test_view_url_accessible_by_name(self):
response=self.client.get(reverse('album'))
self.assertEqual(response.status_code, 200)
class SongViewTest(TestCase):
def test_view_url_accessible_by_name(self):
response=self.client.get(reverse('song'))
self.assertEqual(response.status_code, 200)
class SongList_SongReview_ViewTest(TestCase):
def setUp(self):
self.u = User.objects.create(username='User001')
self.genre = Genre.objects.create(genrename='Pop')
self.artist = Artist.objects.create(name='Taylor Swift',born='1989-12-31',url='https://en.wikipedia.org/wiki/Taylor_Swift',
description='Taylor Alison Swift is an American singer-songwriter.')
self.album = Album.objects.create(albumtitle='Fearless',artist=self.artist,releasedate='2008-11-11')
self.song = Song.objects.create(songtitle='Love Stroy',album=self.album,artist=self.artist,genre=self.genre,track='3',length='5:20')
self.songreview = SongReview.objects.create(song=self.song, postby=self.u,rating='10', reviews='Good song!')
def test_album_list_success(self):
response = self.client.get(reverse('albumlist', args=(self.album.id,)))
self.assertEqual(response.status_code, 200)
def test_review_list_success(self):
response = self.client.get(reverse('songreview', args=(self.song.id,)))
self.assertEqual(response.status_code, 200)
def test_artist_song_list_success(self):
response = self.client.get(reverse('artistsong', args=(self.artist.id,)))
self.assertEqual(response.status_code, 200)
class New_Genre_authentication_test(TestCase):
def setUp(self):
self.test_user=User.objects.create_user(username='testuser1', password='P@ssw0rd1')
self.gen = Genre(genrename='Pop')
def test_redirect_if_not_logged_in(self):
response=self.client.get(reverse('newgenre'))
self.assertRedirects(response, '/accounts/login/?next=/Music/newGenre/')
def test_Logged_in_uses_correct_template(self):
login=self.client.login(username='testuser1', password='P@ssw0rd1')
response=self.client.get(reverse('newgenre'))
self.assertEqual(str(response.context['user']), 'testuser1')
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'Music/newGenre.html')
class New_Artist_authentication_test(TestCase):
def setUp(self):
self.test_user=User.objects.create_user(username='testuser1', password='P@ssw0rd1')
self.artist = Artist(name='Taylor Swift',born='1989-12-31',url='https://en.wikipedia.org/wiki/Taylor_Swift',
description='Taylor Alison Swift is an American singer-songwriter.')
def test_redirect_if_not_logged_in(self):
response=self.client.get(reverse('newartist'))
self.assertRedirects(response, '/accounts/login/?next=/Music/newArtist/')
def test_Logged_in_uses_correct_template(self):
login=self.client.login(username='testuser1', password='P@ssw0rd1')
response=self.client.get(reverse('newartist'))
self.assertEqual(str(response.context['user']), 'testuser1')
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'Music/newArtist.html')
class New_Album_authentication_test(TestCase):
def setUp(self):
self.test_user=User.objects.create_user(username='testuser1', password='P@ssw0rd1')
self.artist = Artist(name='Taylor Swift')
self.album = Album(albumtitle='Fearless',artist=self.artist,releasedate='2008-11-11')
def test_redirect_if_not_logged_in(self):
response=self.client.get(reverse('newalbum'))
self.assertRedirects(response, '/accounts/login/?next=/Music/newAlbum/')
def test_Logged_in_uses_correct_template(self):
login=self.client.login(username='testuser1', password='P@ssw0rd1')
response=self.client.get(reverse('newalbum'))
self.assertEqual(str(response.context['user']), 'testuser1')
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'Music/newAlbum.html')
class New_Song_authentication_test(TestCase):
def setUp(self):
self.test_user=User.objects.create_user(username='testuser1', password='P@ssw0rd1')
self.album = Album(albumtitle='Fearless')
self.artist = Artist(name='Taylor Swift')
self.genre = Genre(genrename='Pop')
self.song = Song(songtitle='Love Stroy',album=self.album,artist=self.artist,genre=self.genre,track='3',length='5:20')
def test_redirect_if_not_logged_in(self):
response=self.client.get(reverse('newsong'))
self.assertRedirects(response, '/accounts/login/?next=/Music/newSong/')
def test_Logged_in_uses_correct_template(self):
login=self.client.login(username='testuser1', password='P@ssw0rd1')
response=self.client.get(reverse('newsong'))
self.assertEqual(str(response.context['user']), 'testuser1')
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'Music/newSong.html')
class New_SongReview_authentication_test(TestCase):
def setUp(self):
self.test_user=User.objects.create_user(username='testuser1', password='P@ssw0rd1')
self.song = Song(songtitle='Love Stroy')
self.songreview = SongReview(song=self.song, postby=self.test_user,rating='10', reviews='Good song!')
def test_redirect_if_not_logged_in(self):
response=self.client.get(reverse('newsongreview'))
self.assertRedirects(response, '/accounts/login/?next=/Music/newSongReview/')
def test_Logged_in_uses_correct_template(self):
login=self.client.login(username='testuser1', password='P@ssw0rd1')
response=self.client.get(reverse('newsongreview'))
self.assertEqual(str(response.context['user']), 'testuser1')
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'Music/newSongReview.html')
# ================== Form Test ========================
class Genre_Form_Test(TestCase):
def test_genre_form_is_valid(self):
form = GenreForm(data={'genrename':"Pop"})
self.assertTrue(form.is_valid())
def test_genre_form_empty(self):
form = GenreForm(data={'genrename':""})
self.assertFalse(form.is_valid())
class Artist_Form_Test(TestCase):
def test_artist_form_is_valid(self):
form = ArtistForm(data={'name':"Taylor Swift",'born':"1989-12-31",'url':"https://en.wikipedia.org/wiki/Taylor_Swift",
'description':"Taylor Alison Swift is an American singer-songwriter."})
self.assertTrue(form.is_valid())
def test_artist_form_minus_url(self):
form = ArtistForm(data={'name':"Taylor Swift",'born':"1989-12-31",'description':"Taylor Alison Swift is an American singer-songwriter."})
self.assertTrue(form.is_valid())
def test_artist_form_minus_description(self):
form = ArtistForm(data={'name':"Taylor Swift",'born':"1989-12-31",'url':"https://en.wikipedia.org/wiki/Taylor_Swift"})
self.assertTrue(form.is_valid())
def test_artist_form_empty(self):
form = ArtistForm(data={'name':""})
self.assertFalse(form.is_valid())
class Album_Form_Test(TestCase):
def test_album_form_is_valid(self):
self.artist = Artist.objects.create(name='Taylor Swift',born='1989-12-31',url='https://en.wikipedia.org/wiki/Taylor_Swift',
description='Taylor Alison Swift is an American singer-songwriter.')
form = AlbumForm(data={'albumtitle':"Fearless",'artist':self.artist,'releasedate':"2008-11-11"})
self.assertTrue(form.is_valid())
def test_album_form_empty(self):
form = AlbumForm(data={'albumtitle':""})
self.assertFalse(form.is_valid())
class Song_Form_Test(TestCase):
def test_song_form_is_valid(self):
self.genre = Genre.objects.create(genrename='Pop')
self.artist = Artist.objects.create(name='Taylor Swift',born='1989-12-31',url='https://en.wikipedia.org/wiki/Taylor_Swift',
description='Taylor Alison Swift is an American singer-songwriter.')
self.album = Album.objects.create(albumtitle='Fearless',artist=self.artist,releasedate='2008-11-11')
form = SongForm(data={'songtitle':"Love Story",'album':self.album,'artist':self.artist,'genre':self.genre,'track':"3",'length':"5:20"})
self.assertTrue(form.is_valid())
def test_song_form_minus_track(self):
self.genre = Genre.objects.create(genrename='Pop')
self.artist = Artist.objects.create(name='Taylor Swift',born='1989-12-31',url='https://en.wikipedia.org/wiki/Taylor_Swift',
description='Taylor Alison Swift is an American singer-songwriter.')
self.album = Album.objects.create(albumtitle='Fearless',artist=self.artist,releasedate='2008-11-11')
form = SongForm(data={'songtitle':"Love Story",'album':self.album,'artist':self.artist,'genre':self.genre,'length':"5:20"})
self.assertTrue(form.is_valid())
def test_song_form_minus_length(self):
self.genre = Genre.objects.create(genrename='Pop')
self.artist = Artist.objects.create(name='Taylor Swift',born='1989-12-31',url='https://en.wikipedia.org/wiki/Taylor_Swift',
description='Taylor Alison Swift is an American singer-songwriter.')
self.album = Album.objects.create(albumtitle='Fearless',artist=self.artist,releasedate='2008-11-11')
form = SongForm(data={'songtitle':"Love Story",'album':self.album,'artist':self.artist,'genre':self.genre,'track':"3"})
self.assertTrue(form.is_valid())
def test_song_form_empty(self):
form = SongForm(data={'songtitle':""})
self.assertFalse(form.is_valid())
class SongReview_Form_Test(TestCase):
def test_song_review_form_is_valid(self):
self.test_user=User.objects.create_user(username='testuser1', password='P@ssw0rd1')
self.genre = Genre.objects.create(genrename='Pop')
self.artist = Artist.objects.create(name='Taylor Swift',born='1989-12-31',url='https://en.wikipedia.org/wiki/Taylor_Swift',
description='Taylor Alison Swift is an American singer-songwriter.')
self.album = Album.objects.create(albumtitle='Fearless',artist=self.artist,releasedate='2008-11-11')
self.song = Song.objects.create(songtitle='Love Stroy',album=self.album,artist=self.artist,genre=self.genre,track='3',length='5:20')
form = SongReviewForm(data={'song':self.song,'postby':self.test_user,'rating':"10",'reviews':"Good song!"})
self.assertTrue(form.is_valid())
def test_song_review_form_empty(self):
form = SongReviewForm(data={'reviews':""})
self.assertFalse(form.is_valid())
| 42.445652
| 143
| 0.675288
| 1,958
| 15,620
| 5.262002
| 0.07712
| 0.036688
| 0.048918
| 0.0396
| 0.826749
| 0.771038
| 0.720567
| 0.652431
| 0.557022
| 0.523634
| 0
| 0.022117
| 0.163444
| 15,620
| 368
| 144
| 42.445652
| 0.766358
| 0.03694
| 0
| 0.514815
| 0
| 0
| 0.185691
| 0.014576
| 0
| 0
| 0
| 0
| 0.237037
| 1
| 0.240741
| false
| 0.040741
| 0.018519
| 0
| 0.351852
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
aca69dfe476764a1dcf08a1e2ba90caf76fa27f0
| 69
|
py
|
Python
|
test.py
|
axetrades/testnew
|
e8586f6570c5aca69f2fed6d916733c77e384a78
|
[
"Apache-2.0"
] | null | null | null |
test.py
|
axetrades/testnew
|
e8586f6570c5aca69f2fed6d916733c77e384a78
|
[
"Apache-2.0"
] | null | null | null |
test.py
|
axetrades/testnew
|
e8586f6570c5aca69f2fed6d916733c77e384a78
|
[
"Apache-2.0"
] | null | null | null |
import yfinance as yf
ticker = yf.Ticker("AAPL")
print(ticker.info)
| 13.8
| 26
| 0.73913
| 11
| 69
| 4.636364
| 0.727273
| 0.313725
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130435
| 69
| 5
| 27
| 13.8
| 0.85
| 0
| 0
| 0
| 0
| 0
| 0.057143
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
acac4bfb0ac46e8083b8b2e050fc9f839ca0e09a
| 3,697
|
py
|
Python
|
cv19gm/utils/cv19errors.py
|
DLab/covid19geomodeller
|
a3a9eedf064078b21be0928ee41b41c902938eff
|
[
"MIT"
] | null | null | null |
cv19gm/utils/cv19errors.py
|
DLab/covid19geomodeller
|
a3a9eedf064078b21be0928ee41b41c902938eff
|
[
"MIT"
] | null | null | null |
cv19gm/utils/cv19errors.py
|
DLab/covid19geomodeller
|
a3a9eedf064078b21be0928ee41b41c902938eff
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
"""
# -------------------------------- #
# Error measuring functions #
# -------------------------------- #
"""
def cv19errorbuild(input):
"""
Function builder
# crear un iterador que recorra el input y cree la función a partir de un comando exec:
# Acepta diccionarios o strings con forma de diccionario
"""
if callable(input):
return input
elif type(input)==str:
print('input dict')
return locals()[input]
# -------------------------------- #
# Global Errors #
# -------------------------------- #
def ITWE(sim, data, t_data=None, rho=1):
# Inverse time weighted error
if type(t_data) == type(None):
t_data = list(range(len(data)))
err = [((data[i] - sim[t_data[i]]) ** 2) / (1 + t_data[i]) ** rho for i in range(len(data))]
return np.sqrt(np.mean(np.array(err) ** 2))
def ITWE_log(sim, data, t_data=None, rho=1):
# Log Inverse time weighted error
if type(t_data) == type(None):
t_data = list(range(len(data)))
err = [((np.log(data[i]+1) - np.log(sim[t_data[i]]+1)) ** 2) / (1 + t_data[i]) ** rho for i in range(len(data))]
return np.sqrt(np.mean(np.array(err) ** 2))
def RMSE(sim, data, t_data=None, rho=None):
# Root Mean Squared Error
if type(t_data) == type(None):
t_data = list(range(len(data)))
err = [((data[i] - sim[t_data[i]]) ** 2) / (1) for i in range(len(data))]
return np.sqrt(np.mean(np.array(err) ** 2))
def MSE(sim, data, t_data=None, ):
# Mean Square Error
if type(t_data) == type(None):
t_data = list(range(len(data)))
err = [((data[i] - sim[t_data[i]]) ** 2) / (1) for i in range(len(data))]
return np.mean(np.array(err) ** 2)
def RRMSE(sim, data, t_data=None):
# Relative Root Mean Square Error
if type(t_data) == type(None):
t_data = list(range(len(data)))
err = [((data[i] - sim[t_data[i]]) ** 2) / (1 + data[i]) for i in range(len(data))]
return np.sqrt(np.mean(np.array(err) ** 2))
# -------------------------------- #
# Residual Metrics #
# -------------------------------- #
def LAE(sim, data, t_data=None):
# Local Absolute Error. Output is a vector
if type(t_data) == type(None):
t_data = list(range(len(data)))
return [np.abs(data[i] - sim[t_data[i]]) for i in range(len(data))]
def LRAE(sim, data, t_data=None):
# Local Relative Error. Output is a vector
if type(t_data) == type(None):
t_data = list(range(len(data)))
return [(np.abs(data[i] - sim[t_data[i]])) / (1 + data[i]) for i in range(len(data))]
def LCE(sim, data, t_data=None):
"""Local Cummulative Error
To do
Args:
sim (list): Simulation data
data (list): Data to compare
t_data (list, optional): _description_. Defaults to None.
Returns:
list: accumulative error
"""
# Local Integrative Error. Output is a vector
if type(t_data) == type(None):
t_data = list(range(len(data)))
return np.cumsum([data[i] - sim[t_data[i]] for i in range(len(data))])
def LRCE(sim, data, t_data=None):
"""Local Relative Cummulative Error
To do
Args:
sim (list): Simulation data
data (list): Data to compare
t_data (list, optional): _description_. Defaults to None.
Returns:
list: accumulative error
"""
# Local Integrative Error. Output is a vector
if type(t_data) == type(None):
t_data = list(range(len(data)))
return np.cumsum([(data[i] - sim[t_data[i]]) / (1 + data[i]) for i in range(len(data))])
| 32.429825
| 116
| 0.550176
| 545
| 3,697
| 3.649541
| 0.194495
| 0.100553
| 0.108597
| 0.054299
| 0.790347
| 0.769231
| 0.738562
| 0.680241
| 0.680241
| 0.676219
| 0
| 0.008922
| 0.242088
| 3,697
| 114
| 117
| 32.429825
| 0.700928
| 0.305112
| 0
| 0.5
| 0
| 0
| 0.004292
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.208333
| false
| 0
| 0.020833
| 0
| 0.458333
| 0.020833
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
acc0c0858ef358cc9dc45678e223dd39761be7ae
| 2,109
|
py
|
Python
|
python3/base/os.py
|
shuguoqing123/code_store
|
32b867d1980c52b352b8c3af8d50c1534ff5b644
|
[
"MIT"
] | null | null | null |
python3/base/os.py
|
shuguoqing123/code_store
|
32b867d1980c52b352b8c3af8d50c1534ff5b644
|
[
"MIT"
] | null | null | null |
python3/base/os.py
|
shuguoqing123/code_store
|
32b867d1980c52b352b8c3af8d50c1534ff5b644
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
#-*-coding:utf-8-*-
'''
不同操作系统底层实现不同,文件系统不同
os模块可以帮助我们屏蔽操作系统的差异
'''
import os
print(os.getcwd())#返回当前目录,脚本所在目录
os.chdir('/home/shuguoqing')#改变工作目录,相当于cd命令
print(os.getcwd())#工作目录被改变
print(os.listdir('.'))#列出目录下所有文件和目录
os.mkdir('new')#在工作目录下新建一个目录
os.makedirs('new/a/b')#在工作目录下新建多层目录
os.chdir('new/a/b')
f = open('test.txt','w')#在工作目录下新建txt文件
os.rename('test.txt','test1.txt')#重命名文件
os.remove('test1.txt')#删除文件
os.chdir('../')
os.rmdir('b')#删除非空目录,里面有子目录和文件都会抛出异常
os.chdir('../../')
os.removedirs('new/a')#从子目录开始,往回递归逐层删除多层目录,有子目录和文件抛出异常
os.system('ls -l /home/shuguoqing/workspace/code_store/python3/base')#执行shell命令
print(os.curdir)#常量,当前目录符
print(os.pardir)#常量,上级目录符
print(os.sep)#常量,路径分隔符,windows下为'\\',linux下为'/'
print(os.linesep)#常量,当前系统的换行符
print(os.name)#常量,系统名,linux为'posix',windows为'nt'
print(os.path.basename('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#去掉路径,保留文件名
print(os.path.dirname('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#去掉文件名,保留路径
print(os.path.join('/home/shuguoqing','workspace/code_store','python3/base'))#拼接路径
print(os.path.split('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#分割文件路径的路径和文件名,返回元组
print(os.path.splitext('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#分割文件的文件名和后缀,返回元组
print(os.path.getsize('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#获取文件大小,单位字节
import time
print(time.localtime(os.path.getctime('/home/shuguoqing/workspace/code_store/python3/base/os.py')))#获取文件创建时间
print(time.localtime(os.path.getatime('/home/shuguoqing/workspace/code_store/python3/base/os.py')))#获取文件访问时间
print(time.localtime(os.path.getmtime('/home/shuguoqing/workspace/code_store/python3/base/os.py')))#获取文件修改时间
print(os.path.exists('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#判断是否存在文件
print(os.path.isabs('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#判断是否是绝对路径
print(os.path.isdir('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#判断是否是目录
print(os.path.isfile('/home/shuguoqing/workspace/code_store/python3/base/os.py'))#判断是否是文件
| 32.953125
| 108
| 0.764817
| 316
| 2,109
| 5.060127
| 0.341772
| 0.078799
| 0.201376
| 0.236398
| 0.451532
| 0.406504
| 0.406504
| 0.35272
| 0.35272
| 0
| 0
| 0.008828
| 0.033191
| 2,109
| 63
| 109
| 33.47619
| 0.77538
| 0.213371
| 0
| 0.057143
| 0
| 0
| 0.533499
| 0.447891
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.057143
| 0
| 0.057143
| 0.6
| 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
| 1
|
0
| 4
|
acdbdf75290ee1fc9a941b69225170e8498381d2
| 75,885
|
py
|
Python
|
sfa_api/conftest.py
|
SolarArbiter/solarforecastarbiter-api
|
280800c73eb7cfd49029462b352887e78f1ff91b
|
[
"MIT"
] | 7
|
2018-12-07T22:05:36.000Z
|
2020-05-03T03:20:50.000Z
|
sfa_api/conftest.py
|
SolarArbiter/solarforecastarbiter-api
|
280800c73eb7cfd49029462b352887e78f1ff91b
|
[
"MIT"
] | 220
|
2018-11-01T23:33:19.000Z
|
2021-12-02T21:06:38.000Z
|
sfa_api/conftest.py
|
SolarArbiter/solarforecastarbiter-api
|
280800c73eb7cfd49029462b352887e78f1ff91b
|
[
"MIT"
] | 3
|
2018-10-31T20:55:07.000Z
|
2021-11-10T22:51:43.000Z
|
from contextlib import contextmanager
import datetime as dt
from functools import partial
from io import StringIO
import json
from flask import _request_ctx_stack
import numpy as np
import pandas as pd
import pymysql
import pytest
import pytz
import requests
from sfa_api import create_app
from sfa_api.utils import storage_interface
from sfa_api.schema import (
VARIABLES, ALLOWED_INTERVAL_VALUE_TYPES, ALLOWED_INTERVAL_LABELS,
ALLOWED_AGGREGATE_TYPES)
BASE_URL = 'https://localhost'
# Strings of formatted field options for error checking
# e.g. provides "interval_mean, instantaneous, ..." so
# f'Must be one of: {interval_value_types}.' can be checked
# against the errors returned from marshmallow
variables = ', '.join(VARIABLES)
agg_types = ', '.join(ALLOWED_AGGREGATE_TYPES)
interval_value_types = ', '.join(ALLOWED_INTERVAL_VALUE_TYPES)
interval_labels = ', '.join(ALLOWED_INTERVAL_LABELS)
VALID_SITE_JSON = {
"elevation": 500.0,
"extra_parameters": '{"parameter": "value"}',
"latitude": 42.19,
"longitude": -122.7,
"modeling_parameters": {
"ac_capacity": 0.015,
"dc_capacity": 0.015,
"ac_loss_factor": 0,
"dc_loss_factor": 0,
"temperature_coefficient": -.2,
"surface_azimuth": 180.0,
"surface_tilt": 45.0,
"tracking_type": "fixed"
},
"name": "Test Site",
"timezone": "Etc/GMT+8",
}
VALID_FORECAST_JSON = {
"extra_parameters": '{"instrument": "pyranometer"}',
"name": "test forecast",
"site_id": "123e4567-e89b-12d3-a456-426655440001",
"variable": "ghi",
"interval_label": "beginning",
"issue_time_of_day": "12:00",
"lead_time_to_start": 60,
"interval_length": 5,
"run_length": 1440,
"interval_value_type": "interval_mean",
}
VALID_FORECAST_AGG_JSON = {
"extra_parameters": '{"instrument": "pyranometer"}',
"name": "test forecast",
"aggregate_id": '458ffc27-df0b-11e9-b622-62adb5fd6af0',
"variable": "ghi",
"interval_label": "beginning",
"issue_time_of_day": "12:00",
"lead_time_to_start": 60,
"interval_length": 5,
"run_length": 1440,
"interval_value_type": "interval_mean",
}
VALID_OBS_JSON = {
"extra_parameters": '{"instrument": "Ascension Technology Rotating Shadowband Pyranometer"}', # NOQA
"name": "Weather Station, ghi",
"site_id": "123e4567-e89b-12d3-a456-426655440001",
"variable": "ghi",
"interval_label": "beginning",
"interval_length": 5,
"interval_value_type": "interval_mean",
"uncertainty": 0.10,
}
VALID_CDF_FORECAST_JSON = VALID_FORECAST_JSON.copy()
VALID_CDF_FORECAST_JSON.update({
"name": 'test cdf forecast',
"axis": 'x',
"constant_values": [5.0, 20.0, 50.0, 80.0, 95.0]
})
VALID_CDF_FORECAST_AGG_JSON = VALID_FORECAST_AGG_JSON.copy()
VALID_CDF_FORECAST_AGG_JSON.update({
"name": 'test cdf forecast',
"axis": 'x',
"constant_values": [10.0, 20.0, 50.0, 80.0, 100.0]
})
VALID_AGG_JSON = {
"name": "Test Aggregate ghi",
"variable": "ghi",
"interval_label": "ending",
"interval_length": 60,
"aggregate_type": "sum",
"extra_parameters": "extra",
"description": "ghi agg",
"timezone": "America/Denver"
}
VALID_OBS_VALUE_JSON = {
'id': '123e4567-e89b-12d3-a456-426655440000',
'values': [
{'quality_flag': 0,
'timestamp': "2019-01-22T17:54:00Z",
'value': 1.0},
{'quality_flag': 0,
'timestamp': "2019-01-22T17:59:00Z",
'value': 32.0},
{'quality_flag': 0,
'timestamp': "2019-01-22T18:04:00Z",
'value': 3.0}
]
}
VALID_OBS_VALUE_CSV = (
'# observation_id: 123e4567-e89b-12d3-a456-426655440000\n'
'# metadata: https://localhost/observations/123e4567-e89b-12d3-a456-426655440000/metadata\n' # NOQA
'timestamp,value,quality_flag\n'
'20190122T12:05:00+0000,52.0,0\n'
'20190122T12:10:00+0000,73.0,0\n'
'20190122T12:15:00+0000,42.0,0\n'
'20190122T12:20:00+0000,12.0,0\n')
VALID_FX_VALUE_JSON = {
'id': '123e4567-e89b-12d3-a456-426655440000',
'values': [
{'timestamp': "2019-01-22T17:54:00Z",
'value': 1.0},
{'timestamp': "2019-01-22T17:59:00Z",
'value': 32.0},
{'timestamp': "2019-01-22T18:04:00Z",
'value': 3.0}
]
}
ADJ_FX_VALUE_JSON = {
'id': '123e4567-e89b-12d3-a456-426655440000',
'values': [
{'timestamp': "2019-11-01T07:00:00Z",
'value': 1.0},
{'timestamp': "2019-11-01T07:05:00Z",
'value': 32.0},
{'timestamp': "2019-11-01T07:10:00Z",
'value': 3.0}
]
}
UNSORTED_FX_VALUE_JSON = {
'id': '123e4567-e89b-12d3-a456-426655440000',
'values': [
{'timestamp': "2019-01-22T17:59:00Z",
'value': 32.0},
{'timestamp': "2019-01-22T17:54:00Z",
'value': 1.0},
{'timestamp': "2019-01-22T18:04:00Z",
'value': 3.0}
]
}
FORECAST_CSV = (
'timestamp,value\n'
'20190122T12:05:00+0000,7.0\n'
'20190122T12:10:00+0000,3.0\n'
'20190122T12:15:00+0000,13.0\n'
'20190122T12:20:00+0000,25.0\n')
VALID_FX_VALUE_CSV = (
'# forecast_id: 11c20780-76ae-4b11-bef1-7a75bdc784e3\n'
'# metadata: https://localhost/forecasts/single/11c20780-76ae-4b11-bef1-7a75bdc784e3/metadata\n' # NOQA
f'{FORECAST_CSV}')
VALID_CDF_VALUE_CSV = (
'# forecast_id: 633f9396-50bb-11e9-8647-d663bd873d93\n'
'# metadata: https://localhost/forecasts/cdf/single/633f9396-50bb-11e9-8647-d663bd873d93\n' # NOQA
f'{FORECAST_CSV}')
ROLE = {
"name": "test created role",
"description": "testing role creation",
}
PERMISSION = {
"action": "read",
"applies_to_all": False,
"description": "test created permission",
"object_type": "observations",
}
@pytest.fixture()
def report_post_json():
return {
'report_parameters': {
'name': 'NREL MIDC OASIS GHI Forecast Analysis',
'start': "2019-04-01T07:00:00Z",
'end': '2019-06-01T06:59:00Z',
'metrics': ['mae', 'rmse'],
'filters': [
{'quality_flags': ['USER FLAGGED']}
],
'categories': [
'total',
'date'
],
'object_pairs': [
{
'observation': '123e4567-e89b-12d3-a456-426655440000',
'forecast': '11c20780-76ae-4b11-bef1-7a75bdc784e3'
}
]
}
}
@pytest.fixture()
def report_json_w_cdf(cdf_forecast_group_id, cdf_forecast_id,
report_post_json):
rpj = report_post_json.copy()
rpj['report_parameters']['object_pairs'] = [
{
'observation': '123e4567-e89b-12d3-a456-426655440000',
'forecast': '11c20780-76ae-4b11-bef1-7a75bdc784e3'
},
{
'observation': '123e4567-e89b-12d3-a456-426655440000',
'forecast_type': 'probabilistic_forecast',
'forecast': cdf_forecast_group_id
},
{
'observation': '123e4567-e89b-12d3-a456-426655440000',
'forecast_type': 'probabilistic_forecast_constant_value',
'forecast': cdf_forecast_id
}
]
return rpj
@pytest.fixture()
def report_parameters(report_post_json):
out = report_post_json['report_parameters'].copy()
out['start'] = dt.datetime(2019, 4, 1, 7,
tzinfo=pytz.utc)
out['end'] = dt.datetime(2019, 6, 1, 6, 59,
tzinfo=pytz.utc)
return out
@pytest.fixture()
def raw_report_json():
return {
'generated_at': '2019-07-01T12:00:00+00:00',
'timezone': 'Etc/GMT+8',
'versions': [],
'plots': None,
'metrics': [],
'processed_forecasts_observations': [],
'messages': [{'step': 'dunno', 'level': 'error',
'message': 'FAILED', 'function': 'fcn'}],
'data_checksum': None
}
@pytest.fixture()
def reportid():
return '9f290dd4-42b8-11ea-abdf-f4939feddd82'
@pytest.fixture()
def report_values():
values = {
'object_id': '123e4567-e89b-12d3-a456-426655440000',
'processed_values': 'superencodedvalues'
}
return values
@pytest.fixture()
def report_value_id():
return 'a2b6ed14-42d0-11ea-aa3c-f4939feddd82'
@pytest.fixture()
def report(report_parameters, raw_report_json, reportid, report_values,
report_value_id):
rv = report_values.copy()
rv['id'] = report_value_id
out = {
'report_parameters': report_parameters,
'name': report_parameters['name'],
'report_id': reportid,
'provider': 'Organization 1',
'created_at': dt.datetime(2020, 1, 22, 13, 48, tzinfo=pytz.utc),
'modified_at': dt.datetime(2020, 1, 22, 13, 50,
tzinfo=pytz.utc),
'raw_report': raw_report_json,
'status': 'failed',
'values': [rv],
'outages': []
}
out['raw_report']['generated_at'] = dt.datetime(2019, 7, 1, 12,
tzinfo=pytz.utc)
return out
def copy_update(json, key, value):
new_json = json.copy()
new_json[key] = value
return new_json
@pytest.fixture()
def user_id():
return '0c90950a-7cca-11e9-a81f-54bf64606445'
@pytest.fixture()
def auth0id():
return 'auth0|5be343df7025406237820b85'
@pytest.fixture()
def user_email():
return 'testing@solarforecastarbiter.org'
@pytest.fixture()
def external_userid():
return '4b436bee-8245-11e9-a81f-54bf64606445'
@pytest.fixture()
def external_auth0id():
return 'auth0|5ceed7c8a1536b1103699501'
# User id of a permission-less unaffiliated user.
@pytest.fixture()
def unaffiliated_userid():
return 'ef026b76-c049-11e9-9c7e-0242ac120002'
@contextmanager
def _make_sql_app():
app = create_app('TestingConfig')
with app.app_context():
try:
storage_interface.mysql_connection()
except pymysql.err.OperationalError:
pytest.skip('No connection to test database')
else:
yield app
@pytest.fixture(scope='module')
def sql_app():
with _make_sql_app() as app:
yield app
@pytest.fixture()
def sql_app_no_commit(mocker):
with _make_sql_app() as app:
with _make_nocommit_cursor(mocker):
yield app
@pytest.fixture()
def sql_api(sql_app, mocker):
return sql_app.test_client()
@pytest.fixture()
def sql_api_unauthenticated(sql_app, mocker):
return sql_app.test_client()
@contextmanager
def _make_nocommit_cursor(mocker):
# on release of a Pool connection, any transaction is rolled back
# need to keep the transaction open between nocommit tests
conn = storage_interface._make_sql_connection_partial()()
mocker.patch.object(conn, 'close')
mocker.patch('sfa_api.utils.storage_interface.mysql_connection',
return_value=conn)
special = partial(storage_interface.get_cursor, commit=False)
mocker.patch('sfa_api.utils.storage_interface.get_cursor', special)
yield conn.cursor()
conn.rollback()
@pytest.fixture()
def nocommit_cursor(mocker, sql_app):
with _make_nocommit_cursor(mocker) as cursor:
yield cursor
@pytest.fixture(scope='session')
def auth_token():
token_req = requests.post(
'https://solarforecastarbiter.auth0.com/oauth/token',
headers={'content-type': 'application/json'},
data=('{"grant_type": "password", '
'"username": "testing@solarforecastarbiter.org",'
'"password": "Thepassword123!", '
'"audience": "https://api.solarforecastarbiter.org", '
'"client_id": "c16EJo48lbTCQEhqSztGGlmxxxmZ4zX7"}'))
if token_req.status_code != 200:
pytest.skip('Cannot retrieve valid Auth0 token')
else:
token = token_req.json()['access_token']
return token
@pytest.fixture()
def user(sql_app):
ctx = sql_app.test_request_context()
ctx.user = 'auth0|5be343df7025406237820b85'
ctx.push()
yield
ctx.pop()
@pytest.fixture()
def invalid_user(sql_app):
ctx = sql_app.test_request_context()
ctx.user = 'bad'
ctx.push()
yield
ctx.pop()
@pytest.fixture()
def app(mocker):
with _make_sql_app() as sql_app:
with _make_nocommit_cursor(mocker):
yield sql_app
@pytest.fixture()
def api(app, mocker):
def add_user():
_request_ctx_stack.top.user = 'auth0|5be343df7025406237820b85'
return True
verify = mocker.patch('sfa_api.utils.auth.verify_access_token')
verify.side_effect = add_user
yield app.test_client()
@pytest.fixture()
def missing_id():
return '7d2c3208-5243-11e9-8647-d663bd873d93'
@pytest.fixture()
def observation_id():
return '123e4567-e89b-12d3-a456-426655440000'
@pytest.fixture()
def cdf_forecast_group_id():
return 'ef51e87c-50b9-11e9-8647-d663bd873d93'
@pytest.fixture()
def cdf_forecast_id():
return '633f9396-50bb-11e9-8647-d663bd873d93'
@pytest.fixture()
def forecast_id():
return '11c20780-76ae-4b11-bef1-7a75bdc784e3'
# Forecast provided by 'Forecast Provider A', but test user does not
# have access to it.
@pytest.fixture()
def inaccessible_forecast_id():
return 'd0dd64fc-8250-11e9-a81f-54bf64606445'
@pytest.fixture()
def site_id():
return 'd2018f1d-82b1-422a-8ec4-4e8b3fe92a4a'
@pytest.fixture()
def site_id_plant():
return '123e4567-e89b-12d3-a456-426655440002'
@pytest.fixture()
def aggregate_id():
return '458ffc27-df0b-11e9-b622-62adb5fd6af0'
@pytest.fixture()
def orgid():
return 'b76ab62e-4fe1-11e9-9e44-64006a511e6f'
@pytest.fixture()
def userid():
return '0c90950a-7cca-11e9-a81f-54bf64606445'
@pytest.fixture()
def jobid():
return '907a9340-0b11-11ea-9e88-f4939feddd82'
@pytest.fixture()
def mocked_queuing(mocker):
mocked = mocker.patch('rq.Queue.enqueue',
autospec=True)
yield mocked
assert mocked.called
@pytest.fixture()
def mock_previous(mocker):
meta = mocker.MagicMock()
mocker.patch(
'sfa_api.utils.storage_interface._set_previous_time',
new=meta)
meta.return_value = None
return meta
@pytest.fixture()
def restrict_fx_upload(mocker):
mocker.patch(
'sfa_api.utils.storage_interface._set_extra_params',
return_value='{"restrict_upload": true}')
cut = mocker.patch(
'sfa_api.utils.request_handling._current_utc_timestamp',
)
return cut
demo_sites = {
'123e4567-e89b-12d3-a456-426655440001': {
"elevation": 595.0,
"extra_parameters": (
'{"network_api_abbreviation": "AS","network": "University of Oregon SRML","network_api_id": "94040"}' # NOQA
),
"latitude": 42.19,
"longitude": -122.7,
"modeling_parameters": {
"ac_capacity": None,
"ac_loss_factor": None,
"axis_azimuth": None,
"axis_tilt": None,
"backtrack": None,
"dc_capacity": None,
"dc_loss_factor": None,
"ground_coverage_ratio": None,
"max_rotation_angle": None,
"surface_azimuth": None,
"surface_tilt": None,
"temperature_coefficient": None,
"tracking_type": None
},
"name": "Weather Station",
"provider": "Organization 1",
"timezone": "Etc/GMT+8",
"site_id": '123e4567-e89b-12d3-a456-426655440001',
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 44, 38)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 44, 38)),
"climate_zones": ["Reference Region 2"]
},
'd2018f1d-82b1-422a-8ec4-4e8b3fe92a4a': {
"elevation": 786.0,
"extra_parameters": '{"network": "NREL MIDC"}',
"latitude": 32.22969,
"longitude": -110.95534,
"modeling_parameters": {
"ac_capacity": None,
"ac_loss_factor": None,
"axis_azimuth": None,
"axis_tilt": None,
"backtrack": None,
"dc_capacity": None,
"dc_loss_factor": None,
"ground_coverage_ratio": None,
"max_rotation_angle": None,
"surface_azimuth": None,
"surface_tilt": None,
"temperature_coefficient": None,
"tracking_type": None
},
"name": "Weather Station 1",
"provider": "Organization 1",
"timezone": "America/Phoenix",
"site_id": 'd2018f1d-82b1-422a-8ec4-4e8b3fe92a4a',
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 44, 44)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 44, 44)),
"climate_zones": ["Reference Region 3"]
},
'123e4567-e89b-12d3-a456-426655440002': {
"elevation": 786.0,
"extra_parameters": "",
"latitude": 43.73403,
"longitude": -96.62328,
"modeling_parameters": {
"ac_capacity": 0.015,
"ac_loss_factor": 0.0,
"axis_azimuth": None,
"axis_tilt": None,
"backtrack": None,
"dc_capacity": 0.015,
"dc_loss_factor": 0.0,
"ground_coverage_ratio": None,
"max_rotation_angle": None,
"surface_azimuth": 180.0,
"surface_tilt": 45.0,
"temperature_coefficient": -.2,
"tracking_type": "fixed"
},
"name": "Power Plant 1",
"provider": "Organization 1",
"timezone": "Etc/GMT+6",
"site_id": '123e4567-e89b-12d3-a456-426655440002',
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 44, 46)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 44, 46)),
"climate_zones": ["Reference Region 5"]
}
}
demo_observations = {
"123e4567-e89b-12d3-a456-426655440000": {
"extra_parameters": (
'{"instrument": "Ascension Technology Rotating Shadowband Pyranometer",' # NOQA
' "network": "UO SRML"}'
),
"name": "GHI Instrument 1",
"observation_id": "123e4567-e89b-12d3-a456-426655440000",
"provider": "Organization 1",
"site_id": "123e4567-e89b-12d3-a456-426655440001",
"variable": "ghi",
"interval_value_type": "interval_mean",
"interval_label": "beginning",
"interval_length": 5,
"uncertainty": 0.10,
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 39)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 39))
},
"9cfa4aa2-7d0f-4f6f-a1c1-47f75e1d226f": {
"extra_parameters": (
'{"instrument": "Ascension Technology Rotating Shadowband Pyranometer",' # NOQA
' "network": "UO SRML"}'
),
"name": "DHI Instrument 1",
"observation_id": "9cfa4aa2-7d0f-4f6f-a1c1-47f75e1d226f",
"provider": "Organization 1",
"site_id": "123e4567-e89b-12d3-a456-426655440001",
"variable": "dhi",
"interval_value_type": "interval_mean",
"interval_label": "beginning",
"interval_length": 5,
"uncertainty": 0.10,
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 43)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 43))
},
"9ce9715c-bd91-47b7-989f-50bb558f1eb9": {
"extra_parameters": (
'{"instrument": "Ascension Technology Rotating Shadowband Pyranometer",' # NOQA
' "network": "UO SRML"}'
),
"name": "DNI Instrument 2",
"observation_id": "9ce9715c-bd91-47b7-989f-50bb558f1eb9",
"provider": "Organization 1",
"site_id": "123e4567-e89b-12d3-a456-426655440001",
"variable": "dni",
"interval_value_type": "interval_mean",
"interval_label": "beginning",
"interval_length": 5,
"uncertainty": 0.10,
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 48)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 48))
},
"e0da0dea-9482-4073-84de-f1b12c304d23": {
"extra_parameters": (
'{"instrument": "Kipp & Zonen CMP 22 Pyranometer",'
' "network": "UO SRML"}'
),
"name": "GHI Instrument 2",
"observation_id": "e0da0dea-9482-4073-84de-f1b12c304d23",
"provider": "Organization 1",
"site_id": "d2018f1d-82b1-422a-8ec4-4e8b3fe92a4a",
"variable": "ghi",
"interval_value_type": "interval_mean",
"interval_label": "beginning",
"interval_length": 5,
"uncertainty": 0.10,
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 55)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 55))
},
"b1dfe2cb-9c8e-43cd-afcf-c5a6feaf81e2": {
"extra_parameters": (
'{"instrument": "Kipp & Zonen CMP 22 Pyranometer",'
' "network": "NOAA"}'
),
"name": "Sioux Falls, ghi",
"observation_id": "b1dfe2cb-9c8e-43cd-afcf-c5a6feaf81e2",
"provider": "Organization 1",
"site_id": "d2018f1d-82b1-422a-8ec4-4e8b3fe92a4a",
"variable": "ghi",
"interval_value_type": "interval_mean",
"interval_label": "beginning",
"interval_length": 5,
"uncertainty": 0.10,
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 2, 38)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 2, 38))
},
'991d15ce-7f66-11ea-96ae-0242ac150002': {
'name': 'Weather Station Event Observation',
'variable': 'event',
'interval_value_type': 'instantaneous',
'interval_length': 5.0,
'interval_label': 'event',
'site_id': '123e4567-e89b-12d3-a456-426655440001',
'uncertainty': 1.0,
'observation_id': '991d15ce-7f66-11ea-96ae-0242ac150002',
'provider': 'Organization 1',
'created_at': pytz.utc.localize(dt.datetime(2019, 4, 14, 7, 00, 00)),
'modified_at': pytz.utc.localize(dt.datetime(2019, 4, 14, 7, 00, 00)),
'extra_parameters': ''}
}
demo_forecasts = {
'11c20780-76ae-4b11-bef1-7a75bdc784e3': {
"extra_parameters": "",
"forecast_id": "11c20780-76ae-4b11-bef1-7a75bdc784e3",
"name": "DA GHI",
"provider": "Organization 1",
"site_id": "123e4567-e89b-12d3-a456-426655440001",
"aggregate_id": None,
"variable": "ghi",
"issue_time_of_day": "06:00",
"interval_length": 5,
"run_length": 1440,
"interval_label": "beginning",
"lead_time_to_start": 60,
"interval_value_type": "interval_mean",
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 55, 37)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 55, 37))
},
'f8dd49fa-23e2-48a0-862b-ba0af6dec276': {
"extra_parameters": "",
"forecast_id": "f8dd49fa-23e2-48a0-862b-ba0af6dec276",
"name": "HA Power",
"provider": "Organization 1",
"site_id": "123e4567-e89b-12d3-a456-426655440002",
"aggregate_id": None,
"variable": "ac_power",
"issue_time_of_day": "12:00",
"run_length": 60,
"interval_length": 1,
"interval_label": "beginning",
"lead_time_to_start": 60,
"interval_value_type": "interval_mean",
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 55, 38)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 55, 38))
},
'39220780-76ae-4b11-bef1-7a75bdc784e3': {
"extra_parameters": "",
"forecast_id": "39220780-76ae-4b11-bef1-7a75bdc784e3",
"name": "GHI Aggregate FX",
"provider": "Organization 1",
"site_id": None,
"aggregate_id": "458ffc27-df0b-11e9-b622-62adb5fd6af0",
"variable": "ghi",
"issue_time_of_day": "06:00",
"run_length": 1440,
"interval_length": 5,
"interval_label": "beginning",
"lead_time_to_start": 60,
"interval_value_type": "interval_mean",
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 55, 37)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 55, 37))
},
'49220780-76ae-4b11-bef1-7a75bdc784e3': {
"extra_parameters": "",
"forecast_id": "49220780-76ae-4b11-bef1-7a75bdc784e3",
"name": "GHI Aggregate FX 60",
"provider": "Organization 1",
"site_id": None,
"aggregate_id": "458ffc27-df0b-11e9-b622-62adb5fd6af0",
"variable": "ghi",
"issue_time_of_day": "00:00",
"run_length": 1440,
"interval_length": 60,
"interval_label": "beginning",
"lead_time_to_start": 0,
"interval_value_type": "interval_mean",
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 55, 37)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 11, 55, 37))
},
'24cbae4e-7ea6-11ea-86b1-0242ac150002': {
'name': 'Weather Station Event Forecast',
'issue_time_of_day': '05:00',
'lead_time_to_start': 60.0,
'interval_length': 5.0,
'run_length': 60.0,
'interval_label': 'event',
'interval_value_type': 'instantaneous',
'variable': 'event',
'forecast_id': '24cbae4e-7ea6-11ea-86b1-0242ac150002',
'site_id': '123e4567-e89b-12d3-a456-426655440001',
'aggregate_id': None,
'provider': 'Organization 1',
'extra_parameters': '',
'created_at': pytz.utc.localize(dt.datetime(2019, 4, 14, 7, 00, 00)),
'modified_at': pytz.utc.localize(dt.datetime(2019, 4, 14, 7, 00, 00)),
}
}
demo_single_cdf = {
'633f9396-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633f9396-50bb-11e9-8647-d663bd873d93',
"constant_value": 5.0,
"parent": 'ef51e87c-50b9-11e9-8647-d663bd873d93',
},
'633f9864-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633f9864-50bb-11e9-8647-d663bd873d93',
"constant_value": 20.0,
"parent": 'ef51e87c-50b9-11e9-8647-d663bd873d93',
},
'633f9b2a-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633f9b2a-50bb-11e9-8647-d663bd873d93',
"constant_value": 50.0,
"parent": 'ef51e87c-50b9-11e9-8647-d663bd873d93',
},
'633f9d96-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633f9d96-50bb-11e9-8647-d663bd873d93',
"constant_value": 80.0,
"parent": 'ef51e87c-50b9-11e9-8647-d663bd873d93',
},
'633fa548-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633fa548-50bb-11e9-8647-d663bd873d93',
"constant_value": 95.0,
"parent": 'ef51e87c-50b9-11e9-8647-d663bd873d93',
},
'633fa94e-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633fa94e-50bb-11e9-8647-d663bd873d93',
"constant_value": 0.0,
"parent": '058b182a-50ba-11e9-8647-d663bd873d93',
},
'633fabec-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633fabec-50bb-11e9-8647-d663bd873d93',
"constant_value": 5.0,
"parent": '058b182a-50ba-11e9-8647-d663bd873d93',
},
'633fae62-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633fae62-50bb-11e9-8647-d663bd873d93',
"constant_value": 10.0,
"parent": '058b182a-50ba-11e9-8647-d663bd873d93',
},
'633fb114-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633fb114-50bb-11e9-8647-d663bd873d93',
"constant_value": 15.0,
"parent": '058b182a-50ba-11e9-8647-d663bd873d93',
},
'633fb3a8-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '633fb3a8-50bb-11e9-8647-d663bd873d93',
"constant_value": 20.0,
"parent": '058b182a-50ba-11e9-8647-d663bd873d93',
},
'733f9396-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '733f9396-50bb-11e9-8647-d663bd873d93',
"constant_value": 10.0,
"parent": 'f6b620ca-f743-11e9-a34f-f4939feddd82'
},
'733f9864-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '733f9864-50bb-11e9-8647-d663bd873d93',
"constant_value": 20.0,
"parent": 'f6b620ca-f743-11e9-a34f-f4939feddd82'
},
'733f9b2a-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '733f9b2a-50bb-11e9-8647-d663bd873d93',
"constant_value": 50.0,
"parent": 'f6b620ca-f743-11e9-a34f-f4939feddd82'
},
'733f9d96-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '733f9d96-50bb-11e9-8647-d663bd873d93',
"constant_value": 80.0,
"parent": 'f6b620ca-f743-11e9-a34f-f4939feddd82'
},
'733fa548-50bb-11e9-8647-d663bd873d93': {
"forecast_id": '733fa548-50bb-11e9-8647-d663bd873d93',
"constant_value": 100.0,
"parent": 'f6b620ca-f743-11e9-a34f-f4939feddd82'
},
}
def _get_constant_values(fxid):
out = demo_single_cdf[fxid].copy()
del out['parent']
return out
demo_group_cdf = {
'ef51e87c-50b9-11e9-8647-d663bd873d93': {
"forecast_id": "ef51e87c-50b9-11e9-8647-d663bd873d93",
"name": "DA GHI",
"extra_parameters": "",
"provider": "Organization 1",
"site_id": "123e4567-e89b-12d3-a456-426655440001",
"aggregate_id": None,
"variable": "ghi",
"issue_time_of_day": "06:00",
"interval_length": 5,
"run_length": 1440,
"interval_label": "beginning",
"lead_time_to_start": 60,
"interval_value_type": "interval_mean",
"axis": "y",
"constant_values": [
_get_constant_values('633f9396-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('633f9864-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('633f9b2a-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('633f9d96-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('633fa548-50bb-11e9-8647-d663bd873d93')],
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 2, 14, 55, 37)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 2, 14, 55, 37))
},
'058b182a-50ba-11e9-8647-d663bd873d93': {
"forecast_id": "058b182a-50ba-11e9-8647-d663bd873d93",
"name": "HA Power",
"extra_parameters": "",
"provider": "Organization 1",
"site_id": "123e4567-e89b-12d3-a456-426655440002",
"aggregate_id": None,
"variable": "ac_power",
"issue_time_of_day": "12:00",
"run_length": 60,
"interval_length": 1,
"interval_label": "beginning",
"lead_time_to_start": 60,
"interval_value_type": "interval_mean",
"axis": "x",
"constant_values": [
_get_constant_values('633fb3a8-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('633fb114-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('633fae62-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('633fabec-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('633fa94e-50bb-11e9-8647-d663bd873d93')],
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 2, 14, 55, 38)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 2, 14, 55, 38))
},
'f6b620ca-f743-11e9-a34f-f4939feddd82': {
"forecast_id": "f6b620ca-f743-11e9-a34f-f4939feddd82",
"name": "GHI Aggregate CDF FX",
"extra_parameters": "",
"provider": "Organization 1",
"site_id": None,
"aggregate_id": "458ffc27-df0b-11e9-b622-62adb5fd6af0",
"variable": "ghi",
"issue_time_of_day": "06:00",
"interval_length": 5,
"run_length": 1440,
"interval_label": "beginning",
"lead_time_to_start": 60,
"interval_value_type": "interval_mean",
"axis": "y",
"constant_values": [
_get_constant_values('733f9396-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('733f9864-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('733f9b2a-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('733f9d96-50bb-11e9-8647-d663bd873d93'),
_get_constant_values('733fa548-50bb-11e9-8647-d663bd873d93')],
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 2, 14, 55, 38)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 2, 14, 55, 38))
}
}
ca = dt.datetime(2019, 9, 25, 0, 0, tzinfo=dt.timezone.utc)
ef = dt.datetime(2019, 1, 1, 0, 0, tzinfo=dt.timezone.utc)
demo_aggregates = {
"458ffc27-df0b-11e9-b622-62adb5fd6af0": {
"aggregate_id": "458ffc27-df0b-11e9-b622-62adb5fd6af0",
"name": "Test Aggregate ghi",
"provider": "Organization 1",
"variable": "ghi",
"interval_label": "ending",
"interval_length": 60,
"interval_value_type": "interval_mean",
"aggregate_type": "mean",
"extra_parameters": "extra",
"description": "ghi agg",
"timezone": "America/Denver",
"created_at": dt.datetime(2019, 9, 24, 12, 0, tzinfo=dt.timezone.utc),
"modified_at": dt.datetime(2019, 9, 24, 12, 0, tzinfo=dt.timezone.utc),
"observations": [
{"observation_id": "123e4567-e89b-12d3-a456-426655440000",
"created_at": ca,
"effective_from": ef,
"observation_deleted_at": None,
"effective_until": None},
{"observation_id": "e0da0dea-9482-4073-84de-f1b12c304d23",
"created_at": ca,
"effective_from": ef,
"observation_deleted_at": None,
"effective_until": None},
{"observation_id": "b1dfe2cb-9c8e-43cd-afcf-c5a6feaf81e2",
"created_at": ca,
"effective_from": ef,
"observation_deleted_at": None,
"effective_until": None},
]
},
"d3d1e8e5-df1b-11e9-b622-62adb5fd6af0": {
"aggregate_id": "d3d1e8e5-df1b-11e9-b622-62adb5fd6af0",
"name": "Test Aggregate dni",
"provider": "Organization 1",
"variable": "dni",
"interval_label": "ending",
"interval_length": 60,
"interval_value_type": "interval_mean",
"aggregate_type": "mean",
"extra_parameters": "extra",
"description": "dni agg",
"timezone": "America/Denver",
"created_at": dt.datetime(2019, 9, 24, 12, 0, tzinfo=dt.timezone.utc),
"modified_at": dt.datetime(2019, 9, 24, 12, 0, tzinfo=dt.timezone.utc),
"observations": [
{"observation_id": "95890740-824f-11e9-a81f-54bf64606445",
"created_at": ca,
"observation_deleted_at": None,
"effective_from": ef,
"effective_until": None},
{"observation_id": "9ce9715c-bd91-47b7-989f-50bb558f1eb9",
"created_at": ca,
"observation_deleted_at": None,
"effective_from": ef,
"effective_until": None}
]
}
}
def generate_randoms(freq):
"""Generates two days worth of random noisy data.
Parameters
----------
freq: int
The "interval length" of the data to produce in minutes.
options: 1 or 5
Returns
-------
Dataframe
Dataframe with datetimeindex, values and quality_flag
columns.
Notes
-----
Won't throw an error if you try to use a freq of other
than 1 or 5 but will provide you values as though
you selected 5.
"""
if freq == 1:
length = 4320
elif freq == 5:
length = 864
else:
# assume 60 min
length = 72
index = pd.date_range(start=pd.Timestamp('20190414T07:00'),
periods=length, freq=f'{freq}min', tz='UTC')
values = np.random.normal(50, 5, size=length)
quality_flags = np.random.randint(11, size=length)
return index, values, quality_flags
demo_file_variables = ['ghi', 'dni', 'dhi']
@pytest.fixture()
def obs_vals():
index, values, quality = generate_randoms(freq=5)
data = {
'value': values,
'quality_flag': quality}
obs_df = pd.DataFrame(index=index, data=data)
obs_df.index.name = 'timestamp'
return obs_df
@pytest.fixture()
def fx_vals():
index, values, quality = generate_randoms(freq=5)
data = {
'value': values}
fx_df = pd.DataFrame(index=index, data=data)
fx_df.index.name = 'timestamp'
return fx_df
@pytest.fixture(scope="module")
def ghi_obs_vals():
ghi_csv = """
timestamp,value,quality_flag
2019-04-14T07:00:00+00:00,-2.58981,0
2019-04-14T07:05:00+00:00,-2.59598,0
2019-04-14T07:10:00+00:00,-2.95363,0
2019-04-14T07:15:00+00:00,-2.58983,0
2019-04-14T07:20:00+00:00,-2.5897900000000003,0
2019-04-14T07:25:00+00:00,-2.65143,0
2019-04-14T07:30:00+00:00,-2.58363,0
2019-04-14T07:35:00+00:00,-2.9351,0
2019-04-14T07:40:00+00:00,-2.5897799999999997,0
2019-04-14T07:45:00+00:00,-2.58975,0
2019-04-14T07:50:00+00:00,-2.58976,0
2019-04-14T07:55:00+00:00,-2.5836,0
2019-04-14T08:00:00+00:00,-2.63912,0
2019-04-14T08:05:00+00:00,-2.87963,0
2019-04-14T08:10:00+00:00,-2.58983,0
2019-04-14T08:15:00+00:00,-2.5897799999999997,0
2019-04-14T08:20:00+00:00,-2.21981,0
2019-04-14T08:25:00+00:00,-2.0163599999999997,0
2019-04-14T08:30:00+00:00,-2.5897900000000003,0
2019-04-14T08:35:00+00:00,-2.58986,0
2019-04-14T08:40:00+00:00,-2.5899,0
2019-04-14T08:45:00+00:00,-2.46659,0
2019-04-14T08:50:00+00:00,-2.54677,0
2019-04-14T08:55:00+00:00,-2.33095,0
2019-04-14T09:00:00+00:00,-2.07193,0
2019-04-14T09:05:00+00:00,-2.3679200000000002,0
2019-04-14T09:10:00+00:00,-2.2137599999999997,0
2019-04-14T09:15:00+00:00,-2.5899799999999997,0
2019-04-14T09:20:00+00:00,-2.368,0
2019-04-14T09:25:00+00:00,-2.59004,0
2019-04-14T09:30:00+00:00,-2.5838900000000002,0
2019-04-14T09:35:00+00:00,-2.59002,0
2019-04-14T09:40:00+00:00,-2.59003,0
2019-04-14T09:45:00+00:00,-2.46049,0
2019-04-14T09:50:00+00:00,-2.21995,0
2019-04-14T09:55:00+00:00,-2.2384,0
2019-04-14T10:00:00+00:00,-2.15828,0
2019-04-14T10:05:00+00:00,-2.59001,0
2019-04-14T10:10:00+00:00,-2.22008,0
2019-04-14T10:15:00+00:00,-2.22011,0
2019-04-14T10:20:00+00:00,-2.34346,0
2019-04-14T10:25:00+00:00,-2.22012,0
2019-04-14T10:30:00+00:00,-2.2200900000000003,0
2019-04-14T10:35:00+00:00,-2.26943,0
2019-04-14T10:40:00+00:00,-2.22627,0
2019-04-14T10:45:00+00:00,-1.94259,0
2019-04-14T10:50:00+00:00,-2.21394,0
2019-04-14T10:55:00+00:00,-2.20161,0
2019-04-14T11:00:00+00:00,-2.18928,0
2019-04-14T11:05:00+00:00,-2.25712,0
2019-04-14T11:10:00+00:00,-2.3496200000000003,0
2019-04-14T11:15:00+00:00,-2.01661,0
2019-04-14T11:20:00+00:00,-2.20778,0
2019-04-14T11:25:00+00:00,-1.99194,0
2019-04-14T11:30:00+00:00,-1.8501,0
2019-04-14T11:35:00+00:00,-1.86243,0
2019-04-14T11:40:00+00:00,-2.1461099999999997,0
2019-04-14T11:45:00+00:00,-1.88093,0
2019-04-14T11:50:00+00:00,-1.8501,0
2019-04-14T11:55:00+00:00,-2.21395,0
2019-04-14T12:00:00+00:00,-2.07211,0
2019-04-14T12:05:00+00:00,-1.8562599999999998,0
2019-04-14T12:10:00+00:00,-2.33112,0
2019-04-14T12:15:00+00:00,-2.56547,0
2019-04-14T12:20:00+00:00,-2.5593,0
2019-04-14T12:25:00+00:00,-2.18928,0
2019-04-14T12:30:00+00:00,-2.1461099999999997,0
2019-04-14T12:35:00+00:00,-1.8501,0
2019-04-14T12:40:00+00:00,-1.8501,0
2019-04-14T12:45:00+00:00,-1.11006,0
2019-04-14T12:50:00+00:00,0.370021,0
2019-04-14T12:55:00+00:00,2.81833,0
2019-04-14T13:00:00+00:00,6.01286,0
2019-04-14T13:05:00+00:00,14.8625,0
2019-04-14T13:10:00+00:00,25.0627,0
2019-04-14T13:15:00+00:00,36.0769,0
2019-04-14T13:20:00+00:00,49.3668,0
2019-04-14T13:25:00+00:00,64.1798,0
2019-04-14T13:30:00+00:00,80.7814,0
2019-04-14T13:35:00+00:00,98.1722,0
2019-04-14T13:40:00+00:00,116.131,0
2019-04-14T13:45:00+00:00,134.749,0
2019-04-14T13:50:00+00:00,152.97799999999998,0
2019-04-14T13:55:00+00:00,161.322,0
2019-04-14T14:00:00+00:00,185.75,0
2019-04-14T14:05:00+00:00,212.2,0
2019-04-14T14:10:00+00:00,232.768,0
2019-04-14T14:15:00+00:00,253.32299999999998,0
2019-04-14T14:20:00+00:00,271.79200000000003,0
2019-04-14T14:25:00+00:00,292.827,0
2019-04-14T14:30:00+00:00,314.072,0
2019-04-14T14:35:00+00:00,331.245,0
2019-04-14T14:40:00+00:00,354.673,0
2019-04-14T14:45:00+00:00,374.912,0
2019-04-14T14:50:00+00:00,395.663,0
2019-04-14T14:55:00+00:00,416.967,0
2019-04-14T15:00:00+00:00,437.421,0
2019-04-14T15:05:00+00:00,458.991,0
2019-04-14T15:10:00+00:00,482.281,0
2019-04-14T15:15:00+00:00,479.139,0
2019-04-14T15:20:00+00:00,508.588,0
2019-04-14T15:25:00+00:00,535.8969999999999,0
2019-04-14T15:30:00+00:00,553.289,0
2019-04-14T15:35:00+00:00,571.726,0
2019-04-14T15:40:00+00:00,590.8,0
2019-04-14T15:45:00+00:00,597.552,0
2019-04-14T15:50:00+00:00,625.388,0
2019-04-14T15:55:00+00:00,642.813,0
2019-04-14T16:00:00+00:00,659.5160000000001,0
2019-04-14T16:05:00+00:00,676.591,0
2019-04-14T16:10:00+00:00,693.842,0
2019-04-14T16:15:00+00:00,710.203,0
2019-04-14T16:20:00+00:00,725.822,0
2019-04-14T16:25:00+00:00,742.3810000000001,0
2019-04-14T16:30:00+00:00,758.559,0
2019-04-14T16:35:00+00:00,774.2180000000001,0
2019-04-14T16:40:00+00:00,789.38,0
2019-04-14T16:45:00+00:00,804.44,0
2019-04-14T16:50:00+00:00,819.814,0
2019-04-14T16:55:00+00:00,834.556,0
2019-04-14T17:00:00+00:00,848.2639999999999,0
2019-04-14T17:05:00+00:00,861.556,0
2019-04-14T17:10:00+00:00,874.9169999999999,0
2019-04-14T17:15:00+00:00,887.265,0
2019-04-14T17:20:00+00:00,899.135,0
2019-04-14T17:25:00+00:00,914.666,0
2019-04-14T17:30:00+00:00,928.618,0
2019-04-14T17:35:00+00:00,951.102,0
2019-04-14T17:40:00+00:00,890.1210000000001,0
2019-04-14T17:45:00+00:00,728.257,0
2019-04-14T17:50:00+00:00,661.2189999999999,0
2019-04-14T17:55:00+00:00,991.305,0
2019-04-14T18:00:00+00:00,974.33,0
2019-04-14T18:05:00+00:00,999.362,0
2019-04-14T18:10:00+00:00,944.8510000000001,0
2019-04-14T18:15:00+00:00,715.2760000000001,0
2019-04-14T18:20:00+00:00,945.5980000000001,0
2019-04-14T18:25:00+00:00,967.4939999999999,0
2019-04-14T18:30:00+00:00,1038.75,0
2019-04-14T18:35:00+00:00,1035.99,0
2019-04-14T18:40:00+00:00,1038.4,0
2019-04-14T18:45:00+00:00,1039.57,0
2019-04-14T18:50:00+00:00,929.263,0
2019-04-14T18:55:00+00:00,947.2260000000001,0
2019-04-14T19:00:00+00:00,952.812,0
2019-04-14T19:05:00+00:00,1056.66,0
2019-04-14T19:10:00+00:00,1084.52,0
2019-04-14T19:15:00+00:00,1080.25,0
2019-04-14T19:20:00+00:00,1067.63,0
2019-04-14T19:25:00+00:00,1063.64,0
2019-04-14T19:30:00+00:00,1046.98,0
2019-04-14T19:35:00+00:00,1049.83,0
2019-04-14T19:40:00+00:00,983.454,0
2019-04-14T19:45:00+00:00,953.0,0
2019-04-14T19:50:00+00:00,973.1189999999999,0
2019-04-14T19:55:00+00:00,1031.86,0
2019-04-14T20:00:00+00:00,893.164,0
2019-04-14T20:05:00+00:00,966.245,0
2019-04-14T20:10:00+00:00,1019.2,0
2019-04-14T20:15:00+00:00,976.79,0
2019-04-14T20:20:00+00:00,901.305,0
2019-04-14T20:25:00+00:00,945.3939999999999,0
2019-04-14T20:30:00+00:00,989.505,0
2019-04-14T20:35:00+00:00,1043.08,0
2019-04-14T20:40:00+00:00,843.58,0
2019-04-14T20:45:00+00:00,943.299,0
2019-04-14T20:50:00+00:00,893.836,0
2019-04-14T20:55:00+00:00,866.0110000000001,0
2019-04-14T21:00:00+00:00,811.8969999999999,0
2019-04-14T21:05:00+00:00,840.812,0
2019-04-14T21:10:00+00:00,757.7389999999999,0
2019-04-14T21:15:00+00:00,899.6519999999999,0
2019-04-14T21:20:00+00:00,909.35,0
2019-04-14T21:25:00+00:00,954.7180000000001,0
2019-04-14T21:30:00+00:00,894.877,0
2019-04-14T21:35:00+00:00,891.1339999999999,0
2019-04-14T21:40:00+00:00,871.166,0
2019-04-14T21:45:00+00:00,872.8610000000001,0
2019-04-14T21:50:00+00:00,844.846,0
2019-04-14T21:55:00+00:00,837.497,0
2019-04-14T22:00:00+00:00,766.3919999999999,0
2019-04-14T22:05:00+00:00,810.61,0
2019-04-14T22:10:00+00:00,776.055,0
2019-04-14T22:15:00+00:00,745.7360000000001,0
2019-04-14T22:20:00+00:00,722.574,0
2019-04-14T22:25:00+00:00,752.806,0
2019-04-14T22:30:00+00:00,721.926,0
2019-04-14T22:35:00+00:00,694.8430000000001,0
2019-04-14T22:40:00+00:00,684.0169999999999,0
2019-04-14T22:45:00+00:00,666.4830000000001,0
2019-04-14T22:50:00+00:00,632.129,0
2019-04-14T22:55:00+00:00,580.055,0
2019-04-14T23:00:00+00:00,458.814,0
2019-04-14T23:05:00+00:00,615.59,0
2019-04-14T23:10:00+00:00,619.446,0
2019-04-14T23:15:00+00:00,592.008,0
2019-04-14T23:20:00+00:00,437.16900000000004,0
2019-04-14T23:25:00+00:00,514.895,0
2019-04-14T23:30:00+00:00,342.56,0
2019-04-14T23:35:00+00:00,567.229,0
2019-04-14T23:40:00+00:00,521.059,0
2019-04-14T23:45:00+00:00,475.625,0
2019-04-14T23:50:00+00:00,286.94,0
2019-04-14T23:55:00+00:00,430.19,0
2019-04-15T00:00:00+00:00,181.178,0
2019-04-15T00:05:00+00:00,246.452,0
2019-04-15T00:10:00+00:00,123.838,0
2019-04-15T00:15:00+00:00,134.411,0
2019-04-15T00:20:00+00:00,178.725,0
2019-04-15T00:25:00+00:00,222.75099999999998,0
2019-04-15T00:30:00+00:00,122.815,0
2019-04-15T00:35:00+00:00,120.95200000000001,0
2019-04-15T00:40:00+00:00,215.28599999999997,0
2019-04-15T00:45:00+00:00,182.082,0
2019-04-15T00:50:00+00:00,112.78399999999999,0
2019-04-15T00:55:00+00:00,99.9878,0
2019-04-15T01:00:00+00:00,95.6318,0
2019-04-15T01:05:00+00:00,98.37,0
2019-04-15T01:10:00+00:00,65.9311,0
2019-04-15T01:15:00+00:00,54.4334,0
2019-04-15T01:20:00+00:00,69.2061,0
2019-04-15T01:25:00+00:00,57.6223,0
2019-04-15T01:30:00+00:00,27.152,0
2019-04-15T01:35:00+00:00,15.2969,0
2019-04-15T01:40:00+00:00,7.52508,0
2019-04-15T01:45:00+00:00,3.06547,0
2019-04-15T01:50:00+00:00,0.370076,0
2019-04-15T01:55:00+00:00,-1.11022,0
2019-04-15T02:00:00+00:00,-1.8503,0
2019-04-15T02:05:00+00:00,-2.6026700000000003,0
2019-04-15T02:10:00+00:00,-2.9603,0
2019-04-15T02:15:00+00:00,-3.31795,0
2019-04-15T02:20:00+00:00,-3.3302300000000002,0
2019-04-15T02:25:00+00:00,-3.3302099999999997,0
2019-04-15T02:30:00+00:00,-3.3302300000000002,0
2019-04-15T02:35:00+00:00,-3.19462,0
2019-04-15T02:40:00+00:00,-3.70025,0
2019-04-15T02:45:00+00:00,-3.8913900000000003,0
2019-04-15T02:50:00+00:00,-3.5152099999999997,0
2019-04-15T02:55:00+00:00,-3.54601,0
2019-04-15T03:00:00+00:00,-3.48432,0
2019-04-15T03:05:00+00:00,-3.33015,0
2019-04-15T03:10:00+00:00,-3.33015,0
2019-04-15T03:15:00+00:00,-3.1760200000000003,0
2019-04-15T03:20:00+00:00,-3.3302400000000003,0
2019-04-15T03:25:00+00:00,-2.9725599999999996,0
2019-04-15T03:30:00+00:00,-2.9664,0
2019-04-15T03:35:00+00:00,-2.59022,0
2019-04-15T03:40:00+00:00,-2.96026,0
2019-04-15T03:45:00+00:00,-3.0836,0
2019-04-15T03:50:00+00:00,-3.33029,0
2019-04-15T03:55:00+00:00,-3.3302199999999997,0
2019-04-15T04:00:00+00:00,-3.33016,0
2019-04-15T04:05:00+00:00,-3.2933,0
2019-04-15T04:10:00+00:00,-2.96029,0
2019-04-15T04:15:00+00:00,-2.96038,0
2019-04-15T04:20:00+00:00,-2.91717,0
2019-04-15T04:25:00+00:00,-2.59643,0
2019-04-15T04:30:00+00:00,-2.59025,0
2019-04-15T04:35:00+00:00,-2.59023,0
2019-04-15T04:40:00+00:00,-2.59016,0
2019-04-15T04:45:00+00:00,-2.7258299999999998,0
2019-04-15T04:50:00+00:00,-2.99723,0
2019-04-15T04:55:00+00:00,-2.96025,0
2019-04-15T05:00:00+00:00,-3.07743,0
2019-04-15T05:05:00+00:00,-3.39195,0
2019-04-15T05:10:00+00:00,-3.36734,0
2019-04-15T05:15:00+00:00,-3.3303599999999998,0
2019-04-15T05:20:00+00:00,-3.3303800000000003,0
2019-04-15T05:25:00+00:00,-3.18854,0
2019-04-15T05:30:00+00:00,-3.3242300000000005,0
2019-04-15T05:35:00+00:00,-2.9603599999999997,0
2019-04-15T05:40:00+00:00,-2.96037,0
2019-04-15T05:45:00+00:00,-2.95419,0
2019-04-15T05:50:00+00:00,-2.96035,0
2019-04-15T05:55:00+00:00,-2.9603599999999997,0
2019-04-15T06:00:00+00:00,-3.09606,0
2019-04-15T06:05:00+00:00,-2.9603599999999997,0
2019-04-15T06:10:00+00:00,-2.9603200000000003,0
2019-04-15T06:15:00+00:00,-2.96029,0
2019-04-15T06:20:00+00:00,-2.96028,0
2019-04-15T06:25:00+00:00,-2.59024,0
2019-04-15T06:30:00+00:00,-2.59023,0
2019-04-15T06:35:00+00:00,-2.59017,0
2019-04-15T06:40:00+00:00,-2.5901400000000003,0
2019-04-15T06:45:00+00:00,-2.59009,0
2019-04-15T06:50:00+00:00,-2.59008,0
2019-04-15T06:55:00+00:00,-2.59001,0
2019-04-15T07:00:00+00:00,-2.5899900000000002,0
2019-04-15T07:05:00+00:00,-2.62702,0
2019-04-15T07:10:00+00:00,-2.5899900000000002,0
2019-04-15T07:15:00+00:00,-2.58996,0
2019-04-15T07:20:00+00:00,-2.5899400000000004,0
2019-04-15T07:25:00+00:00,-2.58995,0
2019-04-15T07:30:00+00:00,-2.5899099999999997,0
2019-04-15T07:35:00+00:00,-2.5899,0
2019-04-15T07:40:00+00:00,-2.58992,0
2019-04-15T07:45:00+00:00,-2.58993,0
2019-04-15T07:50:00+00:00,-2.58995,0
2019-04-15T07:55:00+00:00,-2.58995,0
2019-04-15T08:00:00+00:00,-2.9291,0
2019-04-15T08:05:00+00:00,-2.95992,0
2019-04-15T08:10:00+00:00,-2.95991,0
2019-04-15T08:15:00+00:00,-3.07707,0
2019-04-15T08:20:00+00:00,-2.9599,0
2019-04-15T08:25:00+00:00,-2.68859,0
2019-04-15T08:30:00+00:00,-2.60227,0
2019-04-15T08:35:00+00:00,-2.67009,0
2019-04-15T08:40:00+00:00,-2.58993,0
2019-04-15T08:45:00+00:00,-2.58992,0
2019-04-15T08:50:00+00:00,-2.58989,0
2019-04-15T08:55:00+00:00,-2.58988,0
2019-04-15T09:00:00+00:00,-2.58988,0
2019-04-15T09:05:00+00:00,-2.58989,0
2019-04-15T09:10:00+00:00,-2.9598400000000002,0
2019-04-15T09:15:00+00:00,-2.91663,0
2019-04-15T09:20:00+00:00,-2.58977,0
2019-04-15T09:25:00+00:00,-2.54041,0
2019-04-15T09:30:00+00:00,-2.25062,0
2019-04-15T09:35:00+00:00,-2.30618,0
2019-04-15T09:40:00+00:00,-2.58982,0
2019-04-15T09:45:00+00:00,-2.58986,0
2019-04-15T09:50:00+00:00,-2.58987,0
2019-04-15T09:55:00+00:00,-2.57755,0
2019-04-15T10:00:00+00:00,-2.58989,0
2019-04-15T10:05:00+00:00,-2.58985,0
2019-04-15T10:10:00+00:00,-2.5897900000000003,0
2019-04-15T10:15:00+00:00,-2.31846,0
2019-04-15T10:20:00+00:00,-2.5897799999999997,0
2019-04-15T10:25:00+00:00,-2.58976,0
2019-04-15T10:30:00+00:00,-2.58974,0
2019-04-15T10:35:00+00:00,-2.44176,0
2019-04-15T10:40:00+00:00,-2.57742,0
2019-04-15T10:45:00+00:00,-2.56506,0
2019-04-15T10:50:00+00:00,-2.42942,0
2019-04-15T10:55:00+00:00,-2.2938,0
2019-04-15T11:00:00+00:00,-2.5342599999999997,0
2019-04-15T11:05:00+00:00,-2.3122700000000003,0
2019-04-15T11:10:00+00:00,-2.21975,0
2019-04-15T11:15:00+00:00,-2.20126,0
2019-04-15T11:20:00+00:00,-2.35545,0
2019-04-15T11:25:00+00:00,-2.58973,0
2019-04-15T11:30:00+00:00,-2.58974,0
2019-04-15T11:35:00+00:00,-2.58976,0
2019-04-15T11:40:00+00:00,-2.7069400000000003,0
2019-04-15T11:45:00+00:00,-2.58983,0
2019-04-15T11:50:00+00:00,-2.58986,0
2019-04-15T11:55:00+00:00,-2.58986,0
2019-04-15T12:00:00+00:00,-2.58982,0
2019-04-15T12:05:00+00:00,-2.5898,0
2019-04-15T12:10:00+00:00,-2.34317,0
2019-04-15T12:15:00+00:00,-2.2199,0
2019-04-15T12:20:00+00:00,-2.13352,0
2019-04-15T12:25:00+00:00,-2.2938099999999997,0
2019-04-15T12:30:00+00:00,-2.27527,0
2019-04-15T12:35:00+00:00,-2.55277,0
2019-04-15T12:40:00+00:00,-2.24453,0
2019-04-15T12:45:00+00:00,-1.2333,0
2019-04-15T12:50:00+00:00,1.51696,0
2019-04-15T12:55:00+00:00,3.3299300000000005,0
2019-04-15T13:00:00+00:00,5.33415,0
2019-04-15T13:05:00+00:00,12.8762,0
2019-04-15T13:10:00+00:00,28.0401,0
2019-04-15T13:15:00+00:00,25.3819,0
2019-04-15T13:20:00+00:00,33.9907,0
2019-04-15T13:25:00+00:00,40.2998,0
2019-04-15T13:30:00+00:00,46.7991,0
2019-04-15T13:35:00+00:00,55.1116,0
2019-04-15T13:40:00+00:00,65.0373,0
2019-04-15T13:45:00+00:00,90.2805,0
2019-04-15T13:50:00+00:00,107.291,0
2019-04-15T13:55:00+00:00,91.751,0
2019-04-15T14:00:00+00:00,93.0265,0
2019-04-15T14:05:00+00:00,119.853,0
2019-04-15T14:10:00+00:00,275.908,0
2019-04-15T14:15:00+00:00,259.889,0
2019-04-15T14:20:00+00:00,297.738,0
2019-04-15T14:25:00+00:00,320.35900000000004,0
2019-04-15T14:30:00+00:00,330.24800000000005,0
2019-04-15T14:35:00+00:00,340.918,0
2019-04-15T14:40:00+00:00,315.414,0
2019-04-15T14:45:00+00:00,323.96299999999997,0
2019-04-15T14:50:00+00:00,391.41,0
2019-04-15T14:55:00+00:00,428.966,0
2019-04-15T15:00:00+00:00,452.981,0
2019-04-15T15:05:00+00:00,436.892,0
2019-04-15T15:10:00+00:00,501.43800000000005,0
2019-04-15T15:15:00+00:00,361.515,0
2019-04-15T15:20:00+00:00,517.174,0
2019-04-15T15:25:00+00:00,553.139,0
2019-04-15T15:30:00+00:00,532.0880000000001,0
2019-04-15T15:35:00+00:00,602.265,0
2019-04-15T15:40:00+00:00,542.089,0
2019-04-15T15:45:00+00:00,619.884,0
2019-04-15T15:50:00+00:00,640.026,0
2019-04-15T15:55:00+00:00,615.5459999999999,0
2019-04-15T16:00:00+00:00,535.669,0
2019-04-15T16:05:00+00:00,663.263,0
2019-04-15T16:10:00+00:00,696.176,0
2019-04-15T16:15:00+00:00,709.57,0
2019-04-15T16:20:00+00:00,720.297,0
2019-04-15T16:25:00+00:00,741.4789999999999,0
2019-04-15T16:30:00+00:00,756.16,0
2019-04-15T16:35:00+00:00,772.105,0
2019-04-15T16:40:00+00:00,787.586,0
2019-04-15T16:45:00+00:00,803.993,0
2019-04-15T16:50:00+00:00,816.363,0
2019-04-15T16:55:00+00:00,830.944,0
2019-04-15T17:00:00+00:00,848.325,0
2019-04-15T17:05:00+00:00,862.183,0
2019-04-15T17:10:00+00:00,844.135,0
2019-04-15T17:15:00+00:00,876.2289999999999,0
2019-04-15T17:20:00+00:00,889.044,0
2019-04-15T17:25:00+00:00,902.704,0
2019-04-15T17:30:00+00:00,912.7310000000001,0
2019-04-15T17:35:00+00:00,923.09,0
2019-04-15T17:40:00+00:00,933.9680000000001,0
2019-04-15T17:45:00+00:00,943.538,0
2019-04-15T17:50:00+00:00,951.5260000000001,0
2019-04-15T17:55:00+00:00,961.005,0
2019-04-15T18:00:00+00:00,967.9910000000001,0
2019-04-15T18:05:00+00:00,977.7189999999999,0
2019-04-15T18:10:00+00:00,984.003,0
2019-04-15T18:15:00+00:00,991.053,0
2019-04-15T18:20:00+00:00,998.3510000000001,0
2019-04-15T18:25:00+00:00,1011.07,0
2019-04-15T18:30:00+00:00,1023.55,0
2019-04-15T18:35:00+00:00,956.725,0
2019-04-15T18:40:00+00:00,673.852,0
2019-04-15T18:45:00+00:00,869.235,0
2019-04-15T18:50:00+00:00,1059.85,0
2019-04-15T18:55:00+00:00,923.8989999999999,0
2019-04-15T19:00:00+00:00,1023.12,0
2019-04-15T19:05:00+00:00,1054.61,0
2019-04-15T19:10:00+00:00,1021.47,0
2019-04-15T19:15:00+00:00,960.933,0
2019-04-15T19:20:00+00:00,1037.77,0
2019-04-15T19:25:00+00:00,885.221,0
2019-04-15T19:30:00+00:00,1037.18,0
2019-04-15T19:35:00+00:00,1032.81,0
2019-04-15T19:40:00+00:00,1024.12,0
2019-04-15T19:45:00+00:00,1030.9,0
2019-04-15T19:50:00+00:00,1035.2,0
2019-04-15T19:55:00+00:00,1031.66,0
2019-04-15T20:00:00+00:00,1029.01,0
2019-04-15T20:05:00+00:00,1030.1,0
2019-04-15T20:10:00+00:00,1022.15,0
2019-04-15T20:15:00+00:00,1040.45,0
2019-04-15T20:20:00+00:00,1013.47,0
2019-04-15T20:25:00+00:00,1044.57,0
2019-04-15T20:30:00+00:00,1046.76,0
2019-04-15T20:35:00+00:00,994.2539999999999,0
2019-04-15T20:40:00+00:00,1000.12,0
2019-04-15T20:45:00+00:00,979.342,0
2019-04-15T20:50:00+00:00,963.86,0
2019-04-15T20:55:00+00:00,954.6339999999999,0
2019-04-15T21:00:00+00:00,945.7539999999999,0
2019-04-15T21:05:00+00:00,932.436,0
2019-04-15T21:10:00+00:00,926.655,0
2019-04-15T21:15:00+00:00,912.58,0
2019-04-15T21:20:00+00:00,885.745,0
2019-04-15T21:25:00+00:00,890.035,0
2019-04-15T21:30:00+00:00,881.33,0
2019-04-15T21:35:00+00:00,873.1110000000001,0
2019-04-15T21:40:00+00:00,862.566,0
2019-04-15T21:45:00+00:00,848.862,0
2019-04-15T21:50:00+00:00,837.1339999999999,0
2019-04-15T21:55:00+00:00,823.7389999999999,0
2019-04-15T22:00:00+00:00,787.9630000000001,0
2019-04-15T22:05:00+00:00,769.363,0
2019-04-15T22:10:00+00:00,741.2410000000001,0
2019-04-15T22:15:00+00:00,722.4060000000001,0
2019-04-15T22:20:00+00:00,743.5419999999999,0
2019-04-15T22:25:00+00:00,707.926,0
2019-04-15T22:30:00+00:00,598.981,0
2019-04-15T22:35:00+00:00,527.816,0
2019-04-15T22:40:00+00:00,384.231,0
2019-04-15T22:45:00+00:00,394.772,0
2019-04-15T22:50:00+00:00,343.18300000000005,0
2019-04-15T22:55:00+00:00,365.339,0
2019-04-15T23:00:00+00:00,316.932,0
2019-04-15T23:05:00+00:00,311.01,0
2019-04-15T23:10:00+00:00,269.47700000000003,0
2019-04-15T23:15:00+00:00,266.522,0
2019-04-15T23:20:00+00:00,323.63,0
2019-04-15T23:25:00+00:00,260.445,0
2019-04-15T23:30:00+00:00,300.435,0
2019-04-15T23:35:00+00:00,240.81400000000002,0
2019-04-15T23:40:00+00:00,261.992,0
2019-04-15T23:45:00+00:00,248.27200000000002,0
2019-04-15T23:50:00+00:00,373.164,0
2019-04-15T23:55:00+00:00,338.93,0
2019-04-16T00:00:00+00:00,447.551,0
2019-04-16T00:05:00+00:00,425.18,0
2019-04-16T00:10:00+00:00,253.859,0
2019-04-16T00:15:00+00:00,250.486,0
2019-04-16T00:20:00+00:00,182.83,0
2019-04-16T00:25:00+00:00,157.441,0
2019-04-16T00:30:00+00:00,160.778,0
2019-04-16T00:35:00+00:00,136.722,0
2019-04-16T00:40:00+00:00,116.979,0
2019-04-16T00:45:00+00:00,95.4898,0
2019-04-16T00:50:00+00:00,99.1536,0
2019-04-16T00:55:00+00:00,81.5057,0
2019-04-16T01:00:00+00:00,76.2751,0
2019-04-16T01:05:00+00:00,98.7015,0
2019-04-16T01:10:00+00:00,138.364,0
2019-04-16T01:15:00+00:00,79.304,0
2019-04-16T01:20:00+00:00,42.3035,0
2019-04-16T01:25:00+00:00,30.6648,0
2019-04-16T01:30:00+00:00,29.0972,0
2019-04-16T01:35:00+00:00,21.0981,0
2019-04-16T01:40:00+00:00,11.9581,0
2019-04-16T01:45:00+00:00,6.61729,0
2019-04-16T01:50:00+00:00,1.87484,0
2019-04-16T01:55:00+00:00,0.080174,0
2019-04-16T02:00:00+00:00,-1.85017,0
2019-04-16T02:05:00+00:00,-2.59026,0
2019-04-16T02:10:00+00:00,-2.95407,0
2019-04-16T02:15:00+00:00,-2.9601900000000003,0
2019-04-16T02:20:00+00:00,-2.9601599999999997,0
2019-04-16T02:25:00+00:00,-2.9108099999999997,0
2019-04-16T02:30:00+00:00,-2.96015,0
2019-04-16T02:35:00+00:00,-2.9601599999999997,0
2019-04-16T02:40:00+00:00,-2.9601599999999997,0
2019-04-16T02:45:00+00:00,-2.88618,0
2019-04-16T02:50:00+00:00,-2.94785,0
2019-04-16T02:55:00+00:00,-2.96017,0
2019-04-16T03:00:00+00:00,-2.9602,0
2019-04-16T03:05:00+00:00,-2.85538,0
2019-04-16T03:10:00+00:00,-2.59021,0
2019-04-16T03:15:00+00:00,-2.5902,0
2019-04-16T03:20:00+00:00,-2.59022,0
2019-04-16T03:25:00+00:00,-2.59024,0
2019-04-16T03:30:00+00:00,-2.59024,0
2019-04-16T03:35:00+00:00,-2.60258,0
2019-04-16T03:40:00+00:00,-2.65192,0
2019-04-16T03:45:00+00:00,-2.70745,0
2019-04-16T03:50:00+00:00,-2.63959,0
2019-04-16T03:55:00+00:00,-2.84312,0
2019-04-16T04:00:00+00:00,-2.8307700000000002,0
2019-04-16T04:05:00+00:00,-2.82457,0
2019-04-16T04:10:00+00:00,-2.96026,0
2019-04-16T04:15:00+00:00,-2.96027,0
2019-04-16T04:20:00+00:00,-2.96025,0
2019-04-16T04:25:00+00:00,-2.9664,0
2019-04-16T04:30:00+00:00,-2.96017,0
2019-04-16T04:35:00+00:00,-2.96015,0
2019-04-16T04:40:00+00:00,-2.96017,0
2019-04-16T04:45:00+00:00,-2.92315,0
2019-04-16T04:50:00+00:00,-2.83682,0
2019-04-16T04:55:00+00:00,-2.94789,0
2019-04-16T05:00:00+00:00,-2.96027,0
2019-04-16T05:05:00+00:00,-2.96026,0
2019-04-16T05:10:00+00:00,-2.95411,0
2019-04-16T05:15:00+00:00,-2.88632,0
2019-04-16T05:20:00+00:00,-2.83701,0
2019-04-16T05:25:00+00:00,-2.9048599999999998,0
2019-04-16T05:30:00+00:00,-2.9603200000000003,0
2019-04-16T05:35:00+00:00,-2.60875,0
2019-04-16T05:40:00+00:00,-2.59026,0
2019-04-16T05:45:00+00:00,-2.69508,0
2019-04-16T05:50:00+00:00,-2.86777,0
2019-04-16T05:55:00+00:00,-2.69506,0
2019-04-16T06:00:00+00:00,-2.59021,0
2019-04-16T06:05:00+00:00,-2.59023,0
2019-04-16T06:10:00+00:00,-2.59022,0
2019-04-16T06:15:00+00:00,-2.59022,0
2019-04-16T06:20:00+00:00,-2.59024,0
2019-04-16T06:25:00+00:00,-2.59023,0
2019-04-16T06:30:00+00:00,-2.59022,0
2019-04-16T06:35:00+00:00,-2.59022,0
2019-04-16T06:40:00+00:00,-2.59023,0
2019-04-16T06:45:00+00:00,-2.59024,0
2019-04-16T06:50:00+00:00,-2.58405,0
2019-04-16T06:55:00+00:00,-2.59019,0
2019-04-16T07:00:00+00:00,-2.59015,0
2019-04-16T07:05:00+00:00,-2.58393,0
2019-04-16T07:10:00+00:00,-2.47913,0
2019-04-16T07:15:00+00:00,-2.54083,0
2019-04-16T07:20:00+00:00,-2.34964,0
2019-04-16T07:25:00+00:00,-2.26333,0
2019-04-16T07:30:00+00:00,-2.57167,0
2019-04-16T07:35:00+00:00,-2.59013,0
2019-04-16T07:40:00+00:00,-2.22627,0
2019-04-16T07:45:00+00:00,-2.26326,0
2019-04-16T07:50:00+00:00,-2.22625,0
2019-04-16T07:55:00+00:00,-2.59008,0
2019-04-16T08:00:00+00:00,-2.5284,0
2019-04-16T08:05:00+00:00,-2.58391,0
2019-04-16T08:10:00+00:00,-2.59001,0
2019-04-16T08:15:00+00:00,-2.59006,0
2019-04-16T08:20:00+00:00,-2.23239,0
2019-04-16T08:25:00+00:00,-2.28786,0
2019-04-16T08:30:00+00:00,-2.33102,0
2019-04-16T08:35:00+00:00,-2.30017,0
2019-04-16T08:40:00+00:00,-2.33714,0
2019-04-16T08:45:00+00:00,-2.27547,0
2019-04-16T08:50:00+00:00,-2.23227,0
2019-04-16T08:55:00+00:00,-2.25694,0
2019-04-16T09:00:00+00:00,-2.36794,0
2019-04-16T09:05:00+00:00,-2.28163,0
2019-04-16T09:10:00+00:00,-2.5899400000000004,0
2019-04-16T09:15:00+00:00,-2.55295,0
2019-04-16T09:20:00+00:00,-2.58995,0
2019-04-16T09:25:00+00:00,-2.58996,0
2019-04-16T09:30:00+00:00,-2.58995,0
2019-04-16T09:35:00+00:00,-1.86847,0
2019-04-16T09:40:00+00:00,-1.8499700000000001,0
2019-04-16T09:45:00+00:00,-2.58997,0
2019-04-16T09:50:00+00:00,-2.58997,0
2019-04-16T09:55:00+00:00,-2.58995,0
2019-04-16T10:00:00+00:00,-2.58993,0
2019-04-16T10:05:00+00:00,-2.5899,0
2019-04-16T10:10:00+00:00,-2.5899,0
2019-04-16T10:15:00+00:00,-2.54675,0
2019-04-16T10:20:00+00:00,-2.2816099999999997,0
2019-04-16T10:25:00+00:00,-2.58993,0
2019-04-16T10:30:00+00:00,-2.58993,0
2019-04-16T10:35:00+00:00,-2.8551,0
2019-04-16T10:40:00+00:00,-2.58992,0
2019-04-16T10:45:00+00:00,-2.22611,0
2019-04-16T10:50:00+00:00,-2.37412,0
2019-04-16T10:55:00+00:00,-2.58995,0
2019-04-16T11:00:00+00:00,-3.08324,0
2019-04-16T11:05:00+00:00,-3.23739,0
2019-04-16T11:10:00+00:00,-3.08324,0
2019-04-16T11:15:00+00:00,-2.58989,0
2019-04-16T11:20:00+00:00,-2.50968,0
2019-04-16T11:25:00+00:00,-2.51578,0
2019-04-16T11:30:00+00:00,-2.41095,0
2019-04-16T11:35:00+00:00,-2.3185,0
2019-04-16T11:40:00+00:00,-2.1705200000000002,0
2019-04-16T11:45:00+00:00,-2.50964,0
2019-04-16T11:50:00+00:00,-2.5898,0
2019-04-16T11:55:00+00:00,-2.58977,0
2019-04-16T12:00:00+00:00,-2.58973,0
2019-04-16T12:05:00+00:00,-2.58356,0
2019-04-16T12:10:00+00:00,-2.18894,0
2019-04-16T12:15:00+00:00,-2.09028,0
2019-04-16T12:20:00+00:00,-1.84982,0
2019-04-16T12:25:00+00:00,-1.9115099999999998,0
2019-04-16T12:30:00+00:00,-2.07183,0
2019-04-16T12:35:00+00:00,-2.21366,0
2019-04-16T12:40:00+00:00,-1.8498299999999999,0
2019-04-16T12:45:00+00:00,-0.653601,0
2019-04-16T12:50:00+00:00,2.61437,0
2019-04-16T12:55:00+00:00,4.0572,0
2019-04-16T13:00:00+00:00,7.22663,0
2019-04-16T13:05:00+00:00,17.3453,0
2019-04-16T13:10:00+00:00,32.329,0
2019-04-16T13:15:00+00:00,49.1626,0
2019-04-16T13:20:00+00:00,64.7622,0
2019-04-16T13:25:00+00:00,83.6739,0
2019-04-16T13:30:00+00:00,92.5838,0
2019-04-16T13:35:00+00:00,90.1717,0
2019-04-16T13:40:00+00:00,112.14399999999999,0
2019-04-16T13:45:00+00:00,164.34799999999998,0
2019-04-16T13:50:00+00:00,234.75599999999997,0
2019-04-16T13:55:00+00:00,246.387,0
2019-04-16T14:00:00+00:00,272.242,0
2019-04-16T14:05:00+00:00,271.619,0
2019-04-16T14:10:00+00:00,286.362,0
2019-04-16T14:15:00+00:00,237.521,0
2019-04-16T14:20:00+00:00,200.06799999999998,0
2019-04-16T14:25:00+00:00,93.2373,0
2019-04-16T14:30:00+00:00,90.6478,0
2019-04-16T14:35:00+00:00,94.2381,0
2019-04-16T14:40:00+00:00,104.932,0
2019-04-16T14:45:00+00:00,120.898,0
2019-04-16T14:50:00+00:00,130.222,0
2019-04-16T14:55:00+00:00,141.884,0
2019-04-16T15:00:00+00:00,216.80200000000002,0
2019-04-16T15:05:00+00:00,288.144,0
2019-04-16T15:10:00+00:00,524.619,0
2019-04-16T15:15:00+00:00,547.526,0
2019-04-16T15:20:00+00:00,140.826,0
2019-04-16T15:25:00+00:00,354.62800000000004,0
2019-04-16T15:30:00+00:00,466.901,0
2019-04-16T15:35:00+00:00,594.6519999999999,0
2019-04-16T15:40:00+00:00,441.285,0
2019-04-16T15:45:00+00:00,539.64,0
2019-04-16T15:50:00+00:00,639.173,0
2019-04-16T15:55:00+00:00,642.967,0
2019-04-16T16:00:00+00:00,658.3919999999999,0
2019-04-16T16:05:00+00:00,679.262,0
2019-04-16T16:10:00+00:00,699.2760000000001,0
2019-04-16T16:15:00+00:00,726.8710000000001,0
2019-04-16T16:20:00+00:00,751.487,0
2019-04-16T16:25:00+00:00,771.829,0
2019-04-16T16:30:00+00:00,728.345,0
2019-04-16T16:35:00+00:00,750.4680000000001,0
2019-04-16T16:40:00+00:00,807.5239999999999,0
2019-04-16T16:45:00+00:00,706.362,0
2019-04-16T16:50:00+00:00,850.466,0
2019-04-16T16:55:00+00:00,940.403,0
2019-04-16T17:00:00+00:00,802.26,0
2019-04-16T17:05:00+00:00,891.529,0
2019-04-16T17:10:00+00:00,289.269,0
2019-04-16T17:15:00+00:00,798.425,0
2019-04-16T17:20:00+00:00,269.858,0
2019-04-16T17:25:00+00:00,329.37,0
2019-04-16T17:30:00+00:00,898.745,0
2019-04-16T17:35:00+00:00,766.643,0
2019-04-16T17:40:00+00:00,1005.39,0
2019-04-16T17:45:00+00:00,887.747,0
2019-04-16T17:50:00+00:00,733.038,0
2019-04-16T17:55:00+00:00,961.1410000000001,0
2019-04-16T18:00:00+00:00,985.0110000000001,0
2019-04-16T18:05:00+00:00,1027.04,0
2019-04-16T18:10:00+00:00,1020.3,0
2019-04-16T18:15:00+00:00,995.9,0
2019-04-16T18:20:00+00:00,1006.89,0
2019-04-16T18:25:00+00:00,1026.46,0
2019-04-16T18:30:00+00:00,1027.81,0
2019-04-16T18:35:00+00:00,1048.59,0
2019-04-16T18:40:00+00:00,1115.36,0
2019-04-16T18:45:00+00:00,1084.52,0
2019-04-16T18:50:00+00:00,1106.36,0
2019-04-16T18:55:00+00:00,1155.42,0
2019-04-16T19:00:00+00:00,794.558,0
2019-04-16T19:05:00+00:00,1197.29,0
2019-04-16T19:10:00+00:00,350.171,0
2019-04-16T19:15:00+00:00,580.599,0
2019-04-16T19:20:00+00:00,1228.67,0
2019-04-16T19:25:00+00:00,1266.43,0
2019-04-16T19:30:00+00:00,1223.9,0
2019-04-16T19:35:00+00:00,1106.54,0
2019-04-16T19:40:00+00:00,1122.57,0
2019-04-16T19:45:00+00:00,1152.58,0
2019-04-16T19:50:00+00:00,719.179,0
2019-04-16T19:55:00+00:00,447.056,0
2019-04-16T20:00:00+00:00,402.275,0
2019-04-16T20:05:00+00:00,595.24,0
2019-04-16T20:10:00+00:00,1173.89,0
2019-04-16T20:15:00+00:00,580.9540000000001,0
2019-04-16T20:20:00+00:00,375.871,0
2019-04-16T20:25:00+00:00,1242.88,0
2019-04-16T20:30:00+00:00,503.10900000000004,0
2019-04-16T20:35:00+00:00,1153.81,0
2019-04-16T20:40:00+00:00,1154.69,0
2019-04-16T20:45:00+00:00,489.097,0
2019-04-16T20:50:00+00:00,401.384,0
2019-04-16T20:55:00+00:00,545.076,0
2019-04-16T21:00:00+00:00,267.79,0
2019-04-16T21:05:00+00:00,196.813,0
2019-04-16T21:10:00+00:00,265.881,0
2019-04-16T21:15:00+00:00,231.655,0
2019-04-16T21:20:00+00:00,296.884,0
2019-04-16T21:25:00+00:00,308.718,0
2019-04-16T21:30:00+00:00,251.62900000000002,0
2019-04-16T21:35:00+00:00,254.757,0
2019-04-16T21:40:00+00:00,311.839,0
2019-04-16T21:45:00+00:00,304.407,0
2019-04-16T21:50:00+00:00,367.164,0
2019-04-16T21:55:00+00:00,311.964,0
2019-04-16T22:00:00+00:00,324.35400000000004,0
2019-04-16T22:05:00+00:00,387.246,0
2019-04-16T22:10:00+00:00,279.862,0
2019-04-16T22:15:00+00:00,164.74900000000002,0
2019-04-16T22:20:00+00:00,117.959,0
2019-04-16T22:25:00+00:00,139.999,0
2019-04-16T22:30:00+00:00,133.882,0
2019-04-16T22:35:00+00:00,98.0075,0
2019-04-16T22:40:00+00:00,82.1886,0
2019-04-16T22:45:00+00:00,93.1478,0
2019-04-16T22:50:00+00:00,102.325,0
2019-04-16T22:55:00+00:00,151.645,0
2019-04-16T23:00:00+00:00,137.683,0
2019-04-16T23:05:00+00:00,243.864,0
2019-04-16T23:10:00+00:00,208.706,0
2019-04-16T23:15:00+00:00,121.73,0
2019-04-16T23:20:00+00:00,107.057,0
2019-04-16T23:25:00+00:00,43.7813,0
2019-04-16T23:30:00+00:00,48.154,0
2019-04-16T23:35:00+00:00,63.4735,0
2019-04-16T23:40:00+00:00,54.4389,0
2019-04-16T23:45:00+00:00,69.6048,0
2019-04-16T23:50:00+00:00,68.4514,0
2019-04-16T23:55:00+00:00,65.0645,0
2019-04-17T00:00:00+00:00,71.5086,0
2019-04-17T00:05:00+00:00,139.45600000000002,0
2019-04-17T00:10:00+00:00,173.799,0
2019-04-17T00:15:00+00:00,170.15400000000002,0
2019-04-17T00:20:00+00:00,115.132,0
2019-04-17T00:25:00+00:00,75.0135,0
2019-04-17T00:30:00+00:00,63.6482,0
2019-04-17T00:35:00+00:00,95.7993,0
2019-04-17T00:40:00+00:00,43.5426,0
2019-04-17T00:45:00+00:00,37.5979,0
2019-04-17T00:50:00+00:00,71.2115,0
2019-04-17T00:55:00+00:00,53.3279,0
2019-04-17T01:00:00+00:00,32.997,0
2019-04-17T01:05:00+00:00,16.6621,0
2019-04-17T01:10:00+00:00,7.67766,0
2019-04-17T01:15:00+00:00,4.32305,0
2019-04-17T01:20:00+00:00,3.5645599999999997,0
2019-04-17T01:25:00+00:00,2.1276599999999997,0
2019-04-17T01:30:00+00:00,3.36729,0
2019-04-17T01:35:00+00:00,1.8378400000000001,0
2019-04-17T01:40:00+00:00,0.7339,0
2019-04-17T01:45:00+00:00,-0.104843,0
2019-04-17T01:50:00+00:00,-0.740074,0
2019-04-17T01:55:00+00:00,-1.4801600000000001,0
2019-04-17T02:00:00+00:00,-1.8501900000000002,0
2019-04-17T02:05:00+00:00,-1.65283,0
2019-04-17T02:10:00+00:00,-2.59021,0
2019-04-17T02:15:00+00:00,-2.96022,0
2019-04-17T02:20:00+00:00,-2.45443,0
2019-04-17T02:25:00+00:00,-1.85005,0
2019-04-17T02:30:00+00:00,-1.8500299999999998,0
2019-04-17T02:35:00+00:00,-1.85,0
2019-04-17T02:40:00+00:00,-2.20764,0
2019-04-17T02:45:00+00:00,-1.8499700000000001,0
2019-04-17T02:50:00+00:00,-1.6402900000000002,0
2019-04-17T02:55:00+00:00,-1.85612,0
2019-04-17T03:00:00+00:00,-1.8499700000000001,0
2019-04-17T03:05:00+00:00,-1.81913,0
2019-04-17T03:10:00+00:00,-1.67113,0
2019-04-17T03:15:00+00:00,-1.84995,0
2019-04-17T03:20:00+00:00,-1.8067900000000001,0
2019-04-17T03:25:00+00:00,-1.8499599999999998,0
2019-04-17T03:30:00+00:00,-1.9856200000000002,0
2019-04-17T03:35:00+00:00,-2.95995,0
2019-04-17T03:40:00+00:00,-2.34331,0
2019-04-17T03:45:00+00:00,-1.51698,0
2019-04-17T03:50:00+00:00,-2.33712,0
2019-04-17T03:55:00+00:00,-4.82225,0
2019-04-17T04:00:00+00:00,-3.9835,0
2019-04-17T04:05:00+00:00,-2.30004,0
2019-04-17T04:10:00+00:00,-2.2198,0
2019-04-17T04:15:00+00:00,-2.90423,0
2019-04-17T04:20:00+00:00,-3.32355,0
2019-04-17T04:25:00+00:00,-2.8610700000000002,0
2019-04-17T04:30:00+00:00,-2.5897900000000003,0
2019-04-17T04:35:00+00:00,-2.21365,0
2019-04-17T04:40:00+00:00,-2.78091,0
2019-04-17T04:45:00+00:00,-3.3296900000000003,0
2019-04-17T04:50:00+00:00,-3.5455,0
2019-04-17T04:55:00+00:00,-2.9597599999999997,0
2019-04-17T05:00:00+00:00,-3.3112,0
2019-04-17T05:05:00+00:00,-2.5898,0
2019-04-17T05:10:00+00:00,-2.58981,0
2019-04-17T05:15:00+00:00,-2.5897799999999997,0
2019-04-17T05:20:00+00:00,-2.5897799999999997,0
2019-04-17T05:25:00+00:00,-1.85601,0
2019-04-17T05:30:00+00:00,-1.8498299999999999,0
2019-04-17T05:35:00+00:00,-1.84981,0
2019-04-17T05:40:00+00:00,-1.84981,0
2019-04-17T05:45:00+00:00,-1.84978,0
2019-04-17T05:50:00+00:00,-1.84978,0
2019-04-17T05:55:00+00:00,-1.8497700000000001,0
2019-04-17T06:00:00+00:00,-1.76964,0
2019-04-17T06:05:00+00:00,-1.51683,0
2019-04-17T06:10:00+00:00,-1.15921,0
2019-04-17T06:15:00+00:00,-1.49834,0
2019-04-17T06:20:00+00:00,-1.51068,0
2019-04-17T06:25:00+00:00,-1.1961899999999999,0
2019-04-17T06:30:00+00:00,-1.84981,0
2019-04-17T06:35:00+00:00,-1.8498700000000001,0
2019-04-17T06:40:00+00:00,-2.18287,0
2019-04-17T06:45:00+00:00,-1.91156,0
2019-04-17T06:50:00+00:00,-1.84988,0
2019-04-17T06:55:00+00:00,-1.8498599999999998,0
"""
obs_df = pd.read_csv(StringIO(ghi_csv))
obs_df = obs_df.set_index('timestamp')
obs_df.index = pd.to_datetime(obs_df.index)
obs_df.index.name = 'timestamp'
return obs_df
@pytest.fixture
def new_role(api):
def fn(**kwargs):
role_json = ROLE.copy()
role_json.update(kwargs)
role = api.post('/roles/', BASE_URL, json=role_json)
role_id = role.data.decode('utf-8')
return role_id
return fn
@pytest.fixture
def new_observation(api):
def fn():
obs = api.post('/observations/', BASE_URL, json=VALID_OBS_JSON)
obs_id = obs.data.decode('utf-8')
return obs_id
return fn
@pytest.fixture
def new_forecast(api):
def fn():
fx = api.post('/forecasts/single/', BASE_URL,
json=VALID_FORECAST_JSON)
fx_id = fx.data.decode('utf-8')
return fx_id
return fn
@pytest.fixture
def new_perm(api):
def fn(**kwargs):
perm_json = PERMISSION.copy()
perm_json.update(kwargs)
perm = api.post('/permissions/', BASE_URL, json=perm_json)
perm_id = perm.data.decode('utf-8')
return perm_id
return fn
@pytest.fixture
def current_roles(api):
roles_req = api.get('/roles/', BASE_URL)
return [role['role_id'] for role in roles_req.json]
@pytest.fixture
def current_role(api, current_roles):
return current_roles[0]
@pytest.fixture
def remove_perms_from_current_role(api, current_role):
def fn(action, object_type):
perm_req = api.get('/permissions/', BASE_URL)
perms = perm_req.json
to_remove = [perm['permission_id'] for perm in perms
if perm['object_type'] == object_type
and perm['action'] == action]
for perm_id in to_remove:
api.delete(f'/roles/{current_role}/permissions/{perm_id}',
BASE_URL)
return fn
@pytest.fixture
def remove_all_perms(api, current_roles):
def fn(action, object_type):
perm_req = api.get('/permissions/', BASE_URL)
perms = perm_req.json
to_remove = [perm['permission_id'] for perm in perms
if perm['object_type'] == object_type
and perm['action'] == action]
for role_id in current_roles:
for perm_id in to_remove:
api.delete(f'/roles/{role_id}/permissions/{perm_id}',
BASE_URL)
return fn
@pytest.fixture
def random_post_payload():
def fn(npts, mimetype, include_flags=True):
idx = pd.date_range(
start=pd.to_datetime('2017-01-01T00:00Z'),
periods=npts,
freq='1min'
)
data = {'value': np.random.uniform(0, 999.9, size=idx.size)}
if include_flags:
data['quality_flags'] = 0
df = pd.DataFrame(data=data, index=idx)
if mimetype == 'application/json':
value_string = json.dumps({
'values': df.to_dict(orient='records')
})
else:
value_string = df.to_csv(index=False)
return value_string
return fn
@pytest.fixture()
def startend():
return '?start=20190101T0000Z&end=20200101T0000Z'
@pytest.fixture()
def root_cursor(mocker):
app = create_app('TestingConfig')
app.config['MYSQL_USER'] = 'root'
app.config['MYSQL_PASSWORD'] = 'testpassword'
with app.app_context():
try:
storage_interface.mysql_connection()
except pymysql.err.OperationalError:
pytest.skip('No connection to test database')
else:
with _make_nocommit_cursor(mocker) as cursor:
yield cursor
@pytest.fixture()
def addmayvalues(root_cursor):
root_cursor.execute(
"INSERT INTO forecasts_values (id, timestamp, value) "
"SELECT id, '2019-05-01 00:00', 1.0 FROM forecasts"
)
root_cursor.execute(
"INSERT INTO observations_values (id, timestamp, value, quality_flag)"
" SELECT id, '2019-05-01 00:00', 1.0, 1 FROM observations"
)
root_cursor.execute(
"INSERT INTO observations_values (id, timestamp, value, quality_flag)"
" SELECT id, '2019-05-02 00:00', 1.0, 5 FROM observations"
)
root_cursor.execute(
"INSERT INTO cdf_forecasts_values (id, timestamp, value) "
"SELECT id, '2019-05-01 00:00', 1.0 FROM cdf_forecasts_singles"
)
def _get_large_test_payload(content_type):
"""Produces a large test payload, to avoid having pytest output print the
contents of a fixture.
"""
if content_type == 'text/csv':
return 'timestamp,value\n'+"1"*17*1024*1024
else:
return '{"values": ['+"1"*17*1024*1024+']}'
@pytest.fixture
def dummy_file():
def req_file(filename, contents, content_type):
return {filename: (contents, filename, content_type)}
return req_file
@pytest.fixture()
def addtestsystemoutages(root_cursor):
root_cursor.execute(
"DELETE FROM system_outages"
)
root_cursor.execute(
"INSERT INTO system_outages (start, end) "
"VALUES ('2019-04-14 07:00', '2019-04-14 10:00')"
)
root_cursor.execute(
"INSERT INTO system_outages (start, end) "
"VALUES ('2019-04-14 010:30', '2019-04-14 13:00')"
)
root_cursor.execute(
"INSERT INTO system_outages (start, end) "
"VALUES ('2019-04-14 15:00', '2019-04-14 17:00')"
)
@pytest.fixture()
def addtestreportoutage(root_cursor):
def fn(report_id, start='2019-04-14 07:00', end='2019-04-14 10:00'):
root_cursor.execute(
"INSERT INTO report_outages (report_id, start, end) "
"VALUES (UUID_TO_BIN(%s, 1), %s, %s)", (report_id, start, end)
)
return fn
def outage_exists(outages, expected):
"""Searches a list of outages for an expected outage defined by
an object with start and end properties.
"""
for outage in outages:
if (
outage['start'] == expected['start']
and outage['end'] == expected['end']
):
return True
return False
| 34.508868
| 120
| 0.659814
| 13,626
| 75,885
| 3.606488
| 0.124101
| 0.147491
| 0.114525
| 0.043161
| 0.465712
| 0.35607
| 0.322372
| 0.276444
| 0.230597
| 0.175573
| 0
| 0.438582
| 0.148844
| 75,885
| 2,198
| 121
| 34.524568
| 0.322248
| 0.014601
| 0
| 0.266165
| 0
| 0.003008
| 0.672292
| 0.524223
| 0
| 0
| 0
| 0
| 0.000501
| 1
| 0.037093
| false
| 0.001504
| 0.007519
| 0.013534
| 0.074687
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4a06941c1fc98c19e86b7b106006add68be78f79
| 97
|
py
|
Python
|
code/pyFoamInitVCSCase.py
|
sosohungry/pyfoam
|
b19e40a0ef1f41268930122226660414722178e6
|
[
"MIT"
] | null | null | null |
code/pyFoamInitVCSCase.py
|
sosohungry/pyfoam
|
b19e40a0ef1f41268930122226660414722178e6
|
[
"MIT"
] | null | null | null |
code/pyFoamInitVCSCase.py
|
sosohungry/pyfoam
|
b19e40a0ef1f41268930122226660414722178e6
|
[
"MIT"
] | null | null | null |
#! /usr/bin/env python
from PyFoam.Applications.InitVCSCase import InitVCSCase
InitVCSCase()
| 13.857143
| 55
| 0.783505
| 11
| 97
| 6.909091
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123711
| 97
| 6
| 56
| 16.166667
| 0.894118
| 0.216495
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
4a17a369272dd73d61bcf9a1aa9faee2c7c67761
| 193
|
py
|
Python
|
src/runner/i_discord_bot_runner.py
|
konrad2508/kokomi-discord-bot
|
5a9d459e92d552fa24ba3ada5188db19d93f0aaa
|
[
"MIT"
] | 2
|
2022-03-02T15:56:41.000Z
|
2022-03-10T16:30:41.000Z
|
src/runner/i_discord_bot_runner.py
|
konrad2508/kokomi-discord-bot
|
5a9d459e92d552fa24ba3ada5188db19d93f0aaa
|
[
"MIT"
] | 2
|
2022-03-10T16:30:20.000Z
|
2022-03-16T14:33:59.000Z
|
src/runner/i_discord_bot_runner.py
|
konrad2508/kokomi-discord-bot
|
5a9d459e92d552fa24ba3ada5188db19d93f0aaa
|
[
"MIT"
] | null | null | null |
from abc import ABC, abstractmethod
class IDiscordBotRunner(ABC):
'''Class responsible for running the bot.'''
@abstractmethod
def run(self) -> None:
'''Runs the bot.'''
| 19.3
| 48
| 0.647668
| 22
| 193
| 5.681818
| 0.727273
| 0.096
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.227979
| 193
| 9
| 49
| 21.444444
| 0.838926
| 0.26943
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
c58fa26cc451ddeb585d48e3a8b9d18f10e73165
| 1,416
|
py
|
Python
|
hackerrank/Algorithms/Floyd - City of Blinding Lights/test.py
|
ATrain951/01.python-com_Qproject
|
c164dd093954d006538020bdf2e59e716b24d67c
|
[
"MIT"
] | 4
|
2020-07-24T01:59:50.000Z
|
2021-07-24T15:14:08.000Z
|
hackerrank/Algorithms/Floyd - City of Blinding Lights/test.py
|
ATrain951/01.python-com_Qproject
|
c164dd093954d006538020bdf2e59e716b24d67c
|
[
"MIT"
] | null | null | null |
hackerrank/Algorithms/Floyd - City of Blinding Lights/test.py
|
ATrain951/01.python-com_Qproject
|
c164dd093954d006538020bdf2e59e716b24d67c
|
[
"MIT"
] | null | null | null |
import unittest
import solution
class TestQ(unittest.TestCase):
def test_case_0(self):
dist = solution.calculate_distances(5,
[1, 1, 1, 1, 2, 3, 4],
[2, 3, 4, 5, 3, 4, 5],
[20, 50, 70, 90, 30, 40, 60])
self.assertEqual(solution.shortest_distance(dist, 1, 4), 70)
self.assertEqual(solution.shortest_distance(dist, 5, 1), -1)
self.assertEqual(solution.shortest_distance(dist, 2, 5), 130)
self.assertEqual(solution.shortest_distance(dist, 3, 4), 40)
self.assertEqual(solution.shortest_distance(dist, 1, 4), 70)
self.assertEqual(solution.shortest_distance(dist, 1, 2), 20)
self.assertEqual(solution.shortest_distance(dist, 3, 1), -1)
self.assertEqual(solution.shortest_distance(dist, 1, 2), 20)
def test_case_1(self):
dist = solution.calculate_distances(4,
[1, 1, 2, 3, 3],
[2, 4, 4, 4, 2],
[5, 24, 6, 4, 7])
self.assertEqual(solution.shortest_distance(dist, 1, 2), 5)
self.assertEqual(solution.shortest_distance(dist, 3, 1), -1)
self.assertEqual(solution.shortest_distance(dist, 1, 4), 11)
if __name__ == '__main__':
unittest.main()
| 42.909091
| 73
| 0.53178
| 168
| 1,416
| 4.333333
| 0.220238
| 0.226648
| 0.347527
| 0.468407
| 0.782967
| 0.68956
| 0.68956
| 0.629121
| 0.504121
| 0.494505
| 0
| 0.095802
| 0.343927
| 1,416
| 32
| 74
| 44.25
| 0.687836
| 0
| 0
| 0.230769
| 0
| 0
| 0.00565
| 0
| 0
| 0
| 0
| 0
| 0.423077
| 1
| 0.076923
| false
| 0
| 0.076923
| 0
| 0.192308
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c59541ab353b33ef50372d6f3200689266ab0c18
| 6,338
|
py
|
Python
|
acos_client/tests/unit/v21/test_slb_service_group_member.py
|
sana-ag/acos-client
|
88707cc029551cfae0d4a32904b9c282d4dad0b4
|
[
"Apache-2.0"
] | 33
|
2015-02-11T16:42:04.000Z
|
2021-08-24T16:06:23.000Z
|
acos_client/tests/unit/v21/test_slb_service_group_member.py
|
sana-ag/acos-client
|
88707cc029551cfae0d4a32904b9c282d4dad0b4
|
[
"Apache-2.0"
] | 154
|
2015-01-12T18:46:28.000Z
|
2022-01-22T13:59:48.000Z
|
acos_client/tests/unit/v21/test_slb_service_group_member.py
|
sana-ag/acos-client
|
88707cc029551cfae0d4a32904b9c282d4dad0b4
|
[
"Apache-2.0"
] | 68
|
2015-01-12T22:29:57.000Z
|
2021-07-13T07:21:05.000Z
|
# Copyright 2014, Doug Wiegley, A10 Networks.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# TODO(bosatsu): Add tests for slb.service_group.member.get_oper() method
from __future__ import absolute_import
from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
from acos_client import client
import acos_client.errors as acos_errors
import responses
HOSTNAME = 'fake_a10'
BASE_URL = "https://{}:443/services/rest/v2.1/?format=json&method=".format(HOSTNAME)
AUTH_URL = "{}authenticate".format(BASE_URL)
CREATE_URL = '{}slb.service_group.member.create&session_id={}'.format(BASE_URL, 'foobar')
DELETE_URL = '{}slb.service_group.member.delete&session_id={}'.format(BASE_URL, 'foobar')
UPDATE_URL = '{}slb.service_group.member.update&session_id={}'.format(BASE_URL, 'foobar')
class TestServiceGroupMember(unittest.TestCase):
def setUp(self):
self.client = client.Client(HOSTNAME, '21', 'fake_username', 'fake_password')
@responses.activate
def test_service_group_member_create(self):
responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
json_response = {
'response': {'status': 'OK'}
}
responses.add(responses.POST, CREATE_URL, json=json_response, status=200)
resp = self.client.slb.service_group.member.create('pool1', 'test1', 80)
self.assertIsNone(resp)
self.assertEqual(len(responses.calls), 2)
self.assertEqual(responses.calls[1].request.method, responses.POST)
self.assertEqual(responses.calls[1].request.url, CREATE_URL)
@responses.activate
def test_service_group_member_create_already_exists(self):
responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
json_response = {
"response": {"status": "fail", "err": {"code": 1405, "msg": "The service group member already exists."}}
}
responses.add(responses.POST, CREATE_URL, json=json_response, status=200)
with self.assertRaises(acos_errors.Exists):
self.client.slb.service_group.member.create('pool1', 'test1', 80)
self.assertEqual(len(responses.calls), 2)
self.assertEqual(responses.calls[1].request.method, responses.POST)
self.assertEqual(responses.calls[1].request.url, CREATE_URL)
@responses.activate
def test_service_group_member_delete(self):
responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
json_response = {
'response': {'status': 'OK'}
}
responses.add(responses.POST, DELETE_URL, json=json_response, status=200)
resp = self.client.slb.service_group.member.delete('pool1', 'test1', 80)
self.assertIsNone(resp)
self.assertEqual(len(responses.calls), 2)
self.assertEqual(responses.calls[1].request.method, responses.POST)
self.assertEqual(responses.calls[1].request.url, DELETE_URL)
@responses.activate
def test_service_group_member_delete_not_found(self):
responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
json_response = {
"response": {"status": "fail", "err": {"code": 1023, "msg": "Can not find the service group member"}}
}
responses.add(responses.POST, DELETE_URL, json=json_response, status=200)
resp = self.client.slb.service_group.member.delete('pool1', 'test1', 80)
self.assertIsNone(resp)
self.assertEqual(len(responses.calls), 2)
self.assertEqual(responses.calls[1].request.method, responses.POST)
self.assertEqual(responses.calls[1].request.url, DELETE_URL)
@responses.activate
def test_service_group_member_update(self):
responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
json_response = {
'response': {'status': 'OK'}
}
responses.add(responses.POST, UPDATE_URL, json=json_response, status=200)
resp = self.client.slb.service_group.member.update('pool1', 'test1', 80, self.client.slb.DOWN)
self.assertIsNone(resp)
self.assertEqual(len(responses.calls), 2)
self.assertEqual(responses.calls[1].request.method, responses.POST)
self.assertEqual(responses.calls[1].request.url, UPDATE_URL)
@responses.activate
def test_service_group_member_update_not_found(self):
responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
json_response = {
"response": {"status": "fail", "err": {"code": 1023, "msg": "Can not find the service group member"}}
}
responses.add(responses.POST, UPDATE_URL, json=json_response, status=200)
with self.assertRaises(acos_errors.NotFound):
self.client.slb.service_group.member.update('pool1', 'test1', 80, self.client.slb.DOWN)
self.assertEqual(len(responses.calls), 2)
self.assertEqual(responses.calls[1].request.method, responses.POST)
self.assertEqual(responses.calls[1].request.url, UPDATE_URL)
@responses.activate
def test_service_group_member_update_no_such_service_group(self):
responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
json_response = {
"response": {"status": "fail", "err": {"code": 67305473, "msg": " No such service group"}}
}
responses.add(responses.POST, UPDATE_URL, json=json_response, status=200)
with self.assertRaises(acos_errors.NotFound):
self.client.slb.service_group.member.update('pool1', 'test1', 80, self.client.slb.DOWN)
self.assertEqual(len(responses.calls), 2)
self.assertEqual(responses.calls[1].request.method, responses.POST)
self.assertEqual(responses.calls[1].request.url, UPDATE_URL)
| 43.115646
| 116
| 0.68823
| 794
| 6,338
| 5.338791
| 0.191436
| 0.06511
| 0.089172
| 0.082567
| 0.75348
| 0.732248
| 0.712432
| 0.712432
| 0.699693
| 0.695447
| 0
| 0.021215
| 0.181919
| 6,338
| 146
| 117
| 43.410959
| 0.796336
| 0.105238
| 0
| 0.627451
| 0
| 0
| 0.131011
| 0.024929
| 0
| 0
| 0
| 0.006849
| 0.27451
| 1
| 0.078431
| false
| 0.009804
| 0.078431
| 0
| 0.166667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c5cdee22e5c59d42752507ba83bff3da27fa9953
| 163
|
py
|
Python
|
examples/kubernetes/lib/custom_jinja2_filter.py
|
tklebanoff/kapitan
|
1e55f356ef0212f98fdf76bddc25f183dd42e694
|
[
"Apache-2.0"
] | null | null | null |
examples/kubernetes/lib/custom_jinja2_filter.py
|
tklebanoff/kapitan
|
1e55f356ef0212f98fdf76bddc25f183dd42e694
|
[
"Apache-2.0"
] | 1
|
2019-03-29T10:38:51.000Z
|
2019-03-29T10:38:51.000Z
|
examples/kubernetes/lib/custom_jinja2_filter.py
|
tklebanoff/kapitan
|
1e55f356ef0212f98fdf76bddc25f183dd42e694
|
[
"Apache-2.0"
] | null | null | null |
import base64
def custom_jinja2_filter(string):
"""encodes a string using base64 schema"""
return base64.b64encode(string.encode("UTF-8")).decode("UTF-8")
| 32.6
| 67
| 0.730061
| 23
| 163
| 5.086957
| 0.73913
| 0.068376
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 0.122699
| 163
| 5
| 67
| 32.6
| 0.741259
| 0.220859
| 0
| 0
| 0
| 0
| 0.081967
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
6803139a5638e6981a70047aa64fa7759c8e3bf6
| 82
|
py
|
Python
|
src/flask_graphql_pandas/__init__.py
|
p768lwy3/flask-graphql-pandas
|
f343d1e49049b73210ce37ac02254e0b910ea0b9
|
[
"MIT"
] | 2
|
2019-11-04T08:40:41.000Z
|
2020-03-19T19:37:05.000Z
|
src/flask_graphql_pandas/__init__.py
|
p768lwy3/flask-graphql-pandas
|
f343d1e49049b73210ce37ac02254e0b910ea0b9
|
[
"MIT"
] | null | null | null |
src/flask_graphql_pandas/__init__.py
|
p768lwy3/flask-graphql-pandas
|
f343d1e49049b73210ce37ac02254e0b910ea0b9
|
[
"MIT"
] | null | null | null |
from .graphqlpandasview import GraphQLPandasView
__all__ = ["GraphQLPandasView"]
| 20.5
| 48
| 0.829268
| 6
| 82
| 10.666667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097561
| 82
| 3
| 49
| 27.333333
| 0.864865
| 0
| 0
| 0
| 0
| 0
| 0.207317
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| 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
| 4
|
a84d3a03ec3904180e731e724be3be9db3538660
| 726
|
py
|
Python
|
py/device/boards/pit.py
|
arccode/factory
|
a1b0fccd68987d8cd9c89710adc3c04b868347ec
|
[
"BSD-3-Clause"
] | 3
|
2022-01-06T16:52:52.000Z
|
2022-03-07T11:30:47.000Z
|
py/device/boards/pit.py
|
arccode/factory
|
a1b0fccd68987d8cd9c89710adc3c04b868347ec
|
[
"BSD-3-Clause"
] | null | null | null |
py/device/boards/pit.py
|
arccode/factory
|
a1b0fccd68987d8cd9c89710adc3c04b868347ec
|
[
"BSD-3-Clause"
] | 1
|
2021-10-24T01:47:22.000Z
|
2021-10-24T01:47:22.000Z
|
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from cros.factory.device.boards import chromeos
from cros.factory.device import device_types
from cros.factory.device import power
class PitPower(power.Power):
def SetChargeState(self, state):
# TODO: Add an actual SetChargeState implementation
logging.info('SetChargeState: Non-functional. See crosbug.com/p/19417')
def GetChargerCurrent(self):
raise NotImplementedError
class PitBoard(chromeos.ChromeOSBoard):
"""Board interface for Pit."""
@device_types.DeviceProperty
def power(self):
return PitPower(self)
| 25.928571
| 75
| 0.769972
| 97
| 726
| 5.742268
| 0.690722
| 0.043088
| 0.08079
| 0.113106
| 0.096948
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014634
| 0.152893
| 726
| 27
| 76
| 26.888889
| 0.891057
| 0.322314
| 0
| 0
| 0
| 0
| 0.113872
| 0
| 0
| 0
| 0
| 0.037037
| 0
| 1
| 0.230769
| false
| 0
| 0.307692
| 0.076923
| 0.769231
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a85dff2b28621c44b710fa8edba724e4a00b0412
| 20
|
py
|
Python
|
testsuite/test.py
|
tsukit2/hasthon
|
45be6c6246aae17135b9be39680799de40162bca
|
[
"MIT"
] | null | null | null |
testsuite/test.py
|
tsukit2/hasthon
|
45be6c6246aae17135b9be39680799de40162bca
|
[
"MIT"
] | null | null | null |
testsuite/test.py
|
tsukit2/hasthon
|
45be6c6246aae17135b9be39680799de40162bca
|
[
"MIT"
] | null | null | null |
"""abcdd
efddfdf"""
| 6.666667
| 10
| 0.6
| 2
| 20
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 20
| 2
| 11
| 10
| 0.666667
| 0.65
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a86adf13be6794c5342e6b321d29c7db40ab7d1c
| 35
|
py
|
Python
|
tests/components/spc/__init__.py
|
domwillcode/home-assistant
|
f170c80bea70c939c098b5c88320a1c789858958
|
[
"Apache-2.0"
] | 30,023
|
2016-04-13T10:17:53.000Z
|
2020-03-02T12:56:31.000Z
|
tests/components/spc/__init__.py
|
jagadeeshvenkatesh/core
|
1bd982668449815fee2105478569f8e4b5670add
|
[
"Apache-2.0"
] | 31,101
|
2020-03-02T13:00:16.000Z
|
2022-03-31T23:57:36.000Z
|
tests/components/spc/__init__.py
|
jagadeeshvenkatesh/core
|
1bd982668449815fee2105478569f8e4b5670add
|
[
"Apache-2.0"
] | 11,956
|
2016-04-13T18:42:31.000Z
|
2020-03-02T09:32:12.000Z
|
"""Tests for the spc component."""
| 17.5
| 34
| 0.657143
| 5
| 35
| 4.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 35
| 1
| 35
| 35
| 0.766667
| 0.8
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a87016099cc5a3c7d5292dfe478d8bba2de6e207
| 135
|
py
|
Python
|
lib/__init__.py
|
mikniloes/frcnn-sutdy
|
f9aacb22f0e4306dc5cc54aebc6172e129bc2d93
|
[
"MIT"
] | 1
|
2021-04-12T03:26:23.000Z
|
2021-04-12T03:26:23.000Z
|
lib/__init__.py
|
mikniloes/frcnn-sutdy
|
f9aacb22f0e4306dc5cc54aebc6172e129bc2d93
|
[
"MIT"
] | 3
|
2021-04-07T05:28:56.000Z
|
2021-08-25T01:23:36.000Z
|
lib/__init__.py
|
mikniloes/frcnn-sutdy
|
f9aacb22f0e4306dc5cc54aebc6172e129bc2d93
|
[
"MIT"
] | null | null | null |
import os
import sys
lib_path = os.path.join(os.path.dirname(__file__))
if lib_path not in sys.path:
sys.path.insert(0, lib_path)
| 19.285714
| 50
| 0.740741
| 26
| 135
| 3.576923
| 0.5
| 0.225806
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008621
| 0.140741
| 135
| 6
| 51
| 22.5
| 0.793103
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
a87dd0b83311034ceae7ddb83e11751181b28e4d
| 5,282
|
py
|
Python
|
tests/test_palettetools_constants.py
|
fossabot/palette-tools
|
c44be30d783998edb17a30b7f323df65df8170a4
|
[
"BSD-2-Clause"
] | null | null | null |
tests/test_palettetools_constants.py
|
fossabot/palette-tools
|
c44be30d783998edb17a30b7f323df65df8170a4
|
[
"BSD-2-Clause"
] | null | null | null |
tests/test_palettetools_constants.py
|
fossabot/palette-tools
|
c44be30d783998edb17a30b7f323df65df8170a4
|
[
"BSD-2-Clause"
] | null | null | null |
BLACK_HEX = '000'
WHITE_HEX = 'fff'
IMG_BLUEHAT = "https://assets.imgix.net/examples/bluehat.jpg"
IMG_PINE = "https://sherwinski.imgix.net/pineneedles.jpg"
BROKEN_URL = "https://assets.imgix.net/examples/invalid"
INVALID_URL = "https://google.com"
CSS_BLUEHAT = """.image-fg-1 { color:#0d0c10 !important; } .image-bg-1 { background-color:#0d0c10 !important; } .image-fg-2 { color:#015091 !important; } .image-bg-2 { background-color:#015091 !important; } .image-fg-3 { color:#0870d3 !important; } .image-bg-3 { background-color:#0870d3 !important; } .image-fg-4 { color:#239be0 !important; } .image-bg-4 { background-color:#239be0 !important; } .image-fg-5 { color:#b1dfeb !important; } .image-bg-5 { background-color:#b1dfeb !important; } .image-fg-6 { color:#f0c9b4 !important; } .image-bg-6 { background-color:#f0c9b4 !important; } .image-fg-ex-1 { color:#000000 !important; } .image-bg-ex-1 { background-color:#000000 !important; } .image-fg-ex-2 { color:#ffffff !important; } .image-bg-ex-2 { background-color:#ffffff !important; } .image-fg-vibrant { color:#0d95e4 !important; } .image-bg-vibrant { background-color:#0d95e4 !important; } .image-fg-muted-dark { color:#38445c !important; } .image-bg-muted-dark { background-color:#38445c !important; } .image-fg-muted { color:#966760 !important; } .image-bg-muted { background-color:#966760 !important; } .image-fg-vibrant-light { color:#72c5f4 !important; } .image-bg-vibrant-light { background-color:#72c5f4 !important; } .image-fg-muted-light { color:#d8b6aa !important; } .image-bg-muted-light { background-color:#d8b6aa !important; } .image-fg-vibrant-dark { color:#015091 !important; } .image-bg-vibrant-dark { background-color:#015091 !important; }"""
JSON_BLUEHAT = {'colors': [{'red': 0.0509804, 'hex': '#0d0c10', 'blue': 0.0627451, 'green': 0.0470588}, {'red': 0.00392157, 'hex': '#015091', 'blue': 0.568627, 'green': 0.313725}, {'red': 0.0313725, 'hex': '#0870d3', 'blue': 0.827451, 'green': 0.439216}, {'red': 0.137255, 'hex': '#239be0', 'blue': 0.878431, 'green': 0.607843}, {'red': 0.694118, 'hex': '#b1dfeb', 'blue': 0.921569, 'green': 0.87451}, {'red': 0.941176, 'hex': '#f0c9b4', 'blue': 0.705882, 'green': 0.788235}], 'average_luminance': 0.708396, 'dominant_colors': {'vibrant': {'red': 0.0509804, 'hex': '#0d95e4', 'blue': 0.894118, 'green': 0.584314}, 'muted_light': {'red': 0.847059, 'hex': '#d8b6aa', 'blue': 0.666667, 'green': 0.713725}, 'muted': {'red': 0.588235, 'hex': '#966760', 'blue': 0.376471, 'green': 0.403922}, 'vibrant_dark': {'red': 0.00392157, 'hex': '#015091', 'blue': 0.568627, 'green': 0.313725}, 'vibrant_light': {'red': 0.447059, 'hex': '#72c5f4', 'blue': 0.956863, 'green': 0.772549}, 'muted_dark': {'red': 0.219608, 'hex': '#38445c', 'blue': 0.360784, 'green': 0.266667}}}
CSS_PINE = """.image-fg-1 { color:#f6e4ee !important; } .image-bg-1 { background-color:#f6e4ee !important; } .image-fg-2 { color:#d9afc3 !important; } .image-bg-2 { background-color:#d9afc3 !important; } .image-fg-3 { color:#aac373 !important; } .image-bg-3 { background-color:#aac373 !important; } .image-fg-4 { color:#6e9170 !important; } .image-bg-4 { background-color:#6e9170 !important; } .image-fg-5 { color:#375d2d !important; } .image-bg-5 { background-color:#375d2d !important; } .image-fg-6 { color:#2c4309 !important; } .image-bg-6 { background-color:#2c4309 !important; } .image-fg-ex-1 { color:#ffffff !important; } .image-bg-ex-1 { background-color:#ffffff !important; } .image-fg-ex-2 { color:#000000 !important; } .image-bg-ex-2 { background-color:#000000 !important; } .image-fg-vibrant { color:#aac373 !important; } .image-bg-vibrant { background-color:#aac373 !important; } .image-fg-muted-dark { color:#36522c !important; } .image-bg-muted-dark { background-color:#36522c !important; } .image-fg-muted { color:#98656d !important; } .image-bg-muted { background-color:#98656d !important; } .image-fg-vibrant-light { color:#e1acba !important; } .image-bg-vibrant-light { background-color:#e1acba !important; } .image-fg-muted-light { color:#d3abb5 !important; } .image-bg-muted-light { background-color:#d3abb5 !important; } .image-fg-vibrant-dark { color:#2c4309 !important; } .image-bg-vibrant-dark { background-color:#2c4309 !important; }"""
JSON_PINE = {'colors': [{'red': 0.964706, 'hex': '#f6e4ee', 'blue': 0.933333, 'green': 0.894118}, {'red': 0.85098, 'hex': '#d9afc3', 'blue': 0.764706, 'green': 0.686275}, {'red': 0.666667, 'hex': '#aac373', 'blue': 0.45098, 'green': 0.764706}, {'red': 0.431373, 'hex': '#6e9170', 'blue': 0.439216, 'green': 0.568627}, {'red': 0.215686, 'hex': '#375d2d', 'blue': 0.176471, 'green': 0.364706}, {'red': 0.172549, 'hex': '#2c4309', 'blue': 0.0352941, 'green': 0.262745}], 'average_luminance': 0.38134, 'dominant_colors': {'vibrant': {'red': 0.666667, 'hex': '#aac373', 'blue': 0.45098, 'green': 0.764706}, 'muted_light': {'red': 0.827451, 'hex': '#d3abb5', 'blue': 0.709804, 'green': 0.670588}, 'muted': {'red': 0.596078, 'hex': '#98656d', 'blue': 0.427451, 'green': 0.396078}, 'vibrant_dark': {'red': 0.172549, 'hex': '#2c4309', 'blue': 0.0352941, 'green': 0.262745}, 'vibrant_light': {'red': 0.882353, 'hex': '#e1acba', 'blue': 0.729412, 'green': 0.67451}, 'muted_dark': {'red': 0.211765, 'hex': '#36522c', 'blue': 0.172549, 'green': 0.321569}}}
| 377.285714
| 1,465
| 0.662817
| 730
| 5,282
| 4.765753
| 0.175342
| 0.217304
| 0.128773
| 0.039667
| 0.61167
| 0.492095
| 0.208106
| 0.073584
| 0.073584
| 0.073584
| 0
| 0.180214
| 0.098637
| 5,282
| 14
| 1,466
| 377.285714
| 0.550515
| 0
| 0
| 0
| 0
| 0.2
| 0.712474
| 0.177172
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a88895b39ad9b10a85ef11cb104b05c1acd7d81a
| 225
|
py
|
Python
|
PacketHandler/Filters/http_200_filter.py
|
akbokha/fhttp
|
6ac98ac9abe56259565d45854f58daf4ab808d65
|
[
"MIT"
] | 1
|
2018-03-19T10:16:37.000Z
|
2018-03-19T10:16:37.000Z
|
PacketHandler/Filters/http_200_filter.py
|
akbokha/fhttp
|
6ac98ac9abe56259565d45854f58daf4ab808d65
|
[
"MIT"
] | 3
|
2018-03-22T23:38:09.000Z
|
2018-04-07T09:09:53.000Z
|
PacketHandler/Filters/http_200_filter.py
|
akbokha/fhttp
|
6ac98ac9abe56259565d45854f58daf4ab808d65
|
[
"MIT"
] | null | null | null |
from PacketHandler.Filters.tcp_regex_filter import TcpRegexFilter
class Http200Filter(TcpRegexFilter):
def __init__(self):
super(Http200Filter, self).__init__('^HTTP/\d(\.\d)? 200 OK[^\n]*\r\n[\s\S]*$')
| 28.125
| 88
| 0.68
| 28
| 225
| 5.107143
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04712
| 0.151111
| 225
| 7
| 89
| 32.142857
| 0.701571
| 0
| 0
| 0
| 0
| 0
| 0.183486
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
a88a697761f22c65563cf870292030cba1b1f8e2
| 65
|
py
|
Python
|
tests/__init__.py
|
raydeean/apphelpers
|
b2a77a8e7b04497f1c844cfb8caae77b95b74a5a
|
[
"MIT"
] | 1
|
2019-05-10T06:55:11.000Z
|
2019-05-10T06:55:11.000Z
|
tests/__init__.py
|
raydeean/apphelpers
|
b2a77a8e7b04497f1c844cfb8caae77b95b74a5a
|
[
"MIT"
] | 4
|
2019-05-08T07:40:06.000Z
|
2020-08-01T01:42:39.000Z
|
tests/__init__.py
|
scrolltech/commonlib
|
2ae0c9206c631ea5942024a00755f2d858de9d3f
|
[
"MIT"
] | 5
|
2019-04-26T06:57:48.000Z
|
2020-12-24T12:10:22.000Z
|
# -*- coding: utf-8 -*-
"""Unit test package for apphelpers."""
| 16.25
| 39
| 0.584615
| 8
| 65
| 4.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018519
| 0.169231
| 65
| 3
| 40
| 21.666667
| 0.685185
| 0.861538
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a88e4ec10da72c65a142dc2b23fc189a94886969
| 128
|
py
|
Python
|
school_management_system_app/apps.py
|
AgereJoseph1/Basic-school-management-system
|
8ed7405654f40738e91546d05ad5e8e02d6dde4b
|
[
"MIT"
] | null | null | null |
school_management_system_app/apps.py
|
AgereJoseph1/Basic-school-management-system
|
8ed7405654f40738e91546d05ad5e8e02d6dde4b
|
[
"MIT"
] | null | null | null |
school_management_system_app/apps.py
|
AgereJoseph1/Basic-school-management-system
|
8ed7405654f40738e91546d05ad5e8e02d6dde4b
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class SchoolManagementSystemAppConfig(AppConfig):
name = 'school_management_system_app'
| 21.333333
| 49
| 0.828125
| 13
| 128
| 7.923077
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117188
| 128
| 5
| 50
| 25.6
| 0.911504
| 0
| 0
| 0
| 0
| 0
| 0.21875
| 0.21875
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a89f298697050a2c424f873ab03e66ee832c4dc3
| 35
|
py
|
Python
|
lib/python3.5/tarfile.py
|
hwroitzsch/BikersLifeSaver
|
469c738fdd6352c44a3f20689b17fa8ac04ad8a2
|
[
"MIT"
] | 1
|
2020-08-16T04:04:23.000Z
|
2020-08-16T04:04:23.000Z
|
lib/python3.5/tarfile.py
|
hwroitzsch/BikersLifeSaver
|
469c738fdd6352c44a3f20689b17fa8ac04ad8a2
|
[
"MIT"
] | 5
|
2020-06-05T18:53:24.000Z
|
2021-12-13T19:49:15.000Z
|
lib/python3.5/tarfile.py
|
hwroitzsch/BikersLifeSaver
|
469c738fdd6352c44a3f20689b17fa8ac04ad8a2
|
[
"MIT"
] | null | null | null |
/usr/local/lib/python3.5/tarfile.py
| 35
| 35
| 0.8
| 7
| 35
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057143
| 0
| 35
| 1
| 35
| 35
| 0.742857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a8b0618153c23f3f05035f147b3c8b031783ae72
| 104
|
py
|
Python
|
app/routers.py
|
eason-lee/fastapi-demo
|
89f0b6be6c6038d90179cf8772895b337642a717
|
[
"Apache-2.0"
] | null | null | null |
app/routers.py
|
eason-lee/fastapi-demo
|
89f0b6be6c6038d90179cf8772895b337642a717
|
[
"Apache-2.0"
] | null | null | null |
app/routers.py
|
eason-lee/fastapi-demo
|
89f0b6be6c6038d90179cf8772895b337642a717
|
[
"Apache-2.0"
] | null | null | null |
from fastapi import APIRouter
router = APIRouter(prefix='/v1/statistics')
from . import views # noqa
| 17.333333
| 43
| 0.75
| 13
| 104
| 6
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011364
| 0.153846
| 104
| 5
| 44
| 20.8
| 0.875
| 0.038462
| 0
| 0
| 0
| 0
| 0.142857
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a8c1012999ba957c11308ab8fa526f84f1cb49de
| 19
|
py
|
Python
|
epcy/__init__.py
|
iric-soft/epcy
|
48af624731c8665298321ebb5df526708761cd2f
|
[
"MIT"
] | 5
|
2019-08-12T13:46:45.000Z
|
2022-03-18T13:53:06.000Z
|
epcy/__init__.py
|
iric-soft/epcy
|
48af624731c8665298321ebb5df526708761cd2f
|
[
"MIT"
] | 4
|
2019-12-09T17:16:22.000Z
|
2021-05-28T19:26:13.000Z
|
epcy/__init__.py
|
iric-soft/epcy
|
48af624731c8665298321ebb5df526708761cd2f
|
[
"MIT"
] | null | null | null |
__all__ = ['epcy']
| 9.5
| 18
| 0.578947
| 2
| 19
| 3.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 19
| 1
| 19
| 19
| 0.4375
| 0
| 0
| 0
| 0
| 0
| 0.210526
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7633ea98b4a071ce47249acd518175c0ebd00fcb
| 24
|
py
|
Python
|
tornado_swagger/__init__.py
|
Cthulhu2/tornado-swagger
|
bb940387657c7dc4109194a0bc66768b53725d61
|
[
"MIT"
] | null | null | null |
tornado_swagger/__init__.py
|
Cthulhu2/tornado-swagger
|
bb940387657c7dc4109194a0bc66768b53725d61
|
[
"MIT"
] | null | null | null |
tornado_swagger/__init__.py
|
Cthulhu2/tornado-swagger
|
bb940387657c7dc4109194a0bc66768b53725d61
|
[
"MIT"
] | null | null | null |
__version__ = "1.4.1.1"
| 12
| 23
| 0.625
| 5
| 24
| 2.2
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.190476
| 0.125
| 24
| 1
| 24
| 24
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0.291667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7678ac784fd447d19042c62abe42215bbc9b6aaf
| 456
|
py
|
Python
|
tests/plugs/wrong/__init__.py
|
PapuutekAPT/flask-plugins
|
5eaf538da18255a9689fb6552d0f649803f04c58
|
[
"BSD-3-Clause"
] | 38
|
2015-04-22T13:46:07.000Z
|
2021-12-14T05:27:27.000Z
|
tests/plugs/wrong/__init__.py
|
PapuutekAPT/flask-plugins
|
5eaf538da18255a9689fb6552d0f649803f04c58
|
[
"BSD-3-Clause"
] | 16
|
2015-01-06T14:05:12.000Z
|
2022-03-25T12:36:14.000Z
|
tests/plugs/wrong/__init__.py
|
PapuutekAPT/flask-plugins
|
5eaf538da18255a9689fb6552d0f649803f04c58
|
[
"BSD-3-Clause"
] | 33
|
2015-02-19T18:54:32.000Z
|
2022-01-03T09:13:12.000Z
|
from flask_plugins import Plugin
__plugin__ = "WrongPluginClass"
class TestWrongPlugin(Plugin):
name = "Test Wrong"
description = "Test Wrong description"
author = "test1"
license = "BSD"
version = "1.0"
def enable(self): # pragma: no cover
pass
def disable(self): # pragma: no cover
pass
def install(self): # pragma: no cover
pass
def uninstall(self): # pragma: no cover
pass
| 19
| 44
| 0.614035
| 52
| 456
| 5.288462
| 0.557692
| 0.145455
| 0.174545
| 0.247273
| 0.338182
| 0.261818
| 0
| 0
| 0
| 0
| 0
| 0.009317
| 0.29386
| 456
| 23
| 45
| 19.826087
| 0.844721
| 0.14693
| 0
| 0.25
| 0
| 0
| 0.153646
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.0625
| 0
| 0.6875
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
767c7bfec2dc5cc4962ffd7e88d5b0ca149f4c6a
| 217
|
py
|
Python
|
Tutorial_Code/HeadandTailLights.py
|
aldavhu221/aldavhu221
|
67e9008ecd5c489ed31a314e9eb66a4393169f3c
|
[
"MIT"
] | 3
|
2021-12-29T21:32:30.000Z
|
2022-01-29T13:05:48.000Z
|
Tutorial_Code/HeadandTailLights.py
|
aldavhu221/aldavhu221
|
67e9008ecd5c489ed31a314e9eb66a4393169f3c
|
[
"MIT"
] | 2
|
2022-01-13T08:06:53.000Z
|
2022-02-02T14:19:22.000Z
|
Tutorial_Code/HeadandTailLights.py
|
aldavhu221/aldavhu221
|
67e9008ecd5c489ed31a314e9eb66a4393169f3c
|
[
"MIT"
] | 2
|
2022-01-13T01:42:06.000Z
|
2022-01-26T13:56:32.000Z
|
from PicoAutonomousRobotics import KitronikPicoRobotBuggy
buggy = KitronikPicoRobotBuggy()
buggy.setLED(0, buggy.WHITE)
buggy.setLED(1, buggy.WHITE)
buggy.setLED(2, buggy.RED)
buggy.setLED(3, buggy.RED)
buggy.show()
| 24.111111
| 57
| 0.801843
| 28
| 217
| 6.214286
| 0.464286
| 0.252874
| 0.172414
| 0.241379
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.078341
| 217
| 8
| 58
| 27.125
| 0.85
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.142857
| 0
| 0.142857
| 0
| 1
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
76ae82b15f01504a93296af1208b56eb24a2e96d
| 56
|
py
|
Python
|
test_apps/python_app/example/patterns/empty.py
|
Origen-SDK/o2
|
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
|
[
"MIT"
] | null | null | null |
test_apps/python_app/example/patterns/empty.py
|
Origen-SDK/o2
|
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
|
[
"MIT"
] | 127
|
2019-11-23T17:09:35.000Z
|
2021-09-02T11:06:20.000Z
|
test_apps/python_app/example/patterns/empty.py
|
Origen-SDK/o2
|
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
|
[
"MIT"
] | null | null | null |
# Corner case for generating a pattern with no contents
| 28
| 55
| 0.803571
| 9
| 56
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178571
| 56
| 1
| 56
| 56
| 0.978261
| 0.946429
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
76b79700d3fb7c05ce139ef95b9929bab4bb3851
| 1,825
|
py
|
Python
|
blog/models.py
|
peymanhc/django_animated
|
6180a3f4d5125e6df7ac00062601865d05148cba
|
[
"MIT"
] | 1
|
2021-04-16T11:46:49.000Z
|
2021-04-16T11:46:49.000Z
|
blog/models.py
|
peymanhc/django_animated
|
6180a3f4d5125e6df7ac00062601865d05148cba
|
[
"MIT"
] | null | null | null |
blog/models.py
|
peymanhc/django_animated
|
6180a3f4d5125e6df7ac00062601865d05148cba
|
[
"MIT"
] | null | null | null |
from django.db import models
class Post(models.Model):
id = models.AutoField(primary_key=True)
title = models.CharField(max_length=255)
image = models.FileField(null=True,blank=True,upload_to='')
slug = models.SlugField()
intro = models.TextField()
body = models.TextField()
date_added = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.title
def extension(self):
name, extension = os.path.splitext(self.file.name)
return extension
class Meta:
ordering = ['-date_added']
class About(models.Model):
id = models.AutoField(primary_key=True)
title = models.CharField(max_length=255)
body = models.TextField()
date_added = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = ['title']
class MyTeam(models.Model):
id = models.AutoField(primary_key=True)
image = models.FileField(null=True,blank=True,upload_to='')
title = models.CharField(max_length=255)
body = models.TextField()
date_added = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ['-date_added']
class Gallery(models.Model):
id = models.AutoField(primary_key=True)
image = models.FileField(null=True,blank=True,upload_to='')
class Video(models.Model):
id = models.AutoField(primary_key=True)
title = models.CharField(max_length=255,default="Video")
video = models.FileField(null=True,blank=True,upload_to='')
class Comment(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255)
email = models.EmailField()
phone = models.CharField(max_length=255,default="")
body = models.TextField()
date_added = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ['date_added']
| 31.465517
| 63
| 0.695342
| 233
| 1,825
| 5.287554
| 0.253219
| 0.051136
| 0.063312
| 0.092532
| 0.790584
| 0.768669
| 0.706169
| 0.706169
| 0.672078
| 0.594968
| 0
| 0.01204
| 0.180822
| 1,825
| 58
| 64
| 31.465517
| 0.81204
| 0
| 0
| 0.553191
| 0
| 0
| 0.023001
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.042553
| false
| 0
| 0.021277
| 0.021277
| 0.893617
| 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
| 1
| 0
|
0
| 4
|
76bfb458a64991f35a39e9c5bac7472638d43e10
| 197
|
py
|
Python
|
src/bxcommon/models/entity_type_model.py
|
dolphinridercrypto/bxcommon
|
8f70557c1dbff785a5dd3fcdf91176066e085c3a
|
[
"MIT"
] | 12
|
2019-11-06T17:39:10.000Z
|
2022-03-01T11:26:19.000Z
|
src/bxcommon/models/entity_type_model.py
|
dolphinridercrypto/bxcommon
|
8f70557c1dbff785a5dd3fcdf91176066e085c3a
|
[
"MIT"
] | 8
|
2019-11-06T21:31:11.000Z
|
2021-06-02T00:46:50.000Z
|
src/bxcommon/models/entity_type_model.py
|
dolphinridercrypto/bxcommon
|
8f70557c1dbff785a5dd3fcdf91176066e085c3a
|
[
"MIT"
] | 5
|
2019-11-14T18:08:11.000Z
|
2022-02-08T09:36:22.000Z
|
from bxcommon.models.serializable_flag import SerializableFlag
class EntityType(SerializableFlag):
TRANSACTION = 1
BLOCK = 2
def __str__(self):
return str(self.name).lower()
| 19.7
| 62
| 0.720812
| 22
| 197
| 6.227273
| 0.863636
| 0.10219
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012658
| 0.19797
| 197
| 9
| 63
| 21.888889
| 0.85443
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.166667
| 0.166667
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
4f1e7c4f6a5e4b76f9005c5174e458456096a869
| 73
|
py
|
Python
|
dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_list_comp_1.py
|
pbarton666/virtual_classroom
|
a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675
|
[
"MIT"
] | null | null | null |
dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_list_comp_1.py
|
pbarton666/virtual_classroom
|
a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675
|
[
"MIT"
] | null | null | null |
dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_list_comp_1.py
|
pbarton666/virtual_classroom
|
a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675
|
[
"MIT"
] | null | null | null |
#py_list_comp_1.py
print([str(x)+"!" for x in [y for y in range(10)]])
| 14.6
| 51
| 0.616438
| 17
| 73
| 2.470588
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04918
| 0.164384
| 73
| 4
| 52
| 18.25
| 0.639344
| 0.232877
| 0
| 0
| 0
| 0
| 0.018519
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
4f2639530ddc7d70d60b07c0474a6b61477f3ce8
| 134
|
py
|
Python
|
servercraft/code_model/script.py
|
jumphone/ServerCraft
|
a5031d433a8344229411602fd7257f231f4e92d6
|
[
"Apache-2.0"
] | 1
|
2016-11-02T22:27:22.000Z
|
2016-11-02T22:27:22.000Z
|
servercraft/code_model/script.py
|
jumphone/ServerCraft
|
a5031d433a8344229411602fd7257f231f4e92d6
|
[
"Apache-2.0"
] | null | null | null |
servercraft/code_model/script.py
|
jumphone/ServerCraft
|
a5031d433a8344229411602fd7257f231f4e92d6
|
[
"Apache-2.0"
] | null | null | null |
SCRIPT=r'''
import sys,time
fi=open(sys.argv[1])
time.sleep(8)
fo=open(sys.argv[2],'w')
fo.write(fi.read())
fi.close()
fo.close()
'''
| 13.4
| 24
| 0.641791
| 27
| 134
| 3.185185
| 0.62963
| 0.162791
| 0.255814
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.024194
| 0.074627
| 134
| 9
| 25
| 14.888889
| 0.669355
| 0
| 0
| 0
| 0
| 0
| 0.88806
| 0.179104
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 0.111111
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4f39031801f5221a7c121cd781047ff5a879b273
| 28,302
|
py
|
Python
|
examples/siftmov.py
|
AppGonder/face_recognition
|
c69d55868fcd456a873c7f95d779d630adc10b0c
|
[
"MIT"
] | null | null | null |
examples/siftmov.py
|
AppGonder/face_recognition
|
c69d55868fcd456a873c7f95d779d630adc10b0c
|
[
"MIT"
] | null | null | null |
examples/siftmov.py
|
AppGonder/face_recognition
|
c69d55868fcd456a873c7f95d779d630adc10b0c
|
[
"MIT"
] | null | null | null |
import face_recognition
import urllib.request
import boto3
import requests
import pyodbc
from time import time
from flask import Flask, jsonify, request, redirect, g, render_template
from flask_cors import CORS
from PIL import Image, ImageDraw
import io
import time
import base64
import numpy as np
from datetime import datetime
import json
from io import BytesIO, StringIO
# You can change this to any folder on your system
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
app = Flask(__name__)
app.config['CORS_HEADERS'] = 'Content-Type'
app.config['CORS_HEADERS'] = 'Access-Control-Allow-Origin'
cors = CORS(app)
conn = pyodbc.connect(
# Driver que será utilizado na conexão
'DRIVER={ODBC Driver 17 for SQL Server};'
# IP ou nome do servidor.
'SERVER=gonder.c76jyhbi90dm.sa-east-1.rds.amazonaws.com;'
# Porta
'PORT=1433;'
# Banco que será utilizado.
'DATABASE=Api;'
# Nome de usuário.
f'UID=gonder;'
# Senha.
f'PWD=G0nder!#200&') # integrated security
cursor = conn.cursor()
@app.route('/face-recognition', methods=['POST'])
def face():
req_data = request.get_json(force=True)
token = req_data['token']
if(token != 'df9e299a3f37269c51626c9440c94372'):
result = {
"status": False,
"message": 'Token inválido',
}
return jsonify(result)
else:
g.start = time.time()
diff = str(round((time.time() - g.start) * 1000, 2)) + ' ms'
client_id = req_data['client_id']
base64String = req_data['imageData']
unkown_image = face_recognition.load_image_file(io.BytesIO(base64.b64decode(base64String)))
data = []
face_found = False
if(len(face_recognition.face_encodings(unkown_image)) > 0):
face_enc = face_recognition.face_encodings(unkown_image)[0]
SQL = ('''
EXEC [Api].[dbo].[Face_Recognition]
@client_id =?,
@e1=?, @e2=?, @e3=?, @e4=?, @e5=?, @e6=?, @e7=?, @e8=?, @e9=?, @e10=?,
@e11=?, @e12=?, @e13=?, @e14=?, @e15=?, @e16=?, @e17=?, @e18=?, @e19=?, @e20=?,
@e21=?, @e22=?, @e23=?, @e24=?, @e25=?, @e26=?, @e27=?, @e28=?, @e29=?, @e30=?,
@e31=?, @e32=?, @e33=?, @e34=?, @e35=?, @e36=?, @e37=?, @e38=?, @e39=?, @e40=?,
@e41=?, @e42=?, @e43=?, @e44=?, @e45=?, @e46=?, @e47=?, @e48=?, @e49=?, @e50=?,
@e51=?, @e52=?, @e53=?, @e54=?, @e55=?, @e56=?, @e57=?, @e58=?, @e59=?, @e60=?,
@e61=?, @e62=?, @e63=?, @e64=?, @e65=?, @e66=?, @e67=?, @e68=?, @e69=?, @e70=?,
@e71=?, @e72=?, @e73=?, @e74=?, @e75=?, @e76=?, @e77=?, @e78=?, @e79=?, @e80=?,
@e81=?, @e82=?, @e83=?, @e84=?, @e85=?, @e86=?, @e87=?, @e88=?, @e89=?, @e90=?,
@e91=?, @e92=?, @e93=?, @e94=?, @e95=?, @e96=?, @e97=?, @e98=?, @e99=?, @e100=?,
@e101=?, @e102=?, @e103=?, @e104=?, @e105=?, @e106=?, @e107=?, @e108=?, @e109=?, @e110=?,
@e111=?, @e112=?, @e113=?, @e114=?, @e115=?, @e116=?, @e117=?, @e118=?, @e119=?, @e120=?,
@e121=?, @e122=?, @e123=?, @e124=?, @e125=?, @e126=?, @e127=?, @e128=?;
''')
Values = [client_id, face_enc[0], face_enc[1], face_enc[2], face_enc[3], face_enc[4], face_enc[5], face_enc[6], face_enc[7], face_enc[8],
face_enc[9], face_enc[10], face_enc[11], face_enc[12], face_enc[13], face_enc[14], face_enc[15], face_enc[16], face_enc[17], face_enc[18], face_enc[19],
face_enc[20], face_enc[21], face_enc[22], face_enc[23], face_enc[24], face_enc[25], face_enc[26], face_enc[27], face_enc[28], face_enc[29], face_enc[30],
face_enc[31], face_enc[32], face_enc[33], face_enc[34], face_enc[35], face_enc[36], face_enc[37], face_enc[38], face_enc[39], face_enc[40], face_enc[41],
face_enc[42], face_enc[43], face_enc[44], face_enc[45], face_enc[46], face_enc[47], face_enc[48], face_enc[49], face_enc[50], face_enc[51], face_enc[52],
face_enc[53], face_enc[54], face_enc[55], face_enc[56], face_enc[57], face_enc[58], face_enc[59], face_enc[60], face_enc[61], face_enc[62], face_enc[63],
face_enc[64], face_enc[65], face_enc[66], face_enc[67], face_enc[68], face_enc[69], face_enc[70], face_enc[71], face_enc[72], face_enc[73], face_enc[74],
face_enc[75], face_enc[76], face_enc[77], face_enc[78], face_enc[79], face_enc[80], face_enc[81], face_enc[82], face_enc[83], face_enc[84], face_enc[85],
face_enc[86], face_enc[87], face_enc[88], face_enc[89], face_enc[90], face_enc[91], face_enc[92], face_enc[93], face_enc[94], face_enc[95], face_enc[96],
face_enc[97], face_enc[98], face_enc[99], face_enc[100], face_enc[101], face_enc[102], face_enc[103], face_enc[104], face_enc[105], face_enc[106], face_enc[107],
face_enc[108], face_enc[109], face_enc[110], face_enc[111], face_enc[112], face_enc[113], face_enc[114], face_enc[115], face_enc[116], face_enc[117], face_enc[118],
face_enc[119], face_enc[120], face_enc[121], face_enc[122], face_enc[123], face_enc[124], face_enc[125], face_enc[126], face_enc[127]]
cursor = conn.cursor()
cursor.execute(SQL, Values)
row = cursor.fetchall()
if len(row) > 0:
for r in row:
s3 = boto3.client('s3')
# Generate the URL to get 'key-name' from 'bucket-name'
url = s3.generate_presigned_url(
ClientMethod='get_object',
Params={
'Bucket': 'siftmov',
'Key': 'operadores/' + r.aws_key
}
)
response = urllib.request.urlopen(url)
image = face_recognition.load_image_file(response)
face_locations = face_recognition.face_locations(image)
known_face_encoding = face_recognition.face_encodings(image)[0]
pil_image = Image.fromarray(image)
draw = ImageDraw.Draw(pil_image)
for (top, right, bottom, left), known_face_encoding in zip(face_locations, known_face_encoding):
draw.rectangle(((left, top), (right, bottom)), outline=(0, 0, 255))
name = [r.name][0]
text_width, text_height = draw.textsize(name)
draw.rectangle(((left, bottom - text_height - 10), (right, bottom)), fill=(0, 0, 255), outline=(0, 0, 255))
draw.text((left + 6, bottom - text_height - 5), name, fill=(255, 255, 255, 255))
del draw
im_file = BytesIO()
pil_image.save(im_file, format="JPEG")
im_bytes = im_file.getvalue() # im_bytes: image in binary format.
im_b64 = base64.b64encode(im_bytes)
final = im_b64.decode('utf-8')
result = {
"face_found": True,
"name": r.name,
"registration": r.registration,
"request_time": diff,
"distance": r.distance,
"face_url": url,
"base64": 'data:image/jpeg;base64,' + format(final).replace("'", "")
}
data.append(result)
return jsonify(data), 200
else:
result = {
"face_found": False,
"request_time": diff
}
data.append(result)
return jsonify(data), 200
else:
result = {
"face_found": False,
"request_time": diff
}
data.append(result)
return jsonify(data), 200
@ app.route('/register-face-encodings', methods=['POST'])
def register():
req_data = request.get_json(force=True)
token = req_data['token']
if(token != 'df9e299a3f37269c51626c9440c94372'):
result = {
"status": False,
"message": 'Token inválido',
}
return jsonify(result)
else:
client_id = req_data['client_id']
aws_id = req_data['aws_id']
datetime = req_data['datetime']
SQL = ('''
selecT
aws_tag as aws_id,
name as name,
operators.id as operator_id,
registration as registration,
ltrim(rtrim(isnull(operator_id,'insert'))) as face_encoded
from operators
left join face_encodings on
face_encodings.client_id = operators.client_id and
face_encodings.operator_id = operators.id
where
operators.client_id=? and file_name <> '' and aws_tag=?
''')
Values = [client_id, aws_id]
cursor = conn.cursor()
cursor.execute(SQL, Values)
row = cursor.fetchall()
data = []
for r in row:
s3 = boto3.client('s3')
# Generate the URL to get 'key-name' from 'bucket-name'
url = s3.generate_presigned_url(
ClientMethod='get_object',
Params={
'Bucket': 'siftmov',
'Key': 'operadores/' + r.aws_id
}
)
response = urllib.request.urlopen(url)
# Get the face encodings for the face in each image file
face = face_recognition.load_image_file(response)
face_bounding_boxes = face_recognition.face_locations(face)
face_enc = face_recognition.face_encodings(face)[0]
if(r.face_encoded == 'insert'):
SQLCommand = ('''
INSERT INTO [dbo].[face_encodings]
([client_id]
,[created_at]
,[updated_at]
,[operator_id]
,[encoding1]
,[encoding2]
,[encoding3]
,[encoding4]
,[encoding5]
,[encoding6]
,[encoding7]
,[encoding8]
,[encoding9]
,[encoding10]
,[encoding11]
,[encoding12]
,[encoding13]
,[encoding14]
,[encoding15]
,[encoding16]
,[encoding17]
,[encoding18]
,[encoding19]
,[encoding20]
,[encoding21]
,[encoding22]
,[encoding23]
,[encoding24]
,[encoding25]
,[encoding26]
,[encoding27]
,[encoding28]
,[encoding29]
,[encoding30]
,[encoding31]
,[encoding32]
,[encoding33]
,[encoding34]
,[encoding35]
,[encoding36]
,[encoding37]
,[encoding38]
,[encoding39]
,[encoding40]
,[encoding41]
,[encoding42]
,[encoding43]
,[encoding44]
,[encoding45]
,[encoding46]
,[encoding47]
,[encoding48]
,[encoding49]
,[encoding50]
,[encoding51]
,[encoding52]
,[encoding53]
,[encoding54]
,[encoding55]
,[encoding56]
,[encoding57]
,[encoding58]
,[encoding59]
,[encoding60]
,[encoding61]
,[encoding62]
,[encoding63]
,[encoding64]
,[encoding65]
,[encoding66]
,[encoding67]
,[encoding68]
,[encoding69]
,[encoding70]
,[encoding71]
,[encoding72]
,[encoding73]
,[encoding74]
,[encoding75]
,[encoding76]
,[encoding77]
,[encoding78]
,[encoding79]
,[encoding80]
,[encoding81]
,[encoding82]
,[encoding83]
,[encoding84]
,[encoding85]
,[encoding86]
,[encoding87]
,[encoding88]
,[encoding89]
,[encoding90]
,[encoding91]
,[encoding92]
,[encoding93]
,[encoding94]
,[encoding95]
,[encoding96]
,[encoding97]
,[encoding98]
,[encoding99]
,[encoding100]
,[encoding101]
,[encoding102]
,[encoding103]
,[encoding104]
,[encoding105]
,[encoding106]
,[encoding107]
,[encoding108]
,[encoding109]
,[encoding110]
,[encoding111]
,[encoding112]
,[encoding113]
,[encoding114]
,[encoding115]
,[encoding116]
,[encoding117]
,[encoding118]
,[encoding119]
,[encoding120]
,[encoding121]
,[encoding122]
,[encoding123]
,[encoding124]
,[encoding125]
,[encoding126]
,[encoding127]
,[encoding128])
VALUES
(?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?
,?)
''')
Values = [client_id, datetime, '', r.operator_id, face_enc[0], face_enc[1], face_enc[2], face_enc[3], face_enc[4], face_enc[5], face_enc[6], face_enc[7], face_enc[8],
face_enc[9], face_enc[10], face_enc[11], face_enc[12], face_enc[13], face_enc[14], face_enc[15], face_enc[16], face_enc[17], face_enc[18], face_enc[19],
face_enc[20], face_enc[21], face_enc[22], face_enc[23], face_enc[24], face_enc[25], face_enc[26], face_enc[27], face_enc[28], face_enc[29], face_enc[30],
face_enc[31], face_enc[32], face_enc[33], face_enc[34], face_enc[35], face_enc[36], face_enc[37], face_enc[38], face_enc[39], face_enc[40], face_enc[41],
face_enc[42], face_enc[43], face_enc[44], face_enc[45], face_enc[46], face_enc[47], face_enc[48], face_enc[49], face_enc[50], face_enc[51], face_enc[52],
face_enc[53], face_enc[54], face_enc[55], face_enc[56], face_enc[57], face_enc[58], face_enc[59], face_enc[60], face_enc[61], face_enc[62], face_enc[63],
face_enc[64], face_enc[65], face_enc[66], face_enc[67], face_enc[68], face_enc[69], face_enc[70], face_enc[71], face_enc[72], face_enc[73], face_enc[74],
face_enc[75], face_enc[76], face_enc[77], face_enc[78], face_enc[79], face_enc[80], face_enc[81], face_enc[82], face_enc[83], face_enc[84], face_enc[85],
face_enc[86], face_enc[87], face_enc[88], face_enc[89], face_enc[90], face_enc[91], face_enc[92], face_enc[93], face_enc[94], face_enc[95], face_enc[96],
face_enc[97], face_enc[98], face_enc[99], face_enc[100], face_enc[101], face_enc[102], face_enc[103], face_enc[104], face_enc[105], face_enc[106], face_enc[107],
face_enc[108], face_enc[109], face_enc[110], face_enc[111], face_enc[112], face_enc[113], face_enc[114], face_enc[115], face_enc[116], face_enc[117], face_enc[118],
face_enc[119], face_enc[120], face_enc[121], face_enc[122], face_enc[123], face_enc[124], face_enc[125], face_enc[126], face_enc[127]]
# Processing Query
cursor.execute(SQLCommand, Values)
conn.commit()
result = {
"encoding": format(face_enc),
"status": True,
"action": 'insert'
}
data.append(result)
else:
SQLCommand = ('''
UPDATE [dbo].[face_encodings]
SET [updated_at] = ?
,[encoding1] = ?
,[encoding2] = ?
,[encoding3] = ?
,[encoding4] = ?
,[encoding5] = ?
,[encoding6] = ?
,[encoding7] = ?
,[encoding8] = ?
,[encoding9] = ?
,[encoding10] = ?
,[encoding11] = ?
,[encoding12] = ?
,[encoding13] = ?
,[encoding14] = ?
,[encoding15] = ?
,[encoding16] = ?
,[encoding17] = ?
,[encoding18] = ?
,[encoding19] = ?
,[encoding20] = ?
,[encoding21] = ?
,[encoding22] = ?
,[encoding23] = ?
,[encoding24] = ?
,[encoding25] = ?
,[encoding26] = ?
,[encoding27] = ?
,[encoding28] = ?
,[encoding29] = ?
,[encoding30] = ?
,[encoding31] = ?
,[encoding32] = ?
,[encoding33] = ?
,[encoding34] = ?
,[encoding35] = ?
,[encoding36] = ?
,[encoding37] = ?
,[encoding38] = ?
,[encoding39] = ?
,[encoding40] = ?
,[encoding41] = ?
,[encoding42] = ?
,[encoding43] = ?
,[encoding44] = ?
,[encoding45] = ?
,[encoding46] = ?
,[encoding47] = ?
,[encoding48] = ?
,[encoding49] = ?
,[encoding50] = ?
,[encoding51] = ?
,[encoding52] = ?
,[encoding53] = ?
,[encoding54] = ?
,[encoding55] = ?
,[encoding56] = ?
,[encoding57] = ?
,[encoding58] = ?
,[encoding59] = ?
,[encoding60] = ?
,[encoding61] = ?
,[encoding62] = ?
,[encoding63] = ?
,[encoding64] = ?
,[encoding65] = ?
,[encoding66] = ?
,[encoding67] = ?
,[encoding68] = ?
,[encoding69] = ?
,[encoding70] = ?
,[encoding71] = ?
,[encoding72] = ?
,[encoding73] = ?
,[encoding74] = ?
,[encoding75] = ?
,[encoding76] = ?
,[encoding77] = ?
,[encoding78] = ?
,[encoding79] = ?
,[encoding80] = ?
,[encoding81] = ?
,[encoding82] = ?
,[encoding83] = ?
,[encoding84] = ?
,[encoding85] = ?
,[encoding86] = ?
,[encoding87] = ?
,[encoding88] = ?
,[encoding89] = ?
,[encoding90] = ?
,[encoding91] = ?
,[encoding92] = ?
,[encoding93] = ?
,[encoding94] = ?
,[encoding95] = ?
,[encoding96] = ?
,[encoding97] = ?
,[encoding98] = ?
,[encoding99] = ?
,[encoding100] = ?
,[encoding101] = ?
,[encoding102] = ?
,[encoding103] = ?
,[encoding104] = ?
,[encoding105] = ?
,[encoding106] = ?
,[encoding107] = ?
,[encoding108] = ?
,[encoding109] = ?
,[encoding110] = ?
,[encoding111] = ?
,[encoding112] = ?
,[encoding113] = ?
,[encoding114] = ?
,[encoding115] = ?
,[encoding116] = ?
,[encoding117] = ?
,[encoding118] = ?
,[encoding119] = ?
,[encoding120] = ?
,[encoding121] = ?
,[encoding122] = ?
,[encoding123] = ?
,[encoding124] = ?
,[encoding125] = ?
,[encoding126] = ?
,[encoding127] = ?
,[encoding128] = ?
WHERE client_id =? and operator_id =?
''')
Values = [datetime, face_enc[0], face_enc[1], face_enc[2], face_enc[3], face_enc[4], face_enc[5], face_enc[6], face_enc[7], face_enc[8],
face_enc[9], face_enc[10], face_enc[11], face_enc[12], face_enc[13], face_enc[14], face_enc[15], face_enc[16], face_enc[17], face_enc[18], face_enc[19],
face_enc[20], face_enc[21], face_enc[22], face_enc[23], face_enc[24], face_enc[25], face_enc[26], face_enc[27], face_enc[28], face_enc[29], face_enc[30],
face_enc[31], face_enc[32], face_enc[33], face_enc[34], face_enc[35], face_enc[36], face_enc[37], face_enc[38], face_enc[39], face_enc[40], face_enc[41],
face_enc[42], face_enc[43], face_enc[44], face_enc[45], face_enc[46], face_enc[47], face_enc[48], face_enc[49], face_enc[50], face_enc[51], face_enc[52],
face_enc[53], face_enc[54], face_enc[55], face_enc[56], face_enc[57], face_enc[58], face_enc[59], face_enc[60], face_enc[61], face_enc[62], face_enc[63],
face_enc[64], face_enc[65], face_enc[66], face_enc[67], face_enc[68], face_enc[69], face_enc[70], face_enc[71], face_enc[72], face_enc[73], face_enc[74],
face_enc[75], face_enc[76], face_enc[77], face_enc[78], face_enc[79], face_enc[80], face_enc[81], face_enc[82], face_enc[83], face_enc[84], face_enc[85],
face_enc[86], face_enc[87], face_enc[88], face_enc[89], face_enc[90], face_enc[91], face_enc[92], face_enc[93], face_enc[94], face_enc[95], face_enc[96],
face_enc[97], face_enc[98], face_enc[99], face_enc[100], face_enc[101], face_enc[102], face_enc[103], face_enc[104], face_enc[105], face_enc[106], face_enc[107],
face_enc[108], face_enc[109], face_enc[110], face_enc[111], face_enc[112], face_enc[113], face_enc[114], face_enc[115], face_enc[116], face_enc[117], face_enc[118],
face_enc[119], face_enc[120], face_enc[121], face_enc[122], face_enc[123], face_enc[124], face_enc[125], face_enc[126], face_enc[127], client_id, r.operator_id]
# Processing Query
cursor.execute(SQLCommand, Values)
conn.commit()
result = {
"encoding": format(face_enc),
"status": True,
"action": 'update'
}
data.append(result)
return jsonify(data), 200
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5001, debug=True)
| 39.69425
| 188
| 0.387888
| 2,340
| 28,302
| 4.468803
| 0.258974
| 0.25973
| 0.010902
| 0.010711
| 0.724108
| 0.718179
| 0.70613
| 0.687386
| 0.687386
| 0.687386
| 0
| 0.12221
| 0.477563
| 28,302
| 712
| 189
| 39.75
| 0.585013
| 0.014699
| 0
| 0.383387
| 0
| 0.020767
| 0.562987
| 0.013634
| 0
| 0
| 0
| 0
| 0
| 1
| 0.003195
| false
| 0
| 0.025559
| 0
| 0.038339
| 0
| 0
| 0
| 0
| null | 1
| 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
| 4
|
4f3c4a933f0e19577a30779f1180431a5b4cf88f
| 34
|
py
|
Python
|
tests/unit/cmor/__init__.py
|
Peter9192/ESMValCore
|
febd96a39480cc837afbf4e1f5b0ef61571af76a
|
[
"Apache-2.0"
] | 26
|
2019-06-07T07:50:07.000Z
|
2022-03-22T21:04:01.000Z
|
tests/unit/cmor/__init__.py
|
Peter9192/ESMValCore
|
febd96a39480cc837afbf4e1f5b0ef61571af76a
|
[
"Apache-2.0"
] | 1,370
|
2019-06-06T09:03:07.000Z
|
2022-03-31T04:37:20.000Z
|
tests/unit/cmor/__init__.py
|
Peter9192/ESMValCore
|
febd96a39480cc837afbf4e1f5b0ef61571af76a
|
[
"Apache-2.0"
] | 26
|
2019-07-03T13:08:48.000Z
|
2022-03-02T16:08:47.000Z
|
"""Unit tests for cmor module."""
| 17
| 33
| 0.647059
| 5
| 34
| 4.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 34
| 1
| 34
| 34
| 0.758621
| 0.794118
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4f5375a6049dd299fdd6fb908c4c5c244467e472
| 22,580
|
py
|
Python
|
test/xls_test.py
|
ITB-ProtMet/eppi
|
55f7e361b33a364e4494cd9e0d7f6e07ba9b1930
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
test/xls_test.py
|
ITB-ProtMet/eppi
|
55f7e361b33a364e4494cd9e0d7f6e07ba9b1930
|
[
"ECL-2.0",
"Apache-2.0"
] | 2
|
2015-02-24T15:30:15.000Z
|
2015-02-24T15:32:28.000Z
|
test/xls_test.py
|
ITB-ProtMet/eppi
|
55f7e361b33a364e4494cd9e0d7f6e07ba9b1930
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
# Copyright 2015 Pietro Brunetti <pietro.brunetti@itb.cnr.it>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Unit test for proteomic_xls.py"""
__authors__ = "Pietro Brunetti"
from os import curdir, listdir
import os.path as path
from os.path import abspath
from xlrd import open_workbook
from EPPI.raw import proteomic_xls
from EPPI.raw import data_input
import unittest
DIR = abspath(path.join(curdir, "example_files", 'xls_testfiles'))
protpept_dir = path.join(DIR, "five_right_protpept")
onlypept_dir = path.join(DIR, "five_right_onlypept")
discoverer_dir = path.join(DIR, "five_right_discoverer")
wrong_format_dir = path.join(DIR, "wrong_format")
redundants_dir = path.join(DIR, "redundants")
without_fields_dir = path.join(DIR, "without_fields")
wrong_pepts_dir = path.join(DIR, "wrong_pepts")
class Wrong_header(unittest.TestCase):
"""
Test for the when there is a wrong header in xls files.
This tests prove xls_parser's methods.
"""
def match_kof(self, dir, kof):
xls_p = proteomic_xls.xls_parser()
for file in listdir(dir):
book = open_workbook(path.join(dir, file))
sheet = book.sheet_by_index(0)
res_type = xls_p.what_kind_of_file(sheet)
self.assertEqual(res_type, kof, "%s != %s\nfile: %s" % (res_type, kof, file))
def wkof_test(self):
"""
What Kind of File Test
Controlling if func return right wkof
"""
self.match_kof(protpept_dir, "protpep")
self.match_kof(onlypept_dir, "onlypep")
self.match_kof(discoverer_dir, "discoverer")
self.match_kof(wrong_format_dir, "wrongXLS")
def match_ff(self, dir):
xls_p = proteomic_xls.xls_parser()
for f in listdir(dir):
book = open_workbook(path.join(dir, f))
sheet = book.sheet_by_index(0)
res_type = xls_p.what_kind_of_file(sheet)
a_d = dict(filename=f, xls_type=res_type, sheet=sheet)
self.assertRaises(proteomic_xls.Without_Field, xls_p.find_fields, **a_d)
def test_real_without_fileds(self):
"""
File without Sequence or Accession column.
"""
self.match_ff(without_fields_dir)
class Xls_occurences(unittest.TestCase):
"""
Is the occurrence evaluation rights?
"""
prots = [
("4502027", xrange(1,6)),
("56550049", xrange(1,6)),
("4504943", xrange(1,6)),
("992949", xrange(1,6)),
("15029677", [1 for i in xrange(5)] )
]
pepts =[
("4502027", [
("AEFAEVSK", xrange(1,6), [3*i for i in xrange(1,6)]),
("DDNPNLPR", xrange(1,6), [1*i for i in xrange(1,6)]),
("DLGEENFK", xrange(1,6), [1*i for i in xrange(1,6)]),
("KQTALVELVK", xrange(1,6), [4*i for i in xrange(1,6)]),
("KVPQVSTPTLVEVSR", xrange(1,6), [6*i for i in xrange(1,6)]),
("KYLYEIAR", xrange(1,6), [1*i for i in xrange(1,6)]),
("LVAASQAALGL", xrange(1,6), [2*i for i in xrange(1,6)]),
("LVNEVTEFAK", xrange(1,6), [3*i for i in xrange(1,6)]),
("LVTDLTK", xrange(1,6), [1*i for i in xrange(1,6)]),
("SLHTLFGDK", xrange(1,6), [2*i for i in xrange(1,6)]),
("VFDEFKPLVEEPQNLIK", xrange(1,6), [1*i for i in xrange(1,6)]),
("YLYEIAR", xrange(1,6), [1*i for i in xrange(1,6)]),
("FKDLGEENFK", xrange(1,6), [3*i for i in xrange(1,6)]),
("HPDYSVVLLLR", xrange(1,6), [2*i for i in xrange(1,6)]),
("FYAPELLFFA", xrange(1,6), [1*i for i in xrange(1,6)]),
("FYAPELLFFAK", xrange(1,6), [2*i for i in xrange(1,6)])
]),
("56550049", [
("STIQVVENGESSQGR", xrange(1,6), [1*i for i in xrange(1,6)]),
("TALQPMVSALNIR", xrange(1,6), [5*i for i in xrange(1,6)]),
("VFMYLSDSR", xrange(1,6), [2*i for i in xrange(1,6)]),
("YFIIQDR", xrange(1,6), [3*i for i in xrange(1,6)]),
("VSALNIR", xrange(1,6), [1*i for i in xrange(1,6)]),
("DSTIQVVENGESSQGR", xrange(1,6), [20*i for i in xrange(1,6)]),
("DWVSVVTPAR", xrange(1,6), [5*i for i in xrange(1,6)]),
("FSVQMFR", xrange(1,6), [1*i for i in xrange(1,6)]),
("TLDEYWR", xrange(1,6), [2*i for i in xrange(1,6)]),
("VGGTGMFTVR", xrange(1,6), [2*i for i in xrange(1,6)]),
("LADEIIIR", xrange(1,6), [2*i for i in xrange(1,6)])
]),
("4504943", [
("IDSVSEGNAGPYR", xrange(1,6), [1*i for i in xrange(1,6)]),
("GPVGVQTFR", xrange(1,6), [1*i for i in xrange(1,6)]),
("WSEQSDYLELLVK", xrange(1,6), [2*i for i in xrange(1,6)])
]),
("992949", [
("ISHELDSASSEVN", xrange(1,6), [2*i for i in xrange(1,6)]),
("AIPVAQDLNAPSDWDSR", xrange(1,6), [3*i for i in xrange(1,6)]),
("YPDAVATWLNPDPSQK", xrange(1,6), [3*i for i in xrange(1,6)])
]),
("15029677",[
("EDQTSPAPGLR", [1 for i in xrange(1,6)], [2 for i in xrange(1,6)]),
("SEAAAVQPVIGISQR", [1 for i in xrange(1,6)], [2 for i in xrange(1,6)]),
("SEAAAVQPVIGISQ", [1 for i in xrange(1,6)], [1 for i in xrange(1,6)])
])
]
onlypepts =[
("4502027", [
("AEFAEVSK", xrange(1,6), [3*i for i in xrange(1,6)]),
("DDNPNLPR", xrange(1,6), [1*i for i in xrange(1,6)]),
("DLGEENFK", xrange(1,6), [1*i for i in xrange(1,6)]),
("KQTALVELVK", xrange(1,6), [4*i for i in xrange(1,6)]),
("KVPQVSTPTLVEVSR", xrange(1,6), [1*i for i in xrange(1,6)]), #changed
("KYLYEIAR", xrange(1,6), [1*i for i in xrange(1,6)]),
("LVAASQAALGL", xrange(1,6), [2*i for i in xrange(1,6)]),
("LVNEVTEFAK", xrange(1,6), [3*i for i in xrange(1,6)]),
#("LVTDLTK", xrange(1,6), [1*i for i in xrange(1,6)]),
("SLHTLFGDK", xrange(1,6), [2*i for i in xrange(1,6)]),
("VFDEFKPLVEEPQNLIK", xrange(1,6), [1*i for i in xrange(1,6)]),
("YLYEIAR", xrange(1,6), [1*i for i in xrange(1,6)]),
("FKDLGEENFK", xrange(1,6), [3*i for i in xrange(1,6)]),
("HPDYSVVLLLR", xrange(1,6), [2*i for i in xrange(1,6)]),
("FYAPELLFFA", xrange(1,6), [1*i for i in xrange(1,6)]),
("FYAPELLFFAK", xrange(1,6), [2*i for i in xrange(1,6)])
]),
("56550049", [
("STIQVVENGESSQGR", xrange(1,6), [1*i for i in xrange(1,6)]),
("TALQPMVSALNIR", xrange(1,6), [5*i for i in xrange(1,6)]),
("VFMYLSDSR", xrange(1,6), [2*i for i in xrange(1,6)]),
("YFIIQDR", xrange(1,6), [3*i for i in xrange(1,6)]),
("VSALNIR", xrange(1,6), [1*i for i in xrange(1,6)]),
("DSTIQVVENGESSQGR", xrange(1,6), [20*i for i in xrange(1,6)]),
("DWVSVVTPAR", xrange(1,6), [5*i for i in xrange(1,6)]),
("FSVQMFR", xrange(1,6), [1*i for i in xrange(1,6)]),
("TLDEYWR", xrange(1,6), [2*i for i in xrange(1,6)]),
("VGGTGMFTVR", xrange(1,6), [2*i for i in xrange(1,6)]),
("LADEIIIR", xrange(1,6), [2*i for i in xrange(1,6)])
]),
("4504943", [
("IDSVSEGNAGPYR", xrange(1,6), [1*i for i in xrange(1,6)]),
("GPVGVQTFR", xrange(1,6), [1*i for i in xrange(1,6)]),
("WSEQSDYLELLVK", xrange(1,6), [2*i for i in xrange(1,6)])
]),
("992949", [
("ISHELDSASSEVN", xrange(1,6), [2*i for i in xrange(1,6)]),
("AIPVAQDLNAPSDWDSR", xrange(1,6), [3*i for i in xrange(1,6)]),
("YPDAVATWLNPDPSQK", xrange(1,6), [3*i for i in xrange(1,6)])
]),
("15029677",[
("EDQTSPAPGLR", [1 for i in xrange(1,6)], [2 for i in xrange(1,6)]),
("SEAAAVQPVIGISQR", [1 for i in xrange(1,6)], [2 for i in xrange(1,6)]),
("SEAAAVQPVIGISQ", [1 for i in xrange(1,6)], [1 for i in xrange(1,6)])
])
]
files =[
"A1.xls",
"B1.xls",
"B2.xls",
"B3.xls",
"B4.xls"
]
def test_proteins_protpept(self):
"""
proteins occurrence during parsing the five file
"""
p = proteomic_xls.sequest_protpept_parser()
for i, f in enumerate(self.files):
try:
p.parse(path.join(protpept_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, occs in self.prots:
self.assertEqual(occs[i], p.proteins[acc])
def test_peptides_protpept_nored(self):
"""
peptides occurrence during parsing the five file
Spectral count False
"""
p = proteomic_xls.sequest_protpept_parser()
for i, f in enumerate(self.files):
try:
p.parse(path.join(protpept_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, pepts in self.pepts:
for seq, occs_nr, occs_r in pepts:
self.assertEqual(occs_nr[i], p.peptides[acc][seq], "%d, %s, %s" %(i, acc, seq))
def test_peptides_protpept_red(self):
"""
peptides occurrence during parsing the five file
Spectral Count True
"""
p = proteomic_xls.sequest_protpept_parser(mode=True)
for i, f in enumerate(self.files):
try:
p.parse(path.join(protpept_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, pepts in self.pepts:
for seq, occs_nr, occs_r in pepts:
self.assertEqual(occs_r[i], p.peptides[acc][seq], "%d, %s, %s" %(i, acc, seq))
def test_proteins_onlypept(self):
"""
proteins occurrence during parsing the five file
"""
p = proteomic_xls.sequest_onlypept_parser()
for i, f in enumerate(self.files):
try:
p.parse(path.join(onlypept_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, occs in self.prots:
self.assertEqual(occs[i], p.proteins[acc], "%d != %d @prot: %s, @time: %d"\
%(occs[i], p.proteins[acc], acc, i))
def test_peptides_onlypept_nored(self):
"""
peptides occurrence during parsing the five file
Spectral count False
"""
p = proteomic_xls.sequest_onlypept_parser()
for i, f in enumerate(self.files):
try:
p.parse(path.join(onlypept_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, pepts in self.onlypepts:
for seq, occs_nr, occs_r in pepts:
try:
self.assertEqual(occs_nr[i], p.peptides[acc][seq], "%d, %s, %s" %(i, acc, seq))
except KeyError:
print "KeyError: %s, %s" %(acc, seq)
def test_peptides_onlypept_red(self):
"""
peptides occurrence during parsing the five file
Spectral Count True
"""
p = proteomic_xls.sequest_onlypept_parser(mode=True)
for i, f in enumerate(self.files):
try:
p.parse(path.join(onlypept_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, pepts in self.onlypepts:
for seq, occs_nr, occs_r in pepts:
self.assertEqual(occs_r[i], p.peptides[acc][seq], "%d, %s, %s" %(i, acc, seq))
def test_file_source_store_op(self):
"""
testing the original seq storage
"""
p = proteomic_xls.sequest_onlypept_parser(mode=True)
for f in self.files:
try:
p.parse(path.join(onlypept_dir, f))
except proteomic_xls.EmptyCell:
pass
self.assertListEqual([path.join(onlypept_dir, f) for f in self.files],
p.sources)
def test_file_source_store_pp(self):
"""
testing the original seq storage
"""
p = proteomic_xls.sequest_protpept_parser(mode=True)
for f in self.files:
try:
p.parse(path.join(protpept_dir, f))
except proteomic_xls.EmptyCell:
pass
self.assertListEqual([path.join(protpept_dir, f) for f in self.files],
p.sources)
class Xls_occurences_discoverer(unittest.TestCase):
"""
Is the occurrence evaluation rights?
"""
prots = [
("386599560", xrange(1,6)),
("386601074", xrange(1,6)),
("386601333", xrange(1,6)),
("386602367", xrange(1,6)),
("386601051", [1 for i in xrange(5)] )
]
pepts =[
("386599560", [("VITASDSSGTVVDESGFTK",
xrange(1,6),
[2*i for i in xrange(1,6)]),
("VSVSGSGNVAQYAIEK",
xrange(1,6),
[2*i for i in xrange(1,6)]),
]),
("386601074", [("TIAAAEGPYGEEGMIVQQFHPLPK",
xrange(1,6),
[2*i for i in xrange(1,6)]),
("GQFTDLQDQVISNLFK",
xrange(1,6),
[1*i for i in xrange(1,6)]),
]),
("386601333", [("QHVPVFVTDEMVGHK",
xrange(1,6),
[3*i for i in xrange(1,6)]),
]),
("386602367", [("NIIAGLPGAEEGYTLDQFR",
xrange(1,6),
[2*i for i in xrange(1,6)]),
#only A1 has this peptide
("AIIPVAEEVGVR",
[1 for i in xrange(1,6)],
[1 for i in xrange(1,6)]),
]),
#only A1 has this protein
("386601051", [("TTLDQLLDIVQGPDYPTEAEIITSR",
[1 for i in xrange(1,6)],
[2 for i in xrange(1,6)]),
("MLMFPVSDLPQLSK",
[1 for i in xrange(1,6)],
[2 for i in xrange(1,6)]),
])
]
files =[
"A1.xls",
"B1.xls",
"B2.xls",
"B3.xls",
"B4.xls"
]
def test_proteins(self):
"""
proteins occurrence during parsing the five file
"""
p = proteomic_xls.discoverer_parser()
msg = "{0}: predicted {1} != counted {2}"
for i, f in enumerate(self.files):
try:
p.parse(path.join(discoverer_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, occs in self.prots:
self.assertEqual(occs[i], p.proteins[acc], msg.format(acc, occs[i], p.proteins[acc]))
def test_peptides_protpept_nored(self):
"""
peptides occurrence during parsing the five file
Spectral count False
"""
p = proteomic_xls.discoverer_parser()
for i, f in enumerate(self.files):
try:
p.parse(path.join(discoverer_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, pepts in self.pepts:
for seq, occs_nr, occs_r in pepts:
self.assertEqual(occs_nr[i], p.peptides[acc][seq], "{0} - {1}:{2} aspected {3} != retrived {4}".format(
f, acc, seq, occs_nr[i], p.peptides[acc][seq]))
def test_peptides_protpept_red(self):
"""
peptides occurrence during parsing the five file
Spectral Count True
"""
p = proteomic_xls.discoverer_parser(mode=True)
for i, f in enumerate(self.files):
try:
p.parse(path.join(discoverer_dir, f))
except proteomic_xls.EmptyCell:
pass
for acc, pepts in self.pepts:
for seq, occs_nr, occs_r in pepts:
print occs_r[i]
self.assertEqual(occs_r[i], p.peptides[acc][seq],
"{0} - {1}:{2} aspected {3} != retrived {4}".format(
f, acc, seq, occs_r[i], p.peptides[acc][seq]))
def test_file_source_store(self):
"""
testing the original seq storage
"""
p = proteomic_xls.discoverer_parser(mode=True)
for f in self.files:
try:
p.parse(path.join(discoverer_dir, f))
except proteomic_xls.EmptyCell:
pass
self.assertListEqual([path.join(discoverer_dir, f)\
for f in self.files], p.sources)
class Kind_of_file(unittest.TestCase):
"""
Unit test for the format of xls file
"""
def match_format_parser(self, pars, dir):
for file in listdir(dir):
path_ = path.join(dir, file)
a_d = dict(fileName=path_)
self.assertRaises(proteomic_xls.wrongFile, pars, **a_d)
def test_bad_format_real_protpept(self):
"""
Should fail with format no protpept using
wrong protpept analysis files
"""
p = proteomic_xls.sequest_protpept_parser()
self.match_format_parser(p.parse, onlypept_dir)
self.match_format_parser(p.parse, discoverer_dir)
def test_bad_format_real_onlypept(self):
"""
Should fail with format no onlypept using
wrong onlypept analysis files
"""
p = proteomic_xls.sequest_onlypept_parser()
self.match_format_parser(p.parse, protpept_dir)
self.match_format_parser(p.parse, discoverer_dir)
def test_bad_format_real_discoverer(self):
"""
Should fail with format no data_discoverer using
wrong data_discoverer analysis files
"""
p = proteomic_xls.sequest_onlypept_parser()
self.match_format_parser(p.parse, protpept_dir)
self.match_format_parser(p.parse, discoverer_dir)
class Redundancies_Accession_number(unittest.TestCase):
"""
Test for the xls files.
It evaluates when there's more than
one time the same Accession number
This test is not thought for onlypept, were
redundant accessions are of course allowed.
"""
def test_real_redundant_protpept(self):
"""
When there aren't redundancy in proptpept
"""
path_ = path.join(redundants_dir,
"redundant_accessions_protpept.xls")
p = proteomic_xls.sequest_protpept_parser()
a_d = dict(fileName=path_)
self.assertRaises(proteomic_xls.Same_Accession, p.parse, **a_d)
def test_real_redundant_discoverer(self):
"""
When there aren't redundancy data_discoverer
"""
path_ = path.join(redundants_dir,
"redundant_accessions_discoverer.xls")
p = proteomic_xls.discoverer_parser()
a_d = dict(fileName=path_)
self.assertRaises(proteomic_xls.Same_Accession, p.parse, **a_d)
class distinct_peptides(unittest.TestCase):
"""
Test to evaluate the correctness of computation
of the parsers with distinct peptides and with spectral count
"""
def test_spectral_count_false_proppept(self):
"""
Using a protpept file with peptides no-distinct,
the frequencies must be equal to one.
"""
chase1 = path.join(redundants_dir, "redundant_protpept.xls")
#assert(os.path.isfile(chase1))
p = proteomic_xls.sequest_protpept_parser()
try:
p.parse(chase1)
except proteomic_xls.EmptyCell:
pass
finally:
for acc, pepts in p.peptides.iteritems():
for seq, occ in pepts.iteritems():
self.assertEqual(occ, 1)
def test_spectral_count_false_onlypept(self):
"""
Using a onlypept file with peptides no-distinct,
the frequencies must be equal to one.
"""
chase2 = path.join(redundants_dir, "redundant_onlypept.xls")
p = proteomic_xls.sequest_onlypept_parser()
try:
p.parse(chase2)
except proteomic_xls.EmptyCell:
pass
finally:
for acc, pepts in p.peptides.iteritems():
for seq, occ in pepts.iteritems():
self.assertEqual(occ, 1)
def test_spectral_count_false_discoverer(self):
"""
Using a data_discoverer file with peptides no-distinct,
the frequencies must be equal to one.
"""
chase2 = path.join(redundants_dir, "redundant_discoverer.xls")
p = proteomic_xls.discoverer_parser()
try:
p.parse(chase2)
except proteomic_xls.EmptyCell:
pass
finally:
for acc, pepts in p.peptides.iteritems():
for seq, occ in pepts.iteritems():
self.assertEqual(occ, 1)
class wrong_peptides(unittest.TestCase):
"""
strange peptides inside
"""
def test_wrong_peptides_protpept(self):
"""
When protpept file has wrong peptides
"""
path_ = path.join(wrong_pepts_dir, "wrong_pepts_protpept.xls")
p = proteomic_xls.sequest_protpept_parser()
a_d = dict(fileName=path_)
self.assertRaises(data_input.bad_format_peptide, p.parse, **a_d)
def test_wrong_peptides_onlypept(self):
"""
When onlypept file has wrong peptides
"""
path_ = path.join(wrong_pepts_dir, "wrong_pepts_onlypept.xls")
p = proteomic_xls.sequest_onlypept_parser()
a_d = dict(fileName=path_)
self.assertRaises(data_input.bad_format_peptide, p.parse, **a_d)
def test_wrong_peptides_discoverer(self):
path_ = path.join(wrong_pepts_dir, "wrong_pepts_discoverer.xls")
p = proteomic_xls.discoverer_parser()
a_d = dict(fileName=path_)
self.assertRaises(data_input.bad_format_peptide, p.parse, **a_d)
if __name__ == "__main__":
unittest.main()
| 38.598291
| 123
| 0.549734
| 2,960
| 22,580
| 4.068581
| 0.106419
| 0.098813
| 0.112929
| 0.091672
| 0.757785
| 0.731462
| 0.707797
| 0.680229
| 0.66055
| 0.639957
| 0
| 0.044107
| 0.317228
| 22,580
| 584
| 124
| 38.664384
| 0.737044
| 0.032817
| 0
| 0.69802
| 0
| 0
| 0.094928
| 0.014701
| 0
| 0
| 0
| 0
| 0.056931
| 0
| null | null | 0.037129
| 0.017327
| null | null | 0.004951
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4f6a10b2c999200401fc71ec279ae0ca75b7a4fd
| 283
|
py
|
Python
|
church/models/__init__.py
|
khanhpn/florida
|
5e83d0561b9f41ff79383a6a2f0a84d6c8459ef0
|
[
"Apache-2.0"
] | 1
|
2021-01-22T02:52:33.000Z
|
2021-01-22T02:52:33.000Z
|
church/models/__init__.py
|
khanhpn/florida
|
5e83d0561b9f41ff79383a6a2f0a84d6c8459ef0
|
[
"Apache-2.0"
] | null | null | null |
church/models/__init__.py
|
khanhpn/florida
|
5e83d0561b9f41ff79383a6a2f0a84d6c8459ef0
|
[
"Apache-2.0"
] | null | null | null |
from .introduction import *
from .facebook_link import *
from .prayer_after_mass import *
from .video_misa import *
from .youtube_mass import *
from .confession_time import *
from .mass_time import *
from .linked_church import *
from .activity_image import *
from .activity import *
| 25.727273
| 32
| 0.787986
| 39
| 283
| 5.487179
| 0.435897
| 0.420561
| 0.130841
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141343
| 283
| 10
| 33
| 28.3
| 0.880658
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
4f79754fa52447e26a921ac8371bd7c6fa4984c3
| 11,017
|
py
|
Python
|
src/test/test_routes.py
|
joyliao07/401_midterm_wizard_game
|
4683c04a5c54f8fa499110cd84b9e5e254139b3c
|
[
"MIT"
] | 1
|
2019-02-27T01:51:33.000Z
|
2019-02-27T01:51:33.000Z
|
src/test/test_routes.py
|
joyliao07/wizards_apprentice
|
4683c04a5c54f8fa499110cd84b9e5e254139b3c
|
[
"MIT"
] | 30
|
2018-12-27T18:33:16.000Z
|
2021-09-08T00:48:37.000Z
|
src/test/test_routes.py
|
joyliao07/401_midterm_wizard_game
|
4683c04a5c54f8fa499110cd84b9e5e254139b3c
|
[
"MIT"
] | null | null | null |
import pytest
import io
# Login function
def login_for_test(app):
""" this logs in test user """
app.post('/login', data=dict(
email='default@example.com',
password='secret'
), follow_redirects=True)
# test basics
def test_app_import(app):
assert app
def test_bad_route(app):
""" test 404 with bad route """
rv = app.test_client().get('/fake')
assert rv.status_code == 404
assert b'Page not found' in rv.data
# Home route
def test_home_get_no_login(app):
""" test login page for status code/correct message with no login """
rv = app.test_client().get('/')
assert rv.status_code == 200
assert b'You must be the new apprentice.' in rv.data
def test_home_get_with_login(app, db, session, account):
""" test login page for status code/correct message with login """
with app.test_client() as app:
login_for_test(app)
rv = app.get('/')
assert rv.status_code == 200
assert b'Welcome back, my apprentice' in rv.data
def test_home_bad_method(app):
""" test home route with unimplemented method for correct status code """
rv = app.test_client().delete('/')
assert rv.status_code == 405
assert b'Are you trying to pull a fast one' in rv.data
# Play route
def test_play_get_no_login(app):
""" test that going to /play while not logged in redirects to login
page """
rv = app.test_client().get('/play', follow_redirects=True)
assert b'You must be logged in' in rv.data
assert rv.status_code == 200
def test_play_get_with_login(app, session, db, account):
""" test that going to /play while logged in takes you to the prompt """
with app.test_client() as app:
login_for_test(app)
rv = app.get('/play')
assert rv.status_code == 200
assert b'I seem to have forgotten what a'
def test_play_post_no_login(app):
""" test that trying to post to /play with no login redirects to login """
rv = app.test_client().post('/play', follow_redirects=True)
assert rv.status_code == 200
assert b'You must be logged in' in rv.data
def test_play_post_with_login(app, session, db, account):
""" tests posting to play route (user making initial submission) """
with app.test_client() as app:
login_for_test(app)
data = dict()
data['file_upload'] = (io.BytesIO(b'hi'), 'test_no_match.jpg')
rv = app.post(
'/play',
data=data,
content_type='multipart/form-data',
follow_redirects=True
)
assert rv.status_code == 200
assert b'So, is this what a' in rv.data
def test_play_post_with_login_no_data(app, session, db, account):
""" test that posting to /play with no data while logged in
just serves the /play get page """
with app.test_client() as app:
login_for_test(app)
rv = app.post('/play')
assert rv.status_code == 200
assert b'I seem to have forgotten what a'
def test_play_bad_method(app):
""" test home route with unimplemented method for correct status code """
rv = app.test_client().delete('/play')
assert rv.status_code == 405
assert b'Are you trying to pull a fast one' in rv.data
# Submission route
def test_submission_get_no_login(app):
""" tests that user is prompted to login when visiting submission page
when not logged in """
rv = app.test_client().get('/submission', follow_redirects=True)
assert b'You must be logged in' in rv.data
assert rv.status_code == 200
def test_submission_get_with_login_no_data(app, session, db, account):
""" tests that 404 is received when going to /submission without
submitting anything """
with app.test_client() as app:
login_for_test(app)
rv = app.get('/submission', follow_redirects=True)
assert rv.status_code == 404
assert b'Page not found' in rv.data
def test_submission_get_with_login(app, db, session, account):
""" tests that going to /submission route after submitting an image
(but before confirming/finalizing submission) serves correct content """
with app.test_client() as app:
login_for_test(app)
data = dict()
data['file_upload'] = (io.BytesIO(b'hi'), 'test.jpg')
app.post(
'/play',
data=data,
content_type='multipart/form-data'
)
rv = app.get('/submission')
assert rv.status_code == 200
assert b'So, is this what a' in rv.data
def test_submission_route_bad_method(app):
""" test submission route with unimplemented method for correct
status code """
rv = app.test_client().delete('/submission')
assert rv.status_code == 405
assert b'Are you trying to pull a fast one' in rv.data
# Feedback route
def test_feedback_get_no_login(app):
""" tests going to /feedback without being logged in to make sure
user is prompted to log in """
rv = app.test_client().get('/feedback', follow_redirects=True)
assert rv.status_code == 200
assert b'You must be logged in' in rv.data
def test_feedback_no_data(app, session, db, account):
""" tests that 404 is received when going to /feedback without
submitting anything """
with app.test_client() as app:
login_for_test(app)
rv = app.get('/feedback', follow_redirects=True)
assert rv.status_code == 404
assert b'Page not found' in rv.data
def test_feedback_get_no_match(app, session, db, account, prompt):
""" tests feedback text when user submits unmatching image """
with app.test_client() as app:
login_for_test(app)
f = open('src/test/test_images/test_no_match.jpg', 'rb').read()
data = dict()
data['file_upload'] = (io.BytesIO(f), 'test.jpg')
app.post(
'/play',
data=data,
content_type='multipart/form-data',
follow_redirects=True
)
rv = app.get('/feedback')
assert rv.status_code == 200
assert b'This is not a' in rv.data
assert b'It\'s not even' in rv.data
def test_feedback_get_color_only_match(app, session, db, account, prompt):
""" tests feedback text when user submits image that matches color only """
with app.test_client() as app:
login_for_test(app)
f = open('src/test/test_images/test_color_match.jpg', 'rb').read()
data = dict()
data['file_upload'] = (io.BytesIO(f), 'test.jpg')
app.post(
'/play',
data=data,
content_type='multipart/form-data'
)
rv = app.get('/feedback')
assert rv.status_code == 200
assert b'Well... it\'s' in rv.data
assert b'but it\'s not even a' in rv.data
def test_feedback_get_noun_only_match(app, session, db, account, prompt):
""" tests feedback text when user submits image that matches object
type only """
with app.test_client() as app:
login_for_test(app)
f = open('src/test/test_images/test_noun_match.jpg', 'rb').read()
data = dict()
data['file_upload'] = (io.BytesIO(f), 'test.jpg')
app.post(
'/play',
data=data,
content_type='multipart/form-data',
)
rv = app.get('/feedback')
assert rv.status_code == 200
# assert b'That looks like a' in rv.data
# assert b'but it\'s not' in rv.data
def test_feedback_get_full_match(app, session, db, account, prompt):
""" tests feedback text when user submits full match """
with app.test_client() as app:
login_for_test(app)
f = open('src/test/test_images/test_full_match.png', 'rb').read()
data = dict()
data['file_upload'] = (io.BytesIO(f), 'test.png')
app.post(
'/play',
data=data,
content_type='multipart/form-data'
)
rv = app.get('/feedback')
assert rv.status_code == 200
# assert b'Yes, that\'s a' in rv.data
def test_feedback_route_bad_method(app):
""" test feedback route with unimplemented method for correct ]
status code """
rv = app.test_client().delete('/feedback')
assert rv.status_code == 405
assert b'Are you trying to pull a fast one' in rv.data
# History route
def test_history_get_no_login(app):
""" tests going to /history without being logged in to make sure user is
redirected """
rv = app.test_client().get('/history', follow_redirects=True)
assert b'You must be logged in' in rv.data
assert rv.status_code == 200
def test_history_get_no_submissions(app, session, db, account):
""" tests going to /history when user hasn't submitted anything """
with app.test_client() as app:
login_for_test(app)
rv = app.get('/history')
assert rv.status_code == 200
assert b'Apprentice, you have no submissions yet.' in rv.data
def test_history_get_with_submissions(app, session, db, account, prompt):
""" tests that submission is present on history page """
with app.test_client() as app:
login_for_test(app)
f = open('src/test/test_images/test_color_match.jpg', 'rb').read()
data = dict()
data['file_upload'] = (io.BytesIO(f), 'test.jpg')
app.post(
'/play',
data=data,
content_type='multipart/form-data'
)
rv = app.get('/history')
assert rv.status_code == 200
assert b'Apprentice, your past submissions are below.'
assert b'Blue Chair (Fail)' in rv.data
# Players route
def test_players_get_no_login(app):
""" tests that going to /players when not logged in prompts user to log
in """
rv = app.test_client().get('/players', follow_redirects=True)
assert b'You must be logged in' in rv.data
assert rv.status_code == 200
def test_players_get_no_submissions(app, session, db, account, prompt):
""" tests that going to /players with no submissions shows different
message """
with app.test_client() as app:
login_for_test(app)
rv = app.get('/players')
assert rv.status_code == 200
assert b'Apprentice, there are no successful submissions' in rv.data
def test_players_get_with_submissions(app, session, db, account, prompt):
""" tests that going to /players shows a player's successful submission """
with app.test_client() as app:
login_for_test(app)
f = open('src/test/test_images/test_full_match.png', 'rb').read()
data = dict()
data['file_upload'] = (io.BytesIO(f), 'test.png')
app.post(
'/play',
data=data,
content_type='multipart/form-data'
)
app.get('/feedback')
rv = app.get('/players')
assert rv.status_code == 200
assert b'Other player\'s submissions are below.'
# assert b'Blue Chair' in rv.data
| 28.321337
| 79
| 0.631842
| 1,596
| 11,017
| 4.208647
| 0.10401
| 0.036475
| 0.033348
| 0.072354
| 0.819116
| 0.76954
| 0.733065
| 0.674408
| 0.656245
| 0.617389
| 0
| 0.01097
| 0.255333
| 11,017
| 388
| 80
| 28.39433
| 0.807777
| 0.198511
| 0
| 0.627358
| 0
| 0
| 0.173064
| 0.027913
| 0
| 0
| 0
| 0
| 0.264151
| 1
| 0.136792
| false
| 0.004717
| 0.014151
| 0
| 0.150943
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4f8ccd720c5bbd5cf5b75a4f7deb736c5a27a0cb
| 861
|
py
|
Python
|
mojibake/main.py
|
ardinor/mojibake
|
b080656866603ebf4020ea2b49618cc29533a77b
|
[
"MIT"
] | 1
|
2015-11-05T16:14:13.000Z
|
2015-11-05T16:14:13.000Z
|
mojibake/main.py
|
ardinor/mojibake
|
b080656866603ebf4020ea2b49618cc29533a77b
|
[
"MIT"
] | null | null | null |
mojibake/main.py
|
ardinor/mojibake
|
b080656866603ebf4020ea2b49618cc29533a77b
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
'''Entry point to all things to avoid circular imports.'''
from mojibake.app import app, db, models
from mojibake.settings import DEBUG
from mojibake.views import *
from mojibake.views.archive import archive
from mojibake.views.base import base
from mojibake.views.tags import tag
from mojibake.views.categories import category
from mojibake.views.posts import posts
#from mojibake.monitoring.views import monitor
from mojibake.projects.views import projects
app.register_blueprint(base)
app.register_blueprint(archive, url_prefix='/archive')
app.register_blueprint(tag, url_prefix='/tags')
app.register_blueprint(category, url_prefix='/categories')
app.register_blueprint(posts, url_prefix='/posts')
app.register_blueprint(projects, url_prefix='/projects')
#if DEBUG:
# app.register_blueprint(monitor, url_prefix='/monitoring')
| 33.115385
| 62
| 0.801394
| 118
| 861
| 5.737288
| 0.29661
| 0.177253
| 0.206795
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00128
| 0.092915
| 861
| 25
| 63
| 34.44
| 0.865557
| 0.220674
| 0
| 0
| 0
| 0
| 0.059002
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.6
| 0
| 0.6
| 0.4
| 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
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
4f8d93fa0a6508934ed869bcc97ce81c06450858
| 300
|
py
|
Python
|
irtorch/estimate/model/util.py
|
naktazdim/irtorch
|
3838496e109cb3a096a84c83461c4c1d6c4080d7
|
[
"MIT"
] | 1
|
2021-02-22T16:32:30.000Z
|
2021-02-22T16:32:30.000Z
|
irtorch/estimate/model/util.py
|
naktazdim/irtorch
|
3838496e109cb3a096a84c83461c4c1d6c4080d7
|
[
"MIT"
] | null | null | null |
irtorch/estimate/model/util.py
|
naktazdim/irtorch
|
3838496e109cb3a096a84c83461c4c1d6c4080d7
|
[
"MIT"
] | 1
|
2021-02-22T16:33:44.000Z
|
2021-02-22T16:33:44.000Z
|
import torch
import torch.nn as nn
import torch.nn.functional as F
def parameter(*size: int) -> nn.Parameter:
return nn.Parameter(torch.zeros(*size), requires_grad=True)
def positive(tensor: torch.Tensor) -> torch.Tensor:
return F.softplus(tensor) # ReLU + eps とかだとうまくいかない (おそらく勾配消失のせい)
| 25
| 69
| 0.736667
| 43
| 300
| 5.116279
| 0.511628
| 0.15
| 0.118182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146667
| 300
| 11
| 70
| 27.272727
| 0.859375
| 0.12
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.428571
| 0.285714
| 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
| 1
| 1
| 0
|
0
| 4
|
4fa2356d2c8b2d6f60df33c2793db1157a8c561e
| 56
|
py
|
Python
|
materialize_threats/mx/shapes/__init__.py
|
sfc-gh-nsfard/materialize-threats
|
983cbaf4921cc9e349be5daf4ab8dfddf01ec865
|
[
"Apache-2.0"
] | 30
|
2020-08-10T22:45:50.000Z
|
2021-11-11T17:21:20.000Z
|
materialize_threats/mx/shapes/__init__.py
|
sfc-gh-nsfard/materialize-threats
|
983cbaf4921cc9e349be5daf4ab8dfddf01ec865
|
[
"Apache-2.0"
] | 14
|
2020-10-06T21:57:04.000Z
|
2021-02-26T22:28:06.000Z
|
materialize_threats/mx/shapes/__init__.py
|
sfc-gh-nsfard/materialize-threats
|
983cbaf4921cc9e349be5daf4ab8dfddf01ec865
|
[
"Apache-2.0"
] | 3
|
2020-08-01T01:09:54.000Z
|
2020-08-09T22:57:54.000Z
|
from .Arguments import Arguments
from .Rect import Rect
| 18.666667
| 32
| 0.821429
| 8
| 56
| 5.75
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 56
| 2
| 33
| 28
| 0.958333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
96f26e7129ffaab93fd21339efbf7bc27b399f41
| 112
|
py
|
Python
|
main/views.py
|
FerdiantJoshua/belajar_online
|
1aa2f5edea04a9fc655ae74bd60b9583c0691d7a
|
[
"MIT"
] | null | null | null |
main/views.py
|
FerdiantJoshua/belajar_online
|
1aa2f5edea04a9fc655ae74bd60b9583c0691d7a
|
[
"MIT"
] | 8
|
2021-03-19T01:58:24.000Z
|
2022-01-13T02:32:40.000Z
|
main/views.py
|
FerdiantJoshua/belajar_online
|
1aa2f5edea04a9fc655ae74bd60b9583c0691d7a
|
[
"MIT"
] | null | null | null |
from django.views import generic
class IndexView(generic.TemplateView):
template_name = 'main/index.html'
| 18.666667
| 38
| 0.776786
| 14
| 112
| 6.142857
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133929
| 112
| 5
| 39
| 22.4
| 0.886598
| 0
| 0
| 0
| 0
| 0
| 0.133929
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
8c0c2d966b6874d09b10fc8ddc193f0a6d3fc0b7
| 87
|
py
|
Python
|
habitat/biolab/apps.py
|
matrach/habitatOS
|
1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3
|
[
"MIT"
] | 1
|
2021-02-01T19:04:39.000Z
|
2021-02-01T19:04:39.000Z
|
habitat/biolab/apps.py
|
matrach/habitatOS
|
1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3
|
[
"MIT"
] | null | null | null |
habitat/biolab/apps.py
|
matrach/habitatOS
|
1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class BiolabConfig(AppConfig):
name = 'biolab'
| 14.5
| 33
| 0.747126
| 10
| 87
| 6.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 87
| 5
| 34
| 17.4
| 0.902778
| 0
| 0
| 0
| 0
| 0
| 0.068966
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
8c14078b64bb4c6108c51b94b917ea5483f40978
| 219
|
py
|
Python
|
Framework/ResourceManagement/SoundLoader.py
|
EpicTofuu/Froggers
|
0395ef801fe11a7881fd32fd570bf3135a4a761f
|
[
"MIT"
] | 1
|
2020-11-17T04:32:55.000Z
|
2020-11-17T04:32:55.000Z
|
Framework/ResourceManagement/SoundLoader.py
|
EpicTofuu/Froggers
|
0395ef801fe11a7881fd32fd570bf3135a4a761f
|
[
"MIT"
] | null | null | null |
Framework/ResourceManagement/SoundLoader.py
|
EpicTofuu/Froggers
|
0395ef801fe11a7881fd32fd570bf3135a4a761f
|
[
"MIT"
] | null | null | null |
import pygame
# load in exclusively sound effects (se)
# use pygame.mixer.music for bgm
class SoundLoader:
def __init__ (self):
pass
def get_asset (self, path):
return pygame.mixer.Sound (path)
| 21.9
| 40
| 0.680365
| 30
| 219
| 4.8
| 0.766667
| 0.152778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.237443
| 219
| 10
| 41
| 21.9
| 0.862275
| 0.315068
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.166667
| 0.166667
| 0.166667
| 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
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
8c1e8243fb71f00d3b88d662cc2b66196d5f4873
| 993
|
py
|
Python
|
causaldag/__init__.py
|
jcai117/causaldag
|
94933db7086d21dad1f9d0ea64d538b0365c8add
|
[
"BSD-3-Clause"
] | 86
|
2019-02-17T18:23:36.000Z
|
2022-03-24T14:28:35.000Z
|
causaldag/__init__.py
|
jcai117/causaldag
|
94933db7086d21dad1f9d0ea64d538b0365c8add
|
[
"BSD-3-Clause"
] | 11
|
2019-11-22T05:35:27.000Z
|
2022-02-26T07:28:05.000Z
|
causaldag/__init__.py
|
jcai117/causaldag
|
94933db7086d21dad1f9d0ea64d538b0365c8add
|
[
"BSD-3-Clause"
] | 17
|
2019-03-28T16:46:00.000Z
|
2022-01-31T19:22:12.000Z
|
"""
CausalDAG
=========
CausalDAG is a Python package for the creation, manipulation, and learning of Causal DAGs.
Simple Example
--------------
>>> from causaldag import rand, partial_correlation_suffstat, partial_correlation_test, MemoizedCI_Tester, gsp
>>> import numpy as np
>>> np.random.seed(12312)
>>> nnodes = 5
>>> nodes = set(range(nnodes))
>>> dag = rand.directed_erdos(nnodes, .5)
>>> gdag = rand.rand_weights(dag)
>>> samples = gdag.sample(100)
>>> suffstat = partial_correlation_suffstat(samples)
>>> ci_tester = MemoizedCI_Tester(partial_correlation_test, suffstat, alpha=1e-3)
>>> est_dag = gsp(nodes, ci_tester)
>>> dag.shd_skeleton(est_dag)
3
License
-------
Released under the 3-Clause BSD license::
Copyright (C) 2018
Chandler Squires <chandlersquires18@gmail.com>
"""
# from .loaders import *
# from . import utils
from conditional_independence import *
from graphical_models import *
import graphical_models.rand as rand
from graphical_model_learning import *
| 26.837838
| 110
| 0.733132
| 128
| 993
| 5.515625
| 0.5625
| 0.101983
| 0.073654
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023095
| 0.127895
| 993
| 36
| 111
| 27.583333
| 0.792148
| 0.839879
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
8c1fcdfa31d89d3ee89680f7a3d252caa3a3a0f9
| 109
|
py
|
Python
|
specs/master/cluster-init/files/host_provider/test/test_json_source_helper.py
|
Azure/cyclecloud-symphony
|
a81c410e3ede1f4472116b5b98eb68d63ff29162
|
[
"MIT"
] | 1
|
2020-06-01T14:05:45.000Z
|
2020-06-01T14:05:45.000Z
|
specs/master/cluster-init/files/host_provider/test/test_json_source_helper.py
|
Azure/cyclecloud-symphony
|
a81c410e3ede1f4472116b5b98eb68d63ff29162
|
[
"MIT"
] | 1
|
2019-08-09T00:49:42.000Z
|
2019-08-09T00:49:42.000Z
|
specs/master/cluster-init/files/host_provider/test/test_json_source_helper.py
|
Azure/cyclecloud-symphony
|
a81c410e3ede1f4472116b5b98eb68d63ff29162
|
[
"MIT"
] | 3
|
2019-02-07T01:12:52.000Z
|
2020-12-30T10:28:32.000Z
|
from util import JsonStore
import sys
if not JsonStore(sys.argv[1], sys.argv[2])._lock():
sys.exit(101)
| 18.166667
| 51
| 0.706422
| 19
| 109
| 4
| 0.684211
| 0.184211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.053763
| 0.146789
| 109
| 5
| 52
| 21.8
| 0.763441
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
8c2055812be56c85b3c27f88dc07ec8fbb597f88
| 52
|
py
|
Python
|
ernest/models/filetypes/__init__.py
|
alycejenni/ernest
|
687e916764a50906d9761108d532ba1120ee629a
|
[
"MIT"
] | null | null | null |
ernest/models/filetypes/__init__.py
|
alycejenni/ernest
|
687e916764a50906d9761108d532ba1120ee629a
|
[
"MIT"
] | 1
|
2018-11-08T10:00:57.000Z
|
2018-11-08T10:00:57.000Z
|
ernest/models/filetypes/__init__.py
|
alycejenni/ernest
|
687e916764a50906d9761108d532ba1120ee629a
|
[
"MIT"
] | null | null | null |
from ._py import Pyfile
from ._base import FileItem
| 17.333333
| 27
| 0.807692
| 8
| 52
| 5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 52
| 2
| 28
| 26
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
4fd5b55f712b8705680f4619aa7faf1c5ede42dc
| 64
|
py
|
Python
|
src/package_name/module_name.py
|
rlipperts/python_package_template
|
589b7fa480033351ff0448addf881ddb63112f54
|
[
"MIT"
] | null | null | null |
src/package_name/module_name.py
|
rlipperts/python_package_template
|
589b7fa480033351ff0448addf881ddb63112f54
|
[
"MIT"
] | null | null | null |
src/package_name/module_name.py
|
rlipperts/python_package_template
|
589b7fa480033351ff0448addf881ddb63112f54
|
[
"MIT"
] | null | null | null |
"""
Implement the functionality here (and in sub-packages).
"""
| 16
| 55
| 0.703125
| 8
| 64
| 5.625
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.140625
| 64
| 3
| 56
| 21.333333
| 0.818182
| 0.859375
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4ff144769a92344d6ea0591ee21da8e58339335a
| 4,282
|
py
|
Python
|
server/ahj_app/tests/test_misc_views.py
|
btansy/ahj-registry
|
b5340c7474f610964e828588572846ce4fb088aa
|
[
"MIT"
] | null | null | null |
server/ahj_app/tests/test_misc_views.py
|
btansy/ahj-registry
|
b5340c7474f610964e828588572846ce4fb088aa
|
[
"MIT"
] | null | null | null |
server/ahj_app/tests/test_misc_views.py
|
btansy/ahj-registry
|
b5340c7474f610964e828588572846ce4fb088aa
|
[
"MIT"
] | null | null | null |
from django.urls import reverse
from django.conf import settings
from ahj_app.models import User, Edit, Comment
from fixtures import *
import pytest
import datetime
@pytest.mark.django_db
def test_form_validator__username_exists(generate_client_with_webpage_credentials):
client = generate_client_with_webpage_credentials(Username='someone')
url = reverse('form-validator')
response = client.get(url, {'Username':'someone'})
assert response.data['UsernameExists']
assert response.status_code == 200
@pytest.mark.django_db
def test_form_validator__email_exists(generate_client_with_webpage_credentials):
client = generate_client_with_webpage_credentials(Email='a@a.com')
url = reverse('form-validator')
response = client.get(url, {'Email':'a@a.com'})
assert response.data['EmailExists']
assert response.status_code == 200
@pytest.mark.django_db
def test_form_validator__no_params(client_with_webpage_credentials):
url = reverse('form-validator')
response = client_with_webpage_credentials.get(url, {})
assert not response.data['UsernameExists'] and not response.data['EmailExists']
assert response.status_code == 200
@pytest.mark.django_db
def test_user_comments__comments_exist(ahj_obj, generate_client_with_webpage_credentials):
client = generate_client_with_webpage_credentials(Username='someone')
user = User.objects.get(Username='someone')
comment1 = Comment.objects.create(UserID=user, AHJPK=ahj_obj.AHJPK, CommentText='This is one comment.', ReplyingTo=None)
comment2 = Comment.objects.create(UserID=user, AHJPK=ahj_obj.AHJPK, CommentText='This is another.', ReplyingTo=comment1.CommentID)
url = reverse('user-comments')
response = client.get(url, {'UserID': user.UserID})
assert len(response.data) == 2 # 2 comments returned
assert response.status_code == 200
@pytest.mark.django_db
def test_user_comments__user_does_not_exist(client_with_webpage_credentials):
url = reverse('user-comments')
response = client_with_webpage_credentials.get(url, {'UserID': 99999999})
assert len(response.data) == 0 # no comments returned
assert response.status_code == 200
@pytest.mark.django_db
def test_comment_submit__normal_submission(ahj_obj, client_with_webpage_credentials):
url = reverse('comment-submit')
response = client_with_webpage_credentials.post(url, {'CommentText': 'This is a comment.', 'AHJPK':ahj_obj.AHJPK})
assert response.data['CommentText']['Value'] == 'This is a comment.' # check if comment object returned matches
assert response.status_code == 200
@pytest.mark.django_db
def test_comment_submit__no_comment(ahj_obj, client_with_webpage_credentials):
url = reverse('comment-submit')
response = client_with_webpage_credentials.post(url, {'AHJPK':ahj_obj.AHJPK})
assert response.status_code == 400
@pytest.mark.django_db
def test_user_edits__edits_exist(ahj_obj, generate_client_with_webpage_credentials):
client = generate_client_with_webpage_credentials(Username='someone')
user = User.objects.get(Username='someone')
edit1 = Edit.objects.create(ChangedBy= user, AHJPK=ahj_obj, SourceTable='Contact', SourceColumn='Title', SourceRow='143', DateRequested=datetime.datetime.now())
edit2 = Edit.objects.create(ChangedBy= user, AHJPK=ahj_obj, SourceTable='Contact', SourceColumn='Title', SourceRow='143', DateRequested=datetime.datetime.now())
url = reverse('user-edits')
response = client.get(url, {'UserID': user.UserID})
assert len(response.data) == 2 # 2 edits returned
assert response.status_code == 200
@pytest.mark.django_db
def test_user_edits__user_does_not_exist(client_with_webpage_credentials):
url = reverse('user-edits')
response = client_with_webpage_credentials.get(url, {'UserID': 99999999})
assert len(response.data) == 0 # no edits returned
assert response.status_code == 200
@pytest.mark.django_db
def test_send_support_email__valid_usage(client_with_webpage_credentials):
url = reverse('send-support-email')
settings.SUNSPEC_SUPPORT_EMAIL = 'ahjregistry@gmail.com'
response = client_with_webpage_credentials.post(url, {'Email': 'test@test.abcdef', 'Subject': 'A subject.', 'Message': 'A message.'})
assert response.status_code == 200
| 49.790698
| 164
| 0.767865
| 560
| 4,282
| 5.592857
| 0.182143
| 0.063857
| 0.108557
| 0.178799
| 0.796616
| 0.787995
| 0.72318
| 0.696041
| 0.643997
| 0.643997
| 0
| 0.016698
| 0.11887
| 4,282
| 86
| 165
| 49.790698
| 0.813411
| 0.02709
| 0
| 0.546667
| 0
| 0
| 0.118241
| 0.005047
| 0
| 0
| 0
| 0
| 0.24
| 1
| 0.133333
| false
| 0
| 0.08
| 0
| 0.213333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 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
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.