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
fd58627cdd2915f83dd00019fc49c6fff8cb6cc1
235
py
Python
holobot/extensions/moderation/commands/responses/auto_kick_toggled_response.py
rexor12/holobot
89b7b416403d13ccfeee117ef942426b08d3651d
[ "MIT" ]
1
2021-05-24T00:17:46.000Z
2021-05-24T00:17:46.000Z
holobot/extensions/moderation/commands/responses/auto_kick_toggled_response.py
rexor12/holobot
89b7b416403d13ccfeee117ef942426b08d3651d
[ "MIT" ]
41
2021-03-24T22:50:09.000Z
2021-12-17T12:15:13.000Z
holobot/extensions/moderation/commands/responses/auto_kick_toggled_response.py
rexor12/holobot
89b7b416403d13ccfeee117ef942426b08d3651d
[ "MIT" ]
null
null
null
from dataclasses import dataclass from holobot.discord.sdk.commands.models import CommandResponse @dataclass class AutoKickToggledResponse(CommandResponse): author_id: str = "" is_enabled: bool = False warn_count: int = 0
26.111111
63
0.778723
27
235
6.666667
0.851852
0
0
0
0
0
0
0
0
0
0
0.005025
0.153191
235
8
64
29.375
0.899497
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.285714
0
0.857143
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
fd5f297c0f7f118624a2914ce4ad7806323cd894
266
py
Python
yatube/users/models.py
ilin-art/yatube_project
dd434b2f69f15217e33c9c7c75d6a24907ec016e
[ "BSD-3-Clause" ]
null
null
null
yatube/users/models.py
ilin-art/yatube_project
dd434b2f69f15217e33c9c7c75d6a24907ec016e
[ "BSD-3-Clause" ]
null
null
null
yatube/users/models.py
ilin-art/yatube_project
dd434b2f69f15217e33c9c7c75d6a24907ec016e
[ "BSD-3-Clause" ]
null
null
null
from django.db import models class Contact(models.Model): name = models.CharField(max_length=100) email = models.EmailField() subject = models.CharField(max_length=100) body = models.TextField() is_answered = models.BooleanField(default=False)
26.6
52
0.733083
33
266
5.818182
0.69697
0.15625
0.1875
0.25
0.28125
0
0
0
0
0
0
0.026906
0.161654
266
9
53
29.555556
0.834081
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.142857
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
b5e6703960cdc3123388ff7dade912a096eaaff5
152
py
Python
python/data.py
mashematics/ta-silent-auction
278d0637f4650935a8adbe05b75a72334ba7dd8a
[ "MIT" ]
null
null
null
python/data.py
mashematics/ta-silent-auction
278d0637f4650935a8adbe05b75a72334ba7dd8a
[ "MIT" ]
null
null
null
python/data.py
mashematics/ta-silent-auction
278d0637f4650935a8adbe05b75a72334ba7dd8a
[ "MIT" ]
null
null
null
import json import urllib2 auctioninventory = json.load(urllib2.urlopen('http://www.beta-myauctiontrader.com/data/data.json')) print auctioninventory
21.714286
99
0.809211
19
152
6.473684
0.684211
0
0
0
0
0
0
0
0
0
0
0.014184
0.072368
152
6
100
25.333333
0.858156
0
0
0
0
0
0.328947
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
4
b5e75bcead5d110b9f98d92d417f6653443bbccc
4,306
py
Python
pyweatherbitdata/data.py
lymanepp/py-weatherbit
8f86aed96d0631f961ccad3bfedcf47050582616
[ "MIT" ]
null
null
null
pyweatherbitdata/data.py
lymanepp/py-weatherbit
8f86aed96d0631f961ccad3bfedcf47050582616
[ "MIT" ]
3
2020-06-17T13:01:29.000Z
2022-01-29T07:58:31.000Z
pyweatherbitdata/data.py
lymanepp/py-weatherbit
8f86aed96d0631f961ccad3bfedcf47050582616
[ "MIT" ]
5
2020-06-17T12:52:18.000Z
2022-01-28T17:11:58.000Z
"""Dataclasses for weatherbit.""" from __future__ import annotations from dataclasses import dataclass, field @dataclass class BaseDataDescription: """A class describing base data for the Weather location.""" key: str city_name: str latitude: float longitude: float country_code: str timezone: str @dataclass class AlertDescription: """A class describing a Severe Weather Alert.""" key: str title: str | None = None en_description: str | None = None loc_description: str | None = None severity: str | None = None effective_utc: str | None = None ends_utc: str | None = None expires_utc: str | None = None onset_utc: str | None = None uri: str | None = None city_name: str | None = None regions: list | None = None @dataclass class ObservationDescription: """A class describing current weather data.""" key: str utc_time: str | None = None observation_time: str | None = None city_name: str | None = None temp: float | None = None app_temp: float | None = None pres: float | None = None humidity: int | None = None slp: float | None = None clouds: int | None = None solar_rad: float | None = None wind_spd: float | None = None wind_spd_kmh: float | None = None wind_spd_knots: float | None = None wind_cdir: str | None = None wind_dir: int | None = None dewpt: float | None = None pod: str | None = None weather_icon: str | None = None weather_code: int | None = None weather_text: str | None = None vis: float | None = None precip: float | None = None snow: float | None = None uv: float | None = None uv_description: str | None = None aqi: float | None = None aqi_level: str | None = None dhi: float | None = None dni: float | None = None ghi: float | None = None elev_angle: int | None = None h_angle: int | None = None timezone: str | None = None sunrise: str | None = None sunset: str | None = None is_night: bool | None = None beaufort_value: int | None = None beaufort_text: str | None = None alert_count: int | None = 0 alerts: list[AlertDescription] = field(default_factory=list) @dataclass class ForecastDetailDescription: """A class describing forecast details weather data.""" key: str utc_time: str | None = None temp: float | None = None max_temp: float | None = None min_temp: float | None = None app_max_temp: float | None = None app_min_temp: float | None = None humidity: int | None = None pres: float | None = None slp: float | None = None clouds: int | None = None wind_spd: float | None = None wind_gust_spd: float | None = None wind_cdir: str | None = None wind_dir: int | None = None dewpt: float | None = None pop: int | None = None condition: str | None = None weather_icon: str | None = None weather_text: str | None = None vis: float | None = None precip: float | None = None snow: float | None = None uv: float | None = None ozone: float | None = None @dataclass class ForecastDescription: """A class describing forecast weather data.""" key: str utc_time: str | None = None city_name: str | None = None temp: float | None = None max_temp: float | None = None min_temp: float | None = None app_max_temp: float | None = None app_min_temp: float | None = None humidity: int | None = None pres: float | None = None slp: float | None = None clouds: int | None = None wind_spd: float | None = None wind_gust_spd: float | None = None wind_cdir: str | None = None wind_dir: int | None = None dewpt: float | None = None pop: int | None = None condition: str | None = None alt_condition: str | None = None weather_icon: str | None = None weather_text: str | None = None vis: float | None = None precip: float | None = None snow: float | None = None uv: float | None = None ozone: float | None = None forecast: list[ForecastDetailDescription] = field(default_factory=list) @dataclass class BeaufortDescription: """A class that describes beaufort values.""" value: int description: str
26.9125
75
0.629587
571
4,306
4.628722
0.187391
0.299659
0.231177
0.077185
0.572077
0.560348
0.527809
0.518729
0.495271
0.450246
0
0.000323
0.280307
4,306
159
76
27.081761
0.852533
0.069206
0
0.609375
0
0
0
0
0
0
0
0
0
1
0
true
0
0.015625
0
0.953125
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
bd16246a8317669d71865bedb43b3cc5f8a60f78
2,844
py
Python
tests/sns/sns_fixtures.py
paulhutchings/beartype-boto3-example
d69298d9444d578799e2a17cb63de11474b2278a
[ "MIT" ]
3
2021-11-16T06:21:11.000Z
2021-11-22T08:59:11.000Z
tests/sns/sns_fixtures.py
paulhutchings/beartype-boto3-example
d69298d9444d578799e2a17cb63de11474b2278a
[ "MIT" ]
9
2021-11-19T03:29:00.000Z
2021-12-30T23:54:47.000Z
tests/sns/sns_fixtures.py
paulhutchings/beartype-boto3-example
d69298d9444d578799e2a17cb63de11474b2278a
[ "MIT" ]
null
null
null
import boto3 import pytest from moto import mock_sns from tests.utils import random_str @pytest.fixture def gen_sns_client(aws_setup): with mock_sns(): yield boto3.client("sns") @pytest.fixture def gen_sns_resource(aws_setup): with mock_sns(): yield boto3.resource("sns") # ============================ # PAGINATOR # ============================ @pytest.fixture def gen_list_endpoints_by_platform_application_paginator(gen_sns_client): return gen_sns_client.get_paginator("list_endpoints_by_platform_application") @pytest.fixture def gen_list_platform_applications_paginator(gen_sns_client): return gen_sns_client.get_paginator("list_platform_applications") @pytest.fixture def gen_list_subscriptions_paginator(gen_sns_client): return gen_sns_client.get_paginator("list_subscriptions") @pytest.fixture def gen_list_subscriptions_by_topic_paginator(gen_sns_client): return gen_sns_client.get_paginator("list_subscriptions_by_topic") @pytest.fixture def gen_list_topics_paginator(gen_sns_client): return gen_sns_client.get_paginator("list_topics") @pytest.fixture def gen_list_phone_numbers_opted_out_paginator(gen_sns_client): return gen_sns_client.get_paginator("list_phone_numbers_opted_out") @pytest.fixture def gen_list_origination_numbers_paginator(gen_sns_client): return gen_sns_client.get_paginator("list_origination_numbers") @pytest.fixture def gen_list_sms_sandbox_phone_numbers_paginator(gen_sns_client): return gen_sns_client.get_paginator("list_sms_sandbox_phone_numbers") # ============================ # RESOURCES # ============================ @pytest.fixture def gen_platform_application(gen_sns_resource): return gen_sns_resource.PlatformApplication(random_str()) @pytest.fixture def gen_platform_endpoint(gen_sns_resource): return gen_sns_resource.PlatformEndpoint(random_str()) @pytest.fixture def gen_subscription(gen_sns_resource): return gen_sns_resource.Subscription(random_str()) @pytest.fixture def gen_topic(gen_sns_resource): return gen_sns_resource.Topic(random_str()) # ============================ # COLLECTIONS # ============================ @pytest.fixture def gen_service_resource_platform_applications_collection(gen_sns_resource): return gen_sns_resource.platform_applications.all() @pytest.fixture def gen_service_resource_subscriptions_collection(gen_sns_resource): return gen_sns_resource.subscriptions.all() @pytest.fixture def gen_service_resource_topics_collection(gen_sns_resource): return gen_sns_resource.topics.all() @pytest.fixture def gen_platform_application_endpoints_collection(gen_platform_application): return gen_platform_application.endpoints.all() @pytest.fixture def gen_topic_subscriptions_collection(gen_topic): return gen_topic.subscriptions.all()
24.307692
81
0.777075
364
2,844
5.596154
0.131868
0.094256
0.149239
0.177221
0.744723
0.576338
0.432008
0.300442
0.235641
0.235641
0
0.001163
0.093179
2,844
116
82
24.517241
0.788678
0.072082
0
0.333333
0
0
0.079118
0.065804
0
0
0
0
0
1
0.301587
false
0
0.063492
0.269841
0.634921
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
bd3b2645383715b47064c9d3276fb505cec908c5
790
py
Python
mysite/ubibank/migrations/0001_initial.py
PUNITKUMARGAUTAM/mydjango
5dd86a99bc0fae0cad712412d2de9c0c6cee6dcc
[ "MIT" ]
null
null
null
mysite/ubibank/migrations/0001_initial.py
PUNITKUMARGAUTAM/mydjango
5dd86a99bc0fae0cad712412d2de9c0c6cee6dcc
[ "MIT" ]
null
null
null
mysite/ubibank/migrations/0001_initial.py
PUNITKUMARGAUTAM/mydjango
5dd86a99bc0fae0cad712412d2de9c0c6cee6dcc
[ "MIT" ]
null
null
null
# Generated by Django 3.2.6 on 2021-08-25 09:20 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Bank', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('Acno', models.CharField(max_length=100)), ('Acname', models.CharField(max_length=50)), ('Actype', models.CharField(max_length=50)), ('Acbal', models.CharField(max_length=50)), ('Acmbno', models.CharField(max_length=50)), ('email', models.CharField(max_length=50)), ], ), ]
29.259259
117
0.560759
81
790
5.358025
0.580247
0.207373
0.248848
0.331797
0.299539
0
0
0
0
0
0
0.050725
0.301266
790
26
118
30.384615
0.735507
0.056962
0
0
1
0
0.053836
0
0
0
0
0
0
1
0
false
0
0.052632
0
0.263158
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
bd4e43cd770239b07c51238402cb7b17ce82ecc3
235
py
Python
BioUtils/Tools/__init__.py
allista/BioUtils
8ec645dfc63b8900e3cda483916e2e082a9ed83a
[ "MIT" ]
1
2018-01-24T10:25:53.000Z
2018-01-24T10:25:53.000Z
BioUtils/Tools/__init__.py
allista/BioUtils
8ec645dfc63b8900e3cda483916e2e082a9ed83a
[ "MIT" ]
null
null
null
BioUtils/Tools/__init__.py
allista/BioUtils
8ec645dfc63b8900e3cda483916e2e082a9ed83a
[ "MIT" ]
1
2020-01-31T16:14:19.000Z
2020-01-31T16:14:19.000Z
''' Created on Jul 20, 2012 @author: Allis Tauri <allista@gmail.com> ''' from .AbortableBase import AbortableBase, aborted from .WaitingThread import WaitingThread from .EchoLogger import EchoLogger from .Pipeline import PipelineNode
23.5
49
0.8
28
235
6.714286
0.678571
0
0
0
0
0
0
0
0
0
0
0.029126
0.123404
235
10
50
23.5
0.883495
0.276596
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
1f9e4d554794481f68e249de80f9db82a4bf4b6b
24
py
Python
proselint/checks/corporate_speak/__init__.py
kerri-hicks/proselint
12efe888042703ba409b51de660ed423622b2ad2
[ "BSD-3-Clause" ]
1
2018-10-25T22:39:32.000Z
2018-10-25T22:39:32.000Z
proselint/checks/corporate_speak/__init__.py
kerri-hicks/proselint
12efe888042703ba409b51de660ed423622b2ad2
[ "BSD-3-Clause" ]
50
2021-05-19T17:00:56.000Z
2022-03-28T11:06:11.000Z
proselint/checks/corporate_speak/__init__.py
kerri-hicks/proselint
12efe888042703ba409b51de660ed423622b2ad2
[ "BSD-3-Clause" ]
null
null
null
u"""Corporate-speak."""
12
23
0.625
3
24
5
1
0
0
0
0
0
0
0
0
0
0
0
0.041667
24
1
24
24
0.652174
0.666667
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
950822f90155400eb61240b91b77ecdc89508d13
289
py
Python
vxTrader/broker/__init__.py
vex1023/vxTeller
0e5e265d1a1eb3871cf4574667204ae5bbf104ff
[ "MIT" ]
54
2016-10-22T05:17:34.000Z
2022-03-18T08:15:27.000Z
vxTrader/broker/__init__.py
vex1023/vxTeller
0e5e265d1a1eb3871cf4574667204ae5bbf104ff
[ "MIT" ]
5
2016-10-15T03:46:07.000Z
2018-12-27T00:54:12.000Z
vxTrader/broker/__init__.py
vex1023/vxTeller
0e5e265d1a1eb3871cf4574667204ae5bbf104ff
[ "MIT" ]
24
2016-10-12T17:02:03.000Z
2021-12-18T09:26:33.000Z
# encoding = utf-8 ''' broker基础类 ''' from .WebTrader import WebTrader, LoginSession, BrokerFactory from .gfTrader import gfTrader from .xqTrader import xqTrader from .yjbTrader import yjbTrader __all__ = ['gfTrader', 'yjbTrader', 'xqTrader', 'WebTrader', 'LoginSession', 'BrokerFactory']
26.272727
93
0.761246
29
289
7.448276
0.448276
0.194444
0.314815
0
0
0
0
0
0
0
0
0.003922
0.117647
289
10
94
28.9
0.843137
0.093426
0
0
0
0
0.232283
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
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
0
0
1
0
1
0
0
4
950e6d875ef91baa5289d76570f8646d8af0913d
44
py
Python
v.py
SanjanaMahesh3/Scientific-Calculator
12e61c4ad81d1cab705431f55e789b7fb6b1d078
[ "MIT" ]
null
null
null
v.py
SanjanaMahesh3/Scientific-Calculator
12e61c4ad81d1cab705431f55e789b7fb6b1d078
[ "MIT" ]
null
null
null
v.py
SanjanaMahesh3/Scientific-Calculator
12e61c4ad81d1cab705431f55e789b7fb6b1d078
[ "MIT" ]
null
null
null
import math import numpy as np c=9**3 a=c
11
19
0.681818
11
44
2.727273
0.818182
0
0
0
0
0
0
0
0
0
0
0.058824
0.227273
44
4
20
11
0.823529
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
952846ea6c978b756892312d21f972d599ecef59
201
py
Python
tests/ltypes.py
akshanshbhatt/lpython
70fef49dbbb6cbb0447f7013231171e5c8b8e5df
[ "BSD-3-Clause" ]
31
2022-01-07T23:56:33.000Z
2022-03-29T16:09:02.000Z
tests/ltypes.py
akshanshbhatt/lpython
70fef49dbbb6cbb0447f7013231171e5c8b8e5df
[ "BSD-3-Clause" ]
197
2021-12-29T19:01:41.000Z
2022-03-31T15:58:25.000Z
tests/ltypes.py
akshanshbhatt/lpython
70fef49dbbb6cbb0447f7013231171e5c8b8e5df
[ "BSD-3-Clause" ]
17
2022-01-06T15:34:36.000Z
2022-03-31T13:55:33.000Z
def test_i8(): i: i8 i = 5 print(i) def test_i16(): i: i16 i = 4 print(i) def test_i32(): i: i32 i = 3 print(i) def test_i64(): i: i64 i = 2 print(i)
10.05
15
0.447761
36
201
2.388889
0.333333
0.325581
0.313953
0.453488
0
0
0
0
0
0
0
0.152542
0.412935
201
19
16
10.578947
0.576271
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.25
0.25
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
9532481eb2d2034f847bd93be9057790c6c28e50
58
py
Python
panda3d_render_pass/__init__.py
Kupoman/panda3d-render-pass-node
6c822263c9b04764c537b2a71a99ed7fff0847cb
[ "MIT" ]
3
2019-02-28T12:47:02.000Z
2019-04-17T05:51:19.000Z
panda3d_render_pass/__init__.py
Kupoman/panda3d-render-pass-node
6c822263c9b04764c537b2a71a99ed7fff0847cb
[ "MIT" ]
10
2019-02-16T20:44:50.000Z
2020-05-09T16:31:28.000Z
panda3d_render_pass/__init__.py
Kupoman/panda3d-render-pass
6c822263c9b04764c537b2a71a99ed7fff0847cb
[ "MIT" ]
null
null
null
__version__ = '0.1.0' from .renderpass import RenderPass
14.5
34
0.758621
8
58
5
0.75
0
0
0
0
0
0
0
0
0
0
0.06
0.137931
58
3
35
19.333333
0.74
0
0
0
0
0
0.086207
0
0
0
0
0
0
1
0
false
0.5
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
4
1f119074509687a00b9630413fb8d27cb4093b8e
88
py
Python
settings.py
erisenlee/rf_test
1eddbfc9167ec4a18366cf9f7e44cee99b003891
[ "MIT" ]
null
null
null
settings.py
erisenlee/rf_test
1eddbfc9167ec4a18366cf9f7e44cee99b003891
[ "MIT" ]
1
2021-06-01T22:30:49.000Z
2021-06-01T22:30:49.000Z
settings.py
erisenlee/rf_test
1eddbfc9167ec4a18366cf9f7e44cee99b003891
[ "MIT" ]
null
null
null
import os.path BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # print(BASE_DIR)
17.6
53
0.761364
15
88
4.066667
0.6
0.295082
0
0
0
0
0
0
0
0
0
0
0.090909
88
5
54
17.6
0.7625
0.170455
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
1f22859df578795d478858e8b5be968bd3b728c6
94
py
Python
extutils/strtrans/__init__.py
RaenonX/Jelly-Bot-API
c7da1e91783dce3a2b71b955b3a22b68db9056cf
[ "MIT" ]
5
2020-08-26T20:12:00.000Z
2020-12-11T16:39:22.000Z
extutils/strtrans/__init__.py
RaenonX/Jelly-Bot
c7da1e91783dce3a2b71b955b3a22b68db9056cf
[ "MIT" ]
234
2019-12-14T03:45:19.000Z
2020-08-26T18:55:19.000Z
extutils/strtrans/__init__.py
RaenonX/Jelly-Bot-API
c7da1e91783dce3a2b71b955b3a22b68db9056cf
[ "MIT" ]
2
2019-10-23T15:21:15.000Z
2020-05-22T09:35:55.000Z
"""Module for translating things to :class:`str`.""" from .type_trans import type_translation
31.333333
52
0.765957
13
94
5.384615
0.923077
0
0
0
0
0
0
0
0
0
0
0
0.106383
94
2
53
47
0.833333
0.489362
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
1f332465815f808a88f77579d66806b2c4cebdd8
5,418
py
Python
app2/LocalFunctionProj/tests/Romanize_Test.py
sfibich/funWithPython
b500aeab3bea8242b08acb67ab38550a9a236eaa
[ "MIT" ]
null
null
null
app2/LocalFunctionProj/tests/Romanize_Test.py
sfibich/funWithPython
b500aeab3bea8242b08acb67ab38550a9a236eaa
[ "MIT" ]
null
null
null
app2/LocalFunctionProj/tests/Romanize_Test.py
sfibich/funWithPython
b500aeab3bea8242b08acb67ab38550a9a236eaa
[ "MIT" ]
null
null
null
import unittest import romanize class Testing(unittest.TestCase): def test_canary(self): a = 1 b = 1 self.assertEqual(a, b) def test_I(self): expected_result = "I" result = romanize.romanize(1) self.assertEqual(expected_result, result) def test_V(self): expected_result = "V" result = romanize.romanize(5) self.assertEqual(expected_result, result) def test_X(self): expected_result = "X" result = romanize.romanize(10) self.assertEqual(expected_result, result) def test_II(self): expected_result = "II" result = romanize.romanize(2) self.assertEqual(expected_result, result) def test_III(self): expected_result = "III" result = romanize.romanize(3) self.assertEqual(expected_result, result) def test_IV(self): expected_result = "IV" result = romanize.romanize(4) self.assertEqual(expected_result, result) def test_VI(self): expected_result = "VI" result = romanize.romanize(6) self.assertEqual(expected_result, result) def test_VII(self): expected_result = "VII" result = romanize.romanize(7) self.assertEqual(expected_result, result) def test_VIII(self): expected_result = "VIII" result = romanize.romanize(8) self.assertEqual(expected_result, result) def test_IX(self): expected_result = "IX" result = romanize.romanize(9) self.assertEqual(expected_result, result) def test_XI(self): expected_result = "XI" result = romanize.romanize(11) self.assertEqual(expected_result, result) def test_XII(self): expected_result = "XII" result = romanize.romanize(12) self.assertEqual(expected_result, result) def test_XIII(self): expected_result = "XIII" result = romanize.romanize(13) self.assertEqual(expected_result, result) def test_XIV(self): expected_result = "XIV" result = romanize.romanize(14) self.assertEqual(expected_result, result) def test_XV(self): expected_result = "XV" result = romanize.romanize(15) self.assertEqual(expected_result, result) def test_XIX(self): expected_result = "XIX" result = romanize.romanize(19) self.assertEqual(expected_result, result) def test_XX(self): expected_result = "XX" result = romanize.romanize(20) self.assertEqual(expected_result, result) def test_XXI(self): expected_result = "XXI" result = romanize.romanize(21) self.assertEqual(expected_result, result) def test_XXIII(self): expected_result = "XXIII" result = romanize.romanize(23) self.assertEqual(expected_result, result) def test_XL(self): expected_result = "XL" result = romanize.romanize(40) self.assertEqual(expected_result, result) def test_XLIX(self): expected_result = "XLIX" result = romanize.romanize(49) self.assertEqual(expected_result, result) def test_L(self): expected_result = "L" result = romanize.romanize(50) self.assertEqual(expected_result, result) def test_LX(self): expected_result = "LX" result = romanize.romanize(60) self.assertEqual(expected_result, result) def test_XC(self): expected_result = "XC" result = romanize.romanize(90) self.assertEqual(expected_result, result) def test_C(self): expected_result = "C" result = romanize.romanize(100) self.assertEqual(expected_result, result) def test_CC(self): expected_result = "CC" result = romanize.romanize(200) self.assertEqual(expected_result, result) def test_CD(self): expected_result = "CD" result = romanize.romanize(400) self.assertEqual(expected_result, result) def test_D(self): expected_result = "D" result = romanize.romanize(500) self.assertEqual(expected_result, result) def test_DC(self): expected_result = "DC" result = romanize.romanize(600) self.assertEqual(expected_result, result) def test_CM(self): expected_result = "CM" result = romanize.romanize(900) self.assertEqual(expected_result, result) def test_M(self): expected_result = "M" result = romanize.romanize(1000) self.assertEqual(expected_result, result) def test_MC(self): expected_result = "MC" result = romanize.romanize(1100) self.assertEqual(expected_result, result) def test_MI(self): expected_result = "MI" result = romanize.romanize(1001) self.assertEqual(expected_result, result) def test_MCM(self): expected_result = "MCM" result = romanize.romanize(1900) self.assertEqual(expected_result, result) def test_MM(self): expected_result = "MM" result = romanize.romanize(2000) self.assertEqual(expected_result, result) def test_MMMM(self): expected_result = "MMMM" result = romanize.romanize(4000) self.assertEqual(expected_result, result) if __name__ == "__main__": unittest.main()
27.927835
49
0.633444
601
5,418
5.515807
0.14975
0.304072
0.195475
0.314932
0.453997
0.443439
0.443439
0
0
0
0
0.020975
0.269657
5,418
193
50
28.072539
0.81678
0
0
0.235294
0
0
0.016796
0
0
0
0
0
0.24183
1
0.24183
false
0
0.013072
0
0.261438
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
1f54ede2d3d9fe513348511ca2b39c6755109310
1,097
py
Python
slender/tests/dictionary/test_eq.py
torokmark/slender
3bf815e22f7802ba48706f31ba608cf609e23e68
[ "Apache-2.0" ]
1
2020-01-10T21:51:46.000Z
2020-01-10T21:51:46.000Z
slender/tests/dictionary/test_eq.py
torokmark/slender
3bf815e22f7802ba48706f31ba608cf609e23e68
[ "Apache-2.0" ]
null
null
null
slender/tests/dictionary/test_eq.py
torokmark/slender
3bf815e22f7802ba48706f31ba608cf609e23e68
[ "Apache-2.0" ]
null
null
null
from unittest import TestCase, skip from expects import * from slender import Dictionary class TestEq(TestCase): def test_eq_if_dictionary_is_empty(self): d1 = Dictionary[str, int]({}) d2 = Dictionary[str, int]({}) expect(d1 == d2).to(be_true) def test_eq_if_dictionary_has_different_length(self): d1 = Dictionary[str, int]({'a': 1, 'b': 2, 'c': 3}) d2 = Dictionary[str, int]({'a': 1, 'b': 2, 'c': 3, 'd': 4}) expect(d1 == d2).to(be_false) def test_eq_if_dictionary_contains_different_elements(self): d1 = Dictionary[str, int]({'a': 1, 'b': 2, 'c': 3}) d2 = Dictionary[str, int]({'a': 1, 'b': 2, 'd': 4}) expect(d1 == d2).to(be_false) def test_eq_if_dictionary_contains_same_elements(self): d1 = Dictionary[str, int]({'a': 1, 'b': 2, 'c': 3}) d2 = Dictionary[str, int]({'a': 1, 'b': 2, 'c': 3}) expect(d1 == d2).to(be_true) def test_eq_if_param_is_different(self): d1 = Dictionary[str, int]({'a': 1, 'b': 2, 'c': 3}) expect(d1 == [1, 2, 3]).to(be_false)
32.264706
67
0.571559
170
1,097
3.494118
0.241176
0.19697
0.242424
0.200337
0.70202
0.612795
0.612795
0.612795
0.612795
0.612795
0
0.051251
0.235187
1,097
33
68
33.242424
0.656734
0
0
0.347826
0
0
0.02011
0
0
0
0
0
0
1
0.217391
false
0
0.130435
0
0.391304
0
0
0
0
null
0
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
1f58d7334dacdb94aa262bfbc7bf8f82b18b31c3
75
py
Python
roundabout/ci/hudson/__init__.py
ChristopherMacGown/roundabout
b2222bb1aa98a1c39c26928dbcd9f1be114d02e4
[ "Apache-2.0" ]
3
2016-08-09T21:26:06.000Z
2018-04-23T15:11:56.000Z
roundabout/ci/hudson/__init__.py
ChristopherMacGown/roundabout
b2222bb1aa98a1c39c26928dbcd9f1be114d02e4
[ "Apache-2.0" ]
1
2020-10-23T20:49:22.000Z
2020-10-23T20:49:22.000Z
roundabout/ci/hudson/__init__.py
ChristopherMacGown/roundabout
b2222bb1aa98a1c39c26928dbcd9f1be114d02e4
[ "Apache-2.0" ]
null
null
null
""" Roundabout hudson/jenkins module. """ import roundabout.ci.hudson.job
18.75
41
0.746667
9
75
6.222222
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.106667
75
3
42
25
0.835821
0.44
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
1f8469dd83f7c24bc479e50332a6f255f2f176d8
178
py
Python
sdk/typing.py
morais90/sdk.py
97fcb6f7079ae9ae7606265a13c4d7d9670e176c
[ "MIT" ]
null
null
null
sdk/typing.py
morais90/sdk.py
97fcb6f7079ae9ae7606265a13c4d7d9670e176c
[ "MIT" ]
8
2021-11-17T20:30:21.000Z
2022-03-29T02:23:32.000Z
sdk/typing.py
morais90/sdk.py
97fcb6f7079ae9ae7606265a13c4d7d9670e176c
[ "MIT" ]
null
null
null
from typing import Dict, List, Union Header = Dict[str, str] QueryParams = Dict[str, Union[str, List[str]]] RawBody = Union[str, bytes] Body = Dict[str, Union[str, bool, int]]
22.25
46
0.696629
28
178
4.428571
0.5
0.169355
0.193548
0.241935
0
0
0
0
0
0
0
0
0.151685
178
7
47
25.428571
0.821192
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
0
1
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
1f88514b4c988b39844da138dcac11246dc83692
309
py
Python
comments/forms.py
omisolaidowu/null_project
8f36188fd5f515a2678f402790d254ce1c4a229a
[ "Apache-2.0" ]
null
null
null
comments/forms.py
omisolaidowu/null_project
8f36188fd5f515a2678f402790d254ce1c4a229a
[ "Apache-2.0" ]
null
null
null
comments/forms.py
omisolaidowu/null_project
8f36188fd5f515a2678f402790d254ce1c4a229a
[ "Apache-2.0" ]
null
null
null
from django import forms class commentform(forms.Form): content_type = forms.CharField(widget=forms.HiddenInput) object_id = forms.IntegerField(widget=forms.HiddenInput) #parent_id = forms.IntegerField(widget=forms.HiddenInput, required=False) content = forms.CharField(label='', widget=forms.Textarea)
38.625
74
0.802589
38
309
6.447368
0.526316
0.179592
0.269388
0.204082
0.334694
0.334694
0
0
0
0
0
0
0.084142
309
8
75
38.625
0.865724
0.23301
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
1f88e23b96139f56a7f03208d42069d5e58b3e6b
3,235
py
Python
Topics/WIP/BayesianAnalysis.py
forbes-group/physics-581-physics-inspired-computation
5459a476068680d7e065a735d643d480d902a06a
[ "FTL" ]
null
null
null
Topics/WIP/BayesianAnalysis.py
forbes-group/physics-581-physics-inspired-computation
5459a476068680d7e065a735d643d480d902a06a
[ "FTL" ]
null
null
null
Topics/WIP/BayesianAnalysis.py
forbes-group/physics-581-physics-inspired-computation
5459a476068680d7e065a735d643d480d902a06a
[ "FTL" ]
null
null
null
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.4 # kernelspec: # display_name: Python 3 (PHYS-581-2021) # language: python # metadata: # debugger: true # name: phys-581-2021 # resource_dir: /home/user/.local/share/jupyter/kernels/phys-581-2021 # --- import mmf_setup;mmf_setup.nbinit() # # Bayesian Analysis # Here we work through the example of fitting data with a sine wave. # # Let us assume that some data is being generated by the following function: # # $$ # y(t) = f(t) = A\cos(\omega t + \phi). # $$ # # The data is $D = \{(t_0, y_0), (t_1, y_1), \dots, (t_{N-1}, y_{N-1})\}$: # # $$ # y_i = f_{\vect{a}}(t_i) + e_i # $$ # # where $e_i$ is some random noise with distribution $P_e(e)$ and our model parameters are $\vect{a} = (A, \omega, \phi)$. # # To apply Bayes' theorem, we need prior information $P(\vect{a}|I)$ on these parameters, which we can then update based on the data: # # $$ # P(\vect{a}|D,I) = \frac{P(D|\vect{a}, I)P(\vect{a}|I)}{P(D|I)}. # $$ # # We need to compute the likelihood $P(D|\vect{a}, I)$ of realizing the data $D$ given the underlying parameters $\vect{a}$ and prior information $I$. The denominator can then be computed as a normalization factor. # To estimate the likelihood, we will need to interpret the *noise* distribution $P_i(e)$ instead as a characterization of our measurement process. How likely are we to measure $(t_i, y_i)$ if the parameters are $\vect{a}$? In general, this will be some distribution $P_i(t_i, y_i, \vect{a})$: # # $$ # P(D|\vect{a}, I) = \prod_{i} P_i\big(t_i, y_i, \vect{a}\big). # $$ # # In our cases, however, we generally consider it certain that we can take measurements at a prescribed set of times $t_i$, and, as discussed above, we assume that the measurement will be affected by random noise $e_i$ with distribution $P_e(e)$, thus, we have: # # $$ # P_i\big(t_i, y_i, \vect{a}\big) = P_e\big(y_i - f_{\vect{a}}(t_i)\big)\\ # P(D|\vect{a}, I) = \prod_{i} P_e\big(y_i - f_{\vect{a}}(t_i)\big) # $$ # # *Note: the priori information $I$ may not seem to enter into the formula, but is where the information about the measurement process comes in. In this case, it informs us about the distribution of errors $P_i(e)$.* # ## Neutron Stars # Consider the problems of constraining parameters $\vect{a}$ that describe the equation of state of a neutron star. Solving the TOV equations gives a function $M(\vect{a}, p_c) \in \big(1, M_{\max}(\vect{a})\big)$ where $p_c$ is the central pressure. Given some prior distribution $P(\vect{a}|I)$ on the parameters $\vect{a}$, what can we learn from some observation $D$ of a neutron star described by a distribution $P_e(m)$ on the measured mass? As before: # # $$ # P(\vect{a}|D,I) = \frac{P(D|\vect{a}, I)P(\vect{a}|I)}{P(D|I)} # $$ # # where we must compute the likelihood $P(D|\vect{a}, I)$ of the observation. # # # Let's suppose that we can come up with some prior on $p_c$ # # # # The neutron star equation of state says that # # # # Let's now apply this and see what we what we can learn from some data.
38.975904
462
0.657496
571
3,235
3.635727
0.338004
0.060212
0.028902
0.020231
0.140173
0.113198
0.108863
0.104046
0.091522
0.06262
0
0.013293
0.18609
3,235
82
463
39.45122
0.775161
0.939722
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
2f2ce6bd5a70d62243e34ad8d70bc409f05ac83d
131
py
Python
lego/apps/slack/serializers.py
andrinelo/lego
9b53c8fe538d9107b980a70e2a21fb487cc3b290
[ "MIT" ]
null
null
null
lego/apps/slack/serializers.py
andrinelo/lego
9b53c8fe538d9107b980a70e2a21fb487cc3b290
[ "MIT" ]
null
null
null
lego/apps/slack/serializers.py
andrinelo/lego
9b53c8fe538d9107b980a70e2a21fb487cc3b290
[ "MIT" ]
null
null
null
from rest_framework import serializers class SlackInviteSerializer(serializers.Serializer): email = serializers.EmailField()
21.833333
52
0.824427
12
131
8.916667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.114504
131
5
53
26.2
0.922414
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
2f559ebe4b0e9b6300c98d510f9effbfe78ecfb7
171
py
Python
desafiobackend/quiz/urls.py
nonatin1000/desafio-backend
1711c5aae351cfaaae2b1a9bd19836a331dbb825
[ "MIT" ]
null
null
null
desafiobackend/quiz/urls.py
nonatin1000/desafio-backend
1711c5aae351cfaaae2b1a9bd19836a331dbb825
[ "MIT" ]
null
null
null
desafiobackend/quiz/urls.py
nonatin1000/desafio-backend
1711c5aae351cfaaae2b1a9bd19836a331dbb825
[ "MIT" ]
null
null
null
from django.urls import path, include from desafiobackend.quiz import api app_name = 'quiz' urlpatterns = [ path('api/', include('desafiobackend.quiz.api.urls')), ]
19
58
0.725146
22
171
5.590909
0.545455
0.292683
0
0
0
0
0
0
0
0
0
0
0.140351
171
8
59
21.375
0.836735
0
0
0
0
0
0.210526
0.163743
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
85d0e82f182ab7d1eea8da2c875fd4825eacc406
112
py
Python
core/graph/__init__.py
hyunynim/DIST-Renderer
4717ee8cea77f4f413b61f380a893c6800d0bde5
[ "MIT" ]
176
2020-06-11T19:16:33.000Z
2022-03-29T01:38:28.000Z
core/graph/__init__.py
hyunynim/DIST-Renderer
4717ee8cea77f4f413b61f380a893c6800d0bde5
[ "MIT" ]
6
2020-06-26T05:26:56.000Z
2021-11-10T07:31:21.000Z
core/graph/__init__.py
hyunynim/DIST-Renderer
4717ee8cea77f4f413b61f380a893c6800d0bde5
[ "MIT" ]
23
2020-06-11T21:43:03.000Z
2022-02-18T00:16:16.000Z
import os, sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from deep_sdf_decoder import Decoder
28
59
0.8125
19
112
4.473684
0.631579
0.141176
0
0
0
0
0
0
0
0
0
0
0.071429
112
3
60
37.333333
0.817308
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
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
1
0
1
0
0
0
0
4
85e467f660787f14b5ac4f387b1156dce363725c
1,353
py
Python
src/kalyna_cipher/classRound.py
hunkob/piics_project
2f5d693ab44b04ab65994f5cd67fdfd530731c67
[ "Apache-2.0" ]
null
null
null
src/kalyna_cipher/classRound.py
hunkob/piics_project
2f5d693ab44b04ab65994f5cd67fdfd530731c67
[ "Apache-2.0" ]
null
null
null
src/kalyna_cipher/classRound.py
hunkob/piics_project
2f5d693ab44b04ab65994f5cd67fdfd530731c67
[ "Apache-2.0" ]
null
null
null
from kalyna_cipher.classBasic import classBasic from kalyna_cipher.classTable import classTable from functools import reduce class classRound(classBasic): def __init__(self, var_c=None, var_l=None): classBasic.__init__(self, var_c, var_l) self.state = self.func_gen_matrix() def func_s_block_round(self): self.state = self.func_s_block(self.state) def func_r_s_block_round(self): self.state = self.func_r_s_block(self.state) def func_s_row_round(self): self.state = self.func_s_row(self.state) def func_r_s_row_round(self): self.state = self.func_r_s_row(self.state) def func_fill_matrix_round(self, input_mas): # [] self.state = self.func_fill_matrix(self.state, input_mas) def func_m_col_round(self): self.state = self.func_m_col(self.state) def func_r_m_col_round(self): self.state = self.func_r_m_col(self.state) def func_add_rkey_round(self, input_matrix): # [[], ....] self.state = self.func_add_rkey(self.state, input_matrix) def func_r_add_rkey_round(self, input_matrix): # [[], ....] self.state = self.func_r_add_rkey(self.state, input_matrix) def func_xor_rkey_round(self, input_matrix): # [[], ....] self.state = self.func_xor_rkey(self.state, input_matrix)
30.75
67
0.682188
205
1,353
4.102439
0.165854
0.224732
0.170036
0.222354
0.637337
0.606421
0.461356
0.457788
0.153389
0.104637
0
0
0.20473
1,353
43
68
31.465116
0.781599
0.025868
0
0
0
0
0
0
0
0
0
0
0
1
0.407407
false
0
0.111111
0
0.555556
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
0
1
0
0
4
85e54477a86d54492793c52539f80b1b9d26e240
875
py
Python
src/db/collections/token_map.py
Leibniz137/EthereumBridge
4b82a68cdc09e5ea79ec2fbf87aa065a2a3a5ffa
[ "MIT" ]
null
null
null
src/db/collections/token_map.py
Leibniz137/EthereumBridge
4b82a68cdc09e5ea79ec2fbf87aa065a2a3a5ffa
[ "MIT" ]
null
null
null
src/db/collections/token_map.py
Leibniz137/EthereumBridge
4b82a68cdc09e5ea79ec2fbf87aa065a2a3a5ffa
[ "MIT" ]
null
null
null
from mongoengine import Document, StringField, IntField class TokenRecord(Document): name = StringField(required=True) swap_address: StringField(required=True) swap_code_hash: StringField(required=True) token_address: StringField(required=True) class TokenMapRecord(Document): src = StringField(required=True) src_network = StringField(required=True) swap_token = TokenRecord class TokenPairing(Document): # Blockchain name src_network = StringField(required=True) # Token name src_coin = StringField(required=True) # Smart contract address src_address = StringField(required=True, unique=True) dst_network = StringField(required=True) dst_address = StringField(required=True, unique=True) dst_coin = StringField(required=True) decimals = IntField(required=True) name = StringField(required=True)
30.172414
57
0.749714
96
875
6.708333
0.28125
0.26087
0.464286
0.186335
0.236025
0.13354
0.13354
0
0
0
0
0
0.164571
875
28
58
31.25
0.880985
0.056
0
0.210526
0
0
0
0
0
0
0
0
0
1
0
false
0
0.052632
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
c838df0247addc8d29b839aed672839f19e6dfbd
80
py
Python
Problems/Hello, world_/main.py
TataSatyaPratheek/Tic-Tac-Toe
fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd
[ "MIT" ]
null
null
null
Problems/Hello, world_/main.py
TataSatyaPratheek/Tic-Tac-Toe
fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd
[ "MIT" ]
null
null
null
Problems/Hello, world_/main.py
TataSatyaPratheek/Tic-Tac-Toe
fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd
[ "MIT" ]
null
null
null
name = input() def foo(name): print("Hello, world! Hello, "+name) foo(name)
16
39
0.625
12
80
4.166667
0.583333
0.28
0
0
0
0
0
0
0
0
0
0
0.175
80
5
40
16
0.757576
0
0
0
0
0
0.259259
0
0
0
0
0
0
1
0.25
false
0
0
0
0.25
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
c85ede83687867c522c1d3c4ecf58e2f21e3cacd
97
py
Python
modules/achievements/events.py
heolin123/funcrowd
20167783de208394c09ed0429a5f02ec6dd79c42
[ "MIT" ]
null
null
null
modules/achievements/events.py
heolin123/funcrowd
20167783de208394c09ed0429a5f02ec6dd79c42
[ "MIT" ]
11
2019-11-12T23:26:45.000Z
2021-06-10T17:37:23.000Z
modules/achievements/events.py
heolin123/funcrowd
20167783de208394c09ed0429a5f02ec6dd79c42
[ "MIT" ]
null
null
null
class Events: ALWAYS = "ALWAYS" ON_LOGIN = "ON_LOGIN" ON_ITEM_DONE = "ON_ITEM_DONE"
16.166667
33
0.649485
14
97
4.071429
0.5
0.245614
0.315789
0
0
0
0
0
0
0
0
0
0.247423
97
5
34
19.4
0.780822
0
0
0
0
0
0.270833
0
0
0
0
0
0
1
0
false
0
0
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c0b6ff9abfc5509fa3a920fe121c160ef48a2f21
281
py
Python
Exam5November/LuckyNumbers.py
yani-valeva/Programming-Basics-Python
c553d331ffd210d362df0098bedf28e125a65dbf
[ "MIT" ]
null
null
null
Exam5November/LuckyNumbers.py
yani-valeva/Programming-Basics-Python
c553d331ffd210d362df0098bedf28e125a65dbf
[ "MIT" ]
null
null
null
Exam5November/LuckyNumbers.py
yani-valeva/Programming-Basics-Python
c553d331ffd210d362df0098bedf28e125a65dbf
[ "MIT" ]
null
null
null
number = int(input()) for a in range(1, 9 + 1): for b in range(1, 9 + 1): for c in range(1, 9 + 1): for d in range(1, 9 + 1): if a + b == c + d and number % (a +b) == 0: print('{0}{1}{2}{3}'.format(a, b, c, d), end=" ")
31.222222
69
0.391459
52
281
2.115385
0.384615
0.254545
0.290909
0.327273
0.445455
0.354545
0
0
0
0
0
0.10119
0.402135
281
8
70
35.125
0.553571
0
0
0
0
0
0.046263
0
0
0
0
0
0
1
0
false
0
0
0
0
0.142857
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c0b805ccc348f3dc47e6a698464edf426f344001
348
py
Python
src/bert/data_processor.py
tamarakatic/sentiment-analysis-of-drug-reviews
743f74f45626f7c5e30b10806fb02583ef58a669
[ "MIT" ]
null
null
null
src/bert/data_processor.py
tamarakatic/sentiment-analysis-of-drug-reviews
743f74f45626f7c5e30b10806fb02583ef58a669
[ "MIT" ]
4
2021-06-08T19:43:13.000Z
2022-03-11T23:43:47.000Z
src/bert/data_processor.py
tamarakatic/sentiment-analysis-of-drug-reviews
743f74f45626f7c5e30b10806fb02583ef58a669
[ "MIT" ]
null
null
null
class DataProcessor(object): def get_train_examples(self, data_dir): raise NotImplementedError() def get_dev_examples(self, data_dir): raise NotImplementedError() def get_test_examples(self, data_dir, data_file_name): raise NotImplementedError() def get_labels(self): raise NotImplementedError()
24.857143
58
0.70977
39
348
6.025641
0.435897
0.102128
0.204255
0.242553
0.417021
0.417021
0.417021
0.417021
0
0
0
0
0.212644
348
13
59
26.769231
0.857664
0
0
0.444444
0
0
0
0
0
0
0
0
0
1
0.444444
false
0
0
0
0.555556
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
c0c0314cd34eddccc547f1c6870173f1d918bb8d
93
py
Python
sample/b016.py
yamap55/flake8-bugbear-sample
4068b1a6ca412ac5dc48cf1b2e105dc190453bb1
[ "MIT" ]
null
null
null
sample/b016.py
yamap55/flake8-bugbear-sample
4068b1a6ca412ac5dc48cf1b2e105dc190453bb1
[ "MIT" ]
null
null
null
sample/b016.py
yamap55/flake8-bugbear-sample
4068b1a6ca412ac5dc48cf1b2e105dc190453bb1
[ "MIT" ]
null
null
null
def a(): raise "a" # 文字列を例外として投げる事はできません # ------ def b(): raise Exception("b")
9.3
36
0.516129
10
93
4.8
0.6
0
0
0
0
0
0
0
0
0
0
0
0.268817
93
9
37
10.333333
0.705882
0.27957
0
0
0
0
0.03125
0
0
0
0
0
0
1
0.5
true
0
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
1
1
0
0
0
0
0
0
4
c0d52ee92d3914cc2988f9b6c7fc5aeb2cebd7f0
68
py
Python
base_guizero.py
Perceu/tkinter-examples
cc3f10c49de409f75e261b06938d2258696eb08e
[ "MIT" ]
null
null
null
base_guizero.py
Perceu/tkinter-examples
cc3f10c49de409f75e261b06938d2258696eb08e
[ "MIT" ]
null
null
null
base_guizero.py
Perceu/tkinter-examples
cc3f10c49de409f75e261b06938d2258696eb08e
[ "MIT" ]
null
null
null
from guizero import App app = App(title="Tela Base") app.display()
13.6
28
0.720588
11
68
4.454545
0.727273
0.244898
0
0
0
0
0
0
0
0
0
0
0.147059
68
5
29
13.6
0.844828
0
0
0
0
0
0.130435
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
c0d60bcc0d28f40fc504f9783c3552f3740ebdf0
97
py
Python
realtors/admin.py
fion21/Alicante-Properties_Django
3e48afa42fdbba8d5a8355c06e969ca39bfbb2f1
[ "MIT" ]
null
null
null
realtors/admin.py
fion21/Alicante-Properties_Django
3e48afa42fdbba8d5a8355c06e969ca39bfbb2f1
[ "MIT" ]
3
2021-06-10T22:35:13.000Z
2022-01-13T02:13:50.000Z
realtors/admin.py
fion21/Alicante-Properties_Django
3e48afa42fdbba8d5a8355c06e969ca39bfbb2f1
[ "MIT" ]
1
2020-02-18T23:22:54.000Z
2020-02-18T23:22:54.000Z
from django.contrib import admin from .models import Realtor admin.site.register(Realtor)
16.166667
33
0.773196
13
97
5.769231
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.164948
97
5
34
19.4
0.925926
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
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
1
0
1
0
0
0
0
4
23b3b645d2f71b61b85b11ff4ae22e59936c0233
244
py
Python
tests/tox/test_subproc_backends.py
audreyr/pyscreenshot
6ac9352d634c75ae2815aa9bd98610c22e486cb3
[ "BSD-2-Clause" ]
1
2019-08-30T12:27:01.000Z
2019-08-30T12:27:01.000Z
tests/tox/test_subproc_backends.py
audreyr/pyscreenshot
6ac9352d634c75ae2815aa9bd98610c22e486cb3
[ "BSD-2-Clause" ]
null
null
null
tests/tox/test_subproc_backends.py
audreyr/pyscreenshot
6ac9352d634c75ae2815aa9bd98610c22e486cb3
[ "BSD-2-Clause" ]
null
null
null
from compare import backend_size, backend_ref def test_scrot(): backend = 'scrot' backend_size(backend) backend_ref(backend) def test_imagemagick(): backend = 'imagemagick' backend_size(backend) backend_ref(backend)
17.428571
45
0.721311
29
244
5.793103
0.344828
0.196429
0.321429
0.297619
0.416667
0.416667
0
0
0
0
0
0
0.192623
244
13
46
18.769231
0.852792
0
0
0.444444
0
0
0.065574
0
0
0
0
0
0
1
0.222222
false
0
0.111111
0
0.333333
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
23bab4b83cf590a2d20da75fb761ede331addd72
29,625
py
Python
test_app/test_app/integration_tests/test_orm_queries.py
vercer-cmt/django-query-preparer
555dfd4d9293949b7f36f2c679e284753ba86301
[ "MIT" ]
6
2020-02-17T10:41:47.000Z
2021-08-20T00:19:52.000Z
test_app/test_app/integration_tests/test_orm_queries.py
vercer-cmt/django-query-preparer
555dfd4d9293949b7f36f2c679e284753ba86301
[ "MIT" ]
null
null
null
test_app/test_app/integration_tests/test_orm_queries.py
vercer-cmt/django-query-preparer
555dfd4d9293949b7f36f2c679e284753ba86301
[ "MIT" ]
null
null
null
# Copyright (c) 2020, Vercer Ltd. Rights set out in LICENCE.txt from django.db import transaction from django.db.models import Q from django.test import TestCase from dqp import execute_stmt, Placeholder, ListPlaceholder from dqp.prepared_stmt_controller import PreparedStatementController from dqp.queryset import PreparedStatementQuerySet from dqp.exceptions import CannotAlterPreparedStatementQuerySet, PreparedQueryNotSupported from test_app.models import Species, Animal, Items class TestORMQueries(TestCase): @classmethod def setUpTestData(cls): cls.tiger = Species(name="Tiger") cls.tiger.save() cls.carp = Species(name="Carp") cls.carp.save() cls.crow = Species(name="Crow") cls.crow.save() def test_prepare_all(self): """ Given an ORM query is prepared with the all() function When the prepared statement is executed Then all records from the model will be returned in a query set """ def all_species(): return Species.prepare.all().order_by("pk") PreparedStatementController().register_qs("all_species", all_species) PreparedStatementController().prepare_qs_stmt("all_species", force=True) qs = execute_stmt("all_species") self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 3) self.assertTrue(isinstance(qs[0], Species)) self.assertEqual(qs[0].name, self.tiger.name) def test_prepare_filter(self): """ Given an ORM query is prepared with a filter And the filter is a Placeholder When the prepared statement is executed with a keyword argument for the filter Then only the records which match the filter will be returned in a query set """ def filter_species(): return Species.prepare.filter(name=Placeholder("name")) PreparedStatementController().register_qs("filter_species", filter_species) PreparedStatementController().prepare_qs_stmt("filter_species", force=True) qs = execute_stmt("filter_species", name="Carp") self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 1) self.assertTrue(isinstance(qs[0], Species)) self.assertEqual(qs[0].name, self.carp.name) def test_related_id_filter(self): """ Given an ORM query is prepared with a filter on the id of a related model And the filter is a Placeholder When the prepared statement is executed with a keyword argument for the filter And the filter is a related model id Then only the records which match the filter will be returned in a query set """ Animal.objects.update_or_create(name="Tigger", species=self.tiger) Animal.objects.update_or_create(name="Jack Daw", species=self.crow) Animal.objects.update_or_create(name="C. Orvid", species=self.crow) Animal.objects.update_or_create(name="Koi", species=self.carp) def filter_animals(): return Animal.prepare.filter(species_id=Placeholder("species_id")).order_by("id") PreparedStatementController().register_qs("filter_animals", filter_animals) PreparedStatementController().prepare_qs_stmt("filter_animals", force=True) qs = execute_stmt("filter_animals", species_id=self.crow.id) self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 2) self.assertEqual(qs[0].name, "Jack Daw") self.assertEqual(qs[1].name, "C. Orvid") def test_doubly_related_id_filter(self): """ Given an ORM query is prepared with a filter on the id of a related model And the filter is a Placeholder When the prepared statement is executed with a keyword argument for the filter And the filter is related by two foreign keys Then only the records which match the filter will be returned in a query set """ a1 = Animal.objects.create(name="Jack Daw", species=self.crow) a2 = Animal.objects.create(name="C. Orvid", species=self.crow) a3 = Animal.objects.create(name="Tigger", species=self.tiger) Items.objects.update_or_create(description="bird cage", animal=a1) Items.objects.update_or_create(description="whistle", animal=a1) Items.objects.update_or_create(description="bag of seeds", animal=a2) Items.objects.update_or_create(description="honey", animal=a3) def filter_items(): return Items.prepare.filter(animal__species_id=Placeholder("species_id")).order_by("id") PreparedStatementController().register_qs("filter_items", filter_items) PreparedStatementController().prepare_qs_stmt("filter_items", force=True) qs = execute_stmt("filter_items", species_id=self.crow.id) self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 3) self.assertEqual(qs[0].description, "bird cage") self.assertEqual(qs[1].description, "whistle") self.assertEqual(qs[2].description, "bag of seeds") def test_related_filter(self): """ Given an ORM query is prepared with a filter on a field in a related model And the filter is a Placeholder When the prepared statement is executed with a keyword argument for the filter And the filter is a __ relation Then only the records which match the filter will be returned in a query set """ Animal.objects.update_or_create(name="Tigger", species=self.tiger) Animal.objects.update_or_create(name="Jack Daw", species=self.crow) Animal.objects.update_or_create(name="C. Orvid", species=self.crow) Animal.objects.update_or_create(name="Koi", species=self.carp) def filter_animals(): # Note the use of the double underscore here compared to test_related_id_filter return Animal.prepare.filter(species__id=Placeholder("species_id")).order_by("id") PreparedStatementController().register_qs("filter_animals", filter_animals) PreparedStatementController().prepare_qs_stmt("filter_animals", force=True) qs = execute_stmt("filter_animals", species_id=self.crow.id) self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 2) self.assertEqual(qs[0].name, "Jack Daw") self.assertEqual(qs[1].name, "C. Orvid") def test_prepare_in(self): """ Given an ORM query is prepared with an `__in` filter And the filter is a ListPlaceholder When the prepared statement is executed with a keyword argument which is a list for the filter Then only the records which match the filter will be returned in a query set """ def filter_species_in(): return Species.prepare.filter(id__in=ListPlaceholder("ids")).order_by("id") PreparedStatementController().register_qs("filter_species_in", filter_species_in) PreparedStatementController().prepare_qs_stmt("filter_species_in", force=True) qs = execute_stmt("filter_species_in", ids=[self.carp.id, self.crow.id]) self.assertEqual(len(qs), 2) self.assertEqual(qs[0].id, self.carp.id) self.assertEqual(qs[1].id, self.crow.id) def test_prepare_icontains(self): """ Given an ORM query is prepared with an `__icontains` filter When the prepared statement is executed with a keyword argument for the filter Then only the records which contain the filter will be returned in a query set """ def filter_species_like(): return Species.prepare.filter(name__icontains=Placeholder("name")) PreparedStatementController().register_qs("filter_species_like", filter_species_like) PreparedStatementController().prepare_qs_stmt("filter_species_like", force=True) qs = execute_stmt("filter_species_like", name="car") self.assertEqual(len(qs), 1) self.assertTrue(isinstance(qs[0], Species)) self.assertEqual(qs[0].name, self.carp.name) def test_filter_with_constant(self): """ Given an ORM query is prepared with a filter that has no placeholders When the prepared statement is executed without any keyword arguments Then only the records which match the filter will be returned in a query set """ def filter_species(): return Species.prepare.filter(pk=self.crow.pk) PreparedStatementController().register_qs("filter_species", filter_species) PreparedStatementController().prepare_qs_stmt("filter_species", force=True) qs = execute_stmt("filter_species") self.assertEqual(qs[0].name, self.crow.name) def test_filter_wth_mixed_params(self): """ Given an ORM query is prepared with a filter that has both placeholders and contant value filters When the prepared statement is executed with a keyword arguments for placehlder filters Then only the records which match alls filter will be returned in a query set """ def filter_species(): return Species.prepare.filter(Q(pk=self.crow.pk) | Q(pk=Placeholder("pk"))).order_by("pk") PreparedStatementController().register_qs("filter_species", filter_species) PreparedStatementController().prepare_qs_stmt("filter_species", force=True) qs = execute_stmt("filter_species", pk=self.tiger.pk) self.assertEqual(len(qs), 2) self.assertEqual(qs[0].name, self.tiger.name) self.assertEqual(qs[1].name, self.crow.name) def test_filter_not_enough_params(self): """ Given an ORM query is prepared with a filter that has placeholders When the prepared statement is executed without any keyword arguments Then a ValueError will be raised And the error message will be "Not enough parameters supplied to execute prepared statement" """ def filter_species(): return Species.prepare.filter(Q(pk=self.crow.pk) | Q(pk=Placeholder("pk"))) PreparedStatementController().register_qs("filter_species", filter_species) PreparedStatementController().prepare_qs_stmt("filter_species", force=True) # And again with no params with self.assertRaises(ValueError) as ctx: qs = execute_stmt("filter_species") self.assertEqual(str(ctx.exception), "Not enough parameters supplied to execute prepared statement") def test_filter_missing_param(self): """ Given an ORM query is prepared with a filter that has multiple placeholders When the prepared statement is executed with some but not all keyword arguments Then a ValueError will be raised And the error message will be "Missing parameter {} is required to execute prepared statement" """ def filter_species(): return Species.prepare.filter(Q(pk=self.crow.pk) | Q(pk=Placeholder("pk")) | Q(pk=Placeholder("pk2"))) PreparedStatementController().register_qs("filter_species", filter_species) PreparedStatementController().prepare_qs_stmt("filter_species", force=True) # And again with no params with self.assertRaises(ValueError) as ctx: qs = execute_stmt("filter_species", pk=1) self.assertEqual(str(ctx.exception), "Missing parameter pk2 is required to execute prepared statement") def test_all_params_have_unique_names(self): """ Given an ORM query is created with a filter that has multiple placeholders with non-unique names When the query is prepared Then a NameError will be raised And the error message will be "Repeated placeholder name: {}. All placeholders in a query must have unique names." """ def filter_species(): return Species.prepare.filter(Q(pk=Placeholder("pk")) | Q(pk=Placeholder("pk"))) PreparedStatementController().register_qs("filter_species", filter_species) with self.assertRaises(NameError) as ctx: PreparedStatementController().prepare_qs_stmt("filter_species", force=True) self.assertEqual( str(ctx.exception), "Repeated placeholder name: pk. All placeholders in a query must have unique names." ) def test_filter_too_many_params(self): """ Given an ORM query is prepared with a filter that has one or more placeholders When the prepared statement is executed with keywoird arguments that do not match the given placeholder names Then a ValueError will be raised And the error message will be "Unknown parameters supplied for prepared statement: {}" """ def filter_species(): return Species.prepare.filter(Q(pk=self.crow.pk) | Q(pk=Placeholder("pk"))).order_by("pk") PreparedStatementController().register_qs("filter_species", filter_species) PreparedStatementController().prepare_qs_stmt("filter_species", force=True) with self.assertRaises(ValueError) as ctx: qs = execute_stmt("filter_species", pk=1, pk2=2, pk3=3) self.assertEqual(str(ctx.exception), "Unknown parameters supplied for prepared statement: pk2 , pk3") def test_prepare_get(self): """ Given an ORM query is prepared with a get() function When the prepared statement is executed Then a single model instance will be returned """ def get_species(): return Species.prepare.get(name=Placeholder("name")) PreparedStatementController().register_qs("get_species", get_species) PreparedStatementController().prepare_qs_stmt("get_species", force=True) qs = execute_stmt("get_species", name="Carp") self.assertTrue(isinstance(qs, Species)) self.assertEqual(qs.name, self.carp.name) def test_prepare_first(self): """ Given an ORM query is prepared with a first() function When the prepared statement is executed Then a single model instance will be returned And it will be the model instance with the lowest primary key value """ def first_species(): return Species.prepare.first() PreparedStatementController().register_qs("first", first_species) PreparedStatementController().prepare_qs_stmt("first", force=True) qs = execute_stmt("first") self.assertTrue(isinstance(qs, Species)) self.assertEqual(qs.name, self.tiger.name) def test_prepare_last(self): """ Given an ORM query is prepared with a last() function When the prepared statement is executed Then a single model instance will be returned And it will be the model instance with the highest primary key value """ def last_species(): return Species.prepare.last() PreparedStatementController().register_qs("last", last_species) PreparedStatementController().prepare_qs_stmt("last", force=True) qs = execute_stmt("last") self.assertTrue(isinstance(qs, Species)) self.assertEqual(qs.name, self.crow.name) def test_prepare_count(self): """ Given an ORM query is prepared with a count() function When the prepared statement is executed Then an integer value will be returned And it will be the number of rows that match the query """ def count_species(): return Species.prepare.count() PreparedStatementController().register_qs("count", count_species) PreparedStatementController().prepare_qs_stmt("count", force=True) qs = execute_stmt("count") self.assertTrue(isinstance(qs, int)) self.assertEqual(qs, 3) def test_prepare_prefetch_related(self): """ Given an ORM query is written with a prefetch_related() function When the query is prepared Then a PreparedQueryNotSupported error will be raised """ def will_fail(): return Species.prepare.all().prefetch_related("animal_set") PreparedStatementController().register_qs("will_fail", will_fail) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().prepare_qs_stmt("will_fail", force=True) def test_filtering_prepared_stmt_result(self): """ Given an ORM query is prepared And it has been succesfully executed When any of the functions filter(), get(), latest() or earliest() are called on the resulting query set Then a CannotAlterPreparedStatementQuerySet will be raised """ PreparedStatementController().register_qs("all_species", lambda: Species.prepare.all()) PreparedStatementController().prepare_qs_stmt("all_species", force=True) qs = execute_stmt("all_species") with self.assertRaises(CannotAlterPreparedStatementQuerySet): qs.filter(id=1) with self.assertRaises(CannotAlterPreparedStatementQuerySet): qs.get(id=1) with self.assertRaises(CannotAlterPreparedStatementQuerySet): qs.latest("id") with self.assertRaises(CannotAlterPreparedStatementQuerySet): qs.earliest("id") def test_count_prepared_stmt_result(self): """ Given an ORM query is prepared And it has been succesfully executed When count() is called on the resulting query set Then the number of rows in the query set is returned """ PreparedStatementController().register_qs("all_species", lambda: Species.prepare.all()) PreparedStatementController().prepare_qs_stmt("all_species", force=True) qs = execute_stmt("all_species") self.assertEqual(qs.count(), 3) def test_first_prepared_stmt_result(self): """ Given an ORM query is prepared And it has been succesfully executed When first() is called on the resulting query set Then the first record relative to the ordering of the prepared query is returned as a model instance """ PreparedStatementController().register_qs("all_species", lambda: Species.prepare.all().order_by("pk")) PreparedStatementController().prepare_qs_stmt("all_species", force=True) qs = execute_stmt("all_species") first = qs.first() self.assertEqual(first.name, self.tiger.name) def test_last_prepared_stmt_result(self): """ Given an ORM query is prepared And it has been succesfully executed When last() is called on the resulting query set Then the last record relative to the ordering of the prepared query is returned as a model instance """ PreparedStatementController().register_qs("all_species", lambda: Species.prepare.all().order_by("pk")) PreparedStatementController().prepare_qs_stmt("all_species", force=True) qs = execute_stmt("all_species") last = qs.last() self.assertEqual(last.name, self.crow.name) def test_prefetch_related_on_result(self): """ Given an ORM query is prepared And it has been succesfully executed When prefetch_related() is called on the resulting query set Then an extra query will be run to prefetvh the related objects And no further queries will be run when the related objects are accessed from the original query set """ Animal.objects.update_or_create(name="Tony", species=self.tiger) Animal.objects.update_or_create(name="Sheer Kahn", species=self.tiger) def qry(): return Species.prepare.filter(name=Placeholder("name")) PreparedStatementController().register_qs("qry", qry) PreparedStatementController().prepare_qs_stmt("qry", force=True) qs = execute_stmt("qry", name="Tiger") # Now add the prefetch related, which should execute one query. with self.assertNumQueries(1): qs = qs.prefetch_related("animal_set") # Access the animals on the tiger species - as they are prefetched no more queries should be run! with self.assertNumQueries(0): tigers = qs[0].animal_set.all() self.assertEqual(len(tigers), 2) self.assertEqual(set([tigers[0].name, tigers[1].name]), set(["Tony", "Sheer Kahn"])) def test_values_on_result(self): """ Given an ORM query is prepared and executed When .values_list() is called on the resulting query set And flat=True Then only the requested values should be returned in a flattened list """ def all_species(): return Species.prepare.order_by("pk") PreparedStatementController().register_qs("all_species", all_species) PreparedStatementController().prepare_qs_stmt("all_species", force=True) qs = execute_stmt("all_species") qs = qs.values("name") self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 3) self.assertDictEqual(qs[0], {"name": self.tiger.name}) self.assertDictEqual(qs[1], {"name": self.carp.name}) self.assertDictEqual(qs[2], {"name": self.crow.name}) def test_prepare_values_list(self): """ Given an ORM query is prepared with a values_list() function When the query is prepared Then an PreparedQueryNotSupported exception should be raised """ def all_species(): return Species.prepare.order_by("pk").values_list("name", flat=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("all_species", all_species) PreparedStatementController().prepare_qs_stmt("all_species", force=True) def test_values_list_on_result(self): """ Given an ORM query is prepared and executed When .values_list() is called on the resulting query set And flat=True Then only the requested values should be returned in a flattened list """ def all_species(): return Species.prepare.order_by("pk") PreparedStatementController().register_qs("all_species", all_species) PreparedStatementController().prepare_qs_stmt("all_species", force=True) qs = execute_stmt("all_species") qs = qs.values_list("name", flat=True) self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 3) self.assertEqual(qs[0], self.tiger.name) self.assertEqual(qs[1], self.carp.name) self.assertEqual(qs[2], self.crow.name) def test_related_values_list_on_result(self): """ Given an ORM query is prepared and executed When .values_list() is called on the resulting query set And the named parameter is on a related model And flat=True Then only the requested values should be returned in a flattened list """ Animal.objects.update_or_create(name="Tony", species=self.tiger) Animal.objects.update_or_create(name="Sheer Kahn", species=self.tiger) def all_animal_species(): return Animal.prepare.order_by("pk") PreparedStatementController().register_qs("all_animal_species", all_animal_species) PreparedStatementController().prepare_qs_stmt("all_animal_species", force=True) qs = execute_stmt("all_animal_species") qs = qs.values_list("species_id", flat=True) self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 2) self.assertEqual(qs[0], self.tiger.id) self.assertEqual(qs[1], self.tiger.id) def test_named_values_list_on_result(self): """ Given an ORM query is prepared and executed When .values_list() is called on the resulting query set And named=True Then only the requested values should be returned as a list of named tuples """ def all_species(): return Species.prepare.order_by("pk") PreparedStatementController().register_qs("all_species", all_species) PreparedStatementController().prepare_qs_stmt("all_species", force=True) qs = execute_stmt("all_species") qs = qs.values_list("name", named=True) self.assertTrue(isinstance(qs, PreparedStatementQuerySet)) self.assertEqual(len(qs), 3) self.assertEqual(qs[0].name, self.tiger.name) self.assertEqual(qs[1].name, self.carp.name) self.assertEqual(qs[2].name, self.crow.name) def test_not_supported_queryset_methods(self): """ Given an ORM query is created using any of aggregate(), in_bulk(), create(), bulk_create(), bulk_update(), get_or_create(), update_or_create(), delete(), update(), exists() or explain() When the query is prepared Then a PreparedQueryNotSupported error will be raised """ with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.aggregate()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.in_bulk()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.create()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.bulk_create()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.bulk_update()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.get_or_create()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.update_or_create()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.delete()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.update()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.exists()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) with self.assertRaises(PreparedQueryNotSupported): PreparedStatementController().register_qs("will_fail", lambda: Species.prepare.explain()) PreparedStatementController().prepare_qs_stmt("will_fail", force=True) def test_query_in_transaction(self): """ Given an ORM query is prepared And a database transaction is started When the query is executed Then it should execute as expected """ def all_species(): return Species.prepare.all() PreparedStatementController().register_qs("all_species", all_species) PreparedStatementController().prepare_qs_stmt("all_species", force=True) with transaction.atomic(): qs = execute_stmt("all_species") self.assertEqual(len(qs), 3) def test_reprepare_query_in_transaction(self): """ Given an ORM query is prepared And a database transaction is started And the query has been deallocated in the database When the query is executed Then it should re-prepare without errors And it should execute as expected """ def all_species(): return Species.prepare.all() PreparedStatementController().register_qs("all_species", all_species) PreparedStatementController().prepare_qs_stmt("all_species", force=True) # deallocate the query to simulate changing database session PreparedStatementController().prepared_statements["all_species"].deallocate() with transaction.atomic(): qs = execute_stmt("all_species") cxn = transaction.get_connection() self.assertTrue(cxn.in_atomic_block) self.assertEqual(len(qs), 3)
43.248175
124
0.679899
3,550
29,625
5.525915
0.076901
0.038232
0.077331
0.083601
0.803691
0.762349
0.731814
0.678646
0.638426
0.600907
0
0.00324
0.228996
29,625
684
125
43.311404
0.855611
0.253266
0
0.480826
0
0
0.091054
0
0
0
0
0
0.274336
1
0.171091
false
0
0.023599
0.076696
0.274336
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
23d6c75d10970738b9edbc63b586a95e4ead3c70
264
py
Python
magnolia-examples/echo.py
moxious/magnolia
f9228d2ead7c0d2e5bffb3cf26ded7bfd3f4728e
[ "MIT" ]
7
2018-08-22T21:51:10.000Z
2020-03-03T06:39:56.000Z
magnolia-examples/echo.py
moxious/magnolia
f9228d2ead7c0d2e5bffb3cf26ded7bfd3f4728e
[ "MIT" ]
null
null
null
magnolia-examples/echo.py
moxious/magnolia
f9228d2ead7c0d2e5bffb3cf26ded7bfd3f4728e
[ "MIT" ]
null
null
null
# https://stackoverflow.com/questions/51802367/getting-outer-environment-arguments-from-java-using-graal-python import polyglot def main(): log = polyglot.import_value('log') log.info("echo-python running") return polyglot.import_value('arguments') main()
26.4
111
0.772727
34
264
5.941176
0.705882
0.138614
0.188119
0
0
0
0
0
0
0
0
0.033058
0.083333
264
9
112
29.333333
0.801653
0.412879
0
0
0
0
0.202614
0
0
0
0
0
0
1
0.166667
false
0
0.5
0
0.833333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
23dae68ef0b382260c34fc22a2e6031c8a51a6a5
75
py
Python
pybayes/stresses/__init__.py
strohel/PyBayes
76d3ad12c20e29c5aadb688c4323fb0f1784f8ec
[ "MIT" ]
66
2015-01-05T13:36:03.000Z
2021-03-15T18:26:28.000Z
pybayes/stresses/__init__.py
strohel/PyBayes
76d3ad12c20e29c5aadb688c4323fb0f1784f8ec
[ "MIT" ]
6
2015-02-23T19:45:11.000Z
2021-07-21T08:21:52.000Z
pybayes/stresses/__init__.py
strohel/PyBayes
76d3ad12c20e29c5aadb688c4323fb0f1784f8ec
[ "MIT" ]
22
2015-02-11T23:45:01.000Z
2021-01-16T18:53:25.000Z
"""PyBayes' stress tests""" from pybayes.stresses.stress_filters import *
18.75
45
0.76
9
75
6.222222
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.106667
75
3
46
25
0.835821
0.28
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
23de4775909983cac641dcfdd07db99856a999a5
87
py
Python
sutdents D33102 HouDan/sutdents D33102 HouDan lr3/Day01/NBlog2/TwoApp/apps.py
HD799/ITMO_ICT_WebProgramming_2020-2021_d3310
17ebcd5f2b4a018a3c7324ec3dd13d82e5062361
[ "MIT" ]
null
null
null
sutdents D33102 HouDan/sutdents D33102 HouDan lr3/Day01/NBlog2/TwoApp/apps.py
HD799/ITMO_ICT_WebProgramming_2020-2021_d3310
17ebcd5f2b4a018a3c7324ec3dd13d82e5062361
[ "MIT" ]
null
null
null
sutdents D33102 HouDan/sutdents D33102 HouDan lr3/Day01/NBlog2/TwoApp/apps.py
HD799/ITMO_ICT_WebProgramming_2020-2021_d3310
17ebcd5f2b4a018a3c7324ec3dd13d82e5062361
[ "MIT" ]
null
null
null
from django.apps import AppConfig class TwoappConfig(AppConfig): name = 'TwoApp'
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
9b0f5e5d8699a1d3c80fe6627988cc2321927e9e
679
py
Python
snyk/__init__.py
husband-inc/pysnyk
6019690642cc9ca392df5cea964487ec300f3318
[ "MIT" ]
2
2019-07-18T20:44:30.000Z
2019-08-14T05:11:35.000Z
snyk/__init__.py
husband-inc/pysnyk
6019690642cc9ca392df5cea964487ec300f3318
[ "MIT" ]
9
2019-06-30T17:22:48.000Z
2019-08-14T15:04:17.000Z
snyk/__init__.py
husband-inc/pysnyk
6019690642cc9ca392df5cea964487ec300f3318
[ "MIT" ]
4
2019-06-21T13:53:46.000Z
2019-08-09T06:07:56.000Z
""" Snyk API client ~~~~~~~~~~~~~~~ Snyk provides an API for various parts of the service, including accessing project vulnerabilities, managing settings and testing individual packages or package manifests. >>> import snyk >>> client = snyk.SnykClient("<your-snyk-api-token>") >>> org = client.organizations.first() # Return a list of Snyk Project objects >>> org.projects.all() ... # Return vulnerability information for dependencies from a Pipfile >>> handle = open("Pipfile") >>> org.test_pipfile(handle) ... """ from .__version__ import __description__, __license__, __title__, __url__, __version__ from .client import SnykClient
28.291667
86
0.69514
76
679
5.881579
0.657895
0.03132
0
0
0
0
0
0
0
0
0
0
0.181149
679
23
87
29.521739
0.803957
0.810015
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
9b142ac6a78437cfbb9c448d46275b532904d724
129
py
Python
Chapter08/restful_python_2_08_01/Django01/games_service/games/max_limit_pagination.py
PacktPublishing/Hands-On-RESTful-Python-Web-Services-Second-Edition
db8212c90f6394d8ee6fadb038e2b01ef83c963d
[ "MIT" ]
45
2018-12-21T01:02:16.000Z
2022-03-18T08:23:13.000Z
Chapter08/restful_python_2_08_02/Django01/games_service/games/max_limit_pagination.py
PacktPublishing/Hands-On-RESTful-Python-Web-Services-Second-Edition
db8212c90f6394d8ee6fadb038e2b01ef83c963d
[ "MIT" ]
12
2020-02-11T23:32:33.000Z
2021-06-10T22:29:56.000Z
Chapter07/restful_python_2_07_03/Django01/games_service/games/max_limit_pagination.py
PacktPublishing/Hands-On-RESTful-Python-Web-Services-Second-Edition
db8212c90f6394d8ee6fadb038e2b01ef83c963d
[ "MIT" ]
29
2019-02-11T16:45:56.000Z
2022-03-29T12:43:27.000Z
from rest_framework.pagination import LimitOffsetPagination class MaxLimitPagination(LimitOffsetPagination): max_limit = 8
21.5
59
0.844961
12
129
8.916667
0.916667
0
0
0
0
0
0
0
0
0
0
0.008772
0.116279
129
5
60
25.8
0.929825
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
f1e8929c2fbd94f1040f7af17054f8a23953505f
107
py
Python
manage.py
tolulomo/whyis
eb50ab3301eb7efd27a1a3f6fb2305dedd910397
[ "Apache-2.0" ]
31
2018-05-30T02:41:23.000Z
2021-10-17T01:25:20.000Z
manage.py
tolulomo/whyis
eb50ab3301eb7efd27a1a3f6fb2305dedd910397
[ "Apache-2.0" ]
115
2018-04-07T00:59:11.000Z
2022-03-02T03:06:45.000Z
manage.py
tolulomo/whyis
eb50ab3301eb7efd27a1a3f6fb2305dedd910397
[ "Apache-2.0" ]
25
2018-04-07T00:49:55.000Z
2021-09-28T14:29:18.000Z
#!/usr/bin/env python3 from whyis.manager import Manager if __name__ == "__main__": Manager().run()
13.375
33
0.682243
14
107
4.642857
0.857143
0
0
0
0
0
0
0
0
0
0
0.011236
0.168224
107
7
34
15.285714
0.719101
0.196262
0
0
0
0
0.094118
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
7b023f3501f81f53fe91bf909264f73d9f55f965
126
py
Python
translator.py
mallimuondu/siri
7094569c9e26a3e4d02875a6ad4f9fd245a02cb5
[ "MIT" ]
null
null
null
translator.py
mallimuondu/siri
7094569c9e26a3e4d02875a6ad4f9fd245a02cb5
[ "MIT" ]
null
null
null
translator.py
mallimuondu/siri
7094569c9e26a3e4d02875a6ad4f9fd245a02cb5
[ "MIT" ]
null
null
null
from fnmatch import translate from googletrans import Translator translater = Translator() translater.translate("", dest="")
21
34
0.793651
13
126
7.692308
0.615385
0.4
0
0
0
0
0
0
0
0
0
0
0.111111
126
6
35
21
0.892857
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
7b31ec697f71d630262fcbfda82d4502f5f51ba7
126
py
Python
impression/apps.py
gregschmit/django-impression
b4d624802830d00a136c2bf40b6a8911c1269095
[ "MIT" ]
3
2019-12-11T10:04:55.000Z
2019-12-20T22:15:52.000Z
impression/apps.py
gregschmit/django-impression
b4d624802830d00a136c2bf40b6a8911c1269095
[ "MIT" ]
null
null
null
impression/apps.py
gregschmit/django-impression
b4d624802830d00a136c2bf40b6a8911c1269095
[ "MIT" ]
null
null
null
from django.apps import AppConfig class CustomAppConfig(AppConfig): name = "impression" verbose_name = "Impression"
18
33
0.746032
13
126
7.153846
0.769231
0.301075
0
0
0
0
0
0
0
0
0
0
0.174603
126
6
34
21
0.894231
0
0
0
0
0
0.15873
0
0
0
0
0
0
1
0
false
0
0.25
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
9e4f008a0e4fda76d6eefb842505b126e8644472
89
py
Python
structural/bridge/logic/races/orc.py
Kozak24/Patterns
351d5c11f7c64ce5d58db37b6715fc8f7d31945a
[ "MIT" ]
null
null
null
structural/bridge/logic/races/orc.py
Kozak24/Patterns
351d5c11f7c64ce5d58db37b6715fc8f7d31945a
[ "MIT" ]
null
null
null
structural/bridge/logic/races/orc.py
Kozak24/Patterns
351d5c11f7c64ce5d58db37b6715fc8f7d31945a
[ "MIT" ]
null
null
null
from structural.bridge.logic.races.race import Race class Orc(Race): _NAME = "Orc"
14.833333
51
0.719101
13
89
4.846154
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.168539
89
5
52
17.8
0.851351
0
0
0
0
0
0.033708
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
9e9dab6c3f2063eeef26c162b9c7203005881814
393
py
Python
test.py
EricPedley/posture-detector
8f45a56748948f86641436d61e9bddab942df8ca
[ "MIT" ]
null
null
null
test.py
EricPedley/posture-detector
8f45a56748948f86641436d61e9bddab942df8ca
[ "MIT" ]
null
null
null
test.py
EricPedley/posture-detector
8f45a56748948f86641436d61e9bddab942df8ca
[ "MIT" ]
null
null
null
# import tensorflow as tf # from tensorflow import keras # from keras import layers # import numpy as np # x=np.array([0,1,2,3,4,5,6,7,8,9]) # y=np.array([1,-1,-3,-5,-7,-9,-11,-13,-15,-17]) # model = keras.Sequential([ # layers.Dense(1) # ]) # model.compile(optimizer = 'SGD', loss='mean_squared_error') # model.fit(x,y,epochs=1000) # print(model.predict([-3])) import tensorflow as tf
23.117647
61
0.653944
70
393
3.642857
0.585714
0.12549
0.141176
0.156863
0
0
0
0
0
0
0
0.087977
0.132316
393
17
62
23.117647
0.659824
0.867684
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
9e9f1192425593db229c7bdcb8a4a9dfcbb5f618
87
py
Python
python/main.py
eavelardev/identical-coding
4f3c16e2e6287f989d1d25e13acf27d6bbfbbdee
[ "MIT" ]
null
null
null
python/main.py
eavelardev/identical-coding
4f3c16e2e6287f989d1d25e13acf27d6bbfbbdee
[ "MIT" ]
null
null
null
python/main.py
eavelardev/identical-coding
4f3c16e2e6287f989d1d25e13acf27d6bbfbbdee
[ "MIT" ]
null
null
null
# https://docs.python.org/3/library/__main__.html if __name__ == "__main__": pass
17.4
49
0.689655
12
87
4
0.916667
0
0
0
0
0
0
0
0
0
0
0.013333
0.137931
87
4
50
21.75
0.626667
0.54023
0
0
0
0
0.210526
0
0
0
0
0
0
1
0
true
0.5
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
7b443180479a2cf2db4304e479aca10438875d76
142
py
Python
tests/fibonacci/test_fib1.py
erikopa/classic-cs-problems
9b9974afbacec36045ca3259da5a35a40b2cb953
[ "MIT" ]
null
null
null
tests/fibonacci/test_fib1.py
erikopa/classic-cs-problems
9b9974afbacec36045ca3259da5a35a40b2cb953
[ "MIT" ]
null
null
null
tests/fibonacci/test_fib1.py
erikopa/classic-cs-problems
9b9974afbacec36045ca3259da5a35a40b2cb953
[ "MIT" ]
null
null
null
import pytest from src.fibonacci.fib1 import fib1 def test_fib1_recursion_depth(): with pytest.raises(RecursionError): fib1(5)
15.777778
39
0.739437
19
142
5.368421
0.736842
0
0
0
0
0
0
0
0
0
0
0.043103
0.183099
142
8
40
17.75
0.836207
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
true
0
0.4
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
7b479975c0cdb45bcd8e2aead8968ad01b20cfe8
87
py
Python
unittests/resources/checks/emptycheck.py
ajocksch/reframe
f701ca5075d78cef2dbf9dc8b754bf70b1a04036
[ "BSD-3-Clause" ]
1
2018-08-02T07:34:10.000Z
2018-08-02T07:34:10.000Z
unittests/resources/checks/emptycheck.py
ajocksch/reframe
f701ca5075d78cef2dbf9dc8b754bf70b1a04036
[ "BSD-3-Clause" ]
3
2022-02-01T08:03:57.000Z
2022-03-01T08:06:51.000Z
unittests/resources/checks/emptycheck.py
GiuseppeLoRe/reframe
a1e5aec54dd29925af96e4bb7095f47ea9547c5a
[ "BSD-3-Clause" ]
null
null
null
import reframe as rfm @rfm.simple_test class EmptyTest(rfm.RegressionTest): pass
12.428571
36
0.770115
12
87
5.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.16092
87
6
37
14.5
0.90411
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.25
0
0.5
0
1
0
0
null
0
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
7b6074320d87be00608a2ca5aa8b5f69049bd177
89
py
Python
build/ucube.py
jinlongliu/AliOS-Things
ce051172a775f987183e7aca88bb6f3b809ea7b0
[ "Apache-2.0" ]
92
2020-02-25T11:16:15.000Z
2021-09-20T14:45:49.000Z
build/ucube.py
IamBaoMouMou/AliOS-Things
195a9160b871b3d78de6f8cf6c2ab09a71977527
[ "Apache-2.0" ]
12
2020-02-28T03:51:00.000Z
2020-08-05T09:38:54.000Z
build/ucube.py
IamBaoMouMou/AliOS-Things
195a9160b871b3d78de6f8cf6c2ab09a71977527
[ "Apache-2.0" ]
45
2020-02-26T04:31:08.000Z
2021-10-09T17:17:23.000Z
import os, sys # scons APPLICATION=helloworld BOARD=linuxhost ucube_main(args=ARGUMENTS)
22.25
46
0.831461
12
89
6.083333
1
0
0
0
0
0
0
0
0
0
0
0
0.089888
89
4
47
22.25
0.901235
0.494382
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
7bcc70dbf5cad017c0640f8c97bf32172f5a03ba
210
py
Python
ocp_resources/console_cli_download.py
kbidarkar/openshift-python-wrapper
3cd4d6d3b71c82ff87f032a51510d9c9d207f6cb
[ "Apache-2.0" ]
9
2021-07-05T18:35:55.000Z
2021-12-31T03:09:39.000Z
ocp_resources/console_cli_download.py
kbidarkar/openshift-python-wrapper
3cd4d6d3b71c82ff87f032a51510d9c9d207f6cb
[ "Apache-2.0" ]
418
2021-07-04T13:12:09.000Z
2022-03-30T08:37:45.000Z
ocp_resources/console_cli_download.py
kbidarkar/openshift-python-wrapper
3cd4d6d3b71c82ff87f032a51510d9c9d207f6cb
[ "Apache-2.0" ]
28
2021-07-04T12:48:18.000Z
2022-02-22T15:19:30.000Z
from ocp_resources.resource import Resource class ConsoleCLIDownload(Resource): """ ConsoleCLIDownload object, inherited from Resource. """ api_group = Resource.ApiGroup.CONSOLE_OPENSHIFT_IO
21
55
0.761905
21
210
7.428571
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.166667
210
9
56
23.333333
0.891429
0.242857
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
c894070e8e216b3de5088a3054711f900a18c32a
172
py
Python
web_app/app/__init__.py
ravikiran0606/Game-and-Requirements-KG
ede2c176c83e33b401b879461a9312660049cf10
[ "MIT" ]
null
null
null
web_app/app/__init__.py
ravikiran0606/Game-and-Requirements-KG
ede2c176c83e33b401b879461a9312660049cf10
[ "MIT" ]
1
2020-04-28T19:44:05.000Z
2020-04-28T19:44:05.000Z
web_app/app/__init__.py
ravikiran0606/game-and-requirements-kg
ede2c176c83e33b401b879461a9312660049cf10
[ "MIT" ]
2
2020-05-02T19:31:39.000Z
2020-07-23T23:49:19.000Z
import os from flask import Flask, render_template, json, request, redirect, session app = Flask(__name__) app.config.from_object('config') from app import views, queries
24.571429
74
0.790698
25
172
5.2
0.64
0.153846
0
0
0
0
0
0
0
0
0
0
0.122093
172
7
75
24.571429
0.860927
0
0
0
0
0
0.034682
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
c8d5f467f0fcb05494ea003df8a73cb2c2859eff
852
py
Python
tests/test_decodeways.py
csy-uestc-eng/algorithm_python_implementation
f703b351fcf64669faaa71d0dbe9764f81aadfdc
[ "Apache-2.0" ]
1
2019-11-30T10:17:40.000Z
2019-11-30T10:17:40.000Z
tests/test_decodeways.py
csy-uestc-eng/algorithm_python_implementation
f703b351fcf64669faaa71d0dbe9764f81aadfdc
[ "Apache-2.0" ]
null
null
null
tests/test_decodeways.py
csy-uestc-eng/algorithm_python_implementation
f703b351fcf64669faaa71d0dbe9764f81aadfdc
[ "Apache-2.0" ]
null
null
null
from unittest import TestCase from DecodeWays import Solution class TestSolution(TestCase): def test_numDecodings(self): self.assertEqual(3, Solution().numDecodings('122')) def test_numDecodings01(self): self.assertEqual(3, Solution().numDecodings('222')) def test_numDecodings02(self): self.assertEqual(1, Solution().numDecodings('2')) def test_numDecodings03(self): self.assertEqual(1, Solution().numDecodings('34')) def test_numDecodings04(self): self.assertEqual(0, Solution().numDecodings('0')) def test_numDecodings05(self): self.assertEqual(1, Solution().numDecodings('10')) def test_numDecodings06(self): self.assertEqual(1, Solution().numDecodings('120')) def test_numDecodings07(self): self.assertEqual(2, Solution().numDecodings('227'))
30.428571
59
0.693662
91
852
6.406593
0.32967
0.096055
0.26072
0.137221
0.411664
0.411664
0
0
0
0
0
0.056657
0.171362
852
27
60
31.555556
0.769122
0
0
0
0
0
0.021127
0
0
0
0
0
0.421053
1
0.421053
false
0
0.105263
0
0.578947
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
0
0
0
0
1
0
0
4
7401622d6bf56802694091789430595f0eabf139
910
py
Python
src/shape_constraint_detectors/ValueRangeMaxExclusiveDetectorSHACLMaxExclusive.py
IDLabResearch/lovstats
dd33183574eed692ee89059ff3c6494160dfb8a9
[ "MIT" ]
1
2018-12-11T13:57:38.000Z
2018-12-11T13:57:38.000Z
src/shape_constraint_detectors/ValueRangeMaxExclusiveDetectorSHACLMaxExclusive.py
IDLabResearch/lovstats
dd33183574eed692ee89059ff3c6494160dfb8a9
[ "MIT" ]
null
null
null
src/shape_constraint_detectors/ValueRangeMaxExclusiveDetectorSHACLMaxExclusive.py
IDLabResearch/lovstats
dd33183574eed692ee89059ff3c6494160dfb8a9
[ "MIT" ]
null
null
null
from ValueRangeMaxExclusiveDetector import ValueRangeMaxExclusiveDetector class ValueRangeMaxExclusiveDetectorSHACLMaxExclusive(ValueRangeMaxExclusiveDetector): """ This class implements the detection of the maximum exclusive value range constraint sh:maxExclusive. For further information have a look at the parent class. """ def __init__(self): super(ValueRangeMaxExclusiveDetectorSHACLMaxExclusive, self).__init__() self.number = 0 def count(self, s, p, o, s_blank, o_l, o_blank, statement): if p == 'http://www.w3.org/ns/shacl#maxExclusive': self.number += 1 def getName(self): return "valueRangeMaxExclusiveLODStatsDetectorSHACLMaxExclusive" def getVersion(self): return "valueRangeMaxExclusiveLODStatsDetectorSHACLMaxExclusive-v1" def compute(self): self.setNumberValueRangeMaxExclusive(self.number)
33.703704
104
0.740659
84
910
7.892857
0.630952
0.045249
0.196078
0
0
0
0
0
0
0
0
0.005398
0.185714
910
26
105
35
0.889339
0.172527
0
0
0
0
0.208219
0.154795
0
0
0
0
0
1
0.357143
false
0
0.071429
0.142857
0.642857
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
7401d3e3c1983da48dbf138cb55cb03d30e2dcef
235
py
Python
python/Strings/python-string-formatting.py
cdrowley/hackerrank
cc5c925327cd3ce5b52c1614b814da75d42cca72
[ "MIT" ]
null
null
null
python/Strings/python-string-formatting.py
cdrowley/hackerrank
cc5c925327cd3ce5b52c1614b814da75d42cca72
[ "MIT" ]
null
null
null
python/Strings/python-string-formatting.py
cdrowley/hackerrank
cc5c925327cd3ce5b52c1614b814da75d42cca72
[ "MIT" ]
null
null
null
# https://www.hackerrank.com/challenges/python-string-formatting/problem def print_formatted(number): for i in range(1, number + 1): pad = number.bit_length() print(f"{i:{pad}d} {i:{pad}o} {i:{pad}X} {i:{pad}b}")
29.375
72
0.629787
38
235
3.842105
0.684211
0.109589
0
0
0
0
0
0
0
0
0
0.010256
0.170213
235
7
73
33.571429
0.738462
0.297872
0
0
0
0.25
0.263804
0
0
0
0
0
0
1
0.25
false
0
0
0
0.25
0.5
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
1
0
0
null
0
0
0
0
0
1
0
0
0
0
0
1
0
4
cd9e03f818ab1163d65839e052a64201629583a3
125
py
Python
Python/2.py
daniLOLZ/variaRoba
757586d6c8d1ccfbcc79379a138e3328f94be8ff
[ "MIT" ]
null
null
null
Python/2.py
daniLOLZ/variaRoba
757586d6c8d1ccfbcc79379a138e3328f94be8ff
[ "MIT" ]
null
null
null
Python/2.py
daniLOLZ/variaRoba
757586d6c8d1ccfbcc79379a138e3328f94be8ff
[ "MIT" ]
null
null
null
numero = int(input("inserisci muvt")) if numero % 2 == 0 : print("il numero è pari") else: print("il numero è dispari")
25
38
0.64
20
125
4
0.7
0.175
0.325
0.35
0
0
0
0
0
0
0
0.02
0.2
125
5
39
25
0.78
0
0
0
0
0
0.401639
0
0
0
0
0
0
1
0
false
0
0
0
0
0.4
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
cda91f4fb4e190a034038c93bf11a517b5a5d90b
10,144
py
Python
epcpy/utils/regex.py
nedap/retail-epcpy
f5a454f2a06053f64bc42e6c6411fbd6cb47e745
[ "MIT" ]
2
2022-03-21T08:22:30.000Z
2022-03-22T12:32:29.000Z
epcpy/utils/regex.py
nedap/retail-epcpy
f5a454f2a06053f64bc42e6c6411fbd6cb47e745
[ "MIT" ]
1
2022-03-28T14:48:52.000Z
2022-03-28T14:48:52.000Z
epcpy/utils/regex.py
nedap/retail-epcpy
f5a454f2a06053f64bc42e6c6411fbd6cb47e745
[ "MIT" ]
null
null
null
# Generic CPREF_COMPONENT = "([0-9A-Z-]|%2F|%23)+" NUMERIC_COMPONENT = "(0|[1-9]\d*)" GS3A3_CHAR = "((%[0-9a-fA-F])|([a-zA-Z0-9!'()*+,-.:;=_]))" GS3A3_COMPONENT = f"{GS3A3_CHAR}+" PADDED_NUMERIC_COMPONENT = "\d+" PADDED_NUMERIC_COMPONENT_OR_EMPTY = "\d*" VERIFY_GS3A3_CHARS = "[a-zA-Z0-9!'()*+,-.:;=_\"%&/<>?]+" GS1_ELEM_CHARS = "[a-zA-Z0-9!'()*+,-.:;=_\"%&/<>?]" GS1_ELEM_CHARS_CPI = "[0-9A-Z\/\-\#]" DIGIT = "\d" FOUR_PADDED_NUMERIC_COMPONENTS = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}" # EPC Pure Identity URIs SGTIN_URI_BODY = ( f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}" ) SGTIN_URI = f"urn:epc:id:sgtin:{SGTIN_URI_BODY}" SSCC_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}" SSCC_URI = f"urn:epc:id:sscc:{SSCC_URI_BODY}" SGLN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}" SGLN_URI = f"urn:epc:id:sgln:{SGLN_URI_BODY}" GRAI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}" GRAI_URI = f"urn:epc:id:grai:{GRAI_URI_BODY}" GIAI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}" GIAI_URI = f"urn:epc:id:giai:{GIAI_URI_BODY}" GSRN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}" GSRN_URI = f"urn:epc:id:gsrn:{GSRN_URI_BODY}" GSRNP_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}" GSRNP_URI = f"urn:epc:id:gsrnp:{GSRN_URI_BODY}" GDTI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}" GDTI_URI = f"urn:epc:id:gdti:{GDTI_URI_BODY}" CPI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{CPREF_COMPONENT}\.{NUMERIC_COMPONENT}" CPI_URI = f"urn:epc:id:cpi:{CPI_URI_BODY}" SGCN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{PADDED_NUMERIC_COMPONENT}" SGCN_URI = f"urn:epc:id:sgcn:{SGCN_URI_BODY}" GINC_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}" GINC_URI = f"urn:epc:id:ginc:{GINC_URI_BODY}" GSIN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}" GSIN_URI = f"urn:epc:id:gsin:{GSIN_URI_BODY}" ITIP_URI_BODY = f"{FOUR_PADDED_NUMERIC_COMPONENTS}\.{GS3A3_COMPONENT}" ITIP_URI = f"urn:epc:id:itip:{ITIP_URI_BODY}" UPUI_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}" UPUI_URI = f"urn:epc:id:upui:{UPUI_URI_BODY}" PGLN_URI_BODY = f"{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}" PGLN_URI = f"urn:epc:id:pgln:{PGLN_URI_BODY}" GID_URI_BODY = f"{NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}" GID_URI = f"urn:epc:id:gid:{GID_URI_BODY}" CAGE_CODE_OR_DODAAC = "([0-9A-HJ-NP-Z]){5,6}" USDOD_URI_BODY = f"{CAGE_CODE_OR_DODAAC}\.{NUMERIC_COMPONENT}" USDOD_URI = f"urn:epc:id:usdod:{USDOD_URI_BODY}" ADI_CHAR = "([A-Z0-9-]|(%2F))" ADI_URI_BODY = f"{CAGE_CODE_OR_DODAAC}\.{ADI_CHAR}*\.(%23)?{ADI_CHAR}+" ADI_URI = f"urn:epc:id:adi:{ADI_URI_BODY}" BIC_URI_BODY = "[A-HJ-NP-Z]{3}[JUZ][0-9]{7}" BIC_URI = f"urn:epc:id:bic:{BIC_URI_BODY}" IMOVN_URI_BODY = "[0-9]{7}" IMOVN_URI = f"urn:epc:id:imovn:{IMOVN_URI_BODY}" LGTIN_CLASS = f"urn:epc:class:lgtin:{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}" EPC_URI = ( f"({SGTIN_URI}|{SSCC_URI}|{SGLN_URI}|{GRAI_URI}|{GIAI_URI}|{GSRN_URI}|{GSRNP_URI}|{GDTI_URI}" f"|{CPI_URI}|{SGCN_URI}|{GINC_URI}|{GSIN_URI}|{ITIP_URI}|{UPUI_URI}|{PGLN_URI}|{GID_URI}" f"|{USDOD_URI}|{ADI_URI}|{BIC_URI}|{IMOVN_URI}|{LGTIN_CLASS})" ) # EPC IDPAT URIs SGTIN_IDPAT_URI_BODY = f"sgtin:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)" SSCC_IDPAT_URI_BODY = f"sscc:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)" SGLN_GRAI_IDPAT_URI_BODY_MAIN = f"({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)" SGLN_IDPAT_URI_BODY = f"sgln:{SGLN_GRAI_IDPAT_URI_BODY_MAIN}" GRAI_IDPAT_URI_BODY = f"grai:{SGLN_GRAI_IDPAT_URI_BODY_MAIN}" GIAI_IDPAT_URI_BODY = f"giai:({PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)" GSRN_IDPAT_URI_BODY = f"gsrn:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)" GSRNP_IDPAT_URI_BODY = f"gsrnp:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)" GDTI_IDPAT_URI_BODY = f"gdti:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)" CPI_IDPAT_URI_BODY = f"cpi:({PADDED_NUMERIC_COMPONENT}\.{CPREF_COMPONENT}\.{NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{CPREF_COMPONENT}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)" SGCN_IDPAT_URI_BODY = f"sgcn:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)" GINC_IDPAT_URI_BODY = f"ginc:({PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)" GSIN_IDPAT_URI_BODY = f"gsin:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)" ITIP_IDPAT_URI_BODY = f"itip:({FOUR_PADDED_NUMERIC_COMPONENTS}\.{GS3A3_COMPONENT}|{FOUR_PADDED_NUMERIC_COMPONENTS}\.\*|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.\*\.\*\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*\.\*\.\*|\*\.\*\*\.\*\.\*)" UPUI_IDPAT_URI_BODY = f"upui:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.{GS3A3_COMPONENT}|{PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT}\.\*|{PADDED_NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)" PGLN_IDPAT_URI_BODY = f"pgln:({PADDED_NUMERIC_COMPONENT}\.{PADDED_NUMERIC_COMPONENT_OR_EMPTY}|{PADDED_NUMERIC_COMPONENT}\.\*|\*\.\*)" GID_IDPAT_URI_BODY = f"gid:({NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}|{NUMERIC_COMPONENT}\.{NUMERIC_COMPONENT}\.\*|{NUMERIC_COMPONENT}\.\*\.\*|\*\.\*\.\*)" USDOD_IDPAT_URI_BODY = f"usdod:({CAGE_CODE_OR_DODAAC}\.{NUMERIC_COMPONENT}|{CAGE_CODE_OR_DODAAC}\.\*|\*\.\*)" ADI_IDPAT_URI_BODY = f"adi:({CAGE_CODE_OR_DODAAC}\.{ADI_CHAR}*\.(%23)?{ADI_CHAR}+|{CAGE_CODE_OR_DODAAC}\.{ADI_CHAR}*\.\*|{CAGE_CODE_OR_DODAAC}\.\*\.\*|\*\.\*\.\*)" IDPAT_BODY = ( f"({SGTIN_IDPAT_URI_BODY}|{SSCC_IDPAT_URI_BODY}|{SGLN_IDPAT_URI_BODY}|{GRAI_IDPAT_URI_BODY}" f"|{GIAI_IDPAT_URI_BODY}|{GSRN_IDPAT_URI_BODY}|{GSRNP_IDPAT_URI_BODY}|{GDTI_IDPAT_URI_BODY}" f"|{CPI_IDPAT_URI_BODY}|{SGCN_IDPAT_URI_BODY}|{GINC_IDPAT_URI_BODY}|{GSIN_IDPAT_URI_BODY}" f"|{ITIP_IDPAT_URI_BODY}|{UPUI_IDPAT_URI_BODY}|{PGLN_IDPAT_URI_BODY}|{GID_IDPAT_URI_BODY}" f"|{USDOD_IDPAT_URI_BODY}|{ADI_IDPAT_URI_BODY})" ) IDPAT_URI = f"urn:epc:idpat:{IDPAT_BODY}" # EPC Tag URIs SGTIN_TAG_URI_BODY = f"(sgtin-96|sgtin-198):{NUMERIC_COMPONENT}\.{SGTIN_URI_BODY}" SSCC_TAG_URI_BODY = f"sscc-96:{NUMERIC_COMPONENT}\.{SSCC_URI_BODY}" SGLN_TAG_URI_BODY = f"(sgln-96|sgln-195):{NUMERIC_COMPONENT}\.{SGLN_URI_BODY}" GRAI_TAG_URI_BODY = f"(grai-96|grai-170):{NUMERIC_COMPONENT}\.{GRAI_URI_BODY}" GIAI_TAG_URI_BODY = f"(giai-96|giai-202):{NUMERIC_COMPONENT}\.{GIAI_URI_BODY}" GSRN_TAG_URI_BODY = f"gsrn-96:{NUMERIC_COMPONENT}\.{GSRN_URI_BODY}" GSRNP_TAG_URI_BODY = f"gsrnp-96:{NUMERIC_COMPONENT}\.{GSRNP_URI_BODY}" GDTI_TAG_URI_BODY = f"(gdti-96|gdti-174):{NUMERIC_COMPONENT}\.{GDTI_URI_BODY}" CPI_TAG_URI_BODY = f"(cpi-96|cpi-var):{NUMERIC_COMPONENT}\.{CPI_URI_BODY}" SGCN_TAG_URI_BODY = f"sgcn-96:{NUMERIC_COMPONENT}\.{SGCN_URI_BODY}" ITIP_TAG_URI_BODY = f"(itip-110|itip-212):{NUMERIC_COMPONENT}\.{ITIP_URI_BODY}" GID_TAG_URI_BODY = f"gid-96:{GID_URI_BODY}" USDOD_TAG_URI_BODY = f"usdod-96:{NUMERIC_COMPONENT}\.{USDOD_URI_BODY}" ADI_TAG_URI_BODY = f"adi-var:{NUMERIC_COMPONENT}\.{ADI_URI_BODY}" TAG_URI_BODY = ( f"({SGTIN_TAG_URI_BODY}|{SSCC_TAG_URI_BODY}|{SGLN_TAG_URI_BODY}|{GRAI_TAG_URI_BODY}" f"|{GIAI_TAG_URI_BODY}|{GSRN_TAG_URI_BODY}|{GSRNP_TAG_URI_BODY}|{GDTI_TAG_URI_BODY}" f"|{CPI_TAG_URI_BODY}|{SGCN_TAG_URI_BODY}|{ITIP_TAG_URI_BODY}|{GID_TAG_URI_BODY}" f"|{USDOD_TAG_URI_BODY}|{ADI_TAG_URI_BODY})" ) TAG_URI = f"urn:epc:tag:{TAG_URI_BODY}" # GS1 element strings SGTIN_GS1_ELEMENT_STRING = f"\(01\){DIGIT}{{14}}\(21\){GS1_ELEM_CHARS}{{1,20}}" SSCC_GS1_ELEMENT_STRING = f"\(00\){DIGIT}{{18}}" SGLN_GS1_ELEMENT_STRING = f"\(414\){DIGIT}{{13}}\(254\){GS1_ELEM_CHARS}{{1,20}}" GRAI_GS1_ELEMENT_STRING = f"\(8003\)0{DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,16}}" GIAI_GS1_ELEMENT_STRING = f"\(8004\){DIGIT}{{6,12}}{GS1_ELEM_CHARS}{{1,24}}" GSRN_GS1_ELEMENT_STRING = f"\(8018\){DIGIT}{{18}}" GSRNP_GS1_ELEMENT_STRING = f"\(8017\){DIGIT}{{18}}" GDTI_GS1_ELEMENT_STRING = f"\(253\){DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,17}}" CPI_GS1_ELEMENT_STRING = ( f"\(8010\){DIGIT}{{6,12}}{GS1_ELEM_CHARS_CPI}{{,24}}\(8011\){DIGIT}{{1,12}}" ) SGCN_GS1_ELEMENT_STRING = f"\(255\){DIGIT}{{13}}{GS1_ELEM_CHARS}{{1,12}}" GINC_GS1_ELEMENT_STRING = f"\(401\){DIGIT}{{6,12}}{GS1_ELEM_CHARS}{{1,24}}" GSIN_GS1_ELEMENT_STRING = f"\(402\){DIGIT}{{17}}" ITIP_GS1_ELEMENT_STRING = f"\(8006\){DIGIT}{{18}}\(21\){GS1_ELEM_CHARS}{{1,20}}" UPUI_GS1_ELEMENT_STRING = f"\(01\){DIGIT}{{14}}\(235\){GS1_ELEM_CHARS}{{1,28}}" PGLN_GS1_ELEMENT_STRING = f"\(417\){DIGIT}{{13}}" LGTIN_GS1_ELEMENT_STRING = f"\(01\){DIGIT}{{14}}\(10\){GS1_ELEM_CHARS}{{1,20}}" GS1_ELEMENT_STRING = ( f"({SGTIN_GS1_ELEMENT_STRING}|{SSCC_GS1_ELEMENT_STRING}|{SGLN_GS1_ELEMENT_STRING}" f"|{GRAI_GS1_ELEMENT_STRING}|{GIAI_GS1_ELEMENT_STRING}|{GSRN_GS1_ELEMENT_STRING}" f"|{GSRNP_GS1_ELEMENT_STRING}|{GDTI_GS1_ELEMENT_STRING}|{CPI_GS1_ELEMENT_STRING}" f"|{SGCN_GS1_ELEMENT_STRING}|{GINC_GS1_ELEMENT_STRING}|{GSIN_GS1_ELEMENT_STRING}" f"|{ITIP_GS1_ELEMENT_STRING}|{UPUI_GS1_ELEMENT_STRING}|{PGLN_GS1_ELEMENT_STRING}" f"|{LGTIN_GS1_ELEMENT_STRING})" )
59.670588
247
0.746254
1,567
10,144
4.328653
0.071474
0.126935
0.275689
0.214802
0.631579
0.501695
0.403951
0.350435
0.296919
0.198585
0
0.031564
0.047417
10,144
169
248
60.023669
0.670392
0.007689
0
0
0
0.007407
0.735586
0.720577
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
cdd8a188fcad505ef24a25cf664aa553c9b3d3ff
147
py
Python
hata/ext/management/__init__.py
WizzyBots/hata
f6991afc0bebf7dad932888a536f4d010f8663c7
[ "0BSD" ]
1
2022-03-02T03:59:57.000Z
2022-03-02T03:59:57.000Z
hata/ext/management/__init__.py
m0nk3ybraindead/hata
f87ed3d7009eeae31d6ea158772efd33775c7b1c
[ "0BSD" ]
1
2022-02-08T16:54:39.000Z
2022-02-08T16:54:39.000Z
hata/ext/management/__init__.py
WizzyBots/hata
f6991afc0bebf7dad932888a536f4d010f8663c7
[ "0BSD" ]
null
null
null
try: import dotenv except ModuleNotFoundError as err: raise ImportError( 'The extension requires `dotenv` package.' ) from err
21
50
0.687075
16
147
6.3125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.251701
147
6
51
24.5
0.918182
0
0
0
0
0
0.272109
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
cdd934ffd6dd70734e471b949df40b38a9ee8e98
1,077
py
Python
tests/test_workflow.py
carj/pyPreservica
0b07b67971e89e366964a22d44066c30c42cc5cc
[ "Apache-2.0" ]
8
2020-07-01T12:20:59.000Z
2022-02-22T09:11:38.000Z
tests/test_workflow.py
carj/pyPreservica
0b07b67971e89e366964a22d44066c30c42cc5cc
[ "Apache-2.0" ]
5
2020-11-13T13:38:36.000Z
2022-02-21T09:12:20.000Z
tests/test_workflow.py
carj/pyPreservica
0b07b67971e89e366964a22d44066c30c42cc5cc
[ "Apache-2.0" ]
null
null
null
import pytest from pyPreservica import * def test_get_workflow_contexts(): workflow = WorkflowAPI() workflows = workflow.get_workflow_contexts("com.preservica.core.workflow.ingest.single.file") assert len(workflows) == 1 def test_get_workflow_contexts2(): workflow = WorkflowAPI() workflows = workflow.get_workflow_contexts("com.preservica.core.workflow.ingest") assert len(workflows) == 2 def test_get_workflow_contexts3(): workflow = WorkflowAPI() workflows = workflow.get_workflow_contexts("com.preservica.core.workflow.delete") assert len(workflows) == 2 def test_get_workflow_contexts_type(): workflow = WorkflowAPI() workflows = workflow.get_workflow_contexts_by_type("Ingest") assert len(workflows) == 5 workflows = workflow.get_workflow_contexts_by_type("Access") assert len(workflows) == 5 workflows = workflow.get_workflow_contexts_by_type("Transformation") assert len(workflows) == 1 workflows = workflow.get_workflow_contexts_by_type("DataManagement") assert len(workflows) == 14
28.342105
97
0.750232
126
1,077
6.134921
0.246032
0.156533
0.221216
0.253558
0.756792
0.712807
0.712807
0.57956
0.483829
0.483829
0
0.010905
0.148561
1,077
37
98
29.108108
0.832061
0
0
0.416667
0
0
0.145911
0.108736
0
0
0
0
0.291667
1
0.166667
false
0
0.083333
0
0.25
0
0
0
0
null
0
1
1
0
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
0
0
0
0
0
0
0
0
4
cde517463bd7a554f165ec7ee9019a61c122419f
86
py
Python
PBO_19188/Latihan_6.1_helloworld.py
Fazlur9/PBO
357b739c0c20ed2aa0c3cc58d48bbae843e9e946
[ "MIT" ]
null
null
null
PBO_19188/Latihan_6.1_helloworld.py
Fazlur9/PBO
357b739c0c20ed2aa0c3cc58d48bbae843e9e946
[ "MIT" ]
null
null
null
PBO_19188/Latihan_6.1_helloworld.py
Fazlur9/PBO
357b739c0c20ed2aa0c3cc58d48bbae843e9e946
[ "MIT" ]
null
null
null
def helloworld(): print("ini adalah fungsi menampilkan helloworld") helloworld()
28.666667
54
0.744186
9
86
7.111111
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.151163
86
3
55
28.666667
0.876712
0
0
0
0
0
0.470588
0
0
0
0
0
0
1
0.333333
true
0
0
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
1
1
0
0
0
0
0
0
4
cdf5c3bcdf618f81e120eaa8a7a8887a5d521a6f
117
py
Python
src/__init__.py
emaballarin/RADLER
5a059939a2ddb02c49689bd9d867aa9935589faa
[ "MIT" ]
1
2020-04-18T03:09:00.000Z
2020-04-18T03:09:00.000Z
src/__init__.py
emaballarin/GANsemble
5a059939a2ddb02c49689bd9d867aa9935589faa
[ "MIT" ]
null
null
null
src/__init__.py
emaballarin/GANsemble
5a059939a2ddb02c49689bd9d867aa9935589faa
[ "MIT" ]
null
null
null
# This file just serves the purpose of making the content of the containing # directory importable in Python scripts
39
75
0.811966
18
117
5.277778
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.17094
117
2
76
58.5
0.979381
0.957265
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
b53fa01da43e698fd98cf3eda8e19629bfc8be02
138
py
Python
keytext4py/TextProcessor.py
innerNULL/keytext4py
1a47e5397bb3ec4f42540d79819ca9e78e909a5a
[ "MIT" ]
null
null
null
keytext4py/TextProcessor.py
innerNULL/keytext4py
1a47e5397bb3ec4f42540d79819ca9e78e909a5a
[ "MIT" ]
null
null
null
keytext4py/TextProcessor.py
innerNULL/keytext4py
1a47e5397bb3ec4f42540d79819ca9e78e909a5a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # file: TextProcessor.py # date: 2022-03-08 class TextProcessor(object): def __init__(self): pass
12.545455
28
0.608696
17
138
4.705882
0.941176
0
0
0
0
0
0
0
0
0
0
0.084906
0.231884
138
10
29
13.8
0.669811
0.442029
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
b58562d0625fbb8adac4d37c408a4cda6ff874f8
35
py
Python
components/Number4.py
tassaron2/component-experiment
07fea42a46084373b15a6a95eeb4b26b99a89c4f
[ "MIT" ]
null
null
null
components/Number4.py
tassaron2/component-experiment
07fea42a46084373b15a6a95eeb4b26b99a89c4f
[ "MIT" ]
null
null
null
components/Number4.py
tassaron2/component-experiment
07fea42a46084373b15a6a95eeb4b26b99a89c4f
[ "MIT" ]
null
null
null
''' another placeholder module '''
17.5
34
0.685714
3
35
8
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
35
1
35
35
0.8
0.742857
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
b596ef7595a5dfefa9f5c4f505b176bdda275378
192
py
Python
modules/persons/application/controllers/v1/address/__init__.py
eduardolujan/hexagonal_architecture_django
8055927cb460bc40f3a2651c01a9d1da696177e8
[ "BSD-3-Clause" ]
6
2020-08-09T23:41:08.000Z
2021-03-16T22:05:40.000Z
modules/persons/application/controllers/v1/address/__init__.py
eduardolujan/hexagonal_architecture_django
8055927cb460bc40f3a2651c01a9d1da696177e8
[ "BSD-3-Clause" ]
1
2020-10-02T02:59:38.000Z
2020-10-02T02:59:38.000Z
modules/persons/application/controllers/v1/address/__init__.py
eduardolujan/hexagonal_architecture_django
8055927cb460bc40f3a2651c01a9d1da696177e8
[ "BSD-3-Clause" ]
2
2021-03-16T22:05:43.000Z
2021-04-30T06:35:25.000Z
# -*- coding: utf-8 -*- from .address_finder_controller import AddressFinderController from .create_address_controller import CreateAddressController __all__ = ('AddressFinderController',)
24
62
0.8125
17
192
8.705882
0.705882
0.216216
0
0
0
0
0
0
0
0
0
0.00578
0.098958
192
7
63
27.428571
0.849711
0.109375
0
0
0
0
0.136095
0.136095
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
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
b5b1956f2f6daae5198e99e53873a358cf761c4c
185
py
Python
test.py
marcosblandim/IP-Cam_python
8d0abc46afe2d13be5a0819806bd1e807961271b
[ "MIT" ]
null
null
null
test.py
marcosblandim/IP-Cam_python
8d0abc46afe2d13be5a0819806bd1e807961271b
[ "MIT" ]
1
2020-04-05T07:56:31.000Z
2020-04-05T07:56:31.000Z
test.py
marcosblandim/IP-Cam_python
8d0abc46afe2d13be5a0819806bd1e807961271b
[ "MIT" ]
null
null
null
from IP_Cam_python import Camera ip = input("-> Type your camera's IP: ") initial_position = 0 cam = Camera(ip) cam.goto_position(initial_position) cam.set_position(initial_position)
20.555556
40
0.778378
29
185
4.724138
0.517241
0.328467
0.335766
0
0
0
0
0
0
0
0
0.006135
0.118919
185
9
41
20.555556
0.834356
0
0
0
0
0
0.139785
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a9194bbb041e43ba9a2a515fc54cd5ece15be85d
207
py
Python
gestionies/users/apps.py
pkom/gestionies
3e75b70bac40e014421e60a78e80848fed565d76
[ "BSD-3-Clause" ]
null
null
null
gestionies/users/apps.py
pkom/gestionies
3e75b70bac40e014421e60a78e80848fed565d76
[ "BSD-3-Clause" ]
null
null
null
gestionies/users/apps.py
pkom/gestionies
3e75b70bac40e014421e60a78e80848fed565d76
[ "BSD-3-Clause" ]
null
null
null
# require django >= 1.7 from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class UsersConfig(AppConfig): name = 'gestionies.users' verbose_name = _('Users')
23
55
0.743961
26
207
5.769231
0.730769
0.133333
0
0
0
0
0
0
0
0
0
0.011561
0.164251
207
8
56
25.875
0.855491
0.101449
0
0
0
0
0.114754
0
0
0
0
0
0
1
0
false
0
0.4
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
a91effff663a029b0cd99e41f026f30dc5625fde
560
py
Python
udemy-data-structures-and-algorithms/13-stacks-queues-and-deques/13.3_deque.py
washimimizuku/python-data-structures-and-algorithms
537f4eabaf31888ae48004d153088fb28bb684ab
[ "MIT" ]
null
null
null
udemy-data-structures-and-algorithms/13-stacks-queues-and-deques/13.3_deque.py
washimimizuku/python-data-structures-and-algorithms
537f4eabaf31888ae48004d153088fb28bb684ab
[ "MIT" ]
null
null
null
udemy-data-structures-and-algorithms/13-stacks-queues-and-deques/13.3_deque.py
washimimizuku/python-data-structures-and-algorithms
537f4eabaf31888ae48004d153088fb28bb684ab
[ "MIT" ]
null
null
null
class Deque: def __init__(self): self.items = [] def is_empty(self): return self.items == [] def add_front(self, item): self.items.insert(0, item) def add_rear(self, item): self.items.append(item) def remove_front(self): return self.items.pop(0) def remove_rear(self): return self.items.pop() def size(self): return len(self.items) d = Deque() d.add_front('hello') d.add_rear('world') print(d.size()) print(d.remove_front() + ' ' + d.remove_rear()) print(d.size())
16.969697
47
0.589286
80
560
3.9625
0.3
0.198738
0.132492
0.179811
0.138801
0
0
0
0
0
0
0.004785
0.253571
560
32
48
17.5
0.753589
0
0
0.095238
0
0
0.019643
0
0
0
0
0
0
1
0.333333
false
0
0
0.190476
0.571429
0.142857
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
a9428a663f3af62a23b1ce8ab208a00026c13bcd
82
py
Python
py-edlib/__init__.py
nmiculinic/edlib-python
ed9b8be7732d7129617b949bc3ae19e7b9af9c56
[ "MIT" ]
2
2017-01-12T22:10:04.000Z
2017-01-12T23:36:58.000Z
py-edlib/__init__.py
nmiculinic/edlib-python
ed9b8be7732d7129617b949bc3ae19e7b9af9c56
[ "MIT" ]
null
null
null
py-edlib/__init__.py
nmiculinic/edlib-python
ed9b8be7732d7129617b949bc3ae19e7b9af9c56
[ "MIT" ]
null
null
null
from .edlib import AlignmentResult, Edlib __all__ = ["AlignmentResult", "Edlib"]
20.5
41
0.756098
8
82
7.25
0.625
0.689655
0
0
0
0
0
0
0
0
0
0
0.121951
82
3
42
27.333333
0.805556
0
0
0
0
0
0.243902
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
a9552779489b085a4069d0fb1a96b92f7b59df93
1,594
py
Python
external/netdef_models/netdef_slim/evolutions/state.py
zhuhu00/MOTSFusion_modify
190224a7c3fbded69fedf9645a0ebbf08227fb6d
[ "MIT" ]
null
null
null
external/netdef_models/netdef_slim/evolutions/state.py
zhuhu00/MOTSFusion_modify
190224a7c3fbded69fedf9645a0ebbf08227fb6d
[ "MIT" ]
null
null
null
external/netdef_models/netdef_slim/evolutions/state.py
zhuhu00/MOTSFusion_modify
190224a7c3fbded69fedf9645a0ebbf08227fb6d
[ "MIT" ]
null
null
null
import re, os import netdef_slim as nd class _State: def __init__(self, id): id_re_match = re.compile('([^:]+):([0-9]+)').match(id) self._id = id self._evo_name = id_re_match.group(1) self._iter = int(id_re_match.group(2)) def iter(self): return self._iter def id(self): return self._id def evo_name(self): return self._evo_name def evo_index(self): return nd.evo_manager.get_evolution(self._evo_name).index() def __lt__(self, other): return (self.evo_index() < other.evo_index()) or ( self.evo_index() == other.evo_index() and self.iter() < other.iter()) def __le__(self, other): return (self.evo_index() < other.evo_index()) or ( self.evo_index() == other.evo_index() and self.iter() <= other.iter()) def __gt__(self, other): return (self.evo_index() > other.evo_index()) or ( self.evo_index() == other.evo_index() and self.iter() > other.iter()) def __ge__(self, other): return (self.evo_index() > other.evo_index()) or ( self.evo_index() == other.evo_index() and self.iter() >= other.iter()) def __eq__(self, other): return self.evo_index() == other.evo_index() and self.iter() == other.iter() def __ne__(self, other): return self.evo_index() != other.evo_index() or self.iter() != other.iter() def folder(self): return os.path.join(nd.evo_manager.training_dir(), self.evo_name()) def __str__(self): return self._evo_name+':'+str(self._iter)
34.652174
90
0.599749
225
1,594
3.893333
0.195556
0.191781
0.136986
0.194064
0.601598
0.535388
0.535388
0.535388
0.535388
0.518265
0
0.003303
0.240276
1,594
45
91
35.422222
0.720066
0
0
0.121212
0
0
0.010672
0
0
0
0
0
0
1
0.393939
false
0
0.060606
0.363636
0.757576
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
a9750cf819bed47174aa8222b5c45c9a0b766b01
814
py
Python
app/api/v1/errors.py
cylmemory/SimpleBlog
163c0e8c8b215a8f3d10ac60d922c7979e4e5dac
[ "MIT" ]
17
2018-10-17T03:08:38.000Z
2021-11-08T08:32:48.000Z
app/api/v1/errors.py
cylmemory/SimpleBlog
163c0e8c8b215a8f3d10ac60d922c7979e4e5dac
[ "MIT" ]
1
2019-04-25T04:53:42.000Z
2019-04-25T10:54:39.000Z
app/api/v1/errors.py
cylmemory/SimpleBlog
163c0e8c8b215a8f3d10ac60d922c7979e4e5dac
[ "MIT" ]
7
2019-05-05T02:46:09.000Z
2021-11-08T14:55:58.000Z
from . import api from flask import jsonify def bad_request_error(message): response = jsonify({'error': 'bad request', 'message': message}) response.status_code = 400 return response def unauthorized_error(message): response = jsonify({'error': 'unauthorized', 'message': message}) response.status_code = 401 return response def forbidden_error(message): response = jsonify({'error': 'forbidden', 'message': message}) response.status_code = 403 return response def page_not_found_error(message): response = jsonify({'error': 'page not found', 'message': message}) response.status_code = 404 return response class ValidationError(ValueError): pass @api.errorhandler(ValidationError) def validate_error(e): return bad_request_error(e.args[0])
20.35
71
0.711302
95
814
5.947368
0.336842
0.212389
0.141593
0.19115
0.453097
0
0
0
0
0
0
0.019374
0.175676
814
39
72
20.871795
0.822653
0
0
0.173913
0
0
0.115479
0
0
0
0
0
0
1
0.217391
false
0.043478
0.086957
0.043478
0.565217
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
0
1
0
0
4
a989cd762353200b958e936a948fa0137a984715
132
py
Python
newTest1.py
cesperon/Python-Interpreter
0cf34d52585432fc34e38abace895df5ae2fd2fd
[ "MIT" ]
null
null
null
newTest1.py
cesperon/Python-Interpreter
0cf34d52585432fc34e38abace895df5ae2fd2fd
[ "MIT" ]
null
null
null
newTest1.py
cesperon/Python-Interpreter
0cf34d52585432fc34e38abace895df5ae2fd2fd
[ "MIT" ]
1
2020-03-22T00:26:31.000Z
2020-03-22T00:26:31.000Z
myInt = 11 print myInt # myNextInt = 21 # print myNextInt # newInt = myInt + myNextInt # print newInt # print newInt + myInt
8.8
28
0.674242
16
132
5.5625
0.375
0.314607
0
0
0
0
0
0
0
0
0
0.040404
0.25
132
14
29
9.428571
0.858586
0.689394
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.5
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
8d345bc0f61992b18bb082cf485e3e4432ad93aa
158
py
Python
keystroke/apps.py
jstavanja/quiz-biometrics-api
75e0db348668b14a85f94261aac092ae2d5fa9c6
[ "MIT" ]
null
null
null
keystroke/apps.py
jstavanja/quiz-biometrics-api
75e0db348668b14a85f94261aac092ae2d5fa9c6
[ "MIT" ]
null
null
null
keystroke/apps.py
jstavanja/quiz-biometrics-api
75e0db348668b14a85f94261aac092ae2d5fa9c6
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class KeystrokeConfig(AppConfig): name = 'keystroke'
17.555556
39
0.740506
18
158
6.222222
0.833333
0
0
0
0
0
0
0
0
0
0
0.007519
0.158228
158
8
40
19.75
0.834586
0.132911
0
0
0
0
0.066667
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
8d394260e219b7a4962f8684ed245c7abb548690
264
py
Python
stored_messages/backends/signals.py
andrejchikilev/django-stored-messages
77520e16e2cc875790aa16c26592c541c9a35fd2
[ "BSD-3-Clause" ]
42
2015-04-18T15:20:02.000Z
2019-08-18T06:06:19.000Z
stored_messages/backends/signals.py
andrejchikilev/django-stored-messages
77520e16e2cc875790aa16c26592c541c9a35fd2
[ "BSD-3-Clause" ]
19
2015-02-02T16:49:59.000Z
2018-08-29T07:10:07.000Z
stored_messages/backends/signals.py
andrejchikilev/django-stored-messages
77520e16e2cc875790aa16c26592c541c9a35fd2
[ "BSD-3-Clause" ]
27
2015-02-27T15:49:13.000Z
2021-09-03T09:55:09.000Z
from django.dispatch import Signal inbox_stored = Signal(providing_args=["user", "message"]) inbox_deleted = Signal(providing_args=["user", "message_id"]) inbox_purged = Signal(providing_args=["user"]) archive_stored = Signal(providing_args=["user", "message"])
33
61
0.761364
33
264
5.818182
0.454545
0.3125
0.395833
0.479167
0.53125
0.375
0
0
0
0
0
0
0.079545
264
7
62
37.714286
0.790123
0
0
0
0
0
0.151515
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8d89817dca6e534b98138c60e026a42b8841b201
87
py
Python
DMVProject/DMVApp/apps.py
cs-fullstack-2019-fall/django_imageUploader
9863f4ac3291bd425c75065dc307d3b80ff4cae5
[ "Apache-2.0" ]
null
null
null
DMVProject/DMVApp/apps.py
cs-fullstack-2019-fall/django_imageUploader
9863f4ac3291bd425c75065dc307d3b80ff4cae5
[ "Apache-2.0" ]
null
null
null
DMVProject/DMVApp/apps.py
cs-fullstack-2019-fall/django_imageUploader
9863f4ac3291bd425c75065dc307d3b80ff4cae5
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class DmvappConfig(AppConfig): name = 'DMVApp'
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
8d8a8c517530725d1031cd52aa3ba1d3696d9b47
45
py
Python
commands/testcommand.py
dannydenenberg/Starlight
e7fc946760a41449acd10d0d092fe8a898fdb96c
[ "MIT" ]
1
2019-06-07T07:10:59.000Z
2019-06-07T07:10:59.000Z
commands/testcommand.py
dannydenenberg/Starlight
e7fc946760a41449acd10d0d092fe8a898fdb96c
[ "MIT" ]
null
null
null
commands/testcommand.py
dannydenenberg/Starlight
e7fc946760a41449acd10d0d092fe8a898fdb96c
[ "MIT" ]
null
null
null
test one two three talkToMe('yay it worked')
15
25
0.755556
8
45
4.25
1
0
0
0
0
0
0
0
0
0
0
0
0.155556
45
2
26
22.5
0.894737
0
0
0
0
0
0.288889
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
8d91ced0624fcae89bc739632ca73029328f8100
6,236
py
Python
tests/syn_reports/core/test_synapse_proxy.py
pcstout/syn-reports
9b2692fbc38e5596e62d8a415536483f2d05ee78
[ "Apache-2.0" ]
1
2020-02-27T02:15:38.000Z
2020-02-27T02:15:38.000Z
tests/syn_reports/core/test_synapse_proxy.py
pcstout/syn-reports
9b2692fbc38e5596e62d8a415536483f2d05ee78
[ "Apache-2.0" ]
7
2020-03-24T18:21:31.000Z
2021-06-22T14:22:11.000Z
tests/syn_reports/core/test_synapse_proxy.py
pcstout/syn-reports
9b2692fbc38e5596e62d8a415536483f2d05ee78
[ "Apache-2.0" ]
2
2020-03-02T21:30:50.000Z
2020-03-13T22:03:43.000Z
import pytest import asyncio from src.syn_reports.core import SynapseProxy import synapseclient as syn def test_is_synapse_id(): assert SynapseProxy.is_synapse_id('SyN1230') is True assert SynapseProxy.is_synapse_id(' sYn1230 ') is True assert SynapseProxy.is_synapse_id('syn') is False assert SynapseProxy.is_synapse_id('syn 1230') is False assert SynapseProxy.is_synapse_id('1230') is False assert SynapseProxy.is_synapse_id('1230syn') is False def test__extract_concrete_type(): assert SynapseProxy._extract_concrete_type(syn.Project()) == 'org.sagebionetworks.repo.model.Project' assert SynapseProxy._extract_concrete_type( {'concreteType': 'org.sagebionetworks.repo.model.Project'}) == 'org.sagebionetworks.repo.model.Project' assert SynapseProxy._extract_concrete_type( {'type': 'org.sagebionetworks.repo.model.Project'}) == 'org.sagebionetworks.repo.model.Project' with pytest.raises(ValueError) as err: SynapseProxy._extract_concrete_type({}) assert 'Cannot extract type from' in str(err) def test_entity_type_display_name(): assert SynapseProxy.entity_type_display_name( 'org.sagebionetworks.repo.model.Project') == SynapseProxy.PROJECT_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name(syn.Project()) == SynapseProxy.PROJECT_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( {'concreteType': 'org.sagebionetworks.repo.model.Project'}) == SynapseProxy.PROJECT_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( 'org.sagebionetworks.repo.model.Folder') == SynapseProxy.FOLDER_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name(syn.Folder(parentId='syn0')) == SynapseProxy.FOLDER_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( {'concreteType': 'org.sagebionetworks.repo.model.Folder'}) == SynapseProxy.FOLDER_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( 'org.sagebionetworks.repo.model.FileEntity') == SynapseProxy.FILE_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name(syn.File(parentId='syn0')) == SynapseProxy.FILE_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( {'concreteType': 'org.sagebionetworks.repo.model.FileEntity'}) == SynapseProxy.FILE_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( 'org.sagebionetworks.repo.model.Link') == SynapseProxy.LINK_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( syn.Link(parentId='syn0', targetId='syn0')) == SynapseProxy.LINK_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( {'concreteType': 'org.sagebionetworks.repo.model.Link'}) == SynapseProxy.LINK_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( 'org.sagebionetworks.repo.model.table.TableEntity') == SynapseProxy.TABLE_TYPE_DISPLAY_NAME assert SynapseProxy.entity_type_display_name( {'concreteType': 'org.sagebionetworks.repo.model.table.TableEntity'}) == SynapseProxy.TABLE_TYPE_DISPLAY_NAME def test_is_project(): assert SynapseProxy.is_project('org.sagebionetworks.repo.model.Project') is True assert SynapseProxy.is_project(syn.Project()) is True assert SynapseProxy.is_project({'concreteType': 'org.sagebionetworks.repo.model.Project'}) is True def test_is_folder(): assert SynapseProxy.is_folder('org.sagebionetworks.repo.model.Folder') is True assert SynapseProxy.is_folder(syn.Folder(parentId='syn0')) is True assert SynapseProxy.is_folder({'concreteType': 'org.sagebionetworks.repo.model.Folder'}) is True def test_is_file(): assert SynapseProxy.is_file('org.sagebionetworks.repo.model.FileEntity') is True assert SynapseProxy.is_file(syn.File(parentId='syn0')) is True assert SynapseProxy.is_file({'concreteType': 'org.sagebionetworks.repo.model.FileEntity'}) is True def test_with_cache_get_user(syn_test_helper): user_id = SynapseProxy.client().getUserProfile().get('ownerId') user = SynapseProxy.WithCache.get_user(user_id) assert user['ownerId'] == user_id # Returns None if the user does not exist assert SynapseProxy.WithCache.get_user('-9999999') is None assert SynapseProxy.WithCache.get_user('000') is None assert SynapseProxy.WithCache.get_user(syn_test_helper.uniq_name(prefix='notarealname')) is None def test_with_cache_get_team(syn_test_helper): team = syn_test_helper.create_team() team_id = team.get('id') team_name = team.get('name') team = SynapseProxy.WithCache.get_team(team_id) assert team['id'] == team_id team = SynapseProxy.WithCache.get_team(team_name) assert team['id'] == team_id # Returns None if the team does not exist assert SynapseProxy.WithCache.get_team('-9999999') is None assert SynapseProxy.WithCache.get_team('000') is None assert SynapseProxy.WithCache.get_team(syn_test_helper.uniq_name(prefix='notarealname')) is None def test_with_cache_get_user_or_team(syn_test_helper): user_id = SynapseProxy.client().getUserProfile().get('ownerId') team_id = syn_test_helper.create_team().get('id') user = SynapseProxy.WithCache.get_user_or_team(user_id) assert isinstance(user, syn.UserProfile) assert user['ownerId'] == user_id team = SynapseProxy.WithCache.get_user_or_team(team_id) assert isinstance(team, syn.Team) assert team['id'] == team_id # Returns None if the user and team do not exist assert SynapseProxy.WithCache.get_user_or_team('-9999999') is None assert SynapseProxy.WithCache.get_user_or_team('000') is None assert SynapseProxy.WithCache.get_user_or_team(syn_test_helper.uniq_name(prefix='notarealname')) is None assert SynapseProxy.WithCache.get_user_or_team(syn_test_helper.uniq_name(prefix='notarealname')) is None def test_with_cache_get_team_members(syn_test_helper): team = syn_test_helper.create_team() members = SynapseProxy.WithCache.get_team_members(team.id) assert len(members) == 1 # Returns [] if the team does not exist assert SynapseProxy.WithCache.get_team_members('-9999999') == [] assert SynapseProxy.WithCache.get_team_members('000') == []
46.887218
118
0.769243
807
6,236
5.657993
0.099133
0.173456
0.095269
0.124179
0.861367
0.814279
0.735874
0.621332
0.562199
0.520806
0
0.012291
0.125882
6,236
132
119
47.242424
0.825353
0.026299
0
0.252632
0
0
0.190209
0.135157
0
0
0
0
0.557895
1
0.105263
false
0
0.042105
0
0.147368
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
8d9ea99895a5b98f8e1d17d14989ca1ac76493c1
1,579
py
Python
sdks/python/test/test_jobs_api.py
barryw/bjr
de56f22198b34a9d303ee43ac01134b5cf1ce863
[ "BSD-3-Clause" ]
2
2020-06-04T03:04:15.000Z
2020-06-13T12:53:58.000Z
sdks/python/test/test_jobs_api.py
barryw/bjr
de56f22198b34a9d303ee43ac01134b5cf1ce863
[ "BSD-3-Clause" ]
6
2020-05-24T12:56:25.000Z
2022-02-26T07:13:17.000Z
sdks/python/test/test_jobs_api.py
barryw/bjr
de56f22198b34a9d303ee43ac01134b5cf1ce863
[ "BSD-3-Clause" ]
null
null
null
""" BJR API V1 API specification for the BJR job server. # noqa: E501 The version of the OpenAPI document: v1 Generated by: https://openapi-generator.tech """ import unittest import bjr4py from bjr4py.api.jobs_api import JobsApi # noqa: E501 class TestJobsApi(unittest.TestCase): """JobsApi unit test stubs""" def setUp(self): self.api = JobsApi() # noqa: E501 def tearDown(self): pass def test_create_job(self): """Test case for create_job Creates a job # noqa: E501 """ pass def test_delete_job(self): """Test case for delete_job Deletes a job # noqa: E501 """ pass def test_get_job(self): """Test case for get_job Retrieves a single job # noqa: E501 """ pass def test_get_job_runs(self): """Test case for get_job_runs Retrieve the runs for a job # noqa: E501 """ pass def test_get_jobs(self): """Test case for get_jobs Retrieves jobs # noqa: E501 """ pass def test_job_occurrences(self): """Test case for job_occurrences Upcoming job occurrences # noqa: E501 """ pass def test_run_job_now(self): """Test case for run_job_now Run a job now # noqa: E501 """ pass def test_update_job(self): """Test case for update_job Updates a single job # noqa: E501 """ pass if __name__ == '__main__': unittest.main()
18.576471
59
0.564915
200
1,579
4.275
0.28
0.102924
0.102924
0.140351
0.357895
0.207018
0.123977
0.097076
0
0
0
0.035922
0.347688
1,579
84
60
18.797619
0.794175
0.428752
0
0.346154
1
0
0.011494
0
0
0
0
0
0
1
0.384615
false
0.346154
0.115385
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
93bcf9485079ee457fb832dabf9174debe1ab8b7
150
py
Python
cieloApi3/settings.py
math-s/API-3.0-Python
8b493963f6dcc23cbe54221434f2fcfde3bccfdc
[ "MIT" ]
1
2021-08-10T14:40:37.000Z
2021-08-10T14:40:37.000Z
cieloApi3/settings.py
math-s/API-3.0-Python
8b493963f6dcc23cbe54221434f2fcfde3bccfdc
[ "MIT" ]
null
null
null
cieloApi3/settings.py
math-s/API-3.0-Python
8b493963f6dcc23cbe54221434f2fcfde3bccfdc
[ "MIT" ]
null
null
null
import os from dotenv import load_dotenv load_dotenv(override=True) MERCHANT_ID = os.getenv('merchant_id') MERCHANT_KEY = os.getenv('merchant_key')
18.75
40
0.8
23
150
4.956522
0.478261
0.175439
0.280702
0
0
0
0
0
0
0
0
0
0.1
150
7
41
21.428571
0.844444
0
0
0
0
0
0.153333
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
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
93cc0fa20172d38d3db77c4476a91273edb5e89f
223
py
Python
_/0349_09_Code/112.py
paullewallencom/javascript-978-1-8495-1034-9
7e539d042c644931a9ef2418f66d260a1c6892eb
[ "Apache-2.0" ]
null
null
null
_/0349_09_Code/112.py
paullewallencom/javascript-978-1-8495-1034-9
7e539d042c644931a9ef2418f66d260a1c6892eb
[ "Apache-2.0" ]
null
null
null
_/0349_09_Code/112.py
paullewallencom/javascript-978-1-8495-1034-9
7e539d042c644931a9ef2418f66d260a1c6892eb
[ "Apache-2.0" ]
null
null
null
def image(request, id): return HttpResponse(open(directory.settings.DIRNAME + "/static/images/profile/" + id, "rb").read(), mimetype = directory.models.Entity.objects.filter(id = int(id))[0].image_mimetype)
44.6
88
0.690583
28
223
5.464286
0.785714
0
0
0
0
0
0
0
0
0
0
0.005208
0.139013
223
4
89
55.75
0.791667
0
0
0
0
0
0.112108
0.103139
0
0
0
0
0
1
0.25
false
0
0
0.25
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
93e5c80178ed04bb0bca627f56e0fe475b3517a3
1,088
py
Python
test/test_words_api.py
sgrade/words-api-python
45cebc51fd31026b748981d7c41d5b4e1dea98cd
[ "MIT" ]
null
null
null
test/test_words_api.py
sgrade/words-api-python
45cebc51fd31026b748981d7c41d5b4e1dea98cd
[ "MIT" ]
null
null
null
test/test_words_api.py
sgrade/words-api-python
45cebc51fd31026b748981d7c41d5b4e1dea98cd
[ "MIT" ]
null
null
null
# coding: utf-8 """ Words Words API # noqa: E501 OpenAPI spec version: 1.0.0 Contact: sgrade@users.noreply.github.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import swagger_client from api.words_api import WordsApi # noqa: E501 from swagger_client.rest import ApiException class TestWordsApi(unittest.TestCase): """WordsApi unit test stubs""" def setUp(self): self.api = api.words_api.WordsApi() # noqa: E501 def tearDown(self): pass def test_find_words_by_name(self): """Test case for find_words_by_name Find Words by name # noqa: E501 """ pass def test_find_words_by_status(self): """Test case for find_words_by_status Finds Words by status # noqa: E501 """ pass def test_get_words_to_learn(self): """Test case for get_words_to_learn Get words to learn # noqa: E501 """ pass if __name__ == '__main__': unittest.main()
19.781818
68
0.643382
145
1,088
4.565517
0.37931
0.072508
0.083082
0.067976
0.185801
0.145015
0.07855
0
0
0
0
0.027569
0.266544
1,088
54
69
20.148148
0.802005
0.397978
0
0.222222
1
0
0.01444
0
0
0
0
0
0
1
0.277778
false
0.222222
0.277778
0
0.611111
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
9e080182dd4f4cec935650dc1d1b186d01490f53
425
py
Python
src/reports/RGenerator.py
lsoumille/file-analyzer
cabc7fb8b8727b35b6359cbcceb089f31228e1ef
[ "Apache-2.0" ]
null
null
null
src/reports/RGenerator.py
lsoumille/file-analyzer
cabc7fb8b8727b35b6359cbcceb089f31228e1ef
[ "Apache-2.0" ]
null
null
null
src/reports/RGenerator.py
lsoumille/file-analyzer
cabc7fb8b8727b35b6359cbcceb089f31228e1ef
[ "Apache-2.0" ]
null
null
null
from src.reports.ComprehensiveReport import ComprehensiveReport from src.reports.MediumReport import MediumReport from src.reports.ShortReport import ShortReport class RGenerator: @staticmethod def getShortReport(): return ShortReport() @staticmethod def getMediumReport(): return MediumReport() @staticmethod def getComprehensiveReport(): return ComprehensiveReport()
19.318182
63
0.741176
35
425
9
0.428571
0.066667
0.133333
0
0
0
0
0
0
0
0
0
0.2
425
21
64
20.238095
0.926471
0
0
0.230769
0
0
0
0
0
0
0
0
0
1
0.230769
true
0
0.230769
0.230769
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
0
0
0
1
1
0
0
1
1
0
0
4
9e17a8abb792cedb840e5c1766c6e7da832457a6
146
py
Python
refurbot/domain/commands.py
zmoog/refurbot
1fde9fa92841c5a8b65e256aee7589c9680e968d
[ "MIT" ]
null
null
null
refurbot/domain/commands.py
zmoog/refurbot
1fde9fa92841c5a8b65e256aee7589c9680e968d
[ "MIT" ]
null
null
null
refurbot/domain/commands.py
zmoog/refurbot
1fde9fa92841c5a8b65e256aee7589c9680e968d
[ "MIT" ]
null
null
null
from dataclasses import dataclass @dataclass class Command: pass @dataclass class SearchDeals(Command): country: str product: str
11.230769
33
0.732877
16
146
6.6875
0.6875
0.261682
0
0
0
0
0
0
0
0
0
0
0.212329
146
12
34
12.166667
0.930435
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0
true
0.125
0.125
0
0.625
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
9e22d162697fc012bfe7593eadea54dbd9b37111
405
py
Python
codility-python/lesson4/test_perm_check.py
mforoni/codility
be5005e96612dd7bb33b88bb76a590d28084b032
[ "MIT" ]
null
null
null
codility-python/lesson4/test_perm_check.py
mforoni/codility
be5005e96612dd7bb33b88bb76a590d28084b032
[ "MIT" ]
null
null
null
codility-python/lesson4/test_perm_check.py
mforoni/codility
be5005e96612dd7bb33b88bb76a590d28084b032
[ "MIT" ]
null
null
null
import unittest from lesson4 import perm_check class TestPermCheck(unittest.TestCase): def test_solution(self): self.assertEqual(1, perm_check.solution([4, 1, 3, 2])) self.assertEqual(0, perm_check.solution([4, 1, 3])) self.assertEqual(1, perm_check.solution([1])) self.assertEqual(0, perm_check.solution([2])) self.assertEqual(0, perm_check.solution([0]))
28.928571
62
0.679012
55
405
4.872727
0.345455
0.201493
0.317164
0.223881
0.645522
0.645522
0.253731
0
0
0
0
0.048193
0.180247
405
13
63
31.153846
0.759036
0
0
0
0
0
0
0
0
0
0
0
0.555556
1
0.111111
false
0
0.222222
0
0.444444
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
f557e2be3a0dd3625661e2b81141191b825af797
90
py
Python
application/sources/image_processing/__init__.py
JuiceFV/RamblerTask
1aa57fefcd96059ac63391d6d178ea7cfa49e1d0
[ "MIT" ]
1
2020-03-18T12:29:34.000Z
2020-03-18T12:29:34.000Z
application/sources/image_processing/__init__.py
JuiceFV/RamblerTask
1aa57fefcd96059ac63391d6d178ea7cfa49e1d0
[ "MIT" ]
11
2020-03-06T18:21:17.000Z
2022-03-12T00:34:37.000Z
application/sources/image_processing/__init__.py
JuiceFV/RamblerTask
1aa57fefcd96059ac63391d6d178ea7cfa49e1d0
[ "MIT" ]
null
null
null
"""There is nothing due to I use directly notation 'image_processing.get_image_utl()'. """
45
86
0.755556
14
90
4.642857
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.111111
90
2
87
45
0.8125
0.922222
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
f5aa40d720998486c3c080f1a451a0579bfa36bc
693
py
Python
generator_labeler/ActiveModel/__init__.py
researchuser7/QWAugmenter
eb70fa27ddb4b90d72c2eae6db2ff65086c3fb69
[ "MIT" ]
null
null
null
generator_labeler/ActiveModel/__init__.py
researchuser7/QWAugmenter
eb70fa27ddb4b90d72c2eae6db2ff65086c3fb69
[ "MIT" ]
null
null
null
generator_labeler/ActiveModel/__init__.py
researchuser7/QWAugmenter
eb70fa27ddb4b90d72c2eae6db2ff65086c3fb69
[ "MIT" ]
1
2022-02-28T04:45:16.000Z
2022-02-28T04:45:16.000Z
from generator_labeler.ActiveModel.forest import RandomForestRegressor from generator_labeler.ActiveModel.forest import ExtraTreesRegressor from generator_labeler.ActiveModel.quantile import DecisionTreeQuantileRegressor from generator_labeler.ActiveModel.quantile import ExtraTreeQuantileRegressor from generator_labeler.ActiveModel.quantile import ExtraTreesQuantileRegressor from generator_labeler.ActiveModel.quantile import RandomForestQuantileRegressor __version__ = "0.1.2" __all__ = [ "DecisionTreeQuantileRegressor", "ExtraTreesRegressor", "ExtraTreeQuantileRegressor", "ExtraTreesQuantileRegressor", "RandomForestRegressor", "RandomForestQuantileRegressor"]
43.3125
80
0.858586
53
693
10.962264
0.339623
0.134251
0.20654
0.320138
0.457831
0.457831
0
0
0
0
0
0.004747
0.088023
693
16
81
43.3125
0.914557
0
0
0
0
0
0.224784
0.190202
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
0
0
0
1
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
0
0
0
4
1917b765a13131f30de28051bfb53a4b811ff8c3
457
py
Python
savecode/threeyears/idownclient/spidermanagent/spiderbatchlogintest.py
Octoberr/swm0920
8f05a6b91fc205960edd57f9076facec04f49a1a
[ "Apache-2.0" ]
2
2019-05-19T11:54:26.000Z
2019-05-19T12:03:49.000Z
savecode/threeyears/idownclient/spidermanagent/spiderbatchlogintest.py
Octoberr/swm0920
8f05a6b91fc205960edd57f9076facec04f49a1a
[ "Apache-2.0" ]
1
2020-11-27T07:55:15.000Z
2020-11-27T07:55:15.000Z
savecode/threeyears/idownclient/spidermanagent/spiderbatchlogintest.py
Octoberr/swm0920
8f05a6b91fc205960edd57f9076facec04f49a1a
[ "Apache-2.0" ]
2
2021-09-06T18:06:12.000Z
2021-12-31T07:44:43.000Z
""" 精简代码 账密批量测试 create by judy 2019/01/24 """ from datacontract import Task from idownclient.spidermanagent.spidermanagebase import SpiderManagebase class SpiderBatchLoginTest(SpiderManagebase): def __init__(self): SpiderManagebase.__init__(self) # todo def login_batch_test(self, tsk: Task): # 待处理 # 1、解析账密文件 # 2、批量使用账密测试网站 # 3、生成回馈文件 print("to do") tsk.on_complete(tsk) pass
19.041667
72
0.654267
50
457
5.76
0.76
0.055556
0
0
0
0
0
0
0
0
0
0.032544
0.260394
457
23
73
19.869565
0.819527
0.170678
0
0
0
0
0.013624
0
0
0
0
0.043478
0
1
0.222222
false
0.111111
0.222222
0
0.555556
0.111111
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
1
0
0
1
0
0
4
191dd6a95e41acedf892da3c0ea31a96ea35af9f
1,410
py
Python
mognet/exceptions/result_exceptions.py
IBM/project-mognet
6a10ebe26c9f275334b43e685eb6bc42564c270d
[ "MIT" ]
null
null
null
mognet/exceptions/result_exceptions.py
IBM/project-mognet
6a10ebe26c9f275334b43e685eb6bc42564c270d
[ "MIT" ]
null
null
null
mognet/exceptions/result_exceptions.py
IBM/project-mognet
6a10ebe26c9f275334b43e685eb6bc42564c270d
[ "MIT" ]
null
null
null
from mognet.exceptions.base_exceptions import MognetError from typing import TYPE_CHECKING from uuid import UUID if TYPE_CHECKING: from mognet.model.result import Result class ResultError(MognetError): pass class ResultNotReady(ResultError): pass class ResultFailed(ResultError): def __init__(self, result: "Result") -> None: super().__init__(result) self.result = result def __str__(self) -> str: return f"Result {self.result!r} failed with state {self.result.state!r}" class Revoked(ResultFailed): """Raised when a task is revoked, either by timing out, or manual revoking.""" def __str__(self) -> str: return f"Result {self.result!r} was revoked" class ResultValueLost(ResultError): """ Raised when the value for a result was lost (potentially due to key eviction) """ def __init__(self, result_id: UUID) -> None: super().__init__(result_id) self.result_id = result_id def __str__(self) -> str: return f"Value for result id={self.result_id!r} lost" class ResultLost(ResultError): """ Raised when the result itself was lost (potentially due to key eviction) """ def __init__(self, result_id: UUID) -> None: super().__init__(result_id) self.result_id = result_id def __str__(self) -> str: return f"Result id={self.result_id!r} lost"
23.5
82
0.67234
185
1,410
4.837838
0.308108
0.107263
0.080447
0.058101
0.402235
0.402235
0.402235
0.346369
0.346369
0.346369
0
0
0.226241
1,410
59
83
23.898305
0.820348
0.158156
0
0.4
0
0
0.155731
0.055118
0
0
0
0
0
1
0.233333
false
0.066667
0.133333
0.133333
0.7
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
19a33378a50c897e1455fdb92d392615e0d07132
131
py
Python
backend/src/routes/profile.py
bnidevs/shock
a76e7a74d218e083db1c13b428a7e690e0314062
[ "MIT" ]
null
null
null
backend/src/routes/profile.py
bnidevs/shock
a76e7a74d218e083db1c13b428a7e690e0314062
[ "MIT" ]
null
null
null
backend/src/routes/profile.py
bnidevs/shock
a76e7a74d218e083db1c13b428a7e690e0314062
[ "MIT" ]
null
null
null
from flask import Blueprint profile = Blueprint('profile', __name__) @profile.route("/name") def index(): return "john smith"
18.714286
40
0.717557
16
131
5.625
0.75
0.355556
0
0
0
0
0
0
0
0
0
0
0.145038
131
7
41
18.714286
0.803571
0
0
0
0
0
0.166667
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.6
0.4
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
4
5ffb0db6a6f516bd82821d8ba47ae724f565ef43
5,375
py
Python
src/vardb/datamodel/migration/alembic/versions/0143c6e15141_interpretation_ondelete_rules.py
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
src/vardb/datamodel/migration/alembic/versions/0143c6e15141_interpretation_ondelete_rules.py
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
src/vardb/datamodel/migration/alembic/versions/0143c6e15141_interpretation_ondelete_rules.py
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
"""Interpretation ondelete rules Revision ID: 0143c6e15141 Revises: 61779f00886c Create Date: 2020-08-10 09:57:11.167758 """ # revision identifiers, used by Alembic. revision = "0143c6e15141" down_revision = "61779f00886c" branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): op.drop_constraint( "fk_alleleassessment_analysis_id_analysis", "alleleassessment", type_="foreignkey" ) op.create_foreign_key( op.f("fk_alleleassessment_analysis_id_analysis"), "alleleassessment", "analysis", ["analysis_id"], ["id"], ondelete="SET NULL", ) op.drop_constraint( "fk_alleleinterpretationsnapshot_alleleinterpretation_id_allelei", "alleleinterpretationsnapshot", type_="foreignkey", ) op.create_foreign_key( op.f("fk_alleleinterpretationsnapshot_alleleinterpretation_id_alleleinterpretation"), "alleleinterpretationsnapshot", "alleleinterpretation", ["alleleinterpretation_id"], ["id"], ondelete="CASCADE", ) op.drop_constraint("fk_allelereport_analysis_id_analysis", "allelereport", type_="foreignkey") op.create_foreign_key( op.f("fk_allelereport_analysis_id_analysis"), "allelereport", "analysis", ["analysis_id"], ["id"], ondelete="SET NULL", ) op.drop_constraint( "fk_geneassessment_analysis_id_analysis", "geneassessment", type_="foreignkey" ) op.create_foreign_key( op.f("fk_geneassessment_analysis_id_analysis"), "geneassessment", "analysis", ["analysis_id"], ["id"], ondelete="SET NULL", ) op.drop_constraint( "fk_interpretationlog_alleleinterpretation_id_alleleinterpretati", "interpretationlog", type_="foreignkey", ) op.create_foreign_key( op.f("fk_interpretationlog_alleleinterpretation_id_alleleinterpretation"), "interpretationlog", "alleleinterpretation", ["alleleinterpretation_id"], ["id"], ondelete="CASCADE", ) op.drop_constraint( "fk_interpretationstatehistory_alleleinterpretation_id_alleleint", "interpretationstatehistory", type_="foreignkey", ) op.create_foreign_key( op.f("fk_interpretationstatehistory_alleleinterpretation_id_alleleinterpretation"), "interpretationstatehistory", "alleleinterpretation", ["alleleinterpretation_id"], ["id"], ondelete="CASCADE", ) op.drop_constraint( "fk_referenceassessment_analysis_id_analysis", "referenceassessment", type_="foreignkey" ) op.create_foreign_key( op.f("fk_referenceassessment_analysis_id_analysis"), "referenceassessment", "analysis", ["analysis_id"], ["id"], ondelete="SET NULL", ) def downgrade(): op.drop_constraint( op.f("fk_referenceassessment_analysis_id_analysis"), "referenceassessment", type_="foreignkey", ) op.create_foreign_key( "fk_referenceassessment_analysis_id_analysis", "referenceassessment", "analysis", ["analysis_id"], ["id"], ) op.drop_constraint( op.f("fk_interpretationstatehistory_alleleinterpretation_id_alleleinterpretation"), "interpretationstatehistory", type_="foreignkey", ) op.create_foreign_key( "fk_interpretationstatehistory_alleleinterpretation_id_alleleint", "interpretationstatehistory", "alleleinterpretation", ["alleleinterpretation_id"], ["id"], ) op.drop_constraint( op.f("fk_interpretationlog_alleleinterpretation_id_alleleinterpretation"), "interpretationlog", type_="foreignkey", ) op.create_foreign_key( "fk_interpretationlog_alleleinterpretation_id_alleleinterpretati", "interpretationlog", "alleleinterpretation", ["alleleinterpretation_id"], ["id"], ) op.drop_constraint( op.f("fk_geneassessment_analysis_id_analysis"), "geneassessment", type_="foreignkey" ) op.create_foreign_key( "fk_geneassessment_analysis_id_analysis", "geneassessment", "analysis", ["analysis_id"], ["id"], ) op.drop_constraint( op.f("fk_allelereport_analysis_id_analysis"), "allelereport", type_="foreignkey" ) op.create_foreign_key( "fk_allelereport_analysis_id_analysis", "allelereport", "analysis", ["analysis_id"], ["id"] ) op.drop_constraint( op.f("fk_alleleinterpretationsnapshot_alleleinterpretation_id_alleleinterpretation"), "alleleinterpretationsnapshot", type_="foreignkey", ) op.create_foreign_key( "fk_alleleinterpretationsnapshot_alleleinterpretation_id_allelei", "alleleinterpretationsnapshot", "alleleinterpretation", ["alleleinterpretation_id"], ["id"], ) op.drop_constraint( op.f("fk_alleleassessment_analysis_id_analysis"), "alleleassessment", type_="foreignkey" ) op.create_foreign_key( "fk_alleleassessment_analysis_id_analysis", "alleleassessment", "analysis", ["analysis_id"], ["id"], )
30.196629
99
0.659349
441
5,375
7.61678
0.133787
0.07145
0.08574
0.091694
0.916642
0.916642
0.788925
0.732956
0.572492
0.535874
0
0.014538
0.232186
5,375
177
100
30.367232
0.79937
0.029395
0
0.693252
0
0
0.502784
0.343636
0
0
0
0
0
1
0.01227
false
0
0.01227
0
0.02454
0
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2700f38f7e9e3023e1827cde083ef34cd83341b2
79
py
Python
mPyPl/utils/__init__.py
karolzak/mPyPl
d55a952394f45fc1ff8ccde567c126d213bf4dd4
[ "MIT" ]
64
2018-11-08T11:37:30.000Z
2022-01-24T18:42:46.000Z
mPyPl/utils/__init__.py
karolzak/mPyPl
d55a952394f45fc1ff8ccde567c126d213bf4dd4
[ "MIT" ]
null
null
null
mPyPl/utils/__init__.py
karolzak/mPyPl
d55a952394f45fc1ff8ccde567c126d213bf4dd4
[ "MIT" ]
4
2018-11-08T11:59:01.000Z
2021-03-18T03:03:03.000Z
# mPyPl - Monadic Pipeline Library for Python # http://github.com/shwars/mPyPl
26.333333
45
0.759494
11
79
5.454545
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.126582
79
2
46
39.5
0.869565
0.936709
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
270e3766d9ebeb4871e76eb04914a3ad200a7b51
227
py
Python
Exercicios/ex007.py
laurourbano/Projetos_Python
50e7f4a7ff34158385ea7b635bac95ec8a0363a1
[ "MIT" ]
1
2021-12-28T02:51:34.000Z
2021-12-28T02:51:34.000Z
Exercicios/ex007.py
laurourbano/Projetos_Python
50e7f4a7ff34158385ea7b635bac95ec8a0363a1
[ "MIT" ]
null
null
null
Exercicios/ex007.py
laurourbano/Projetos_Python
50e7f4a7ff34158385ea7b635bac95ec8a0363a1
[ "MIT" ]
null
null
null
n1 = float(input('Digite a primeira nota do aluno: ')) n2 = float(input('Digite a segunda nota do aluno: ')) m = float((n1 + n2)/2) print('\nA média entre 'f'{n1} e 'f'{n2} é 'f'{m:.1f}\n\nObrigado por utilizar este programa!')
56.75
95
0.651982
42
227
3.52381
0.642857
0.135135
0.216216
0.22973
0
0
0
0
0
0
0
0.041451
0.14978
227
4
95
56.75
0.725389
0
0
0
0
0
0.622807
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2720edaad63e104bf3ca77e6f6f593e2bc4dcdf6
5,399
py
Python
goal_address.py
noFloat/CNNexample
6c2ec08580e820ede8cab999e336b50cae1fe68f
[ "MIT" ]
null
null
null
goal_address.py
noFloat/CNNexample
6c2ec08580e820ede8cab999e336b50cae1fe68f
[ "MIT" ]
null
null
null
goal_address.py
noFloat/CNNexample
6c2ec08580e820ede8cab999e336b50cae1fe68f
[ "MIT" ]
null
null
null
import pymysql import configparser import sys import linecache def connectdb(): conf = configparser.ConfigParser() conf.read("./mysql.conf") name = conf.get("mysql", "name") password = conf.get("mysql", "password") dbname = conf.get("mysql", "dbname") db = pymysql.connect(host="127.0.0.1", port=3306, user=name, passwd=password, db=dbname, charset='utf8mb4') #db.set_character_set('utf8mb4') return db def connectdb2(): conf = configparser.ConfigParser() conf.read("../mysql.conf") name = conf.get("mysql", "name") password = conf.get("mysql", "password") dbname = conf.get("mysql", "dbname") db = pymysql.connect(host="127.0.0.1", port=3306, user=name, passwd=password, db=dbname, charset='utf8mb4') return db def insertdb(db,table,line): cursor = db.cursor() # SQL 插入语句 sql = "INSERT INTO "+ table +" (x,y,address_name) VALUES ('"+line.x+"', '"+line.y+"', '"+line.name+"');" try: # 执行sql语句 cursor.execute(sql) db.commit() except ZeroDivisionError as e: print('except:', e) db.rollback() def errDate(db): cursor = db.cursor() sql = "select * from address_all_test where x<1;" try: # 执行sql语句 cursor.execute(sql) results = cursor.fetchall() for row in results: id=row[0] deletedb(db,id) except ZeroDivisionError as e: print('except:', e) db.rollback() def deletedb(db,id): cursor = db.cursor() # SQL 插入语句 sql = "delete from address_all_test where id="+id+";" try: # 执行sql语句 cursor.execute(sql) db.commit() except ZeroDivisionError as e: print('except:', e) db.rollback() class Line(object): def __init__(self, x, y, name): self.x = x self.y = y self.name = name path='shanghai.csv' def is_number(s): try: float(s) return True except ValueError: pass try: import unicodedata unicodedata.numeric(s) return True except (TypeError, ValueError): pass return False def search_data(param,low,max,db): cursor = db.cursor() # SQL 插入语句 sql = "select * from address_ where "+param+">" + low + "and"+ param+"<"+max+";" try: # 执行sql语句 cursor.execute(sql) results = cursor.fetchall() for row in results: id=row[0] deletedb(db,id) except ZeroDivisionError as e: print('except:', e) db.rollback() #模糊判断地名是否存在 def check_goal(name,db): cursor = db.cursor() param = name.replace("'", "") #sql = "select * from address_last where address_name like '%" + param + "%';" sql = "select * from address_last where address_name = '" + param + "';" try: cursor.execute(sql) results = cursor.fetchall() if (len(results) != 0): return True else: return False except ZeroDivisionError as e: print('except:', e) print(results) def search_goal(param,db): cursor = db.cursor() param = param.replace("'","") sql = "select * from address_last where address_name ='" + param + "';" try: cursor.execute(sql) results = cursor.fetchall() if(len(results)!=0): result1 = str(results[0][1]) result2 = str(results[0][2]) sql2="select * from location_14 where x1 < " + result1 + " and x2 > "+result1+" and y1 < "+result2+" and y2 > "+result2+";" cursor.execute(sql2) results2 = cursor.fetchall() try: if(len(results2)!=0): result=(results[0][1],results[0][2],results2[0][0]) return result else: return 0 except ZeroDivisionError as e: print('except:', e) else: return 0 except ZeroDivisionError as e: print('except:', e) print(results) # 文档名字替换 def search_goal2(param, db): cursor = db.cursor() param = param.replace("'", "") sql = "select * from address_last where address_name ='" + param + "';" try: cursor.execute(sql) results = cursor.fetchall() if (len(results) != 0): result1 = str(results[0][1]) result2 = str(results[0][2]) sql2 = "select * from location_14 where x1 < " + result1 + " and x2 > " + result1 + " and y1 < " + result2 + " and y2 > " + result2 + ";" cursor.execute(sql2) results2 = cursor.fetchall() try: if (len(results2) != 0): return results2[0][0] else: return 0 except ZeroDivisionError as e: print('except:', e) else: return 0 except ZeroDivisionError as e: print('except:', e) #判断是不是动词 def check_verbs(name,db): cursor = db.cursor() param = name.replace("'", "") sql = "select * from verbs where content = '" + name + "';" try: cursor.execute(sql) results = cursor.fetchall() if (len(results) != 0): return False else: return True except ZeroDivisionError as e: print('except:', e)
26.336585
154
0.534729
609
5,399
4.694581
0.192118
0.039175
0.087443
0.090941
0.750962
0.727527
0.702343
0.689052
0.689052
0.657922
0
0.025041
0.326912
5,399
204
155
26.465686
0.761695
0.036118
0
0.772152
0
0
0.141371
0
0
0
0
0
0
1
0.075949
false
0.037975
0.031646
0
0.208861
0.075949
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
272f4f3351cc85052aef935863b0076eca11ec73
119
py
Python
1172.py
gabzin/uri
177bdf3f87bacfd924bd031a973b8db877379fe5
[ "MIT" ]
3
2021-09-21T18:50:20.000Z
2021-12-14T13:07:31.000Z
1172.py
gabzin/uri
177bdf3f87bacfd924bd031a973b8db877379fe5
[ "MIT" ]
null
null
null
1172.py
gabzin/uri
177bdf3f87bacfd924bd031a973b8db877379fe5
[ "MIT" ]
null
null
null
x=[] for i in range(10): x.append(int(input())) if x[i]<=0:x[i]=1 for i in range(10):print(f"X[{i}] = {x[i]}")
19.833333
44
0.504202
28
119
2.142857
0.5
0.133333
0.2
0.366667
0.433333
0
0
0
0
0
0
0.061856
0.184874
119
5
45
23.8
0.556701
0
0
0
0
0
0.12605
0
0
0
0
0
0
1
0
false
0
0
0
0
0.2
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2785319f380c87382721a659c272397751299248
54
py
Python
main.py
KesleyK/projeto-redes-unb2020
16abe9fa198c2632ebf07d0fa574164bde89b19f
[ "MIT" ]
1
2020-11-01T00:59:04.000Z
2020-11-01T00:59:04.000Z
main.py
KesleyK/projeto-redes-unb2020
16abe9fa198c2632ebf07d0fa574164bde89b19f
[ "MIT" ]
null
null
null
main.py
KesleyK/projeto-redes-unb2020
16abe9fa198c2632ebf07d0fa574164bde89b19f
[ "MIT" ]
null
null
null
print("Trabalho", "de", "redes", sep="\n", end="!\n")
27
53
0.518519
8
54
3.5
0.875
0
0
0
0
0
0
0
0
0
0
0
0.092593
54
1
54
54
0.571429
0
0
0
0
0
0.37037
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
279dad7cb79c25a66b3c58fb4b92ab1f75306a98
251
py
Python
loginInfo/admin.py
Shamaun-Nabi/Online-Gaming-Shop
817f43e8a7db0805fedc47089894b531251b1131
[ "MIT" ]
3
2021-03-30T17:56:43.000Z
2021-04-10T08:55:07.000Z
loginInfo/admin.py
Shamaun-Nabi/Online-Gaming-Shop-with-Team
817f43e8a7db0805fedc47089894b531251b1131
[ "MIT" ]
2
2021-03-19T16:18:46.000Z
2021-03-20T13:23:13.000Z
loginInfo/admin.py
Shamaun-Nabi/Online-Gaming-Shop
817f43e8a7db0805fedc47089894b531251b1131
[ "MIT" ]
3
2021-03-08T15:57:11.000Z
2021-07-07T17:00:43.000Z
from django.contrib import admin from .models import Customer # Register your models here. class CustomerInfo(admin.ModelAdmin): list_display=['first_name','last_name','email','phone','password',] admin.site.register(Customer,CustomerInfo)
25.1
71
0.76494
31
251
6.096774
0.709677
0
0
0
0
0
0
0
0
0
0
0
0.111554
251
9
72
27.888889
0.847534
0.103586
0
0
0
0
0.165919
0
0
0
0
0
0
1
0
false
0.2
0.4
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
4
27a070f9458e19fc37e57fce14ff69bafb61f024
103
py
Python
src/boilerplate/__main__.py
noelbundick/azure-python-boilerplate
25d5af9fe7df60a09a6dd3893846ffefe4056962
[ "MIT" ]
5
2019-03-03T18:47:49.000Z
2019-11-24T19:32:46.000Z
src/boilerplate/__main__.py
noelbundick/azure-python-boilerplate
25d5af9fe7df60a09a6dd3893846ffefe4056962
[ "MIT" ]
6
2019-03-02T17:19:51.000Z
2019-05-04T19:37:07.000Z
src/boilerplate/__main__.py
noelbundick/azure-python-boilerplate
25d5af9fe7df60a09a6dd3893846ffefe4056962
[ "MIT" ]
1
2019-03-04T02:36:52.000Z
2019-03-04T02:36:52.000Z
""" Boilerplate entrypoint """ from boilerplate.cli import main if __name__ == "__main__": main()
17.166667
32
0.68932
11
103
5.727273
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.174757
103
5
33
20.6
0.741176
0.213592
0
0
0
0
0.109589
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
27aeeefff4f2a2e820ebdb91eef9ff227d387967
187
py
Python
stream/api/utils.py
freejooo/vigilio
d21bf4f9d39e5dcde5d7c21476d8650e914c3c66
[ "MIT" ]
137
2021-03-26T18:19:45.000Z
2022-03-06T07:48:23.000Z
stream/api/utils.py
rrosajp/vigilio
d21bf4f9d39e5dcde5d7c21476d8650e914c3c66
[ "MIT" ]
11
2021-03-28T00:07:00.000Z
2021-05-04T12:54:58.000Z
stream/api/utils.py
rrosajp/vigilio
d21bf4f9d39e5dcde5d7c21476d8650e914c3c66
[ "MIT" ]
16
2021-03-27T23:58:53.000Z
2022-03-20T14:52:13.000Z
from django.urls import reverse def _get_relative_path_to_watch(pk: int = 1) -> str: url: str = reverse("stream:watch", kwargs={"movie_id": pk}) return url.replace(str(pk), "")
26.714286
63
0.679144
29
187
4.172414
0.758621
0
0
0
0
0
0
0
0
0
0
0.006369
0.160428
187
6
64
31.166667
0.764331
0
0
0
0
0
0.106952
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
27fa7491d3fd959464b0b044238ddb018a46d94d
25,034
py
Python
slugdetection/test_Slug_Detection.py
dapolak/acse-9-independent-research-project-dapolak
5ae2cfa7f63c739d419b1362c4aede451ae83eb1
[ "MIT" ]
null
null
null
slugdetection/test_Slug_Detection.py
dapolak/acse-9-independent-research-project-dapolak
5ae2cfa7f63c739d419b1362c4aede451ae83eb1
[ "MIT" ]
null
null
null
slugdetection/test_Slug_Detection.py
dapolak/acse-9-independent-research-project-dapolak
5ae2cfa7f63c739d419b1362c4aede451ae83eb1
[ "MIT" ]
2
2019-08-29T16:14:37.000Z
2019-08-30T08:52:03.000Z
# -*- coding: utf-8 -*- """ Part of slugdetection package @author: Deirdree A Polak github: dapolak """ import numpy as np import pandas as pd from datetime import datetime, timedelta from slugdetection.Slug_Detection import Slug_Detection import unittest class Test_Slug_Detection(unittest.TestCase): """ Unitest class for the Slug Detection class """ def test_create_class(self, spark_data): """ Unit test for class creation Parameters ---------- spark_data : Spark data frame well data frame """ test_class = Slug_Detection(spark_data) assert hasattr(test_class, "well_df"), "Assert well_df attribute is created" assert len(test_class.well_df.head(1)) != 0, \ "well_df attribute not empty" # Pyspark has no clear empty attribute def test_jump(self, spark_data): """ Unit test for jump method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering test_class = Slug_Detection(spark_data) test_class.timeframe(start="12-SEP-16 09:09", end="18-SEP-16 09:09") # known interval that has 3 section of data over 99% choke test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.jump() assert 'count_id' in test_class.pd_df.columns, "Assert new count_id column was created" assert test_class.pd_df['count_id'].nunique() >= 3, \ "For this example, assert that there are three continuous sets of data" def test_clean_short_sub(self, spark_data): """ Unit test for clean_short_sub method Parameters ---------- spark_data : Spark data frame well data frame """ test_class = Slug_Detection(spark_data) test_class.timeframe(start="12-SEP-16 09:09", end="18-SEP-16 09:09") # known interval that has 3 section of data over 99% choke test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.jump() a = len(test_class.pd_df) # Store length of pd_df data frame test_class.clean_short_sub(min_df_size=200) # Apply clean_short_sub method b = len(test_class.pd_df) # Store length of pd_df data frame assert a > b, "For this example, the post clean_short_sub pd_df attribute should be shorter" def test_sub_data(self, spark_data): """ Unit test for clean_short_sub method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering test_class = Slug_Detection(spark_data) test_class.timeframe(start="12-SEP-16 09:09", end="18-SEP-16 09:09") # known interval that has 3 section of data over 99% choke test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.sub_data(min_df_size=200) assert hasattr(test_class, "sub_df_dict"), "New attribute must have been created" a = test_class.pd_df["count_id"].nunique() assert a == len(test_class.sub_df_dict), "Number of unique count ids must be the same as number of data " \ "frames in sub_df_dict dictionary" a = test_class.sub_df_dict[0] # Get first element of the dictionary assert isinstance(a, pd.DataFrame), "sub_df_dict elements are pandas data frames" for f in test_class.features: assert f in a.columns, "data frame must contain all features" def test_slug_check(self, spark_data): """ Unit test for slug_check method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-SEP-16 09:09") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.sub_data() ## Test 1 : Test that slug_check returns right value ## # Create fake dataframe datetime_format = '%d-%b-%y %H:%M' # datetime date format base = datetime.strptime("01-JAN-16 09:09", datetime_format) # Create datetime type timestamp date_list = [[base + timedelta(minutes=x)] for x in range(1000)] # Create list of timestamps x = np.linspace(0, 100 * np.pi, 1000) # Get evenly spaced x array whp_list = (np.sin(x) * 3) + 10 # Create sin wave array (slug-like) fake_df = pd.DataFrame(data=date_list, columns=["ts"], dtype=str) # Create data frame with timestamp fake_df["ts"] = pd.to_datetime(fake_df["ts"]) # Ensure timestamp are datetime type fake_df["WH_P"] = whp_list # Add sine wave as WHP data test_class.sub_df_dict = { 1: fake_df } # Override sub_df_dict attribute with fake data frame slug_idx = pd.Series(whp_list)[whp_list > 12.90].index.tolist() # Create list of slug peaks for fake slugs first = test_class.slug_check(slug_idx, 1) # Get results from slug_check method assert len(first) == 1, "First slug index list should only contain one value in this example" ## Test 2 : Test that slug_check returns right value ## # Create fake data frame datetime_format = '%d-%b-%y %H:%M' # datetime date format base = datetime.strptime("01-JAN-16 09:09", datetime_format) # Create datetime type timestamp date_list = [[base + timedelta(minutes=x)] for x in range(2300)] # Create list of timestamps x = np.linspace(0, 100 * np.pi, 1000) # Get evenly spaced x array whp_list = (np.sin(x) * 3) + 10 # Create sin wave array (slug-like) whp_list = np.append(whp_list, [10 for i in range(300)]) # Add flat flow to simulate normal flow whp_list = np.append(whp_list, (np.sin(x) * 3) + 10) # Add more slugs fake_df = pd.DataFrame(data=date_list, columns=["ts"], dtype=str) # Create data frame with timestamp fake_df["ts"] = pd.to_datetime(fake_df["ts"]) # Ensure timestamp are datetime type fake_df["WH_P"] = whp_list # Add fake whp data slug_idx = pd.Series(whp_list)[whp_list > 12.90].index.tolist() # Create list of slug peaks test_class.sub_df_dict = { 1: fake_df } # Override sub_df_dict attribute with fake data frame first = test_class.slug_check(slug_idx, 1) # Get results from slug_check method assert first, "First slug index list should not be empty" assert len(first) == 2, "First slug index list should only contain two value in this example" assert first[1] == 1305, "In this example, the second first slug of the data set occurs at minutes = 1305" def test_label_slugs(self, spark_data): """ Unit test for label_slugs method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="30-SEP-16 09:09") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() try: f, s = test_class.label_slugs() print("Sub df dict attribute has not been created") raise ValueError except AssertionError: pass test_class.sub_data() # Create sub df dict # create fake data set datetime_format = '%d-%b-%y %H:%M' base = datetime.strptime("01-JAN-16 09:09", datetime_format) date_list = [[base + timedelta(minutes=x)] for x in range(1000)] # Creat time, one minute appart x = np.linspace(0, 100 * np.pi, 1000) whp_list = (np.sin(x) * 3) + 10 # create sin wave fake_df = pd.DataFrame(data=date_list, columns=["ts"], dtype=str) fake_df["ts"] = pd.to_datetime(fake_df["ts"]) fake_df["WH_P"] = whp_list # overide test_class.sub_df_dict = { 1: fake_df, 2: pd.DataFrame(data=[[0, 0], [0, 0]], columns=["ts", "WH_P"]) } # This should create f, s = test_class.label_slugs() assert s, "Assert slug index list is not empty" assert f, "Assert first slug index list not empty" assert len(s[0]) == 49, "In this example, there should be 50 slug peaks" assert len(s) == 2, "In this example, there should be one list of slug peaks" def test_format_data(self, spark_data): """ Unit test for format_data method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-SEP-16 09:09") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() try: f, s = test_class.label_slugs() print("Sub df dict attribute has not been created") raise ValueError except AssertionError: pass test_class.sub_data() # Create sub df dict ## Example 1 ## # create fake data set datetime_format = '%d-%b-%y %H:%M' # datetime date format base = datetime.strptime("01-JAN-16 09:09", datetime_format) # Create datetime type timestamp date_list = [[base + timedelta(minutes=x)] for x in range(2600)] # Create list of timestamps x = np.linspace(0, 100 * np.pi, 1000) # Get evenly spaced x array whp_list = np.array([10 for i in range(300)]) # Create whp list with normal flow behaviour whp_list = np.append(whp_list, (np.sin(x) * 3) + 10) # Add sin wave array (slug-like) whp_list = np.append(whp_list, [10 for i in range(300)]) # Add flat flow to simulate normal flow whp_list = np.append(whp_list, (np.sin(x) * 3) + 10) # Add more slugs fake_df = pd.DataFrame(data=date_list, columns=["ts"], dtype=str) # Create data frame with timestamp fake_df["ts"] = pd.to_datetime(fake_df["ts"]) # Ensure timestamp are datetime type fake_df["WH_P"] = whp_list # Add fake whp data test_class.sub_df_dict = { 1: fake_df, 2: pd.DataFrame(data=[[0, 0], [0, 0]], columns=["ts", "WH_P"]) } f, s = test_class.label_slugs() # Get first slugs indices list test_class.format_data(f) # Format data assert len(test_class.df_list) == 2, \ "For this example, only two first slug with sufficient amount of time prior" assert len(test_class.df_list[0]) == 240, "Created list should be 240" assert len(test_class.df_list[1]) == 240, "Created list should be 240" ## Example 2 ## # Create fake data frame datetime_format = '%d-%b-%y %H:%M' # datetime date format base = datetime.strptime("01-JAN-16 09:09", datetime_format) # Create datetime type timestamp date_list = [[base + timedelta(minutes=x)] for x in range(2300)] # Create list of timestamps x = np.linspace(0, 100 * np.pi, 1000) # Get evenly spaced x array whp_list = (np.sin(x) * 3) + 10 # Create sin wave array (slug-like) whp_list = np.append(whp_list, [10 for i in range(300)]) # Add flat flow to simulate normal flow whp_list = np.append(whp_list, (np.sin(x) * 3) + 10) # Add more slugs fake_df = pd.DataFrame(data=date_list, columns=["ts"], dtype=str) # Create data frame with timestamp fake_df["ts"] = pd.to_datetime(fake_df["ts"]) # Ensure timestamp are datetime type fake_df["WH_P"] = whp_list # Add fake whp data # Override sub_df_dict values test_class.sub_df_dict = { 1: fake_df, 2: pd.DataFrame(data=[[0, 0], [0, 0]], columns=["ts", "WH_P"]) } f, s = test_class.label_slugs() # Get first slugs indices list test_class.format_data(f) # Format data assert len(test_class.df_list) == 1, \ "For this example, only one first slug with sufficient amount of time prior" ## Example 3 ## # Create fake data frame datetime_format = '%d-%b-%y %H:%M' # datetime date format base = datetime.strptime("01-JAN-16 09:09", datetime_format) # Create datetime type timestamp date_list = [[base + timedelta(minutes=x)] for x in range(600)] # Create list of timestamps whp_list = [10 for i in range(600)] # Normal flow fake_df = pd.DataFrame(data=date_list, columns=["ts"], dtype=str) # Create data frame with timestamp fake_df["ts"] = pd.to_datetime(fake_df["ts"]) # Ensure timestamp are datetime type fake_df["WH_P"] = whp_list # Add fake whp data # Override sub_df_dict test_class.sub_df_dict = { 1: fake_df, 2: pd.DataFrame(data=[[0, 0], [0, 0]], columns=["ts", "WH_P"]) } f, s = test_class.label_slugs() # Get first slugs indices list test_class.format_data(f) # Format data assert len(test_class.df_list) == 3, "Based on the example, df_list should equal to 3" test_class.format_data(f, size_list=300) # Format data assert len(test_class.df_list) == 2, "Based on the example, df_list should equal to 2" ## Example 4 ## # Override sub_df_dict test_class.sub_df_dict = { 1: fake_df, 2: fake_df } f, s = test_class.label_slugs() test_class.format_data(f, size_list=30, max_clean_count=15) assert len(test_class.df_list) == 17, "Based on the example, df_list should equal to 17" def test_feature_vector(self, spark_data): """ Unit test for feature_vector method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-SEP-16 09:09") # large data sample test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.sub_data() f, s = test_class.label_slugs() test_class.format_data(f) test_class.feature_vector() # Run method assert len(test_class.df_list) == len(test_class.X), "Same number of feature vectors as data frames" assert len(test_class.X.columns) == 152, "For this example, number of features should be 152" try: test_class.feature_vector(percentage_significance=10) print("percentage_significance must be a decimal/percentage") raise ValueError except AssertionError: pass try: test_class.feature_vector(time_predict=1000) print("time to predict before must be shorter than size list") raise ValueError except AssertionError: pass def test_data_prep(self, spark_data): """ Unit test for data_prep method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps up to data_prep method test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-SEP-16 09:19") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.data_prep() # enough to just test for X, if this has been created, then all other attributes have to assert hasattr(test_class, "X"), "Sub_df_dict has been created " assert len(test_class.df_list) == len(test_class.X), "Same number of feature vectors as data frames" assert len(test_class.X.columns) == 152, "For this example, number of features should be 152" def test_split_data(self, spark_data): """ Unit test for split_data method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps up to split_data method test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-OCT-16 09:10") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.data_prep() test_class.split_data() # assert variables exist assert hasattr(test_class, 'X_train'), "X_train attribute data frame should have been created" assert hasattr(test_class, 'X_test'), "X_test attribute data frame should have been created" assert hasattr(test_class, 'y_train'), "y_train attribute data frame should have been created" assert hasattr(test_class, 'y_test'), "y_test attribute data frame should have been created" # assert not empty assert not test_class.X_train.empty, "X_train attribute must not be empty" assert not test_class.X_test.empty, "X_test attribute must not be empty" assert test_class.y_train.size != 0, "y_train attribute must not be empty" assert test_class.y_test.size != 0, "y_test attribute must not be empty" # assert dimensions assert test_class.y_test.ndim == 1, "y_test attribute must be 1-D (pandas series)" assert test_class.y_train.ndim == 1, "y_train attribute must be 1-D (pandas series)" assert len(test_class.X_test.columns) == len(test_class.X.columns), "X_test attribute must same size as X" assert len(test_class.X_train.columns) == len(test_class.X.columns), "X_train attribute must same size as X" # Test test_size parameter try: test_class.split_data(test_size = 6) print("test_size must be less than 1") raise ValueError except AssertionError: pass def test_RF_train(self, spark_data): """ Unit test for RF_train method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps up to RF_train method test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-OCT-16 09:10") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.data_prep() test_class.split_data() # Test method pred_features = test_class.RF_train() assert hasattr(test_class, 'rf') # check if correct format assert len(pred_features) == len(test_class.X.columns), \ "There must be as many features as in the original X attribute" def test_feature_selection(self, spark_data): """ Unit test for feature_selection method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps test_class = Slug_Detection(spark_data) test_class.timeframe(start="30-SEP-16 01:09", end="18-OCT-16 09:09") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.data_prep() # need to create X # Create example list of features scores feature_scores = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 1, 1, 0.1, 0.1] feature_scores.extend((152 - len(feature_scores)) * [0]) # equivalent feature names features_names = ['mean_WH_P_0', 'std_WH_P_0', 'mean_DH_P_0', 'std_DH_P_0', 'mean_WH_T_0', 'std_WH_T_0', 'mean_DH_T_0', 'mean_WH_P_1', 'std_WH_P_1', 'mean_DH_P_1', 'std_DH_P_1', 'mean_WH_T_1', 'std_WH_T_1', 'mean_DH_T_1'] assert len(test_class.feature_selection(feature_scores)) == 15, "It must be top_n sized, here 15" assert test_class.feature_selection(feature_scores) == ['std_WH_P_1', 'mean_WH_P_1', 'std_DH_T_0', 'mean_DH_T_0', 'std_WH_T_0', 'mean_WH_T_0', 'std_DH_P_0', 'mean_DH_P_0', 'std_WH_P_0', 'mean_WH_P_0', 'mean_DH_P_1', 'std_DH_P_1', 'mean_WH_T_1', 'std_WH_T_1', 'mean_DH_T_1'], \ "In this example, the following list og feature names is expected" assert test_class.feature_selection(feature_scores, top_n=3) == ['std_WH_P_1', 'mean_WH_P_1', 'std_DH_T_0'], \ "In this example, the following list og feature names is expected" def test_RF_predict(self, spark_data): """ Unit test for RF_predict method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-OCT-16 09:09") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.data_prep() test_class.RF_train() p, s, cm = test_class.RF_predict() assert len(p) == len(test_class.y_test), "Prediction list must be same size as y_test attribute" assert len(test_class.RF_predict(true_label=True)) == 3, "In this example, three objects must be returned" assert len(test_class.RF_predict(true_label=False)) == len(p), "In this example, only predictions are returned" def test_LogReg_train(self, spark_data): """ Unit test for LogReg_train method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-OCT-16 09:09") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.data_prep() test_class.LogReg_train() assert hasattr(test_class, 'log'), "log attribute must have been created" pred_features = test_class.RF_train() top_features = test_class.feature_selection(pred_features) test_class.LogReg_train(top_features=top_features) assert hasattr(test_class, 'logreg_features'), "For this example, logreg_features must have been created" def test_LogReg_pred(self, spark_data): """ Unit test for LogReg_pred method Parameters ---------- spark_data : Spark data frame well data frame """ # Standard Data Engineering steps test_class = Slug_Detection(spark_data) test_class.timeframe(start="18-SEP-16 01:09", end="18-OCT-16 09:09") # example interval test_class.data_range(verbose=False) test_class.clean_choke(method="99") sd_df = test_class.df_toPandas() test_class.data_prep() test_class.LogReg_train() pred, prob, s, cm = test_class.LogReg_pred() assert len(pred) == len(test_class.y_test), "Prediction list must be same size as y_test attribute" assert len(test_class.LogReg_pred(true_label=True)) == 4, "In this example, four objects must be returned" assert len(test_class.LogReg_pred(true_label=False)) == 2, "In this example, two objects must be returned" pred_features = test_class.RF_train() top_features = test_class.feature_selection(pred_features) test_class.LogReg_train(top_features=top_features) pred, prob, s, cm = test_class.LogReg_pred() assert len(test_class.X_test.columns) == len(top_features), "Top features selection must have been performed"
41.723333
119
0.619398
3,535
25,034
4.174257
0.085997
0.110396
0.024397
0.024397
0.803741
0.771889
0.737531
0.682028
0.656546
0.630726
0
0.033973
0.27922
25,034
600
120
41.723333
0.783806
0.205081
0
0.635258
0
0
0.208968
0.001216
0
0
0
0
0.18541
1
0.045593
false
0.015198
0.015198
0
0.06383
0.015198
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
7e0625345591c1ab2f834dc514a321eb3676bcba
318
py
Python
hedp/tests/test_matdb.py
luli/hedp
ab78879106ef2d7b6e54ac6a69d24439ec8c9a8b
[ "CECILL-B" ]
9
2015-04-07T12:45:40.000Z
2020-10-26T14:40:49.000Z
hedp/tests/test_matdb.py
luli/hedp
ab78879106ef2d7b6e54ac6a69d24439ec8c9a8b
[ "CECILL-B" ]
9
2015-10-20T13:01:09.000Z
2016-09-09T15:24:36.000Z
hedp/tests/test_matdb.py
luli/hedp
ab78879106ef2d7b6e54ac6a69d24439ec8c9a8b
[ "CECILL-B" ]
12
2015-12-17T14:24:29.000Z
2021-04-26T13:42:48.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import hedp def test_matdb_database(): """ Check that we can parse the database """ hedp.load_material_database()
19.875
48
0.764151
42
318
5.238095
0.666667
0.181818
0.290909
0
0
0
0
0
0
0
0
0.003717
0.154088
318
15
49
21.2
0.814126
0.238994
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
true
0
0.714286
0
0.857143
0.142857
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
fd7147dfbc6f415bee9b701fcf9e5e633aa7c0c6
546
py
Python
episode-4-long-multiplication/multiplication_test.py
nickelcarbide/arbitrary-precision-arithmetic-demo
7f9576ff7401c0d638553e7e7412e275569d6fd9
[ "Unlicense" ]
null
null
null
episode-4-long-multiplication/multiplication_test.py
nickelcarbide/arbitrary-precision-arithmetic-demo
7f9576ff7401c0d638553e7e7412e275569d6fd9
[ "Unlicense" ]
null
null
null
episode-4-long-multiplication/multiplication_test.py
nickelcarbide/arbitrary-precision-arithmetic-demo
7f9576ff7401c0d638553e7e7412e275569d6fd9
[ "Unlicense" ]
null
null
null
from biguint import BigUInt x = BigUInt() x.from_py_int(25) y = BigUInt() y.from_py_int(25) z = x.long_multiply(y) print("x =", x) print("y =", y) print("x * y =", z) print() x = BigUInt() x.from_py_int(12_341_234) y = BigUInt() y.from_py_int(2_000_000_000) z = x.long_multiply(y) print("x =", x) print("y =", y) print("x * y =", z) print() x = BigUInt() x.from_py_int(3_141_592) y = BigUInt() y.from_py_int(61_092_399_581_409_512) z = x.long_multiply(y) print("x =", x) print("y =", y) print("x * y =", z)
16.058824
38
0.59707
105
546
2.847619
0.247619
0.160535
0.180602
0.130435
0.765886
0.765886
0.525084
0.525084
0.525084
0.525084
0
0.105747
0.203297
546
33
39
16.545455
0.581609
0
0
0.740741
0
0
0.076023
0
0
0
0
0
0
1
0
false
0
0.037037
0
0.037037
0.407407
0
0
0
null
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
fd90d2dbd876a62a8ff5a92a853cab7cdfd75b17
80
py
Python
python/sina/cli/__init__.py
LLNL/Sina
f3e9bb3a122cfae2a9fd82c3c5613cff939d3aa1
[ "MIT" ]
5
2019-06-28T22:52:19.000Z
2021-09-03T04:28:24.000Z
python/sina/cli/__init__.py
LLNL/Sina
f3e9bb3a122cfae2a9fd82c3c5613cff939d3aa1
[ "MIT" ]
2
2019-07-03T11:40:38.000Z
2020-10-28T17:26:50.000Z
python/sina/cli/__init__.py
LLNL/Sina
f3e9bb3a122cfae2a9fd82c3c5613cff939d3aa1
[ "MIT" ]
1
2019-06-28T22:52:25.000Z
2019-06-28T22:52:25.000Z
"""Logic supporting optional command line utilities, such as Record diffing."""
40
79
0.775
10
80
6.2
1
0
0
0
0
0
0
0
0
0
0
0
0.125
80
1
80
80
0.885714
0.9125
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
fd93fcc2ac86747f4e1acd911f3d9a7338052d74
188
py
Python
src/tt_properties/tt_properties/objects.py
Alacrate/the-tale
43b211f3a99e93964e95abc20a8ed649a205ffcf
[ "BSD-3-Clause" ]
85
2017-11-21T12:22:02.000Z
2022-03-27T23:07:17.000Z
src/tt_properties/tt_properties/objects.py
Alacrate/the-tale
43b211f3a99e93964e95abc20a8ed649a205ffcf
[ "BSD-3-Clause" ]
545
2017-11-04T14:15:04.000Z
2022-03-27T14:19:27.000Z
src/tt_properties/tt_properties/objects.py
Alacrate/the-tale
43b211f3a99e93964e95abc20a8ed649a205ffcf
[ "BSD-3-Clause" ]
45
2017-11-11T12:36:30.000Z
2022-02-25T06:10:44.000Z
import dataclasses from .relations import MODE @dataclasses.dataclass class Property: object_id: int type: int value: str mode: MODE = dataclasses.field(compare=False)
14.461538
49
0.723404
23
188
5.869565
0.73913
0.222222
0
0
0
0
0
0
0
0
0
0
0.207447
188
12
50
15.666667
0.90604
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.25
0
0.875
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4